/* style.css · ui.spec 视觉规格：#06081a 暗底 / 衬线 / 四态 / 响应式（C6） */
:root {
  --bg: #06081a;
  --ink: #e8e6df;
  --muted: #8b89a3;
  --serif: "Songti SC", "STSong", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--serif); }

#stage { position: relative; width: 100vw; height: 100svh; overflow: hidden; }
#spiral { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; display: block; }
#spiral:active { cursor: grabbing; }

/* L2 顶栏：自上而下渐隐底 */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 9;
  padding: 16px 28px 26px;
  background: linear-gradient(#06081acc, #06081a00);
  pointer-events: none;
}
.topbar h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: 0.08em; }
.topbar h1 .en { font-size: 15px; color: var(--muted); font-weight: 400; }
.topbar .sub { margin: 4px 0 0; font-size: 12px; color: var(--muted); }

/* L3 底部朝代 chips */
.chips {
  position: absolute; left: 0; right: 0; bottom: 14px; z-index: 9;
  display: flex; gap: 8px; justify-content: center; align-items: center;
  padding: 0 16px; flex-wrap: nowrap;
  overflow-x: auto; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  font: 13px var(--serif);
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 2px solid currentColor;
  padding: 5px 10px;
  cursor: pointer;
  opacity: 0.85;
}
.chip:hover { opacity: 1; }
.chip.on { border-color: currentColor; background: #06081a; opacity: 1; }
.chip.all { color: var(--muted); border-bottom-color: var(--muted); }

/* L4 导览按钮（小屏抬升避开 chips 横滚行） */
.tour {
  position: absolute; right: 20px; bottom: 62px; z-index: 9;
  font: 14px var(--serif);
  color: var(--ink);
  background: #06081acc;
  border: 1px solid #3a3d5c;
  padding: 8px 18px;
  cursor: pointer;
}
.tour:hover { border-color: var(--muted); }
@media (max-width: 640px) { .tour { bottom: 66px; } }

/* L5 详情面板（非模态；桌面右侧停靠，手机底部抽屉） */
.panel {
  position: absolute; top: 76px; right: 20px; z-index: 10;
  width: min(340px, 86vw);
  max-height: 70vh; overflow: auto;
  background: #0a0d24f2;
  border: 1px solid #2a2d4a;
  padding: 18px 20px 16px;
}
.panel-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.panel-meta .sep { opacity: 0.5; }
.dyn-dot { width: 9px; height: 9px; border-radius: 50%; background: #888; display: inline-block; }
.panel h2 { margin: 10px 0 6px; font-size: 17px; font-weight: 600; line-height: 1.5; }
.panel-en { margin: 0 0 12px; font-size: 12px; color: var(--muted); font-style: italic; }
.panel-source h3 { margin: 10px 0 6px; font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0.2em; }
.panel-source .src { font-size: 13px; line-height: 1.6; }
.panel-source .src a { color: var(--ink); }
.panel-source .pending { color: var(--muted); font-size: 13px; }
.panel-source .pending-note { color: var(--muted); font-size: 12px; margin-top: 4px; }
.panel-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: var(--muted);
  font-size: 20px; cursor: pointer; padding: 4px 8px;
}
.panel-close:hover { color: var(--ink); }
/* 暗底和谐的键盘焦点环（替代浏览器默认蓝框） */
.panel-close:focus { outline: none; }
.panel-close:focus-visible { outline: 1px solid var(--muted); outline-offset: 2px; }

/* L6 页脚（滚动可达） */
.footer { padding: 20px 28px 34px; font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.footer a { color: var(--ink); }
.footer strong { color: var(--ink); }

/* 手机 <375 基准：chips 横滚（内滚）、面板改底部抽屉 */
@media (max-width: 640px) {
  .panel {
    top: auto; right: 0; left: 0; bottom: 0;
    width: 100%; max-height: 60vh;
    border-left: none; border-right: none;
    border-top: 1px solid #2a2d4a;
  }
  .tour { bottom: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
