/*
 * [INPUT]:  styles.css 的 design tokens (颜色/字体/圆角)
 * [OUTPUT]: 言壤 app 界面的纯 CSS 复刻 — Hero 仪表盘窗口 + 历史/设置/关于迷你窗
 * [POS]:    样式层副文件; 承载落地页「Show, don't tell」的视觉证据
 * [PROTOCOL]: 变更时更新此头部, 然后检查 CLAUDE.md
 */

/* ════════════════════════ 通用窗口外壳 ════════════════════════ */
.window, .mini-win {
  background: linear-gradient(180deg, #161619, #121215);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .02);
}
.window { width: 100%; }

.win-bar {
  display: flex; align-items: center; gap: .9rem;
  padding: .7rem .9rem;
  background: rgba(255, 255, 255, .03);
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
}
.win-bar.sm { padding: .55rem .7rem; font-size: .74rem; }
.lights { display: inline-flex; gap: 6px; flex: none; }
.lights i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.win-bar.sm .lights i { width: 9px; height: 9px; }
.l-r { background: #ff5f57; } .l-y { background: #febc2e; } .l-g { background: #28c840; }
.win-title { font-weight: 700; color: var(--ink); flex: none; }
.win-title em { color: var(--ink-faint); font-weight: 500; font-family: var(--mono); font-size: .9em; margin-left: .15rem; }
.win-title.sm { font-weight: 600; }
.win-nav { display: flex; gap: .2rem; margin: 0 auto; color: var(--ink-muted); }
.win-nav span { padding: .3rem .6rem; border-radius: 7px; white-space: nowrap; }
.win-nav .active { background: var(--surface-2); color: var(--ink); }
.win-status { display: inline-flex; align-items: center; gap: .4rem; color: var(--green); flex: none; padding: .25rem .6rem; border: 1px solid rgba(48,209,88,.3); border-radius: 999px; font-size: .76rem; }

/* ════════════════════════ Hero 仪表盘内容 ════════════════════════ */
.win-body { padding: clamp(.8rem, 2vw, 1.2rem); display: grid; gap: .8rem; }

.listening-card {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.15rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: radial-gradient(120% 140% at 0% 0%, rgba(48,209,88,.08), transparent 60%), var(--surface);
}
.lc-title { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.02rem; }
.lc-sub { color: var(--ink-muted); font-size: .82rem; margin-top: .2rem; }
.lc-btn { font-size: .78rem; padding: .45rem .8rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-muted); white-space: nowrap; flex: none; }

.stat-row { display: grid; grid-template-columns: 1fr 1fr 2.1fr; gap: .7rem; }
.stat { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: .9rem 1rem; }
.stat-num { display: block; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; line-height: 1; font-feature-settings: "tnum"; }
.stat-label { display: block; color: var(--ink-muted); font-size: .78rem; margin-top: .35rem; }
.stat-checks { display: grid; gap: .4rem; align-content: center; }
.stat-checks p { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--ink); }
.stat-checks em { color: var(--ink-faint); font-size: .92em; }
.ck { width: 14px; height: 14px; border-radius: 50%; background: rgba(48,209,88,.18); position: relative; flex: none; }
.ck::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--green); font-size: 9px; font-weight: 700; }

.log-panel { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); overflow: hidden; }
.log-head { display: flex; justify-content: space-between; padding: .7rem .95rem; border-bottom: 1px solid var(--border); font-weight: 600; font-size: .85rem; }
.log-head span { color: var(--ink-faint); font-weight: 400; font-family: var(--mono); }
.log-list { list-style: none; max-height: 210px; overflow: hidden; padding: .3rem 0; }
.log-list li { display: flex; gap: .8rem; padding: .42rem .95rem; font-size: .84rem; line-height: 1.45; border-bottom: 1px solid rgba(255,255,255,.03); }
.log-list li time { color: var(--ink-faint); font-family: var(--mono); font-size: .78rem; flex: none; padding-top: .05rem; }
.log-list li span { color: #d4d4d8; min-width: 0; }
.log-list li.fresh { animation: logIn .55s var(--ease); }
.log-list li.fresh time { color: var(--red); }
@keyframes logIn { from { opacity: 0; transform: translateY(-6px); background: rgba(255,59,51,.08); } to { opacity: 1; transform: none; } }

/* ════════════════════════ 迷你窗: 历史 / 日历 ════════════════════════ */
.cal { padding: 1rem; }
.cal-head { font-weight: 600; font-size: .85rem; margin-bottom: .7rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-grid .dow { color: var(--ink-faint); font-size: .68rem; text-align: center; padding-bottom: .2rem; }
.cal-grid .day { aspect-ratio: 1; display: grid; place-items: center; font-size: .76rem; border-radius: 7px; position: relative; color: var(--ink); }
.cal-grid .day.mute { color: #5a5a62; }
.cal-grid .day.today { background: var(--red); color: #fff; font-weight: 700; }
.cal-grid .day.has::after { content: ""; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--red); }
.cal-grid .day.today.has::after { background: #fff; }

/* ════════════════════════ 迷你窗: 设置 / 参数 ════════════════════════ */
.settings { padding: 1rem; display: grid; gap: .85rem; }
.set-row { display: flex; align-items: center; justify-content: space-between; font-size: .85rem; padding-bottom: .3rem; border-bottom: 1px solid var(--border); }
.toggle { width: 38px; height: 22px; border-radius: 999px; background: var(--surface-2); position: relative; transition: background .2s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s var(--ease); }
.toggle.on { background: var(--blue); }
.toggle.on::after { left: 18px; }
.set-slider label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--ink-muted); margin-bottom: .45rem; }
.set-slider label b { color: var(--ink); font-family: var(--mono); }
.set-slider .track { display: block; position: relative; height: 4px; border-radius: 999px; background: var(--surface-2); }
.set-slider .track i { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.set-slider .track::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--fill, 50%); background: var(--red); border-radius: 999px; }

/* ════════════════════════ 迷你窗: 关于 ════════════════════════ */
.about { padding: 1.1rem; }
.about-head { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.about-head > div { margin-right: auto; }
.about-head b { display: block; font-size: 1.1rem; }
.about-head em { color: var(--ink-muted); font-size: .78rem; }
.ver-badge { font-size: .72rem; color: var(--green); padding: .2rem .55rem; border: 1px solid rgba(48,209,88,.35); border-radius: 999px; font-family: var(--mono); }
.about-list { list-style: none; display: grid; gap: .55rem; }
.about-list li { position: relative; padding-left: 1.3rem; font-size: .82rem; color: var(--ink-muted); }
.about-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-size: .78rem; }

/* mini-win 在巡览卡内不需要额外阴影(卡片已有边框) */
.tour-card .mini-win { border: none; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; }

/* ════════════════════════ 窄屏降级: 仪表盘自适应 ════════════════════════ */
@media (max-width: 560px) {
  .window .win-nav { display: none; }
  .window .win-title { margin-right: auto; }
  .listening-card { flex-wrap: wrap; gap: .65rem; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat-checks { grid-column: 1 / -1; }
}
