/* 中文 Live 发现 — black-gold visual + micro-interactions */

:root {
  --bg: #0B0B0C;
  --bg-elevated: #121214;
  --surface: #161618;
  --surface-hover: #1C1C1F;
  --border: #2A2A2E;
  --border-gold: #3D3420;
  --border-gold-strong: #C9A227;
  --text: #F3F0E7;
  --text-secondary: #A39E90;
  --text-tertiary: #6F6A5E;
  --gold: #D4AF37;
  --gold-bright: #F0D78C;
  --gold-dim: #8A7340;
  --accent: #D4AF37;
  --accent-pressed: #B8932A;
  --accent-text: #0B0B0C;
  --chip-bg: #1C1C1F;
  --chip-border: #2A2A2E;
  --chip-active-bg: #D4AF37;
  --chip-active-text: #0B0B0C;
  --overlay: rgba(0, 0, 0, 0.64);
  --focus-ring: #F0D78C;
  --status-live: #FF4D6A;
  --status-recent: #E0B84A;
  --status-unknown: #6F6A5E;
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --max: 720px;
  --pad: 16px;
  --radius-card: 12px;
  --radius-btn: 8px;
  --radius-drawer: 16px;
  --gap-card: 8px;
  --chip-h: 32px;
  --btn-h: 36px;
  --dot: 8px;
  --drawer-w: 400px;
  --ease-color: 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-motion: 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-drawer: 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-overlay: 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 22px;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
}

body.drawer-open {
  overflow: hidden;
}

a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--ease-color);
}

a:hover {
  color: var(--gold-bright);
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* —— Layout —— */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad) 48px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* —— Sticky top bar —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  margin: 0 calc(-1 * var(--pad));
  padding: 0 var(--pad);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  gap: 12px;
}

.site-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
}

.site-name:hover {
  color: var(--gold-bright);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 4px;
  height: 100%;
  align-items: stretch;
}

.nav a {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 15px;
  line-height: 22px;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--ease-color), border-color var(--ease-color);
}

.nav a:hover {
  color: var(--gold-bright);
  text-decoration: none;
}

.nav a[aria-current="page"] {
  font-weight: 600;
  color: var(--text);
  border-bottom-color: var(--gold);
}

/* —— Page header —— */
.page-header {
  padding: 24px 0 12px;
}

.page-header h1 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 30px;
  font-weight: 600;
  color: var(--text);
}

.lead {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--text-secondary);
}

.disclaimer {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 12px;
  line-height: 18px;
  color: var(--text-tertiary);
}

/* —— Filters —— */
.filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  height: var(--chip-h);
  padding: 0 12px;
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background var(--ease-color),
    color var(--ease-color),
    border-color var(--ease-color);
}

.chip:hover {
  border-color: var(--gold-dim);
  color: var(--text);
}

.chip:active {
  border-color: var(--gold-bright);
}

.chip[aria-pressed="true"] {
  background: var(--chip-active-bg);
  color: var(--chip-active-text);
  border-color: var(--chip-active-bg);
}

.chip[aria-pressed="true"]:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  color: var(--accent-text);
}

/* —— Search —— */
.search-wrap {
  margin: 0 0 12px;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--surface);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  transition: border-color var(--ease-color), box-shadow var(--ease-color);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-input:focus {
  border-color: var(--gold-dim);
  outline: none;
  box-shadow: 0 0 0 2px rgba(240, 215, 140, 0.22);
}

/* —— List meta —— */
.list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 18px;
  color: var(--text-tertiary);
}

.list-meta strong {
  font-weight: 500;
  color: var(--text-secondary);
}

/* —— Cards —— */
.card-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap-card);
  list-style: none;
  margin: 0;
  padding: 0;
}

.card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-card);
  min-height: 64px;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
  position: relative;
  transition:
    background var(--ease-color),
    border-color var(--ease-color),
    transform var(--ease-motion);
}

.card:hover {
  background: var(--surface-hover);
  border-color: var(--gold-dim);
  transform: translateY(-1px);
}

.card:active {
  background: var(--bg);
  transform: none;
}

.card-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.card-main:active {
  opacity: 0.92;
}

.avatar {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: #f3f0e7;
  line-height: 1;
  border: 1px solid rgba(212, 175, 55, 0.18);
}

.card-body {
  flex: 1 1 auto;
  min-width: 0;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.display-name {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.badge-demo {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  line-height: 1;
}

.card-meta {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-secondary);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 8px;
}

.topic-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.status-dot {
  width: var(--dot);
  height: var(--dot);
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.live {
  background: var(--status-live);
  animation: pulse-live 1.6s ease-in-out infinite;
}

.status-dot.recent {
  background: var(--status-recent);
}

.status-dot.unknown {
  background: transparent;
  border: 1.5px solid var(--status-unknown);
}

@keyframes pulse-live {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* List enter (filter re-render) */
.card-list > li,
.dir-list > li {
  animation: list-enter var(--ease-motion) both;
}

.card-list > li:nth-child(1),
.dir-list > li:nth-child(1) {
  animation-delay: 0ms;
}
.card-list > li:nth-child(2),
.dir-list > li:nth-child(2) {
  animation-delay: 30ms;
}
.card-list > li:nth-child(3),
.dir-list > li:nth-child(3) {
  animation-delay: 60ms;
}
.card-list > li:nth-child(4),
.dir-list > li:nth-child(4) {
  animation-delay: 90ms;
}
.card-list > li:nth-child(5),
.dir-list > li:nth-child(5) {
  animation-delay: 120ms;
}
.card-list > li:nth-child(6),
.dir-list > li:nth-child(6) {
  animation-delay: 150ms;
}
.card-list > li:nth-child(7),
.dir-list > li:nth-child(7) {
  animation-delay: 180ms;
}
.card-list > li:nth-child(8),
.dir-list > li:nth-child(8) {
  animation-delay: 210ms;
}
.card-list > li:nth-child(n + 9),
.dir-list > li:nth-child(n + 9) {
  animation-delay: 210ms;
}

@keyframes list-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-open-x {
  flex: 0 0 auto;
  height: var(--btn-h);
  padding: 0 12px;
  border: 1px solid var(--gold);
  border-radius: var(--radius-btn);
  background: var(--gold);
  color: var(--accent-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-top: 2px;
  transition:
    background var(--ease-color),
    border-color var(--ease-color),
    color var(--ease-color),
    transform var(--ease-color);
}

.btn-open-x:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  color: var(--accent-text);
  text-decoration: none;
}

.btn-open-x:active {
  background: var(--accent-pressed);
  border-color: var(--accent-pressed);
  color: var(--accent-text);
  transform: scale(0.98);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-btn);
  background: var(--gold);
  color: var(--accent-text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--ease-color),
    transform var(--ease-color);
}

.btn-primary:hover {
  background: var(--gold-bright);
  text-decoration: none;
  color: var(--accent-text);
}

.btn-primary:active {
  background: var(--accent-pressed);
  transform: scale(0.98);
  color: var(--accent-text);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--btn-h);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition:
    color var(--ease-color),
    border-color var(--ease-color),
    background var(--ease-color);
}

.btn-ghost:hover {
  color: var(--gold-bright);
  border-color: var(--gold-dim);
  background: var(--chip-bg);
  text-decoration: none;
}

/* Clear filters as gold text CTA */
#clear-filters,
.empty .btn-ghost {
  border: none;
  background: transparent;
  color: var(--gold);
  padding: 0 4px;
  height: auto;
}

#clear-filters:hover,
.empty .btn-ghost:hover {
  color: var(--gold-bright);
  background: transparent;
  border: none;
}

/* —— Compact directory rows —— */
.dir-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.dir-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
  min-height: 64px;
  transition: background var(--ease-color);
}

.dir-row:last-child {
  border-bottom: none;
}

.dir-row:hover {
  background: var(--surface-hover);
}

.dir-row:active {
  background: var(--bg);
}

.dir-row-main {
  flex: 1;
  min-width: 0;
}

.dir-row .display-name {
  font-size: 15px;
  line-height: 22px;
}

.chevron {
  flex: 0 0 auto;
  color: var(--text-tertiary);
  font-size: 18px;
  line-height: 1;
}

/* —— Empty state —— */
.empty {
  text-align: center;
  padding: 40px 16px;
  background: var(--surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-card);
  animation: list-enter var(--ease-overlay) both;
}

.empty h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: var(--text);
}

.empty p {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.empty[hidden],
[hidden] {
  display: none !important;
}

/* —— About —— */
.about-section {
  margin: 0 0 24px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-card);
}

.about-section h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: var(--text);
}

.about-section p {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--text-secondary);
}

.about-section p + p {
  margin-top: 8px;
}

.about-backlinks {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 22px;
  color: var(--text-secondary);
}

.about-backlinks a {
  color: var(--gold);
}

.about-backlinks a:hover {
  color: var(--gold-bright);
}

/* —— Footer —— */
.site-footer {
  margin-top: auto;
  padding: 24px 0 8px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 18px;
  color: var(--text-tertiary);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.site-footer a {
  color: var(--text-secondary);
  font-weight: 500;
}

.site-footer a:hover {
  color: var(--gold-bright);
}

/* —— Drawer / sheet —— */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--ease-overlay), visibility var(--ease-overlay);
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  z-index: 60;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  max-height: min(88dvh, 640px);
  transform: translateY(100%);
  transition: transform var(--ease-drawer);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
  /* mobile: bottom sheet */
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius-drawer) var(--radius-drawer) 0 0;
  border-top: 1px solid rgba(201, 162, 39, 0.35);
}

.drawer.is-open {
  transform: translateY(0);
}

.drawer-handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
}

.drawer-handle span {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-dim), var(--border-gold-strong), var(--gold-dim));
  opacity: 0.85;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px 12px;
}

.drawer-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--chip-bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease-color), border-color var(--ease-color), color var(--ease-color);
}

.drawer-close:hover {
  background: var(--surface-hover);
  border-color: var(--gold-dim);
  color: var(--gold-bright);
}

.drawer-profile {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.drawer-profile .avatar {
  width: 48px;
  height: 48px;
  font-size: 18px;
  border-radius: 10px;
}

.drawer-content {
  padding: 0 16px 16px;
  overflow-y: auto;
  flex: 1;
}

.drawer-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.field-label {
  font-size: 12px;
  line-height: 18px;
  color: var(--text-tertiary);
  margin: 0 0 4px;
}

.field-value {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--text);
}

.status-note {
  font-size: 12px;
  line-height: 18px;
  color: var(--text-tertiary);
  margin: 4px 0 0;
}

.drawer-actions {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
  .drawer {
    left: auto;
    right: 0;
    top: 0;
    bottom: 0;
    width: var(--drawer-w);
    max-height: none;
    height: 100%;
    border-radius: 0;
    border-top: none;
    border-left: 1px solid rgba(201, 162, 39, 0.35);
    transform: translateX(100%);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45);
  }

  .drawer.is-open {
    transform: translateX(0);
  }

  .drawer-handle {
    display: none;
  }

  .drawer-header {
    padding-top: 20px;
  }
}

/* —— Reduced motion —— */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .status-dot.live {
    animation: none;
    opacity: 1;
  }

  .card:hover,
  .card:active,
  .btn-open-x:active,
  .btn-primary:active {
    transform: none;
  }

  .card-list > li,
  .dir-list > li,
  .empty {
    animation: none;
  }

  .overlay,
  .drawer {
    transition: none;
  }
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
