:root {
  font-family: system-ui, -apple-system, 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  color: #263442;
  background: #f3f5f7;
  --ink: #263442;
  --muted: #63717f;
  --line: #d9e0e6;
  --accent: #24638f;
  --soft: #edf3f8;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 7px; padding: 10px 14px; min-height: 42px; }
button:hover:not(:disabled) { background: #f0f5f9; border-color: #afc5d6; }
button.primary { background: var(--accent); border-color: var(--accent); color: white; font-weight: 600; }
button.primary:hover:not(:disabled) { background: #1d557c; }
button:focus-visible, summary:focus-visible { outline: 3px solid #77a9ce; outline-offset: 2px; }
input, select { color: var(--ink); background: #fff; border: 1px solid #ccd6df; border-radius: 5px; padding: 10px; width: 100%; min-width: 0; margin-top: 7px; min-height: 43px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button:disabled { color: #89949e; background: #f0f2f4; border-color: #d8dee4; cursor: not-allowed; opacity: .8; }
input[type=checkbox] { accent-color: var(--accent); }
label { display: block; color: #52615e; font-size: 13px; min-width: 0; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { font-size: 20px; margin: 0; letter-spacing: -.5px; }
h2 { font-size: 17px; margin: 0 0 16px; }
h3 { font-size: 14px; margin: 20px 0 12px; }
p { line-height: 1.7; }
.site-header { background: white; border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1440px; margin: auto; padding: 18px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-icon { width: 40px; height: 40px; flex-shrink: 0; }
.brand small { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; }
.module-nav { margin-left: auto; }
.module-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; }
.module-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #526273; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.module-nav a:hover { background: #f2f5f8; }
.module-nav a[aria-current=page] { border-color: #c6d8e6; background: #eaf1f7; color: #205a83; }
.module-nav a:focus-visible { outline: 2px solid #639ac2; outline-offset: 2px; }
.module-nav small { color: #5b8078; font-size: 10px; font-weight: 500; }
.wrap { max-width: 1440px; padding: 24px 32px 36px; margin: auto; }
.panel { background: white; border: 1px solid var(--line); border-radius: 7px; padding: 20px; margin-bottom: 16px; min-width: 0; }
.section-toolbar { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(230px, .85fr) auto; gap: 20px; align-items: end; margin-bottom: 0; border-radius: 10px 10px 0 0; border-bottom: 0; padding-bottom: 18px; }
.context-label { color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 8px; }
.section-toolbar .hint { grid-column: 1/-1; margin: 0; }
.badge { display: inline-block; background: #f0f4ef; color: #54665b; padding: 7px 10px; border-radius: 5px; font-size: 12px; line-height: 1.5; }
.buttons { display: flex; gap: 8px; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 10px 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 22px 0 26px; }
.card { background: white; border: 1px solid var(--line); border-radius: 9px; padding: 20px; min-width: 0; }
.card > span { color: var(--muted); font-size: 12px; line-height: 1.6; display: block; }
.card > span:first-child { font-size: 13px; color: #52615e; }
.card strong { display: block; font-size: clamp(23px, 2.3vw, 32px); letter-spacing: -.7px; line-height: 1.8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card em { font-size: 13px; color: var(--muted); font-style: normal; font-weight: 400; letter-spacing: 0; }
.workspace-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.workspace-heading h2 { margin: 0; font-size: 18px; }
.workspace-heading .hint { margin: 0; }
.layout { display: grid; grid-template-columns: minmax(300px, .82fr) minmax(0, 1.18fr); gap: 18px; align-items: start; }
.layout > * { min-width: 0; }
.parameter-panel { padding: 0; overflow: hidden; }
.parameter-intro { padding: 22px; }
.parameter-intro h2 { margin-bottom: 8px; }
.parameter-intro .hint { margin: 0 0 15px; }
.parameter-intro button { width: 100%; }
.parameter-group { border-top: 1px solid var(--line); }
summary { cursor: pointer; }
.parameter-group > summary { padding: 17px 22px; font-size: 14px; font-weight: 600; }
.parameter-group > summary small { display: block; margin: 5px 0 0 17px; font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.group-body { padding: 0 22px 20px; }
.group-body > .hint:first-child { margin-top: 0; }
.number-wrap { position: relative; }
.number-wrap input { padding-right: 29px; }
.number-wrap > span { position: absolute; right: 10px; top: 19px; color: var(--muted); font-size: 12px; }
.field em { font-style: normal; color: var(--muted); font-size: 12px; }
.wall-editor, .haunch-editor { border: 1px solid var(--line); border-radius: 7px; padding: 12px; margin-top: 12px; }
.wall-editor-title { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; font-size: 13px; }
.auto-height { color: #826019; font-size: 12px; }
.auto-height.invalid { color: #ae3827; }
.wall-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wall-inputs .field:last-child { grid-column: 1/-1; }
.haunch-editor summary { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.haunch-editor summary span:last-child { color: var(--muted); font-size: 12px; }
.corner-head, .corner-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: center; font-size: 13px; }
.corner-head { color: var(--muted); margin-top: 13px; }
.corner-row { margin-top: 8px; }
.corner-row input { margin: 0; }
.batch-editor { background: #f4f6f2; border-radius: 6px; padding: 12px; }
.batch-editor summary { font-size: 13px; }
.batch-editor button { margin-top: 12px; width: 100%; }
.diagram-scroll { overflow-x: auto; max-width: 100%; border: 1px solid #edf0ec; border-radius: 7px; }
.diagram-scroll svg { display: block; width: 100%; min-width: 560px; }
.dim-label, .cell-size, .plate-label { font-size: 14px; fill: #52666d; font-family: inherit; }
.cell-label { font-size: 16px; fill: #52666d; font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 15px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i, .formula-title i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.bottom-color { background: #27a99b; }
.wall-color { background: #5288c4; }
.top-color { background: #edb356; }
.haunch-color { background: #9a7dc4; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -22px 22px; padding: 0 18px 12px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; color: var(--muted); white-space: nowrap; padding: 9px 13px; }
.tabs button.active { color: #205a83; background: #eaf1f7; font-weight: 600; }
.view { min-width: 0; }
.result-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.result-heading h2 { margin: 0; }
.result-heading span { color: var(--muted); font-size: 12px; }
.formula-row { border-bottom: 1px solid var(--line); }
.formula-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 0; }
.formula-title h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0; }
.formula-title h3::after { content: '⌄'; color: var(--muted); margin-left: 5px; font-size: 14px; }
.formula-row[open] .formula-title h3::after { content: '⌃'; }
.formula-title strong { font-size: 23px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.formula-title small { font-size: 13px; color: var(--muted); font-weight: 400; }
.symbolic { color: #52615e; font-size: 13px; margin: 0 0 10px; }
.numeric { background: #f5f7f3; font-family: Consolas, 'Microsoft YaHei', monospace; font-size: 13px; line-height: 1.8; padding: 12px; border-radius: 6px; overflow-wrap: anywhere; margin: 0 0 10px; }
.formula-sub { color: var(--muted); font-size: 12px; margin: 10px 0 18px; }
.note { background: #f1f7f1; border-left: 3px solid #a0bbab; padding: 13px 15px; font-size: 13px; line-height: 1.8; margin-top: 14px; }
#haunch-summary { display: flex; gap: 10px; margin-top: 18px; border-left-color: #9a7dc4; background: #f7f5fa; }
#haunch-summary p { margin: 5px 0 0; font-size: 12px; color: var(--muted); }
.check-disclosure { margin-top: 18px; border: 1px solid var(--line); border-radius: 7px; padding: 14px; }
.check-disclosure > summary { font-size: 14px; font-weight: 600; }
#check-badge { font-size: 12px; color: #087f75; margin-left: 8px; font-weight: 400; }
#check-badge.error { color: #956215; background: none; padding: 0; }
.check-row { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { padding-bottom: 0; border: 0; }
.check-row > div { min-width: 0; }
.check-row h3 { margin: 0 0 8px; }
.check-row p { font-size: 13px; color: #52615e; margin: 6px 0; }
.check-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; font-size: 13px; }
.pass { background: #e3f3ec; color: #087f75; }
.fail { background: #fcebe6; color: #ae3827; }
.mono { font-family: Consolas, 'Microsoft YaHei', monospace; overflow-wrap: anywhere; }
.height-list { display: grid; gap: 5px; font-size: 13px; color: #52615e; }
.height-list b { color: #826019; }
.check-comparison { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.check-comparison > span { background: #f4f6f2; padding: 10px; border-radius: 5px; font-size: 12px; }
.check-comparison strong { display: block; font-size: 17px; margin-top: 5px; }
.tablewrap { overflow: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { color: var(--muted); background: #f4f6f2; font-weight: 500; text-align: left; }
td, th { padding: 13px 10px; border-bottom: 1px solid var(--line); }
td:last-child, th:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.formula { font-family: Consolas, 'Microsoft YaHei', monospace; color: #52615e; overflow-wrap: anywhere; }
tr.total { font-weight: 700; background: #edf6ef; }
.checks { display: flex; gap: 16px; flex-wrap: wrap; margin: 14px 0; }
.checks label { display: flex; align-items: center; gap: 6px; }
.checks input { width: 18px; min-height: 18px; margin: 0; }
.error { background: #fceeea; color: #ae3827; padding: 13px 16px; margin: 18px 0; border-radius: 7px; font-size: 13px; line-height: 1.7; }
.warning { background: #fff5df; color: #865d12; padding: 12px 15px; font-size: 13px; margin-top: 10px; border-radius: 6px; }
.footer { font-size: 12px; color: var(--muted); line-height: 1.8; }
.metadata { padding-top: 12px; margin-top: 10px; border-top: 1px solid var(--line); }
.metadata summary { font-size: 13px; color: var(--muted); }
.metadata-body { padding: 12px 0 0; }
.workspace-switch { display: none; }
.hidden { display: none; }
@media (max-width: 1100px) {
  .layout { grid-template-columns: 310px minmax(0, 1fr); gap: 18px; }
  .header-inner { padding: 16px 24px; }
  .wrap { padding: 20px 24px 32px; }
  .section-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .section-toolbar > .badge { display: none; }
  .card { padding: 16px; }
  .card strong { font-size: 24px; }
  .card > span:last-child { min-height: 38px; }
}
@media (max-width: 760px) {
  .header-inner { padding: 12px 14px; gap: 9px; display: grid; grid-template-columns: minmax(0,1fr) auto; }
  h1 { font-size: 17px; }
  .brand { gap: 9px; }
  .brand-icon { width: 34px; height: 34px; }
  .brand small { font-size: 10px; line-height: 1.4; }
  .module-nav { grid-column: 1/-1; justify-content: stretch; border-top: 1px solid #edf0f3; padding-top: 7px; }
  .module-nav a { flex: 1; justify-content: center; gap: 0; padding: 8px 5px; min-height: 40px; font-size: 12px; }
  .module-nav small { display: none; }
  .wrap { padding: 14px 12px calc(36px + env(safe-area-inset-bottom)); }
  .section-toolbar { padding: 16px; gap: 12px; grid-template-columns: minmax(0, 1fr); border-bottom: 1px solid var(--line); border-radius: 9px; }
  .section-toolbar .hint { font-size: 12px; }
  .context-label { display: block; font-size: 10px; margin-bottom: 4px; }
  input, select { font-size: 16px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 13px 0 18px; }
  .card { padding: 11px; border-radius: 6px; }
  .card strong { font-size: clamp(19px, 5.5vw, 24px); letter-spacing: -.6px; }
  .card em { font-size: 11px; }
  .card > span { font-size: 11px; }
  .card > span:first-child { font-size: 12px; }
  .card > span:last-child { min-height: 36px; }
  .workspace-heading { align-items: center; flex-wrap: wrap; }
  .workspace-heading > .hint { display: none; }
  .workspace-switch { display: flex; background: #e8ece7; border-radius: 7px; padding: 3px; }
  .workspace-switch button { border: 0; background: transparent; padding: 8px 13px; min-height: 40px; font-size: 13px; color: var(--muted); }
  .workspace-switch button[aria-pressed=true] { background: white; color: var(--accent); box-shadow: 0 1px 3px #24323812; font-weight: 600; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .layout[data-mobile-view=results] > .parameter-pane { display: none; }
  .layout[data-mobile-view=parameters] > .results-pane { display: none; }
  .panel { padding: 14px; border-radius: 7px; }
  .parameter-panel { padding: 0; }
  .parameter-intro { padding: 18px; }
  .parameter-group > summary { padding: 16px 18px; }
  .group-body { padding: 0 18px 18px; }
  .tabs { margin: 0 -14px 16px; padding: 0 7px 9px; gap: 0; }
  .tabs button { min-height: 42px; padding: 8px 9px; font-size: 12px; }
  .formula-title strong { font-size: 21px; }
  .result-heading span { font-size: 11px; }
  .legend { gap: 9px 12px; font-size: 11px; }
  .diagram-scroll { position: relative; }
  .diagram-help { display: block; margin-bottom: 0; font-size: 11px; }
  .check-comparison { flex-direction: column; }
  .tablewrap { overflow-x: auto; overscroll-behavior-inline: contain; }
  table { min-width: 520px; }
  .diagram-scroll, .tablewrap { scrollbar-color: #a7b8c6 #edf1f4; }
}
@media (min-width: 761px) { .diagram-help { display: none; } }
@media print {
  :root, body { background: white; color: black; }
  .site-header { border: 0; }
  .header-inner, .wrap { padding: 0; }
  .buttons, .tabs, .workspace-switch, #account-controls, .collaboration, .parameter-intro button { display: none !important; }
  .section-toolbar { border: 0; }
  .layout { display: block; }
  .layout > .parameter-pane, .layout > .results-pane { display: block !important; }
  .panel { break-inside: avoid; }
  .view.hidden { display: block; }
  input, select { border: 0; background: transparent; }
  .diagram-scroll { overflow: visible; }
  .diagram-scroll svg { min-width: 0; }
  .metadata { display: none; }
  .formula-row, .check-disclosure { break-inside: avoid; }
}
