/* 绿电直连源荷储测算 — navy platform identity, consistent with the product family. */

@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-400.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-500.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-600.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Bomi Display';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/noto-sans-sc-display-800.ttf?v=2') format('truetype');
}

:root {
  color-scheme: light;

  --navy-deep: #132936;
  --navy: #1a3548;
  --navy-soft: #24536b;
  --ink: #10182d;
  --body: #4c566d;
  --muted: #5f6a7f;
  --line: #dce5ed;
  --mist: #f2f6f9;
  --white: #ffffff;
  --on-navy: #e6eef3;
  --on-navy-muted: #aebfc9;
  --copper: #ce784b;
  --gold: #f2bd42;

  --pv: #e8a317;
  --storage: #2a86d6;
  --grid: #6f8797;
  --pv-dark: #dcaa2b;
  --storage-dark: #5b9cd6;
  --grid-dark: #8fa8b8;
  --pass: #1f8a5d;
  --pass-bg: #e5f4ec;
  --fail: #c0503a;
  --fail-bg: #fbeae6;
  --soc: #2f9e7a;

  --font: 'DM Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wrap: min(100% - 64px, 1012px);
  --header-height: 64px;

  --z-header: 10;
  --z-tooltip: 50;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--white);
  color: var(--ink);
  font: 400 16px/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
figure,
dl,
dd,
ol {
  margin: 0;
}
h1,
h2,
h3 {
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
output {
  font: inherit;
  color: inherit;
}
svg {
  display: block;
}

:focus-visible {
  outline: 3px solid #e9b646;
  outline-offset: 5px;
}
a:focus-visible,
button:focus-visible {
  outline: 3px solid #e9b646;
  outline-offset: 5px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: var(--z-tooltip);
  padding: 10px 16px;
  background: var(--white);
  color: var(--ink);
}
.skip-link:focus {
  top: 12px;
}

.wrap {
  width: var(--wrap);
  margin-inline: auto;
}

section[id] {
  scroll-margin-top: 0;
}
section:focus {
  outline: none;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease);
}
.btn-light {
  background: var(--white);
  color: var(--ink);
}
.btn-light:hover {
  background: #e8eff3;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--navy-deep);
  color: var(--white);
  transition: box-shadow 180ms ease;
}
.site-header.is-scrolled {
  box-shadow: 0 1px 0 rgb(174 191 201 / 20%), 0 5px 18px rgb(0 0 0 / 10%);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--header-height);
  flex-wrap: nowrap;
}
.wordmark {
  display: grid;
  justify-items: start;
  gap: 3px;
  width: max-content;
  line-height: 1.2;
  flex-shrink: 0;
}
.wordmark-cn {
  font-family: 'Bomi Display', var(--font);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1.3px;
  white-space: nowrap;
}
.wordmark-sub {
  width: max-content;
  font-size: 10px;
  letter-spacing: 0.2px;
  color: #e0e9ee;
  white-space: nowrap;
}
.nav {
  display: flex;
  gap: 25px;
  margin-left: auto;
  color: var(--on-navy);
  font-size: 13px;
}
.nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  position: relative;
  white-space: nowrap;
  transition: color 180ms var(--ease);
}
.nav a:hover {
  color: var(--white);
}
.nav a::after {
  content: '';
  position: absolute;
  height: 2px;
  left: 0;
  right: 0;
  bottom: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}
.nav a[aria-current] {
  color: var(--gold);
}
.nav a[aria-current]::after {
  transform: scaleX(1);
}
.menu-toggle {
  display: none;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 84% 50%, rgb(47 90 127 / 16%), transparent 65%), var(--navy-deep);
  color: var(--white);
  min-height: calc(100svh / var(--zoom, 1) - var(--header-height));
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.17fr) minmax(0, 1fr);
  align-items: start;
  gap: 28px;
  padding: 40px 0 28px;
}
.hero-copy {
  padding-top: 10px;
}
.hero h1 {
  font-family: 'Bomi Display', var(--font);
  margin-top: 18px;
  font-size: clamp(39px, 4.66vw, 58px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 2.3px;
}
.hero h1 .line {
  display: block;
  white-space: nowrap;
}
.hero .hero-location {
  font-size: 0.93em;
  line-height: 1.2;
  letter-spacing: 4px;
}
.hero-focus {
  color: var(--gold);
}
.hero-lead {
  max-width: 36em;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.65;
  letter-spacing: 0.6px;
  color: var(--on-navy-muted);
}
.hero-lead .lead-line {
  display: block;
}
.hero-actions {
  margin-top: 50px;
}
.hero-config {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  justify-content: space-between;
  gap: 16px 20px;
  padding-top: 16px;
  margin-top: 38px;
  border-top: 1px solid rgb(255 255 255 / 12%);
}
.hero-config dt {
  font-size: 12px;
  color: var(--on-navy-muted);
}
.hero-config dd {
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-top: 4px;
}

.project-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid rgb(255 255 255 / 0.2);
  border-radius: 999px;
}
.project-switch button {
  min-width: 76px;
  min-height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--on-navy);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 200ms var(--ease), color 200ms var(--ease);
}
.project-switch button:hover {
  color: var(--white);
}
.project-switch button[aria-pressed='true'] {
  background: var(--white);
  color: var(--ink);
}

/* ---------- Clock ---------- */

.clock-figure {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-top: -6px;
  width: calc(100% - 12px);
}
.clock {
  position: relative;
  width: 420px;
  max-width: 100%;
  min-width: 0;
  aspect-ratio: 1;
}
.clock svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.clock .daylight {
  fill: rgb(214 154 18 / 0.55);
}
.clock .nightlight {
  fill: rgb(169 191 204 / 0.25);
}
.clock .dial {
  fill: none;
  stroke: rgb(255 255 255 / 0.12);
}
.clock .sweep {
  opacity: 0;
  transform-box: view-box;
  transform-origin: 50% 50%;
  pointer-events: none;
}
.clock .trail {
  fill: #ffffff;
}
.clock .hand {
  stroke: rgb(255 255 255 / 0.9);
  stroke-width: 2;
  stroke-linecap: round;
}
.clock .hand-tip {
  fill: #ffffff;
  filter: drop-shadow(0 0 6px rgb(255 255 255 / 0.9));
}
.clock .wedge {
  transform-box: view-box;
  transform-origin: 50% 50%;
  transition: opacity 260ms var(--ease), transform 300ms var(--ease), filter 260ms var(--ease);
  cursor: default;
}
.clock.is-focus .wedge {
  opacity: 0.26;
}
.clock.is-focus .wedge.is-active {
  opacity: 1;
  transform: translate(var(--dx), var(--dy)) scale(1.045);
  filter: brightness(1.2) drop-shadow(0 0 14px rgb(255 255 255 / 0.35));
}
.clock .hour-label {
  fill: var(--on-navy-muted);
  font-size: 13px;
}
.clock .center-big {
  fill: var(--white);
  font-size: 46px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.clock .center-small {
  fill: var(--on-navy-muted);
  font-size: 14px;
}
.clock .hit {
  fill: transparent;
  cursor: default;
}
.clock svg:focus {
  outline: none;
}
.clock-figure figcaption {
  display: grid;
  justify-items: center;
  gap: 11px;
}
.clock-hint {
  color: var(--on-navy-muted);
  font-size: 12px;
}

/* ---------- Legends ---------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: var(--body);
  font-size: 13px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.legend-dark {
  gap: 15px;
  font-size: 12px;
  color: var(--on-navy);
}
.legend-dark b {
  margin-left: 4px;
  color: var(--white);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.legend-dark b:empty {
  display: none;
}
.legend-center {
  justify-content: center;
  margin-top: 18px;
}
.key {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--pv);
}
.key-pv {
  background: var(--pv);
}
.key-storage {
  background: var(--storage);
}
.key-grid {
  background: var(--grid);
}
.key-soc {
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: var(--soc);
}
.legend-dark .key-pv {
  background: var(--pv-dark);
}
.legend-dark .key-storage {
  background: var(--storage-dark);
}
.legend-dark .key-grid {
  background: var(--grid-dark);
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(72px, 9vw, 120px) 0;
}
.section-mist {
  background: var(--mist);
}
.section-head {
  max-width: 760px;
  margin-bottom: 44px;
}
.section-head h2 {
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.section-head p {
  margin-top: 14px;
  color: var(--body);
  font-size: 17px;
}

/* ---------- Configure ---------- */

.configure-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}
.controls {
  display: grid;
  gap: 30px;
}
.presets {
  margin: 0;
  padding: 0;
  border: 0;
}
.presets legend {
  margin-bottom: 12px;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
}
.chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.chip {
  display: grid;
  gap: 1px;
  min-height: 52px;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease), color 180ms var(--ease);
}
.chip span {
  font-size: 14px;
  font-weight: 600;
}
.chip small {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.chip:hover {
  border-color: var(--navy-soft);
}
.chip[aria-pressed='true'] {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}
.chip[aria-pressed='true'] small {
  color: var(--on-navy-muted);
}

.control + .control {
  margin-top: 30px;
}
.control-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
.control-head label {
  font-size: 17px;
  font-weight: 600;
}
.numbox {
  display: inline-flex;
  align-items: center;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.numbox:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgb(24 70 93 / 0.15);
}
.numbox input {
  width: 64px;
  height: 100%;
  padding: 0 4px 0 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  outline: none;
}
.numbox-unit {
  min-width: 40px;
  color: var(--muted);
  font-size: 13px;
}
.step {
  display: grid;
  place-items: center;
  width: 38px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: background-color 140ms var(--ease);
}
.step:first-child {
  border-right: 1px solid var(--line);
  border-radius: 5px 0 0 5px;
}
.step:last-child {
  border-left: 1px solid var(--line);
  border-radius: 0 5px 5px 0;
}
.step:hover:not(:disabled) {
  background: var(--mist);
}
.step:disabled {
  color: #b5c2cd;
  cursor: not-allowed;
}
.step svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.range {
  position: relative;
  margin-top: 24px;
  padding-bottom: 26px;
}
.range input[type='range'] {
  --fill: 50%;
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  appearance: none;
  cursor: pointer;
}
.range input[type='range']::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--navy-soft), var(--navy) var(--fill), #e1e9ef var(--fill));
}
.range input[type='range']::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: #e1e9ef;
}
.range input[type='range']::-moz-range-progress {
  height: 8px;
  border-radius: 4px;
  background: var(--navy);
}
.range input[type='range']::-webkit-slider-thumb {
  width: 26px;
  height: 26px;
  margin-top: -9px;
  border: 4px solid var(--white);
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 0 0 1px rgb(24 70 93 / 0.35), 0 3px 10px rgb(16 24 45 / 0.25);
  appearance: none;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.range input[type='range']::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 4px solid var(--white);
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 0 0 1px rgb(24 70 93 / 0.35), 0 3px 10px rgb(16 24 45 / 0.25);
}
.range input[type='range']:hover::-webkit-slider-thumb {
  box-shadow: 0 0 0 6px rgb(24 70 93 / 0.12), 0 3px 10px rgb(16 24 45 / 0.25);
}
.range input[type='range']:active::-webkit-slider-thumb {
  transform: scale(1.1);
}
.range input[type='range']:focus-visible {
  outline: none;
}
.range input[type='range']:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--copper);
}
.range-ticks {
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 0;
  height: 22px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.range-ticks span {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
}
.range-ticks span::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -8px;
  width: 1px;
  height: 5px;
  background: #c3d0da;
}
.range-ref {
  position: absolute;
  top: -16px;
  transform: translateX(-50%);
  color: var(--copper);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}
.range-ref i {
  position: absolute;
  left: 50%;
  top: 17px;
  width: 2px;
  height: 14px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--copper);
}
.duration {
  min-height: 22px;
  margin-top: 6px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--mist);
  color: var(--body);
  font-size: 14px;
}

/* ---------- Result panel ---------- */

.result {
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  box-shadow: 0 24px 60px -32px rgb(16 24 45 / 0.28);
}
.result-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
}
.result-label {
  color: var(--body);
  font-size: 16px;
}
.result-figure {
  margin-top: 4px;
  color: var(--ink);
  font-size: clamp(56px, 7vw, 88px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.result-figure .unit {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.42em;
  letter-spacing: 0;
}
.result-badge {
  margin-top: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #e8f0f5;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.result-badge.is-fail {
  background: var(--fail-bg);
  color: var(--fail);
}
.mix-bar {
  display: flex;
  gap: 2px;
  height: 14px;
  margin-top: 26px;
}
.mix-bar span {
  min-width: 2px;
  height: 100%;
}
.mix-bar.is-morphing span {
  transition: flex-grow 700ms var(--ease);
}
.mix-bar span:first-child {
  border-radius: 4px 0 0 4px;
}
.mix-bar span:last-child {
  border-radius: 0 4px 4px 0;
}
.mix-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}
.mix-keys li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--body);
}
.mix-keys b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 28px;
  border-top: 1px solid var(--line);
}
.kpis > div {
  padding: 18px 16px 16px 0;
  border-bottom: 1px solid var(--line);
}
.kpis > div:nth-child(even) {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}
.kpis dt {
  color: var(--body);
  font-size: 14px;
}
.kpi-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
}
.kpi-value b {
  color: var(--ink);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.kpi-value span {
  color: var(--muted);
  font-size: 14px;
}
.kpi-note {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}
.result-status {
  min-height: 20px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}
.result-status.is-error {
  color: #b23b2a;
}
.result.is-busy .result-figure,
.result.is-busy .kpi-value b {
  opacity: 0.55;
  transition: opacity 160ms var(--ease);
}

/* ---------- Tables ---------- */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th,
.table td {
  padding: 9px 10px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12.5px;
}
.table th:first-child,
.table td:first-child {
  text-align: left;
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  padding: 2px 10px;
}
.badge-pass {
  color: var(--pass);
  background: var(--pass-bg);
}
.badge-fail {
  color: var(--fail);
  background: var(--fail-bg);
}
.policy-card {
  margin-bottom: 24px;
}

.sens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(430px, 100%), 1fr));
  gap: 24px;
}

/* ---------- Energy flow ---------- */

.section-navy {
  background: var(--navy-deep);
  color: var(--white);
}
.section-navy .section-head p {
  color: var(--on-navy);
}
.flow-card {
  padding: 28px 0 8px;
  border-top: 1px solid rgb(255 255 255 / 0.12);
}
.flow svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  overflow: visible;
}
.flow-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 12px;
}
.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 6px;
  background: var(--mist);
}
.segmented button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), box-shadow 180ms var(--ease);
}
.segmented button[aria-pressed='true'] {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 3px rgb(16 24 45 / 0.12);
}
.segmented-dark {
  background: rgb(255 255 255 / 0.08);
}
.segmented-dark button {
  color: var(--on-navy);
}
.segmented-dark button:hover {
  color: var(--white);
}
.segmented-dark button[aria-pressed='true'] {
  background: var(--white);
  color: var(--ink);
}
.flow-day {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.flow-day[hidden] {
  display: none;
}
.play {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-radius: 50%;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.play:hover {
  border-color: var(--white);
  background: rgb(255 255 255 / 0.08);
}
.play svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.play .icon-play {
  fill: currentColor;
}
.play[aria-pressed='true'] .icon-play,
.play[aria-pressed='false'] .icon-pause {
  display: none;
}
#flow-hour {
  --fill: 50%;
  width: min(240px, 46vw);
  height: 24px;
  background: transparent;
  appearance: none;
  cursor: pointer;
}
#flow-hour::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #ffffff var(--fill), rgb(255 255 255 / 0.2) var(--fill));
}
#flow-hour::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgb(255 255 255 / 0.2);
}
#flow-hour::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--white);
  appearance: none;
}
#flow-hour::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: var(--white);
}
#flow-time {
  min-width: 64px;
  color: var(--white);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.flow-track {
  fill: none;
  stroke: var(--c);
  stroke-opacity: 0.24;
  stroke-linecap: round;
}
.flow-dots {
  fill: none;
  stroke: color-mix(in srgb, var(--c) 45%, #ffffff);
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px var(--c)) drop-shadow(0 0 2px var(--c));
}
.flow-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 28px;
  pointer-events: stroke;
}
.flow-link:hover .flow-track {
  stroke-opacity: 0.38;
}
.flow-pill {
  pointer-events: none;
}
.flow-pill rect {
  fill: #132936;
  stroke: var(--c);
  stroke-opacity: 0.7;
}
.flow-pill text {
  fill: var(--white);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.flow-node {
  transition: opacity 400ms var(--ease);
}
.flow-node.is-idle {
  opacity: 0.4;
}
.node-halo {
  fill: var(--c);
  opacity: 0.12;
  transform-box: fill-box;
  transform-origin: center;
  animation: halo 2.8s ease-in-out infinite;
}
.flow-node.is-idle .node-halo {
  animation: none;
  opacity: 0;
}
@keyframes halo {
  0%,
  100% {
    opacity: 0.12;
    transform: scale(1);
  }
  50% {
    opacity: 0.22;
    transform: scale(1.08);
  }
}
.node-disc {
  fill: #132936;
  stroke: var(--c);
  stroke-width: 2.5;
}
.node-icon {
  color: var(--c);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.node-load .node-disc {
  fill: var(--white);
}
.node-load .node-icon {
  color: var(--navy-deep);
}
.node-glyph {
  fill: #e6eef3;
  font-size: 20px;
  font-weight: 600;
}
.node-load .node-glyph {
  fill: #132936;
}
.node-label,
.node-value {
  paint-order: stroke;
  stroke: #132936;
  stroke-width: 6px;
  stroke-linejoin: round;
}
.node-label {
  fill: var(--white);
  font-size: 15px;
  font-weight: 600;
}
.node-value {
  fill: var(--on-navy);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.is-tall .node-label {
  font-size: 17px;
}
.is-tall .node-value,
.is-tall .flow-pill text {
  font-size: 14px;
}
.flow.is-offscreen .flow-dots,
.flow.is-offscreen .node-halo {
  animation-play-state: paused;
}
.flow-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 8px 48px;
  margin-top: 28px;
}
.flow-group-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgb(255 255 255 / 0.22);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
}
.flow-group-title b {
  font-variant-numeric: tabular-nums;
}
.flow-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.flow-group li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 90px;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  color: var(--on-navy);
  font-size: 14px;
}
.flow-group li span {
  color: var(--on-navy-muted);
  font-variant-numeric: tabular-nums;
}
.flow-group li b {
  color: var(--white);
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.flow-note {
  margin-top: 10px;
  color: var(--on-navy-muted);
  font-size: 13px;
  text-align: right;
}

/* ---------- Charts ---------- */

.chart-card {
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  transition: box-shadow 220ms var(--ease);
}
.chart-card:hover {
  box-shadow: 0 18px 40px -28px rgb(16 24 45 / 0.35);
}
.chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  margin-bottom: 18px;
}
.chart-title {
  font-size: 17px;
  font-weight: 600;
}
.chart-sub {
  color: var(--body);
  font-size: 14px;
}
.chart {
  position: relative;
  width: 100%;
}
.chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart .grid line {
  stroke: var(--line);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.chart .axis text {
  fill: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.chart.is-morphing .seg {
  transition: y 760ms var(--ease), height 760ms var(--ease);
  transition-delay: calc(var(--i, 0) * 28ms);
}
.chart.is-morphing .line {
  transition: d 760ms var(--ease);
}
.chart .hit {
  fill: transparent;
}
.chart .hit:hover {
  fill: rgb(16 24 45 / 0.04);
}
.chart .axis-title {
  fill: var(--body);
  font-size: 13px;
}
.chart .soc-axis text {
  fill: var(--soc);
}
.chart .soc-line {
  fill: none;
  stroke: var(--soc);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.heat-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.heat-legend i {
  width: 140px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #eef3f7, #c6d7e4, #8eb0c9, #4d7fa2, #18465d);
}
.heat-cell {
  cursor: default;
}
.heat-cell:hover {
  stroke: var(--ink);
  stroke-width: 1.5;
}
.chart.is-morphing .heat-cell {
  transition: fill 700ms var(--ease);
  transition-delay: calc(var(--i, 0) * 12ms);
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 24px;
  margin-top: 24px;
}

.size-cell {
  cursor: pointer;
  outline: none;
}
.size-cell rect {
  transition: transform 180ms var(--ease), filter 180ms var(--ease);
  transform-box: fill-box;
  transform-origin: center;
}
.size-cell:hover rect,
.size-cell:focus-visible rect {
  transform: scale(0.94);
  filter: brightness(1.06);
}
.size-cell:focus-visible rect {
  stroke: var(--copper);
  stroke-width: 3;
}
.size-value {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.size-axis {
  fill: var(--muted);
  font-size: 12px;
}
.size-marker {
  fill: none;
  stroke: var(--copper);
  stroke-width: 3;
  pointer-events: none;
}
.chart.is-morphing .size-marker {
  transition: x 700ms var(--ease), y 700ms var(--ease);
}
.chart.is-morphing .size-cell rect {
  transition: transform 180ms var(--ease), filter 180ms var(--ease), fill 600ms var(--ease), fill-opacity 600ms var(--ease);
}
.marker-key {
  display: inline-block;
  width: 16px;
  height: 12px;
  margin-right: 6px;
  border: 2.5px solid var(--copper);
  border-radius: 3px;
  vertical-align: -1px;
}

/* ---------- Method ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  border-top: 1px solid #c9d6e0;
}
.steps li {
  position: relative;
  padding: 30px 32px 6px 0;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
}
.steps h3 {
  font-size: 20px;
  font-weight: 600;
}
.steps p {
  margin-top: 8px;
  max-width: 24em;
  color: var(--body);
}
.method-note {
  margin-top: 40px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Footer & tooltip ---------- */

.site-footer {
  background: var(--navy-deep);
  color: var(--on-navy-muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 0;
  justify-content: flex-start;
}

.tooltip {
  position: fixed;
  z-index: var(--z-tooltip);
  min-width: 170px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 12px 30px rgb(16 24 45 / 0.3);
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
}
.tooltip strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}
.tooltip table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.tooltip td:last-child {
  padding-left: 14px;
  text-align: right;
}
.tooltip .key {
  display: inline-block;
  margin-right: 6px;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .intro .hero h1 .line,
  .intro .reveal-hero {
    animation: rise 900ms var(--ease) both;
  }
  .intro .hero h1 .line:nth-child(1) {
    animation-delay: 180ms;
  }
  .intro .hero h1 .line:nth-child(2) {
    animation-delay: 300ms;
  }
  .intro .hero-lead {
    animation-delay: 460ms;
  }
  .intro .hero-actions {
    animation-delay: 580ms;
  }
  .intro .hero-config {
    animation-delay: 700ms;
  }
  .intro .clock-figure .reveal-hero {
    animation-delay: 1500ms;
  }
  .clock.is-entering .daylight,
  .clock.is-entering .nightlight,
  .clock.is-entering .hour-label {
    animation: fade-in 1200ms var(--ease) 200ms both;
  }
  /* The hand covers one hour every 60 ms; each sector lights up as it passes, then its glow fades. */
  .clock.is-entering .wedge {
    animation: wedge-in 1000ms var(--ease) both;
    animation-delay: calc(300ms + var(--i) * 60ms);
  }
  .clock.is-entering .sweep {
    animation: sweep 1440ms linear 300ms both;
  }
  .clock.is-entering .center-big,
  .clock.is-entering .center-small {
    animation: fade-in 900ms var(--ease) 700ms both;
  }
  .hero h1 .line.is-swapping {
    animation: swap-in 600ms var(--ease) both;
  }

  .motion .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 800ms var(--ease), transform 800ms var(--ease);
  }
  .motion .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
  .motion .configure-grid.reveal .result {
    transition: transform 800ms var(--ease) 120ms;
  }

  .chip,
  .chart-card,
  .result {
    transition: transform 220ms var(--ease), box-shadow 220ms var(--ease), border-color 180ms var(--ease),
      background-color 180ms var(--ease), color 180ms var(--ease);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes wedge-in {
  0% {
    opacity: 0;
    transform: scale(0.6);
    filter: brightness(1);
  }
  30% {
    opacity: 1;
    transform: scale(1.035);
    filter: brightness(1.75);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: brightness(1);
  }
}
@keyframes swap-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes sweep {
  0% {
    opacity: 0;
    transform: rotate(0deg);
  }
  8% {
    opacity: 1;
  }
  84% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(360deg);
  }
}

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

/* ---------- Responsive ---------- */

@media (min-width: 1500px) {
  :root {
    --wrap: min(100% - 120px, 1280px);
    --header-height: 80px;
  }
  .wordmark-cn {
    font-size: 23px;
  }
  .wordmark-sub {
    font-size: 12px;
  }
  .nav {
    font-size: 15px;
    gap: 34px;
  }
  .hero-grid {
    padding-top: 70px;
    gap: 60px;
  }
  .hero h1 {
    font-size: 65px;
  }
  .clock {
    width: 530px;
  }
}

@media (min-width: 1000px) {
  main > .hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100svh / var(--zoom, 1) - var(--header-height));
  }
  main > .section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100svh / var(--zoom, 1) - var(--header-height));
    padding-block: 56px;
  }
  main > .section > .wrap {
    flex-shrink: 0;
  }
  main > .section .section-head {
    margin-bottom: 32px;
  }
}

@media (min-width: 1000px) and (max-height: 820px) {
  main > .section {
    padding-block: 32px;
  }
  main > .section .section-head {
    margin-bottom: 20px;
  }
  main > .section .section-head h2 {
    font-size: 32px;
  }
}

@media (max-width: 1080px) {
  :root {
    --wrap: min(100% - 48px, 920px);
    --header-height: 68px;
  }
  .hero {
    min-height: 0;
  }
  .header-row {
    justify-content: space-between;
  }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 0 12px;
    min-height: 44px;
    border: 1px solid #4d6574;
    border-radius: 3px;
    background: transparent;
    color: var(--white);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
  }
  .menu-toggle span {
    font-size: 19px;
  }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy-deep);
    border-top: 1px solid #344d5c;
    padding: 12px 24px 20px;
    box-shadow: 0 12px 20px rgb(0 0 0 / 15%);
    font-size: 15px;
    gap: 6px;
  }
  .menu-open .nav {
    display: grid;
  }
  .menu-open .menu-toggle span {
    transform: rotate(45deg);
  }
  .hero-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    padding: 45px 0 50px;
    gap: 24px;
  }
  .hero h1 {
    font-size: clamp(30px, 4.2vw, 45px);
    letter-spacing: 1px;
  }
  .clock {
    width: min(100%, 430px);
  }
  .configure-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
  .steps li {
    padding: 26px 0 22px 56px;
    border-bottom: 1px solid #c9d6e0;
  }
  .steps li::before {
    position: absolute;
    left: 0;
    top: 24px;
  }
}

@media (max-width: 700px) {
  :root {
    --wrap: calc(100% - 40px);
    --header-height: 68px;
  }
  .header-row {
    gap: 10px;
  }
  .wordmark {
    flex-shrink: 1;
  }
  .wordmark-cn {
    font-size: clamp(12px, 3.6vw, 18px);
    letter-spacing: 0.4px;
  }
  .wordmark-sub {
    display: none;
  }
  .menu-toggle {
    min-width: 66px;
    padding-inline: 8px;
    font-size: 12px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    padding-top: 26px;
    padding-bottom: 36px;
    gap: 36px;
  }
  .hero h1 {
    font-size: clamp(29px, 7.7vw, 49px);
    line-height: 1.3;
    letter-spacing: 1px;
  }
  .hero-lead {
    font-size: 14px;
    line-height: 1.8;
    margin-top: 20px;
    letter-spacing: 0;
  }
  .hero-config {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 28px;
    padding-top: 20px;
    row-gap: 20px;
  }
  .clock {
    width: min(100%, 410px);
  }
  .section {
    padding: 60px 0;
  }
  .section-head h2 {
    font-size: 28px;
  }
  .section-head p {
    font-size: 14px;
  }
  .chart-card {
    padding: 18px 12px;
  }
  .chart-card > .table:not(.policy-table) {
    display: block;
    overflow-x: auto;
  }
  .result {
    padding: 24px 20px;
  }
  .kpis > div {
    padding-right: 10px;
  }
  .kpis > div:nth-child(even) {
    padding-left: 12px;
  }
  .kpi-value b {
    font-size: 22px;
  }
  .numbox {
    flex-shrink: 0;
  }
}
