:root {
  color-scheme: light;
  --bg: oklch(98% 0.012 185);
  --surface: oklch(99% 0.006 185);
  --surface-2: oklch(96% 0.024 185);
  --surface-3: oklch(94% 0.034 185);
  --text: oklch(22% 0.025 210);
  --muted: oklch(52% 0.024 210);
  --faint: oklch(66% 0.022 210);
  --line: oklch(88% 0.024 185);
  --primary: oklch(55% 0.135 185);
  --primary-strong: oklch(40% 0.115 190);
  --primary-soft: oklch(94% 0.045 185);
  --accent: oklch(70% 0.160 150);
  --accent-soft: oklch(95% 0.050 150);
  --danger: oklch(56% 0.220 25);
  --danger-soft: oklch(95% 0.050 25);
  --shadow: 0 14px 36px oklch(42% 0.040 190 / 0.10);
  --radius-lg: 20px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 8% 0%, oklch(91% 0.060 185 / 0.58), transparent 28rem),
    radial-gradient(circle at 88% 0%, oklch(91% 0.065 150 / 0.48), transparent 32rem),
    var(--bg);
}
button, input { font: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
.top-stack { display: grid; gap: 14px; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; }
.compact-hero { padding: 4px 2px 2px; }
.brand-lockup { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 54px; height: 54px; flex: 0 0 54px; display: grid; place-items: center; border-radius: 17px; background: linear-gradient(145deg, var(--primary), var(--accent)); box-shadow: 0 14px 30px oklch(42% 0.08 185 / .18); }
.brand-mark svg { width: 34px; height: 34px; fill: none; }
.brand-mark-bg { fill: oklch(99% 0.006 185 / .96); stroke: oklch(99% 0.006 185 / .72); stroke-width: 1.5; }
.brand-mark-play { fill: var(--primary-strong); stroke: none; }
.brand-mark-spark { stroke: var(--primary-strong); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hero-copy { max-width: 760px; }
.eyebrow, .section-kicker { margin: 0 0 6px; color: var(--primary); text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 850; }
h1 { margin: 0; font-size: 46px; line-height: 1; letter-spacing: -0.055em; }
.hero-desc { max-width: 64ch; margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }

.card, .search-panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.search-panel { padding: 14px; }
.search-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.search-form input { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: oklch(99.5% 0.006 185); color: var(--text); padding: 14px 15px; outline: none; transition: border-color .16s ease, box-shadow .16s ease; }
.search-form input::placeholder { color: var(--faint); }
.search-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px oklch(55% 0.12 185 / .14); }
.search-form button { border: 1px solid var(--primary-strong); color: oklch(99% 0.004 185); background: var(--primary-strong); border-radius: 14px; padding: 0 20px; font-weight: 850; box-shadow: 0 8px 16px oklch(40% 0.09 190 / .16); }
.quick-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quick { border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; background: var(--surface-2); color: var(--muted); font-weight: 750; font-size: 13px; transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease; }
.quick:hover { transform: translateY(-1px); background: var(--primary-soft); color: var(--primary-strong); border-color: oklch(76% 0.085 185); }
.search-mode-toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; border: 1px solid oklch(78% 0.085 185); border-radius: 999px; padding: 0 12px; background: var(--accent-soft); color: oklch(34% 0.080 160); font-size: 13px; font-weight: 850; cursor: pointer; user-select: none; }
.search-mode-toggle input { width: 15px; height: 15px; accent-color: var(--primary-strong); }
.search-mode-toggle:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-strong); }
.quick:active, .filter-chip:active, .filter-reset:active, .ghost-action:active, .round-action:active, .copy-btn:active { transform: translateY(0) scale(.98); }
.quick:focus-visible, .filter-chip:focus-visible, .filter-reset:focus-visible, .ghost-action:focus-visible, .round-action:focus-visible, .copy-btn:focus-visible, .resource-tab:focus-visible, .pansou-tab:focus-visible, .resource-link:focus-visible { outline: 3px solid oklch(70% 0.16 185 / .34); outline-offset: 3px; }

.is-hidden { display: none !important; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.section-head h3 { margin: 0; letter-spacing: -0.02em; font-size: 15px; }

.resource-board { padding: 0; overflow: hidden; border-color: var(--line); }
.resource-stats-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 22px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, oklch(98% 0.016 185), oklch(99% 0.018 150)); }
.resource-stats { display: flex; align-items: center; flex-wrap: wrap; gap: clamp(18px, 4vw, 34px); color: oklch(35% 0.050 190); }
.stat-item { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; }
.stat-item strong { color: var(--primary); font-size: 18px; line-height: 1; font-weight: 920; letter-spacing: -0.025em; }
.stat-icon { width: 24px; height: 24px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--primary-strong); background: var(--primary-soft); line-height: 1; }
.stat-icon svg, .action-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.resource-actions-top { display: flex; align-items: center; gap: 12px; }
.ghost-action, .round-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid oklch(78% 0.085 185); background: var(--primary-soft); color: var(--primary-strong); box-shadow: 0 8px 18px oklch(42% 0.08 185 / .10); font-weight: 900; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.ghost-action { min-height: 36px; border-radius: 999px; padding: 0 14px; }
.round-action { width: 36px; height: 36px; border-radius: 999px; }
.ghost-action:hover, .round-action:hover { transform: translateY(-1px); border-color: var(--primary); background: oklch(93% 0.055 185); }
.resource-board-head { padding: 18px 26px 0; margin: 0; }
.resource-board-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.035em; }

.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 14px 26px 4px; background: oklch(99% 0.008 185); }
.filter-group { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.filter-label { color: var(--muted); font-size: 12px; font-weight: 850; margin-right: 2px; white-space: nowrap; }
.filter-chip, .filter-reset { min-height: 30px; border-radius: 999px; font-size: 12px; font-weight: 820; transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease; }
.filter-chip { border: 1px solid var(--line); background: oklch(98% 0.010 185); color: oklch(38% 0.030 210); padding: 0 11px; }
.filter-chip:hover { transform: translateY(-1px); border-color: oklch(76% 0.085 185); color: var(--primary-strong); background: var(--primary-soft); }
.filter-chip.active { color: oklch(99% 0.004 185); background: linear-gradient(135deg, var(--primary-strong), var(--primary)); border-color: var(--primary-strong); box-shadow: 0 8px 18px oklch(42% 0.08 185 / .13); }
.filter-reset { margin-left: auto; border: 1px solid oklch(78% 0.085 185); background: var(--accent-soft); color: oklch(34% 0.080 160); padding: 0 12px; }
.filter-reset:hover { background: oklch(92% 0.065 150); }

.resource-tabs-wrap { margin-top: 10px; border-top: 1px solid oklch(92% 0.020 185); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--primary) transparent; background: oklch(99% 0.008 185); }
.resource-tabs { display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 0; min-width: max-content; padding: 0 26px; }
.resource-tab { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; border: 0; border-radius: 0; padding: 0 26px 0 0; margin-right: 20px; background: transparent; color: oklch(30% 0.035 210); font-weight: 620; font-size: 15px; white-space: nowrap; transition: color .16s ease, transform .16s ease; }
.resource-tab::after { content: ""; position: absolute; left: 0; right: 28px; bottom: 0; height: 2px; border-radius: 999px; background: transparent; }
.resource-tab:hover { color: var(--primary); background: transparent; transform: translateY(-1px); }
.resource-tab.active { color: var(--primary); background: transparent; box-shadow: none; border: 0; }
.resource-tab.active::after { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.resource-tab.is-empty:not(.active) { opacity: .8; }
.tab-count { min-width: auto; height: auto; display: inline; padding: 0; border-radius: 0; background: transparent; color: currentColor; font-size: inherit; font-weight: 680; }
.tab-status { display: inline-flex; align-items: center; margin-left: 2px; border-radius: 999px; padding: 2px 7px; background: var(--primary-soft); color: var(--primary-strong); font-size: 11px; font-weight: 750; }
.tab-status[data-status="loading"] { color: var(--primary); background: oklch(96% 0.050 185); }
.tab-status[data-status="done"] { color: var(--primary-strong); background: var(--primary-soft); }
.tab-status[data-status="empty"] { color: var(--muted); background: var(--surface-2); }
.tab-status[data-status="error"] { color: var(--danger); background: var(--danger-soft); }
.resource-panels { border: 0; border-radius: 0; background: oklch(99.2% 0.006 185); padding: 14px 22px 22px; min-height: 260px; }
.resource-panel { display: none; }
.resource-panel.active { display: block; }
.resource-panel[hidden] { display: none !important; }
.resource-panel > .section-head { display: none; }
.resource-list { display: grid; gap: 0; }
.empty, .loading, .error { color: var(--muted); padding: 16px; border: 1px dashed var(--line); border-radius: var(--radius-md); background: oklch(97% 0.018 185); line-height: 1.55; }
.empty { display: grid; gap: 4px; }
.empty strong { color: var(--text); font-size: 14px; }
.empty span { color: var(--muted); font-size: 13px; }
.loading { color: var(--primary); }
.error { color: oklch(42% 0.18 25); border-color: oklch(78% 0.13 25); background: oklch(95% 0.050 25); }
.resource-item { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(260px, 42%); gap: 18px; align-items: start; padding: 14px 0; border: 0; border-bottom: 1px solid oklch(92% 0.016 185); border-radius: 0; background: transparent; transition: background .16s ease, transform .16s ease; }
.resource-item:hover { transform: translateX(2px); background: oklch(97% 0.024 185); box-shadow: none; }
.resource-main { min-width: 0; }
.resource-aside { display: grid; justify-items: end; gap: 7px; min-width: 0; color: var(--muted); font-size: 14px; }
.resource-label { position: relative; padding-left: 16px; color: var(--text); font-weight: 650; font-size: 15px; line-height: 1.45; margin-bottom: 3px; word-break: break-word; }
.resource-label::before { content: "\25A7"; position: absolute; left: 0; top: .12em; color: var(--primary); font-size: 12px; }
.resource-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 100%; margin: 0; }
.resource-chip { border-radius: 6px; padding: 3px 8px; background: var(--primary-soft); border: 1px solid oklch(78% 0.090 185); color: var(--primary-strong); font-size: 12px; font-weight: 650; }
.resource-meta { color: var(--muted); font-size: 12px; line-height: 1.45; margin: 0; text-align: right; }
.resource-link { position: relative; display: block; width: fit-content; max-width: 100%; color: var(--primary); font-family: inherit; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; line-height: 1.45; background: transparent; border-radius: 8px; padding: 1px 6px 1px 16px; border: 0; transition: color .16s ease, background .16s ease, box-shadow .16s ease; }
.resource-link:not(.is-static) { cursor: pointer; }
.resource-link:not(.is-static)::after { content: ""; position: absolute; left: 16px; right: 6px; bottom: 1px; height: 1px; background: currentColor; opacity: .18; transform: scaleX(.36); transform-origin: left center; transition: opacity .16s ease, transform .16s ease; }
.resource-link:not(.is-static):hover { color: var(--primary-strong); background: var(--primary-soft); box-shadow: 0 6px 14px oklch(42% 0.08 185 / .08); }
.resource-link:not(.is-static):hover::after { opacity: .52; transform: scaleX(1); }
.resource-link.is-static { cursor: default; }
.resource-password { display: inline-flex; width: fit-content; margin-top: 0; color: var(--primary-strong); background: transparent; border: 0; border-radius: 0; padding: 0; font-size: 14px; font-weight: 650; }
.resource-note { color: oklch(36% 0.10 150); background: var(--accent-soft); border: 1px solid oklch(84% 0.085 150); border-radius: 10px; padding: 8px 10px; font-size: 12px; line-height: 1.45; margin: 8px 0 0 20px; }
.pansou-summary { display: flex; flex-wrap: nowrap; gap: 0; margin: -2px 0 10px; overflow-x: auto; padding: 0; border-bottom: 1px solid oklch(93% 0.014 185); }
.pansou-tab { position: relative; display: inline-flex; align-items: center; gap: 4px; min-height: 38px; margin-right: 18px; padding: 0 2px; border: 0; border-radius: 0; background: transparent; color: oklch(32% 0.035 210); font-size: 14px; font-weight: 610; white-space: nowrap; transition: color .16s ease, transform .16s ease; }
.pansou-tab span { color: currentColor; }
.pansou-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: transparent; border-radius: 999px; }
.pansou-tab:hover, .pansou-tab.active { color: var(--primary); }
.pansou-tab:hover { transform: translateY(-1px); }
.pansou-tab.active::after { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.resource-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 0; align-items: center; justify-content: flex-end; }
.copy-btn { padding: 7px 10px; font-size: 12px; border-radius: 8px; border: 1px solid var(--primary-strong); color: oklch(99% 0.004 185); background: var(--primary-strong); box-shadow: none; font-weight: 800; transition: transform .16s ease, filter .16s ease, box-shadow .16s ease, background .16s ease; }
.copy-btn.open-link { color: var(--primary-strong); background: oklch(98% 0.014 185); border-color: oklch(74% 0.080 185); }
.copy-btn:hover { transform: translateY(-1px); filter: brightness(.96); box-shadow: 0 8px 16px oklch(42% 0.08 185 / .12); }
.load-more-row { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 18px 0 4px; color: var(--muted); font-size: 13px; }
.load-more-btn { min-height: 38px; border: 1px solid oklch(74% 0.080 185); border-radius: 999px; padding: 0 16px; background: var(--primary-soft); color: var(--primary-strong); font-size: 13px; font-weight: 900; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.load-more-btn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--primary); background: oklch(92% 0.055 185); }
.load-more-btn:disabled { cursor: progress; opacity: .65; }
.badge { font-size: 11px; border-radius: 999px; padding: 5px 8px; border: 1px solid var(--line); font-weight: 850; letter-spacing: .02em; }
.badge.red, .badge.green, .badge.blue, .badge.violet, .badge.cyan { color: var(--primary-strong); background: var(--primary-soft); border-color: oklch(78% 0.090 185); }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--primary-strong); color: oklch(98% 0.006 185); padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 850; }

@media (max-width: 820px) {
  .hero { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 40px; }
  .brand-mark { width: 48px; height: 48px; flex-basis: 48px; border-radius: 15px; }
  .resource-tabs { justify-content: flex-start; }
}
@media (max-width: 640px) {
  body {
    background:
      radial-gradient(circle at 0% 0%, oklch(91% 0.060 185 / 0.44), transparent 20rem),
      var(--bg);
  }
  .top-stack {
    gap: 10px;
  }
  .search-panel {
    position: sticky;
    top: 8px;
    z-index: 20;
    padding: 10px;
    border-radius: 18px;
    box-shadow: 0 16px 30px oklch(42% 0.040 190 / 0.16);
  }
  .hero-desc {
    font-size: 14px;
    line-height: 1.5;
  }
  .quick-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .quick {
    flex: 0 0 auto;
  }
  .search-mode-toggle {
    flex: 0 0 auto;
    margin-left: 0;
  }
  .resource-stats-bar {
    align-items: flex-start;
    flex-direction: column;
    padding: 13px 14px;
    gap: 10px;
  }
  .resource-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 10px;
  }
  .stat-item {
    align-items: flex-start;
    white-space: normal;
    font-size: 12px;
  }
  .resource-actions-top {
    width: 100%;
    justify-content: space-between;
  }
  .resource-board-head {
    padding: 14px 14px 0;
  }
  .filter-bar { padding: 12px 14px 4px; gap: 8px; }
  .filter-group { width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .filter-chip {
    flex: 0 0 auto;
  }
  .filter-reset { margin-left: 0; }
  .resource-tabs-wrap {
    margin-top: 8px;
  }
  .resource-tabs {
    padding: 0 14px;
  }
  .resource-tab {
    min-height: 44px;
    margin-right: 14px;
    padding-right: 14px;
    font-size: 14px;
  }
  .tab-status {
    padding: 2px 6px;
    font-size: 10px;
  }
  .resource-panels {
    padding: 10px 12px 16px;
  }
  .resource-item { grid-template-columns: 1fr; gap: 10px; }
  .resource-item {
    padding: 12px 0;
  }
  .resource-item:hover {
    transform: none;
  }
  .resource-label {
    display: -webkit-box;
    margin-bottom: 6px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 14px;
    line-height: 1.5;
  }
  .resource-link {
    max-width: calc(100vw - 54px);
    font-size: 13px;
  }
  .resource-aside { justify-items: start; gap: 8px; }
  .resource-tags, .resource-actions { justify-content: flex-start; }
  .resource-tags {
    gap: 5px;
  }
  .resource-chip {
    padding: 3px 7px;
    font-size: 11px;
  }
  .resource-meta, .resource-password {
    font-size: 12px;
    text-align: left;
  }
  .resource-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }
  .copy-btn {
    min-height: 40px;
    width: 100%;
    text-align: center;
    border-radius: 12px;
    font-size: 13px;
  }
  .load-more-row {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding-top: 14px;
    text-align: center;
  }
  .load-more-btn {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
  }
  .empty, .loading, .error {
    padding: 14px;
  }
  .app-shell { width: min(100% - 18px, 1180px); padding-top: 18px; }
  .search-form { grid-template-columns: 1fr; }
  .search-form button { padding: 13px; }
}
