/* 由 style.css 自动生成：作用域限定到 .tools-wrap，已剔除与本站外框冲突的规则 */
.tools-wrap * { box-sizing: border-box; }
.tools-wrap {
  
  --green-50:#f0fdf4;  --green-100:#dcfce7; --green-200:#bbf7d0;
  --green-400:#4ade80; --green-500:#22c55e; --green-600:#16a34a;
  --green-700:#15803d; --green-800:#166534; --green-900:#14532d;
  
  --emerald-400:#34d399; --emerald-500:#10b981; --emerald-600:#059669; --emerald-700:#047857;
  
  --teal-500:#14b8a6;  --teal-600:#0d9488;
  --amber-400:#fbbf24; --amber-500:#f59e0b; --amber-600:#d97706;
  --sky-500:#38bdf8;   --sky-600:#0ea5e9;
  
  --slate-50:#f8fafc; --slate-100:#f1f5f9; --slate-200:#e2e8f0;
  --slate-300:#cbd5e1; --slate-400:#94a3b8; --slate-500:#64748b;
  --slate-600:#475569; --slate-700:#334155; --slate-800:#1e293b; --slate-900:#0f172a;
  
  --red-600:#dc2626; --red-700:#b91c1c; --rose-500:#f43f5e;
  
  --shadow-sm:0 1px 3px rgba(15,23,42,.05);
  --shadow:0 4px 16px -4px rgba(15,23,42,.10);
  --shadow-green:0 8px 22px -10px rgba(5,150,105,.45);
  --shadow-lg:0 12px 32px -10px rgba(15,23,42,.18);
  --radius:12px; --radius-lg:16px; --radius-sm:8px;
  
  --brand:#15803d; --brand-2:#16a34a; --brand-soft:#f0fdf4;
}
.tools-wrap #gs_capexBreakdown .gs-cap-total { border-top: 1px dashed rgba(22,163,74,.4); margin-top: 4px; padding-top: 4px; }
.tools-wrap #gs_capexBreakdown .gs-cap-total span:last-child { color: var(--green-700); font-weight: 700; }
.tools-wrap .tool-section { display: none; }
.tools-wrap .tool-section.active { display: block; animation: tw_fadeIn .25s ease; }
@keyframes tw_fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tools-wrap .card {
  background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.tools-wrap .card:hover { box-shadow: var(--shadow-lg); border-color: var(--green-200); }
.tools-wrap .card-title {
  font-size: 17px; font-weight: 700; color: var(--emerald-700);
  border-bottom: 1px solid var(--slate-200); padding-bottom: 10px; margin: 0 0 16px;
  display: flex; align-items: center; gap: 8px;
}
.tools-wrap .card-title::before {
  content: ""; width: 4px; height: 18px; border-radius: 2px;
  background: linear-gradient(var(--green-500), var(--emerald-600));
}
.tools-wrap .section-intro { font-size: 12.5px; color: var(--slate-500); margin: -8px 0 16px; line-height: 1.7; }
.tools-wrap .field.input-struck { opacity: .55; }
.tools-wrap .field.input-struck label { text-decoration: line-through; color: var(--slate-400); }
.tools-wrap .field.input-struck input { text-decoration: line-through; background: var(--slate-100); }
.tools-wrap .sub-title { font-size: 13px; font-weight: 600; color: var(--green-700); margin: 18px 0 10px; padding-left: 8px; border-left: 3px solid var(--green-500); }
.tools-wrap .fieldset { border: 1px solid var(--slate-200); border-radius: 8px; padding: 12px 14px 4px; margin-bottom: 14px; background: var(--slate-50); }
.tools-wrap .fieldset-legend { font-size: 12px; font-weight: 600; color: var(--slate-600); margin: -22px 0 8px 0; background: #fff; display: inline-block; padding: 0 8px; border: 1px solid var(--slate-200); border-radius: 5px; }
.tools-wrap .grid-3 { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; }
.tools-wrap .grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.tools-wrap .grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.tools-wrap label { display: block; font-size: 13px; color: var(--slate-600); margin-bottom: 4px; }
.tools-wrap .radio-inline { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; margin: 0 18px 0 0; font-weight: 500; }
.tools-wrap .radio-inline input { width: auto; margin: 0; }
.tools-wrap .radio-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tools-wrap .field { margin-bottom: 16px; }
.tools-wrap .field .hint { font-size: 11px; color: var(--slate-400); margin-top: 2px; }
.tools-wrap input, .tools-wrap select {
  width: 100%; border: 1px solid var(--slate-200); border-radius: 7px;
  padding: 7px 9px; font-size: 13px; background: #fff; color: var(--slate-800);
  transition: border-color .15s, box-shadow .15s;
}
.tools-wrap input:focus, .tools-wrap select:focus {
  border-color: var(--green-600); outline: none;
  box-shadow: 0 0 0 3px rgba(22,163,74,.15);
}
.tools-wrap input[readonly] { background: var(--green-50); color: var(--slate-500); }
.tools-wrap input[type="text"], .tools-wrap input[type="number"], .tools-wrap textarea, .tools-wrap select {
  border-bottom: 2px solid var(--green-600);
}
.tools-wrap .btn-primary {
  width: 100%; background: linear-gradient(135deg, var(--green-600), var(--emerald-600));
  color: #fff; font-weight: 600; border: none; border-radius: 8px;
  padding: 11px; font-size: 14px; cursor: pointer; margin-top: 8px;
  box-shadow: var(--shadow-green); transition: transform .12s, filter .15s;
}
.tools-wrap .btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.tools-wrap .btn-secondary {
  background: var(--slate-100); color: var(--slate-700); border: none; border-radius: 8px;
  padding: 10px; font-size: 14px; cursor: pointer;
}
.tools-wrap .btn-secondary:hover { background: var(--slate-200); }
.tools-wrap .btn-group { display: flex; gap: 12px; align-items: stretch; }
.tools-wrap .btn-group .btn-primary, .tools-wrap .btn-group .btn-secondary { flex: 1 1 0; width: auto; margin-top: 8px; box-sizing: border-box; }
.tools-wrap .btn-accent {
  background: linear-gradient(135deg, var(--amber-500), var(--amber-600));
  color: #fff; border: none; border-radius: 8px; padding: 10px 18px;
  font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 12px -4px rgba(217,119,6,.5);
}
.tools-wrap .btn-accent:hover { filter: brightness(1.05); }
.tools-wrap .metric-card {
  --mc: var(--green-600); --mc-bg: #f0fdf4;
  background: var(--mc-bg); border: 1px solid var(--slate-200); border-top: 3px solid var(--mc);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
  transition: transform .2s, box-shadow .2s;
}
.tools-wrap .metric-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-green); }
.tools-wrap .metric-card:nth-of-type(4n+2) { --mc: var(--teal-600); --mc-bg:#f0fdfa; }
.tools-wrap .metric-card:nth-of-type(4n+3) { --mc: var(--amber-500); --mc-bg:#fffbeb; }
.tools-wrap .metric-card:nth-of-type(4n+4) { --mc: var(--sky-600); --mc-bg:#f0f9ff; }
.tools-wrap .metric-label { font-size: 12px; color: var(--slate-500); }
.tools-wrap .metric-value { font-size: 24px; font-weight: 700; color: var(--mc); margin-top: 4px; }
.tools-wrap .metric-unit { font-size: 12px; color: var(--slate-400); }
.tools-wrap .gs-mcard .metric-value, .tools-wrap .gs-mcard .metric-unit { display: inline-block; white-space: nowrap; vertical-align: baseline; }
.tools-wrap .gs-mcard .metric-value { margin-top: 6px; }
.tools-wrap .gs-mcard .metric-unit { font-size: 13px; margin-left: 5px; color: var(--slate-400); }
.tools-wrap #gs_finance div > span:last-child, .tools-wrap #gs_capexBreakdown div > span:last-child { white-space: nowrap; }
.tools-wrap .chart-box { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-top: 16px; }
.tools-wrap .chart-title { font-size: 13px; font-weight: 600; color: var(--slate-700); margin-bottom: 12px; }
.tools-wrap .info-box {
  background: var(--green-50); border: 1px solid var(--green-100); border-radius: 10px;
  padding: 16px; margin-top: 16px; font-size: 12px; color: var(--emerald-700);
}
.tools-wrap .info-box h3 { font-size: 14px; color: var(--emerald-600); margin: 0 0 8px; }
.tools-wrap .info-box.amber { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.tools-wrap .info-box.amber h3 { color: var(--amber-600); }
.tools-wrap .notice {
  background: #fef2f2; border: 1px solid #fecaca; color: var(--red-700);
  border-radius: 6px; padding: 8px; font-size: 12px; margin-top: 8px; display: none;
}
.tools-wrap .tiny-table { font-size: 12px; }
.tools-wrap .tiny-table div { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed var(--slate-200); }
.tools-wrap .loss-box { height: auto; }
.tools-wrap .loss-grid { align-items: center; }
.tools-wrap .loss-chart-wrap { position: relative; width: 200px; max-width: 100%; aspect-ratio: 1; height: auto; margin: 0 auto; }
.tools-wrap .loss-chart-wrap canvas { max-width: 100% !important; height: auto !important; }
.tools-wrap .loss-table .lt-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--slate-200); }
.tools-wrap .loss-table .lt-left { display: flex; align-items: center; gap: 7px; }
.tools-wrap .loss-table .lt-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.tools-wrap .loss-table .lt-val { font-variant-numeric: tabular-nums; color: var(--slate-700); font-weight: 600; }
.tools-wrap .loading { display: none; }
.tools-wrap .loading.active { display: block; opacity: 1; pointer-events: none; color: var(--emerald-700); font-weight: 500; padding: 12px 0; text-align: center; }
.tools-wrap .sect-label {
  font-size: 12px; font-weight: 700; color: var(--emerald-700);
  background: var(--green-50); padding: 4px 8px; border-radius: 4px; margin-top: 4px;
}
@media (max-width: 860px) {
.tools-wrap .grid-3, .tools-wrap .grid-2, .tools-wrap .grid-4 { grid-template-columns: 1fr !important; }
.tools-wrap .calc-table, .tools-wrap .excel-table, .tools-wrap .cl-result-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (max-width: 560px) {
.tools-wrap .grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
}
.tools-wrap .tag {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px;
  border-radius: 999px; background: var(--green-100); color: var(--emerald-700);
}
.tools-wrap .tag.amber { background: #fef3c7; color: var(--amber-600); }
.tools-wrap .tag.teal { background: #ccfbf1; color: var(--teal-600); }
.tools-wrap .tag.sky { background: #e0f2fe; color: var(--sky-600); }
.tools-wrap .pill {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 12px;
  border-radius: 999px;
}
.tools-wrap .pill-ok { background: var(--green-100); color: var(--emerald-600); }
.tools-wrap .pill-bad { background: #fee2e2; color: var(--red-700); }
.tools-wrap .ref-note {
  background: var(--green-50); border: 1px solid var(--green-100); border-left: 3px solid var(--green-600);
  border-radius: 8px; padding: 10px 14px; margin: 0 0 18px;
  font-size: 12px; color: var(--slate-600); line-height: 1.7;
}
.tools-wrap .ref-note b { color: var(--emerald-600); }
.tools-wrap .ref-note .formula {
  display: inline-block; background: var(--green-100); border-radius: 4px;
  padding: 1px 6px; font-family: "SFMono-Regular", Consolas, monospace; color: var(--emerald-700);
  margin: 0 2px;
}
.tools-wrap .formula-block {
  background: var(--green-50); border: 1px solid var(--green-100); border-radius: 8px;
  padding: 12px 16px; margin: 2px 0; line-height: 1.9;
}
.tools-wrap .formula-block .formula { display: block; margin: 3px 0; }
.tools-wrap .tool-title {
  font-size: 17px; font-weight: 700; color: var(--emerald-700);
  border-bottom: 1px solid var(--slate-200); padding-bottom: 10px; margin: 0 0 16px;
  display: flex; align-items: center; gap: 8px;
}
.tools-wrap .tool-title::before {
  content: ""; width: 4px; height: 18px; border-radius: 2px;
  background: linear-gradient(var(--green-500), var(--emerald-600));
}
.tools-wrap .excel-table {
  width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 12px;
}
.tools-wrap .excel-table th, .tools-wrap .excel-table td {
  border: 1px solid #000; padding: 4px 6px; text-align: center;
  height: 28px; vertical-align: middle;
}
.tools-wrap .excel-table td.merged-cell { font-weight: 600; background: var(--green-50); }
.tools-wrap .excel-table th {
  background: linear-gradient(var(--emerald-600), var(--green-600)); color: #fff;
  font-weight: 600; text-align: center; height: 30px;
}
.tools-wrap tr.es-block-header > td {
  background: var(--green-100); color: var(--emerald-700); font-weight: 600;
  text-align: left; padding-left: 12px; letter-spacing: .5px;
}
.tools-wrap .calc-table {
  width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 12px;
}
.tools-wrap .calc-table th, .tools-wrap .calc-table td {
  border: 1px solid var(--slate-200); padding: 8px 10px; text-align: left;
  font-size: 12px; vertical-align: middle;
}
.tools-wrap .calc-table th { background: var(--green-50); font-weight: bold; color: var(--emerald-700); }
.tools-wrap .calc-table input { width: 100%; padding: 5px 7px; border: 1px solid var(--slate-300); border-radius: 5px; font-size: 12px; background: #fff; }
.tools-wrap .calc-table input[readonly] { cursor: not-allowed; border-color: transparent; background: var(--green-50); }
.tools-wrap .input-cell { background-color: #FFF2CC !important; }
.tools-wrap .input-cell input { background-color: #FFF2CC; border-color: #e6d8a8; }
.tools-wrap .output-cell { background-color: #D5E8D4 !important; }
.tools-wrap .output-cell input { background-color: #D5E8D4; border-color: #a9c9a3; }
.tools-wrap #excel10-section .calc-table th:first-child, .tools-wrap #excel10-section .calc-table td:first-child { width: 120px; min-width: 110px; white-space: nowrap; }
.tools-wrap .chart-box { position: relative; height: 340px; margin: 16px 0; }
.tools-wrap #lcoe-section .chart-box { height: auto; }
.tools-wrap .lc-chart-wrap { position: relative; width: 100%; height: 220px; }
.tools-wrap #gridstorage-section .chart-box { height: auto; }
.tools-wrap .lcoe-opt-row { background: var(--green-100); font-weight: 600; }
.tools-wrap .lcoe-opt-row td { color: var(--emerald-700); }
.tools-wrap .excel-table input {
  width: 100%; padding: 2px 4px; border: none; border-bottom: 1.5px solid var(--green-600);
  background-color: transparent; text-align: center; font-size: 12px; height: 22px; outline: none;
}
.tools-wrap .out-label { text-align: right; white-space: nowrap; padding-right: 8px; font-weight: 500; }
.tools-wrap #excel1-section .excel-table tr:nth-child(-n+7) td:nth-child(4) { width: 100px; }
.tools-wrap #excel1-section .excel-table tr:nth-child(-n+7) td:nth-child(5) { text-align: left; padding-left: 10px; }
.tools-wrap #excel1-section .excel-table tr:nth-child(-n+7) td:nth-child(6) { text-align: right; padding-right: 10px; }
.tools-wrap #excel1-section .excel-table tr:nth-child(-n+7) td:nth-child(9) { text-align: right; padding-right: 10px; }
.tools-wrap .btn-calculate, .tools-wrap .btn-container button {
  background-color: var(--green-600); color: #fff; border: none;
  padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 12px; margin-top: 10px;
}
.tools-wrap .btn-calculate:hover, .tools-wrap .btn-container button:hover { background-color: var(--emerald-600); }
.tools-wrap .btn-reset, .tools-wrap .btn-container .btn-reset { background-color: var(--slate-400); color: #fff; }
.tools-wrap .btn-container { text-align: center; margin: 5px 0; }
.tools-wrap .reserved-tab {
  text-align: center; padding: 80px 0; color: #999; font-size: 14px; line-height: 2;
}
.tools-wrap .cl-rows-wrap { margin: 6px 0 4px; }
.tools-wrap .cl-rows-wrap .cl-rows th:first-child, .tools-wrap .cl-rows-wrap .cl-rows td:first-child { white-space: nowrap; }
.tools-wrap .cl-amp-wrap { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 10px; }
.tools-wrap .cl-amp-wrap .cl-amp { flex: 1 1 320px; min-width: 300px; margin: 0; }
.tools-wrap .cl-amp-wrap .cl-amp th { background: var(--green-50); }
.tools-wrap .cl-note { font-size: 12px; color: var(--slate-500); margin: 6px 2px; line-height: 1.6; }
.tools-wrap .cl-note.cl-err { color: var(--red-700); background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; padding: 7px 10px; }
.tools-wrap .cl-summary { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0; }
.tools-wrap .cl-sum-card { flex: 1 1 200px; background: var(--green-50); border: 1px solid var(--green-200); border-radius: 8px; padding: 10px 12px; }
.tools-wrap .cl-sum-l { font-size: 12px; color: var(--emerald-700); }
.tools-wrap .cl-sum-v { font-size: 22px; font-weight: 700; color: var(--green-600); margin: 2px 0; }
.tools-wrap .cl-sum-v span { font-size: 13px; font-weight: 500; color: var(--slate-500); }
.tools-wrap .cl-sum-s { font-size: 11px; color: var(--slate-500); }
.tools-wrap .cl-result-table th, .tools-wrap .cl-result-table td { font-size: 12px; white-space: nowrap; }
.tools-wrap .cl-result-table tr.cl-total-row td { background: var(--green-100); font-weight: 700; }
.tools-wrap .cl-diagram { margin-top: 6px; overflow-x: auto; border: 1px dashed var(--green-200); border-radius: 8px; padding: 6px; background: #fff; }
.tools-wrap .cl-svg { display: block; min-width: 640px; }
.tools-wrap .btn-export { background-color: #15803d; }
.tools-wrap .btn-export:hover:not([disabled]) { background-color: #166534; }
.tools-wrap .btn-export:disabled { background-color: #9ca3af; cursor: not-allowed; opacity: 0.7; }

/* ===================================================================
   深色模式覆盖层：复用全局 style.css 的 data-theme="dark" 变量体系
   （--surface/--text/--border/--brand 等），与全站深浅切换保持一致。
   本层只翻转"浅色硬编码"为深色可读，不破坏计算逻辑与布局。
   =================================================================== */
html[data-theme="dark"] .tools-wrap {
  --green-50: #0e2a1c;  --green-100: #123526; --green-200: #1a4a32;
  --green-400: #4ade80; --green-500: #34d399; --green-600: #34d399;
  --green-700: #6ee7b7; --green-800: #86efac; --green-900: #bbf7d0;

  --emerald-400: #34d399; --emerald-500: #34d399; --emerald-600: #10b981; --emerald-700: #6ee7b7;

  --teal-500: #2dd4bf;  --teal-600: #14b8a6;
  --amber-400: #fbbf24; --amber-500: #f59e0b; --amber-600: #fbbf24;
  --sky-500: #38bdf8;   --sky-600: #38bdf8;

  --slate-50: #0f1a2c; --slate-100: #16223a; --slate-200: #24334e;
  --slate-300: #33456a; --slate-400: #6b7d99; --slate-500: #a8b8cf;
  --slate-600: #c4d2e6; --slate-700: #dfe8f3; --slate-800: #e6edf7; --slate-900: #f1f6fc;

  --red-600: #f87171; --red-700: #fca5a5; --rose-500: #fb7185;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow: 0 6px 20px -6px rgba(0,0,0,.55);
  --shadow-green: 0 8px 22px -10px rgba(52,211,153,.35);
  --shadow-lg: 0 12px 32px -10px rgba(0,0,0,.65);
  --radius: 12px; --radius-lg: 16px; --radius-sm: 8px;
  --brand: #34d399; --brand-2: #38bdf8; --brand-soft: rgba(52,211,153,.12);
}
/* 卡片/图表/输入底：翻为深色表面 */
html[data-theme="dark"] .tools-wrap .card { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .tools-wrap .card:hover { border-color: var(--green-600); }
html[data-theme="dark"] .tools-wrap .fieldset { background: var(--surface-2); border-color: var(--border); }
html[data-theme="dark"] .tools-wrap .fieldset-legend { background: var(--surface); color: var(--slate-500); border-color: var(--border); }
html[data-theme="dark"] .tools-wrap input,
html[data-theme="dark"] .tools-wrap select,
html[data-theme="dark"] .tools-wrap textarea { background: var(--surface-2); color: var(--text); border-color: var(--border); }
html[data-theme="dark"] .tools-wrap input:focus,
html[data-theme="dark"] .tools-wrap select:focus { border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(52,211,153,.20); }
html[data-theme="dark"] .tools-wrap input[readonly] { background: var(--surface-3); color: var(--slate-500); }
html[data-theme="dark"] .tools-wrap .calc-table input { background: var(--surface-2); border-color: var(--border); color: var(--text); }
html[data-theme="dark"] .tools-wrap .calc-table input[readonly] { background: var(--surface-3); border-color: transparent; }
html[data-theme="dark"] .tools-wrap .excel-table input { background: transparent; color: var(--text); border-bottom-color: var(--green-600); }
/* 黄输入格 / 绿输出格：深色下改为低饱和暗色，保证可读性 */
html[data-theme="dark"] .tools-wrap .input-cell { background-color: #3a2f12 !important; }
html[data-theme="dark"] .tools-wrap .input-cell input { background-color: #473a16; border-color: #6b531f; color: #fde68a; }
html[data-theme="dark"] .tools-wrap .output-cell { background-color: #0f2e1f !important; }
html[data-theme="dark"] .tools-wrap .output-cell input { background-color: #143a28; border-color: #1f5c3e; color: #86efac; }
/* 信息/参考框：深色表面化 */
html[data-theme="dark"] .tools-wrap .info-box { background: var(--green-50); border-color: var(--green-100); color: var(--emerald-700); }
html[data-theme="dark"] .tools-wrap .info-box.amber { background: #2c2410; border-color: #4a3b16; color: #fcd34d; }
html[data-theme="dark"] .tools-wrap .notice { background: #2a1414; border-color: #5c2a2a; color: #fca5a5; }
html[data-theme="dark"] .tools-wrap .ref-note { background: var(--green-50); border-color: var(--green-100); border-left-color: var(--green-600); color: var(--slate-500); }
html[data-theme="dark"] .tools-wrap .ref-note .formula,
html[data-theme="dark"] .tools-wrap .formula-block { background: var(--green-100); color: var(--emerald-700); }
html[data-theme="dark"] .tools-wrap .tag { background: var(--green-100); color: var(--emerald-700); }
html[data-theme="dark"] .tools-wrap .tag.amber { background: #4a3b16; color: #fcd34d; }
html[data-theme="dark"] .tools-wrap .tag.teal { background: #0e3b38; color: #5eead4; }
html[data-theme="dark"] .tools-wrap .tag.sky { background: #0c2f4a; color: #7dd3fc; }
html[data-theme="dark"] .tools-wrap .pill-ok { background: var(--green-100); color: var(--emerald-500); }
html[data-theme="dark"] .tools-wrap .pill-bad { background: #3a1a1a; color: #fca5a5; }
html[data-theme="dark"] .tools-wrap .chart-box { background: var(--surface); border-color: var(--border); }
/* 计算表头：保持品牌绿渐变（暗色下提亮） */
html[data-theme="dark"] .tools-wrap .calc-table th { background: var(--green-100); color: var(--emerald-700); }
html[data-theme="dark"] .tools-wrap .excel-table th { background: linear-gradient(var(--emerald-600), var(--green-600)); color: #06281c; }
html[data-theme="dark"] .tools-wrap tr.es-block-header > td { background: var(--green-100); color: var(--emerald-700); }
html[data-theme="dark"] .tools-wrap .btn-secondary { background: var(--surface-2); color: var(--slate-600); }
html[data-theme="dark"] .tools-wrap .btn-secondary:hover { background: var(--surface-3); }
html[data-theme="dark"] .tools-wrap .cl-diagram { background: var(--surface); border-color: var(--green-100); }
/* 指标卡 / 优化行 / 结果汇总：深色表面 */
html[data-theme="dark"] .tools-wrap .metric-card { background: var(--surface-2); border-color: var(--border); }
html[data-theme="dark"] .tools-wrap .lcoe-opt-row { background: var(--green-100); }
html[data-theme="dark"] .tools-wrap .lcoe-opt-row td { color: var(--emerald-700); }
html[data-theme="dark"] .tools-wrap .cl-sum-card { background: var(--green-50); border-color: var(--green-100); }
html[data-theme="dark"] .tools-wrap .cl-sum-l { color: var(--emerald-700); }
html[data-theme="dark"] .tools-wrap .cl-sum-v { color: var(--green-400); }
html[data-theme="dark"] .tools-wrap .cl-result-table tr.cl-total-row td { background: var(--green-100); }
html[data-theme="dark"] .tools-wrap .cl-note.cl-err { color: var(--red-700); background: #2a1414; border-color: #5c2a2a; }
html[data-theme="dark"] .tools-wrap .cl-amp-wrap .cl-amp th { background: var(--green-100); }
html[data-theme="dark"] .tools-wrap .reserved-tab { color: var(--slate-400); }
html[data-theme="dark"] .tools-wrap .btn-export { background-color: var(--green-600); }
html[data-theme="dark"] .tools-wrap .btn-export:hover:not([disabled]) { background-color: var(--green-500); }

/* 计算引擎注入结果：标题/结论框（dc / ups 模块）—— 浅色绿主题，随全站深浅切换。
   此前用内联 color:#14532d / background:#f0fdf4，深色下标题不可见、结论框为亮块；
   改为类 + data-theme 覆盖层，与全站深浅一致。 */
.tools-wrap .result-h3 { margin:10px 0 4px; color:#14532d; font-size:13pt; font-weight:700; }
.tools-wrap .result-callout { background:#f0fdf4; border:1px solid #86efac; border-left:4px solid #16a34a; padding:8px 10px; font-size:10.5pt; line-height:1.8; margin:8px 0; border-radius:4px; }
html[data-theme="dark"] .tools-wrap .result-h3 { color:#86efac; }
html[data-theme="dark"] .tools-wrap .result-callout { background:#0f2e1f; border-color:#166534; border-left-color:#34d399; color:#dcfce7; }

/* ===================================================================
   loadstation / ground 分栏布局与组件（框架对齐 · 绿主题 · 随深浅切换）
   仅保留布局几何与少量必需组件样式；颜色全部复用框架令牌，
   与「原有 52 工具」保持一致，且与计算逻辑（JS 仅引用 *_id）无关。
   =================================================================== */
.tools-wrap #loadstation-section .ls-split,
.tools-wrap #ground-section .ground-split {
  display: flex; gap: 18px; align-items: stretch; margin: 12px 0 4px;
}
.tools-wrap #loadstation-section .ls-col-left { flex: 1.05 1 0; min-width: 320px; }
.tools-wrap #loadstation-section .ls-col-right { flex: 0.95 1 0; min-width: 320px; display: flex; flex-direction: column; }
.tools-wrap #ground-section .ground-col-left { flex: 0.88 1 0; min-width: 290px; }
.tools-wrap #ground-section .ground-col-right { flex: 1.12 1 0; min-width: 300px; display: flex; flex-direction: column; }
.tools-wrap #loadstation-section .ls-col-left,
.tools-wrap #ground-section .ground-col-left { font-size: 13px; line-height: 1.32; }
.tools-wrap #loadstation-section .ls-col-right,
.tools-wrap #ground-section .ground-col-right { font-size: 13px; line-height: 1.5; justify-content: flex-start; }
.tools-wrap #loadstation-section .ls-col-right > .card,
.tools-wrap #ground-section .ground-col-right > .card { min-height: 100%; }
/* 分表列宽固定：保证 参数/数值/单位/说明 各列纵向对齐（仅布局，无颜色） */
.tools-wrap #loadstation-section .calc-table,
.tools-wrap #ground-section .calc-table { table-layout: fixed; width: 100%; margin: 3px 0 7px; }
.tools-wrap #loadstation-section .calc-table td,
.tools-wrap #loadstation-section .calc-table th,
.tools-wrap #ground-section .calc-table td,
.tools-wrap #ground-section .calc-table th { padding: 3px 7px; line-height: 1.32; vertical-align: middle; word-break: break-word; overflow-wrap: break-word; }
.tools-wrap #loadstation-section .ls-col-left .calc-table th:nth-child(1),
.tools-wrap #loadstation-section .ls-col-left .calc-table td:nth-child(1) { width: 24%; }
.tools-wrap #loadstation-section .ls-col-left .calc-table th:nth-child(2),
.tools-wrap #loadstation-section .ls-col-left .calc-table td:nth-child(2) { width: 16%; }
.tools-wrap #loadstation-section .ls-col-left .calc-table th:nth-child(3),
.tools-wrap #loadstation-section .ls-col-left .calc-table td:nth-child(3) { width: 8%; text-align: center; }
.tools-wrap #loadstation-section .ls-col-left .calc-table th:nth-child(4),
.tools-wrap #loadstation-section .ls-col-left .calc-table td:nth-child(4) { width: 52%; }
.tools-wrap #loadstation-section .ls-col-right .calc-table th:nth-child(1),
.tools-wrap #loadstation-section .ls-col-right .calc-table td:nth-child(1) { width: 34%; }
.tools-wrap #loadstation-section .ls-col-right .calc-table th:nth-child(2),
.tools-wrap #loadstation-section .ls-col-right .calc-table td:nth-child(2) { width: 20%; text-align: center; }
.tools-wrap #loadstation-section .ls-col-right .calc-table th:nth-child(3),
.tools-wrap #loadstation-section .ls-col-right .calc-table td:nth-child(3) { width: 12%; text-align: center; }
.tools-wrap #loadstation-section .ls-col-right .calc-table th:nth-child(4),
.tools-wrap #loadstation-section .ls-col-right .calc-table td:nth-child(4) { width: 34%; }
.tools-wrap #ground-section .ground-col-left .calc-table th:nth-child(1),
.tools-wrap #ground-section .ground-col-left .calc-table td:nth-child(1) { width: 24%; }
.tools-wrap #ground-section .ground-col-left .calc-table th:nth-child(2),
.tools-wrap #ground-section .ground-col-left .calc-table td:nth-child(2) { width: 16%; }
.tools-wrap #ground-section .ground-col-left .calc-table th:nth-child(3),
.tools-wrap #ground-section .ground-col-left .calc-table td:nth-child(3) { width: 8%; text-align: center; }
.tools-wrap #ground-section .ground-col-left .calc-table th:nth-child(4),
.tools-wrap #ground-section .ground-col-left .calc-table td:nth-child(4) { width: 52%; }
.tools-wrap #ground-section .ground-col-right .calc-table th:nth-child(1),
.tools-wrap #ground-section .ground-col-right .calc-table td:nth-child(1) { width: 30%; }
.tools-wrap #ground-section .ground-col-right .calc-table th:nth-child(2),
.tools-wrap #ground-section .ground-col-right .calc-table td:nth-child(2) { width: 23%; text-align: center; }
.tools-wrap #ground-section .ground-col-right .calc-table th:nth-child(3),
.tools-wrap #ground-section .ground-col-right .calc-table td:nth-child(3) { width: 12%; text-align: center; }
.tools-wrap #ground-section .ground-col-right .calc-table th:nth-child(4),
.tools-wrap #ground-section .ground-col-right .calc-table td:nth-child(4) { width: 35%; }
.tools-wrap #loadstation-section .calc-table td:nth-child(4),
.tools-wrap #ground-section .calc-table td:nth-child(4) { font-size: 11.5px; color: var(--slate-500); line-height: 1.42; }
.tools-wrap #loadstation-section .calc-table th,
.tools-wrap #ground-section .calc-table th { text-align: center; }
.tools-wrap #loadstation-section .calc-table th:nth-child(1),
.tools-wrap #loadstation-section .calc-table th:nth-child(4),
.tools-wrap #ground-section .calc-table th:nth-child(1),
.tools-wrap #ground-section .calc-table th:nth-child(4) { text-align: left; }
.tools-wrap #loadstation-section .input-cell { padding: 2px 6px !important; }
.tools-wrap #ground-section .input-cell { padding: 2px 6px !important; }
.tools-wrap #loadstation-section .ls-col-right .calc-table td { padding: 7px 7px; line-height: 1.5; }
.tools-wrap #loadstation-section .ls-col-right .calc-table th { padding: 6px 7px; line-height: 1.4; }
.tools-wrap #ground-section .ground-col-right .calc-table td { padding: 7px 7px; line-height: 1.5; }
.tools-wrap #ground-section .ground-col-right .calc-table th { padding: 6px 7px; line-height: 1.4; }
.tools-wrap #loadstation-section .ls-col-left input,
.tools-wrap #loadstation-section .ls-col-left select,
.tools-wrap #ground-section .ground-col-left input,
.tools-wrap #ground-section .ground-col-left select { height: 24px; padding: 1px 4px; font-size: 12.5px; line-height: 1.2; width: 100%; box-sizing: border-box; }
/* 工具栏（负荷增删 / 导入等辅助操作）—— 与 .btn-secondary 同色系 */
.tools-wrap #loadstation-section .ls-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 8px; }
.tools-wrap #loadstation-section .ls-toolbar button { background: var(--slate-100); color: var(--slate-700); border: 1px solid var(--slate-200); border-radius: 6px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; font-weight: 600; }
.tools-wrap #loadstation-section .ls-toolbar button:hover { background: var(--slate-200); }
.tools-wrap #loadstation-section .ls-toolbar .ls-import-btn { position: relative; overflow: hidden; }
.tools-wrap #loadstation-section .ls-toolbar .ls-import-btn input[type=file] { position: absolute; left: 0; top: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
/* 负荷表删除按钮（JS 注入 .ls-del-btn） */
.tools-wrap .ls-del-btn { cursor: pointer; color: var(--red-600); font-weight: 700; background: none; border: none; font-size: 14px; }
/* 响应式：窄屏堆叠 */
@media (max-width: 900px) {
  .tools-wrap #loadstation-section .ls-split { flex-direction: column; }
  .tools-wrap #loadstation-section .ls-col-left,
  .tools-wrap #loadstation-section .ls-col-right { min-width: 0; width: 100%; }
}
@media (max-width: 880px) {
  .tools-wrap #ground-section .ground-split { flex-direction: column; }
  .tools-wrap #ground-section .ground-col-left,
  .tools-wrap #ground-section .ground-col-right { min-width: 0; width: 100%; }
}

/* 深色模式：分栏布局/组件随全站深浅切换（复用 --surface/--border/--text） */
html[data-theme="dark"] .tools-wrap #loadstation-section .ls-toolbar button { background: var(--surface-2); color: var(--slate-600); border-color: var(--border); }
html[data-theme="dark"] .tools-wrap #loadstation-section .ls-toolbar button:hover { background: var(--surface-3); }
html[data-theme="dark"] .tools-wrap .ls-del-btn { color: var(--red-700); }
