:root {
  --steel-950: #0f172a;
  --steel-900: #172033;
  --steel-800: #233047;
  --steel-100: #f4f6f8;
  --line: #d9e1ea;
  --text: #1f2937;
  --muted: #64748b;
  --orange: #f97316;
  --blue: #2563eb;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #f4f6f8;
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
}
a { color: inherit; text-decoration: none; }

.site-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--white);
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.08);
}
.top-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px max(20px, calc((100vw - 1180px) / 2));
  background: var(--steel-950);
  color: #dbe5ef;
  font-size: 14px;
}
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  min-height: 72px;
  margin: 0 auto;
  padding: 0 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 6px;
  background: var(--steel-950);
  color: var(--orange);
  font-weight: 800;
}
.brand strong { display: block; color: var(--steel-950); font-size: 19px; }
.brand em { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; font-style: normal; }
.home-link {
  padding: 12px 18px;
  border-radius: 6px;
  background: var(--orange);
  color: white;
  font-weight: 700;
}

main { max-width: 1180px; margin: 0 auto; padding: 34px 20px 52px; }
.hero {
  display: grid;
  grid-template-columns: 1fr 330px;
  gap: 24px;
  align-items: stretch;
  padding: 34px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, #172033, #233047);
  color: white;
  box-shadow: var(--shadow);
}
.eyebrow { margin: 0 0 10px; color: #93c5fd; font-size: 13px; font-weight: 800; letter-spacing: 0; }
.hero h1 { margin: 0; font-size: 38px; line-height: 1.18; letter-spacing: 0; }
.lead { max-width: 760px; margin: 18px 0 0; color: #dbe5ef; font-size: 17px; line-height: 1.85; }
.hero-panel {
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.34);
}
.hero-panel span { color: #bfdbfe; font-size: 13px; font-weight: 700; }
.hero-panel strong { display: block; margin-top: 12px; font-size: 22px; line-height: 1.45; }
.hero-panel p { margin: 18px 0 0; color: #e2e8f0; line-height: 1.7; }

.calculator-shell, .info-grid article {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}
.calculator-shell { padding: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.section-head h2, .card-title h2, .info-grid h2 { margin: 0; color: var(--steel-950); }
.category-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.category-tab {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--steel-900);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.category-tab:hover { transform: translateY(-2px); border-color: #93c5fd; }
.category-tab.active { background: var(--steel-950); color: white; border-color: var(--steel-950); }
.tab-icon { color: var(--orange); font-weight: 900; }

.work-area {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
  gap: 22px;
  margin-top: 22px;
}
.input-card, .result-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.card-title { margin-bottom: 18px; }
.card-title p { margin: 8px 0 0; color: var(--muted); line-height: 1.6; }
.form-grid, .advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.field { display: grid; gap: 8px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field span { display: flex; justify-content: space-between; gap: 10px; color: var(--steel-900); font-weight: 800; }
.field em { color: var(--muted); font-size: 12px; font-style: normal; font-weight: 600; }
input, select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: white;
  color: var(--text);
  font: inherit;
  padding: 0 12px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14); }
.input-error { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.field-error, .form-error { min-height: 18px; color: #b91c1c; font-size: 13px; }
.form-error { margin: 12px 0 0; }
.advanced { margin-bottom: 18px; }
details { border: 1px solid var(--line); border-radius: 6px; background: #f8fafc; padding: 14px; }
summary { cursor: pointer; font-weight: 800; color: var(--steel-900); }
.advanced-grid { margin-top: 14px; }
.manual-area { margin-top: 14px; }
.checkline { display: inline-flex; align-items: center; gap: 8px; color: var(--steel-900); font-weight: 700; }
.checkline input { width: 18px; min-height: 18px; }
.manual-meter { margin-top: 14px; max-width: 310px; }
.quantity-field { margin-top: 16px; max-width: 310px; }
.inline-note { grid-column: 1 / -1; margin: 0; color: var(--muted); line-height: 1.7; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(15,23,42,.12); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--orange); color: white; }
.btn.secondary { border-color: var(--line); background: white; color: var(--steel-900); }

.result-card {
  position: sticky;
  top: 116px;
  align-self: start;
  background: var(--steel-950);
  color: white;
}
.result-card .card-title h2 { color: white; }
.result-card .card-title p { color: #cbd5e1; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.result-grid div {
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}
.result-grid .result-main { grid-column: 1 / -1; background: rgba(249, 115, 22, 0.14); border-color: rgba(249, 115, 22, 0.44); }
.result-grid span, .basis span { display: block; color: #bfdbfe; font-size: 13px; font-weight: 800; }
.result-grid strong { display: block; margin-top: 10px; font-size: 22px; line-height: 1.2; word-break: break-word; }
.result-main strong { font-size: 34px; color: #fff7ed; }
.basis { margin-top: 16px; padding: 16px; border-radius: 6px; background: rgba(255,255,255,.06); }
.basis p, .notice { margin: 10px 0 0; color: #dbe5ef; line-height: 1.7; }
.copy-status { min-height: 20px; color: #93c5fd; font-weight: 700; }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.info-grid article { padding: 22px; }
.info-grid p { color: #475569; line-height: 1.75; }
.info-grid a { color: var(--blue); font-weight: 800; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 24px;
  padding: 26px 20px;
  background: var(--steel-950);
  color: #cbd5e1;
}
.site-footer strong { color: white; }
.site-footer a { color: #93c5fd; }

@media (max-width: 900px) {
  .top-line { display: none; }
  .brand-bar { min-height: 64px; }
  .brand em { display: none; }
  .home-link { padding: 10px 12px; }
  main { padding: 20px 14px 38px; }
  .hero, .work-area, .info-grid { grid-template-columns: 1fr; }
  .hero { padding: 24px; }
  .hero h1 { font-size: 29px; }
  .category-tabs { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .advanced-grid, .result-grid { grid-template-columns: 1fr; }
  .result-card { position: static; }
}

@media (max-width: 480px) {
  .brand strong { font-size: 16px; }
  .logo-mark { width: 38px; height: 38px; }
  .category-tabs { grid-template-columns: 1fr; }
  .calculator-shell, .input-card, .result-card { padding: 16px; }
  .result-main strong { font-size: 28px; }
}
