/* 衡度 — deep green + signal lime. Shared shell: base.css */
:root {
  --accent: #0c7562;
  --accent-dark: #075346;
  --accent-soft: #d6eee6;
  --unit-forest: #113c35;
  --unit-forest-deep: #07231f;
  --unit-mint: #a8ead6;
  --unit-lime: #dff475;
  --unit-lime-deep: #bcdb42;
  --unit-cream: #f7f9e9;
  --unit-line: #ccd8b4;
  --unit-blue: #2f6f8f;
  --unit-coral: #c75837;
}

body {
  background-color: #edf2dd;
  background-image:
    radial-gradient(circle at 94% -5%, rgba(168, 234, 214, .56), transparent 31rem),
    radial-gradient(circle at 4% 42%, rgba(223, 244, 117, .24), transparent 28rem),
    linear-gradient(rgba(17, 60, 53, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 60, 53, .035) 1px, transparent 1px);
  background-size: auto, auto, 28px 28px, 28px 28px;
}

::selection { color: var(--unit-cream); background: var(--accent-dark); }
.brand-mark {
  color: var(--unit-forest-deep);
  background: var(--unit-lime);
  font-family: var(--font-display);
  font-size: 20px;
}
.eyebrow span { background: var(--unit-forest); }
.top-nav a::after { background: var(--unit-lime-deep); }
.site-footer { background: var(--unit-forest-deep); }

/* Hero */
.unit-hero {
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, .82fr);
  gap: clamp(38px, 7vw, 86px);
  padding-block: clamp(50px, 7vw, 92px) 68px;
}
.unit-hero .hero-lead { max-width: 640px; }
.unit-hero .hero-facts span { border-color: var(--unit-line); background: rgba(247, 249, 233, .78); }
.unit-hero h1 { letter-spacing: -.075em; }
.unit-hero h1 em { color: var(--accent-dark); }
.unit-hero h1 em::after {
  left: -.02em;
  right: -.02em;
  height: .18em;
  bottom: .08em;
  background: var(--unit-lime);
  opacity: .85;
}
.precision-note {
  max-width: 640px;
  margin: 24px 0 0;
  padding: 12px 14px;
  color: #475b42;
  background: rgba(247, 249, 233, .66);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 11.5px;
  line-height: 1.75;
}
.precision-note strong { color: var(--unit-forest); }

.unit-board {
  position: relative;
  width: min(100%, 440px);
  justify-self: end;
  overflow: hidden;
  padding: 20px 20px 16px;
  color: #eff8dc;
  background:
    linear-gradient(135deg, rgba(168, 234, 214, .09), transparent 38%),
    var(--unit-forest-deep);
  border: 2px solid var(--ink);
  border-radius: 24px;
  box-shadow: 12px 12px 0 var(--unit-lime);
  transform: rotate(-1.2deg);
}
.unit-board::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(223, 244, 117, .14);
  border-radius: 18px;
  pointer-events: none;
}
.board-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 3px 14px;
  color: #a5b99b;
  border-bottom: 1px dashed rgba(223, 244, 117, .24);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
}
.board-top b {
  padding: 4px 8px;
  color: var(--unit-forest-deep);
  background: var(--unit-lime);
  border-radius: 3px;
  font-size: 8px;
}
.board-main { position: relative; z-index: 1; padding: 24px 4px 21px; }
.board-label {
  margin: 0 0 9px;
  color: var(--unit-mint);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .12em;
}
.board-equation {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  line-height: 1;
}
.board-equation span,
.board-equation em { font-family: var(--font-display); font-size: clamp(25px, 3.2vw, 37px); font-style: normal; }
.board-equation i { color: var(--unit-lime); font-family: var(--font-mono); font-size: 19px; font-style: normal; }
.board-equation strong {
  color: var(--unit-lime);
  font-family: var(--font-mono);
  font-size: clamp(43px, 6vw, 68px);
  letter-spacing: -.08em;
}
.board-sub { margin: 10px 0 0; color: #98ad90; font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; }
.board-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 13px;
  border-top: 1px dashed rgba(223, 244, 117, .24);
}
.board-grid div {
  min-width: 0;
  padding: 10px 11px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(168, 234, 214, .14);
  border-radius: 8px;
}
.board-grid small { display: block; color: #93a88b; font-size: 9px; }
.board-grid strong { display: block; margin-top: 2px; overflow: hidden; color: #f0f8df; font-family: var(--font-mono); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.board-ruler {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 17px;
  margin-top: 16px;
  padding-inline: 2px;
  border-bottom: 1px solid rgba(223, 244, 117, .35);
}
.board-ruler i { width: 1px; height: 5px; background: rgba(223, 244, 117, .48); }
.board-ruler i:nth-child(3n + 1) { height: 11px; background: var(--unit-lime); }

/* Tool layout */
.unit-tool {
  grid-template-columns: minmax(0, 1.16fr) minmax(330px, .84fr);
  gap: 28px;
  scroll-margin-top: 24px;
}
.unit-tool .card { border-radius: 20px; }
.converter-card { background: rgba(249, 251, 238, .97); }
.converter-card .card-heading p:not(.section-index) { max-width: 440px; }
.card-heading.compact { align-items: center; }
.card-heading.compact h2 { font-size: clamp(21px, 2.5vw, 27px); }

.category-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-top: 24px;
  padding: 5px;
  background: #e8eed8;
  border: 1px solid var(--unit-line);
  border-radius: 12px;
}
.category-tab {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 60px;
  padding: 7px 2px;
  color: #58634e;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
  transition: color .15s, background .15s, box-shadow .15s;
}
.category-tab span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(12, 117, 98, .17);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
}
.category-tab:hover { color: var(--ink); background: rgba(255, 255, 255, .55); }
.category-tab.is-active {
  color: var(--unit-cream);
  background: var(--unit-forest);
  box-shadow: 2px 2px 0 var(--unit-lime-deep);
}
.category-tab.is-active span { color: var(--unit-forest-deep); background: var(--unit-lime); border-color: var(--unit-lime); }

.value-field { margin-top: 24px; }
.value-field .field-label,
.unit-picker .field-label,
.batch-target-field .field-label { color: #445140; font-size: 12px; font-weight: 650; }
#valueInput {
  height: 64px;
  padding: 10px 16px;
  color: var(--unit-forest);
  background: #fffef6;
  border: 1.5px solid #849176;
  border-radius: 11px;
  font-family: var(--font-mono);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 650;
  letter-spacing: -.03em;
}
#valueInput:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(12, 117, 98, .13); }

.unit-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  margin-top: 18px;
}
.unit-picker .field { min-width: 0; }
.unit-picker select { height: 50px; min-width: 0; font-size: 13px; font-weight: 600; background-color: #fffef6; }
.swap-button {
  display: grid;
  place-items: center;
  align-content: center;
  width: 64px;
  min-height: 50px;
  padding: 3px;
  color: var(--unit-forest);
  background: var(--unit-lime);
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.swap-button:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.swap-button:active { transform: translate(1px, 1px); box-shadow: none; }
.swap-button span { font-family: var(--font-mono); font-size: 22px; line-height: 1; }
.swap-button small { margin-top: 2px; font-size: 8px; font-weight: 700; letter-spacing: .06em; }
.convert-button { width: 100%; min-height: 52px; margin-top: 20px; font-size: 14px; }
.convert-button span { font-size: 18px; }

.result-stage {
  position: relative;
  overflow: hidden;
  margin-top: 22px;
  padding: 19px;
  background:
    linear-gradient(rgba(12, 117, 98, .035) 1px, transparent 1px) 0 0 / 22px 22px,
    #eff5dd;
  border: 1.5px solid #9bac83;
  border-radius: 14px;
}
.result-stage::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -42px;
  width: 130px;
  height: 130px;
  border: 22px solid rgba(223, 244, 117, .42);
  border-radius: 50%;
  pointer-events: none;
}
.result-kicker {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #62705a;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
}
.result-kicker b {
  padding: 3px 7px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, .62);
  border: 1px solid #aab99a;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
}
.main-result-line {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 11px;
  margin-top: 9px;
  min-width: 0;
}
.main-result-line #result {
  display: inline-block;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
  color: var(--unit-forest);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: clamp(42px, 7vw, 72px);
  font-weight: 650;
  line-height: 1.05;
  letter-spacing: -.065em;
  white-space: normal;
  overflow-wrap: anywhere;
}
.main-result-line > span { color: #3d5147; font-family: var(--font-display); font-size: clamp(19px, 3vw, 29px); line-height: 1.2; }
.main-result-line > span small { display: block; color: #6b7963; font-family: var(--font-mono); font-size: 10px; letter-spacing: .07em; }
.result-meta { position: relative; z-index: 1; margin: 8px 0 0; color: #5c6b55; font-size: 11.5px; line-height: 1.65; }
.result-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.result-actions .button { background: rgba(255, 254, 246, .76); }
.result-actions .lock-dot { margin-left: 2px; }
.result-stage .lock-note { position: relative; z-index: 1; margin: 13px 0 0; }

.quick-pairs-block { margin-top: 23px; padding-top: 20px; border-top: 1px dashed #b8c6a5; }
.quick-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.quick-heading strong { font-size: 13px; }
.quick-heading span { color: #728065; font-size: 10px; }
.quick-pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.quick-pair {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 47px;
  padding: 8px 11px;
  color: var(--unit-forest);
  background: #f7f9e9;
  border: 1px solid #bdc9a8;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  transition: transform .15s, border-color .15s, background .15s;
}
.quick-pair:hover { transform: translateY(-1px); background: #fffef6; border-color: var(--accent); }
.quick-pair > span { flex: 0 0 auto; font-family: var(--font-mono); font-size: 11px; font-weight: 700; }
.quick-pair small { min-width: 0; color: #6c7a61; font-family: var(--font-mono); font-size: 9px; text-align: right; }

/* Side reference */
.side-stack { gap: 20px; }
.inspector-card { background: rgba(255, 252, 242, .88); }
.mini-badge { background: #edf3dc; border-color: var(--unit-line); color: var(--accent-dark); }
.inspector-lead { margin: 14px 0 8px; color: #5b6752; font-size: 12px; }
.unit-list {
  max-height: 328px;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #a2b18c transparent;
}
.unit-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px minmax(88px, auto);
  gap: 8px;
  align-items: baseline;
  min-height: 35px;
  padding: 7px 8px;
  border-bottom: 1px dashed #d3ddc2;
  font-size: 11px;
}
.unit-list-row:last-child { border-bottom: 0; }
.unit-list-row.is-target { background: #edf6d0; border-bottom-color: transparent; border-radius: 6px; }
.unit-list-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-list-row small { overflow: hidden; color: #7c8872; font-family: var(--font-mono); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.unit-list-row strong { color: var(--unit-forest); font-family: var(--font-mono); font-size: 11px; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
.formula-note {
  margin: 15px 0 0;
  padding: 10px 11px;
  color: var(--accent-dark);
  background: #e8f4e9;
  border-left: 3px solid var(--accent);
  border-radius: 0 7px 7px 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.7;
}
.inspector-card .mini-note { margin-top: 10px; }

.favorites-card { background: #f9f7e9; }
.favorites-list { display: grid; gap: 8px; margin-top: 16px; }
.favorites-list .empty-state { margin: 0; padding: 22px 15px; background: #f2f4e2; font-size: 11.5px; }
.favorite-item { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 5px; }
.favorite-load {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 44px;
  padding: 9px 10px;
  color: var(--unit-forest);
  background: #fffdf3;
  border: 1px solid #c2cda9;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}
.favorite-load:hover { border-color: var(--accent); }
.favorite-load span { overflow: hidden; font-size: 11.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.favorite-load small { overflow: hidden; color: #6c7a60; font-family: var(--font-mono); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.favorite-remove {
  min-height: 44px;
  padding: 0;
  color: #7d2d1c;
  background: transparent;
  border: 1px solid #d4c5ad;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 20px;
  cursor: pointer;
}
.favorite-remove:hover { background: #ffe8df; border-color: #bd745f; }

/* Batch */
.batch-section { margin-top: 30px; scroll-margin-top: 24px; }
.batch-card { background: rgba(250, 250, 239, .94); }
.batch-card .card-heading p code { padding: 1px 4px; color: var(--accent-dark); background: #e8efd8; border-radius: 3px; }
.batch-format-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 19px;
  padding: 11px 13px;
  color: #56634e;
  background: #eef2df;
  border: 1px dashed #b6c49f;
  border-radius: 9px;
  font-size: 10.5px;
}
.batch-format-note code {
  padding: 4px 7px;
  color: var(--unit-forest);
  background: #fffdf3;
  border: 1px solid #c8d3b2;
  border-radius: 4px;
  font-size: 10px;
}
.batch-format-note span { margin-left: auto; color: #6d7a62; }
.batch-topline { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-top: 17px; }
.batch-target-field { flex: 1 1 310px; min-width: 0; }
.batch-target-field select { max-width: 360px; background-color: #fffef6; }
.batch-input {
  min-height: 164px;
  margin-top: 14px;
  color: #2e4a40;
  background: #fffef7;
  border-color: #89987a;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.8;
}
.batch-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(12, 117, 98, .12); }
.batch-actions { margin-top: 16px; }
.batch-actions .button-primary { min-width: 160px; }
.batch-table-wrap { margin-top: 17px; border: 1px solid #c4cfb1; border-radius: 10px; background: #fffdf6; }
.batch-table-wrap .empty-state { margin: 0; border: 0; background: transparent; }
.batch-table { min-width: 680px; }
.batch-table th { position: sticky; top: 0; z-index: 1; color: #4b5a43; background: #eaf0db; }
.batch-table td { color: #39463a; font-size: 11.5px; }
.batch-table tr.is-error td { background: #fff0e9; }
.batch-table tr.is-error td:last-child { color: #9b2f19; font-weight: 600; }
.batch-result-cell { color: var(--accent-dark) !important; font-family: var(--font-mono); font-weight: 650; }

/* Shared content accents */
.guide-heading h2 { color: var(--unit-forest); }
.section-index { color: var(--accent-dark); }
.how-to-grid li { background: #fbfcef; }
.how-to-grid li > span { color: var(--unit-forest-deep); background: var(--unit-lime); border: 1px solid var(--ink); }
.faq-list details { background: rgba(251, 252, 239, .78); border-color: #c7d2b4; }
.faq-list summary::after { color: var(--accent-dark); }
.premium-map { background: #fbfcef; border-color: var(--ink); }
.premium-map ul { margin-bottom: 20px; }
.premium-map li span { color: var(--accent-dark); }
.lock-note { color: #65301f; background: #f9e8d5; border-left-color: var(--unit-coral); }

@media (max-width: 1020px) {
  .unit-hero { grid-template-columns: minmax(0, 1fr) minmax(300px, .72fr); gap: 36px; }
  .unit-tool { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr 1fr; }
  .category-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .category-tab:last-child { grid-column: span 2; }
}

@media (max-width: 900px) {
  .unit-hero { grid-template-columns: 1fr; }
  .unit-board { justify-self: start; width: min(100%, 500px); transform: rotate(-.8deg); }
  .unit-hero .hero-copy { max-width: 720px; }
}

@media (max-width: 700px) {
  .site-header { padding: 14px 0; }
  .header-inner { flex-wrap: wrap; gap: 10px 18px; }
  .top-nav { gap: 12px 18px; font-size: 11.5px; }
  .unit-hero { padding-top: 42px; padding-bottom: 50px; }
  .unit-hero .hero-lead { font-size: 14.5px; }
  .unit-board { padding: 17px; box-shadow: 8px 8px 0 var(--unit-lime); }
  .board-equation strong { font-size: 52px; }
  .board-grid { gap: 6px; }
  .category-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .category-tab:last-child { grid-column: auto; }
  .category-tab { min-height: 55px; }
  .unit-picker { grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr); gap: 7px; }
  .swap-button { width: 52px; }
  .unit-picker select { padding-left: 10px; padding-right: 30px; font-size: 11.5px; }
  .quick-pairs { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr; }
  .unit-list { max-height: 290px; }
  .batch-topline { flex-wrap: wrap; }
  .batch-target-field { flex-basis: 100%; }
  .batch-target-field select { max-width: none; }
  .batch-format-note span { margin-left: 0; width: 100%; }
}

@media (max-width: 480px) {
  .header-inner { align-items: flex-start; flex-direction: column; }
  .top-nav { width: 100%; justify-content: space-between; gap: 8px; }
  .top-nav a { min-height: 44px; }
  .unit-hero h1 { font-size: clamp(48px, 17vw, 68px); }
  .unit-board { width: calc(100% - 7px); margin-right: 7px; }
  .board-equation { gap: 4px 7px; }
  .board-equation span,
  .board-equation em { font-size: 24px; }
  .board-equation strong { font-size: 46px; }
  .board-grid strong { font-size: 10.5px; }
  .result-stage { padding: 16px; }
  .main-result-line #result { font-size: clamp(39px, 15vw, 58px); }
  .main-result-line > span { font-size: 19px; }
  .result-actions .button { flex: 1 1 145px; }
  .quick-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .batch-format-note code { font-size: 9.5px; }
  .batch-actions { align-items: stretch; flex-direction: column; }
  .batch-actions .button { width: 100%; }
}

@media (max-width: 400px) {
  .unit-hero { gap: 28px; }
  .category-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-tab { grid-column: auto !important; }
  .unit-picker { grid-template-columns: 1fr 48px; }
  .unit-picker .field:last-child { grid-column: 1 / -1; }
  .swap-button { grid-column: 2; grid-row: 1; width: 48px; }
  .unit-picker .field:first-child { grid-column: 1; }
  .board-grid { grid-template-columns: 1fr; }
  .board-grid div:nth-child(n + 3) { display: none; }
  .unit-list-row { grid-template-columns: minmax(0, 1fr) 46px minmax(76px, auto); }
}

@media (prefers-reduced-motion: reduce) {
  .unit-board { transform: none; }
}
