/* ═══════════════════════════════════════════════════════════════════════
   四为智慧能源平台 · 统一视觉系统  theme.css
   ─────────────────────────────────────────────────────────────────────
   = 全站唯一配色 / 字体 / 组件来源 =
   使用方式：在每个页面的「自身样式表之后」引入本文件，即可统一外观。
       <link rel="stylesheet" href="/static/theme.css?v=20261002a">
   品牌色：深空蓝底 #0a1424 · 金 #f6c453 · 蓝 #5fb0ff · 玻璃拟态
   ═══════════════════════════════════════════════════════════════════════ */

/* ───────────── 1. 设计令牌 Design Tokens ───────────── */
:root {
  /* 背景层 */
  --u-bg:        #0a1424;
  --u-bg-2:      #0c1a2e;
  --u-bg-3:      #0e2038;
  /* 面板 */
  --u-panel:     rgba(255, 255, 255, .045);
  --u-panel-2:   rgba(255, 255, 255, .075);
  --u-panel-hi:  rgba(255, 255, 255, .10);
  --u-solid:     #11233e;
  --u-solid-2:   #16294a;
  /* 描边 */
  --u-line:      rgba(255, 255, 255, .09);
  --u-line-2:    rgba(255, 255, 255, .16);
  --u-line-3:    #23446b;
  /* 文字 */
  --u-txt:       #e8eef5;
  --u-txt-2:     #b6c4d8;
  --u-dim:       #8aa5c2;
  --u-dim-2:     #6b7f99;
  /* 品牌 */
  --u-gold:      #f6c453;
  --u-gold-2:    #e08c2b;
  --u-blue:      #5fb0ff;
  --u-green:     #19c37d;
  --u-red:       #e5534b;
  --u-purple:    #a78bfa;
  /* 形状 / 阴影 */
  --u-r:         14px;
  --u-r-sm:      9px;
  --u-r-pill:    999px;
  --u-shadow:    0 4px 20px rgba(0, 0, 0, .28);
  --u-shadow-lg: 0 12px 40px rgba(0, 0, 0, .45);
  --u-glow-gold: 0 6px 18px rgba(240, 180, 80, .30);
  /* 字体 / 布局 */
  --u-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
            "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --u-topbar-h: 62px;
  --u-maxw: 1480px;
}

/* ───────────── 2. 基础 ───────────── */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--u-font) !important;
  color: var(--u-txt);
  background-color: var(--u-bg);
  background-image:
    radial-gradient(1200px 800px at 8% -12%, rgba(95, 176, 255, .10), transparent 62%),
    radial-gradient(1000px 720px at 108% 6%, rgba(246, 196, 83, .07), transparent 60%),
    linear-gradient(180deg, var(--u-bg) 0%, var(--u-bg-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* 统一滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .14);
  border-radius: 8px; border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(246, 196, 83, .45); background-clip: content-box; }

a { color: var(--u-blue); text-decoration: none; }
a:hover { color: var(--u-gold); }

::selection { background: rgba(246, 196, 83, .30); }

:focus-visible { outline: 2px solid rgba(246, 196, 83, .65); outline-offset: 2px; border-radius: 6px; }

/* ───────────── 3. 背景装饰（可选，与 portal 同款） ───────────── */
.bg-deco, .u-bg-deco { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-deco .orb, .u-orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: .42;
  animation: uFloat 18s ease-in-out infinite;
}
.orb-1, .o1 { width: 480px; height: 480px; background: #2a5fc7; top: -180px; left: -120px; }
.orb-2, .o2 { width: 520px; height: 520px; background: #c79a45; top: 30%; right: -180px; animation-delay: -6s; opacity: .28; }
.orb-3, .o3 { width: 420px; height: 420px; background: #4a8fd9; bottom: -150px; left: 30%; animation-delay: -12s; opacity: .32; }
@keyframes uFloat {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(40px, -40px); }
}
.grid-bg, .bg-deco .grid {
  position: absolute; inset: 0; opacity: .04;
  background-image:
    linear-gradient(rgba(95, 176, 255, .4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 176, 255, .4) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ───────────── 4. 统一顶栏 ───────────── */
.u-topbar {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; gap: 14px;
  height: var(--u-topbar-h);
  padding: 0 20px;
  background: rgba(10, 20, 36, .82);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--u-line);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .30);
}
.u-topbar .u-brand { display: flex; align-items: center; gap: 11px; flex: none; text-decoration: none; }
.u-topbar .u-logo {
  width: 38px; height: 38px; flex: none;
  background: rgba(255, 255, 255, .06);
  background-image: url('/static/brand-logo.png');
  background-size: 78%;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 10px; box-shadow: var(--u-glow-gold);
  color: transparent; font-size: 0;
}
.u-topbar .u-brand-txt { line-height: 1.2; }
.u-topbar .u-brand-main { font-size: 15px; font-weight: 700; color: var(--u-txt); letter-spacing: .3px; }
.u-topbar .u-brand-sub  { font-size: 10px; color: var(--u-dim-2); letter-spacing: .6px; text-transform: uppercase; }

.u-nav {
  display: flex; align-items: center; gap: 3px;
  flex: 1 1 auto; min-width: 0;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
}
.u-nav::-webkit-scrollbar { display: none; }
.u-nav a {
  flex: none; white-space: nowrap;
  padding: 7px 13px; border-radius: var(--u-r-sm);
  font-size: 13.5px; color: var(--u-txt-2);
  transition: background .15s, color .15s;
}
.u-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.u-nav a.active {
  background: linear-gradient(135deg, rgba(246, 196, 83, .18), rgba(95, 176, 255, .15));
  color: var(--u-gold); font-weight: 600;
}

/* ─── 导航「更多」下拉（低频模块收纳，保持一级导航一行放得下） ─── */
.u-more { position: relative; flex: none; display: flex; align-items: center; }
/* 窄屏时导航需横向滚动，「更多」吸住右端，避免被滚出可视区点不到 */
@media (max-width: 1300px) {
  .u-more {
    position: sticky; right: 0;
    padding-left: 20px; margin-left: 2px;
    background: linear-gradient(90deg, rgba(10, 20, 36, 0) 0%, rgba(10, 20, 36, .97) 26%);
  }
}
.u-more-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 13px; border-radius: var(--u-r-sm);
  background: transparent; border: 0; cursor: pointer;
  font-family: inherit; font-size: 13.5px; color: var(--u-txt-2);
  white-space: nowrap; transition: background .15s, color .15s;
}
.u-more-btn:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.u-more-btn .u-caret {
  font-size: 9px; opacity: .65; line-height: 1;
  transition: transform .18s ease;
}
.u-more.open .u-more-btn { background: rgba(255, 255, 255, .08); color: var(--u-gold); }
.u-more.open .u-caret { transform: rotate(180deg); }
/* 当前页在菜单内时：按钮留一点金色提示，避免"自己在哪"丢失 */
.u-more.has-active > .u-more-btn { color: var(--u-gold); }
.u-more.has-active > .u-more-btn::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--u-gold); box-shadow: 0 0 6px rgba(246, 196, 83, .8);
  margin-right: 2px;
}

/* 菜单挂在 .u-nav 之外，相对 .u-topbar（position:sticky）绝对定位；
   left 由 JS 按按钮位置计算，避免被导航的 overflow 裁剪 */
.u-more-menu {
  position: absolute; top: calc(100% + 6px); left: 12px;
  min-width: 186px; padding: 7px;
  background: rgba(13, 24, 42, .97);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55), 0 0 0 1px rgba(246, 196, 83, .06) inset;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
  z-index: 300;
}
.u-more-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.u-more-menu .u-more-label {
  font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase;
  color: var(--u-dim-2); padding: 7px 11px 5px;
}
.u-more-menu .u-more-sep {
  height: 1px; margin: 6px 9px;
  background: rgba(255, 255, 255, .07);
}
.u-more-menu a {
  display: block; padding: 9px 11px; border-radius: 10px;
  font-size: 13.5px; color: var(--u-txt-2); text-decoration: none;
  white-space: nowrap; transition: background .13s, color .13s;
}
.u-more-menu a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.u-more-menu a.active { background: rgba(246, 196, 83, .14); color: var(--u-gold); font-weight: 600; }
.u-topbar .u-right { display: flex; align-items: center; gap: 10px; flex: none; }
/* 用户区 = 单行胶囊：头像 + 姓名 + 角色简称。姓名本身是岗位名时不显示角色，
   免得「系统管理员 / 超级管理员」一件事说两遍。 */
.u-topbar .u-user {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 11px 3px 3px; border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .07);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.u-topbar .u-user:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(246, 196, 83, .28);
  box-shadow: 0 4px 14px rgba(246, 196, 83, .10);
}
.u-topbar .u-user-name {
  font-size: 13px; font-weight: 600; line-height: 1; color: var(--u-txt);
  max-width: 108px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.u-topbar .u-user-role {
  display: inline-block; flex: none;
  font-size: 10px; font-weight: 700; letter-spacing: .3px; line-height: 1;
  padding: 3px 8px; border-radius: 999px; white-space: nowrap;
  color: var(--u-gold);
  background: linear-gradient(90deg, rgba(246, 196, 83, .18), rgba(95, 176, 255, .12));
  border: 1px solid rgba(246, 196, 83, .33);
}
.u-topbar .u-user-role[hidden] { display: none !important; }
.u-topbar .u-avatar {
  width: 28px; height: 28px; flex: none;
  font-size: 13px;
}
.u-avatar {
  width: 34px; height: 34px; flex: none;
  /* 用 flex 居中，不靠 line-height：中文/字母/emoji 三种字形都能落在圆心 */
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
  font-size: 15px; font-weight: 800; color: var(--u-gold);
  text-shadow: 0 0 8px rgba(240, 180, 41, .5);
  background: linear-gradient(135deg, #152238 0%, #23375a 55%, #2f4b7a 100%);
  border: 2px solid rgba(240, 180, 41, .55);
  border-radius: 50%; box-shadow: 0 4px 12px rgba(47, 129, 247, .30);
}
.u-iconbtn {
  width: 34px; height: 34px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .06); color: var(--u-txt);
  border: 1px solid var(--u-line); border-radius: var(--u-r-sm);
  font-size: 15px; cursor: pointer; transition: all .15s;
}
.u-iconbtn:hover { background: rgba(255, 80, 80, .22); border-color: rgba(255, 80, 80, .45); color: #ffb4b4; }

@media (max-width: 900px) {
  .u-topbar { padding: 0 12px; gap: 8px; }
  .u-topbar .u-brand-sub { display: none; }
  .u-topbar .u-user { padding: 3px; }
  .u-topbar .u-user-name, .u-topbar .u-user-role { display: none !important; }
}

/* ───────────── 5. 页面骨架 ───────────── */
.page, .wrap {
  max-width: var(--u-maxw) !important;
  margin: 0 auto;
  padding: 24px !important;
}
.page > .title, .wrap > .title { margin-top: 0; }

/* 统一页面标题（渐变字） */
.title {
  display: flex !important; align-items: center; gap: 10px;
  font-size: 22px !important; font-weight: 700 !important;
  letter-spacing: .4px;
  margin: 0 0 18px 0 !important;
  background: linear-gradient(135deg, #ffffff 0%, var(--u-gold) 62%, var(--u-blue) 100%);
  -webkit-background-clip: text !important; background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: #ffffff;
}
.title > * { -webkit-text-fill-color: currentColor !important; }
.title-ico { width: 22px !important; height: 22px !important; flex: none; color: var(--u-gold) !important; }

/* 统一工具条 */
.toolbar {
  display: flex !important; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px !important; margin-bottom: 18px !important;
  background: var(--u-panel) !important;
  border: 1px solid var(--u-line) !important;
  border-radius: var(--u-r) !important;
  backdrop-filter: blur(12px);
}
.toolbar .meta, .toolbar-meta { margin-left: auto; font-size: 12.5px; color: var(--u-dim); }

/* ───────────── 6. 卡片 ───────────── */
.card, section.card {
  background: linear-gradient(160deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .012)) !important;
  border: 1px solid var(--u-line) !important;
  border-radius: var(--u-r) !important;
  box-shadow: var(--u-shadow) !important;
  backdrop-filter: blur(14px);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover { border-color: rgba(246, 196, 83, .26) !important; }
.card h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px !important; font-weight: 600 !important;
  color: var(--u-txt) !important;
  margin: 0 0 14px 0 !important;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--u-line);
  letter-spacing: .2px;
}
.card h3 .r { margin-left: auto; font-weight: 400; font-size: 12.5px; color: var(--u-dim); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { margin: 0 !important; padding-bottom: 0; border-bottom: none; }

/* ───────────── 7. 按钮 ───────────── */
.btn, button.btn, .btn-card {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px !important;
  font-family: var(--u-font); font-size: 13px !important; font-weight: 600;
  line-height: 1.2; white-space: nowrap;
  color: var(--u-txt) !important;
  background: rgba(255, 255, 255, .06) !important;
  border: 1px solid var(--u-line-2) !important;
  border-radius: var(--u-r-sm) !important;
  cursor: pointer;
  transition: all .15s;
}
.btn:hover, .btn-card:hover {
  background: rgba(255, 255, 255, .12) !important;
  border-color: rgba(246, 196, 83, .45) !important;
  color: var(--u-gold) !important;
  transform: translateY(-1px);
}
.btn:active, .btn-card:active { transform: none; }

.btn.primary, .btn-primary, button.primary,
.btn.gold, button[type="submit"].btn {
  background: linear-gradient(135deg, var(--u-gold), var(--u-gold-2)) !important;
  color: #2b1d00 !important;
  border-color: transparent !important;
  font-weight: 700 !important;
  box-shadow: var(--u-glow-gold);
}
.btn.primary:hover, .btn-primary:hover, button.primary:hover, .btn.gold:hover {
  color: #2b1d00 !important;
  box-shadow: 0 8px 22px rgba(240, 180, 80, .42);
  filter: brightness(1.05);
}

.btn.ghost { background: transparent !important; border-color: var(--u-line-2) !important; }
.btn.danger, .btn.btn-danger {
  background: rgba(229, 83, 75, .12) !important;
  border-color: rgba(229, 83, 75, .45) !important;
  color: #ff8b83 !important;
}
.btn.danger:hover { background: rgba(229, 83, 75, .25) !important; color: #ffb4b4 !important; border-color: rgba(229, 83, 75, .6) !important; }
.btn.export { background: rgba(25, 195, 125, .12) !important; border-color: rgba(25, 195, 125, .40) !important; color: #4ee0a2 !important; }
.btn.export:hover { background: rgba(25, 195, 125, .24) !important; color: #7bffc8 !important; border-color: rgba(25, 195, 125, .6) !important; }
.btn.small, .btn.sm { padding: 5px 11px !important; font-size: 12px !important; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* 卡片式工具按钮（sales 用） */
.btn-card { flex-direction: column; gap: 1px; padding: 9px 16px !important; }
.btn-card .ico { font-size: 15px; }
.btn-card .lbl { font-size: 12.5px; font-weight: 600; }
.btn-card .sub { font-size: 10px; opacity: .55; font-weight: 400; }

/* 小图标按钮 */
.mini {
  background: rgba(255, 255, 255, .06); border: 1px solid var(--u-line);
  color: var(--u-txt-2); border-radius: 6px; cursor: pointer;
  width: 22px; height: 22px; font-size: 12px; line-height: 1;
}
.mini:hover { color: var(--u-gold); border-color: rgba(246, 196, 83, .45); }

/* ───────────── 8. 表单控件 ───────────── */
input, select, textarea, .modal input, .modal select, .modal textarea {
  font-family: var(--u-font) !important;
  background: rgba(0, 0, 0, .28) !important;
  border: 1px solid var(--u-line-2) !important;
  border-radius: var(--u-r-sm) !important;
  color: var(--u-txt) !important;
  padding: 8px 11px !important;
  font-size: 13px !important;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--u-dim-2) !important; }
input:focus, select:focus, textarea:focus, .modal input:focus, .modal select:focus {
  border-color: var(--u-gold) !important;
  box-shadow: 0 0 0 3px rgba(246, 196, 83, .14) !important;
}
select option { background: var(--u-solid); color: var(--u-txt); }
label { font-size: 12.5px; color: var(--u-dim); }
/* 复选框 / 单选框 / 滑块不套用输入框皮肤 */
input[type="checkbox"], input[type="radio"] {
  padding: 0 !important; margin: 0 6px 0 0 !important;
  width: auto !important; height: auto !important;
  background: none !important; border: none !important;
  box-shadow: none !important; accent-color: var(--u-gold) !important;
  vertical-align: middle;
}
input[type="range"] { padding: 0 !important; background: none !important; border: none !important; box-shadow: none !important; }

/* ───────────── 9. 表格 ───────────── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .tbl th, .card table th {
  text-align: left; font-weight: 600; font-size: 12px;
  color: var(--u-dim) !important; text-transform: none; letter-spacing: .2px;
  padding: 10px !important;
  background: rgba(255, 255, 255, .035) !important;
  border-bottom: 1px solid var(--u-line-2) !important;
  white-space: nowrap;
}
.data-table td, .tbl td, .card table td {
  padding: 10px !important;
  color: var(--u-txt);
  border-bottom: 1px solid var(--u-line) !important;
  vertical-align: middle;
}
.data-table tbody tr:hover td, .tbl tr:hover td, .card table tbody tr:hover td {
  background: rgba(246, 196, 83, .06) !important;
}
.data-table .num, .tbl .num { font-variant-numeric: tabular-nums; text-align: right; }
.data-table-wrap, .table-wrap { overflow-x: auto; border-radius: var(--u-r-sm); }

/* ───────────── 10. 徽章 ───────────── */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: var(--u-r-pill);
  font-size: 11.5px; font-weight: 600; line-height: 1.7;
  background: rgba(138, 165, 194, .14); color: var(--u-dim);
}
.badge.b-green, .badge.green { background: rgba(25, 195, 125, .16); color: #4ee0a2; }
.badge.b-blue,  .badge.blue  { background: rgba(95, 176, 255, .16); color: var(--u-blue); }
.badge.b-gold,  .badge.gold  { background: rgba(246, 196, 83, .16); color: var(--u-gold); }
.badge.b-red,   .badge.red   { background: rgba(229, 83, 75, .16);  color: #ff8b83; }
.badge.b-dim,   .badge.dim   { background: rgba(138, 165, 194, .12); color: var(--u-dim); }
.up { color: var(--u-green) !important; }
.down { color: var(--u-red) !important; }
.warn { color: var(--u-gold) !important; }

/* ───────────── 11. KPI ───────────── */
.kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.kpi-item, .kpi-card, .kpi {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .012)) !important;
  border: 1px solid var(--u-line) !important;
  border-radius: var(--u-r) !important;
  padding: 16px 18px !important;
  box-shadow: var(--u-shadow);
}
.kpi-item::before, .kpi-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--u-gold), var(--u-blue));
  opacity: .8;
}
.kpi-label { font-size: 12.5px !important; color: var(--u-dim) !important; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.kpi-value, .kpi .v { font-size: 26px !important; font-weight: 700 !important; color: var(--u-txt) !important; font-variant-numeric: tabular-nums; }
.kpi-unit, .kpi .u { font-size: 12.5px !important; color: var(--u-dim) !important; margin-left: 4px; font-weight: 400; }
.kpi-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.kpi-badge { font-size: 11.5px; color: var(--u-dim); }
.kpi-sub, .kpi .sub { font-size: 12px !important; color: var(--u-dim) !important; margin-top: 6px; }

/* ───────────── 12. 弹窗 ───────────── */
.modal, .modal-mask {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 10, 20, .72);
  backdrop-filter: blur(4px);
}
.modal[hidden], .modal-mask[hidden] { display: none !important; }
.modal-box, .modal > .modal {
  width: 620px; max-width: 94vw; max-height: 88vh; overflow: auto;
  background: linear-gradient(160deg, #12253f, #0d1a2e) !important;
  border: 1px solid var(--u-line-2) !important;
  border-radius: 18px !important;
  box-shadow: var(--u-shadow-lg);
  padding: 22px 24px !important;
}
.modal-box > header, .modal-box > h3, .modal > h4,
.modal-box h4 {
  font-size: 16px !important; font-weight: 700 !important; color: var(--u-txt) !important;
  margin: 0 0 14px !important;
}
.modal-box h4 { font-size: 13px !important; color: var(--u-gold) !important; margin-top: 18px !important; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal label { display: block; margin-bottom: 10px; }
.modal label input, .modal label select, .modal label textarea { width: 100%; margin-top: 4px; }

/* ───────────── 13. 标签页 / 药丸 ───────────── */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button, .pills button, .fbtn {
  background: rgba(255, 255, 255, .05) !important;
  border: 1px solid var(--u-line) !important;
  color: var(--u-dim) !important;
  padding: 6px 15px !important; border-radius: var(--u-r-pill) !important;
  font-size: 12.5px !important; cursor: pointer; font-family: var(--u-font);
  transition: all .15s;
}
.tabs button:hover, .pills button:hover, .fbtn:hover { color: var(--u-txt) !important; border-color: var(--u-line-2) !important; }
.tabs button.active, .pills button.active, .fbtn.active {
  background: linear-gradient(135deg, var(--u-gold), var(--u-gold-2)) !important;
  color: #2b1d00 !important; border-color: transparent !important; font-weight: 700 !important;
}

/* ───────────── 14. 图表 / 提示 ───────────── */
.chart, .chart-box { width: 100%; }
.chart-260 { height: 260px; }
.chart-280 { height: 280px; }

#toast, .toast {
  position: fixed; top: 78px; left: 50%; transform: translateX(-50%);
  padding: 10px 24px; border-radius: var(--u-r-pill);
  background: linear-gradient(135deg, var(--u-gold), var(--u-gold-2));
  color: #2b1d00; font-size: 13.5px; font-weight: 700; z-index: 2000;
  box-shadow: var(--u-shadow-lg);
}
#toast.err, .toast.err { background: linear-gradient(135deg, #e5534b, #b9362f); color: #fff; }

/* 空状态 */
.empty, .u-empty { text-align: center; color: var(--u-dim-2); font-size: 13px; padding: 28px 12px; }

/* ───────────── 15. 布局工具 ───────────── */
.grid { display: grid; gap: 14px; }
.grid-2, .cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3, .cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.span2, .span-2 { grid-column: span 2; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .grid-2, .cols-2, .grid-3, .cols-3, .grid-4 { grid-template-columns: 1fr; }
  .span2, .span-2 { grid-column: span 1; }
  .page, .wrap { padding: 16px !important; }
}

/* 页脚 */
.u-footer, .footer-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  margin-top: 26px; padding: 16px 4px;
  border-top: 1px solid var(--u-line);
  font-size: 12px; color: var(--u-dim-2);
}
.u-chip, .fb-chip, .chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: var(--u-r-pill);
  border: 1px solid var(--u-line); background: rgba(255, 255, 255, .035);
  font-size: 11.5px; color: var(--u-dim);
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.dot-g, .dot.g { background: var(--u-green); box-shadow: 0 0 8px rgba(25, 195, 125, .8); }
.dot-b, .dot.b { background: var(--u-blue);  box-shadow: 0 0 8px rgba(95, 176, 255, .8); }
.dot-r { background: var(--u-red);   box-shadow: 0 0 8px rgba(229, 83, 75, .8); }
.dot-y { background: var(--u-gold);  box-shadow: 0 0 8px rgba(246, 196, 83, .8); }

/* 隐藏工具类 */
.u-hidden { display: none !important; }
.admin-only[hidden] { display: none !important; }

/* ───────────── 站点页脚 · ICP 备案号 ───────────── */
.u-site-footer {
  margin-top: 30px;
  padding: 18px 16px 26px;
  text-align: center;
  font-size: 12px;
  line-height: 1.9;
  color: var(--u-dim);
  opacity: .82;
}
.u-site-footer-inner { max-width: var(--u-maxw); margin: 0 auto; }
.u-site-footer a {
  color: inherit; text-decoration: none;
  border-bottom: 1px dotted rgba(138, 165, 194, .55);
}
.u-site-footer a:hover { color: var(--u-txt-2); border-bottom-color: currentColor; }

/* ───────────── 数据新鲜度提示条（现货/门户共用） ───────────── */
.data-health {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 9px 14px; border-radius: 12px;
  font-size: 12.5px; line-height: 1.55;
  border: 1px solid rgba(46, 74, 108, .9);
  background: rgba(255, 255, 255, .035);
  color: var(--u-txt-2, #b6c4d8);
}
.data-health[hidden] { display: none !important; }
.data-health .dh-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: #19c37d;
}
.data-health .dh-txt { font-weight: 600; }
.data-health .dh-meta {
  margin-left: auto; font-size: 11.5px; color: var(--u-dim-2, #7b8ca6);
}
.data-health.is-ok {
  border-color: rgba(25, 195, 125, .34); background: rgba(25, 195, 125, .075);
}
.data-health.is-ok .dh-dot { box-shadow: 0 0 8px rgba(25, 195, 125, .75); }
.data-health.is-info {
  border-color: rgba(95, 176, 255, .42); background: rgba(95, 176, 255, .10);
  color: #b8d8ff;
}
.data-health.is-info .dh-dot { background: #5fb0ff; box-shadow: 0 0 8px rgba(95, 176, 255, .75); }
.data-health.is-info .dh-meta { color: #7fa3cf; }
.data-health.is-warn {
  border-color: rgba(246, 196, 83, .42); background: rgba(246, 196, 83, .10);
  color: #ffe3ab;
}
.data-health.is-warn .dh-dot { background: #f6c453; box-shadow: 0 0 8px rgba(246, 196, 83, .75); }
.data-health.is-warn .dh-meta { color: #c9a961; }
.data-health.is-stale {
  border-color: rgba(229, 83, 75, .5); background: rgba(229, 83, 75, .12);
  color: #ffd3cf;
}
.data-health.is-stale .dh-dot { background: #e5534b; box-shadow: 0 0 9px rgba(229, 83, 75, .85); }
.data-health.is-stale .dh-meta { color: #d99a95; }
@media (max-width: 760px) {
  .data-health { font-size: 12px; }
  .data-health .dh-meta { margin-left: 0; width: 100%; }
}
