:root {
  color-scheme: light dark;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #172033;
  --muted: #657084;
  --line: #dbe2ec;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eaf1ff;
  --success: #16803c;
  --success-soft: #eaf8ef;
  --warning: #9a5b00;
  --warning-soft: #fff6df;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --shadow: 0 12px 30px rgba(23, 32, 51, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  background: linear-gradient(135deg, #172554 0%, #1d4ed8 58%, #38bdf8 100%);
  color: white;
  padding: 48px 0 72px;
}
.header-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.eyebrow, .step-label { margin: 0 0 8px; font-size: .75rem; font-weight: 800; letter-spacing: .14em; }
.eyebrow { color: #bfdbfe; }
.step-label { color: var(--primary); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.08; }
h2 { margin-bottom: 0; font-size: 1.25rem; }
.subtitle { max-width: 780px; margin-bottom: 0; color: #dbeafe; font-size: 1.05rem; }
.privacy-badge {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  font-size: .86rem;
  font-weight: 700;
}
.main-grid { display: grid; gap: 20px; margin-top: -38px; padding-bottom: 44px; }
.card {
  background: var(--surface);
  border: 1px solid rgba(219, 226, 236, .9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field > span:first-child { font-size: .9rem; font-weight: 700; color: var(--muted); }
input, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 9px 12px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13); }
.input-with-unit { position: relative; }
.input-with-unit input { padding-right: 58px; }
.input-with-unit > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .88rem; pointer-events: none; }
.workflow-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.workflow-tab {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}
.workflow-tab.active { background: var(--surface); color: var(--primary); box-shadow: 0 2px 8px rgba(23,32,51,.08); }
.mode-description { margin: 0 0 18px; color: var(--muted); font-size: .92rem; }
.formula-note { margin-top: 20px; padding: 14px 16px; border-radius: 12px; background: var(--primary-soft); color: #244071; font-size: .9rem; }
.button-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.button { min-height: 40px; border-radius: 10px; padding: 8px 14px; border: 1px solid transparent; font-weight: 750; white-space: nowrap; }
.button-primary { background: var(--primary); color: white; }
.button-primary:hover { background: var(--primary-hover); }
.button-ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.button-ghost:hover { border-color: #aeb9c9; background: var(--surface-soft); }
.file-button { display: inline-flex; align-items: center; }
.file-button input { display: none; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: var(--surface-soft); color: var(--muted); font-size: .82rem; font-weight: 800; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td input { min-width: 130px; }
.action-col { width: 64px; text-align: center; }
.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--danger); font-size: 1.25rem; line-height: 1; }
.icon-button:hover { background: var(--danger-soft); border-color: #f1b6b0; }
.help-text { margin: 10px 2px 0; color: var(--muted); font-size: .84rem; }
code { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.summary-item { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.summary-label { display: block; color: var(--muted); font-size: .8rem; font-weight: 700; }
.summary-value { display: block; margin-top: 3px; font-size: 1.2rem; font-weight: 850; }
.alerts { display: grid; gap: 8px; margin-bottom: 16px; }
.alert { padding: 11px 14px; border-radius: 10px; font-size: .88rem; }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.status { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.status-ok { background: var(--success-soft); color: var(--success); }
.status-warning { background: var(--warning-soft); color: var(--warning); }
.status-error { background: var(--danger-soft); color: var(--danger); }
.empty-cell { text-align: center; color: var(--muted); padding: 28px 14px; }
.notes-card { box-shadow: none; }
.notes-card ul { margin-bottom: 0; padding-left: 1.25rem; color: var(--muted); }
.notes-card li + li { margin-top: 7px; }
.hidden { display: none !important; }
.site-footer { padding: 24px 0 34px; color: var(--muted); text-align: center; font-size: .84rem; }
@media (max-width: 860px) {
  .form-grid, .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-inner { flex-direction: column; }
}
@media (max-width: 560px) {
  .container { width: min(100% - 20px, 1180px); }
  .site-header { padding: 34px 0 64px; }
  .main-grid { margin-top: -30px; }
  .card { padding: 17px; border-radius: 15px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .form-grid, .summary-grid { grid-template-columns: 1fr; }
  .button-row { width: 100%; }
  .button-row .button, .button-row .file-button { flex: 1 1 auto; justify-content: center; }
}
