/* 理见 · 各模型共用样式：配色、布局、面板、控件、窄屏抽屉 */
:root {
  --bg: #05070d;
  --panel: #111723;
  --panel-2: #1a2231;
  --line: #2a3446;
  --text: #e6ebf2;
  --muted: #8d99ab;
  --accent: #ffc94a;
  --accent-2: #4fc3f7;
  --panel-w: 340px;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; }

#app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
#stage { position: relative; flex: 1; min-width: 0; overflow: hidden; }
#stage canvas { display: block; }

#hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3;
  padding: 4px 12px; border-radius: 999px; background: rgba(17,23,35,.75); color: var(--muted);
  font-size: 12px; pointer-events: none; white-space: nowrap; }

/* 返回首页 */
.home-link { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; padding: 1px 8px 1px 6px;
  font-size: 12px; font-weight: normal; color: var(--muted); text-decoration: none; vertical-align: 3px;
  border: 1px solid var(--line); border-radius: 999px; }
.home-link:hover { color: var(--accent); border-color: var(--accent); }
.home-fab { display: none; }

#panelToggle { display: none; }

/* 分段按钮 */
.seg { display: inline-flex; pointer-events: auto; }
.seg button { font: inherit; font-size: 12px; padding: 2px 8px; color: var(--muted); background: var(--panel-2);
  border: 1px solid var(--line); border-left: none; cursor: pointer; }
.seg button:first-child { border-radius: 6px 0 0 6px; border-left: 1px solid var(--line); }
.seg button:last-child { border-radius: 0 6px 6px 0; }
.seg button.on { color: #111; background: var(--accent); border-color: var(--accent); }

/* 面板 */
#panel { width: var(--panel-w); flex: none; overflow-y: auto; background: var(--panel);
  border-left: 1px solid var(--line); padding: 14px 16px 24px; }
#panel h1 { font-size: 18px; margin: 0 0 10px; }
#panel h1 small { font-size: 12px; color: var(--muted); font-weight: normal; margin-left: 6px; }
#panel h2 { font-size: 13px; color: var(--accent); margin: 0 0 8px; font-weight: 600; letter-spacing: .5px; }
#panel section { padding: 12px 0; border-top: 1px solid var(--line); }

.readout { background: var(--panel-2); border-radius: 10px; padding: 10px 12px !important; border: 1px solid var(--line) !important; }
.readout .big { font-size: 20px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 8px 0 0; font-size: 13px; }
dt { color: var(--muted); }
dd { margin: 0; }
.muted { color: var(--muted); font-size: 12px; }

button.small { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
button.small:hover { border-color: var(--accent); }

.slider, .row { display: grid; grid-template-columns: 64px 1fr 72px; align-items: center; gap: 8px; margin: 6px 0; }
output { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); text-align: right; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.switch { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.switch input, .checks input { accent-color: var(--accent); }

.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.checks label { cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }

select { width: 100%; font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; }

.note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.foot { border-top: 1px solid var(--line); padding-top: 12px; }

/* 窄屏：面板变为底部抽屉 */
@media (max-width: 760px) {
  #app { display: block; }
  #stage { position: absolute; inset: 0; }
  #panel { position: absolute; left: 0; right: 0; bottom: 0; width: auto; max-height: 62%; z-index: 5;
    border-left: none; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0;
    transform: translateY(0); transition: transform .25s; }
  #panel.collapsed { transform: translateY(100%); }
  #panelToggle, .home-fab { display: block; position: absolute; top: 44px; z-index: 6; font: inherit; font-size: 13px;
    padding: 6px 12px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
    text-decoration: none; }
  #panelToggle { right: 12px; }
  .home-fab { left: 12px; }
  #panel h1 .home-link { display: none; }
  #hint { font-size: 11px; max-width: calc(100% - 24px); white-space: normal; text-align: center; }
}
