/* =============================================
   State Grid Power - 电费电量查询 Web 版
   主色 #0052D9 · 参照国家电网 www.95598.cn 设计风格
   扁平权威 · 清晰高效 · 数据优先
   ============================================= */

/* ===== CSS 变量 ===== */
:root {
  /* ===== 国家电网品牌色系 ===== */
  --primary: #0052D9;
  --primary-dark: #0041B3;
  --primary-light: #E8F0FE;
  --primary-bg: #F0F5FF;
  --primary-gradient: linear-gradient(135deg, #0052D9 0%, #0066F0 100%);

  /* 语义色 */
  --accent: #FF6A00;
  --accent-light: #FFF3E8;
  --success: #00B578;
  --success-light: #EDFFF5;
  --danger: #F5222D;
  --danger-light: #FFF1F0;
  --warning: #FAAD14;

  /* 文字 */
  --text-primary: #1A1A2E;
  --text-secondary: #555555;
  --text-muted: #999999;

  /* 边框 & 背景 */
  --border: #E5E5E5;
  --border-light: #F0F0F0;
  --bg-body: #F5F6FA;
  --bg-card: #FFFFFF;

  /* 阴影（更轻更自然） */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 2px 12px rgba(0,0,0,0.08);

  /* 圆角 */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  /* 尺寸 */
  --header-height: 56px;
  --nav-height: 50px;
  --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* ===== 重置 & 基础 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-body);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

input, select, textarea, button {
  font-family: var(--font-family);
  font-size: 0.875rem;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b0b0b0; }

/* ===== 顶部导航 ===== */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 82, 217, 0.2);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
}

.header-logo-icon {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.15);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-auth-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
  max-width: 160px;
}

.header-auth-badge:hover { background: rgba(255,255,255,0.25); }
.header-auth-badge-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.header-btn {
  padding: 6px 14px;
  background: rgba(255,255,255,0.15);
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
}

.header-btn:hover { background: rgba(255,255,255,0.25); }

/* ===== 主导航 Tab ===== */
.main-nav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  z-index: 999;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  height: var(--nav-height);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-inner::-webkit-scrollbar { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  user-select: none;
}

.nav-item:hover {
  color: var(--primary);
  background: var(--primary-bg);
}

.nav-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
  background: transparent;
}

.nav-item .nav-icon { font-size: 1rem; }

/* ===== 主内容区 ===== */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  /* header + tool-nav + sub-nav(40px when visible) + gap */
  padding-top: calc(var(--header-height) + var(--nav-height) + 60px);
  padding-bottom: 40px;
}

/* ===== 视图容器 ===== */
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-title-dot {
  display: inline-block;
  width: 3px;
  height: 14px;
  background: #0052D9;
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: middle;
}

/* ===== 登录/授权页面 ===== */
.auth-view {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-height) - var(--nav-height) - 80px);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.auth-header {
  background: var(--primary);
  padding: 32px;
  text-align: center;
  color: #fff;
}

.auth-header-icon {
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 12px;
}

.auth-header h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 4px; }
.auth-header p { font-size: 0.8rem; opacity: 0.8; }

.auth-body { padding: 24px 32px 32px; }

.auth-intro {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}

.auth-form-group {
  margin-bottom: 16px;
}

.auth-form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.auth-form-input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 0.9rem;
  transition: border-color 0.2s;
  outline: none;
  background: #fafafa;
}

.auth-form-input:focus {
  border-color: #0052D9;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.auth-form-input::placeholder { color: #ccc; }

.auth-switch-link {
  text-align: center;
  margin-top: 12px;
  font-size: 0.8rem;
  color: #0052D9;
  cursor: pointer;
}

.auth-switch-link:hover { text-decoration: underline; }

.auth-status-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--success-light);
  border: 1px solid #99E6C0;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.auth-status-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.auth-status-info { flex: 1; }
.auth-status-name { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.auth-status-code { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.auth-status-hint { font-size: 0.78rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 16px; }

/* ===== 余额/概览卡片 (Dashboard) ===== */
.balance-hero {
  background: var(--primary-gradient);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  color: #fff;
  margin-bottom: 20px;
  position: relative;
}

.balance-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.balance-label {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: 4px;
}

.balance-amount {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.balance-amount .unit {
  font-size: 1rem;
  font-weight: 400;
  opacity: 0.85;
}

.balance-actions {
  display: flex;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.balance-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 18px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 0.75rem;
  min-width: 72px;
}

.balance-action-btn:hover { background: rgba(255,255,255,0.25); }
.balance-action-btn .action-icon { font-size: 1.25rem; }

.balance-stats {
  display: flex;
  gap: 32px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.balance-stat {
  flex: 1;
}

.balance-stat-label {
  font-size: 0.75rem;
  opacity: 0.7;
}

.balance-stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2px;
}

/* ===== 快捷统计卡片 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
  border: 1px solid var(--border-light);
}

.stat-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin: 0 auto 8px;
}

.stat-card-icon.blue { background: var(--primary-bg); }
.stat-card-icon.orange { background: var(--accent-light); }
.stat-card-icon.green { background: var(--success-light); }

.stat-card-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-card-value {
  font-size: 1.3rem;
  font-weight: 700;
}

.stat-card-value.blue { color: #0052D9; }
.stat-card-value.orange { color: var(--accent); }
.stat-card-value.green { color: #00B578; }

.stat-card-unit {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* ===== 图表容器 ===== */
.chart-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
}

.chart-wrapper-sm {
  height: 220px;
}

.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
}

.chart-empty-icon { font-size: 3rem; margin-bottom: 8px; }
.chart-empty-text { font-size: 0.9rem; }
.chart-empty-hint { font-size: 0.78rem; color: #ccc; margin-top: 4px; }

/* ===== 图例 ===== */
.chart-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: opacity 0.2s, color 0.2s;
  user-select: none;
}

.legend-item.active {
  color: var(--text-primary);
}

.legend-item:not(.active) {
  opacity: 0.4;
}

.legend-item:hover {
  opacity: 0.8;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.blue { background: #0052D9; }
.legend-dot.orange { background: var(--accent); }

/* ===== 表格 ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  text-align: left;
  padding: 10px 8px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  font-size: 0.8rem;
  white-space: nowrap;
}

.data-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.data-table tr:hover td { background: #FAFAFA; }

.data-table .text-right { text-align: right; }
.data-table .text-center { text-align: center; }

/* ===== 月份账单列表 ===== */
.bill-list { display: flex; flex-direction: column; gap: 10px; }

.bill-item {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  gap: 16px;
  border: 1px solid var(--border-light);
}

.bill-item:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
}

.bill-month {
  width: 72px;
  text-align: center;
  flex-shrink: 0;
}

.bill-month-num {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0052D9;
}

.bill-month-year {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.bill-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
  flex-shrink: 0;
}

.bill-info {
  flex: 1;
  display: flex;
  gap: 32px;
}

.bill-info-item { flex: 1; }
.bill-info-label { font-size: 0.75rem; color: var(--text-muted); }
.bill-info-value { font-size: 1.1rem; font-weight: 600; margin-top: 2px; }
.bill-info-value.blue { color: #0052D9; }
.bill-info-value.orange { color: var(--accent); }

.bill-arrow {
  font-size: 1.2rem;
  color: #ddd;
  flex-shrink: 0;
}

/* ===== 表单 ===== */
.form-card { margin-bottom: 16px; }
.form-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  gap: 12px;
}

.form-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  min-width: 110px;
  flex-shrink: 0;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-input, .form-select {
  flex: 1;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 0.85rem;
  outline: none;
  background: #FAFAFA;
  transition: all 0.2s;
  max-width: 280px;
}

.form-input:focus, .form-select:focus {
  border-color: #0052D9;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.form-input-sm { max-width: 160px; }

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.6;
}

/* 分时用电量网格 */
.period-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.period-item {
  background: var(--bg-body);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.period-label {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.period-label-jian { background: #FFF1F0; color: #CF1322; }
.period-label-feng { background: var(--accent-light); color: #D46B08; }
.period-label-ping { background: var(--primary-bg); color: var(--primary); }
.period-label-gu { background: var(--success-light); color: #009966; }

.period-input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 8px;
  text-align: center;
  font-size: 0.9rem;
  outline: none;
  background: #fff;
}

.period-input:focus {
  border-color: #0052D9;
  box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.period-unit {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
  user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: #0041B3; }

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover { background: #E05500; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover { background: #CF1322; }

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover { background: #389E0D; }

.btn-sm { height: 30px; padding: 0 12px; font-size: 0.78rem; }
.btn-lg { height: 44px; padding: 0 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: 8px; }

/* ===== 自动计算按钮 ===== */
.auto-calc-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--primary);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  transition: background 0.2s;
}

.auto-calc-btn:hover { background: var(--primary-bg); }

/* ===== 充值记录 ===== */
.topup-list { display: flex; flex-direction: column; gap: 8px; }

.topup-item {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  gap: 12px;
  transition: box-shadow 0.2s, border-color 0.2s;
  border: 1px solid var(--border-light);
}

.topup-item:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
}

.topup-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary-bg), #D6E4FF);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.topup-info { flex: 1; }
.topup-amount {
  font-size: 1rem;
  font-weight: 600;
  color: var(--success);
}

.topup-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.topup-note {
  font-size: 0.75rem;
  color: #bbb;
  margin-right: 12px;
  flex-shrink: 0;
}

.topup-del-btn {
  font-size: 0.75rem;
  color: var(--danger);
  padding: 4px 10px;
  border: 1px solid var(--danger);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.topup-del-btn:hover { background: var(--danger-light); }

/* ===== 弹窗 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.show { display: flex; }

.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  padding: 20px 24px 0;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
}

.modal-body { padding: 16px 24px 20px; }
.modal-footer {
  display: flex;
  border-top: 1px solid var(--border-light);
}

.modal-footer .modal-btn {
  flex: 1;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
  border: none;
  background: transparent;
}

.modal-footer .modal-btn:hover { background: #FAFAFA; }

.modal-footer .modal-btn.modal-btn-primary {
  color: #0052D9;
  font-weight: 600;
  border-left: 1px solid var(--border-light);
}

.modal-footer .modal-btn.modal-btn-cancel { color: var(--text-secondary); }

/* ===== 弹窗内表单 ===== */
.modal-form-row {
  margin-bottom: 14px;
}

.modal-form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.modal-form-input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
  background: #FAFAFA;
}

.modal-form-input:focus {
  border-color: #0052D9;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

/* ===== 空状态 ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 0;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 3.5rem; margin-bottom: 12px; }
.empty-state-title { font-size: 1rem; font-weight: 500; }
.empty-state-hint { font-size: 0.8rem; color: #ccc; margin-top: 4px; }

/* ===== 模式切换Tabs ===== */
.mode-tabs {
  display: flex;
  background: var(--bg-body);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 16px;
  width: fit-content;
}

.mode-tab {
  padding: 6px 20px;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
  user-select: none;
}

.mode-tab.active {
  background: #fff;
  color: #0052D9;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.mode-tab:hover:not(.active) { color: var(--text-primary); }

/* ===== 年份选择胶囊 ===== */
.year-capsule {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.year-capsule-item {
  padding: 5px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
}

.year-capsule-item:hover { border-color: #0052D9; color: #0052D9; }
.year-capsule-item.active {
  background: #0052D9;
  color: #fff;
  border-color: #0052D9;
}

/* ===== 日用电量列表 ===== */
.day-list { display: flex; flex-direction: column; gap: 6px; }

.day-item {
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
  border: 1px solid var(--border-light);
}

.day-item:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
}

.day-summary {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  gap: 12px;
  transition: background 0.2s;
}

.day-summary:hover { background: #FAFAFA; }

.day-date {
  width: 80px;
  font-size: 0.85rem;
  font-weight: 500;
  flex-shrink: 0;
}

.day-weekday {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.day-kwh {
  flex: 1;
  text-align: right;
  font-size: 0.85rem;
  color: #0052D9;
  font-weight: 500;
}

.day-cost {
  width: 100px;
  text-align: right;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  flex-shrink: 0;
}

.day-arrow {
  width: 24px;
  text-align: center;
  font-size: 0.7rem;
  color: #ddd;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.day-arrow.expanded { transform: rotate(180deg); }

.day-detail {
  padding: 16px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-body);
}

.detail-content {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.detail-chart-area {
  width: 180px;
  height: 180px;
  flex-shrink: 0;
}

.detail-periods {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 20px;
}

.period-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.period-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.period-dot-jian { background: #FF4D4F; }
.period-dot-feng { background: var(--accent); }
.period-dot-ping { background: #0052D9; }
.period-dot-gu { background: var(--success); }

.period-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  width: 20px;
}

.period-value {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.detail-total {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.detail-total-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-right: 4px;
}

.detail-total-kwh { font-size: 0.9rem; font-weight: 600; color: #0052D9; }
.detail-total-cost { font-size: 0.9rem; font-weight: 600; color: var(--accent); }

/* ===== 工具导航（二级导航） ===== */
.tool-nav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  z-index: 999;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.tool-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  height: var(--nav-height);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tool-nav-inner::-webkit-scrollbar { display: none; }

.tool-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  user-select: none;
  position: relative;
}

.tool-nav-item:hover:not(.disabled) {
  color: var(--primary);
  background: var(--primary-bg);
}

.tool-nav-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
  background: var(--primary-bg);
}

.tool-nav-item.disabled {
  color: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.tool-nav-icon { font-size: 1rem; }

.coming-soon {
  font-size: 0.6rem;
  color: #fff;
  background: #FF6A00;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
  font-weight: 400;
  white-space: nowrap;
}

/* ===== 子导航（三级导航，工具内页） ===== */
.sub-nav {
  position: fixed;
  top: calc(var(--header-height) + var(--nav-height));
  left: 0;
  right: 0;
  z-index: 998;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.sub-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  height: 40px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 8px;
}

.sub-nav-inner::-webkit-scrollbar { display: none; }

.sub-nav-item {
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  user-select: none;
}

.sub-nav-item:hover { color: var(--text-secondary); }

.sub-nav-item.active {
  color: #0052D9;
  border-bottom-color: #0052D9;
  font-weight: 500;
}

/* ===== 工具导航（二级导航） ===== */
.hub-banner {
  background: var(--primary-gradient);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  color: #fff;
  margin-bottom: 24px;
}
.hub-banner-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.hub-banner-desc { font-size: 0.85rem; opacity: 0.8; }

.hub-section {
  margin-bottom: 24px;
}

.hub-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-left: 4px;
}

/* 工具卡片网格 */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.tool-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border-light);
}

.tool-card:hover:not(.disabled) {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
}

.tool-card.disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.tool-card-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-card-icon { font-size: 1.4rem; }

.tool-card-info { flex: 1; min-width: 0; }
.tool-card-name { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.tool-card-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.tool-card-status {
  font-size: 0.7rem;
  color: var(--success);
  background: var(--success-light);
  padding: 2px 10px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tool-card-status-badge {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--bg-body);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== 工具页头 ===== */
.tool-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.tool-header-icon {
  width: 42px;
  height: 42px;
  background: var(--primary-bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.tool-header-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tool-header-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== Toast 提示 ===== */
.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  pointer-events: auto;
  max-width: 90vw;
  text-align: center;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }
.toast.warning { background: var(--warning); color: #333; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

/* ===== Loading 状态 ===== */
.loading-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0052D9;
  animation: bounce 1.4s ease infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  gap: 12px;
}

/* ===== 管理员面板 ===== */
.admin-stats-grid {
  grid-template-columns: repeat(4, 1fr) !important;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-logout-btn {
  color: var(--danger) !important;
  border-color: var(--danger) !important;
}

.admin-logout-btn:hover {
  background: var(--danger-light) !important;
}

.admin-table-card {
  padding: 0 !important;
  overflow: hidden;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  min-width: 700px;
}

.admin-table th {
  white-space: nowrap;
  font-size: 0.78rem;
}

.admin-table .col-index { width: 40px; text-align: center; }
.admin-table .col-code { min-width: 110px; }
.admin-table .col-name { min-width: 90px; }
.admin-table .col-remark { min-width: 80px; }
.admin-table .col-status { width: 80px; text-align: center; }
.admin-table .col-records { width: 60px; text-align: center; }
.admin-table .col-time { min-width: 130px; }
.admin-table .col-actions { min-width: 120px; text-align: center; }

/* 状态标签 */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}

.status-badge.active {
  background: var(--success-light);
  color: #00B578;
}

.status-badge.inactive {
  background: #FFF1F0;
  color: #F5222D;
}

/* 开关样式 */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #d9d9d9;
  border-radius: 20px;
  transition: all 0.25s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background: #00B578;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
}

/* 管理员表格按钮 */
.admin-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  font-size: 0.72rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  white-space: nowrap;
}

.admin-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}

.admin-action-btn.danger {
  color: var(--danger);
  border-color: var(--danger);
}

.admin-action-btn.danger:hover {
  background: var(--danger-light);
}

.admin-code-link {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 500;
}

/* ===== 管理员登录方式切换 ===== */
.admin-login-tabs {
  display: flex;
  background: var(--bg-body);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 16px;
  width: 100%;
}

.admin-login-tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.82rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
  user-select: none;
  text-align: center;
}

.admin-login-tab.active {
  background: #fff;
  color: #0052D9;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.admin-login-tab:hover:not(.active) {
  color: var(--text-primary);
}

/* ===== 微信扫码区域 ===== */
.wechat-qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 8px;
  min-height: 260px;
}

.wechat-qr-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

#wechatQrCode {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
}

#wechatQrCode canvas,
#wechatQrCode img {
  max-width: 100%;
  max-height: 100%;
}

.wechat-qr-tip {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-top: 14px;
}

.wechat-qr-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  animation: fadeIn 0.3s ease;
}

.wechat-status-icon {
  font-size: 3rem;
  line-height: 1;
}

.wechat-status-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .header-inner { padding: 0 12px; }
  .header-logo { font-size: 1rem; }
  .header-logo-icon { width: 28px; height: 28px; font-size: 1rem; }
  .header-auth-badge { max-width: 100px; font-size: 0.7rem; padding: 3px 8px; }
  .header-btn { font-size: 0.75rem; padding: 4px 10px; }

  .main-content { padding: 12px; padding-top: calc(var(--header-height) + var(--nav-height) + 12px); }

  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card { padding: 12px 8px; }
  .stat-card-value { font-size: 1.1rem; }

  .balance-hero { padding: 20px; }
  .balance-amount { font-size: 2rem; }
  .balance-actions { gap: 6px; }
  .balance-action-btn { padding: 8px 12px; min-width: 60px; font-size: 0.7rem; }
  .balance-stats { gap: 12px; flex-wrap: wrap; }

  .period-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .form-label { min-width: auto; }
  .form-input, .form-select { max-width: 100%; width: 100%; }

  .bill-item { padding: 12px 14px; gap: 10px; }
  .bill-info { gap: 16px; flex-wrap: wrap; }
  .bill-month { width: 56px; }
  .bill-month-num { font-size: 1rem; }

  .detail-content { flex-direction: column; align-items: center; }
  .detail-chart-area { width: 160px; height: 160px; }
  .detail-periods { width: 100%; }

  .nav-item { padding: 0 12px; font-size: 0.8rem; }

  .auth-card { margin: 12px; }
  .auth-body { padding: 20px; }

  /* 管理员面板响应式 */
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-toolbar-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stat-card { padding: 10px 6px; }
  .stat-card-value { font-size: 1rem; }
  .stat-card-icon { width: 32px; height: 32px; font-size: 1rem; }

  .balance-stats { flex-direction: column; gap: 8px; }
  .balance-amount { font-size: 1.8rem; }

  .topup-item { padding: 10px 12px; }
  .topup-amount { font-size: 0.9rem; }

  .tool-grid { grid-template-columns: 1fr; }
  .hub-banner { padding: 28px 20px; }
  .hub-banner-title { font-size: 1.3rem; }
}

/* ===== ICP 备案信息 ===== */
.footer-icp {
  text-align: center;
  padding: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-icp a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-icp a:hover {
  color: var(--primary);
}

/* ===== Excel 导入 ===== */
.excel-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #FAFAFA;
  margin-bottom: 12px;
}

.excel-dropzone:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.excel-dropzone.dragover {
  border-color: var(--primary);
  background: #E8F0FE;
}

.excel-dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.excel-dropzone-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.excel-dropzone-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.excel-preview-wrap {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.excel-preview-wrap::-webkit-scrollbar { width: 4px; }
.excel-preview-wrap::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.excel-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.excel-preview-table th {
  background: var(--bg-body);
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}

.excel-preview-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.excel-preview-table tr:hover td {
  background: var(--primary-bg);
}

.excel-preview-table .preview-date {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 0.76rem;
  color: var(--primary);
  font-weight: 500;
}

.excel-preview-table .preview-skip {
  color: #ccc;
  font-size: 0.72rem;
}

.excel-progress {
  margin: 8px 0 12px;
}

.excel-progress-bar {
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.excel-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.excel-progress-text {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-align: center;
}

.excel-result {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.6;
  margin-top: 8px;
}

.excel-result.success {
  background: var(--success-light);
  border: 1px solid #99E6C0;
  color: #009966;
}

.excel-result.error {
  background: var(--danger-light);
  border: 1px solid #FFCCC7;
  color: #CF1322;
}

.excel-result.warning {
  background: #FFFBE6;
  border: 1px solid #FFE58F;
  color: #D48806;
}
