:root {
  --ink: #14332f;
  --muted: #71817d;
  --paper: #f8f7f2;
  --surface: #fffefa;
  --line: #e4e8e1;
  --green: #1f685a;
  --green-dark: #123b36;
  --mint: #dcefe5;
  --coral: #e46553;
  --coral-soft: #fff0eb;
  --amber: #d99038;
  --shadow: 0 20px 60px rgba(20, 51, 47, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #e9ede7;
  font-family: Manrope, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; max-width: 1240px; margin: auto; background: var(--paper); box-shadow: 0 0 80px rgba(20, 51, 47, .12); }
.topbar { height: 78px; padding: 0 clamp(20px, 4vw, 52px); display: flex; align-items: center; justify-content: space-between; background: rgba(255,254,250,.88); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; color: #fff; background: var(--green-dark); border-radius: 12px 12px 12px 3px; transform: rotate(-4deg); }
.brand-mark svg { width: 20px; transform: rotate(4deg); }
.brand b { display: block; font-family: "Noto Serif SC", serif; font-size: 21px; line-height: 1; letter-spacing: 1px; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 8px; letter-spacing: 1.6px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn, .avatar { border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; }
.icon-btn:hover { color: var(--green); background: var(--mint); }
.icon-btn svg { width: 19px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; color: var(--green-dark); background: #e8c58f; font-size: 13px; font-weight: 800; }
.main-content { padding: 38px clamp(20px, 4vw, 52px) 130px; min-height: calc(100vh - 78px); }
.page { animation: rise .36s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.eyebrow { color: var(--coral); font: 500 11px "DM Mono", monospace; letter-spacing: 1.8px; text-transform: uppercase; }
h1, h2, h3, p { margin: 0; }
h1 { margin-top: 8px; font: 900 clamp(28px, 5vw, 51px)/1.12 "Noto Serif SC", serif; letter-spacing: -1px; }
h2 { font: 700 24px/1.25 "Noto Serif SC", serif; }
h3 { font-size: 15px; }
.subhead { max-width: 580px; margin-top: 13px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.section-head { display:flex; align-items:flex-end; justify-content:space-between; gap: 16px; margin: 38px 0 16px; }
.section-head p { color: var(--muted); font-size: 12px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr); gap: 22px; align-items: stretch; }
.hero-copy { padding: 32px 0 25px; }
.hero-art { position: relative; overflow: hidden; min-height: 248px; padding: 25px; color:#fff; background: var(--green-dark); border-radius: 24px 24px 4px 24px; }
.hero-art:before { content:""; position:absolute; width: 360px; height: 360px; right:-120px; top:-130px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; box-shadow: 0 0 0 38px rgba(255,255,255,.04), 0 0 0 78px rgba(255,255,255,.035); }
.hero-art:after { content:""; position:absolute; inset: 0; opacity: .12; background-image: radial-gradient(#fff 1px, transparent 1px); background-size: 17px 17px; mask-image: linear-gradient(135deg, #000, transparent 68%); }
.hero-art > * { position: relative; z-index: 1; }
.art-label { color: #a8d3bf; font: 11px "DM Mono", monospace; letter-spacing: 1px; }
.art-number { margin-top: 59px; font: 700 60px/1 "Noto Serif SC", serif; }
.art-note { margin-top: 10px; color: #c1d9cf; font-size: 12px; }
.quick-actions { display:flex; flex-wrap: wrap; gap:10px; margin-top: 25px; }
.btn { border: 1px solid transparent; display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height: 42px; padding: 0 17px; border-radius: 10px; font-size: 13px; font-weight: 700; transition: .2s ease; }
.btn svg { width: 16px; }
.btn-primary { color:#fff; background: var(--green); box-shadow: 0 8px 18px rgba(31,104,90,.17); }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.btn-soft { color: var(--green); background: var(--mint); }
.btn-quiet { color: var(--muted); background: transparent; border-color: var(--line); }
.btn-danger { color: var(--coral); background: var(--coral-soft); border-color: #f7c9be; }
.btn:disabled { opacity:.45; cursor:not-allowed; transform:none; }
.stats-grid { display:grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { padding: 20px; background: var(--surface); border:1px solid var(--line); border-radius: var(--radius); }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { margin-top: 8px; font: 800 28px "Noto Serif SC", serif; }
.stat-note { margin-top: 4px; color: var(--green); font-size: 11px; }
.surface { background: var(--surface); border:1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.report-list { display:grid; gap:10px; }
.report-card { display:grid; grid-template-columns: 54px 1fr auto; gap:14px; align-items:center; padding: 16px; background:var(--surface); border:1px solid var(--line); border-radius: 15px; transition:.2s; }
.report-card:hover { border-color: #b7d6c8; transform: translateY(-2px); box-shadow:var(--shadow); }
.date-stamp { width: 54px; height: 54px; display:grid; place-items:center; text-align:center; color:var(--green-dark); background:var(--mint); border-radius: 13px; font: 600 11px/1.25 "DM Mono", monospace; }
.report-title { font-weight:800; font-size:14px; }
.report-meta { display:flex; flex-wrap:wrap; gap:8px; margin-top:5px; color:var(--muted); font-size:11px; }
.report-side { text-align:right; }
.badge { display:inline-flex; align-items:center; gap:4px; padding: 5px 8px; border-radius: 99px; font-size: 10px; font-weight:800; white-space:nowrap; }
.badge-normal { color:var(--green); background:var(--mint); }
.badge-abnormal { color:var(--coral); background:var(--coral-soft); }
.badge-muted { color:var(--muted); background:#eef0ec; }
.empty { padding: 44px 20px; text-align:center; color:var(--muted); }
.empty svg { width: 34px; height:34px; margin-bottom: 12px; color:#abc6ba; }
.empty p { font-size:13px; line-height:1.7; }
.empty .btn { margin-top:18px; }
.toolbar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between; margin: 22px 0 18px; }
.search { flex: 1 1 240px; position:relative; }
.search svg { position:absolute; left:13px; top:12px; width:16px; color:var(--muted); }
.input, .select, .textarea { width:100%; border:1px solid var(--line); color:var(--ink); background:#fff; border-radius:10px; outline:none; transition:.2s; }
.input, .select { height: 42px; padding: 0 13px; font-size:13px; }
.search .input { padding-left:38px; }
.textarea { min-height: 148px; padding:14px; resize:vertical; line-height:1.7; font-size:13px; }
.input:focus, .select:focus, .textarea:focus { border-color:var(--green); box-shadow:0 0 0 3px rgba(31,104,90,.1); }
.upload-layout { display:grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap:20px; }
.panel { padding:22px; }
.panel-title { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:17px; }
.panel-title p { color:var(--muted); font-size:11px; }
.dropzone { min-height: 252px; display:grid; place-items:center; text-align:center; padding:25px; border:1px dashed #a6c7b7; background: linear-gradient(135deg, #f5fbf6, #fffefa); border-radius:15px; }
.dropzone.dragover { border-color:var(--green); background:var(--mint); }
.dropzone svg { width: 34px; height:34px; color:var(--green); margin-bottom: 13px; }
.dropzone strong { display:block; font-size:14px; }
.dropzone p { margin-top:7px; color:var(--muted); font-size:11px; }
.file-preview { max-width:100%; max-height:290px; border-radius:12px; object-fit:contain; }
.form-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap:13px; }
.field { display:grid; gap:7px; }
.field.full { grid-column:1/-1; }
.field label { color:var(--muted); font-size:11px; font-weight:700; }
.upload-footer { display:flex; justify-content:flex-end; gap:10px; margin-top:17px; }
.notice { display:flex; gap:10px; padding:12px 14px; color:#896029; background:#fff7e7; border:1px solid #f1d6a7; border-radius:11px; font-size:11px; line-height:1.6; }
.notice svg { flex:0 0 auto; width:16px; margin-top:2px; }
.result-summary { display:flex; flex-wrap:wrap; gap:10px; margin:18px 0; }
.summary-pill { padding:10px 14px; background:#f1f6f1; border-radius:10px; font-size:12px; }
.summary-pill b { margin-right:4px; font-size:17px; }
.data-table-wrap { overflow:auto; border:1px solid var(--line); border-radius:12px; }
.data-table { width:100%; border-collapse:collapse; min-width:650px; font-size:12px; }
.data-table th { padding:12px 13px; color:var(--muted); background:#f5f7f3; text-align:left; font-weight:700; }
.data-table td { padding:13px; border-top:1px solid var(--line); vertical-align:middle; }
.data-table tr.abnormal td { background:#fffaf7; }
.data-table tr.abnormal td:first-child { border-left:3px solid var(--coral); }
.value-high, .value-low { font-weight:800; color:var(--coral); }
.value-low { color:#bd7d29; }
.edit-input { width:100%; min-width:70px; padding:7px; border:1px solid #bfd8cb; border-radius:7px; }
.compare-grid { display:grid; grid-template-columns: 290px 1fr; gap:18px; align-items:start; }
.selection-list { display:grid; gap:8px; }
.select-report { display:flex; align-items:center; gap:10px; padding:13px; border:1px solid var(--line); border-radius:11px; background:var(--surface); cursor:pointer; }
.select-report.selected { border-color:#a6cbb9; background:#f1f8f3; }
.select-report input { accent-color:var(--green); }
.select-report small { display:block; margin-top:3px; color:var(--muted); font-size:10px; }
.trend-up { color:var(--coral); font-weight:800; }
.trend-down { color:var(--green); font-weight:800; }
.trend-flat { color:var(--muted); }
.mode-switch { display:flex; gap:4px; padding:4px; border-radius:11px; background:#edf1ec; }
.mode-switch button { flex:1; border:0; padding:9px 13px; color:var(--muted); background:transparent; border-radius:8px; font-size:12px; font-weight:700; }
.mode-switch button.active { color:var(--green-dark); background:#fff; box-shadow:0 2px 8px rgba(20,51,47,.08); }
.markdown { line-height:1.85; font-size:13px; white-space:pre-wrap; }
.markdown h { display:block; margin:19px 0 7px; font:700 18px "Noto Serif SC",serif; }
.settings-grid { max-width:680px; display:grid; gap:13px; }
.setting-actions { display:flex; gap:10px; margin-top:10px; }
.privacy { color:var(--muted); font-size:11px; line-height:1.7; }
.bottom-nav { position:fixed; bottom:0; left:50%; z-index:30; transform:translateX(-50%); width:min(1240px, 100%); height:72px; display:grid; grid-template-columns:repeat(5,1fr); padding:8px 18px max(8px, env(safe-area-inset-bottom)); background:rgba(255,254,250,.92); border-top:1px solid var(--line); backdrop-filter:blur(16px); }
.bottom-nav a { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; color:#8b9893; font-size:10px; font-weight:700; }
.bottom-nav a.active { color:var(--green); }
.bottom-nav svg { width:18px; height:18px; }
.bottom-nav .nav-add { margin-top:-25px; }
.nav-add span { display:grid; place-items:center; width:46px; height:46px; color:#fff; background:var(--coral); border:5px solid var(--paper); border-radius:50%; box-shadow:0 7px 17px rgba(228,101,83,.3); }
.nav-add span svg { width:20px; }
.nav-add label { margin-top:1px; }
.toast { position:fixed; z-index:60; left:50%; bottom:90px; transform:translate(-50%, 20px); padding:11px 16px; color:#fff; background:var(--green-dark); border-radius:9px; opacity:0; pointer-events:none; font-size:12px; transition:.25s; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.modal-backdrop { position:fixed; inset:0; z-index:50; display:grid; place-items:center; padding:20px; background:rgba(18,59,54,.45); backdrop-filter:blur(5px); }
.modal { width:min(560px, 100%); max-height:90vh; overflow:auto; padding:24px; background:var(--surface); border-radius:20px; box-shadow:0 30px 100px rgba(18,59,54,.25); animation:rise .25s ease; }
.modal-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:18px; }
.modal-head h2 { font-size:22px; }
.modal-close { border:0; color:var(--muted); background:transparent; }
@media (max-width: 760px) {
  .main-content { padding-top:24px; }
  .hero-grid, .upload-layout, .compare-grid { grid-template-columns:1fr; }
  .hero-art { min-height:190px; }
  .art-number { margin-top:34px; font-size:48px; }
  .stats-grid { grid-template-columns:repeat(2,1fr); }
  .section-head { margin-top:28px; }
  .report-side { align-self:start; }
}
@media (max-width: 430px) {
  .topbar { height:68px; }
  .main-content { min-height:calc(100vh - 68px); padding-left:16px; padding-right:16px; }
  .brand b { font-size:19px; }
  .hero-copy { padding-top:16px; }
  .quick-actions .btn { flex:1; }
  .panel { padding:16px; }
  .form-grid { grid-template-columns:1fr; }
  .field.full { grid-column:auto; }
  .bottom-nav { padding-left:8px; padding-right:8px; }
}
