:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #17302e;
  background: #f1f3ef;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #17302e;
  --ink-2: #29413e;
  --teal: #0b716a;
  --teal-dark: #0d3633;
  --teal-soft: #e1f1ed;
  --mint: #8ccfc0;
  --lime: #c9eb7d;
  --coral: #ee765f;
  --coral-soft: #fff0eb;
  --amber: #e8a647;
  --paper: #f1f3ef;
  --surface: #fff;
  --surface-soft: #f8faf7;
  --line: #dce3de;
  --line-strong: #c7d2cc;
  --muted: #62736f;
  --quiet: #899692;
  --shadow: 0 18px 55px rgba(26, 54, 49, .08);
  --shadow-soft: 0 3px 18px rgba(26, 54, 49, .055);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { min-width: 320px; min-height: 100%; margin: 0; }
body { background: var(--paper); }
button, input, select, textarea { font: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, label:focus-within { outline: 3px solid rgba(11, 113, 106, .24); outline-offset: 3px; }
.hidden { display: none !important; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 12px 16px; border-radius: 8px; color: white; background: var(--teal); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 100; inset: 0 auto 0 0; display: flex; width: 224px; flex-direction: column; padding: 22px 15px 18px; color: #dcebe7; background: #0d2f2d; overflow: hidden; }
.sidebar::after { position: absolute; right: -140px; bottom: 10%; width: 270px; height: 270px; border: 1px solid rgba(201, 235, 125, .12); border-radius: 50%; box-shadow: 0 0 0 42px rgba(201, 235, 125, .025), 0 0 0 88px rgba(140, 207, 192, .02); content: ""; pointer-events: none; }
.brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 8px 20px; border-bottom: 1px solid rgba(255, 255, 255, .11); color: inherit; text-decoration: none; }
.brand-logo-wrap { display: grid; width: 64px; height: 44px; flex: 0 0 64px; place-items: center; padding: 4px; border-radius: 9px; background: #fff; box-shadow: 0 10px 25px rgba(0, 0, 0, .13); }
.brand-logo-wrap .cnano-logo { display: block; width: 56px; height: 38px; object-fit: contain; }
.brand-copy { display: flex; flex-direction: column; }
.brand-copy strong { color: #fff; font-size: 18px; letter-spacing: .04em; }
.brand-copy small { margin-top: 2px; color: #86aaa5; font-size: 8px; font-weight: 700; letter-spacing: .18em; }
.primary-nav { position: relative; z-index: 1; display: grid; gap: 7px; margin-top: 24px; }
.nav-item { position: relative; display: flex; min-height: 62px; align-items: center; gap: 13px; width: 100%; padding: 0 13px; border: 0; border-radius: 12px; text-align: left; color: #9fbcb7; background: transparent; cursor: pointer; transition: .2s ease; }
.nav-item::before { position: absolute; inset: 12px auto 12px -15px; width: 3px; border-radius: 0 3px 3px 0; background: var(--lime); content: ""; opacity: 0; }
.nav-item:hover { color: white; background: rgba(255, 255, 255, .065); }
.nav-item.active { color: white; background: rgba(225, 241, 237, .11); }
.nav-item.active::before { opacity: 1; }
.nav-icon { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border: 1px solid rgba(255, 255, 255, .12); border-radius: 9px; font-size: 18px; }
.nav-item.active .nav-icon { color: var(--lime); border-color: rgba(201, 235, 125, .2); background: rgba(201, 235, 125, .08); }
.nav-item > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.nav-item b { font-size: 13px; font-weight: 650; }
.nav-item small { margin-top: 4px; color: #658a84; font-size: 7px; font-weight: 700; letter-spacing: .13em; }
.nav-item.active small { color: #99bcb6; }
.sidebar-note { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; margin-top: auto; padding: 14px 12px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; background: rgba(255, 255, 255, .045); }
.privacy-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px rgba(201, 235, 125, .1); }
.sidebar-note div { display: flex; flex-direction: column; }
.sidebar-note strong { color: #e7f2ef; font-size: 11px; }
.sidebar-note small { margin-top: 4px; color: #82a59f; font-size: 9px; }
.sidebar-footer { position: relative; z-index: 1; display: flex; justify-content: space-between; margin-top: 12px; padding: 12px 7px 0; color: #678b85; font-size: 8px; letter-spacing: .12em; }
.sidebar-footer b { color: #8eafa9; font-size: 9px; }

.main-content { min-height: 100vh; padding-left: 224px; }
.topbar { position: sticky; z-index: 60; top: 0; display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 28px; border-bottom: 1px solid rgba(204, 214, 208, .8); background: rgba(250, 251, 248, .92); backdrop-filter: blur(18px); }
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--quiet); font-size: 11px; }
.breadcrumb i { color: #b6c0bc; font-style: normal; }
.breadcrumb strong { color: var(--ink); font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.portal-link { display: inline-flex; min-height: 36px; align-items: center; gap: 6px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--teal); background: white; text-decoration: none; font-size: 9px; font-weight: 700; }
.portal-link:hover { border-color: #a9c8c1; background: var(--teal-soft); }
.portal-link span { font-size: 12px; }
.engine-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.engine-status i { width: 7px; height: 7px; border-radius: 50%; background: #62ad7d; box-shadow: 0 0 0 4px rgba(98, 173, 125, .12); }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: white; cursor: pointer; font-size: 14px; font-weight: 700; }
.mobile-brand { display: none; }
.mobile-brand img { display: block; width: 54px; height: 31px; object-fit: contain; }
.mobile-brand > span { width: 1px; height: 24px; background: var(--line-strong); }
.page { display: none; padding: 36px clamp(22px, 2.8vw, 46px) 64px; }
.page.active { display: block; }
.page-heading { display: flex; max-width: 1700px; min-height: 135px; align-items: flex-start; justify-content: space-between; gap: 40px; margin: 0 auto 28px; }
.page-heading.compact { min-height: 118px; }
.eyebrow { margin-bottom: 10px; color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: .22em; }
.page-heading h1 { max-width: 900px; margin-bottom: 12px; color: var(--ink); font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(30px, 3vw, 46px); font-weight: 500; line-height: 1.12; letter-spacing: -.035em; }
.page-heading h1 em { color: var(--teal); font-style: normal; }
.page-lead { max-width: 720px; margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.privacy-chip { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding: 9px 13px; border: 1px solid #cee1db; border-radius: 999px; color: #37665f; background: #edf8f4; font-size: 10px; white-space: nowrap; }
.privacy-chip span { color: #58a17a; font-size: 9px; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.analysis-layout { display: grid; max-width: 1700px; grid-template-columns: 288px minmax(520px, 1fr) 330px; align-items: start; gap: 16px; margin: auto; }
.control-column, .viewer-column, .result-column { display: grid; min-width: 0; gap: 16px; }
.panel-heading { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 14px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.panel-heading > div { display: flex; align-items: center; gap: 10px; }
.panel-heading h2 { margin: 0; font-size: 13px; font-weight: 750; }
.panel-heading > small { color: var(--quiet); font-size: 8px; letter-spacing: .08em; }
.step-index { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 7px; color: var(--teal); background: var(--teal-soft); font-size: 9px; font-weight: 800; }
.text-button { min-height: 38px; padding: 0 6px; border: 0; color: var(--teal); background: transparent; cursor: pointer; font-size: 10px; font-weight: 700; }

.drop-zone { display: flex; min-height: 142px; flex-direction: column; align-items: center; justify-content: center; margin: 16px; padding: 18px; border: 1px dashed #9cb5af; border-radius: 13px; text-align: center; background: #f8fbf9; cursor: pointer; transition: .2s ease; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--teal); background: #eff8f5; transform: translateY(-1px); }
.drop-zone input, .multi-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-symbol { display: grid; width: 36px; height: 36px; place-items: center; margin-bottom: 10px; border-radius: 50%; color: #fff; background: var(--teal); box-shadow: 0 8px 20px rgba(11, 113, 106, .17); font-size: 22px; font-weight: 300; }
.drop-zone strong { font-size: 12px; }
.drop-zone small { margin-top: 6px; color: var(--quiet); font-size: 9px; }
.file-summary { display: grid; grid-template-columns: 72px minmax(0, 1fr) 32px; align-items: center; gap: 10px; margin: 0 16px 16px; padding: 9px; border: 1px solid var(--line); border-radius: 11px; background: #fafbf9; }
.file-thumb { width: 72px; height: 54px; overflow: hidden; border-radius: 7px; background: #dce3df; }
.file-thumb canvas { display: block; width: 72px; height: 54px; object-fit: cover; }
.file-summary > div:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.file-summary strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.file-summary small { margin-top: 5px; color: var(--quiet); font-size: 8px; }
.file-summary button { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 8px; color: var(--quiet); background: transparent; cursor: pointer; font-size: 18px; }
.file-summary button:hover { color: var(--coral); background: var(--coral-soft); }

.parameter-panel { overflow: hidden; }
.field-group { display: grid; gap: 6px; margin: 16px 18px; }
.field-group label { color: var(--ink-2); font-size: 10px; font-weight: 700; }
.field-group select, .field-group input[type="number"] { width: 100%; min-height: 42px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: white; }
.field-group select { padding: 0 12px; cursor: pointer; }
.field-group input[type="number"] { padding: 0 48px 0 11px; }
.field-group p { margin: -1px 0 0; color: var(--quiet); font-size: 8px; line-height: 1.5; }
.calibration-grid { display: grid; grid-template-columns: 1fr 1fr; padding: 0 18px; gap: 8px; }
.calibration-grid .field-group { margin: 0; }
.input-unit { position: relative; }
.input-unit span { position: absolute; top: 50%; right: 10px; color: var(--quiet); font-size: 9px; transform: translateY(-50%); pointer-events: none; }
.advanced-settings { margin-top: 18px; border-top: 1px solid var(--line); }
.advanced-settings summary { display: flex; min-height: 48px; align-items: center; justify-content: space-between; padding: 0 18px; color: var(--ink-2); cursor: pointer; font-size: 10px; font-weight: 700; list-style: none; }
.advanced-settings summary::-webkit-details-marker { display: none; }
.advanced-settings summary span { color: var(--teal); font-size: 9px; font-weight: 600; }
.advanced-settings[open] summary span { font-size: 0; }
.advanced-settings[open] summary span::after { content: "收起"; font-size: 9px; }
.range-field { margin: 4px 18px 17px; }
.range-field > div { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.range-field label { color: var(--muted); font-size: 9px; }
.range-field output { color: var(--teal); font-size: 9px; font-weight: 750; }
.range-field input { width: 100%; accent-color: var(--teal); cursor: pointer; }
.toggle-row { display: flex; min-height: 54px; align-items: center; gap: 10px; margin: 4px 18px 15px; cursor: pointer; }
.toggle-row > span { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.toggle-row b { font-size: 9px; }
.toggle-row small { margin-top: 3px; color: var(--quiet); font-size: 7px; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle-row i { position: relative; width: 36px; height: 20px; flex: 0 0 36px; border-radius: 10px; background: #cfd8d3; transition: .2s ease; }
.toggle-row i::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); content: ""; transition: .2s ease; }
.toggle-row input:checked + i { background: var(--teal); }
.toggle-row input:checked + i::after { transform: translateX(16px); }
.primary-button { display: flex; width: calc(100% - 36px); min-height: 48px; align-items: center; justify-content: space-between; margin: 4px 18px 18px; padding: 0 17px; border: 0; border-radius: 11px; color: white; background: var(--teal); box-shadow: 0 10px 26px rgba(11, 113, 106, .2); cursor: pointer; font-size: 11px; font-weight: 750; transition: .2s ease; }
.primary-button:hover:not(:disabled) { background: #075f59; transform: translateY(-1px); box-shadow: 0 13px 30px rgba(11, 113, 106, .25); }
.primary-button:disabled { color: #82938f; background: #d8dfdc; box-shadow: none; cursor: not-allowed; }
.primary-button i { font-size: 17px; font-style: normal; }

.viewer-panel { overflow: hidden; }
.viewer-toolbar { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 15px; border-bottom: 1px solid var(--line); }
.view-tabs { display: flex; align-items: center; gap: 3px; padding: 4px; border-radius: 9px; background: #f0f3ef; }
.view-tabs button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 9px; font-weight: 650; }
.view-tabs button.active { color: var(--teal); background: white; box-shadow: 0 2px 8px rgba(30, 56, 50, .08); }
.viewer-actions { display: flex; align-items: center; gap: 4px; }
.viewer-actions span { margin-right: 5px; color: var(--quiet); font-size: 8px; }
.viewer-actions button { min-height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: white; cursor: pointer; font-size: 8px; }
.viewer-actions button:disabled { opacity: .4; cursor: not-allowed; }
.canvas-stage { position: relative; display: grid; min-height: 520px; max-height: 66vh; place-items: center; padding: 18px; background-color: #e9eeea; background-image: linear-gradient(45deg, rgba(255, 255, 255, .45) 25%, transparent 25%), linear-gradient(-45deg, rgba(255, 255, 255, .45) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, .45) 75%), linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, .45) 75%); background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-size: 16px 16px; overflow: auto; }
.canvas-stage.empty { overflow: hidden; }
.canvas-stage canvas { display: none; max-width: 100%; max-height: calc(66vh - 36px); border-radius: 3px; background: #fff; box-shadow: 0 14px 45px rgba(21, 43, 38, .18); object-fit: contain; }
.canvas-stage.ready canvas { display: block; }
.empty-state, .processing-state { display: flex; width: min(340px, 88%); flex-direction: column; align-items: center; text-align: center; }
.empty-state strong, .processing-state strong { margin-top: 18px; font-size: 13px; }
.empty-state p, .processing-state p { margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.7; }
.empty-orbit { position: relative; display: block; width: 78px; height: 78px; border: 1px solid #aec3bd; border-radius: 50%; }
.empty-orbit::before, .empty-orbit::after { position: absolute; inset: 10px; border: 1px solid rgba(11, 113, 106, .18); border-radius: 50%; content: ""; }
.empty-orbit::after { inset: 26px; background: var(--teal); box-shadow: 0 0 0 8px rgba(11, 113, 106, .08); }
.empty-orbit i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
.empty-orbit i:nth-child(1) { top: 9px; left: 13px; }
.empty-orbit i:nth-child(2) { right: 6px; bottom: 21px; background: var(--lime); }
.empty-orbit i:nth-child(3) { bottom: 4px; left: 21px; background: var(--mint); }
.processing-state { position: relative; }
.scanner { position: relative; display: block; width: 150px; height: 96px; overflow: hidden; border: 1px solid #a8bbb6; border-radius: 10px; background: repeating-linear-gradient(0deg, #e4ebe7 0, #e4ebe7 4px, #f5f7f4 5px, #f5f7f4 9px); }
.scanner::after { position: absolute; inset: 0 0 auto; height: 2px; background: var(--coral); box-shadow: 0 0 12px var(--coral); content: ""; animation: scan 1.5s ease-in-out infinite alternate; }
@keyframes scan { to { transform: translateY(94px); } }
.canvas-legend { position: absolute; right: 22px; bottom: 20px; display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 10px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 8px; background: rgba(10, 38, 35, .78); box-shadow: 0 6px 18px rgba(0, 0, 0, .16); backdrop-filter: blur(8px); }
.canvas-legend span { display: flex; align-items: center; gap: 5px; color: #e9f3f0; font-size: 7px; }
.canvas-legend i { display: block; width: 8px; height: 8px; border-radius: 2px; }
.legend-dispersed { background: #1ed6ae; }
.legend-agglomerated { background: #ff765f; }
.legend-roi { border: 1px solid #d9ff80; background: transparent; }
.viewer-footer { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 15px; color: var(--quiet); font-size: 8px; }
.mode-badge { padding: 5px 7px; border-radius: 5px; color: #466b65; background: #e7f2ee; font-size: 7px; font-weight: 750; letter-spacing: .09em; }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-panel { overflow: hidden; }
.chart-panel header, .comparison-chart-panel > header { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 17px; border-bottom: 1px solid var(--line); }
.chart-panel header p, .comparison-chart-panel header p { margin-bottom: 4px; color: var(--teal); font-size: 7px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.chart-panel h2, .comparison-chart-panel h2 { margin: 0; font-size: 11px; }
.chart-panel header > span { color: var(--quiet); font-size: 8px; }
.chart-canvas-wrap { height: 210px; padding: 12px; }
.chart-canvas-wrap canvas, .comparison-canvas-wrap canvas { display: block; width: 100%; height: 100%; }

.score-panel { overflow: hidden; color: white; border-color: #123b38; background: #123b38; box-shadow: 0 18px 45px rgba(13, 47, 45, .14); }
.score-panel > header { display: flex; min-height: 48px; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.score-panel > header span { font-size: 10px; font-weight: 700; }
.score-panel > header small { padding: 5px 7px; border-radius: 5px; color: #9bc5bf; background: rgba(255, 255, 255, .07); font-size: 7px; letter-spacing: .08em; }
.score-hero { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 16px; padding: 22px 18px 16px; }
.score-ring { position: relative; display: grid; width: 88px; height: 88px; place-content: center; border-radius: 50%; text-align: center; background: conic-gradient(var(--lime) 0deg, rgba(255, 255, 255, .11) 0); }
.score-ring::after { position: absolute; inset: 7px; border-radius: 50%; background: #123b38; content: ""; }
.score-ring strong, .score-ring small { position: relative; z-index: 1; }
.score-ring strong { font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.score-ring small { margin-top: -3px; color: #91b2ad; font-size: 7px; }
.score-hero > div:last-child { display: flex; min-width: 0; flex-direction: column; }
.score-hero p { margin-bottom: 5px; color: #8fb6b0; font-size: 8px; }
.score-hero > div:last-child > strong { font-size: 15px; }
.score-hero > div:last-child > span { margin-top: 6px; color: #9cb8b4; font-size: 8px; line-height: 1.5; }
.result-narrative { margin: 0; padding: 14px 18px 17px; border-top: 1px solid rgba(255, 255, 255, .08); color: #b4ccc8; background: rgba(0, 0, 0, .07); font-size: 8px; line-height: 1.7; }
.metrics-panel, .insight-panel { overflow: hidden; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; }
.metric-grid article { display: flex; min-height: 92px; flex-direction: column; justify-content: center; padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric-grid article:nth-child(2n) { border-right: 0; }
.metric-grid article:nth-last-child(-n+2) { border-bottom: 0; }
.metric-grid span { color: var(--muted); font-size: 8px; }
.metric-grid strong { margin-top: 7px; font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 500; line-height: 1; }
.metric-grid small { margin-top: 5px; color: var(--quiet); font-size: 7px; }
.insight-panel ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.insight-panel li { display: grid; grid-template-columns: 25px 1fr; gap: 9px; padding: 12px 15px; border-bottom: 1px solid #edf0ed; }
.insight-panel li:last-child { border-bottom: 0; }
.insight-panel li > span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 7px; font-size: 9px; font-weight: 800; }
.insight-panel li p { margin: 1px 0 0; color: var(--muted); font-size: 8px; line-height: 1.65; }
.insight-panel li.neutral > span { color: var(--teal); background: var(--teal-soft); }
.insight-panel li.good > span { color: #397653; background: #e6f3e9; }
.insight-panel li.warn > span { color: #9a6217; background: #fff3df; }
.insight-panel li.danger > span { color: #a84033; background: var(--coral-soft); }

.compare-upload-grid { display: grid; max-width: 1320px; grid-template-columns: 1fr 1fr; gap: 18px; margin: auto; }
.group-upload { overflow: hidden; }
.group-upload > header { display: flex; min-height: 74px; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); }
.group-upload header div > span { color: var(--teal); font-size: 7px; font-weight: 800; letter-spacing: .17em; }
.group-upload h2 { margin: 5px 0 0; font-size: 14px; }
.group-upload header > strong { padding: 6px 9px; border-radius: 6px; color: var(--teal); background: var(--teal-soft); font-size: 9px; }
.experiment-group { border-top: 3px solid var(--coral); }
.base-group { border-top: 3px solid var(--teal); }
.experiment-group header div > span { color: var(--coral); }
.experiment-group header > strong { color: #a94d3b; background: var(--coral-soft); }
.multi-drop { display: flex; min-height: 130px; flex-direction: column; align-items: center; justify-content: center; margin: 18px; border: 1px dashed #a6bbb5; border-radius: 13px; background: #f8faf8; cursor: pointer; }
.multi-drop:hover { border-color: var(--teal); background: #f0f8f5; }
.experiment-group .multi-drop:hover { border-color: var(--coral); background: #fff7f4; }
.multi-drop > span { font-size: 25px; font-weight: 300; }
.multi-drop strong { margin-top: 5px; font-size: 11px; }
.multi-drop small { margin-top: 5px; color: var(--quiet); font-size: 8px; }
.file-list { display: grid; gap: 6px; max-height: 140px; margin: 0; padding: 0 18px 18px; list-style: none; overflow: auto; }
.file-list li { display: flex; min-height: 33px; align-items: center; justify-content: space-between; gap: 10px; padding: 0 10px; border-radius: 7px; color: var(--muted); background: #f5f7f4; font-size: 8px; }
.file-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li b { flex: 0 0 auto; color: var(--quiet); font-size: 7px; font-weight: 500; }
.file-list li.placeholder { justify-content: center; color: var(--quiet); background: transparent; }
.compare-action-bar { display: flex; max-width: 1320px; min-height: 82px; align-items: center; justify-content: space-between; gap: 22px; margin: 18px auto; padding: 14px 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow-soft); }
.compare-action-bar > div { display: flex; align-items: center; gap: 13px; }
.compare-action-bar p { display: flex; flex-direction: column; margin: 0; }
.compare-action-bar p strong { font-size: 11px; }
.compare-action-bar p small { margin-top: 4px; color: var(--quiet); font-size: 8px; }
.compact-button { width: 210px; flex: 0 0 210px; margin: 0; }
.compare-results { display: grid; max-width: 1320px; gap: 18px; margin: 0 auto; }
.compare-summary-grid { display: grid; grid-template-columns: 1.6fr .7fr .7fr; gap: 14px; }
.compare-verdict, .compare-stat { min-height: 128px; padding: 22px; }
.compare-verdict { color: white; border-color: var(--teal-dark); background: var(--teal-dark); }
.compare-verdict p { margin-bottom: 11px; color: var(--mint); font-size: 7px; font-weight: 800; letter-spacing: .15em; }
.compare-verdict h2 { margin-bottom: 8px; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.compare-verdict span { color: #a9c6c1; font-size: 9px; line-height: 1.7; }
.compare-stat { display: flex; flex-direction: column; justify-content: center; border-top: 3px solid var(--teal); }
.compare-stat.accent { border-top-color: var(--coral); }
.compare-stat span { color: var(--muted); font-size: 9px; }
.compare-stat strong { margin-top: 9px; font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.compare-stat small { margin-top: 6px; color: var(--quiet); font-size: 8px; }
.comparison-chart-panel { overflow: hidden; }
.compare-legend { display: flex; gap: 14px; }
.compare-legend span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; }
.compare-legend i { width: 9px; height: 9px; border-radius: 3px; }
.base-color { background: var(--teal); }
.experiment-color { background: var(--coral); }
.comparison-canvas-wrap { height: 350px; padding: 18px 20px 8px; }
.chart-note { margin: 0; padding: 12px 20px 18px; color: var(--quiet); font-size: 8px; line-height: 1.7; }
.comparison-table-panel { overflow: hidden; }
.comparison-table-panel > header { display: flex; min-height: 58px; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); }
.comparison-table-panel h2 { margin: 0; font-size: 12px; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 9px; }
th, td { min-height: 44px; padding: 12px 16px; border-bottom: 1px solid #e9edea; text-align: left; white-space: nowrap; }
th { color: var(--muted); background: #f7f9f6; font-size: 8px; }
td { color: var(--ink-2); }
tbody tr:last-child td { border-bottom: 0; }
.delta-up { color: #3b7a59; }
.delta-down { color: #b45343; }

.method-flow { display: grid; max-width: 1320px; grid-template-columns: repeat(4, 1fr); margin: 0 auto 18px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow-soft); overflow: hidden; }
.method-flow article { position: relative; min-height: 245px; padding: 24px 22px; border-right: 1px solid var(--line); }
.method-flow article:last-child { border: 0; }
.method-flow article:not(:last-child)::after { position: absolute; z-index: 2; top: 37px; right: -12px; display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--teal); background: white; content: "→"; font-size: 10px; }
.method-flow article > span { display: block; color: #cfdbd6; font-family: Georgia, serif; font-size: 42px; }
.method-flow article > i { display: block; margin-top: 22px; color: var(--teal); font-size: 7px; font-style: normal; font-weight: 800; letter-spacing: .15em; }
.method-flow h2 { margin: 7px 0 10px; font-size: 15px; }
.method-flow p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.75; }
.boundary-grid { display: grid; max-width: 1320px; grid-template-columns: 1fr 1fr; gap: 18px; margin: auto; }
.boundary-card { position: relative; min-height: 315px; padding: 28px; overflow: hidden; }
.boundary-card::after { position: absolute; right: -65px; bottom: -85px; width: 210px; height: 210px; border: 30px solid rgba(11, 113, 106, .045); border-radius: 50%; content: ""; }
.boundary-card > p { margin-bottom: 9px; color: var(--teal); font-size: 8px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.boundary-card h2 { margin-bottom: 20px; font-family: Georgia, "Noto Serif SC", serif; font-size: 24px; font-weight: 500; }
.boundary-card ul { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.boundary-card li { position: relative; padding-left: 19px; color: var(--muted); font-size: 10px; }
.boundary-card li::before { position: absolute; left: 0; color: var(--teal); content: "✓"; font-weight: 800; }
.desktop-boundary { color: white; border-color: var(--teal-dark); background: var(--teal-dark); }
.desktop-boundary > p { color: var(--lime); }
.desktop-boundary li { color: #b3cdc8; }
.desktop-boundary li::before { color: var(--lime); }
.desktop-boundary::after { border-color: rgba(201, 235, 125, .05); }
.method-warning { display: grid; max-width: 1320px; grid-template-columns: 150px 1fr; gap: 20px; margin: 18px auto 0; padding: 22px 25px; border-left: 4px solid var(--amber); border-radius: 0 14px 14px 0; background: #fff8ed; }
.method-warning strong { font-size: 12px; }
.method-warning p { margin: 0; color: #756650; font-size: 9px; line-height: 1.8; }

.mobile-nav { display: none; }
.toast { position: fixed; z-index: 500; right: 24px; bottom: 24px; max-width: min(380px, calc(100% - 32px)); padding: 13px 17px; border-radius: 10px; color: white; background: rgba(13, 47, 45, .94); box-shadow: 0 14px 42px rgba(13, 47, 45, .22); opacity: 0; pointer-events: none; transform: translateY(15px); transition: .25s ease; font-size: 10px; line-height: 1.6; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: rgba(149, 58, 46, .96); }

@media (max-width: 1450px) {
  .analysis-layout { grid-template-columns: 272px minmax(470px, 1fr) 300px; }
  .page { padding-inline: 24px; }
  .canvas-stage { min-height: 470px; }
}

@media (max-width: 1322px) {
  .sidebar { width: 78px; padding-inline: 10px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand-logo-wrap { width: 58px; flex-basis: 58px; padding: 3px; }
  .brand-logo-wrap .cnano-logo { width: 52px; }
  .brand-copy, .nav-item > span:last-child, .sidebar-note div, .sidebar-footer span { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item::before { left: -10px; }
  .sidebar-note { justify-content: center; padding-inline: 0; }
  .sidebar-footer { justify-content: center; }
  .main-content { padding-left: 78px; }
  .analysis-layout { grid-template-columns: 270px minmax(0, 1fr); }
  .result-column { grid-column: 1 / -1; grid-template-columns: 1fr 1.3fr 1fr; }
  .score-panel, .metrics-panel, .insight-panel { min-height: 100%; }
  .chart-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  body { padding-bottom: 68px; }
  .sidebar { display: none; }
  .main-content { padding-left: 0; }
  .topbar { min-height: 62px; padding-inline: 16px; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; }
  .mobile-brand strong { font-size: 14px; }
  .breadcrumb { display: none; }
  .engine-status { font-size: 8px; }
  .page { padding: 24px 15px 38px; }
  .page-heading { min-height: auto; margin-bottom: 22px; }
  .page-heading h1 { font-size: 30px; }
  .privacy-chip { display: none; }
  .analysis-layout { grid-template-columns: 1fr; }
  .control-column { grid-template-columns: 1fr 1fr; }
  .result-column { grid-column: auto; grid-template-columns: 1fr; }
  .canvas-stage { min-height: 450px; max-height: 62vh; }
  .canvas-stage canvas { max-height: calc(62vh - 36px); }
  .compare-upload-grid, .boundary-grid { grid-template-columns: 1fr; }
  .compare-summary-grid { grid-template-columns: 1fr 1fr; }
  .compare-verdict { grid-column: 1 / -1; }
  .method-flow { grid-template-columns: 1fr 1fr; }
  .method-flow article:nth-child(2) { border-right: 0; }
  .method-flow article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .method-flow article:nth-child(2)::after { display: none; }
  .mobile-nav { position: fixed; z-index: 110; inset: auto 0 0; display: flex; height: calc(62px + env(safe-area-inset-bottom)); align-items: flex-start; justify-content: space-around; padding: 6px 16px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .96); box-shadow: 0 -8px 25px rgba(22, 46, 41, .06); backdrop-filter: blur(16px); }
  .mobile-nav button { display: flex; min-width: 78px; min-height: 48px; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 10px; color: var(--quiet); background: transparent; cursor: pointer; }
  .mobile-nav button span { font-size: 17px; }
  .mobile-nav button small { font-size: 8px; }
  .mobile-nav button.active { color: var(--teal); background: var(--teal-soft); }
  .toast { right: 16px; bottom: 78px; }
}

@media (max-width: 620px) {
  .topbar-actions .icon-button { display: none; }
  .topbar-actions .engine-status { display: none; }
  .page-heading h1 { font-size: 26px; line-height: 1.2; }
  .page-lead { font-size: 11px; }
  .control-column, .chart-grid { grid-template-columns: 1fr; }
  .canvas-stage { min-height: 360px; }
  .viewer-toolbar { align-items: flex-start; flex-direction: column; padding: 9px 10px; }
  .view-tabs { width: 100%; }
  .view-tabs button { flex: 1; padding-inline: 5px; }
  .viewer-actions { align-self: flex-end; }
  .canvas-legend { right: 12px; bottom: 12px; max-width: calc(100% - 24px); }
  .score-hero { grid-template-columns: 80px 1fr; }
  .score-ring { width: 76px; height: 76px; }
  .compare-action-bar { align-items: stretch; flex-direction: column; }
  .compact-button { width: 100%; flex-basis: auto; }
  .compare-summary-grid { grid-template-columns: 1fr; }
  .compare-verdict { grid-column: auto; }
  .comparison-canvas-wrap { height: 300px; padding-inline: 8px; }
  .comparison-chart-panel > header { align-items: flex-start; flex-direction: column; padding-block: 13px; }
  .method-flow { grid-template-columns: 1fr; }
  .method-flow article { min-height: 210px; border-right: 0; border-bottom: 1px solid var(--line); }
  .method-flow article:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .method-flow article::after { display: none !important; }
  .method-warning { grid-template-columns: 1fr; gap: 8px; }
  .boundary-card { min-height: 290px; padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
