
:root {
  /* Raw light / dark palette tokens (keeps #1E54D8 brand primary) */
  --brand-light: #1E54D8;
  --brand-dark: #3B82F6;
  --brand-active-light: #1642B5;
  --brand-active-dark: #60A5FA;
  --brand-tint-light: #EFF6FF;
  --brand-tint-dark: rgba(59, 130, 246, 0.16);
  --brand-border-light: rgba(30, 84, 216, 0.24);
  --brand-border-dark: rgba(96, 165, 250, 0.34);
  --logo-bg-start-light: #2563EB;
  --logo-bg-start-dark: #3B82F6;
  --logo-bg-end-light: #1E54D8;
  --logo-bg-end-dark: #2563EB;
  --logo-flap-light: #BFDBFE;
  --logo-flap-dark: #93C5FD;
  --logo-ink-light: #1E54D8;
  --logo-ink-dark: #1D4ED8;

  --canvas-light: #F8FAFC;
  --canvas-dark: #0B1120;
  --surface-light: #FFFFFF;
  --surface-dark: #111827;
  --surface-subtle-light: #F8FAFC;
  --surface-subtle-dark: #1A2333;
  --surface-muted-light: #F1F5F9;
  --surface-muted-dark: #1E293B;
  --topbar-bg-light: rgba(255, 255, 255, 0.88);
  --topbar-bg-dark: rgba(11, 17, 32, 0.86);

  --border-light: #E2E8F0;
  --border-dark: #1E293B;
  --border-subtle-light: #F1F5F9;
  --border-subtle-dark: rgba(148, 163, 184, 0.14);

  --text-title-light: #0F172A;
  --text-title-dark: #F1F5F9;
  --text-body-light: #334155;
  --text-body-dark: #CBD5E1;
  --text-meta-light: #64748B;
  --text-meta-dark: #94A3B8;

  --pill-inv-bg-light: #0F172A;
  --pill-inv-bg-dark: #F1F5F9;
  --pill-inv-text-light: #FFFFFF;
  --pill-inv-text-dark: #0F172A;

  --success-light: #047857;
  --success-dark: #34D399;
  --success-tint-light: #ECFDF5;
  --success-tint-dark: rgba(16, 185, 129, 0.14);
  --success-border-light: rgba(16, 185, 129, 0.25);
  --success-border-dark: rgba(52, 211, 153, 0.28);

  --danger-light: #B91C1C;
  --danger-dark: #F87171;
  --danger-tint-light: #FEF2F2;
  --danger-tint-dark: rgba(239, 68, 68, 0.14);

  --shadow-soft-light: 0 2px 10px -2px rgba(15, 23, 42, 0.04), 0 4px 20px -4px rgba(15, 23, 42, 0.03);
  --shadow-soft-dark: 0 2px 12px -2px rgba(2, 6, 23, 0.45), 0 4px 24px -4px rgba(2, 6, 23, 0.35);
  --shadow-search-light: 0 4px 24px -4px rgba(30, 84, 216, 0.09), 0 2px 8px -2px rgba(15, 23, 42, 0.04);
  --shadow-search-dark: 0 6px 28px -4px rgba(2, 6, 23, 0.65), 0 2px 10px -2px rgba(59, 130, 246, 0.14);

  --scrollbar-track-light: #F1F5F9;
  --scrollbar-track-dark: #0F172A;
  --scrollbar-thumb-light: #94A3B8;
  --scrollbar-thumb-dark: #475569;

  /* Default resolved light tokens */
  --brand: var(--brand-light);
  --brand-active: var(--brand-active-light);
  --brand-tint: var(--brand-tint-light);
  --brand-border: var(--brand-border-light);
  --logo-bg-start: var(--logo-bg-start-light);
  --logo-bg-end: var(--logo-bg-end-light);
  --logo-flap: var(--logo-flap-light);
  --logo-ink: var(--logo-ink-light);
  --canvas: var(--canvas-light);
  --surface: var(--surface-light);
  --surface-subtle: var(--surface-subtle-light);
  --surface-muted: var(--surface-muted-light);
  --topbar-bg: var(--topbar-bg-light);
  --border: var(--border-light);
  --border-subtle: var(--border-subtle-light);
  --text-title: var(--text-title-light);
  --text-body: var(--text-body-light);
  --text-meta: var(--text-meta-light);
  --pill-inv-bg: var(--pill-inv-bg-light);
  --pill-inv-text: var(--pill-inv-text-light);
  --success: var(--success-light);
  --success-tint: var(--success-tint-light);
  --success-border: var(--success-border-light);
  --danger: var(--danger-light);
  --danger-tint: var(--danger-tint-light);
  --shadow-soft: var(--shadow-soft-light);
  --shadow-search: var(--shadow-search-light);
  --scrollbar-track: var(--scrollbar-track-light);
  --scrollbar-thumb: var(--scrollbar-thumb-light);

  /* Drive badge light tokens */
  --drive-quark-bg: #F5F3FF;
  --drive-quark-fg: #6D28D9;
  --drive-quark-bd: rgba(139, 92, 246, 0.26);
  --drive-quark-dot: #8B5CF6;

  --drive-baidu-bg: #EFF6FF;
  --drive-baidu-fg: #1D4ED8;
  --drive-baidu-bd: rgba(59, 130, 246, 0.26);
  --drive-baidu-dot: #2563EB;

  --drive-ali-bg: #EEF2FF;
  --drive-ali-fg: #4338CA;
  --drive-ali-bd: rgba(99, 102, 241, 0.26);
  --drive-ali-dot: #6366F1;

  --drive-xunlei-bg: #F0F9FF;
  --drive-xunlei-fg: #0369A1;
  --drive-xunlei-bd: rgba(14, 165, 233, 0.26);
  --drive-xunlei-dot: #0EA5E9;

  --drive-uc-bg: #FFF7ED;
  --drive-uc-fg: #C2410C;
  --drive-uc-bd: rgba(249, 115, 22, 0.26);
  --drive-uc-dot: #F97316;

  --drive-115-bg: #ECFEFF;
  --drive-115-fg: #0E7490;
  --drive-115-bd: rgba(6, 182, 212, 0.26);
  --drive-115-dot: #06B6D4;

  --drive-123-bg: #F0FDFA;
  --drive-123-fg: #0F766E;
  --drive-123-bd: rgba(20, 184, 166, 0.26);
  --drive-123-dot: #14B8A6;

  --drive-tianyi-bg: #FFF1F2;
  --drive-tianyi-fg: #BE123C;
  --drive-tianyi-bd: rgba(244, 63, 94, 0.26);
  --drive-tianyi-dot: #F43F5E;

  --drive-mobile-bg: #ECFDF5;
  --drive-mobile-fg: #047857;
  --drive-mobile-bd: rgba(16, 185, 129, 0.26);
  --drive-mobile-dot: #10B981;

  --font-sans: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  color-scheme: light dark;
  accent-color: var(--brand);
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Reflect explicit <meta name="color-scheme"> override back into CSS color-scheme */
:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  color-scheme: dark;
  --brand: var(--brand-dark);
  --brand-active: var(--brand-active-dark);
  --brand-tint: var(--brand-tint-dark);
  --brand-border: var(--brand-border-dark);
  --logo-bg-start: var(--logo-bg-start-dark);
  --logo-bg-end: var(--logo-bg-end-dark);
  --logo-flap: var(--logo-flap-dark);
  --logo-ink: var(--logo-ink-dark);
  --canvas: var(--canvas-dark);
  --surface: var(--surface-dark);
  --surface-subtle: var(--surface-subtle-dark);
  --surface-muted: var(--surface-muted-dark);
  --topbar-bg: var(--topbar-bg-dark);
  --border: var(--border-dark);
  --border-subtle: var(--border-subtle-dark);
  --text-title: var(--text-title-dark);
  --text-body: var(--text-body-dark);
  --text-meta: var(--text-meta-dark);
  --pill-inv-bg: var(--pill-inv-bg-dark);
  --pill-inv-text: var(--pill-inv-text-dark);
  --success: var(--success-dark);
  --success-tint: var(--success-tint-dark);
  --success-border: var(--success-border-dark);
  --danger: var(--danger-dark);
  --danger-tint: var(--danger-tint-dark);
  --shadow-soft: var(--shadow-soft-dark);
  --shadow-search: var(--shadow-search-dark);
  --scrollbar-track: var(--scrollbar-track-dark);
  --scrollbar-thumb: var(--scrollbar-thumb-dark);

  --drive-quark-bg: rgba(139, 92, 246, 0.16);
  --drive-quark-fg: #C4B5FD;
  --drive-quark-bd: rgba(167, 139, 250, 0.30);

  --drive-baidu-bg: rgba(59, 130, 246, 0.16);
  --drive-baidu-fg: #93C5FD;
  --drive-baidu-bd: rgba(96, 165, 250, 0.30);

  --drive-ali-bg: rgba(99, 102, 241, 0.16);
  --drive-ali-fg: #A5B4FC;
  --drive-ali-bd: rgba(129, 140, 248, 0.30);

  --drive-xunlei-bg: rgba(14, 165, 233, 0.16);
  --drive-xunlei-fg: #7DD3FC;
  --drive-xunlei-bd: rgba(56, 189, 248, 0.30);

  --drive-uc-bg: rgba(249, 115, 22, 0.16);
  --drive-uc-fg: #FDBA74;
  --drive-uc-bd: rgba(251, 146, 60, 0.30);

  --drive-115-bg: rgba(6, 182, 212, 0.16);
  --drive-115-fg: #67E8F9;
  --drive-115-bd: rgba(34, 211, 238, 0.30);

  --drive-123-bg: rgba(20, 184, 166, 0.16);
  --drive-123-fg: #5EEAD4;
  --drive-123-bd: rgba(45, 212, 191, 0.30);

  --drive-tianyi-bg: rgba(244, 63, 94, 0.16);
  --drive-tianyi-fg: #FDA4AF;
  --drive-tianyi-bd: rgba(251, 113, 133, 0.30);

  --drive-mobile-bg: rgba(16, 185, 129, 0.16);
  --drive-mobile-fg: #6EE7B7;
  --drive-mobile-bd: rgba(52, 211, 153, 0.30);
}

:root:has(> head > meta[name="color-scheme"][content="light"]) {
  color-scheme: light;
}

/* System preference fallback when <meta name="color-scheme"> is "light dark" */
@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) {
    --brand: var(--brand-dark);
    --brand-active: var(--brand-active-dark);
    --brand-tint: var(--brand-tint-dark);
    --brand-border: var(--brand-border-dark);
    --logo-bg-start: var(--logo-bg-start-dark);
    --logo-bg-end: var(--logo-bg-end-dark);
    --logo-flap: var(--logo-flap-dark);
    --logo-ink: var(--logo-ink-dark);
    --canvas: var(--canvas-dark);
    --surface: var(--surface-dark);
    --surface-subtle: var(--surface-subtle-dark);
    --surface-muted: var(--surface-muted-dark);
    --topbar-bg: var(--topbar-bg-dark);
    --border: var(--border-dark);
    --border-subtle: var(--border-subtle-dark);
    --text-title: var(--text-title-dark);
    --text-body: var(--text-body-dark);
    --text-meta: var(--text-meta-dark);
    --pill-inv-bg: var(--pill-inv-bg-dark);
    --pill-inv-text: var(--pill-inv-text-dark);
    --success: var(--success-dark);
    --success-tint: var(--success-tint-dark);
    --success-border: var(--success-border-dark);
    --danger: var(--danger-dark);
    --danger-tint: var(--danger-tint-dark);
    --shadow-soft: var(--shadow-soft-dark);
    --shadow-search: var(--shadow-search-dark);
    --scrollbar-track: var(--scrollbar-track-dark);
    --scrollbar-thumb: var(--scrollbar-thumb-dark);

    --drive-quark-bg: rgba(139, 92, 246, 0.16);
    --drive-quark-fg: #C4B5FD;
    --drive-quark-bd: rgba(167, 139, 250, 0.30);

    --drive-baidu-bg: rgba(59, 130, 246, 0.16);
    --drive-baidu-fg: #93C5FD;
    --drive-baidu-bd: rgba(96, 165, 250, 0.30);

    --drive-ali-bg: rgba(99, 102, 241, 0.16);
    --drive-ali-fg: #A5B4FC;
    --drive-ali-bd: rgba(129, 140, 248, 0.30);

    --drive-xunlei-bg: rgba(14, 165, 233, 0.16);
    --drive-xunlei-fg: #7DD3FC;
    --drive-xunlei-bd: rgba(56, 189, 248, 0.30);

    --drive-uc-bg: rgba(249, 115, 22, 0.16);
    --drive-uc-fg: #FDBA74;
    --drive-uc-bd: rgba(251, 146, 60, 0.30);

    --drive-115-bg: rgba(6, 182, 212, 0.16);
    --drive-115-fg: #67E8F9;
    --drive-115-bd: rgba(34, 211, 238, 0.30);

    --drive-123-bg: rgba(20, 184, 166, 0.16);
    --drive-123-fg: #5EEAD4;
    --drive-123-bd: rgba(45, 212, 191, 0.30);

    --drive-tianyi-bg: rgba(244, 63, 94, 0.16);
    --drive-tianyi-fg: #FDA4AF;
    --drive-tianyi-bd: rgba(251, 113, 133, 0.30);

    --drive-mobile-bg: rgba(16, 185, 129, 0.16);
    --drive-mobile-fg: #6EE7B7;
    --drive-mobile-bd: rgba(52, 211, 153, 0.30);
  }
}

/* Modern CSS light-dark() automatic adaptation */
@supports (color: light-dark(white, black)) {
  :root {
    --brand: light-dark(var(--brand-light), var(--brand-dark));
    --brand-active: light-dark(var(--brand-active-light), var(--brand-active-dark));
    --brand-tint: light-dark(var(--brand-tint-light), var(--brand-tint-dark));
    --brand-border: light-dark(var(--brand-border-light), var(--brand-border-dark));
    --logo-bg-start: light-dark(var(--logo-bg-start-light), var(--logo-bg-start-dark));
    --logo-bg-end: light-dark(var(--logo-bg-end-light), var(--logo-bg-end-dark));
    --logo-flap: light-dark(var(--logo-flap-light), var(--logo-flap-dark));
    --logo-ink: light-dark(var(--logo-ink-light), var(--logo-ink-dark));
    --canvas: light-dark(var(--canvas-light), var(--canvas-dark));
    --surface: light-dark(var(--surface-light), var(--surface-dark));
    --surface-subtle: light-dark(var(--surface-subtle-light), var(--surface-subtle-dark));
    --surface-muted: light-dark(var(--surface-muted-light), var(--surface-muted-dark));
    --topbar-bg: light-dark(var(--topbar-bg-light), var(--topbar-bg-dark));
    --border: light-dark(var(--border-light), var(--border-dark));
    --border-subtle: light-dark(var(--border-subtle-light), var(--border-subtle-dark));
    --text-title: light-dark(var(--text-title-light), var(--text-title-dark));
    --text-body: light-dark(var(--text-body-light), var(--text-body-dark));
    --text-meta: light-dark(var(--text-meta-light), var(--text-meta-dark));
    --pill-inv-bg: light-dark(var(--pill-inv-bg-light), var(--pill-inv-bg-dark));
    --pill-inv-text: light-dark(var(--pill-inv-text-light), var(--pill-inv-text-dark));
    --success: light-dark(var(--success-light), var(--success-dark));
    --success-tint: light-dark(var(--success-tint-light), var(--success-tint-dark));
    --success-border: light-dark(var(--success-border-light), var(--success-border-dark));
    --danger: light-dark(var(--danger-light), var(--danger-dark));
    --danger-tint: light-dark(var(--danger-tint-light), var(--danger-tint-dark));
    --scrollbar-track: light-dark(var(--scrollbar-track-light), var(--scrollbar-track-dark));
    --scrollbar-thumb: light-dark(var(--scrollbar-thumb-light), var(--scrollbar-thumb-dark));
  }
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0em;
  color: var(--text-body);
  background: var(--canvas);
}

main {
  flex: 1 0 auto;
}

::selection {
  background: var(--brand-tint);
  color: var(--brand);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-style: normal;
  color: var(--text-title);
  text-wrap: balance;
}

h1 {
  font-size: 2rem;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.0625rem;
  line-height: 1.32;
  letter-spacing: -0.01em;
}

p, li {
  text-wrap: pretty;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-active);
}

.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;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.container {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ==================== Sticky TopBar (64px) ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-title);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: transparent;
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(30, 84, 216, 0.22);
}

.brand-logo-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-logo-flap {
  fill: var(--logo-flap);
}

.brand-logo-ink {
  fill: var(--logo-ink);
}

.brand-name {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-title);
}

.brand-tag {
  display: none;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text-meta);
  font-size: 0.6875rem;
  font-weight: 500;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.footer-inner .nav-actions {
  flex-wrap: wrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.4375rem;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-sans);
  color: var(--text-body);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 140ms ease, background 140ms ease;
}

.topbar .nav-link svg {
  display: none;
}

.nav-link:hover {
  color: var(--text-title);
  background: var(--surface-muted);
}

.nav-divider {
  display: none;
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 0.25rem;
}

.nav-login-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.3125rem 0.5625rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-title);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.nav-login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.nav-login-btn:hover {
  background: var(--surface-subtle);
  border-color: var(--text-meta);
  color: var(--text-title);
}

.nav-user {
  color: var(--text-meta);
  font-size: 0.75rem;
  font-weight: 400;
  padding: 0 0.25rem;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Two-State Theme Toggle (CSS-driven icon visibility, zero FOUC) */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-body);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.theme-toggle-btn:hover {
  background: var(--surface-muted);
  color: var(--text-title);
}

.theme-icon-sun,
.theme-label-to-light {
  display: none;
}

.theme-icon-moon,
.theme-label-to-dark {
  display: inline;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-icon-sun,
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-label-to-light {
  display: inline;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-icon-moon,
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-label-to-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-icon-sun,
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-label-to-light {
    display: inline;
  }
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-icon-moon,
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-label-to-dark {
    display: none;
  }
}

/* ==================== Hero Section ==================== */
.hero-section {
  padding: 3.5rem 0 3rem;
  background: linear-gradient(180deg, var(--surface-subtle) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 840px;
  margin: 0 auto;
  text-align: center;
}

.hero-subtitle {
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-meta);
}

/* Drive Switcher ABOVE Search Box */
.drive-tabs {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.125rem;
}

.drive-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border: 0;
  background: transparent;
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease;
}

.drive-tab-logo,
.pan-pill-logo,
.pan-tag-logo {
  display: block;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.drive-tab-logo {
  width: 16px;
  height: 16px;
}

.pan-pill-logo,
.pan-tag-logo {
  width: 14px;
  height: 14px;
}

.drive-tab:hover {
  background: var(--surface-muted);
  color: var(--text-title);
}

.drive-tab.is-active {
  background: var(--pill-inv-bg);
  color: var(--pill-inv-text);
}

/* Rounded-2xl Search Box matching panhub.html */
.search-box {
  max-width: 672px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-search);
  padding: 0.375rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-tint), var(--shadow-search);
}

.search-icon-wrap {
  display: inline-flex;
  align-items: center;
  padding: 0 0.5rem 0 0.75rem;
  color: var(--text-meta);
  pointer-events: none;
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-title);
  padding: 0.625rem 0.375rem;
}

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

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--text-meta);
  padding: 0.375rem;
  margin-right: 0.25rem;
  border-radius: 8px;
  cursor: pointer;
}

.search-clear-btn:hover {
  color: var(--text-title);
  background: var(--surface-muted);
}

.search-clear-btn[hidden] {
  display: none;
}

/* Buttons: 1px smaller than adjacent copy */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: 0;
  cursor: pointer;
  background: var(--brand);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.6875rem 1.25rem;
  border-radius: 12px;
  transition: background 140ms ease, transform 80ms ease;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--brand-active);
  color: #FFFFFF;
}

.btn-primary:active {
  transform: scale(0.99);
}

.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
  opacity: 0.58;
  cursor: not-allowed;
}

.btn-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border: 1px solid var(--brand-border);
  cursor: pointer;
  background: var(--brand-tint);
  color: var(--brand);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.4375rem 0.75rem;
  border-radius: 8px;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
  white-space: nowrap;
}

.resource-card:hover .btn-card,
.btn-card:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}

.btn-card:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  padding: 0.5625rem 1rem;
  border-radius: 10px;
  transition: background 140ms ease, border-color 140ms ease;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--surface-subtle);
  border-color: var(--text-meta);
  color: var(--text-title);
}

.btn-ghost-link {
  background: transparent;
  border: 0;
  padding: 0.25rem 0.375rem;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-meta);
  transition: color 140ms ease;
}

.btn-ghost-link:hover {
  color: var(--text-title);
}

/* Hot Search Pills */
.hot-terms {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-meta);
}

.hot-term-link {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  border: 0;
  background: var(--surface-muted);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}

.hot-term-link:hover {
  background: var(--border);
  color: var(--text-title);
}

/* ==================== Sections & Listing Area ==================== */
.section {
  padding: 3rem 0;
}

.listing-section {
  position: relative;
  background: var(--canvas);
  border-bottom: 1px solid var(--border);
}

.search-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  overflow: hidden;
  background: var(--brand-tint);
  pointer-events: none;
  z-index: 2;
}

.search-progress-bar[hidden] {
  display: none;
}

.search-progress-fill {
  display: block;
  width: 38%;
  height: 100%;
  background: var(--brand);
  transform-origin: left center;
  animation: panhub-progress-slide 1.15s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes panhub-progress-slide {
  0% {
    transform: translateX(-110%) scaleX(0.75);
  }
  55% {
    transform: translateX(95%) scaleX(1.15);
  }
  100% {
    transform: translateX(280%) scaleX(0.65);
  }
}

.btn-spinner,
.inline-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  border: 1.75px solid currentColor;
  border-top-color: transparent;
  flex-shrink: 0;
  animation: panhub-spin 0.72s linear infinite;
}

.btn-spinner {
  display: none;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #FFFFFF;
}

.btn-primary.is-loading .btn-spinner {
  display: inline-block;
}

.inline-spinner {
  width: 13px;
  height: 13px;
  border-color: var(--brand-border);
  border-top-color: var(--brand);
}

.inline-spinner[hidden] {
  display: none;
}

@keyframes panhub-spin {
  to {
    transform: rotate(360deg);
  }
}

.search-status-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.search-status-inline .section-sub {
  margin: 0;
}

.section-alt {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.section-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-title-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text-meta);
  font-size: 0.75rem;
  font-weight: 500;
}

.section-sub {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--text-meta);
}

.meta-outside {
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--text-meta);
}

/* Segmented Category Bar */
.cat-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  overflow-x: auto;
  max-width: 100%;
}

.cat-tab {
  border: 0;
  background: transparent;
  color: var(--text-meta);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.cat-tab:hover {
  color: var(--text-title);
}

.cat-tab.is-active {
  background: var(--surface);
  color: var(--text-title);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.filter-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.filter-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.filter-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.filter-chip.is-active {
  background: var(--brand-tint);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 500;
}

/* ==================== Uniform Resource Cards (14px body / 12px meta) ==================== */
.card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.resource-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  font-size: 0.875rem;
  line-height: 1.6;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.resource-card > div {
  min-width: 0;
}

.resource-card:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-search);
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
}

.pan-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid var(--drive-baidu-bd);
  background: var(--drive-baidu-bg);
  color: var(--drive-baidu-fg);
}

.pan-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: var(--drive-baidu-dot);
}

.pan-tag[data-pan="quark"] { background: var(--drive-quark-bg); color: var(--drive-quark-fg); border-color: var(--drive-quark-bd); }
.pan-tag[data-pan="quark"] .pan-dot { background: var(--drive-quark-dot); }
.pan-tag[data-pan="baidu"] { background: var(--drive-baidu-bg); color: var(--drive-baidu-fg); border-color: var(--drive-baidu-bd); }
.pan-tag[data-pan="baidu"] .pan-dot { background: var(--drive-baidu-dot); }
.pan-tag[data-pan="ali"] { background: var(--drive-ali-bg); color: var(--drive-ali-fg); border-color: var(--drive-ali-bd); }
.pan-tag[data-pan="ali"] .pan-dot { background: var(--drive-ali-dot); }
.pan-tag[data-pan="xunlei"] { background: var(--drive-xunlei-bg); color: var(--drive-xunlei-fg); border-color: var(--drive-xunlei-bd); }
.pan-tag[data-pan="xunlei"] .pan-dot { background: var(--drive-xunlei-dot); }
.pan-tag[data-pan="uc"] { background: var(--drive-uc-bg); color: var(--drive-uc-fg); border-color: var(--drive-uc-bd); }
.pan-tag[data-pan="uc"] .pan-dot { background: var(--drive-uc-dot); }
.pan-tag[data-pan="115"] { background: var(--drive-115-bg); color: var(--drive-115-fg); border-color: var(--drive-115-bd); }
.pan-tag[data-pan="115"] .pan-dot { background: var(--drive-115-dot); }
.pan-tag[data-pan="123"] { background: var(--drive-123-bg); color: var(--drive-123-fg); border-color: var(--drive-123-bd); }
.pan-tag[data-pan="123"] .pan-dot { background: var(--drive-123-dot); }
.pan-tag[data-pan="tianyi"] { background: var(--drive-tianyi-bg); color: var(--drive-tianyi-fg); border-color: var(--drive-tianyi-bd); }
.pan-tag[data-pan="tianyi"] .pan-dot { background: var(--drive-tianyi-dot); }
.pan-tag[data-pan="mobile"] { background: var(--drive-mobile-bg); color: var(--drive-mobile-fg); border-color: var(--drive-mobile-bd); }
.pan-tag[data-pan="mobile"] .pan-dot { background: var(--drive-mobile-dot); }

.verified-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 6px;
  background: var(--success-tint);
  border: 1px solid var(--success-border);
  color: var(--success);
  font-size: 0.6875rem;
  font-weight: 500;
}

.card-cat-label {
  font-size: 0.6875rem;
  color: var(--text-meta);
  padding: 0 0.25rem;
}

.card-date {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-meta);
  flex-shrink: 0;
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text-title);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.5rem;
  transition: color 140ms ease;
}

.resource-card:hover .card-title {
  color: var(--brand);
}

.card-summary-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-meta);
  margin-bottom: 1rem;
}

.card-summary-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.card-spec-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-meta);
}

.card-spec-size {
  font-family: var(--font-mono);
  color: var(--text-body);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

/* Inline acquire feedback slot inside card (progressive fallback & quick-view) */
.acquire-slot {
  margin-top: 0.875rem;
}

.acquire-panel {
  padding: 0.875rem;
  background: var(--brand-tint);
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  font-size: 0.875rem;
}

.acquire-notice {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  color: var(--brand);
}

.acquire-link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.acquire-url {
  word-break: break-all;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--brand);
}

.acquire-pwd {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-title);
}

.copy-fallback {
  margin-top: 0.625rem;
  width: 100%;
  min-height: 60px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--text-body);
}

/* ==================== Evergreen Topic Cards (3x2 Grid) ==================== */
.topic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.topic-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  color: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.topic-card:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-soft);
}

.topic-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.875rem;
}

.topic-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease, color 140ms ease;
}

.topic-card:hover .topic-icon-box {
  background: var(--brand-tint);
  color: var(--brand);
}

.topic-badge {
  padding: 0.1875rem 0.625rem;
  border-radius: 9999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-meta);
  font-size: 0.6875rem;
  font-weight: 500;
}

.topic-card h3 {
  font-size: 0.9375rem;
  margin-bottom: 0.375rem;
  transition: color 140ms ease;
}

.topic-card:hover h3 {
  color: var(--brand);
}

.topic-card p {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--text-meta);
}

.topic-card-foot {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-body);
  transition: color 140ms ease;
}

.topic-card:hover .topic-card-foot {
  color: var(--brand);
}

/* ==================== Trust Footer ==================== */
.site-footer {
  background: var(--surface-subtle);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}

.footer-pillars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.footer-pillar {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.pillar-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.pillar-icon.is-blue { background: var(--brand-tint); color: var(--brand); }
.pillar-icon.is-green { background: var(--success-tint); color: var(--success); }
.pillar-icon.is-slate { background: var(--surface-muted); color: var(--text-body); }

.footer-pillar h4 {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-title);
}

.footer-pillar p {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--text-meta);
}

.footer-disclaimer {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.footer-disclaimer-lead {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-title);
}

.footer-disclaimer-body {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-meta);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-meta);
}

/* ==================== Forms & Auth Cards ==================== */
.form-card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  font-size: 0.875rem;
  box-shadow: var(--shadow-soft);
}

.form-card h1, .form-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.field-group {
  margin-bottom: 1.125rem;
}

.field-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-title);
}

.input-control, .select-control, .textarea-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-title);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 400;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.input-control:focus, .select-control:focus, .textarea-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap .input-control {
  padding-right: 2.75rem;
}

.eye-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-meta);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.form-card .btn-primary,
.modal-card .btn-primary {
  font-size: 0.8125rem;
}

.eye-toggle:hover,
.eye-toggle[aria-pressed="true"] {
  color: var(--brand);
  background: var(--brand-tint);
}

.eye-toggle .icon-eye-off {
  display: none;
}

.eye-toggle[aria-pressed="true"] .icon-eye-on {
  display: none;
}

.eye-toggle[aria-pressed="true"] .icon-eye-off {
  display: inline;
}

.tab-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.625rem;
}

.tab-btn {
  border: 0;
  background: transparent;
  color: var(--text-meta);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 400;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
}

.tab-btn.is-active {
  background: var(--brand-tint);
  color: var(--brand);
  font-weight: 500;
}

.status-banner {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.8125rem;
}

.status-banner[hidden] {
  display: none;
}

.admin-pan-offline-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-pan-offline-banner[hidden] {
  display: none;
}

.status-banner.is-info {
  background: var(--brand-tint);
  color: var(--brand);
}

.status-banner.is-success {
  background: var(--success-tint);
  color: var(--success);
}

.status-banner.is-error {
  background: var(--danger-tint);
  color: var(--danger);
}

/* ==================== Native <dialog> Modals ==================== */
dialog.panhub-dialog {
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 520px;
  width: calc(100% - 2rem);
  color: var(--text-body);
}

dialog.panhub-dialog[open] {
  display: block;
}

dialog.panhub-dialog:modal {
  overscroll-behavior: contain;
}

dialog.panhub-dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: 100%;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 48px rgba(2, 6, 23, 0.25);
  overflow: hidden;
  font-size: 0.875rem;
}

.modal-head {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.modal-head h2, .modal-head h3 {
  font-size: 1rem;
  line-height: 1.4;
}

.modal-close-btn {
  border: 0;
  background: transparent;
  color: var(--text-meta);
  padding: 0.375rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  color: var(--text-title);
  background: var(--surface-muted);
}

.modal-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: calc(100dvh - 10rem);
  overflow-y: auto;
}

.pan-cred-guide {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-body);
}

.pan-cred-guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pan-cred-guide-title {
  font-weight: 500;
  color: var(--text-title);
}

.pan-cred-portal-link {
  color: var(--brand);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.8125rem;
}

.pan-cred-portal-link:hover {
  text-decoration: underline;
}

.pan-cred-steps {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pan-cred-steps li {
  padding-left: 0.15rem;
}

.pan-cred-em {
  font-weight: 500;
  color: var(--text-title);
}

.pan-cred-warn {
  margin: 0;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--danger);
  font-size: 0.8125rem;
  font-weight: 500;
}

.modal-status-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 12px;
  background: var(--success-tint);
  border: 1px solid var(--success-border);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 500;
}

.modal-status-box.is-error {
  background: var(--danger-tint);
  border-color: rgba(220, 38, 38, 0.26);
  color: var(--danger);
}

.modal-file-list {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 180px;
  overflow-y: auto;
  font-size: 0.75rem;
}

.modal-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-file-row .preview-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-file-row:last-child {
  border-bottom: 0;
}

.modal-url-box {
  min-width: 0;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.875rem;
}

.modal-url-label {
  font-size: 0.6875rem;
  color: var(--text-meta);
  margin-bottom: 0.25rem;
}

.modal-url-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.modal-url-code {
  min-width: 0;
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.modal-pwd-chip {
  padding: 0.125rem 0.5rem;
  border-radius: 6px;
  background: var(--brand-tint);
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  flex-shrink: 0;
}

.modal-foot {
  padding: 1rem 1.5rem;
  background: var(--surface-subtle);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem;
}

.modal-save-tip {
  padding: 0.5625rem 0.875rem;
  border-radius: 10px;
  background: var(--brand-tint);
  border: 1px solid var(--brand-border);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
}

/* ==================== Grouped-by-Netdisk Listing ==================== */
.search-summary-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.search-summary-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
}

.summary-metric {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-meta);
  font-size: 0.75rem;
  font-weight: 400;
}

.summary-metric strong {
  color: var(--text-title);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.pan-count-pills {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  padding-bottom: 0.125rem;
}

.pan-count-pills[hidden] {
  display: none;
}

.pan-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.pan-count-pill:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.pan-count-pill.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
  font-weight: 500;
}

.pan-count-pills.is-refreshing {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 150ms ease-out;
}

.pan-groups-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: opacity 150ms ease-out;
}

.pan-groups-stack.is-refreshing {
  opacity: 0.48;
  pointer-events: none;
}

.pan-groups-stack[hidden] {
  display: none;
}

.search-skeleton-wrap {
  display: block;
}

.search-skeleton-wrap[hidden] {
  display: none;
}

.skeleton-pills-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.skeleton-block {
  position: relative;
  display: inline-block;
  overflow: hidden;
  background: var(--surface-muted);
  border-radius: 6px;
}

.skeleton-block::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: panhub-shimmer 1.35s ease-in-out infinite;
}

@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .skeleton-block::after {
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
  }
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .skeleton-block::after {
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
}

@keyframes panhub-shimmer {
  to {
    transform: translateX(100%);
  }
}

.skeleton-pill {
  height: 30px;
  border-radius: 9999px;
  flex-shrink: 0;
}

.skeleton-group-card {
  pointer-events: none;
}

.skeleton-row {
  cursor: default;
}

.skeleton-row:hover {
  background: transparent;
}

.sk-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
}

.sk-group-title {
  width: 72px;
  height: 16px;
}

.sk-group-count {
  width: 48px;
  height: 12px;
}

.sk-title {
  display: block;
  height: 16px;
}

.sk-meta-row {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sk-time {
  width: 98px;
  height: 12px;
}

.sk-tag {
  width: 38px;
  height: 16px;
}

.sk-btn {
  width: 64px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
}

.search-stream-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.625rem 1rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-meta);
}

.search-stream-more[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .search-progress-fill {
    width: 100%;
    animation: none;
    opacity: 0.85;
  }
  .btn-spinner,
  .inline-spinner {
    animation-duration: 2.2s;
  }
  .skeleton-block::after {
    animation: none;
    display: none;
  }
}

.pan-group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.pan-group-card[hidden] {
  display: none;
}

.pan-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.pan-group-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.pan-group-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.pan-group-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pan-group-icon .pan-dot {
  width: 10px;
  height: 10px;
}

.pan-group-icon[data-pan="quark"] { background: var(--drive-quark-bg); border-color: var(--drive-quark-bd); }
.pan-group-icon[data-pan="quark"] .pan-dot { background: var(--drive-quark-dot); }
.pan-group-icon[data-pan="baidu"] { background: var(--drive-baidu-bg); border-color: var(--drive-baidu-bd); }
.pan-group-icon[data-pan="baidu"] .pan-dot { background: var(--drive-baidu-dot); }
.pan-group-icon[data-pan="ali"] { background: var(--drive-ali-bg); border-color: var(--drive-ali-bd); }
.pan-group-icon[data-pan="ali"] .pan-dot { background: var(--drive-ali-dot); }
.pan-group-icon[data-pan="xunlei"] { background: var(--drive-xunlei-bg); border-color: var(--drive-xunlei-bd); }
.pan-group-icon[data-pan="xunlei"] .pan-dot { background: var(--drive-xunlei-dot); }
.pan-group-icon[data-pan="uc"] { background: var(--drive-uc-bg); border-color: var(--drive-uc-bd); }
.pan-group-icon[data-pan="uc"] .pan-dot { background: var(--drive-uc-dot); }
.pan-group-icon[data-pan="115"] { background: var(--drive-115-bg); border-color: var(--drive-115-bd); }
.pan-group-icon[data-pan="115"] .pan-dot { background: var(--drive-115-dot); }
.pan-group-icon[data-pan="123"] { background: var(--drive-123-bg); border-color: var(--drive-123-bd); }
.pan-group-icon[data-pan="123"] .pan-dot { background: var(--drive-123-dot); }
.pan-group-icon[data-pan="tianyi"] { background: var(--drive-tianyi-bg); border-color: var(--drive-tianyi-bd); }
.pan-group-icon[data-pan="tianyi"] .pan-dot { background: var(--drive-tianyi-dot); }
.pan-group-icon[data-pan="mobile"] { background: var(--drive-mobile-bg); border-color: var(--drive-mobile-bd); }
.pan-group-icon[data-pan="mobile"] .pan-dot { background: var(--drive-mobile-dot); }

.pan-group-meta {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  min-width: 0;
}

.pan-group-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-title);
}

.pan-group-count {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-meta);
  white-space: nowrap;
}

.pan-group-list {
  display: flex;
  flex-direction: column;
}

.pan-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 140ms ease;
}

.pan-row-item[hidden] {
  display: none;
}

.pan-row-item:last-child {
  border-bottom: 0;
}

.pan-row-item:hover {
  background: var(--surface-subtle);
}

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

.pan-row-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-title);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 140ms ease;
}

.pan-row-item:hover .pan-row-title {
  color: var(--brand);
}

.pan-row-meta {
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pan-row-time {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-meta);
  font-variant-numeric: tabular-nums;
}

.pan-row-actions {
  flex-shrink: 0;
}

.btn-acquire-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 0.4375rem 0.875rem;
  border-radius: 8px;
  border: 1px solid var(--brand-border);
  background: var(--brand-tint);
  color: var(--brand);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.pan-row-item:hover .btn-acquire-row,
.btn-acquire-row:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}

.btn-acquire-row.is-acquired {
  background: var(--success-tint);
  border-color: var(--success-border);
  color: var(--success);
}

.pan-row-item:hover .btn-acquire-row.is-acquired {
  background: var(--success-tint);
  border-color: var(--success-border);
  color: var(--success);
}

.btn-acquire-row:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.pan-group-foot {
  padding: 0.75rem 1.25rem;
  background: var(--surface-subtle);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.pan-group-foot[hidden] {
  display: none;
}

.btn-expand-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4375rem 1.125rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.btn-expand-group:hover {
  background: var(--surface-muted);
  border-color: var(--brand-border);
  color: var(--brand);
}

/* ==================== Toast & Empty State ==================== */
.panhub-toast {
  position: fixed;
  inset: auto;
  top: auto;
  right: auto;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  border: 0;
  overflow: visible;
  max-width: calc(100vw - 2rem);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 12px;
  background: var(--pill-inv-bg);
  color: var(--pill-inv-text);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 10px 25px rgba(2, 6, 23, 0.28);
  pointer-events: none;
}

.panhub-toast::backdrop {
  display: none;
}

.panhub-toast[hidden] {
  display: none;
}

@supports selector(:popover-open) {
  .panhub-toast[popover]:not(:popover-open) {
    display: none;
  }
}

.empty-state {
  padding: 3rem 1.25rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-meta);
  font-size: 0.875rem;
}

.empty-state h3 {
  margin: 0.75rem 0 0.25rem;
  font-size: 1rem;
}

/* Poster Preview */
.poster-wrap {
  margin-top: 1.5rem;
  text-align: center;
}

.poster-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

@media (min-width: 640px) {
  .topbar-inner {
    gap: 1rem;
  }
  .brand-link {
    gap: 0.625rem;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
  }
  .brand-name {
    font-size: 1.125rem;
  }
  .brand-tag {
    display: inline-flex;
  }
  .nav-actions {
    gap: 0.375rem;
  }
  .nav-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
  }
  .topbar .nav-link svg {
    display: inline;
  }
  .nav-login-btn {
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
  }
  .nav-user {
    max-width: 180px;
    font-size: 0.8125rem;
    padding: 0 0.375rem;
  }
  .theme-toggle-btn {
    width: 34px;
    height: 34px;
  }
  .nav-divider {
    display: block;
  }
  .section-head {
    flex-direction: row;
    align-items: center;
  }
  .footer-pillars {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  h1 {
    font-size: 2.375rem;
    line-height: 1.1;
    letter-spacing: -0.035em;
  }

  h2 {
    font-size: 1.375rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
  }

  .hero-section {
    padding: 4.5rem 0 3.75rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .topic-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}


/* ==================== Miaosou-Style WeChat Verification Modal ==================== */
dialog.wechat-gate-dialog {
  max-width: 420px;
}

.wechat-gate-card .wechat-gate-body {
  gap: 0.875rem;
}

.wechat-gate-sub {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-meta);
  text-align: center;
  text-wrap: pretty;
}

.wechat-qr-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 168px;
  padding: 0.75rem;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.wechat-qr-img {
  width: 176px;
  height: 176px;
  object-fit: contain;
  border-radius: 8px;
  background: #ffffff;
  display: block;
}

.wechat-qr-img[hidden],
.wechat-qr-empty[hidden],
.wechat-ad-badge[hidden] {
  display: none;
}

.wechat-qr-empty {
  font-size: 0.8125rem;
  color: var(--text-meta);
  text-align: center;
  line-height: 1.55;
}

.wechat-ad-badge {
  position: absolute;
  top: 0.625rem;
  left: 0.625rem;
  padding: 0.125rem 0.45rem;
  border-radius: 9999px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.2;
}

.wechat-steps {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-body);
}

.wechat-steps strong {
  font-weight: 500;
  color: var(--brand);
}

.wechat-code-input {
  text-align: center;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.25em;
}

.admin-wechat-qr-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.admin-wechat-qr-preview {
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.admin-wechat-endpoints {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
}

.admin-wechat-endpoint-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.admin-pager-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.85rem;
  font-size: 0.8125rem;
  color: var(--text-meta);
}

.admin-pager-btns {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

/* ==================== Search Highlight, Tags, Clustering & Trending Media ==================== */
.search-hl {
  background: var(--brand-tint);
  color: var(--brand);
  padding: 0 0.125rem;
  border-radius: 3px;
  font-weight: 500;
}

.pan-row-meta {
  flex-wrap: wrap;
}

.pan-row-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.0625rem 0.4375rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--text-meta);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.pan-row-tag.is-ok {
  color: var(--success);
  background: var(--success-tint);
  border-color: var(--success-border);
}

.pan-row-tag.is-accent {
  color: var(--brand);
  background: var(--brand-tint);
  border-color: var(--brand-border);
}

.pan-alt-toggle {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-meta);
  border-radius: 9999px;
  padding: 0.0625rem 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.35;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.pan-alt-toggle:hover {
  color: var(--brand);
  border-color: var(--brand-border);
  background: var(--brand-tint);
}

.pan-row-item.is-cluster-alt {
  background: var(--surface-subtle);
  padding-left: 2rem;
}

.trending-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 720px) {
  .trending-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .trending-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.trending-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.9375rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.trending-card:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-soft);
}

.trending-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.trending-card-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  font-style: normal;
  line-height: 1.35;
  color: var(--text-title);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trending-card:hover .trending-card-title {
  color: var(--brand);
}

.trending-stock-pill {
  flex-shrink: 0;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: var(--success-tint);
  border: 1px solid var(--success-border);
  color: var(--success);
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.3;
}

.trending-card-meta {
  font-size: 0.75rem;
  color: var(--text-meta);
  line-height: 1.4;
}

/* ==================== Featured Collections Grid & About Page ==================== */
.seo-lead-note {
  margin: 0.5rem auto 0;
  max-width: 680px;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-meta);
}

.collection-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .collection-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.collection-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  color: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.collection-card:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-soft);
}

.collection-card-title {
  margin: 0 0 0.375rem;
  font-size: 0.9375rem;
  font-weight: 500;
  font-style: normal;
  line-height: 1.38;
  color: var(--text-title);
  transition: color 140ms ease;
}

.collection-card:hover .collection-card-title {
  color: var(--brand);
}

.collection-card-desc {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-meta);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.collection-card-foot {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-body);
  transition: color 140ms ease;
}

.collection-card:hover .collection-card-foot {
  color: var(--brand);
}

.about-pan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 720px) {
  .about-pan-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.about-pan-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.about-pan-item:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-soft);
}

.about-pan-arrow {
  flex-shrink: 0;
  color: var(--text-meta);
  transition: color 140ms ease, transform 140ms ease;
}

.about-pan-item:hover .about-pan-arrow {
  color: var(--brand);
  transform: translateX(2px);
}

.faq-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.faq-item {
  padding: 1.25rem 1.5rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.875rem;
}

.faq-q {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  font-style: normal;
  line-height: 1.35;
  color: var(--text-title);
}

.faq-a {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-body);
}

/* ==================== Breadcrumbs, Hub Callouts & Semantic Spec Tables ==================== */
.breadcrumb-nav {
  margin: 0 auto 0.875rem;
  display: flex;
  justify-content: center;
}

.breadcrumb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-meta);
}

.breadcrumb-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.breadcrumb-list a {
  color: var(--text-meta);
  transition: color 140ms ease-out;
}

.breadcrumb-list a:hover {
  color: var(--brand);
}

.breadcrumb-current {
  font-weight: 500;
  color: var(--text-title);
}

.breadcrumb-sep {
  color: var(--text-meta);
  opacity: 0.55;
  user-select: none;
}

.hub-callout-bar {
  margin-top: 1rem;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.375rem 0.625rem;
  padding: 0.5rem 0.875rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-body);
}

.hub-callout-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--brand);
  transition: color 140ms ease-out;
}

.hub-callout-link:hover {
  text-decoration: underline;
}

.table-scroll-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.seo-spec-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  color: var(--text-body);
}

.seo-spec-table .pan-tag {
  white-space: nowrap;
  flex-shrink: 0;
}

.seo-spec-table td:first-child {
  white-space: nowrap;
}

.seo-spec-table caption {
  text-align: left;
  padding: 0.875rem 1.125rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-style: normal;
  color: var(--text-meta);
  border-bottom: 1px solid var(--border-subtle);
}

.seo-spec-table th {
  text-align: left;
  padding: 0.75rem 1.125rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-style: normal;
  color: var(--text-title);
  background: var(--bg-alt, rgba(148, 163, 184, 0.06));
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.seo-spec-table td {
  padding: 0.75rem 1.125rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-body);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.seo-spec-table tbody tr:last-child td {
  border-bottom: none;
}

.seo-spec-table .table-title-cell {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-title);
}

.seo-spec-table .table-status-valid {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--success, #15803d);
  white-space: nowrap;
}

.seo-spec-table .table-status-public {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-meta);
  white-space: nowrap;
}

.seo-spec-table .table-action-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--brand);
  white-space: nowrap;
  transition: color 140ms ease-out;
}

.seo-spec-table .table-action-link:hover {
  text-decoration: underline;
}

.topics-hub-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .topics-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.topic-hub-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out;
}

.topic-hub-card:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-soft);
}

.topic-hub-title {
  display: inline-block;
  font-size: 1rem;
  font-weight: 500;
  font-style: normal;
  color: var(--text-title);
  transition: color 140ms ease-out;
}

.topic-hub-title:hover {
  color: var(--brand);
}

.topic-hub-desc {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-meta);
}

.topic-hub-spokes {
  margin-top: 0.875rem;
}

.topic-hub-spokes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4375rem;
}

.topic-hub-foot {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.topic-hub-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-body);
  transition: color 140ms ease-out;
}

.topic-hub-link:hover {
  color: var(--brand);
}
