/* VIP research workspace. Same light/dark system as the chat (the theme script rewrites this media query). */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --card: #f9f9f9;
  --text: #0d0d0d;
  --muted: #5d5d5d;
  --faint: #8f8f8f;
  --line: #e5e5e5;
  --line-strong: #d1d1d1;
  --btn: #0d0d0d;
  --btn-text: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05);
  --fact: #166534;
  --fact-bg: #ecfdf3;
  --inf: #92400e;
  --inf-bg: #fffbeb;
  --ai: #5b21b6;
  --ai-bg: #f5f3ff;
  --danger: #9f1239;
  --danger-bg: #fff1f2;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #212121;
    --card: #2a2a2a;
    --text: #ececec;
    --muted: #b4b4b4;
    --faint: #8e8e8e;
    --line: #383838;
    --line-strong: #4a4a4a;
    --btn: #ffffff;
    --btn-text: #0d0d0d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .28);
    --fact: #86efac;
    --fact-bg: #14261c;
    --inf: #fcd34d;
    --inf-bg: #2a2110;
    --ai: #ddd6fe;
    --ai-bg: #221c33;
    --danger: #fda4af;
    --danger-bg: rgba(159, 18, 57, .28);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.5; min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
button, textarea { font: inherit; color: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.desk { width: min(840px, 100%); margin: 0 auto; padding: 0 16px calc(32px + var(--safe-bottom)); }
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  margin: 0 -16px; padding: calc(10px + var(--safe-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
}
.back {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: var(--muted); text-decoration: none; flex: none;
}
.back:hover { background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: #eee url("/avatar/avatar-96.webp") center / cover no-repeat;
  box-shadow: 0 0 0 1px var(--line);
}
.titles { flex: 1; min-width: 0; }
.titles h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.titles p { margin: 1px 0 0; font-size: 12px; color: var(--faint); }
.lang, .theme { display: flex; padding: 2px; border: 1px solid var(--line-strong); border-radius: 999px; background: color-mix(in srgb, var(--card) 70%, transparent); }
.lang button, .theme button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 12px; font-weight: 700; padding: 0 6px; height: 28px; border-radius: 999px; white-space: nowrap;
}
.lang button[aria-pressed="true"], .theme button[aria-pressed="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

.tabs { display: flex; gap: 6px; padding: 4px; margin: 8px 0 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.tabs button {
  flex: 1; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  height: 40px; border-radius: 10px; font-weight: 650; font-size: 14.5px;
}
.tabs button[aria-selected="true"] { background: var(--bg); color: var(--text); box-shadow: var(--shadow); }

.quota { margin: 0 2px 12px; color: var(--muted); font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.hero { padding: 22px 18px 18px; text-align: center; }
.hero img { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; box-shadow: 0 0 0 1px var(--line); }
.hero h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.02em; }
.hero p { margin: 0 auto; max-width: 46ch; color: var(--muted); font-size: 15px; line-height: 1.6; }
.ask { margin-top: 12px; padding: 14px; }
.model-slot { margin: 0 0 10px; }
.gate .model-slot { margin: 14px 0 4px; }
.ask label { display: block; font-size: 13px; font-weight: 650; margin: 0 2px 8px; }
.ask textarea {
  width: 100%; resize: vertical; min-height: 88px; border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--text); border-radius: 14px; padding: 12px 12px;
  font-size: 16px; line-height: 1.5; outline: none;
}
.ask textarea:focus { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.ask-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.count { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ask-row button, .gate .go, .proj button.open, .report .new-btn, .danger {
  border: 0; border-radius: 999px; padding: 11px 16px; font-weight: 700; cursor: pointer; font-size: 15px;
}
.ask-row button, .gate .go, .proj button.open, .report .new-btn { margin-left: auto; background: var(--btn); color: var(--btn-text); }
.ask-row button:disabled { opacity: .45; cursor: default; }
.danger { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line)); }
.banner, .gate .err { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); font-size: 14px; }

.gate { padding: 22px 18px; }
.gate h2 { margin: 8px 0 8px; font-size: 24px; letter-spacing: -0.03em; }
.gate p { margin: 0 0 12px; color: var(--muted); }
.gate ul { margin: 0 0 16px; padding-left: 18px; color: var(--text); }
.gate li { margin: 6px 0; }
.gate .mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--ai-bg); color: var(--ai); }
.gate .go { display: inline-flex; text-decoration: none; margin-left: 0; }
.price { font-weight: 750; color: var(--text); }

.progress { list-style: none; margin: 12px 0 0; padding: 8px; }
.progress li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; color: var(--faint); font-weight: 600;
}
.progress li .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); flex: none; }
.progress li.done { color: var(--muted); }
.progress li.done .dot { background: var(--fact); }
.progress li.now { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.progress li.now .dot { background: var(--btn); }
@media (prefers-reduced-motion: no-preference) {
  .progress li.now .dot { animation: pulse 1.1s ease-in-out infinite; }
}
@keyframes pulse { 50% { transform: scale(.65); opacity: .55; } }

.report { margin-top: 14px; }
.report-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.report-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.03em; line-height: 1.25; flex: 1; }
.topic-line { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 750; letter-spacing: .02em;
  border: 1px solid transparent;
}
.chip.fact, .block.fact { color: var(--fact); background: var(--fact-bg); border-color: color-mix(in srgb, var(--fact) 35%, transparent); }
.chip.inference, .block.inference { color: var(--inf); background: var(--inf-bg); border-color: color-mix(in srgb, var(--inf) 35%, transparent); }
.chip.ai, .block.ai { color: var(--ai); background: var(--ai-bg); border-color: color-mix(in srgb, var(--ai) 35%, transparent); }
.block {
  margin: 0 0 10px; padding: 12px 14px; border-radius: 16px;
  border-left: 4px solid currentColor;
}
.block p { margin: 6px 0 0; color: var(--text); font-size: 15.5px; line-height: 1.65; }
.cites { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: super; }
.cite {
  min-width: 1.3em; text-align: center; text-decoration: none; font-size: 12px; font-weight: 750;
  color: var(--text); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 5px;
}
.section-title { margin: 18px 0 8px; font-size: 13px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.compare { display: grid; gap: 10px; }
.compare h3 { margin: 0 0 8px; font-size: 15px; }
.compare .col { padding: 12px; }
.sources { display: grid; gap: 10px; }
.source { padding: 14px; scroll-margin-top: 72px; }
.source .num {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--line-strong); font-weight: 750; font-size: 13px; margin-right: 8px;
}
.source h3 { display: flex; align-items: baseline; margin: 0 0 4px; font-size: 16px; line-height: 1.35; }
.source .meta { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.source a.url { color: var(--fact); font-size: 13px; word-break: break-all; }
.source blockquote {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--bg);
  border: 1px solid var(--line); color: var(--text); font-size: 14px; line-height: 1.55;
}
.source .excerpt-label { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); }
.actions { display: flex; gap: 8px; margin-top: 14px; }

.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.proj { padding: 14px; display: grid; gap: 6px; }
.proj h3 { margin: 0; font-size: 16.5px; letter-spacing: -0.02em; }
.proj p { margin: 0; color: var(--muted); font-size: 13.5px; }
.proj .row { display: flex; gap: 8px; margin-top: 6px; }
.proj button.open { margin-left: 0; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.foot { margin: 18px 0 0; color: var(--faint); font-size: 12.5px; line-height: 1.5; text-align: center; }
.foot a { color: var(--muted); }
.foot.visits { margin-top: 6px; font-size: 12px; }

@media (min-width: 800px) {
  .hero { padding: 28px 28px 22px; }
  .compare { grid-template-columns: 1fr 1fr; }
  .progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .progress li { flex-direction: column; text-align: center; gap: 8px; min-height: 78px; justify-content: center; }
}
