:root {
  --ink: #1c2822;
  --muted: #7b847e;
  --green: #294f3e;
  --green-dark: #1c3d2e;
  --lime: #c9f27b;
  --line: #e4e8e3;
  --paper: #f6f7f3;
  --white: #ffffff;
  --orange: #c86e36;
  --shadow: 0 16px 40px rgba(28, 40, 34, .06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.container { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 247, 243, .92);
  border-bottom: 1px solid rgba(228, 232, 227, .85);
  backdrop-filter: blur(16px);
}
.header-inner { height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; color: var(--lime); background: var(--green); border-radius: 10px; }
.brand-mark svg { width: 26px; height: 26px; }
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-text strong { font-size: 19px; letter-spacing: -.5px; line-height: 1; }
.brand-text small { color: var(--muted); font-size: 10px; letter-spacing: .6px; }
.main-nav { display: flex; align-items: center; gap: 34px; height: 100%; }
.main-nav a { height: 100%; display: flex; align-items: center; position: relative; color: #68726c; font-size: 13px; font-weight: 500; transition: color .2s; }
.main-nav a:hover, .main-nav a.active { color: var(--ink); }
.main-nav a.active::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 22px; height: 3px; border-radius: 3px 3px 0 0; background: var(--green); transform: translateX(-50%); }
.header-tag { display: flex; align-items: center; gap: 7px; color: #69736c; font-size: 11px; white-space: nowrap; }
.header-tag > span { width: 6px; height: 6px; border-radius: 50%; background: #78a867; box-shadow: 0 0 0 4px #e9efe5; }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; padding-top: 56px; padding-bottom: 38px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: #66766b; font-size: 10px; font-weight: 700; letter-spacing: 1.8px; }
.eyebrow span { width: 22px; height: 2px; background: #8bab76; }
h1 { margin: 0; font-size: clamp(34px, 4.2vw, 51px); line-height: 1.2; letter-spacing: -2px; font-weight: 650; }
h1 em { color: var(--green); font-style: normal; position: relative; z-index: 0; isolation: isolate; }
h1 em::after { content: ""; position: absolute; height: 7px; left: 2px; right: 0; bottom: 2px; z-index: -1; background: var(--lime); transform: rotate(-1deg); }
.hero p { margin: 18px 0 0; color: #78817b; font-size: 13px; line-height: 1.9; }
.hero-meta { display: flex; padding: 19px 0 7px; gap: 0; }
.hero-meta > div { display: flex; flex-direction: column; min-width: 96px; padding: 0 23px; border-left: 1px solid #dde3dc; }
.hero-meta > div:first-child { border-left: 0; }
.hero-meta strong { font-size: 25px; line-height: 1.2; letter-spacing: -1px; font-weight: 600; }
.hero-meta span { margin-top: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }

.calculator-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 22px; align-items: stretch; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.form-card { padding: 28px 30px 26px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.section-heading > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.section-heading h2 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.2px; }
.step-number { display: grid; place-items: center; width: 26px; height: 26px; color: var(--green); background: #edf2eb; border-radius: 7px; font-size: 10px; font-weight: 700; letter-spacing: .3px; }
.section-note { color: #929993; font-size: 10px; white-space: nowrap; }
.field-label { display: block; margin-bottom: 8px; color: #66706a; font-size: 11px; font-weight: 500; }
.select-wrap { position: relative; }
.select-wrap select { width: 100%; height: 47px; appearance: none; padding: 0 42px 0 14px; color: var(--ink); background: #fbfcfa; border: 1px solid #dfe5de; border-radius: 9px; outline: none; font-size: 13px; font-weight: 500; transition: border-color .2s, box-shadow .2s; }
.select-wrap select:focus { border-color: #729276; box-shadow: 0 0 0 3px rgba(89, 127, 91, .1); }
.select-wrap > svg { position: absolute; width: 18px; right: 14px; top: 15px; color: #7a867d; pointer-events: none; }
.field-hint { margin: 8px 0 0; color: #909791; font-size: 10px; }
.field-hint strong { color: #66736a; font-weight: 600; }
.section-divider { height: 1px; background: #edf0ec; margin: 25px 0; }

.shape-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.shape-option { min-height: 78px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 10px 5px; color: #7c857e; background: #fbfcfa; border: 1px solid #e3e8e1; border-radius: 9px; transition: .2s ease; }
.shape-option:hover { color: var(--green); border-color: #aabd9f; background: #f7faf3; transform: translateY(-1px); }
.shape-option.active { color: var(--green); border-color: #78936e; background: #f0f6e9; box-shadow: inset 0 0 0 1px #78936e; }
.shape-option svg { width: 35px; height: 25px; }
.shape-option span { font-size: 11px; font-weight: 500; }
.text-button { display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; color: #89928b; background: none; border: 0; font-size: 11px; transition: color .2s; }
.text-button:hover { color: var(--green); }
.text-button:disabled { opacity: .4; }
.text-button svg { width: 14px; height: 14px; }

.dimension-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.dimension-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dimension-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.input-group label { display: block; margin-bottom: 8px; color: #59655d; font-size: 11px; font-weight: 500; }
.optional { color: #a1a7a2; font-size: 10px; font-weight: 400; }
.input-shell { position: relative; }
.input-shell input { width: 100%; height: 45px; padding: 0 38px 0 13px; color: var(--ink); background: #fbfcfa; border: 1px solid #dfe5de; border-radius: 8px; outline: none; font-size: 14px; font-weight: 500; transition: border-color .2s, box-shadow .2s; }
.input-shell input::placeholder { color: #b2b8b2; font-size: 12px; font-weight: 400; }
.input-shell input:focus { border-color: #729276; box-shadow: 0 0 0 3px rgba(89, 127, 91, .1); background: #fff; }
.input-shell input.invalid { border-color: #d38664; box-shadow: 0 0 0 3px rgba(195, 96, 57, .08); }
.input-suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: #9da49e; font-size: 10px; pointer-events: none; }
input[type="number"]::-webkit-inner-spin-button { opacity: .35; }
.quantity-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 15px; }
.validation-message { min-height: 16px; margin: 10px 0 -5px; color: #b65e38; font-size: 11px; line-height: 1.5; }

.result-card { position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 25px 26px 20px; color: #f4f8f2; background: var(--green-dark); border: 1px solid #315441; border-radius: 16px; box-shadow: 0 20px 45px rgba(28, 61, 46, .16); }
.result-card::before { content: ""; position: absolute; width: 340px; height: 340px; right: -190px; top: -180px; border: 1px solid rgba(201, 242, 123, .15); border-radius: 50%; box-shadow: 0 0 0 45px rgba(201, 242, 123, .025), 0 0 0 90px rgba(201, 242, 123, .02); pointer-events: none; }
.result-topline { position: relative; display: flex; align-items: center; justify-content: space-between; color: #c5d2c8; font-size: 11px; }
.live-badge { display: flex; align-items: center; gap: 5px; color: var(--lime); font-size: 9px; letter-spacing: 1px; }
.live-badge i { width: 5px; height: 5px; background: var(--lime); border-radius: 50%; box-shadow: 0 0 0 3px rgba(201, 242, 123, .12); }
.shape-visual { position: relative; height: 118px; display: grid; place-items: center; margin: 7px 0 -2px; }
.shape-visual::before { content: ""; position: absolute; width: 116px; height: 31px; bottom: 10px; border: 1px solid rgba(201, 242, 123, .2); border-radius: 50%; background: rgba(201, 242, 123, .04); transform: rotate(-8deg); }
.shape-visual svg { position: relative; width: 158px; height: 92px; overflow: visible; filter: drop-shadow(0 12px 12px rgba(0, 0, 0, .18)); }
.result-title { position: relative; text-align: center; }
.result-title > span { color: #aebfb3; font-size: 10px; }
.result-title h2 { margin: 4px 0 0; font-size: 19px; font-weight: 550; letter-spacing: .3px; }
.weight-result { margin-top: 22px; text-align: center; }
.result-label { color: #b6c5ba; font-size: 10px; letter-spacing: 1px; }
.weight-number { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-top: 4px; }
.weight-number strong { max-width: 100%; overflow-wrap: anywhere; color: var(--lime); font-size: clamp(38px, 4.5vw, 49px); line-height: 1.18; font-weight: 600; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.weight-number > span { color: #b3c3b7; font-size: 13px; }
.weight-result p { margin: 3px 0 0; color: #8fa598; font-size: 10px; }
.result-breakdown { display: grid; grid-template-columns: 1fr 1fr 1fr; margin-top: 22px; padding: 15px 0; border-top: 1px solid rgba(220, 235, 222, .13); border-bottom: 1px solid rgba(220, 235, 222, .13); }
.result-breakdown > div { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0 6px; border-left: 1px solid rgba(220, 235, 222, .12); min-width: 0; }
.result-breakdown > div:first-child { border-left: 0; }
.result-breakdown span { color: #8fa598; font-size: 9px; white-space: nowrap; }
.result-breakdown strong { color: #e5eee6; font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.price-result { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 17px 0 15px; }
.price-result > div { display: flex; flex-direction: column; gap: 4px; }
.price-result span { color: #b6c5ba; font-size: 10px; }
.price-result small { color: #7f9789; font-size: 9px; }
.price-result > strong { color: var(--lime); font-size: 20px; font-weight: 550; font-variant-numeric: tabular-nums; }
.price-result.inactive { opacity: .5; }
.result-actions { display: flex; gap: 9px; margin-top: auto; }
.primary-button { flex: 1; height: 44px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #203824; background: var(--lime); border: 0; border-radius: 8px; font-size: 12px; font-weight: 650; transition: background .2s, transform .2s; }
.primary-button:hover { background: #d6fa94; transform: translateY(-1px); }
.primary-button:active { transform: translateY(0); }
.primary-button svg { width: 16px; height: 16px; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; color: #c7d6ca; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .15); border-radius: 8px; transition: background .2s; }
.icon-button:hover { background: rgba(255, 255, 255, .12); }
.icon-button svg { width: 17px; height: 17px; }
.result-disclaimer { margin: 13px 0 0; color: #799183; font-size: 8px; line-height: 1.7; text-align: center; }

.lower-layout { display: grid; grid-template-columns: .92fr 1.35fr; gap: 22px; margin-top: 22px; }
.formula-card, .history-card { padding: 26px 28px; min-height: 280px; }
.formula-content { display: flex; align-items: flex-start; gap: 14px; padding: 17px; background: #f6f8f3; border: 1px solid #e7ece3; border-radius: 10px; }
.formula-icon { flex: 0 0 35px; height: 35px; display: grid; place-items: center; color: var(--green); background: #e6efdc; border-radius: 8px; font-family: Georgia, serif; font-size: 21px; font-style: italic; }
.formula-content h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; }
.formula { margin: 0; color: #445d4a; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.formula-detail { margin: 6px 0 0; color: #89928b; font-size: 9px; line-height: 1.7; }
.guide-points { display: flex; flex-direction: column; gap: 9px; margin-top: 17px; }
.guide-points > div { display: flex; align-items: flex-start; gap: 9px; }
.guide-points span { color: #9ba89b; font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; line-height: 1.8; }
.guide-points p { margin: 0; color: #7d867f; font-size: 10px; line-height: 1.8; }
.count-badge { min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; color: #6c786e; background: #f0f3ee; border-radius: 6px; font-size: 9px; font-weight: 600; }
.history-empty { min-height: 175px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.history-empty svg { width: 42px; height: 42px; margin-bottom: 9px; color: #c3cdc1; }
.history-empty p { margin: 0 0 5px; color: #68746a; font-size: 12px; font-weight: 500; }
.history-empty span { color: #a0a7a0; font-size: 9px; }
.history-table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { padding: 0 10px 10px; color: #99a199; border-bottom: 1px solid #e9ede7; font-size: 9px; font-weight: 500; }
td { padding: 12px 10px; color: #5e6961; border-bottom: 1px solid #eef1ec; font-size: 10px; vertical-align: middle; }
td:first-child { color: #34463a; font-weight: 500; }
td small { display: block; margin-top: 3px; color: #9ca49d; font-size: 8px; font-weight: 400; }
td.weight-cell { color: var(--green); font-weight: 650; font-variant-numeric: tabular-nums; }
.delete-button { padding: 4px; color: #a7afa8; background: transparent; border: 0; border-radius: 4px; }
.delete-button:hover { color: #b65e38; background: #fbf0eb; }
.delete-button svg { width: 14px; height: 14px; }
.clear-button { display: block; margin: 13px auto -7px; padding: 4px 8px; color: #a0a8a1; background: none; border: 0; font-size: 9px; }
.clear-button:hover { color: #b65e38; }

.site-footer { margin-top: 50px; border-top: 1px solid #e1e6df; }
.footer-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; color: #9ba39b; font-size: 10px; }
.toast { position: fixed; left: 50%; bottom: 30px; z-index: 50; padding: 11px 18px; color: #f6faf5; background: #23392c; border: 1px solid #45634f; border-radius: 9px; box-shadow: 0 10px 35px rgba(22, 39, 28, .2); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1000px) {
  .container { width: min(100% - 40px, 820px); }
  .calculator-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; }
  .form-card { padding: 24px; }
  .shape-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shape-option { min-height: 70px; }
  .dimension-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-card { padding-inline: 22px; }
  .lower-layout { grid-template-columns: 1fr 1.2fr; gap: 16px; }
  .formula-card, .history-card { padding: 24px; }
  .hero-meta > div { min-width: 80px; padding-inline: 15px; }
}

@media (max-width: 760px) {
  .container { width: calc(100% - 32px); }
  .header-inner { height: 66px; gap: 15px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 8px; }
  .brand-mark svg { width: 23px; height: 23px; }
  .brand-text strong { font-size: 17px; }
  .brand-text small { font-size: 8px; }
  .main-nav { gap: 18px; }
  .main-nav a { font-size: 11px; }
  .main-nav a:last-child, .header-tag { display: none; }
  .hero { display: block; padding-top: 36px; padding-bottom: 27px; }
  h1 { font-size: 36px; letter-spacing: -1.5px; }
  .hero p { font-size: 12px; }
  .desktop-break { display: none; }
  .hero-meta { padding-top: 23px; }
  .hero-meta > div { flex: 1; min-width: 0; padding-inline: 16px; }
  .hero-meta > div:first-child { padding-left: 0; }
  .hero-meta strong { font-size: 22px; }
  .calculator-layout { grid-template-columns: 1fr; gap: 16px; }
  .form-card { padding: 22px 20px; }
  .shape-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .shape-option { min-height: 69px; gap: 5px; }
  .shape-option svg { width: 31px; height: 23px; }
  .shape-option span { font-size: 10px; }
  .dimension-grid, .dimension-grid.three, .dimension-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .quantity-row { gap: 13px; }
  .result-card { padding: 24px; }
  .shape-visual { height: 105px; }
  .weight-number strong { font-size: 48px; }
  .lower-layout { grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
  .formula-card, .history-card { padding: 23px 20px; min-height: auto; }
  .history-empty { min-height: 165px; }
  .site-footer { margin-top: 35px; }
}

@media (max-width: 430px) {
  .brand-text small { display: none; }
  .main-nav { gap: 15px; }
  .hero-meta > div { padding-inline: 12px; }
  .hero-meta span { font-size: 9px; }
  .shape-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shape-option { flex-direction: row; min-height: 49px; justify-content: flex-start; padding: 8px 13px; gap: 10px; }
  .shape-option svg { width: 29px; }
  .dimension-grid, .dimension-grid.three, .dimension-grid.four { grid-template-columns: 1fr 1fr; }
  .section-note { font-size: 9px; }
  .weight-number strong { font-size: 44px; }
  .footer-inner { min-height: 64px; }
  .footer-inner span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
