/* ==========================================================================
   WorkBuddy 项目档案 · 样式
   设计基调：Minimalism / Swiss Style — 中性灰底、链接蓝、大留白、清晰层级
   ========================================================================== */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e8eef5;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #1e293b;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 36px rgba(15, 23, 42, .10);

  --cat-web: #2563eb;
  --cat-embedded: #0d9488;
  --cat-game: #9333ea;
  --cat-tool: #c2740a;
  --cat-research: #64748b;
  --status-active: #2563eb;
  --status-done: #059669;
  --status-archived: #64748b;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Inter, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;

  --topbar-h: 66px;
  --sidebar-w: 284px;
}

html[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #151f33;
  --surface-2: #1c2940;
  --surface-3: #24334d;
  --border: #2b3b55;
  --border-strong: #3b4d6b;
  --text: #e8eef8;
  --text-muted: #b4c2d8;
  --text-subtle: #8fa1bb;
  --accent: #6ea8fe;
  --accent-hover: #93c0ff;
  --accent-soft: #1b2c4a;
  --accent-border: #2f4d7d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, .35);

  --cat-web: #7dabff;
  --cat-embedded: #3ecfbe;
  --cat-game: #c084fc;
  --cat-tool: #f0b45e;
  --cat-research: #9aaac2;
  --status-active: #7dabff;
  --status-done: #34d399;
  --status-archived: #9aaac2;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button, input { font: inherit; }
code { font-family: var(--font-mono); font-size: .88em; }

::selection { background: var(--accent-border); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 200;
  padding: 8px 16px; background: var(--accent); color: #fff;
  border-radius: 6px; font-size: 13px; font-weight: 600;
  transition: top .18s ease;
}
.skip-link:focus { top: 12px; color: #fff; }

/* --------------------------------------------------------------- Topbar */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  height: 100%; max-width: 1600px; margin: 0 auto;
  padding: 0 24px; display: flex; align-items: center; gap: 18px;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  min-width: 0; color: var(--text); flex: none;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent);
}
.brand-mark .icon { width: 20px; height: 20px; stroke-width: 1.6; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 15px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand-text small {
  font-size: 11px; color: var(--text-subtle); font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.search-wrap {
  position: relative; margin-left: auto; width: 100%; max-width: 390px; flex: 1 1 300px;
}
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-subtle); pointer-events: none;
}
.search-input {
  width: 100%; height: 38px; padding: 0 74px 0 37px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13.5px; outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.search-input::placeholder { color: var(--text-subtle); }
.search-input:focus {
  background: var(--surface); border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.search-input::-webkit-search-cancel-button { display: none; }
.search-kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-sans); font-size: 10.5px; font-weight: 600;
  color: var(--text-subtle); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 5px;
  padding: 1px 6px; pointer-events: none; letter-spacing: .02em;
}
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: var(--surface-3); color: var(--text-muted);
  width: 22px; height: 22px; border-radius: 5px; cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.search-clear:hover { color: var(--text); }
.search-clear[hidden] { display: none; }
.search-clear .icon { width: 13px; height: 13px; }
.search-wrap.has-value .search-kbd { display: none; }

.icon-btn {
  width: 36px; height: 36px; flex: none; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 8px;
  transition: color .18s, background .18s, border-color .18s;
}
.icon-btn:hover { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-border); }
.menu-btn { display: none; }
.theme-btn .icon-moon { display: none; }
html[data-theme="dark"] .theme-btn .icon-sun { display: none; }
html[data-theme="dark"] .theme-btn .icon-moon { display: block; }

/* --------------------------------------------------------------- Layout */
.app-shell {
  max-width: 1600px; margin: 0 auto;
  display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
}
.sidebar {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto; overscroll-behavior: contain;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.sidebar::-webkit-scrollbar { width: 7px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.side-nav { padding: 22px 14px 8px; flex: 1; }
.side-foot { padding: 16px 20px 22px; border-top: 1px solid var(--border); }
.side-stat { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.side-hint { margin: 8px 0 0; font-size: 11px; line-height: 1.7; color: var(--text-subtle); }
.side-hint code {
  background: var(--surface-2); padding: 1px 4px; border-radius: 3px;
  color: var(--text-muted); font-size: 10.5px;
}

.side-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; margin: 22px 0 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  color: var(--text-subtle); text-transform: uppercase;
}
.side-label:first-child { margin-top: 0; }
.side-label .count { font-weight: 500; letter-spacing: 0; }

.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; margin: 1px 0; border-radius: 7px;
  color: var(--text-muted); font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: background .16s, color .16s;
}
.side-link .icon { width: 16px; height: 16px; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-link .link-count {
  margin-left: auto; font-size: 11px; font-variant-numeric: tabular-nums;
  color: var(--text-subtle); font-weight: 500;
}
.side-link.active .link-count { color: var(--accent); }
.cat-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--c); }

.year-label {
  padding: 0 12px; margin: 16px 0 5px;
  font-size: 11px; font-weight: 700; color: var(--text-subtle);
  font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.doc-item {
  position: relative; display: block; padding: 6px 12px 6px 14px;
  margin: 1px 0; border-radius: 6px;
  color: var(--text-muted); font-size: 13px; line-height: 1.5;
  cursor: pointer; transition: background .16s, color .16s;
}
.doc-item::before {
  content: ""; position: absolute; left: 3px; top: 9px; bottom: 9px;
  width: 2px; border-radius: 2px; background: transparent;
}
.doc-item:hover { background: var(--surface-2); color: var(--text); }
.doc-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.doc-item.active::before { background: var(--accent); }
.doc-item .doc-date {
  display: block; font-size: 10.5px; color: var(--text-subtle);
  font-variant-numeric: tabular-nums; font-weight: 400; margin-top: 1px;
}
.doc-item.active .doc-date { color: var(--accent); opacity: .8; }
.side-empty { padding: 6px 12px; font-size: 12px; color: var(--text-subtle); }

.drawer-backdrop { display: none; }

/* --------------------------------------------------------------- Content */
.content { min-height: calc(100vh - var(--topbar-h)); padding: 0 0 40px; }
.content-inner { width: 100%; max-width: 880px; margin: 0 auto; padding: 42px 52px 24px; }

.site-footer {
  max-width: 880px; margin: 0 auto; padding: 20px 52px 0;
  border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 9px; align-items: center;
  font-size: 11.5px; color: var(--text-subtle);
}
.footer-dot { opacity: .5; }

/* --------------------------------------------------------------- Common */
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  color: var(--accent); text-transform: uppercase;
}
.eyebrow .icon { width: 13px; height: 13px; }

.page-title {
  margin: 12px 0 10px; font-size: 32px; line-height: 1.3;
  letter-spacing: -.025em; font-weight: 750;
}
.page-lead { margin: 0; color: var(--text-muted); font-size: 15.5px; line-height: 1.8; }

.breadcrumb {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-subtle); margin-bottom: 22px;
}
.breadcrumb a { color: var(--text-subtle); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .icon { width: 12px; height: 12px; opacity: .6; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 42px 0 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.section-head .more { font-size: 12px; color: var(--text-subtle); }
.section-head .more a { font-weight: 600; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.7;
  border: 1px solid var(--border); background: var(--surface-2);
  white-space: nowrap;
}
.badge .b-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.status-active   { color: var(--status-active);   background: color-mix(in srgb, var(--status-active) 10%, transparent);   border-color: color-mix(in srgb, var(--status-active) 25%, transparent); }
.badge.status-done     { color: var(--status-done);     background: color-mix(in srgb, var(--status-done) 10%, transparent);     border-color: color-mix(in srgb, var(--status-done) 25%, transparent); }
.badge.status-archived { color: var(--status-archived); background: color-mix(in srgb, var(--status-archived) 12%, transparent); border-color: color-mix(in srgb, var(--status-archived) 25%, transparent); }
.badge.cat { color: var(--c); background: color-mix(in srgb, var(--c) 9%, transparent); border-color: color-mix(in srgb, var(--c) 22%, transparent); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 6px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 11.5px; font-weight: 500;
  transition: color .16s, border-color .16s, background .16s;
}
.chip:hover { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.chip .icon { width: 11px; height: 11px; opacity: .7; }
.chip.plain { cursor: default; }
.chip.plain:hover { color: var(--text-muted); border-color: var(--border); background: var(--surface-2); }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong);
  transition: background .16s, border-color .16s, color .16s, transform .16s;
}
.btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.btn .icon { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

mark { background: #fef08a; color: #422006; border-radius: 2px; padding: 0 1px; }
html[data-theme="dark"] mark { background: #6b5a13; color: #fef9c3; }

/* --------------------------------------------------------------- Overview */
.hero {
  position: relative; overflow: hidden;
  padding: 34px 36px 32px; margin-bottom: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-sm);
}
.hero::after {
  content: ""; position: absolute; right: -70px; top: -95px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 11%, transparent) 0%, transparent 68%);
  pointer-events: none;
}
.hero::before {
  content: ""; position: absolute; right: 46px; bottom: -78px;
  width: 180px; height: 180px; border: 1px solid var(--border);
  border-radius: 42px; transform: rotate(24deg); opacity: .65; pointer-events: none;
}
.hero .page-title { font-size: 34px; }
.hero .page-lead { max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; position: relative; z-index: 1; }

.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 15px 17px; box-shadow: var(--shadow-sm);
}
.stat-card .num {
  font-size: 25px; font-weight: 750; line-height: 1.2;
  font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
.stat-card .lbl { font-size: 11.5px; color: var(--text-subtle); margin-top: 3px; }

.project-card {
  display: block; padding: 17px 19px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.project-card:hover {
  border-color: var(--accent-border); box-shadow: var(--shadow-md); transform: translateY(-1px);
}
.pc-top { display: flex; align-items: flex-start; gap: 12px; }
.pc-title { font-size: 15.5px; font-weight: 680; letter-spacing: -.01em; line-height: 1.5; }
.pc-date { margin-left: auto; flex: none; font-size: 11.5px; color: var(--text-subtle); font-variant-numeric: tabular-nums; padding-top: 2px; }
.pc-summary { margin: 7px 0 0; font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.pc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.pc-tag {
  font-size: 10.5px; color: var(--text-subtle); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 7px;
}

.cat-bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) 24px; gap: 12px; align-items: center; font-size: 12.5px; }
.bar-row .name { color: var(--text-muted); display: flex; align-items: center; gap: 7px; }
.bar-track { height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 4px; background: var(--c); min-width: 0; }
.bar-row .val { text-align: right; color: var(--text-subtle); font-variant-numeric: tabular-nums; }

.timeline { position: relative; margin-left: 5px; padding-left: 20px; border-left: 1px solid var(--border); }
.tl-item { position: relative; padding: 0 0 17px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -25px; top: 8px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--c);
}
.tl-date { font-size: 11px; color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.tl-title { font-size: 13.5px; font-weight: 600; margin-top: 1px; }
.tl-title a { color: var(--text); }
.tl-title a:hover { color: var(--accent); }

/* --------------------------------------------------------------- Detail */
.detail-head { padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.detail-head .page-title { font-size: 30px; margin-bottom: 14px; }
.detail-summary { font-size: 15.5px; color: var(--text-muted); line-height: 1.85; margin: 0 0 18px; }
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.meta-date { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-subtle); }
.meta-date .icon { width: 13px; height: 13px; }

.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 20px 0 0; }
.detail-stack { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; }

.doc-section { margin-top: 34px; scroll-margin-top: 86px; }
.doc-section h2 {
  margin: 0 0 12px; font-size: 17px; font-weight: 700; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 10px;
}
.doc-section h2::before {
  content: ""; width: 3px; height: 15px; border-radius: 2px; background: var(--accent); flex: none;
}
.doc-section p { margin: 0 0 12px; color: var(--text-muted); line-height: 1.9; }
.doc-section ul { margin: 0; padding: 0; list-style: none; }
.doc-section li {
  position: relative; padding: 0 0 0 20px; margin-bottom: 9px;
  color: var(--text-muted); line-height: 1.85;
}
.doc-section li::before {
  content: ""; position: absolute; left: 3px; top: 11px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--border-strong);
}

.info-box {
  margin-top: 30px; padding: 16px 18px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
}
.info-row { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; padding: 4px 0; }
.info-row .icon { width: 15px; height: 15px; color: var(--text-subtle); margin-top: 3px; }
.info-row .k { color: var(--text-subtle); flex: none; width: 62px; }
.info-row .v { color: var(--text-muted); word-break: break-all; }
.info-row code { background: var(--surface); border: 1px solid var(--border); padding: 1px 5px; border-radius: 4px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 42px; }
.pager a {
  display: flex; flex-direction: column; gap: 3px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); transition: border-color .18s, background .18s;
}
.pager a:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.pager .p-label { font-size: 11px; color: var(--text-subtle); display: flex; align-items: center; gap: 5px; }
.pager .p-label .icon { width: 12px; height: 12px; }
.pager .p-title { font-size: 13.5px; font-weight: 600; }
.pager .next { text-align: right; align-items: flex-end; }

/* --------------------------------------------------------------- Project files */
.files-section .files-lead { margin: -4px 0 18px; font-size: 13px; color: var(--text-subtle); }
.files-group { margin-bottom: 20px; }
.files-group-head {
  display: flex; align-items: center; gap: 9px; padding: 0 0 9px;
  border-bottom: 1px solid var(--border);
  font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  color: var(--text-subtle); text-transform: uppercase;
}
.files-group-count {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0; text-transform: none;
  color: var(--text-subtle); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 20px; padding: 1px 8px;
}
.file-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-bottom: 1px solid var(--border);
  transition: background .18s;
}
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: var(--surface-2); }
.file-ic {
  flex: none; width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center; --k: var(--accent);
  color: var(--k);
  background: color-mix(in srgb, var(--k) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--k) 24%, var(--surface));
}
.file-ic .icon { width: 17px; height: 17px; }
.file-ic.k-draw { --k: #0d9488; }
.file-ic.k-code { --k: #7c3aed; }
.file-ic.k-data { --k: #c2740a; }
.file-ic.k-zip  { --k: #be123c; }
html[data-theme="dark"] .file-ic.k-draw { --k: #5eead4; }
html[data-theme="dark"] .file-ic.k-code { --k: #c4b5fd; }
html[data-theme="dark"] .file-ic.k-data { --k: #fcd34d; }
html[data-theme="dark"] .file-ic.k-zip  { --k: #fda4af; }
.file-body { min-width: 0; flex: 1 1 auto; }
.file-name { font-size: 13.5px; font-weight: 650; color: var(--text); line-height: 1.5; }
.file-desc { font-size: 12px; color: var(--text-subtle); line-height: 1.6; margin-top: 2px; }
.file-actions { flex: none; display: flex; align-items: center; gap: 10px; }
.file-size { font-size: 11px; color: var(--text-subtle); font-variant-numeric: tabular-nums; white-space: nowrap; }
.file-raw, .file-open {
  font-size: 12px; text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.file-raw { color: var(--text-subtle); }
.file-raw:hover { color: var(--accent); text-decoration: underline; }
.file-open {
  color: var(--accent); font-weight: 600; padding: 5px 10px; border-radius: 6px;
  border: 1px solid var(--accent-border); background: var(--accent-soft);
}
.file-open:hover { color: var(--accent-hover); border-color: var(--accent); }
.file-open .icon { width: 12px; height: 12px; }

/* --------------------------------------------------------------- Catalog */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 14px 0 20px; border-bottom: 1px solid var(--border); margin-bottom: 20px;
}
.filter-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: 7px; font-size: 12.5px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border);
}
.filter-pill .icon { width: 12px; height: 12px; cursor: pointer; }
.filter-pill:hover { color: var(--accent-hover); }
.result-count { font-size: 12.5px; color: var(--text-subtle); margin-left: auto; }

.empty-state {
  padding: 56px 24px; text-align: center;
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 12px;
}
.empty-state .icon { width: 30px; height: 30px; color: var(--text-subtle); }
.empty-state h3 { margin: 14px 0 6px; font-size: 16px; }
.empty-state p { margin: 0; color: var(--text-subtle); font-size: 13px; }

/* --------------------------------------------------------------- Guide */
.guide-block { margin-top: 30px; }
.guide-block h2 { font-size: 17px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.guide-block h2::before { content: ""; width: 3px; height: 15px; border-radius: 2px; background: var(--accent); }
.guide-block p { color: var(--text-muted); line-height: 1.9; margin: 0 0 12px; }
.guide-block ol { margin: 0; padding-left: 20px; color: var(--text-muted); }
.guide-block ol li { padding-left: 4px; margin-bottom: 8px; line-height: 1.85; }
.code-block {
  position: relative; margin: 14px 0 0; padding: 18px 18px 18px 20px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  overflow-x: auto;
}
.code-block pre { margin: 0; font-family: var(--font-mono); font-size: 12px; line-height: 1.8; color: var(--text); }
.code-block .copy-btn {
  position: absolute; right: 10px; top: 10px; padding: 4px 9px;
  font-size: 11px; display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 6px; color: var(--text-muted); cursor: pointer;
}
.code-block .copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.code-block .copy-btn .icon { width: 12px; height: 12px; }
.callout {
  display: flex; gap: 12px; padding: 15px 17px; margin-top: 18px;
  background: var(--accent-soft); border: 1px solid var(--accent-border);
  border-radius: 10px; font-size: 13px; color: var(--text-muted); line-height: 1.8;
}
.callout .icon { width: 17px; height: 17px; color: var(--accent); flex: none; margin-top: 3px; }
.callout strong { color: var(--text); }

/* --------------------------------------------------------------- Responsive */
@media (max-width: 1180px) {
  .content-inner { padding: 36px 36px 24px; }
  .site-footer { padding-left: 36px; padding-right: 36px; }
  .brand-text small { display: none; }
}

@media (max-width: 960px) {
  :root { --sidebar-w: 0px; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: grid; }
  .sidebar {
    position: fixed; z-index: 80; top: var(--topbar-h); left: 0;
    width: 284px; height: calc(100vh - var(--topbar-h));
    transform: translateX(-101%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  body.drawer-open .sidebar { transform: translateX(0); }
  body.drawer-open .drawer-backdrop {
    display: block; position: fixed; inset: var(--topbar-h) 0 0 0;
    z-index: 70; background: rgba(15, 23, 42, .42);
  }
  .content-inner { max-width: 820px; padding: 32px 28px 24px; }
  .site-footer { padding-left: 28px; padding-right: 28px; }
  .topbar-inner { padding: 0 16px; gap: 12px; }
}

@media (max-width: 640px) {
  :root { --topbar-h: 60px; }
  .brand-text { display: none; }
  .brand-mark { width: 32px; height: 32px; }
  .search-wrap { flex: 1 1 auto; min-width: 0; max-width: none; }
  .search-kbd { display: none; }
  .search-input { padding-right: 34px; }
  .content-inner { padding: 26px 18px 20px; }
  .site-footer { padding-left: 18px; padding-right: 18px; }
  .hero { padding: 24px 20px; }
  .hero .page-title, .page-title { font-size: 25px; }
  .hero::before { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-head .page-title { font-size: 25px; }
  .pc-date { display: none; }
  .pager { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 84px minmax(0, 1fr) 20px; gap: 8px; }
  .result-count { width: 100%; margin-left: 0; }
  .file-row { flex-wrap: wrap; gap: 9px; padding: 12px 6px; }
  .file-body { flex: 1 1 calc(100% - 46px); }
  .file-actions { width: 100%; padding-left: 46px; justify-content: flex-end; }
  .file-size { margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
