/* WorkLens Hub · 收敛版样式
   绝大多数布局与排版使用 Tailwind utility；这里只放设计令牌、字体、
   关键帧与 Tailwind 难以表达的少量细节（印章、纸纹、漏斗刻度）。 */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,700;0,9..144,800;1,9..144,500&family=Noto+Sans+SC:wght@400;500;700&family=Noto+Serif+SC:wght@600;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --paper: #f3ede1;
  --paper-raised: #faf5ea;
  --paper-sunk: #e9e0cf;
  --ink: #181512;
  --ink-soft: #3b3630;
  --ink-mute: #6b6258;
  --rule: #cdbfa8;
  --rule-soft: #ddd2bf;
  --cinnabar: #a83d29;
  --cinnabar-wash: #f2dfd4;
  --forest: #2d4a3a;
  --forest-wash: #dfe6dc;
  --mustard: #a8741c;
  --mustard-wash: #f1e4c4;
  --font-display: 'Fraunces', 'Noto Serif SC', serif;
  --font-cn-display: 'Noto Serif SC', 'Fraunces', serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; overflow-x: hidden; }
body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/><feColorMatrix values='0 0 0 0 0.08  0 0 0 0 0.07  0 0 0 0 0.06  0 0 0 0.05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
#root { position: relative; z-index: 1; }

.ff-display { font-family: var(--font-display); font-optical-sizing: auto; }
.ff-cn { font-family: var(--font-cn-display); }
.ff-mono { font-family: var(--font-mono); }

button { font: inherit; color: inherit; }
a, button { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--cinnabar); }

/* —— 签名细节：漏斗刻度线。数字像报纸版心的刻度，从左往右收窄 —— */
.funnel-step { position: relative; }
.funnel-step + .funnel-step::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 14px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent 45%, var(--rule) 45%, var(--rule) 55%, transparent 55%);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* 印章：建议引入的候选会盖一个朱砂章，进入视口时轻轻落下 */
.stamp {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 2px solid var(--cinnabar);
  border-radius: 50%;
  color: var(--cinnabar);
  font-family: var(--font-cn-display);
  font-weight: 900;
  font-size: 15px;
  line-height: 1.05;
  letter-spacing: 0.08em;
  text-align: center;
  transform: rotate(-12deg);
  box-shadow: inset 0 0 0 3px var(--paper-raised), inset 0 0 0 4px var(--cinnabar);
  mix-blend-mode: multiply;
  animation: stamp-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.stamp--sm { width: 44px; height: 44px; font-size: 11px; box-shadow: inset 0 0 0 2px var(--paper-raised), inset 0 0 0 3px var(--cinnabar); }
@keyframes stamp-in {
  from { opacity: 0; transform: rotate(-24deg) scale(1.6); }
  to { opacity: 0.92; transform: rotate(-12deg) scale(1); }
}

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 0.36s ease both; }

@keyframes sheet-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet { animation: sheet-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.scrim { animation: fade-in 0.2s ease both; }
@media (max-width: 720px) {
  .sheet { animation-name: sheet-up; }
}

@keyframes shimmer { 0% { background-position: -320px 0; } 100% { background-position: 320px 0; } }
.skeleton {
  background: linear-gradient(90deg, var(--paper-sunk) 0, var(--paper-raised) 40%, var(--paper-sunk) 80%) 0 0 / 640px 100%;
  animation: shimmer 1.4s linear infinite;
}

/* 7 项阻断检查的刻度条 */
.check-tick { width: 100%; height: 8px; background: var(--paper-sunk); }
.check-tick[data-status='pass'] { background: var(--forest); }
.check-tick[data-status='warn'] { background: var(--mustard); }
.check-tick[data-status='fail'] { background: var(--cinnabar); }

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

/* ================= 仓库卡片指标 =================
   数字 = 实测快照（CountUp 滚动）；曲线 / 活跃度 = 示意（虚线 + 「示意」标签）。
   签名细节：推演段虚线，只有末点是朱砂实心点 + 呼吸光圈——「只有这一点是真的」。 */
.spark { display: block; overflow: visible; clip-path: inset(-8px 100% -8px 0); }
.spark.is-run { animation: spark-draw 1s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.spark__area { fill: var(--ink); opacity: 0.05; }
.spark__line { stroke: var(--ink-mute); stroke-width: 1.4; stroke-dasharray: 3 2.4; stroke-linecap: round; stroke-linejoin: round; }
.spark__dot { fill: var(--cinnabar); }
.spark__halo { fill: var(--cinnabar); opacity: 0; transform-box: fill-box; transform-origin: center; }
.spark.is-run .spark__halo { animation: spark-halo 2.2s 1s ease-out infinite; }
@keyframes spark-draw { to { clip-path: inset(-8px -10px -8px 0); } }
@keyframes spark-halo { 0% { opacity: 0.35; transform: scale(0.5); } 100% { opacity: 0; transform: scale(1.8); } }

.heat { display: inline-grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 2px; height: 16px; }
.heat i { display: block; width: 100%; background: var(--rule); transform-origin: bottom; transform: scaleY(0); }
.heat.is-run i { animation: heat-up 0.5s cubic-bezier(0.2, 1.2, 0.4, 1) forwards; }
.heat i[data-l='1'] { height: 20%; }
.heat i[data-l='2'] { height: 40%; background: color-mix(in oklab, var(--cinnabar) 30%, var(--paper-sunk)); }
.heat i[data-l='3'] { height: 60%; background: color-mix(in oklab, var(--cinnabar) 50%, var(--paper-sunk)); }
.heat i[data-l='4'] { height: 80%; background: color-mix(in oklab, var(--cinnabar) 72%, var(--paper-sunk)); }
.heat i[data-l='5'] { height: 100%; background: var(--cinnabar); }
@keyframes heat-up { to { transform: scaleY(1); } }

/* 台账行：一条细刻度带 */
.repo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--rule); color: var(--ink-mute); font-family: var(--font-mono); font-size: 11px; }
.repo-row__spark { display: inline-flex; }
.repo-row__num { display: inline-flex; align-items: center; gap: 4px; }
.repo-row__num b { color: var(--ink); font-weight: 600; }
.repo-row__num.is-hot { color: var(--cinnabar); }
.repo-row__heat .heat { width: 46px; height: 12px; }

/* 头条 / 速读：三栏指标板 */
.repo-board { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px 22px; padding: 14px 0; border-top: 1px solid var(--ink); border-bottom: 1px dashed var(--rule); }
.repo-board__head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; color: var(--ink-mute); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; }
.repo-board__legend { display: flex; gap: 12px; margin-top: 4px; color: var(--ink-mute); font-family: var(--font-mono); font-size: 10px; }
.repo-board__legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg-dash { display: inline-block; width: 14px; border-top: 1.5px dashed var(--ink-mute); }
.lg-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cinnabar); }
.repo-board__nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-content: start; }
.repo-num { min-width: 0; }
.repo-num__label { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-mute); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; }
.repo-num.is-hot .repo-num__label { color: var(--cinnabar); }
.repo-num__value { display: block; margin-top: 2px; font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; }
.repo-num__help { display: block; margin-top: 4px; color: var(--ink-mute); font-size: 12px; line-height: 1.5; }
.repo-board__heat { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); }
.repo-board__heat .heat { width: 100%; height: 18px; gap: 4px; }
.repo-board__note { grid-column: 1 / -1; margin: 2px 0 0; padding: 10px 12px; background: var(--paper-sunk); color: var(--ink-soft); font-size: 12.5px; line-height: 1.7; }
.repo-board__note b { font-weight: 600; color: var(--ink); }
.tag-ill, .tag-real { display: inline-block; padding: 0 5px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.04em; line-height: 16px; text-transform: none; }
.tag-ill { color: var(--mustard); border: 1px dashed var(--mustard); }
.tag-real { margin-left: 4px; color: var(--forest); background: var(--forest-wash); white-space: nowrap; }
.repo-board--detail { grid-template-columns: minmax(0, 1fr); }
.repo-board--detail .repo-board__nums { gap: 16px; }
.repo-board--detail .spark { width: 100%; height: auto; }
@media (max-width: 720px) {
  .repo-board { grid-template-columns: minmax(0, 1fr); }
  .repo-num__value { font-size: 22px; }
}

/* 本机相关徽标：一个小屏幕图标 + 等级 + 分数 */
.local-badge { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; font-size: 11px; line-height: 18px; white-space: nowrap; border: 1px solid currentColor; }
.local-badge b { margin-left: 2px; font-size: 10.5px; }
.local-badge.is-high { color: var(--cinnabar); background: var(--cinnabar-wash); }
.local-badge.is-mid { color: var(--forest); background: var(--forest-wash); }
.local-badge.is-low { color: var(--ink-mute); border-color: var(--rule); }

/* 可展开解释 */
.explain__btn { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; color: var(--ink-mute); font-size: 12.5px; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.explain__btn:hover, .explain[open] .explain__btn { color: var(--ink); }
.explain__body { margin-top: 6px; padding: 12px 14px; border-left: 2px solid var(--cinnabar); background: var(--paper-raised); color: var(--ink-soft); font-size: 13.5px; line-height: 1.75; animation: rise 0.24s ease both; }
.explain__body dt { font-weight: 600; color: var(--ink); }
.explain__body dd { margin: 0 0 8px; }

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details[open] .chev { transform: rotate(90deg); }

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

/* ---------------- 来源构成条：六类渠道一条线读完 ---------------- */
.intake__bar { display: flex; gap: 2px; height: 34px; border: 1px solid var(--ink); padding: 2px; background: var(--paper-raised); }
.intake__seg { position: relative; min-width: 10px; border: 0; cursor: pointer; overflow: hidden; transform-origin: left center;
  animation: intake-grow 0.7s cubic-bezier(.2,.8,.2,1) both; transition: opacity .2s ease, filter .2s ease; }
.intake__seg:hover { filter: brightness(1.08); }
.intake__seg:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.intake__seg.is-dim { opacity: .28; }
.intake__seg.is-active { box-shadow: inset 0 0 0 2px var(--paper-raised); }
.intake__label { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 8px; font: 600 11px/1 var(--font-mono); letter-spacing: .04em; color: var(--paper-raised); white-space: nowrap; }
.intake__dot { display: inline-block; width: 8px; height: 8px; }
[data-channel='trending'] { background: var(--cinnabar); }
[data-channel='search'] { background: var(--ink); }
[data-channel='starred'] { background: var(--forest); }
[data-channel='owned'] { background: #5d7a66; }
[data-channel='mention'] { background: var(--mustard); }
[data-channel='pinned'] { background: var(--ink-mute); }
@keyframes intake-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.fresh-card { box-shadow: 0 1px 0 var(--rule-soft); }
@media (prefers-reduced-motion: reduce) { .intake__seg { animation: none; } }

/* ---------------- 深度解读 dossier ---------------- */
.dossier { padding-top: 18px; border-top: 1px solid var(--ink); }
.dossier--empty { padding: 14px 16px; border: 1px dashed var(--rule); background: var(--paper-raised); }
.dossier__tagline { margin: 10px 0 0; padding-left: 14px; border-left: 3px solid var(--cinnabar); font-family: var(--font-cn-display); font-size: 17px; line-height: 1.6; color: var(--ink); }
.dossier__index { display: flex; gap: 6px; margin: 14px 0 4px; overflow-x: auto; }
.dossier__index a { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border: 1px solid var(--rule); font-size: 12.5px; color: var(--ink-soft); background: var(--paper-raised); transition: border-color .15s, color .15s; }
.dossier__index a span { font-size: 10px; color: var(--ink-mute); }
.dossier__index a:hover { border-color: var(--ink); color: var(--ink); }
.dossier__sec { scroll-margin-top: 12px; padding: 14px 0 4px; border-bottom: 1px dashed var(--rule); animation: rise .32s ease both; }
.dossier__sec:last-of-type { border-bottom: 0; }
.dossier__sec h4 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.dossier__sec h4 span { font-size: 11px; color: var(--cinnabar); }
.dossier__sec h4 b { font-size: 15px; font-weight: 600; }
.dossier__sec h4 em { font-style: normal; font-size: 12px; color: var(--ink-mute); }
.dossier__sec li { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; padding: 6px 0 6px 14px; position: relative; font-size: 14px; line-height: 1.7; color: var(--ink-soft); }
.dossier__sec li::before { content: ''; position: absolute; left: 0; top: 15px; width: 6px; height: 1px; background: var(--ink); }
.dossier__text { overflow-wrap: anywhere; }
/* 出处标记：像校样上的批注章，一眼区分「原文 / 实测 / 推断」 */
.prov { margin-top: 3px; padding: 0 5px; font-size: 10.5px; line-height: 18px; white-space: nowrap; letter-spacing: .04em; border: 1px solid currentColor; }
.prov[data-from="readme"] { color: var(--ink); background: var(--paper-raised); }
.prov[data-from="facts"] { color: var(--forest); background: var(--forest-wash); border-color: transparent; }
.prov[data-from="inferred"] { color: var(--ink-mute); border-style: dashed; }
.prov[data-from="editor"] { color: var(--cinnabar); background: var(--cinnabar-wash); border-color: transparent; }
.prov[data-from="llm"] { color: var(--mustard); background: var(--mustard-wash); border-color: transparent; }
.dossier__arch { margin: 6px 0 8px 14px; }
.stackbar { display: flex; height: 8px; gap: 2px; }
.stackbar i { flex-basis: 0; transform-origin: left; animation: stackgrow .7s cubic-bezier(.2,.7,.2,1) both; }
@keyframes stackgrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.stackbar__legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 11.5px; color: var(--ink-mute); }
.stackbar__legend span { display: inline-flex; align-items: center; gap: 5px; }
.stackbar__legend i { width: 8px; height: 8px; display: inline-block; }
.stackbar__legend b { color: var(--ink); font-weight: 500; font-family: var(--font-mono); }
.dossier__code { position: relative; margin: 4px 0 10px; background: var(--ink); color: var(--paper-raised); }
.dossier__code pre { margin: 0; padding: 12px 70px 12px 14px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.dossier__code button { position: absolute; top: 8px; right: 8px; height: 26px; padding: 0 9px; font-size: 11.5px; color: var(--paper-raised); border: 1px solid rgba(250,245,234,.4); }
.dossier__code button:hover { border-color: var(--paper-raised); }
/* 缓存票根：带打孔撕线的存根，告诉你这份解读是缓存、0 次模型调用 */
.ticket { display: flex; margin-top: 16px; background: var(--paper-sunk); position: relative; }
.ticket__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; color: var(--ink-soft); }
.ticket__stub { flex: none; width: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink-mute); border-left: 2px dashed var(--paper); position: relative; }
.ticket__stub b { font-size: 15px; color: var(--cinnabar); letter-spacing: .04em; }
.ticket__stub::before, .ticket__stub::after { content: ''; position: absolute; left: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper-raised); }
.ticket__stub::before { top: -8px; }
.ticket__stub::after { bottom: -8px; }
.row-insight { display: flex; gap: 8px; margin-top: 6px; font-size: 13px; line-height: 1.6; color: var(--ink-soft); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.row-insight b { font-weight: 600; color: var(--forest); margin-right: 6px; }
@media (prefers-reduced-motion: reduce) { .stackbar i, .dossier__sec { animation: none; } }
