/* ============================================================
 * styles.css — 浅色主题 · 财务指标看板
 * ============================================================ */
:root {
  --bg: #f2f6fb;
  --bg-2: #e9eff7;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f1;
  --border-2: #cfd9e6;
  --text: #1e293b;
  --text-2: #475569;
  --muted: #7c8ba1;
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --primary-s: #eaf1ff;
  --ex: #10b981;
  --gd: #f59e0b;
  --bd: #ef4444;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --ff: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--ff);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
 * 登录页 — 居中卡片式 · 高级感设计
 * ============================================================ */
.login-overlay {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 30% 20%, #1a2a4a 0%, #0f1729 45%, #0a0f1e 100%);
  overflow: hidden;
}
/* 背景装饰光晕 */
.login-bg-deco {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 75% 85%, rgba(37,99,235,.18) 0%, transparent 40%),
    radial-gradient(circle at 15% 75%, rgba(220,38,38,.12) 0%, transparent 35%),
    radial-gradient(circle at 85% 15%, rgba(245,158,11,.10) 0%, transparent 30%);
}
.login-overlay::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .04;
  background-image:
    linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px);
  background-size: 48px 48px;
}
.login-card {
  position: relative; z-index: 1;
  width: 440px; max-width: calc(100vw - 32px);
  background: rgba(255,255,255,.97);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.08);
  padding: 38px 40px 30px;
  animation: loginFadeIn .5s cubic-bezier(.16,1,.3,1);
}
@keyframes loginFadeIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
/* 头部品牌 */
.login-header { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.login-emblem { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.emblem-ring {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #dc2626, #f59e0b);
  box-shadow: 0 4px 16px rgba(220,38,38,.3), inset 0 1px 0 rgba(255,255,255,.3);
  position: relative;
}
.emblem-ring::after {
  content: '⚡'; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 24px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.emblem-text { font-size: 10.5px; font-weight: 800; letter-spacing: 2px; color: #94a3b8; text-transform: uppercase; }
.login-titles h1 { font-size: 19px; margin: 0; font-weight: 800; color: #0f172a; letter-spacing: .5px; }
.login-titles p { font-size: 13px; margin: 4px 0 0; color: #64748b; font-weight: 500; }
/* 分割线 */
.login-divider { display: flex; align-items: center; gap: 10px; margin: 22px 0; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #e2e8f1, transparent); }
.login-divider span { width: 8px; height: 8px; border-radius: 50%; background: #dc2626; flex: 0 0 8px; }
/* 表单 */
.login-body { display: flex; flex-direction: column; gap: 18px; }
.login-field { display: flex; flex-direction: column; gap: 7px; }
.login-field > label { font-size: 13px; font-weight: 700; color: #1e293b; }
.login-select-wrap { position: relative; }
.login-select-wrap select {
  width: 100%; appearance: none; -webkit-appearance: none;
  padding: 11px 36px 11px 14px; font-size: 14px; font-family: inherit;
  border: 1.5px solid #e2e8f1; border-radius: 10px; background: #f8fafc; color: #0f172a; outline: none;
  transition: border-color .2s, box-shadow .2s; cursor: pointer;
}
.login-select-wrap select:focus { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.12); background: #fff; }
.login-select-wrap .select-arrow { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 12px; color: #94a3b8; pointer-events: none; }
.login-pwd-wrap { position: relative; }
.login-pwd-wrap input {
  width: 100%; padding: 11px 44px 11px 14px; font-size: 14px; font-family: inherit;
  border: 1.5px solid #e2e8f1; border-radius: 10px; background: #f8fafc; color: #0f172a; outline: none;
  transition: border-color .2s, box-shadow .2s; letter-spacing: 1px;
}
.login-pwd-wrap input:focus { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.12); background: #fff; }
.login-pwd-wrap input::placeholder { letter-spacing: 0; color: #94a3b8; }
.pwd-toggle-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; cursor: pointer; padding: 4px;
  display: flex; align-items: center; justify-content: center; color: #94a3b8; transition: color .2s;
}
.pwd-toggle-btn:hover { color: #dc2626; }
.eye-icon { display: none; }
.pwd-toggle-btn .eye-open { display: block; }
.pwd-toggle-btn.show-pwd .eye-open { display: none; }
.pwd-toggle-btn.show-pwd .eye-closed { display: block; }
/* 错误提示 */
.login-error {
  min-height: 20px; font-size: 13px; color: #dc2626; font-weight: 600;
  text-align: center; opacity: 0; transition: opacity .2s;
}
.login-error.show { opacity: 1; animation: shake .35s ease; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
/* 登录按钮 */
.login-btn {
  width: 100%; padding: 13px; font-size: 15px; font-weight: 800; letter-spacing: 4px;
  color: #fff; border: none; border-radius: 10px; cursor: pointer; font-family: inherit;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  box-shadow: 0 4px 14px rgba(220,38,38,.35), inset 0 1px 0 rgba(255,255,255,.2);
  transition: transform .15s, box-shadow .15s, filter .15s; margin-top: 2px;
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(220,38,38,.45), inset 0 1px 0 rgba(255,255,255,.2); filter: brightness(1.05); }
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.login-footer { text-align: center; margin-top: 22px; font-size: 11.5px; color: #94a3b8; letter-spacing: 1px; }
/* 登录页隐藏后 */
.login-overlay.hidden { display: none; }

/* ============================================================
 * 名称虚化样式 — 非授权大区/区域公司名称模糊
 * ============================================================ */
.nm-blur { filter: blur(4px); user-select: none; cursor: default; }
.bg-blur { filter: blur(3.5px); user-select: none; }

#app { display: flex; min-height: 100vh; }

/* ---------- 侧栏 ---------- */
.side {
  width: 268px; flex: 0 0 268px; background: #fff; border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
}
.side-head { padding: 18px 18px 12px; border-bottom: 1px solid var(--border); }
.side-head .brand { display: flex; align-items: center; gap: 9px; }
.side-head .brand .logo {
  width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.side-head h1 { font-size: 15px; margin: 0; font-weight: 800; letter-spacing: .3px; }
.side-head p { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
.side-scroll { overflow-y: auto; padding: 10px; flex: 1; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  background: transparent; border: 0; border-radius: 9px; cursor: pointer; text-align: left;
  color: var(--text-2); transition: .15s; margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-2); }
.nav-item.active { background: var(--primary-s); color: var(--primary-d); }
.nav-idx { font-size: 10.5px; font-weight: 800; color: var(--muted); width: 18px; flex: 0 0 18px; text-align: center; }
.nav-item.active .nav-idx { color: var(--primary); }
.nav-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nav-txt b { font-size: 12.8px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nav-txt i { font-style: normal; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #dbe3ee; flex: 0 0 6px; }
.dot.has { background: var(--ex); box-shadow: 0 0 0 3px rgba(16, 185, 129, .15); }
.side-foot { padding: 10px 14px 14px; border-top: 1px solid var(--border); }
/* 身份信息条（登录后显示） */
.auth-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; padding: 6px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; font-size: 12px; }
.auth-identity { color: var(--text-2); font-weight: 600; }
.auth-logout { border: 1px solid var(--border-2); background: #fff; color: var(--muted); border-radius: 6px; padding: 2px 10px; font-size: 11.5px; cursor: pointer; transition: .15s; font-family: inherit; }
.auth-logout:hover { color: #dc2626; border-color: #dc2626; background: #fef2f2; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; user-select: none; }
.switch span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.switch input { display: none; }
.switch .track { width: 40px; height: 22px; border-radius: 22px; background: #d5dee9; position: relative; transition: .2s; flex: 0 0 40px; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { left: 20px; }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; padding: 22px 26px 60px; max-width: 1500px; }
.loading { padding: 80px; text-align: center; color: var(--muted); }
.banner { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; }

.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 22px; margin: 0 0 6px; font-weight: 800; letter-spacing: .2px; }
.page-head .sub, .hero .sub { margin: 0; color: var(--muted); font-size: 13px; }

/* ---------- 总览卡片 ---------- */
.overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px 13px; cursor: pointer; transition: .18s; box-shadow: var(--shadow-sm);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-2); }
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.card-idx { font-size: 11px; font-weight: 800; color: var(--primary); background: var(--primary-s); padding: 1px 7px; border-radius: 6px; }
.card h3 { font-size: 15px; margin: 6px 0 4px; font-weight: 700; line-height: 1.4; }
.card-meta { font-size: 11.5px; color: var(--muted); }
.card-nums { display: flex; gap: 10px; margin: 11px 0 9px; }
.card-nums > div { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; }
/* 电力年累平均值气泡：与电力平均值气泡颜色区分 */
.card-nums > div.ya-cell { background: #eff6ff; border-color: #93c5fd; }
.card-nums > div.ya-cell span { color: #1e40af; }
.card-nums > div.ya-cell b { color: #1d4ed8; }
.card-nums span { display: block; font-size: 10.5px; color: var(--muted); }
.card-nums b { font-size: 15px; font-weight: 800; letter-spacing: .2px; }
.month-cell { display: flex; flex-direction: column; gap: 2px; }
.card-month {
  border: 1px solid var(--border); border-radius: 6px; padding: 2px 4px; font-size: 12px;
  color: var(--text); background: #fff; outline: none; cursor: pointer; font-family: inherit;
  max-width: 110px;
}
.card-month:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-s); }
.card-line { display: flex; justify-content: space-between; font-size: 11.5px; }
.card-line .lead { color: #047857; font-weight: 600; }
.card-line .lag { color: #b91c1c; font-weight: 600; }
.card-foot { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 11.5px; color: var(--muted); }

/* ---------- 数据更新状态标签（下拉选择） ---------- */
.status-select {
  font-size: 10px; padding: 1px 6px; border-radius: 20px; font-weight: 700; cursor: pointer;
  border: 1px solid #cbd5e1; background: #f8fafc; color: #64748b; outline: none; font-family: inherit;
  transition: .15s; max-width: 130px;
}
.status-select:focus { box-shadow: 0 0 0 2px var(--primary-s); }
/* 最新数据已更新 — 绿色 */
.status-select.s-updated { background: #dcfce7; color: #047857; border-color: #34d399; }
/* 最新数据未更新 — 橙色 */
.status-select.s-pending { background: #fef3c7; color: #b45309; border-color: #fbbf24; }
/* 暂无数据 — 灰色 */
.status-select.s-nodata { background: #f1f5f9; color: #64748b; border-color: #cbd5e1; }

/* ---------- 页头 hero ---------- */
.hero {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 55%, #3b82f6 100%);
  color: #fff; border-radius: 14px; padding: 20px 22px; display: flex; gap: 18px;
  align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
  box-shadow: 0 10px 30px rgba(37, 99, 235, .22); margin-bottom: 14px;
}
.hero h1 { font-size: 22px; margin: 8px 0 6px; font-weight: 800; }
.hero .sub { color: rgba(255, 255, 255, .82); font-size: 12.5px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { background: rgba(255, 255, 255, .17); border: 1px solid rgba(255, 255, 255, .25); color: #fff; font-size: 11.5px; padding: 3px 10px; border-radius: 20px; }
.pill.ok { background: rgba(16, 185, 129, .35); border-color: rgba(255, 255, 255, .35); }
.pill.warn { background: rgba(245, 158, 11, .35); border-color: rgba(255, 255, 255, .35); }
.pill.owner { display: inline-flex; align-items: center; gap: 4px; }
.pill-lbl { opacity: .85; }
.pill-val { min-width: 36px; outline: none; border-bottom: 1px dashed transparent; }
body.editing .pill-val { border-bottom-color: rgba(255,255,255,.5); cursor: text; }
.pill-val:focus { border-bottom-style: solid; }
/* 内联可编辑文本（数值口径/展示口径） */
.sub-edit { outline: none; }
body.editing .hero .sub-edit { border-bottom: 1px dashed rgba(255,255,255,.5); cursor: text; }
body.editing .avg-note .sub-edit { border-bottom: 1px dashed var(--border-2); cursor: text; }
.sub-edit:focus { border-bottom-style: solid; }
.hero-r { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; min-width: 280px; }
.hero-r-top { display: flex; align-items: flex-end; gap: 10px; }
.hero-r .field { display: flex; flex-direction: column; gap: 4px; }
.hero-r .field span { font-size: 11px; color: rgba(255, 255, 255, .8); }
.hero-r select { padding: 7px 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .16); color: #fff; font-size: 13px; outline: none; }
.hero-r select option { color: var(--text); }

/* 备注框（查看月份下方，始终可编辑） */
.remark-box { display: flex; flex-direction: column; gap: 5px; width: 320px; max-width: 100%; }
.rm-lbl { font-size: 11px; color: rgba(255, 255, 255, .8); font-weight: 600; }
.rm-body {
  min-height: 30px; max-height: 120px; overflow: auto; padding: 6px 10px; font-size: 12.5px; line-height: 1.6;
  color: #fff; background: rgba(255, 255, 255, .14); border: 1px dashed rgba(255, 255, 255, .4);
  border-radius: 9px; outline: none; white-space: pre-wrap; word-break: break-all;
}
.rm-body:focus { border-style: solid; background: rgba(255, 255, 255, .22); box-shadow: 0 0 0 3px rgba(255, 255, 255, .18); }
.rm-body:empty::before { content: attr(data-ph); color: rgba(255, 255, 255, .55); }

.btn {
  border: 1px solid transparent; border-radius: 9px; padding: 8px 14px; font-size: 13px;
  cursor: pointer; font-weight: 600; transition: .15s; white-space: nowrap;
}
.btn.primary { background: #fff; color: var(--primary-d); }
.btn.primary:hover { background: #eef4ff; }
.btn.ghost { background: #fff; border-color: var(--border-2); color: var(--text-2); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.tiny { padding: 4px 10px; font-size: 11.5px; background: var(--surface-2); border-color: var(--border); color: var(--muted); }
.btn.tiny:hover { color: var(--primary); border-color: var(--primary); }

/* ---------- 面板 ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.meaning { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.meaning .m-col { padding: 15px 18px; }
.meaning .m-col + .m-col { border-left: 1px dashed var(--border); background: var(--surface-2); }
.meaning h4 { font-size: 12px; margin: 0 0 4px; color: var(--primary-d); font-weight: 800; letter-spacing: .3px; }
.meaning h4:not(:first-child) { margin-top: 13px; }
.meaning p { margin: 0; font-size: 12.8px; color: var(--text-2); line-height: 1.75; }
ul.std { list-style: none; margin: 0; padding: 0; }
ul.std li { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); padding: 3px 0; }
ul.std li b { flex: 0 0 42px; font-weight: 700; }
.d { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-top: 7px; flex: 0 0 8px; }
.d.ex { background: var(--ex); } .d.gd { background: var(--gd); } .d.bd { background: var(--bd); }

/* ---------- 投喂 ---------- */
.feed summary { display: flex; align-items: center; gap: 9px; padding: 13px 18px; cursor: pointer; list-style: none; }
.feed summary::-webkit-details-marker { display: none; }
.feed summary b { font-size: 13.5px; }
.feed summary em { font-style: normal; font-size: 12px; color: var(--muted); }
.fd-ico { width: 22px; height: 22px; border-radius: 7px; background: var(--primary-s); color: var(--primary); display: grid; place-items: center; font-size: 12px; }
.feed-body { padding: 0 18px 16px; }
.feed-row { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; }
.drop {
  border: 1.6px dashed var(--border-2); border-radius: 11px; background: var(--surface-2);
  padding: 20px; display: flex; flex-direction: column; gap: 6px; align-items: center;
  justify-content: center; text-align: center; cursor: pointer; transition: .18s;
}
.drop:hover, .drop.over { border-color: var(--primary); background: var(--primary-s); }
.drop b { font-size: 13.5px; color: var(--primary-d); }
.drop span { font-size: 11.5px; color: var(--muted); max-width: 380px; }
.feed-side { display: flex; flex-direction: column; gap: 9px; justify-content: center; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.field input, .field select { padding: 8px 10px; border: 1px solid var(--border-2); border-radius: 8px; font-size: 13px; color: var(--text); background: #fff; outline: none; }
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-s); }
.feed-btns { display: flex; gap: 8px; }
.feed-btns .btn { flex: 1; }
.hint { font-size: 11.5px; color: var(--muted); margin: 0; }

.preview { margin-top: 14px; border: 1px solid var(--border); border-radius: 11px; overflow: hidden; background: #fff; }
.pv-head { padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.pv-file { color: var(--primary-d); font-weight: 600; }
.pv-stat { color: var(--muted); margin-left: auto; }
.pv-warn { margin: 0; padding: 9px 14px 9px 30px; background: #fffbeb; color: #92400e; font-size: 12px; border-bottom: 1px solid #fde68a; }
.pv-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.pv-tbl th { background: var(--surface-2); text-align: left; padding: 7px 12px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--border); }
.pv-tbl td { padding: 6px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.pv-tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pv-actions { padding: 11px 14px; display: flex; gap: 12px; align-items: flex-end; background: var(--surface-2); border-top: 1px solid var(--border); flex-wrap: wrap; }
.pv-actions .btn { margin-left: auto; }
.pv-actions .btn + .btn { margin-left: 0; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); padding-bottom: 8px; }
textarea.paste { width: 100%; min-height: 150px; border: 0; border-top: 1px solid var(--border); padding: 12px 14px; font-family: Consolas, Monaco, monospace; font-size: 12px; resize: vertical; outline: none; }

/* ---------- 模块 ---------- */
.module { padding: 16px 18px 18px; }
.mod-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.mod-title h3 { font-size: 16px; margin: 0; font-weight: 800; }
.mod-title h3::before { content: ''; display: inline-block; width: 4px; height: 15px; background: var(--primary); border-radius: 3px; margin-right: 8px; vertical-align: -2px; }
.mod-title p { margin: 5px 0 0; font-size: 12px; color: var(--muted); }
.mod-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { border: 1px solid var(--border-2); background: #fff; color: var(--text-2); border-radius: 20px; padding: 4px 12px; font-size: 11.5px; cursor: pointer; transition: .15s; font-weight: 600; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-sep { width: 1px; height: 18px; background: var(--border-2); margin: 0 2px; }
.module-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.module-chart-col { min-width: 0; }
.module-an-col { min-width: 0; }
.chart-wrap { border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-top: 0; overflow: hidden; }
.chart { width: 100%; height: 400px; }
.chart-small .chart { height: 220px; }
.chart-region { max-height: none; overflow: visible; }
.chart-region .chart { height: 340px; }

/* ---------- 图表样式面板 ---------- */
.style-panel {
  margin: 10px 0 4px; padding: 12px 14px; border: 1px solid var(--border-2); border-radius: 11px;
  background: var(--surface-2); display: flex; flex-direction: column; gap: 10px;
}
.style-panel[hidden] { display: none; }
.sp-sec { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.sp-sec-lbl { font-size: 11.5px; font-weight: 800; color: var(--primary-d); width: 100%; margin-bottom: -6px; }
.sp-clr { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.sp-clr input[type="color"] { width: 30px; height: 24px; padding: 0; border: 1px solid var(--border-2); border-radius: 6px; background: #fff; cursor: pointer; }
.sp-in { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); font-weight: 600; }
.sp-in input { width: 78px; padding: 4px 7px; border: 1px solid var(--border-2); border-radius: 7px; font-size: 12.5px; color: var(--text); background: #fff; outline: none; font-family: inherit; }
.sp-in input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-s); }
.sp-tip { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.avg-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.avg-note b { color: var(--primary-d); font-weight: 700; }
.avg-input { width: 76px; border: 1px dashed var(--primary); border-radius: 4px; padding: 1px 6px; font-size: 12px; font-weight: 700; color: var(--primary-d); text-align: center; font-family: inherit; outline: none; background: #fff; }
.avg-input:focus { border-style: solid; box-shadow: 0 0 0 2px var(--primary-s); }
.avg-input::placeholder { font-weight: 400; color: var(--muted); font-size: 11px; }
.avg-line { display: inline-block; width: 22px; height: 0; border-top: 2px dashed var(--primary); vertical-align: 4px; }
.avg-sep { width: 1px; height: 13px; background: var(--border-2); }

.leg { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 11px; padding: 10px 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; font-size: 12px; }
.leg-item { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; }
.leg-item.star b { color: #047857; font-weight: 600; }
.leg-item.warn b { color: #b91c1c; font-weight: 600; }
.leg-sep { width: 1px; height: 16px; background: var(--border-2); }

/* ---------- 分析 ---------- */
.analysis { margin-top: 13px; border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 10px; background: linear-gradient(180deg, #f8fbff, #fff); padding: 12px 15px 11px; }
.an-head { display: flex; align-items: baseline; justify-content: space-between; }
.an-head h4 { margin: 0; font-size: 13px; font-weight: 800; color: var(--primary-d); }
.an-tip { font-size: 11px; color: var(--muted); }
.an-body { margin: 8px 0 0; font-size: 13px; color: var(--text-2); line-height: 1.9; white-space: pre-wrap; }
body.editing .an-body { white-space: normal; }
body.editing .an-body { background: #fff; border: 1px dashed var(--primary); border-radius: 8px; padding: 10px 12px; outline: none; }
.an-body[contenteditable="true"]:focus { border-style: solid; box-shadow: 0 0 0 3px var(--primary-s); }
.analysis .btn.tiny { margin-top: 9px; }

/* ---------- 富文本工具栏 ---------- */
.fmt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin: 6px 0 0; padding: 4px 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.fmt-bar button { min-width: 26px; height: 26px; padding: 0 5px; border: 1px solid var(--border); border-radius: 5px; background: #fff; color: var(--text-2); font-size: 12px; cursor: pointer; line-height: 1; font-family: inherit; }
.fmt-bar button:hover { background: var(--primary-s); border-color: var(--primary); color: var(--primary-d); }
.fmt-bar button b { font-weight: 800; }
.fmt-bar .fmt-sep { width: 1px; height: 16px; background: var(--border-2); margin: 0 3px; }
.advice .fmt-bar { background: #fff8ec; border-color: #fde6c2; }
.advice .fmt-bar button:hover { border-color: #f59e0b; color: #b8730a; }
.an-body[contenteditable="true"] ul, .an-body[contenteditable="true"] ol,
.ad-body[contenteditable="true"] ul, .ad-body[contenteditable="true"] ol { margin: 4px 0 4px 20px; padding: 0; }
.an-body[contenteditable="true"] p, .ad-body[contenteditable="true"] p { margin: 4px 0; }

/* ---------- 数据表 ---------- */
.tbl-wrap { margin-top: 12px; }
.tbl-wrap summary { cursor: pointer; font-size: 12.5px; color: var(--primary-d); font-weight: 700; list-style: none; padding: 6px 0; }
.tbl-wrap summary::-webkit-details-marker { display: none; }
.tbl-wrap summary::before { content: '▸ '; }
.tbl-wrap[open] summary::before { content: '▾ '; }
.tbl-hint { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 11px; }
.tbl-hint b { color: var(--primary-d); }
body.editing .tbl-hint { background: #fff; border: 1px dashed var(--primary); outline: none; cursor: text; }
.tbl-hint[contenteditable="true"]:focus { border-style: solid; box-shadow: 0 0 0 3px var(--primary-s); }
table.dt { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12.5px; }
table.dt th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-weight: 700; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border-2); font-size: 11.5px; z-index: 1; }
body.editing table.dt th { background: #eef4ff; color: var(--primary-d); outline: none; cursor: text; border-bottom: 1px dashed var(--primary); }
table.dt th[contenteditable="true"]:focus { background: #fff; box-shadow: 0 0 0 3px var(--primary-s); }
table.dt td { padding: 6px 10px; border-bottom: 1px solid var(--border); color: var(--text-2); }
table.dt tbody tr:hover { background: #f8fbff; }
table.dt td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.dt td.rk { font-weight: 800; color: var(--primary); width: 52px; }
table.dt td.nm { font-weight: 600; color: var(--text); }
table.dt td.bg { color: var(--muted); font-size: 11.5px; }
input.cell { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; font-size: 12px; text-align: right; font-family: inherit; outline: none; background: #fff; }
input.cell:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-s); }
input.cell-name { text-align: left; font-weight: 600; }
table.dt th.op-th, table.dt td.op { width: 56px; text-align: center; }
.row-del { border: none; background: #fee2e2; color: #dc2626; width: 26px; height: 26px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1; transition: background .15s; }
.row-del:hover { background: #fecaca; }
table.dt tfoot td.op-add { padding: 10px; text-align: left; }
.row-add { border: 1px dashed var(--primary); background: var(--primary-s); color: var(--primary-d); padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: 600; transition: background .15s, border-color .15s; }
.row-add:hover { background: #dbeafe; border-color: var(--primary); }
.tag { display: inline-block; color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 20px; font-weight: 700; white-space: nowrap; }

/* ---------- 年累计 ---------- */
.ya-block { margin-top: 18px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--surface); overflow: hidden; }
.ya-block > summary { cursor: pointer; padding: 14px 18px; font-size: 14px; font-weight: 700; color: var(--primary-d); background: linear-gradient(90deg, #eef4ff, transparent); list-style: none; }
.ya-block > summary::-webkit-details-marker { display: none; }
.ya-block > summary::before { content: '▸ '; }
.ya-block[open] > summary::before { content: '▾ '; }
.ya-bar { display: flex; align-items: center; gap: 16px; padding: 0 18px; margin-bottom: 10px; flex-wrap: wrap; }
.ya-tabs { display: inline-flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: 8px; }
.ya-tab { border: none; background: transparent; color: var(--muted); padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 12.5px; font-weight: 600; transition: all .15s; }
.ya-tab.on { background: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(37,99,235,.3); }
.ya-tab:hover:not(.on) { color: var(--primary-d); }
.ya-avg { font-size: 12px; color: var(--muted); }
.ya-desc { padding: 0 18px; margin: 8px 0 12px; font-size: 12px; color: var(--muted); }
.ya-empty { padding: 24px 18px; color: var(--muted); font-size: 13px; text-align: center; }
.ya-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; padding: 0 18px 18px; align-items: start; }
.ya-left { background: var(--surface-2); border-radius: 10px; padding: 12px; }
.ya-chart { width: 100%; }
.ya-right .tbl-wrap { margin-top: 0; }

/* ---------- 建议 ---------- */
.advice { padding: 16px 18px 18px; border-left: 3px solid #f59e0b; }
.ad-head { display: flex; align-items: baseline; justify-content: space-between; }
.ad-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.ad-head h3::before { content: ''; display: inline-block; width: 4px; height: 15px; background: #f59e0b; border-radius: 3px; margin-right: 8px; vertical-align: -2px; }
.ad-tip { font-size: 11px; color: var(--muted); }
.ad-body { margin-top: 9px; font-size: 13px; color: var(--text-2); line-height: 1.9; white-space: pre-wrap; min-height: 60px; }
body.editing .ad-body { background: #fff; border: 1px dashed #f59e0b; border-radius: 8px; padding: 10px 12px; outline: none; }

/* ---------- ECharts tooltip（全局） ---------- */
.tip { font-family: var(--ff); font-size: 12.5px; min-width: 220px; max-width: 330px; padding: 0 0 8px; max-height: 420px; overflow: auto; }
.tip-h { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 9px 13px; border-bottom: 2px solid #e2e8f1; font-size: 13px; }
.tip-h b { color: #0f172a; }
.tag { font-size: 10.5px; padding: 1px 8px; border-radius: 20px; color: #fff; font-weight: 700; }
.tip-r { display: flex; justify-content: space-between; gap: 16px; padding: 3px 13px; color: #64748b; }
.tip-r b { color: #0f172a; font-variant-numeric: tabular-nums; }
.tip-sep { margin: 8px 13px 4px; font-size: 11px; font-weight: 800; color: #2563eb; border-top: 1px dashed #e2e8f1; padding-top: 8px; }
.tip-list { list-style: none; margin: 0; padding: 0 13px; max-height: 250px; overflow: auto; }
.tip-list li { display: flex; align-items: center; gap: 8px; padding: 2px 0; color: #334155; font-size: 12px; }
.tip-list li .rk { width: 20px; height: 20px; flex: 0 0 20px; border-radius: 6px; background: #eef2f8; color: #475569; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; }
.tip-list li em { margin-left: auto; font-style: normal; color: #64748b; font-variant-numeric: tabular-nums; }
.tip-list li.more { color: #94a3b8; font-size: 11.5px; padding-left: 28px; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px);
  background: #0f172a; color: #fff; padding: 10px 20px; border-radius: 10px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 9999; box-shadow: 0 12px 32px rgba(15, 23, 42, .3);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: #b91c1c; }

@media (max-width: 1280px) {
  .module-grid { grid-template-columns: 1fr; }
  .ya-grid { grid-template-columns: 1fr; }
  .chart-small .chart { height: 260px; }
  .chart-region { max-height: none; }
  .remark-box { width: 100%; }
}
@media (max-width: 1080px) {
  /* 小屏保留身份、退出和编辑入口，避免认证控件随原侧栏一起消失。 */
  #app { flex-direction: column; }
  .side { display: flex; position: relative; width: 100%; flex: 0 0 auto; height: auto; border-right: 0; }
  .side-head { display: none; }
  .side-scroll { display: flex; overflow-x: auto; padding: 6px; max-width: 100%; }
  .nav-item { flex: 0 0 auto; width: auto; }
  .side-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 16px; }
  .auth-bar { margin: 0; gap: 12px; }
  .switch { gap: 12px; }
  .main { padding: 16px; }
  .meaning { grid-template-columns: 1fr; }
  .meaning .m-col + .m-col { border-left: 0; border-top: 1px dashed var(--border); }
  .feed-row { grid-template-columns: 1fr; }
}

/* ---------- 实时同步胶囊 ---------- */
.sync-pill {
  position: fixed; right: 16px; bottom: 18px; z-index: 9000;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.96); border: 1px solid var(--border-2);
  border-radius: 999px; padding: 7px 14px 7px 12px;
  font-size: 12px; color: var(--text-2); font-weight: 600;
  box-shadow: 0 6px 20px rgba(15,23,42,.12); cursor: pointer;
  user-select: none; transition: .2s; max-width: 86vw;
}
.sync-pill:hover { border-color: var(--primary); transform: translateY(-1px); }
.sync-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px;
  background: #94a3b8; box-shadow: 0 0 0 4px rgba(148,163,184,.16);
}
.sync-pill[data-state="connecting"] .sync-dot { background: #f59e0b; animation: pulse 1.2s infinite; }
.sync-pill[data-state="live"] .sync-dot { background: var(--ex); box-shadow: 0 0 0 4px rgba(16,185,129,.16); }
.sync-pill[data-state="live"] { color: var(--text); }
.sync-pill[data-state="pending"] .sync-dot { background: var(--gd); box-shadow: 0 0 0 4px rgba(245,158,11,.18); animation: pulse 1s infinite; }
.sync-pill[data-state="pending"] { border-color: var(--gd); color: #b45309; }
.sync-pill[data-state="dirty"] .sync-dot { background: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.16); }
.sync-pill[data-state="dirty"] { color: var(--primary-d); }
.sync-pill[data-state="error"] .sync-dot { background: var(--bd); box-shadow: 0 0 0 4px rgba(239,68,68,.16); }
.sync-pill[data-state="error"] { border-color: var(--bd); color: #b91c1c; }
.sync-pill.flash { animation: flash .6s ease; }
.sync-reload {
  border: 0; background: var(--primary); color: #fff; font-size: 11.5px; font-weight: 700;
  border-radius: 999px; padding: 3px 12px; cursor: pointer; margin-left: 2px;
}
.sync-reload:hover { background: var(--primary-d); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); } 100% { box-shadow: 0 6px 20px rgba(15,23,42,.12); } }
@media (max-width: 1080px) { .sync-pill { bottom: 12px; right: 12px; font-size: 11px; } }
