:root {
  color-scheme: dark;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #e9f2f5;
  background: #071117;
  --bg: #071117;
  --panel: rgba(12, 27, 35, 0.94);
  --panel-2: rgba(16, 35, 44, 0.9);
  --line: rgba(145, 185, 197, 0.18);
  --muted: #8ea3ad;
  --accent: #58d6c7;
  --accent-2: #f5a85c;
  --accent-soft: rgba(88, 214, 199, 0.1);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.26);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(31, 133, 137, 0.2), transparent 35rem),
    radial-gradient(circle at 92% 100%, rgba(166, 94, 42, 0.13), transparent 38rem),
    linear-gradient(148deg, #071117 0%, #0a161d 55%, #071016 100%);
}
button, a { font: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.topbar {
  min-height: 104px;
  padding: 20px clamp(18px, 3vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 18, 24, 0.82);
  backdrop-filter: blur(18px);
}
.eyebrow, .section-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
}
h1 { margin: 0; font-size: clamp(21px, 2.2vw, 30px); letter-spacing: -.025em; }
.subtitle { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.release-meta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid rgba(88, 214, 199, .27);
  border-radius: 999px;
  color: #bad1d6;
  background: rgba(88, 214, 199, .05);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(88,214,199,.11); }
.meta-divider { width: 1px; height: 13px; background: var(--line); }

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(235px, 278px) minmax(440px, 1fr) minmax(240px, 292px);
  gap: 13px;
  padding: 13px;
}
.panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sidebar, .detail-panel { display: flex; flex-direction: column; }
.panel-heading { padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0 0 5px; font-size: 16px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.model-list { flex: 1; overflow-y: auto; padding: 9px; }
.model-group { margin: 10px 9px 5px; color: #647f89; font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.model-button {
  width: 100%; display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center;
  padding: 10px; border: 1px solid transparent; border-radius: 11px;
  background: transparent; color: #e5eef1; text-align: left; cursor: pointer; transition: 150ms ease;
}
.model-button:hover { background: rgba(255,255,255,.035); border-color: var(--line); }
.model-button.active { background: var(--accent-soft); border-color: rgba(88,214,199,.27); }
.model-code { min-height: 34px; display: grid; place-items: center; border-radius: 8px; background: #152832; color: #9eb1b8; font-size: 9px; font-weight: 800; }
.model-button.active .model-code { color: #071b1d; background: var(--accent); }
.model-button strong { display: block; margin-bottom: 3px; font-size: 12px; line-height: 1.25; }
.model-button span span { display: block; color: var(--muted); font-size: 10px; line-height: 1.35; }
.boundary-note { margin: 9px; padding: 12px; border: 1px solid rgba(245,168,92,.15); border-radius: 11px; background: rgba(245,168,92,.06); color: #cbbba9; font-size: 10px; line-height: 1.5; }
.boundary-note strong { color: #f0c08f; }
.boundary-note p { margin: 5px 0 0; }

.viewer-panel { display: grid; grid-template-rows: auto 1fr; }
.viewer-toolbar { min-height: 78px; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.model-meta { min-width: 0; display: flex; align-items: center; gap: 11px; }
.stage-pill { flex: 0 0 auto; padding: 7px 9px; border-radius: 8px; background: #153d44; color: #9ff3e8; font-size: 10px; font-weight: 800; }
.model-copy { min-width: 0; }
.model-copy h2 { margin: 0 0 4px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-copy p { margin: 0; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.toolbar-actions button {
  padding: 7px 9px; border: 1px solid #28414c; border-radius: 7px; background: #10232c;
  color: #afc0c6; font-size: 10px; font-weight: 700; cursor: pointer;
}
.toolbar-actions button:hover, .toolbar-actions button[aria-pressed="true"] { color: #bcfff5; border-color: #3e8f8b; background: #153a3d; }
.canvas-wrap { position: relative; min-height: 0; overflow: hidden; background: #0b151b; }
#viewport { width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.loading-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); display: flex; align-items: center; gap: 10px; padding: 11px 15px; border: 1px solid var(--line); border-radius: 10px; background: rgba(11,26,33,.94); color: #b7c9ce; font-size: 11px; transition: opacity 180ms ease; }
.loading-card.hidden { opacity: 0; pointer-events: none; }
.spinner { width: 15px; height: 15px; border: 2px solid #29434d; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.interaction-hint, .axis-legend { position: absolute; bottom: 12px; padding: 7px 9px; border-radius: 7px; color: #b8c8cd; background: rgba(4,12,16,.73); font-size: 9px; pointer-events: none; }
.interaction-hint { left: 12px; }
.axis-legend { right: 12px; }
.axis-legend b { color: var(--accent); }

.detail-scroll { flex: 1; overflow-y: auto; }
.detail-section { padding: 15px 17px; border-bottom: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 10px; color: #c7d7db; font-size: 11px; letter-spacing: .04em; }
.review-points { margin: 0; padding-left: 17px; color: #9fb1b8; font-size: 10px; line-height: 1.6; }
.review-points li + li { margin-top: 4px; }
.metrics { margin: 0; display: grid; gap: 8px; }
.metrics div { display: grid; grid-template-columns: 76px 1fr; gap: 8px; }
.metrics dt { color: #6f8993; font-size: 10px; }
.metrics dd { margin: 0; color: #c3d1d5; font-size: 10px; line-height: 1.4; }
.release-note p { margin: 0; color: #849ba4; font-size: 10px; line-height: 1.6; }
.download-button { margin: 12px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid rgba(88,214,199,.34); border-radius: 10px; color: #d3fff9; background: linear-gradient(135deg, rgba(35,111,109,.42), rgba(16,56,64,.55)); text-decoration: none; transition: 150ms ease; }
.download-button:hover { border-color: var(--accent); transform: translateY(-1px); }
.download-button span { font-size: 11px; font-weight: 800; }
.download-button small { color: #7fc5bd; font-size: 9px; }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: 240px 1fr; grid-template-rows: minmax(62vh, 1fr) auto; }
  .detail-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 240px 1fr auto; }
  .detail-panel .panel-heading { border-right: 1px solid var(--line); border-bottom: 0; }
  .detail-scroll { display: grid; grid-template-columns: 1.15fr .8fr .9fr; overflow: visible; }
  .detail-section { border-right: 1px solid var(--line); border-bottom: 0; }
  .download-button { min-width: 190px; align-self: center; }
}
@media (max-width: 760px) {
  .topbar { min-height: 82px; padding: 15px 17px; }
  .release-meta { display: none; }
  .workspace { grid-template-columns: 1fr; grid-template-rows: auto minmax(64vh, 1fr) auto; padding: 9px; }
  .sidebar { max-height: 210px; }
  .model-list { display: flex; overflow-x: auto; overflow-y: hidden; }
  .model-group { display: none; }
  .model-button { min-width: 205px; }
  .boundary-note { display: none; }
  .viewer-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { justify-content: flex-start; }
  .detail-panel { grid-column: auto; display: flex; }
  .detail-panel .panel-heading { border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-scroll { display: block; }
  .detail-section { border-right: 0; border-bottom: 1px solid var(--line); }
  .axis-legend { display: none; }
}
