/* ============================================================
   CutMyBill — 设计系统 v2
   特色：中文优先排版 / 价格可溯源 / 官方 EAB 对账 / 成本条直观排名
   配色：爱尔兰松绿 + 暖金 + 暖纸底
   ============================================================ */
:root {
  --pine: #0d5c46;
  --pine-dark: #093f30;
  --pine-deep: #06281f;
  --emerald: #159c6b;
  --mint: #e8f6f0;
  --gold: #b8862b;
  --gold-soft: #fbf2dd;
  --ink: #0e1c2b;
  --body: #45576a;
  --muted: #7d8b99;
  --paper: #f8f6f1;
  --card: #ffffff;
  --wash: #eef3f0;
  --line: #e2e7e2;
  --line-soft: #eef1ee;
  --danger: #8a2b2b;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(14, 28, 43, .05);
  --shadow: 0 1px 2px rgba(14, 28, 43, .05), 0 14px 34px -22px rgba(14, 28, 43, .35);
  --shadow-lg: 0 2px 4px rgba(14, 28, 43, .06), 0 30px 60px -30px rgba(14, 28, 43, .38);
  --field: #ffffff;
  --field-hover: #ffffff;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.18; letter-spacing: -.02em; font-weight: 800; }
p { margin: 0; }
a { color: var(--pine); text-decoration: none; }
.container { width: min(1180px, 92vw); margin: 0 auto; }

/* ---------- 按钮 ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font: inherit; font-weight: 700;
  border-radius: 999px; padding: 12px 22px; background: var(--wash); color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--pine); color: #fff; box-shadow: 0 10px 24px -14px rgba(13, 92, 70, .8); }
.button.primary:hover { background: var(--pine-dark); }
.button.switch { background: var(--emerald); color: #fff; box-shadow: 0 10px 24px -14px rgba(21, 156, 107, .85); }
.button.switch:hover { background: #10824f; }
.button.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.button.ghost:hover { background: var(--field); border-color: var(--pine); color: var(--pine); }
.button.big { padding: 15px 30px; font-size: 17px; }
.button.full { width: 100%; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(248, 246, 241, .9);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.nav { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: inline-flex; align-items: baseline; gap: 8px; font-weight: 800; font-size: 19px; color: var(--ink); }
.brand-mark { color: var(--gold); font-size: 20px; }
.brand-sub { font-size: 12px; font-weight: 600; color: var(--muted); }
.nav-links { display: flex; gap: 22px; margin-left: 12px; }
.nav-links a { color: var(--body); font-size: 15px; font-weight: 600; }
.nav-links a:hover { color: var(--pine); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-cta { background: var(--pine); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 15px; font-weight: 700; }
.nav-cta:hover { background: var(--pine-dark); color: #fff; }
.language-switcher { position: relative; }
.language-button {
  border: 1.5px solid var(--line); background: var(--field); border-radius: 999px;
  padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; color: var(--ink);
}
.language-menu {
  position: absolute; right: 0; top: calc(100% + 8px); background: var(--field); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 6px; min-width: 132px; z-index: 70;
}
.language-menu button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 12px; border-radius: 8px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink);
}
.language-menu button:hover { background: var(--mint); color: var(--pine); }

/* ---------- 主题切换 ---------- */
.theme-button {
  width: 38px; height: 38px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--field); cursor: pointer; display: grid; place-items: center; font-size: 16px; line-height: 1;
}
.theme-button::before { content: "🌙"; }
[data-theme="dark"] .theme-button::before { content: "☀️"; }
.theme-button:hover { border-color: var(--pine); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 56px 0 0; }
.hero::before {
  content: ""; position: absolute; inset: -30% 40% 20% -20%; pointer-events: none;
  background: radial-gradient(circle at 30% 40%, rgba(21, 156, 107, .16), transparent 62%),
              radial-gradient(circle at 75% 10%, rgba(184, 134, 43, .14), transparent 55%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.08fr .92fr; gap: 46px; align-items: start; padding-bottom: 54px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--pine);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 0 4px rgba(21, 156, 107, .16); }
.eyebrow.center { justify-content: center; }
.hero h1 { font-size: clamp(34px, 4.4vw, 56px); margin-bottom: 18px; }
.hero h1 strong { color: var(--pine); }
.hero-copy { font-size: 17px; color: var(--body); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 30px; }
.trust-row { list-style: none; display: flex; flex-wrap: wrap; gap: 30px; padding: 22px 0 0; margin: 0; border-top: 1px solid var(--line); }
.trust-row li { display: flex; flex-direction: column; gap: 2px; }
.trust-row b { font-size: 24px; letter-spacing: -.02em; }
.trust-row span { font-size: 12.5px; color: var(--muted); }

/* 今日最省 */
.today-card { background: var(--card); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-lg); border: 1px solid var(--line-soft); }
.today-head { display: flex; align-items: center; justify-content: space-between; }
.mini-label { font-size: 12.5px; font-weight: 800; letter-spacing: .06em; color: var(--gold); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(21,156,107,.5); } 50% { opacity: .7; box-shadow: 0 0 0 6px rgba(21,156,107,0); } }
.today-sub { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.today-list { list-style: none; margin: 18px 0 16px; padding: 0; display: flex; flex-direction: column; }
.today-list li { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.today-list li:last-child { border-bottom: 0; }
.today-list .rank { width: 24px; height: 24px; border-radius: 8px; background: var(--wash); color: var(--body); font-size: 12.5px; font-weight: 800; display: grid; place-items: center; }
.today-list li:first-child .rank { background: var(--pine); color: #fff; }
.today-list .sup { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.today-list .plan { font-size: 14.5px; font-weight: 600; }
.today-list .price { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.today-note { font-size: 12px; color: var(--muted); margin-bottom: 16px; }

.tricolor { height: 5px; background: linear-gradient(90deg, var(--pine) 0 34%, #fff 34% 66%, var(--gold) 66% 100%); opacity: .9; }

/* ---------- 计算器 ---------- */
.calculator-section { padding: 64px 0 12px; }
.section-heading { max-width: 46em; margin-bottom: 26px; }
.section-heading.center { text-align: center; margin-inline: auto; }
.section-heading h2 { font-size: clamp(26px, 3vw, 36px); }
.section-heading p { color: var(--body); margin-top: 10px; }
.calculator { background: var(--card); border-radius: var(--radius-lg); padding: 26px; border: 1px solid var(--line-soft); box-shadow: var(--shadow); }
.fuel-tabs { display: inline-flex; gap: 6px; background: var(--wash); padding: 5px; border-radius: 999px; margin-bottom: 22px; }
.fuel-tab { border: 0; background: transparent; font: inherit; font-weight: 700; font-size: 15px; color: var(--body); padding: 9px 20px; border-radius: 999px; cursor: pointer; }
.fuel-tab.active { background: var(--field); color: var(--pine); box-shadow: var(--shadow-sm); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.form-grid label { display: flex; flex-direction: column; gap: 7px; }
.form-grid label > span { font-size: 13.5px; font-weight: 700; color: var(--body); }
.form-grid small { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.input-wrap { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--field); padding: 0 12px; }
.input-wrap:focus-within { border-color: var(--pine); box-shadow: 0 0 0 4px rgba(13, 92, 70, .1); }
.input-wrap b { color: var(--muted); font-size: 13px; font-weight: 700; }
.input-wrap input { border: 0; outline: 0; padding: 12px 0; font: inherit; width: 100%; background: transparent; }
select {
  appearance: none; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 34px 12px 12px; font: inherit; background: var(--field) no-repeat right 12px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237d8b99' stroke-width='2'/%3E%3C/svg%3E");
}
select:focus { outline: 0; border-color: var(--pine); box-shadow: 0 0 0 4px rgba(13, 92, 70, .1); }
.advanced { display: flex; flex-wrap: wrap; gap: 20px; margin: 22px 0 20px; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--body); }
.check input { width: 17px; height: 17px; accent-color: var(--pine); }

/* ---------- 结果区 ---------- */
.results-section { padding: 56px 0 20px; }
.results-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.results-top h2 { font-size: clamp(24px, 2.8vw, 34px); }
#resultSummary { color: var(--body); margin-top: 8px; max-width: 52em; }
.sort-wrap { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.results-bar {
  margin-top: 20px; background: var(--pine-deep); color: #fff; border-radius: var(--radius);
  padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; box-shadow: var(--shadow);
}
.bar-facts { display: flex; gap: 34px; flex-wrap: wrap; }
.bar-facts div { display: flex; flex-direction: column; }
.bar-facts span { font-size: 12px; color: rgba(255, 255, 255, .68); }
.bar-facts b { font-size: 21px; letter-spacing: -.02em; }
.bar-facts b.gold { color: #f2cd7a; }
.bar-hint { font-size: 12.5px; color: rgba(255, 255, 255, .66); max-width: 30em; }
.hint-row { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13.5px; color: var(--body); }
.hint-row .hint-text { font-weight: 600; }
.hint-row .button { background: var(--field); padding: 8px 14px; font-size: 13px; }
.data-note { margin-top: 22px; background: var(--gold-soft); border: 1px solid #f0dfb6; color: #6c5220; padding: 13px 16px; border-radius: var(--radius-sm); font-size: 12.5px; }
.data-note.error { border-color: #f0c2c2; background: #fdf2f2; color: var(--danger); }
.results-list { margin-top: 22px; display: flex; flex-direction: column; gap: 16px; }

/* 结果卡 */
.result-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px 22px; box-shadow: var(--shadow-sm); position: relative;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto; gap: 16px 26px;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.result-card:hover { box-shadow: var(--shadow); border-color: #cfd9d3; }
.result-card.featured { border-color: var(--emerald); box-shadow: 0 0 0 1px var(--emerald), var(--shadow); }
.rank-badge { position: absolute; top: -11px; left: 22px; background: var(--pine); color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .05em; padding: 4px 11px; border-radius: 999px; }
.result-card.featured .rank-badge { background: var(--gold); }
.card-main { min-width: 0; }
.sup-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sup-name { font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.plan-name { font-size: 14.5px; color: var(--body); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.tag { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--wash); color: var(--body); border: 1px solid transparent; white-space: nowrap; }
.tag.green { background: var(--mint); color: #0a6146; }
.tag.gold { background: var(--gold-soft); color: #8a6318; }
.tag.stale { background: #fdeeee; color: #8a2b2b; }
.price-block { display: flex; flex-direction: column; gap: 2px; }
.price-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.annual-price { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.price-sub { font-size: 12.5px; color: var(--muted); }
.saving { font-size: 13px; font-weight: 800; color: var(--gold); }
.card-actions { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 10px; min-width: 148px; }
.card-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 12px; }

/* 成本条 */
.costbar { grid-column: 1 / -1; }
.costbar-track { position: relative; height: 9px; border-radius: 999px; background: linear-gradient(90deg, var(--mint), #f2f4f2); }
.costbar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--emerald), #8fcfae); }
.costbar-marker { position: absolute; top: -5px; width: 3px; height: 19px; border-radius: 2px; background: var(--ink); opacity: .55; }
.costbar-legend { display: flex; justify-content: space-between; gap: 12px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.costbar-legend .you { color: var(--ink); font-weight: 700; }

/* 价格构成 */
.breakdown { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stack { flex: 1 1 320px; display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--wash); min-width: 200px; }
.stack .seg { display: block; height: 100%; }
.stack .seg.elec { background: var(--pine); }
.stack .seg.gas { background: #7fb7a3; }
.stack .seg.standing { background: #c9b98a; }
.stack .seg.pso { background: #b0b8bf; }
.stack-legend { display: flex; gap: 12px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; font-size: 11.5px; color: var(--body); }
.stack-legend li { display: inline-flex; align-items: center; gap: 6px; }
.stack-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.show-more { margin-top: 6px; }
.empty-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; }

/* ---------- 怎么比 ---------- */
.how-section { padding: 70px 0 40px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 34px; }
.steps > div { background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: 26px 24px; box-shadow: var(--shadow-sm); }
.steps b { display: block; font-size: 40px; font-weight: 800; line-height: 1; color: transparent; -webkit-text-stroke: 1.5px #cfd9d3; margin-bottom: 14px; }
.steps h3 { font-size: 18px; margin-bottom: 8px; }
.steps p { color: var(--body); font-size: 14.5px; }
.audit { margin-top: 26px; background: var(--wash); border: 1px dashed #cfd9d3; border-radius: var(--radius); padding: 16px 20px; font-size: 13px; color: var(--body); }

/* ---------- 页脚 ---------- */
footer { background: var(--pine-deep); color: rgba(255, 255, 255, .82); padding: 40px 0; margin-top: 40px; }
footer strong { color: #fff; font-size: 17px; }
footer .brand-mark { color: var(--gold); }
.footer-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 26px; }
.footer-grid p { font-size: 12.5px; margin-top: 8px; color: rgba(255, 255, 255, .65); }

/* ---------- 自适应 ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-card { grid-template-columns: 1fr; gap: 14px; }
  .card-actions { flex-direction: row; }
  .steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .nav-links, .brand-sub { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .trust-row { gap: 20px; }
  .annual-price { font-size: 26px; }
  .results-top { align-items: flex-start; }
}

/* ============================================================
   深色主题（爱尔兰夜配色：墨绿底 + 亮绿 + 暖金）
   ============================================================ */
[data-theme="dark"] {
  --pine: #2fa07c;
  --pine-dark: #25866a;
  --pine-deep: #07130f;
  --emerald: #38bd8d;
  --mint: #16302a;
  --gold: #e3b45c;
  --gold-soft: #2b2413;
  --ink: #f0f5f2;
  --body: #c3d0ca;
  --muted: #93a59d;
  --paper: #0b1310;
  --card: #131e1a;
  --wash: #1a2723;
  --line: #27342f;
  --line-soft: #1d2925;
  --field: #182521;
  --danger: #ff9d9d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 14px 34px -22px rgba(0, 0, 0, .85);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .55), 0 30px 60px -30px rgba(0, 0, 0, .95);
}
[data-theme="dark"] body { background: var(--paper); }
[data-theme="dark"] .site-header { background: rgba(11, 19, 16, .86); }
[data-theme="dark"] .hero::before {
  background: radial-gradient(circle at 28% 38%, rgba(56, 189, 141, .20), transparent 60%),
              radial-gradient(circle at 76% 8%, rgba(227, 180, 92, .14), transparent 55%);
}
[data-theme="dark"] .tricolor { background: linear-gradient(90deg, #2fa07c 0 34%, #cfd8d4 34% 66%, #e3b45c 66% 100%); opacity: .55; }
[data-theme="dark"] .nav-cta, [data-theme="dark"] .button.primary { color: #06120e; }
[data-theme="dark"] .button.switch { color: #06120e; }
[data-theme="dark"] .results-bar { background: #0d221b; border: 1px solid var(--line); }
[data-theme="dark"] .bar-facts b.gold { color: #f0cc83; }
[data-theme="dark"] .rank-badge { color: #06120e; }
[data-theme="dark"] .result-card.featured { box-shadow: 0 0 0 1px var(--emerald), var(--shadow); }
[data-theme="dark"] .costbar-track { background: linear-gradient(90deg, #1d3a31, #16211d); }
[data-theme="dark"] .costbar-fill { background: linear-gradient(90deg, var(--emerald), #2b6d55); }
[data-theme="dark"] .costbar-marker { background: var(--ink); opacity: .8; }
[data-theme="dark"] .steps b { -webkit-text-stroke: 1.5px #2c3b35; }
[data-theme="dark"] .data-note { background: #2b2413; border-color: #453a1d; color: #e6cf9b; }
[data-theme="dark"] .data-note.error { background: #34191b; border-color: #5c2a2e; color: #ffb3b3; }
[data-theme="dark"] .audit { background: #121d19; border-color: #26332e; }
[data-theme="dark"] footer { background: #06110d; }
[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2393a59d' stroke-width='2'/%3E%3C/svg%3E");
}
