/* Hallmark · macrostructure: Workbench · tone: technical · anchor hue: grass green */
/* Hallmark · pre-emit critique: P4 H4 E4 S5 R5 V5 · contrast: pass (40–41)
 * nav: N9 · footer: Ft2 · genre: modern-minimal · inherited CityTrace theme */
@import url('./tokens.css');
:root { --color-danger: var(--theme-error, #9a3025); }
:root[data-color-scheme] { --color-control: light-dark(#718576, #999999); }
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body { background: var(--color-paper); color: var(--color-ink); font: var(--text-body)/1.8 var(--font-body); }
[hidden] { display: none !important; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: var(--color-accent); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
a:active { color: var(--color-focus); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; }
button, .nav-link, footer a { white-space: nowrap; }
button, .nav-link { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; line-height: 1.4; }
button { padding: var(--space-sm) var(--space-md); border: 1px solid var(--color-control); border-radius: var(--radius-control); background: var(--color-panel); color: var(--color-ink); cursor: pointer; }
button:hover:not(:disabled) { background: var(--color-raised); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--color-accent); color: var(--color-accent-ink); border-color: var(--color-accent); font-weight: 700; }
button.primary:hover:not(:disabled) { outline: 1px solid var(--color-accent); outline-offset: 2px; background: var(--color-accent); }
.shell { width: min(1440px, 100%); margin: auto; padding-inline: var(--space-xl); }
header { display: flex; justify-content: space-between; gap: var(--space-md); align-items: center; min-height: 80px; border-bottom: 1px solid var(--color-line); }
.nav-link { text-decoration: none; }
main { padding-top: var(--space-xl); }
h1, h2, h3 { font-style: normal; min-width: 0; overflow-wrap: anywhere; }
h1 { font-size: var(--text-display); line-height: 1.4; margin: 0 0 var(--space-sm); letter-spacing: -.025em; }
h2 { font-size: var(--text-heading); line-height: 1.6; margin: 0; }
p { margin: var(--space-sm) 0; }
.intro { color: var(--color-muted); max-width: 70ch; }
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-md); margin: var(--space-lg) 0 var(--space-md); }
.controls { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.zoom-controls { display: inline-flex; flex-wrap: wrap; gap: var(--space-xs); }
.zoom-controls button[aria-pressed="true"] { border-color: var(--color-accent); background: var(--color-raised); font-weight: 700; }
.fill-setting { display:flex; align-items:center; gap:var(--space-sm); width:fit-content; margin:var(--space-sm) 0; cursor:pointer; }
.fill-setting input { width:20px; height:20px; accent-color:var(--color-accent); flex:none; }
.dimensions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-md); color: var(--color-muted); font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: var(--text-sm); }
.dimensions span { white-space: nowrap; }
.status { min-height: 28px; margin-bottom: var(--space-sm); color: var(--color-muted); font-size: var(--text-sm); }
.status[data-state="error"] { color: var(--color-danger); }
.status[data-state="success"] { color: var(--color-accent); }
progress { display: block; width: 100%; height: 4px; accent-color: var(--color-accent); margin: 0 0 var(--space-md); }
.comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--color-line); background: var(--color-panel); }
.result { min-width: 0; }
.result + .result { border-left: 1px solid var(--color-line); }
.result-head { display: flex; flex-direction: column; gap: var(--space-xs); align-items: flex-start; padding: var(--space-md) var(--space-lg) 0; }
.result-head span { color: var(--color-muted); font-size: var(--text-sm); }
.result-head .measured { color: var(--color-accent); }
.viewport { position: relative; height: clamp(280px, 34vw, 470px); }
canvas { display: block; width: 100%; height: 100%; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--color-muted); padding: var(--space-lg); text-align: center; }
.result-bottom { padding: 0 var(--space-lg) var(--space-lg); }
.result-bottom p { color: var(--color-muted); font-size: var(--text-sm); min-height: 3.6em; margin-bottom: var(--space-md); }
.footnote { color: var(--color-muted); font-size: var(--text-sm); margin: var(--space-md) 0 var(--space-xl); max-width: 75ch; }
details { border-top: 1px solid var(--color-line); padding-block: var(--space-md); }
summary { cursor: pointer; min-height: 44px; padding-block: var(--space-sm); }
summary:hover, summary:active { color: var(--color-accent); }
details p, details li { color: var(--color-muted); max-width: 75ch; font-size: var(--text-sm); }
ul { padding-left: var(--space-lg); }
footer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-lg); border-top: 1px solid var(--color-line); padding-block: var(--space-lg); margin-top: var(--space-lg); color: var(--color-muted); font-size: var(--text-sm); }
footer a { display: inline-flex; align-items: center; min-height: 44px; }
footer span { display: inline-flex; align-items: center; }
@media (max-width: 760px) {
  .shell { padding-inline: var(--space-md); }
  header { min-height: 68px; }
  .comparison { grid-template-columns: minmax(0, 1fr); }
  .result + .result { border-left: 0; border-top: 1px solid var(--color-line); }
  .viewport { height: clamp(280px, 75vw, 440px); }
  .result-head, .result-bottom { padding-inline: var(--space-md); }
  .result-bottom p { min-height: 0; }
  .toolbar { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { button:active:not(:disabled) { transform: none; } }
html[lang="zh-CN"] body,html[lang="zh-CN"] button{font-family:"PingFang SC","Microsoft YaHei","Noto Sans CJK SC","Noto Sans SC",system-ui,sans-serif}
