/* =========================================================
   储能优化调度平台 · 设计系统
   UI Designer (像素君) · 2026-07-24
   纯前端美化改造：仅样式/结构，不改动 app.js / api.js / 后端
   ========================================================= */

/* ── Design Tokens ── */
:root {
  /* 布局 */
  --sidebar-w: 250px;
  --topbar-h: 64px;

  /* 间距（4px 基准） */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* 圆角 */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-pill: 999px;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 15px;
  --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px;

  /* 动效 */
  --t-fast: 150ms cubic-bezier(.16, 1, .3, 1);
  --t-norm: 300ms cubic-bezier(.16, 1, .3, 1);
  --ease: cubic-bezier(.16, 1, .3, 1);

  /* 浅色主题 */
  --bg: #F5F7FB;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: #E3E8EF;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text-muted: #475569;
  --text-subtle: #64748B;

  --primary: #0E7490;
  --primary-strong: #0C5C75;
  --on-primary: #FFFFFF;
  --primary-soft: #E1F5EE;
  --accent: #0F766E;

  --success: #0F6E56;
  --success-soft: #E7F4EE;
  --warning: #B45309;
  --warning-soft: #FBEFE0;
  --danger: #B91C1C;
  --danger-soft: #FCEBEA;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, .08);
  --shadow-lg: 0 14px 36px rgba(15, 23, 42, .12);
}

[data-theme="dark"] {
  --bg: #0A0F1C;
  --surface: #111A2E;
  --surface-2: #1A2438;
  --border: #25324B;
  --border-strong: #33425E;
  --text: #E6EDF6;
  --text-muted: #9FB0C6;
  --text-subtle: #7C8DA6;

  --primary: #2DD4BF;
  --primary-strong: #14B8A6;
  --on-primary: #062B29;
  --primary-soft: rgba(45, 212, 191, .14);
  --accent: #34D399;

  --success: #34D399;
  --success-soft: rgba(52, 211, 153, .12);
  --warning: #FBBF24;
  --warning-soft: rgba(251, 191, 36, .12);
  --danger: #F87171;
  --danger-soft: rgba(248, 113, 113, .12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 22px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .55);
}

/* ── 全局重置 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--t-norm), color var(--t-norm);
}
.hidden { display: none !important; }
a { color: var(--primary-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 可见焦点环（无障碍） */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

/* =========================================================
   认证门控
   ========================================================= */
#login-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(45, 212, 191, .18), transparent 60%),
    radial-gradient(1000px 500px at 110% 120%, rgba(14, 116, 144, .22), transparent 55%),
    linear-gradient(135deg, #0B1220 0%, #0E1B33 55%, #0A2A33 100%);
}
#app.authenticated #login-gate { display: none !important; }

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 40px 36px;
  width: 380px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
  animation: fade-up .5s var(--ease) both;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
}
.login-brand-title { font-size: 15px; font-weight: 700; color: var(--text); }
.login-brand-sub { font-size: 11px; color: var(--text-muted); letter-spacing: .3px; }
.login-box h2 { font-size: var(--fs-xl); font-weight: 700; color: var(--text); text-align: center; }
.login-subtitle { font-size: var(--fs-sm); color: var(--text-muted); text-align: center; margin: 6px 0 24px; }

.login-type-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 22px; }
.login-type-tab {
  flex: 1; padding: 10px 0; border: none; background: none; cursor: pointer;
  font-size: var(--fs-base); font-weight: 500; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--t-fast);
}
.login-type-tab:hover { color: var(--primary-strong); }
.login-type-tab.active { color: var(--primary-strong); border-bottom-color: var(--primary); font-weight: 700; }

.login-box .form-group { margin-bottom: 16px; }
.login-box .btn { width: 100%; margin-top: 8px; }
.login-status { margin-top: 12px; font-size: var(--fs-sm); text-align: center; min-height: 20px; }

/* =========================================================
   应用外壳
   ========================================================= */
/* 未认证时隐藏主界面，认证后显示 */
.header, .tabs, .tab-content { display: none; }
#app.authenticated .header,
#app.authenticated .tabs { display: flex; }
#app.authenticated .tab-content { display: none; }
#app.authenticated .tab-content.active { display: block; }

/* 顶栏 */
.header {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0; height: var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  align-items: center; justify-content: space-between;
  padding: 0 var(--sp-6); z-index: 40;
}
.header-left { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.brand-text { min-width: 0; }
.brand-text h1 { font-size: var(--fs-md); font-weight: 700; color: var(--text); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text .subtitle { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: var(--sp-2); }

.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--t-fast); line-height: 1;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(.94); }
.sidebar-toggle { display: none; }

/* 侧边导航 */
.tabs {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  flex-direction: column; padding: var(--sp-4) var(--sp-3); gap: var(--sp-2);
  z-index: 50; transition: transform var(--t-norm);
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px var(--sp-4); }
.sidebar-brand-mark {
  width: 40px; height: 40px; flex: none; border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-weight: 800; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.sidebar-brand-meta strong { display: block; font-size: var(--fs-base); color: var(--text); line-height: 1.25; }
.sidebar-brand-meta span { font-size: 11px; color: var(--text-muted); letter-spacing: .3px; }

.nav-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.tabs .tab {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; border: none; background: none; cursor: pointer;
  color: var(--text-muted); font-size: var(--fs-base); font-weight: 500; text-align: left;
  border-radius: 10px; transition: background var(--t-fast), color var(--t-fast);
}
.tabs .tab .nav-ico { width: 19px; height: 19px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabs .tab:hover { background: var(--surface-2); color: var(--text); }
.tabs .tab.active { background: var(--primary-soft); color: var(--primary-strong); font-weight: 700; }
[data-theme="dark"] .tabs .tab.active { color: var(--primary); }
.tabs .tab.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.tabs .tab { position: relative; }

.sidebar-foot {
  margin-top: auto; padding: 12px 12px 4px; font-size: 11px; color: var(--text-subtle);
  border-top: 1px solid var(--border); letter-spacing: .2px;
}

/* 内容区 */
.tab-content {
  margin-left: var(--sidebar-w);
  padding: calc(var(--topbar-h) + var(--sp-6)) var(--sp-8) var(--sp-10);
  max-width: 1380px;
}

/* =========================================================
   卡片
   ========================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-norm), transform var(--t-norm), border-color var(--t-norm);
}
.card h2 {
  font-size: var(--fs-md); font-weight: 700; color: var(--text);
  margin-bottom: var(--sp-4); padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.card h3 { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }

/* =========================================================
   按钮
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border: 1px solid transparent; border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm); }
.btn.primary:not(:disabled):hover { background: var(--primary-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn.secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn.secondary:not(:disabled):hover { background: var(--border); color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:not(:disabled):hover { filter: brightness(1.08); box-shadow: var(--shadow-md); }
.btn-large { padding: 13px 32px; font-size: var(--fs-md); width: 100%; max-width: 420px; }

/* =========================================================
   表单
   ========================================================= */
.form-row { display: flex; gap: var(--sp-4); align-items: flex-end; flex-wrap: wrap; margin-bottom: var(--sp-2); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--sp-4); }
.form-grid.col3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.form-group { display: flex; flex-direction: column; min-width: 0; }
.form-group label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-group label small { font-weight: 400; }
.form-group input, .form-group select {
  padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--text); background: var(--surface);
  font-family: inherit; transition: border-color var(--t-fast), box-shadow var(--t-fast);
  width: 100%;
}
.form-group input:focus, .form-group select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-group input[readonly] { background: var(--surface-2); color: var(--text-muted); }

.pwd-wrap { position: relative; display: flex; align-items: center; }
.pwd-wrap input { flex: 1; padding-right: 38px; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 16px; padding: 2px 4px;
  opacity: .5; transition: opacity var(--t-fast); line-height: 1;
}
.pwd-eye:hover, .pwd-eye.active { opacity: 1; }

/* =========================================================
   上传区
   ========================================================= */
.upload-row { display: flex; gap: var(--sp-4); align-items: flex-end; flex-wrap: wrap; }
.upload-box { flex: 1; min-width: 220px; }
.upload-box label { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.upload-box input[type="file"] {
  width: 100%; padding: 10px; border: 1px dashed var(--border-strong); border-radius: var(--r-sm);
  font-size: var(--fs-sm); background: var(--surface-2); color: var(--text); cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.upload-box input[type="file"]:hover { border-color: var(--primary); background: var(--primary-soft); }
.hint { display: block; font-size: 11px; color: var(--text-subtle); margin-top: 4px; }

/* =========================================================
   统计卡片 / KPI
   ========================================================= */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-4); }
/* 经济性评价 6 个财务指标卡：宽屏单行排列，窄屏自动换行 */
#econ-indicator-cards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
  transition: transform var(--t-norm), box-shadow var(--t-norm), border-color var(--t-norm);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary-soft); }
.stat-label { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1.1; letter-spacing: -.3px; }
.stat-value.small { font-size: 13px; font-weight: 600; color: var(--text-muted); }

/* =========================================================
   状态消息 / 进度
   ========================================================= */
.status { margin-top: var(--sp-3); font-size: var(--fs-sm); min-height: 20px; color: var(--text-muted); }
.scaling-results { margin-top: var(--sp-3); display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--sp-3); font-size: var(--fs-sm); }
.scaling-results div { background: var(--surface-2); padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--border); }

.progress-bar { height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); margin: 12px 0; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: var(--r-pill); transition: width .3s var(--ease); }
#progress-text { font-size: var(--fs-sm); color: var(--text-muted); }
#progress-dates { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 6px; line-height: 1.8; max-height: 120px; overflow-y: auto; }

/* =========================================================
   图表
   ========================================================= */
.chart-wrap { position: relative; width: 100%; height: 330px; }
.chart-wrap canvas { width: 100% !important; }
.chart-date-row { align-items: flex-end; margin-top: var(--sp-2); }

.series-checkboxes { display: flex; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-3); font-size: var(--fs-sm); color: var(--text-muted); }
.series-checkboxes label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.series-checkboxes input { accent-color: var(--primary); }

/* =========================================================
   表格
   ========================================================= */
.table-scroll { overflow-x: auto; border-radius: var(--r-sm); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table th {
  background: var(--surface-2); padding: 10px 12px; text-align: left; font-weight: 700;
  color: var(--text-muted); border-bottom: 2px solid var(--border-strong); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table td { padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; color: var(--text); }
table tbody tr { transition: background var(--t-fast); }
table tbody tr:hover { background: var(--surface-2); }
table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }

/* 参数摘要条 */
.param-summary {
  margin-top: var(--sp-3); padding: 11px 16px; border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--primary-strong); font-weight: 600;
  background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
}

/* 空状态 */
.empty-hint { color: var(--text-subtle); text-align: center; padding: 48px 0; font-size: var(--fs-base); }

/* 汇总内容 */
#summary-content { font-size: var(--fs-sm); line-height: 2.1; }
#summary-content .highlight { font-size: var(--fs-lg); font-weight: 800; color: var(--primary-strong); padding: 6px 0; }
[data-theme="dark"] #summary-content .highlight { color: var(--primary); }

/* =========================================================
   统计对比表 / 经济性参数
   ========================================================= */
.stats-table { font-size: var(--fs-sm); }
.stats-table th { background: var(--primary-soft); text-align: center; color: var(--primary-strong); }
.stats-table td { text-align: center; }
.stats-table td:first-child { text-align: center; font-weight: 600; }

.econ-sections { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.econ-section {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px 18px 14px; transition: box-shadow var(--t-norm), border-color var(--t-norm);
}
.econ-section:hover { border-color: color-mix(in srgb, var(--primary) 35%, transparent); box-shadow: var(--shadow-sm); }
.econ-section-title {
  font-size: var(--fs-xs); font-weight: 700; color: var(--primary-strong); margin-bottom: var(--sp-3);
  padding-bottom: 8px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px;
}
.econ-section-title::before {
  content: ''; display: inline-block; width: 3px; height: 13px;
  background: var(--primary); border-radius: 2px;
}
[data-theme="dark"] .econ-section-title { color: var(--primary); }

.econ-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.econ-grid .form-group label { font-size: 11px; }
.econ-grid .form-group input, .econ-grid .form-group select { padding: 7px 9px; font-size: var(--fs-sm); }

.econ-summary-section { display: flex; flex-direction: column; gap: var(--sp-3); }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; }
.summary-cell { background: var(--surface); border-radius: var(--r-sm); padding: 10px 12px; text-align: center; border: 1px solid var(--border); }
.summary-cell .sc-label { display: block; font-size: 10.5px; color: var(--text-subtle); margin-bottom: 3px; }
.summary-cell strong { font-size: 15px; color: var(--text); font-weight: 800; }
.summary-cell-total { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 28%, transparent); }
.summary-cell-total strong { color: var(--primary-strong); font-size: 17px; }
[data-theme="dark"] .summary-cell-total strong { color: var(--primary); }

.econ-calc-action { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: auto; }
.econ-calc-action .btn { width: 100%; }
.method-details { width: 100%; }
.method-details summary { cursor: pointer; font-weight: 500; color: var(--text-muted); font-size: var(--fs-sm); padding: 4px 0; }
.method-details summary:hover { color: var(--primary-strong); }
.method-details p { margin-bottom: 6px; }

/* 经济性结果：投资汇总 + 融资概要 并排 */
.econ-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.finance-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.finance-cards > div {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 12px 14px;
}
.finance-cards > div .fc-label, .finance-cards > div label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.finance-cards > div .fc-value, .finance-cards > div strong { font-size: 16px; font-weight: 800; color: var(--text); }

/* =========================================================
   现金流详表（分组表头）
   ========================================================= */
.cf-table { font-size: 11px; }
.cf-table th, .cf-table td { padding: 6px 7px; text-align: right; white-space: nowrap; }
.cf-table td:first-child, .cf-table th:first-child { text-align: center; }
.cf-header-group th { font-size: 11px; font-weight: 700; text-align: center; }
.cf-header-detail th { font-size: 10px; font-weight: 600; text-align: center; }
.cf-h-year { background: var(--surface-2); }
.cf-h-inflow { background: var(--success-soft); color: var(--success); }
.cf-h-outflow { background: var(--danger-soft); color: var(--danger); }
.cf-h-net { background: var(--primary-soft); color: var(--primary-strong); }
[data-theme="dark"] .cf-h-net { color: var(--primary); }
.cf-h-ref { background: var(--surface-2); color: var(--text-subtle); }
.cf-table tfoot td { border-top: 2px solid var(--border-strong); font-weight: 700; }
.cf-formula-note { margin-top: var(--sp-4); padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); font-size: var(--fs-sm); line-height: 1.9; color: var(--text-muted); }
.cf-formula-note .cf-note-sub { color: var(--text-subtle); font-size: 11.5px; margin-top: 4px; }
.cf-round-note { margin-top: 8px; font-size: 11.5px; color: var(--text-subtle); line-height: 1.6; }

/* =========================================================
   动画
   ========================================================= */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.tab-content.active { animation: fade-up .35s var(--ease) both; }
.stat-card, .card { animation: fade-up .4s var(--ease) both; }

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1180px) {
  .econ-sections { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  :root { --sidebar-w: 0px; }
  .sidebar-toggle { display: flex; }
  .tabs {
    transform: translateX(-100%);
    width: 256px;
    box-shadow: var(--shadow-lg);
  }
  #app.sidebar-open .tabs { transform: translateX(0); }
  .header { left: 0; }
  .tab-content { margin-left: 0; padding: calc(var(--topbar-h) + var(--sp-4)) var(--sp-5) var(--sp-8); }
  .econ-result-grid { grid-template-columns: 1fr; }
  /* 移动端遮罩 */
  #app.sidebar-open::after {
    content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 45;
  }
}
@media (max-width: 768px) {
  .series-checkboxes { flex-direction: column; gap: 6px; }
  .form-grid, .form-grid.col3 { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 20px; }
  .brand-text .subtitle { display: none; }
}
@media (max-width: 560px) {
  .form-grid, .form-grid.col3 { grid-template-columns: 1fr; }
  .econ-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .finance-cards { grid-template-columns: 1fr; }
  .header { padding: 0 var(--sp-4); }
  .tab-content { padding: calc(var(--topbar-h) + var(--sp-3)) var(--sp-4) var(--sp-6); }
  .card { padding: var(--sp-4); }
}

/* 尊重用户减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
