/* ==================== 全局重置与变量 ==================== */
:root {
  --primary: #0f4c75;
  --primary-light: #3282b8;
  --primary-dark: #0a3a5a;
  --accent: #f8b400;
  --accent-light: #ffd966;
  --teal: #00b4a6;
  --teal-light: #4ecdc4;
  --danger: #e63946;
  --warning: #f4a261;
  --success: #2a9d8f;
  --bg-base: #eef2f7;
  --bg-card: #ffffff;
  --bg-sidebar: #f8fafc;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 28px rgba(0,0,0,.12);
  --radius: 10px;
  --radius-sm: 6px;
  --gradient-primary: linear-gradient(135deg, #0f4c75 0%, #1c6fa8 50%, #3282b8 100%);
  --gradient-accent: linear-gradient(135deg, #f8b400 0%, #ffb627 100%);
  --gradient-teal: linear-gradient(135deg, #00b4a6 0%, #4ecdc4 100%);
  --gradient-dark: linear-gradient(135deg, #0a2540 0%, #0f4c75 100%);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif;
  font-size: 14px; line-height: 1.6; color: var(--text-primary);
  background: var(--bg-base); overflow: hidden;
}
#app { display: flex; flex-direction: column; height: 100vh; }

/* ==================== 顶部导航栏 ==================== */
.app-header {
  height: 56px; background: var(--gradient-dark);
  color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; box-shadow: 0 2px 12px rgba(15,76,117,.3); z-index: 100;
  flex-shrink: 0; position: relative;
}
.app-header::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--teal), transparent);
}
.header-left { display: flex; align-items: center; gap: 14px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { height: 36px; width: auto; border-radius: 4px; }
.logo-text {
  font-size: 17px; font-weight: 700; letter-spacing: 0.5px;
  background: linear-gradient(90deg, #fff, #b3d9f2);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.version-badge {
  background: rgba(248,180,0,.2); border: 1px solid rgba(248,180,0,.4);
  padding: 2px 10px; border-radius: 12px; font-size: 11px; color: var(--accent-light);
}
.header-right { font-size: 12px; display: flex; align-items: center; gap: 16px; }
.header-nav-tabs { display: flex; align-items: center; gap: 4px; }
.header-nav-tab {
  padding: 6px 16px; border-radius: 6px; font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,.7); cursor: pointer; transition: all .2s;
  background: transparent; border: 1px solid transparent;
}
.header-nav-tab:hover {
  color: #fff; background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
}
.header-nav-tab.active {
  color: #fff; background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.2);
}
.header-divider {
  width: 1px; height: 24px; background: rgba(255,255,255,.15);
  margin: 0 4px;
}
.header-info {
  color: rgba(255,255,255,.6); display: flex; align-items: center; gap: 6px;
  font-size: 11px;
}
.header-info::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--teal-light);
  box-shadow: 0 0 8px var(--teal-light);
}
.btn-export {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: #fff; padding: 6px 16px; border-radius: 6px; font-size: 12px;
  cursor: pointer; transition: all .2s; margin-left: 12px;
}
.btn-export:hover { background: rgba(255,255,255,.2); border-color: var(--accent); }

/* ==================== 主区域布局 ==================== */
.app-body { display: flex; flex: 1; overflow: hidden; }

/* ==================== 左侧输入面板 ==================== */
.input-panel {
  width: 360px; background: var(--bg-sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; transition: width .3s;
  flex-shrink: 0; overflow: hidden;
}
.input-panel.collapsed { width: 44px; }
.panel-header {
  padding: 14px 18px; background: var(--bg-card); border-bottom: 2px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.panel-header h3 {
  font-size: 15px; font-weight: 700; color: var(--primary);
  display: flex; align-items: center; gap: 8px;
}
.panel-header h3::before {
  content: ''; width: 4px; height: 18px; background: var(--gradient-accent);
  border-radius: 2px;
}
.btn-collapse {
  border: 1px solid var(--border); background: var(--bg-card); cursor: pointer;
  font-size: 12px; color: var(--text-secondary); border-radius: 4px;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.btn-collapse:hover { border-color: var(--primary); color: var(--primary); }
.panel-content { flex: 1; overflow-y: auto; padding: 0; }
.section { padding: 14px 18px; border-bottom: 1px solid var(--border-light); }
.section-title {
  font-size: 11px; font-weight: 700; color: var(--text-secondary);
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px;
  display: flex; align-items: center; gap: 6px;
}
.section-title::before {
  content: ''; width: 8px; height: 8px; border-radius: 2px;
  background: var(--gradient-primary); flex-shrink: 0;
}

/* 预设按钮 */
.preset-list { display: flex; flex-direction: column; gap: 6px; }
.preset-btn {
  text-align: left; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-card); cursor: pointer;
  font-size: 12px; transition: all .2s; position: relative; overflow: hidden;
}
.preset-btn::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--border); transition: all .2s;
}
.preset-btn:hover { border-color: var(--primary-light); background: #f0f7ff; }
.preset-btn:hover::before { background: var(--primary-light); }
.preset-btn.active {
  border-color: var(--primary); background: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(15,76,117,.3);
}
.preset-btn.active::before { background: var(--accent); }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-item { display: flex; flex-direction: column; gap: 4px; }
.form-item label { font-size: 11px; color: var(--text-secondary); font-weight: 600; }
.form-item input, .form-item select {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px;
  font-size: 13px; outline: none; transition: all .2s; width: 100%;
  background: var(--bg-card); color: var(--text-primary);
}
.form-item input:focus, .form-item select:focus {
  border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(50,130,184,.12);
}
.form-item input:disabled { background: #f1f5f9; color: var(--text-muted); }
.form-checkbox { grid-template-columns: 1fr 1fr; }
.checkbox-label {
  display: flex; align-items: center; gap: 6px; font-size: 12px;
  cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-card); transition: all .2s;
}
.checkbox-label:hover { border-color: var(--primary-light); }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

/* 计算按钮 */
.btn-calculate {
  width: 100%; padding: 12px; background: var(--gradient-primary);
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700; cursor: pointer; transition: all .2s;
  letter-spacing: 1px; position: relative; overflow: hidden;
}
.btn-calculate::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
  transform: translateX(-100%); transition: transform .6s;
}
.btn-calculate:hover:not(:disabled) {
  box-shadow: 0 6px 20px rgba(15,76,117,.4); transform: translateY(-2px);
}
.btn-calculate:hover::after { transform: translateX(100%); }
.btn-calculate:disabled { opacity: .6; cursor: not-allowed; }

/* ==================== 右侧结果面板 ==================== */
.result-panel { flex: 1; overflow-y: auto; padding: 20px 24px; }

/* 空状态 - 首页设计 */
.empty-state {
  text-align: center; padding: 40px 20px; max-width: 900px; margin: 0 auto;
}
.empty-logo { margin-bottom: 24px; }
.empty-logo img { height: 80px; width: auto; }
.empty-state h2 {
  color: var(--primary); margin-bottom: 12px; font-size: 28px; font-weight: 800;
  background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.empty-state .subtitle {
  font-size: 15px; color: var(--text-secondary); margin-bottom: 32px; max-width: 600px;
  margin-left: auto; margin-right: auto; line-height: 1.8;
}
.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-align: left; transition: all .3s; position: relative; overflow: hidden;
}
.feature-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient-primary); transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-card:hover::before { transform: scaleX(1); }
.feature-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex;
  align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px;
}
.feature-icon.blue { background: #e3f2fd; color: #1565c0; }
.feature-icon.teal { background: #e0f7f5; color: #00897b; }
.feature-icon.amber { background: #fff8e1; color: #f57f17; }
.feature-icon.purple { background: #f3e5f5; color: #7b1fa2; }
.feature-icon.green { background: #e8f5e9; color: #2e7d32; }
.feature-icon.red { background: #ffebee; color: #c62828; }
.feature-card h3 { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.feature-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.empty-hint {
  margin-top: 32px; color: var(--text-muted); font-size: 13px;
  padding: 12px 24px; background: var(--bg-card); border-radius: 20px;
  display: inline-block; border: 1px dashed var(--border);
}

/* 加载状态 */
.loading-state { text-align: center; padding: 80px 20px; }
.spinner {
  width: 48px; height: 48px; border: 4px solid var(--border); border-top: 4px solid var(--primary);
  border-radius: 50%; margin: 0 auto 16px; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 标签页 */
.tabs {
  display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 2px solid var(--border);
  flex-wrap: wrap; background: var(--bg-card); border-radius: var(--radius) var(--radius) 0 0;
  padding: 0 8px;
}
.tab-btn {
  padding: 10px 18px; border: none; background: none; cursor: pointer;
  font-size: 13px; color: var(--text-secondary); border-bottom: 3px solid transparent;
  margin-bottom: -2px; transition: all .2s; font-weight: 500;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active {
  color: var(--primary); border-bottom-color: var(--accent); font-weight: 700;
}

/* KPI卡片 */
.kpi-row { display: flex; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.kpi-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 16px 24px; min-width: 150px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  text-align: center; position: relative; overflow: hidden; transition: all .2s;
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient-primary);
}
.kpi-card.alert::before { background: var(--gradient-accent); }
.kpi-card.teal::before { background: var(--gradient-teal); }
.kpi-card.small { min-width: 110px; padding: 12px 18px; }
.kpi-label { font-size: 11px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--text-primary); margin: 6px 0 2px; }
.kpi-card.alert .kpi-value { color: var(--warning); }
.kpi-card.teal .kpi-value { color: var(--teal); }
.kpi-unit { font-size: 11px; color: var(--text-muted); }

/* 结果卡片 */
.card-row { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.card-row > .result-card { flex: 1; min-width: 400px; }
.result-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: box-shadow .2s;
}
.result-card:hover { box-shadow: var(--shadow-md); }
.result-card h4 {
  font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 2px solid var(--border-light);
  display: flex; align-items: center; gap: 8px;
}
.result-card h4::before {
  content: ''; width: 4px; height: 16px; background: var(--gradient-accent); border-radius: 2px;
}

/* 图表容器 */
.chart-container { width: 100%; }

/* 表格 */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  background: #f1f5f9; color: var(--text-secondary); font-weight: 700;
  text-align: left; padding: 8px 12px; border-bottom: 2px solid var(--border);
}
.data-table td { padding: 7px 12px; border-bottom: 1px solid var(--border-light); }
.data-table tr:hover td { background: #f8fafc; }
.data-table.wide { font-size: 13px; }
.data-table.wide td { padding: 9px 12px; }
.data-table .highlight-row td { background: #fffbeb; font-weight: 600; }
.highlight-text { color: var(--primary); font-weight: 700; }
.alert-text { color: var(--danger); font-weight: 700; }
.success-text { color: var(--success); font-weight: 700; }
.mono { font-family: "Cascadia Code", "Consolas", "Courier New", monospace; font-size: 12px; }

/* 工艺流程图 */
.process-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 14px 0; }
.flow-node { display: flex; align-items: center; }
.flow-name {
  background: linear-gradient(135deg, #e3f2fd, #f0f7ff); border: 1px solid #90cdf4;
  border-radius: var(--radius-sm); padding: 8px 14px; font-size: 12px;
  font-weight: 600; color: var(--primary); white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: all .2s;
}
.flow-name:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.flow-arrow { color: var(--text-muted); font-size: 18px; margin: 0 4px; }
.route-desc { color: var(--text-secondary); font-size: 13px; margin-bottom: 14px; line-height: 1.7; }
.route-controls h5 { font-size: 13px; color: var(--primary); margin: 14px 0 8px; font-weight: 700; }
.route-controls ul { padding-left: 20px; }
.route-controls li { font-size: 12px; color: var(--text-primary); margin: 4px 0; line-height: 1.6; }

/* 设备卡片 */
.equipment-summary { display: flex; gap: 20px; margin-bottom: 18px; font-size: 13px; }
.equipment-summary span {
  background: var(--bg-card); padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); color: var(--text-secondary); font-weight: 600;
}
.equipment-card {
  background: var(--bg-card); border-radius: var(--radius); margin-bottom: 14px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border); overflow: hidden;
  transition: box-shadow .2s;
}
.equipment-card:hover { box-shadow: var(--shadow-md); }
.equipment-header {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px;
  background: #f8fafc; border-bottom: 1px solid var(--border);
}
.equipment-index {
  width: 28px; height: 28px; border-radius: 50%; background: var(--gradient-primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.equipment-name { font-weight: 700; color: var(--text-primary); font-size: 14px; }
.equipment-type { font-size: 11px; color: var(--text-secondary); background: #e2e8f0; padding: 3px 10px; border-radius: 12px; }
.equipment-temp { font-size: 12px; color: var(--warning); margin-left: auto; font-weight: 600; }
.equipment-dp { font-size: 12px; color: var(--text-secondary); }
.equipment-body { padding: 14px 18px; display: flex; gap: 24px; }
.equipment-sizing { flex: 1; }
.equipment-sizing h5 { font-size: 12px; color: var(--primary); margin-bottom: 10px; font-weight: 700; }
.sizing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.sizing-item { display: flex; gap: 6px; font-size: 12px; align-items: flex-start; }
.sizing-label { color: var(--text-secondary); min-width: 120px; max-width: 150px; flex-shrink: 0; }
.sizing-value { color: var(--text-primary); font-weight: 600; word-break: break-word; flex: 1; line-height: 1.5; }
.equipment-meta { flex-shrink: 0; width: 280px; }
/* 详细规范参考 */
.detail-schemes { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 10px; }
.detail-toggle { font-size: 12px; color: var(--primary); cursor: pointer; user-select: none; font-weight: 600; }
.detail-toggle:hover { text-decoration: underline; }
.detail-section { margin-bottom: 10px; }
.detail-section-title { font-size: 11px; color: var(--primary); font-weight: 700; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .3px; }
.meta-item { font-size: 12px; margin-bottom: 8px; }
.meta-label { color: var(--text-secondary); font-weight: 600; }
.instrument-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.inst-tag {
  background: #f1f5f9; border: 1px solid var(--border); border-radius: 3px;
  padding: 2px 7px; font-size: 10px; color: var(--text-primary);
}

/* P&ID 图 */
.pid-container {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; overflow: auto;
}
.pid-svg { display: block; margin: 0 auto; }
.pid-toolbar {
  display: flex; gap: 10px; margin-bottom: 14px; align-items: center;
}
.pid-toolbar button {
  padding: 6px 14px; border: 1px solid var(--border); background: var(--bg-card);
  border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; transition: all .2s;
  color: var(--text-primary);
}
.pid-toolbar button:hover { border-color: var(--primary); color: var(--primary); }
.pid-legend {
  display: flex; gap: 16px; font-size: 11px; color: var(--text-secondary);
  margin-left: auto;
}
.pid-legend span { display: flex; align-items: center; gap: 4px; }
.pid-legend .dot { width: 10px; height: 10px; border-radius: 2px; }

/* 风险卡片 */
.risk-card {
  background: var(--bg-card); border-radius: var(--radius); margin-bottom: 12px;
  padding: 16px 18px; border-left: 5px solid var(--border); box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.risk-card:hover { box-shadow: var(--shadow-md); }
.risk-high { border-left-color: var(--danger); }
.risk-medium { border-left-color: var(--warning); }
.risk-low { border-left-color: var(--success); }
.risk-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.risk-type { font-weight: 700; color: var(--text-primary); font-size: 15px; }
.risk-level { font-size: 11px; padding: 3px 12px; border-radius: 12px; font-weight: 700; }
.level-high { background: #fee2e2; color: var(--danger); }
.level-medium { background: #fef3c7; color: #92400e; }
.level-low { background: #d1fae5; color: #065f46; }
.risk-desc { font-size: 13px; color: var(--text-primary); margin-bottom: 10px; line-height: 1.7; }
.risk-mitigation {
  font-size: 12px; color: var(--primary); background: #f0f7ff;
  padding: 10px 14px; border-radius: var(--radius-sm); line-height: 1.6;
}

/* 步骤卡片 */
.step-card {
  background: var(--bg-card); border-radius: var(--radius); margin-bottom: 12px;
  padding: 16px 18px; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: box-shadow .2s;
}
.step-card:hover { box-shadow: var(--shadow-md); }
.step-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.step-num {
  background: var(--gradient-primary); color: #fff; padding: 3px 12px;
  border-radius: var(--radius-sm); font-size: 12px; font-weight: 700;
}
.step-title { font-weight: 700; color: var(--text-primary); font-size: 14px; }
.step-summary { font-size: 13px; color: var(--text-primary); margin-bottom: 8px; line-height: 1.6; }
.step-formula {
  font-family: "Cascadia Code", "Consolas", monospace; font-size: 12px;
  color: #7c3aed; background: #f5f3ff; padding: 6px 10px; border-radius: var(--radius-sm);
  margin-bottom: 8px; border: 1px solid #e9d5ff;
}
.step-results pre {
  font-size: 11px; background: #f8fafc; padding: 10px 14px; border-radius: var(--radius-sm);
  overflow-x: auto; max-height: 300px; border: 1px solid var(--border-light);
}

/* PLC标签 */
.plc-tag { font-size: 10px; padding: 2px 7px; border-radius: 3px; font-weight: 700; }
.plc-AI { background: #dbeafe; color: #1e40af; }
.plc-AO { background: #ede9fe; color: #6b21a8; }
.plc-DI { background: #d1fae5; color: #065f46; }
.plc-DO { background: #fef3c7; color: #92400e; }

/* 分类标签 */
.category-tag { font-size: 11px; background: #f1f5f9; padding: 3px 10px; border-radius: 12px; color: var(--text-secondary); }

/* 排放达标 */
.compliance-pass { color: var(--success); font-weight: 700; }
.compliance-fail { color: var(--danger); font-weight: 700; }

/* 底部 */
.app-footer {
  height: 34px; background: var(--gradient-dark); color: #ffffff;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
  flex-shrink: 0; border-top: 1px solid rgba(255,255,255,.15);
}

/* 滚动条 */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 响应式 */
@media (max-width: 1200px) {
  .card-row { flex-direction: column; }
  .card-row > .result-card { min-width: 100%; }
  .equipment-body { flex-direction: column; }
  .equipment-meta { width: 100%; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .input-panel { width: 300px; }
  .form-grid { grid-template-columns: 1fr; }
  .sizing-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
}

/* ==================== 登录页 ==================== */
.login-view {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--gradient-dark); overflow: hidden; z-index: 1000;
}
.login-view::before {
  content: ''; position: absolute; width: 600px; height: 600px;
  border-radius: 50%; background: radial-gradient(circle, rgba(0,180,166,.15), transparent 70%);
  top: -200px; right: -100px; animation: float 8s ease-in-out infinite;
}
.login-view::after {
  content: ''; position: absolute; width: 400px; height: 400px;
  border-radius: 50%; background: radial-gradient(circle, rgba(248,180,0,.12), transparent 70%);
  bottom: -100px; left: -100px; animation: float 10s ease-in-out infinite reverse;
}
@keyframes float {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}
.login-card {
  position: relative; width: 420px; max-width: 90vw;
  background: rgba(255,255,255,.95); backdrop-filter: blur(20px);
  border-radius: 20px; padding: 48px 40px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.2);
  z-index: 1;
}
.login-logo {
  display: flex; justify-content: center; margin-bottom: 20px;
}
.login-logo img {
  height: 64px; width: auto; border-radius: 8px;
}
.login-title {
  text-align: center; font-size: 24px; font-weight: 800; color: var(--primary);
  margin-bottom: 6px; letter-spacing: 1px;
}
.login-subtitle {
  text-align: center; font-size: 13px; color: var(--text-secondary);
  margin-bottom: 32px;
}
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-form-item { position: relative; }
.login-form-item label {
  display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 6px;
}
.login-form-item input {
  width: 100%; padding: 12px 16px 12px 42px; border: 2px solid var(--border);
  border-radius: 10px; font-size: 14px; transition: all .2s; outline: none;
  background: #f8fafc;
}
.login-form-item input:focus {
  border-color: var(--primary-light); background: #fff;
  box-shadow: 0 0 0 4px rgba(50,130,184,.1);
}
.login-form-item .input-icon {
  position: absolute; left: 14px; top: 38px; font-size: 16px; color: var(--text-muted);
}
.btn-login {
  width: 100%; padding: 13px; border: none; border-radius: 10px;
  background: var(--gradient-primary); color: #fff; font-size: 15px;
  font-weight: 700; cursor: pointer; transition: all .2s; letter-spacing: 2px;
  margin-top: 6px;
}
.btn-login:hover {
  transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,76,117,.35);
}
.btn-login:active { transform: translateY(0); }
.login-hint {
  text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 20px;
  padding: 10px; background: #f0f7ff; border-radius: 8px; border: 1px dashed var(--primary-light);
}
.login-error {
  color: var(--danger); font-size: 12px; text-align: center; margin-top: 4px;
  padding: 8px; background: #fef2f2; border-radius: 6px;
}

/* ==================== 首页 ==================== */
.home-view {
  position: fixed; inset: 0; overflow-y: auto; background: var(--bg-base);
}
.home-nav {
  height: 64px; background: rgba(255,255,255,.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  justify-content: space-between; padding: 0 48px; position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.home-nav-logo { display: flex; align-items: center; gap: 12px; }
.home-nav-logo img { height: 40px; width: auto; border-radius: 6px; }
.home-nav-logo .nav-title { font-size: 18px; font-weight: 800; color: var(--primary); }
.home-nav-links { display: flex; align-items: center; gap: 32px; }
.home-nav-links a {
  font-size: 14px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; transition: color .2s; text-decoration: none;
}
.home-nav-links a:hover, .home-nav-links a.active { color: var(--primary); }
.home-nav-user { display: flex; align-items: center; gap: 12px; }
.home-nav-user .user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.home-nav-user .user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.btn-logout {
  background: none; border: 1px solid var(--border); padding: 6px 16px;
  border-radius: 6px; font-size: 12px; color: var(--text-secondary);
  cursor: pointer; transition: all .2s;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

.home-hero {
  background: var(--gradient-dark); color: #fff; padding: 80px 48px 100px;
  text-align: center; position: relative; overflow: hidden;
}
.home-hero::before {
  content: ''; position: absolute; width: 500px; height: 500px;
  border-radius: 50%; background: radial-gradient(circle, rgba(0,180,166,.12), transparent 70%);
  top: -150px; right: 10%; animation: float 8s ease-in-out infinite;
}
.home-hero::after {
  content: ''; position: absolute; width: 300px; height: 300px;
  border-radius: 50%; background: radial-gradient(circle, rgba(248,180,0,.08), transparent 70%);
  bottom: -100px; left: 15%; animation: float 10s ease-in-out infinite reverse;
}
.home-hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }
.home-hero h1 {
  font-size: 42px; font-weight: 800; margin-bottom: 16px; letter-spacing: 2px;
  background: linear-gradient(90deg, #fff, #b3d9f2, #4ecdc4);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.home-hero .hero-tagline {
  font-size: 18px; color: #a8caf0; margin-bottom: 12px; font-weight: 500;
}
.home-hero .hero-desc {
  font-size: 14px; color: #8ab4d8; margin-bottom: 36px; line-height: 1.8;
}
.btn-enter-platform {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 40px; border: none; border-radius: 30px;
  background: var(--gradient-accent); color: #1a2b3c; font-size: 16px;
  font-weight: 700; cursor: pointer; transition: all .3s; letter-spacing: 1px;
  box-shadow: 0 8px 24px rgba(248,180,0,.35);
}
.btn-enter-platform:hover {
  transform: translateY(-3px); box-shadow: 0 12px 32px rgba(248,180,0,.45);
}

.home-section { max-width: 1200px; margin: 0 auto; padding: 60px 48px; }
.home-section-title {
  text-align: center; font-size: 28px; font-weight: 800; color: var(--primary);
  margin-bottom: 8px;
}
.home-section-subtitle {
  text-align: center; font-size: 14px; color: var(--text-secondary);
  margin-bottom: 40px;
}
.home-feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.home-feature-card {
  background: var(--bg-card); border-radius: 16px; padding: 32px 24px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: all .3s; cursor: pointer;
}
.home-feature-card:hover {
  transform: translateY(-6px); box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.home-feature-card .card-icon {
  width: 56px; height: 56px; border-radius: 14px; display: flex;
  align-items: center; justify-content: center; font-size: 24px;
  margin-bottom: 18px;
}
.home-feature-card .card-icon.blue { background: #e3f2fd; color: #1976d2; }
.home-feature-card .card-icon.teal { background: #e0f7f5; color: #00897b; }
.home-feature-card .card-icon.amber { background: #fff8e1; color: #f57f17; }
.home-feature-card .card-icon.purple { background: #f3e5f5; color: #7b1fa2; }
.home-feature-card .card-icon.green { background: #e8f5e9; color: #388e3c; }
.home-feature-card .card-icon.red { background: #ffebee; color: #c62828; }
.home-feature-card h3 { font-size: 17px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.home-feature-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

.home-stats {
  display: flex; justify-content: center; gap: 60px; padding: 40px 48px;
  background: var(--bg-card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.home-stat { text-align: center; }
.home-stat .stat-value { font-size: 36px; font-weight: 800; color: var(--primary); }
.home-stat .stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.home-footer {
  background: var(--gradient-dark); color: #ffffff; text-align: center;
  padding: 30px 48px; font-size: 12px; line-height: 1.8;
}
.home-footer strong { color: #ffffff; }

/* 计算平台视图容器 */
.calc-view { display: flex; flex-direction: column; height: 100vh; }

/* details/summary 样式 */
.balance-details-summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--primary);
  padding: 8px 0; user-select: none;
}
.balance-details-summary:hover { color: var(--primary-light); }

/* ==================== 项目管理页 ==================== */
.project-view {
  position: fixed; inset: 0; overflow-y: auto; background: var(--bg-base);
}
.project-toolbar {
  max-width: 1200px; margin: 0 auto; padding: 24px 48px 0;
  display: flex; justify-content: space-between; align-items: center;
}
.project-toolbar h2 { font-size: 24px; font-weight: 800; color: var(--primary); }
.project-toolbar .toolbar-actions { display: flex; gap: 12px; }
.btn-new-project {
  padding: 10px 24px; border: none; border-radius: 8px;
  background: var(--gradient-primary); color: #fff; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: all .2s;
  box-shadow: 0 4px 12px rgba(15,76,117,.2);
}
.btn-new-project:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(15,76,117,.3); }
.btn-back-home {
  padding: 10px 20px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--text-secondary); font-size: 13px;
  cursor: pointer; transition: all .2s;
}
.btn-back-home:hover { border-color: var(--primary-light); color: var(--primary); }

.project-list {
  max-width: 1200px; margin: 0 auto; padding: 24px 48px 60px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 20px;
}
.project-card {
  background: var(--bg-card); border-radius: 14px; padding: 24px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: all .2s; position: relative;
}
.project-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-light); transform: translateY(-3px); }
.project-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.project-card-title { font-size: 17px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.project-card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.project-card-badge {
  font-size: 10px; padding: 3px 10px; border-radius: 12px; font-weight: 600;
  white-space: nowrap;
}
.badge-has-result { background: #d1fae5; color: #065f46; }
.badge-no-result { background: #f1f5f9; color: var(--text-muted); }
.project-card-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0;
}
.project-meta-tag {
  font-size: 11px; padding: 3px 10px; border-radius: 6px;
  background: #f0f7ff; color: var(--primary); border: 1px solid #dbeafe;
}
.project-card-metrics {
  display: flex; gap: 20px; padding: 12px 0; border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light); margin-bottom: 14px;
}
.project-metric { text-align: center; }
.project-metric .metric-val { font-size: 18px; font-weight: 700; color: var(--primary); }
.project-metric .metric-lbl { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.project-card-footer {
  display: flex; gap: 8px; justify-content: flex-end;
}
.btn-project-action {
  padding: 7px 16px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .2s; color: var(--text-secondary);
}
.btn-project-action:hover { border-color: var(--primary-light); color: var(--primary); }
.btn-project-action.primary {
  background: var(--gradient-primary); color: #fff; border: none;
}
.btn-project-action.primary:hover { box-shadow: 0 4px 12px rgba(15,76,117,.25); }
.btn-project-action.danger:hover { border-color: var(--danger); color: var(--danger); }

.project-empty {
  text-align: center; padding: 80px 20px; color: var(--text-muted);
}
.project-empty-icon { font-size: 48px; margin-bottom: 16px; }

/* 项目创建对话框 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.modal-card {
  background: #fff; border-radius: 16px; padding: 32px;
  width: 500px; max-width: 90vw; box-shadow: var(--shadow-lg);
}
.modal-card h3 { font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 20px; }
.modal-form { display: flex; flex-direction: column; gap: 16px; }
.modal-form-item label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.modal-form-item input, .modal-form-item select, .modal-form-item textarea {
  width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: 8px;
  font-size: 14px; outline: none; transition: border-color .2s; background: #f8fafc;
}
.modal-form-item input:focus, .modal-form-item select:focus, .modal-form-item textarea:focus {
  border-color: var(--primary-light); background: #fff;
}
.modal-form-item textarea { resize: vertical; min-height: 60px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.btn-modal-cancel {
  padding: 10px 24px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; font-size: 14px; cursor: pointer; color: var(--text-secondary);
}
.btn-modal-confirm {
  padding: 10px 24px; border: none; border-radius: 8px;
  background: var(--gradient-primary); color: #fff; font-size: 14px;
  font-weight: 600; cursor: pointer;
}

/* 项目上下文指示器 */
.project-context-bar {
  background: #fff8e1; border-bottom: 1px solid #ffe082;
  padding: 6px 24px; font-size: 12px; color: #92400e;
  display: flex; align-items: center; justify-content: space-between;
}
.project-context-bar strong { color: #78350f; }
