/* ===== 设计变量（配色卡：Amalfi #2E5AA7 / Sea Breeze #86C5FF / Citrus Zest #FFA62B；cream 系已并入 Citrus） ===== */
:root, [data-theme="light"] {
  --amalfi: #2e5aa7;
  --sea: #86c5ff;
  --citrus: #ffa62b;
  --cream: #ffa62b;
  --accent-ink: #9a5f08;       /* 可读的琥珀字色 */
  --sea-ink: #2a5ea8;          /* 可读的蓝字色 */
  --ink-on-accent: #16305e;    /* 琥珀/柠檬底上的可读深蓝字 */

  /* 兼容别名 */
  --navy: #2e5aa7;
  --sapphire: #86c5ff;
  --taupe: #ffa62b;
  --champagne: #ffa62b;
  --ivory: #f6f9fd;
  --bright-yellow: #ffa62b;
  --warm-amber: #ffa62b;
  --grass-green: #86c5ff;
  --deep-green: #2e5aa7;
  --sky-blue: #86c5ff;
  --pale-blue: #c9e2ff;

  --brand: #2e5aa7;
  --brand-2: #86c5ff;
  --brand-soft: #e7f0fe;
  --accent: #ffa62b;
  --accent-bright: #ffa62b;
  --accent-warm: #ffa62b;
  --accent-warm-ink: #9a5f08;
  --accent-success: #2e5aa7;
  --accent-sky: #86c5ff;
  --accent-sky-ink: #2a5ea8;
  --bg: #f6f9fd;
  --surface: #ffffff;
  --surface-2: #f3f7fd;
  --surface-3: #e7effb;
  --surface-warm: #fff5e4;
  --surface-cool: #eaf3ff;
  --surface-leaf: #edf4fe;
  --line: #dbe6f5;
  --line-soft: #eaf1fa;
  --text: #16294a;
  --muted: #57698c;
  --up: #e5484d;
  --down: #2e9e5b;
  --shadow: 0 1px 2px rgba(46, 90, 167, .05), 0 4px 16px rgba(46, 90, 167, .07);
  --shadow-lg: 0 12px 40px rgba(46, 90, 167, .18);
  --sidebar-bg: linear-gradient(180deg, #22457e 0%, #16305c 100%);
  --sidebar-text: #c7daf6;
  --sidebar-text-active: #ffffff;
  --sidebar-hover: rgba(255,255,255,.09);
  --sidebar-active-bg: rgba(255,166,43,.20);
  --sidebar-divider: rgba(255,255,255,.14);

  /* Bootstrap 5.3 组件跟随品牌色（浅色） */
  --bs-body-bg: var(--surface);
  --bs-body-color: var(--text);
  --bs-emphasis-color: var(--text);
  --bs-heading-color: var(--text);
  --bs-secondary-color: var(--muted);
  --bs-secondary-bg: var(--surface-2);
  --bs-tertiary-bg: var(--surface-3);
  --bs-border-color: var(--line);
  --bs-table-color: var(--text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--line-soft);
  --bs-table-striped-bg: var(--surface-2);
  --bs-table-hover-bg: var(--surface-2);
  --bs-modal-bg: var(--surface);
  --bs-modal-header-border-color: var(--line);
  --bs-modal-footer-border-color: var(--line);
  --bs-dropdown-bg: var(--surface);
  --bs-dropdown-border-color: var(--line);
  --bs-dropdown-link-color: var(--text);
  --bs-nav-link-color: var(--text);
  --bs-nav-link-hover-color: var(--brand);
  --bs-nav-tabs-link-active-color: var(--brand);
  --bs-nav-tabs-link-active-bg: var(--surface);
  --bs-pagination-bg: var(--surface);
  --bs-pagination-color: var(--brand);
  --bs-pagination-hover-color: var(--accent-warm-ink);
  --bs-pagination-active-bg: var(--brand);
  --bs-pagination-active-border-color: var(--brand);
  --bs-pagination-disabled-bg: var(--surface-2);
}
[data-theme="dark"] {
  --amalfi: #2e5aa7;
  --sea: #86c5ff;
  --citrus: #ffa62b;
  --cream: #ffa62b;
  --accent-ink: #ffc46b;
  --sea-ink: #a9d5ff;
  --ink-on-accent: #16305e;

  --navy: #2e5aa7;
  --sapphire: #86c5ff;
  --taupe: #ffa62b;
  --champagne: #ffa62b;
  --ivory: #0c1626;
  --bright-yellow: #ffa62b;
  --warm-amber: #ffa62b;
  --grass-green: #86c5ff;
  --deep-green: #86c5ff;
  --sky-blue: #86c5ff;
  --pale-blue: #c9e2ff;

  --brand: #86c5ff;
  --brand-2: #a9d5ff;
  --brand-soft: #1a2b45;
  --accent: #ffa62b;
  --accent-bright: #ffa62b;
  --accent-warm: #ffa62b;
  --accent-warm-ink: #ffc46b;
  --accent-success: #86c5ff;
  --accent-sky: #86c5ff;
  --accent-sky-ink: #a9d5ff;
  --bg: #0c1626;
  --surface: #142338;
  --surface-2: #1b2c45;
  --surface-3: #223551;
  --surface-warm: #2d2716;
  --surface-cool: #152740;
  --surface-leaf: #16283f;
  --line: #263a5b;
  --line-soft: #1e3050;
  --text: #e8f0fb;
  --muted: #8ca0be;
  --up: #ff7b6b;
  --down: #5fd08c;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.2);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  --sidebar-bg: linear-gradient(180deg, #0a1322 0%, #2e5aa7 100%);
  --sidebar-text: #bfd4f2;
  --sidebar-text-active: #ffffff;
  --sidebar-hover: rgba(255,255,255,.07);
  --sidebar-active-bg: rgba(255,166,43,.18);
  --sidebar-divider: rgba(134,197,255,.16);

  /* Bootstrap 5.3 组件跟随深色主题（表格 / 输入框 / 页签 / 分页 / 下拉 / 弹窗） */
  --bs-body-bg: var(--surface);
  --bs-body-color: var(--text);
  --bs-emphasis-color: var(--text);
  --bs-heading-color: var(--text);
  --bs-secondary-color: var(--muted);
  --bs-secondary-bg: var(--surface-2);
  --bs-tertiary-bg: var(--surface-3);
  --bs-border-color: var(--line);
  --bs-table-color: var(--text);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--line-soft);
  --bs-table-striped-bg: var(--surface-2);
  --bs-table-hover-bg: var(--surface-2);
  --bs-modal-bg: var(--surface);
  --bs-modal-header-border-color: var(--line);
  --bs-modal-footer-border-color: var(--line);
  --bs-dropdown-bg: var(--surface);
  --bs-dropdown-border-color: var(--line);
  --bs-dropdown-link-color: var(--text);
  --bs-nav-link-color: var(--text);
  --bs-nav-link-hover-color: var(--brand);
  --bs-nav-tabs-link-active-color: var(--brand);
  --bs-nav-tabs-link-active-bg: var(--surface);
  --bs-pagination-bg: var(--surface);
  --bs-pagination-color: var(--brand);
  --bs-pagination-hover-color: var(--accent-warm-ink);
  --bs-pagination-active-bg: var(--brand);
  --bs-pagination-active-border-color: var(--brand);
  --bs-pagination-disabled-bg: var(--surface-2);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  transition: background .25s ease, color .25s ease;
}
#shell { display: flex; height: 100vh; overflow: hidden; }

/* ===== 侧边栏（竖排） ===== */
#sidebar {
  width: 224px; flex-shrink: 0; flex-grow: 0;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  transition: background .25s ease;
}
#sidebar .logo {
  height: 64px; display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--sidebar-divider);
  color: #fff;
}
#sidebar .logo .mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--champagne); color: var(--amalfi);
  display: flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
}
  #sidebar .logo .title { font-weight: 600; font-size: 15px; letter-spacing: .8px; white-space: nowrap; }

#sidebar .sidebar-close {
  display: none; margin-left: auto;
  width: 30px; height: 30px;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.20);
  border-radius: 7px; color: #fff; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
#sidebar .sidebar-close:hover { background: rgba(255,166,43,.22); border-color: rgba(255,166,43,.55); }

#sidebar .nav { flex: 1; overflow-y: auto; padding: 14px 0 18px; min-width: 0; }
#sidebar .nav .group { display: flex; flex-direction: column; width: 100%; }
#sidebar .group-title {
  padding: 16px 22px 6px; font-size: 10.5px; letter-spacing: 2px;
  color: rgba(199,218,246,.55); text-transform: uppercase;
  width: 100%; font-weight: 600;
}
#sidebar .nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 18px; margin: 2px 10px;
  width: calc(100% - 20px); box-sizing: border-box;
  color: var(--sidebar-text); text-decoration: none;
  font-size: 13.5px; border-radius: 6px;
  border-left: 3px solid transparent;
  transition: background .15s ease, color .15s ease;
}
#sidebar .nav a svg { flex-shrink: 0; opacity: .75; transition: color .15s ease, opacity .15s ease; }
#sidebar .nav a:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active); }
#sidebar .nav a:hover svg { opacity: 1; color: var(--citrus); }
#sidebar .nav a.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  border-left-color: var(--citrus);
}
#sidebar .nav a.active svg { opacity: 1; color: var(--citrus); }

/* ===== 主区 ===== */
#main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

#topbar {
  height: 60px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; flex-shrink: 0; gap: 16px;
  transition: background .25s ease, border-color .25s ease;
}
#topbar .t { font-weight: 600; font-size: 16px; }
#topbar .actions { display: flex; align-items: center; gap: 10px; }
#topbar .search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 12px; color: var(--muted);
  width: 240px; position: relative;
}
#topbar .search:focus-within { border-color: var(--citrus); }
/* 搜索结果下拉 */
.search-panel {
  position: absolute; top: calc(100% + 8px); left: 0;
  width: 340px; max-height: 420px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-lg);
  z-index: 1000; text-align: left; cursor: default;
}
.search-panel .grp { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.search-panel .grp:last-child { border-bottom: none; }
.search-panel .grp-h {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 14px; font-size: 11px; letter-spacing: 1px;
  color: var(--muted); font-weight: 600;
}
.search-panel .row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 14px; text-decoration: none; color: var(--text);
  transition: background .12s ease;
}
.search-panel .row:hover { background: var(--surface-2); }
.search-panel .row .t { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-panel .row .s { font-size: 11.5px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.search-panel .empty { padding: 28px 14px; text-align: center; color: var(--muted); font-size: 12.5px; }
#topbar .search input {
  border: none; background: transparent; outline: none; flex: 1;
  font-size: 13px; color: var(--text);
}
#topbar .search input::placeholder { color: var(--muted); }
#topbar .icon-btn {
  position: relative; width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; color: var(--text); cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
#topbar .icon-btn:hover { border-color: var(--brand); color: var(--brand); }
/* 主题切换按钮：浅色页面=深底浅色月亮（点击进深色）/ 深色页面=白底深蓝太阳（点击回浅色） */
#topbar #btnTheme {
  background: #16305c; border-color: rgba(255,255,255,.18); color: #dbe9ff;
}
#topbar #btnTheme:hover { border-color: var(--citrus); color: var(--citrus); }
[data-theme="dark"] #topbar #btnTheme {
  background: #ffffff; border-color: #dbe6f5; color: #16305c;
}
[data-theme="dark"] #topbar #btnTheme:hover { border-color: var(--citrus); color: var(--accent-warm-ink); }
#topbar .icon-btn .dot {
  position: absolute; top: -4px; right: -4px;
  background: var(--citrus); color: var(--amalfi); font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(255,166,43,.45);
}
.notif-panel {
  position: absolute; top: 56px; right: 90px;
  width: 320px; max-height: 420px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-lg);
  z-index: 99;
}
.notif-panel .head {
  padding: 12px 16px; font-weight: 600; font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center;
}
.notif-panel .item {
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
  display: flex; gap: 10px; cursor: pointer;
}
.notif-panel .item:hover { background: var(--surface-2); }
.notif-panel .item:last-child { border-bottom: none; }
.notif-panel .item .badge {
  flex-shrink: 0; width: 6px; height: 6px; border-radius: 3px;
  background: var(--citrus); margin-top: 6px;
  box-shadow: 0 0 6px rgba(255,166,43,.55);
}
.notif-panel .item .text { flex: 1; font-size: 12.5px; line-height: 1.5; }
.notif-panel .item .text b { color: var(--text); }
.notif-panel .item .time { font-size: 11px; color: var(--muted); margin-top: 2px; }
.notif-panel .empty { padding: 36px; text-align: center; color: var(--muted); font-size: 13px; }

#topbar .user {
  display: flex; align-items: center; gap: 8px; padding: 0 4px;
}
#topbar .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--amalfi) 0%, var(--sea) 100%);
  color: #fff; font-weight: 600; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--cream);
}

#content { flex: 1; overflow-y: auto; padding: 18px; color: var(--text); }

/* ===== 通用卡片 ===== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px;
  box-shadow: var(--shadow);
  transition: background .25s ease, border-color .25s ease;
}
.card + .card { margin-top: 14px; }
.card-title, .card-title * { font-weight: 600; margin-bottom: 12px; font-size: 14px; display: flex; align-items: center; justify-content: space-between; color: var(--text) !important; }
.card-title .more, .card-title .more * { font-size: 12px; color: var(--muted) !important; text-decoration: none; font-weight: 400; }
.card-title .more:hover, .card-title .more:hover * { color: var(--brand) !important; }
#content .card-title, #content .card { color: var(--text); }

/* ===== 统计卡片 ===== */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; margin-bottom:14px; }
.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .15s ease;
}
.stat:hover { transform: translateY(-2px); }
.stat::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 4px; height: 100%; background: var(--brand);
}
.stat.warn::before { background: var(--citrus); width: 5px; }
.stat.sky::before { background: var(--sea); }
.stat.leaf::before { background: var(--cream); }
.stat .label { color: var(--muted); font-size: 12.5px; }
.stat .value { font-size: 26px; font-weight: 600; color: var(--brand); margin-top: 6px; line-height: 1.2; }
.stat.warn .value { color: var(--accent-warm-ink); }
.stat.sky .value { color: var(--accent-sky-ink); }
.stat.leaf .value { color: var(--brand); }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
/* 可点击的统计卡：点击直达对应模块 */
a.stat {
  display: block; text-decoration: none; color: inherit; cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
a.stat:hover, a.stat:focus-visible {
  border-color: var(--citrus);
  box-shadow: 0 8px 22px rgba(255,166,43,.20);
  text-decoration: none; color: inherit;
}
a.stat:hover .value { color: var(--citrus); }
a.stat.warn:hover .value { color: var(--accent-warm-ink); }

/* ===== 表格 ===== */
.table { font-size: 13px; color: var(--text); --bs-table-color: var(--text); --bs-table-bg: transparent; }
/* 表头：Bootstrap 的单元格选择器优先级更高，这里同时写在自定义属性上才压得住 */
.table thead th, .table th {
  --bs-table-color: var(--muted);
  --bs-table-bg: var(--surface-2);
  background: var(--surface-2); color: var(--muted);
  font-weight: 600; white-space: nowrap;
  border-color: var(--line); border-bottom: 1px solid var(--line);
}
.table td { vertical-align: middle; border-color: var(--line-soft); }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
.muted { color: var(--muted); }
.text-up { color: var(--up); }
.text-down { color: var(--down); }
.nowrap { white-space: nowrap; }
.badge-soft { background: var(--brand-soft); color: var(--brand); padding: 2px 8px; border-radius: 10px; font-size: 12px; }
[data-theme="dark"] .badge-soft { color: var(--brand-2); }

.pagination { margin: 0; }
.section-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 8px; }

/* ===== 登录页（左介绍 / 右登录） ===== */
.login-split { height: 100vh; display: flex; }
.login-hero {
  flex: 1.85; min-width: 0; display: flex; flex-direction: column;
  padding: 38px 60px 46px;
  background: linear-gradient(150deg, #2e5aa7 0%, #1c3a70 100%);
  position: relative; overflow: hidden;
}
.login-hero::before {
  content: ''; position: absolute; right: -110px; top: -110px;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,166,43,.24), transparent 62%);
  pointer-events: none;
}
.login-hero::after {
  content: ''; position: absolute; left: -90px; bottom: -130px;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(134,197,255,.30), transparent 62%);
  pointer-events: none;
}
.hero-top { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.hero-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--cream); color: var(--amalfi);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; flex-shrink: 0;
}
.hero-brand { font-weight: 600; font-size: 14.5px; color: rgba(255,255,255,.94); letter-spacing: .5px; }
.hero-main { margin-top: 10vh; position: relative; z-index: 1; }
.hero-main h1 { font-size: 48px; line-height: 1.22; margin: 0 0 22px; color: #fff; font-weight: 700; letter-spacing: 1px; }
.hero-main h1 em { font-style: normal; color: var(--cream); }
.hero-main p { margin: 0; color: rgba(214,229,250,.82); font-size: 16px; line-height: 1.8; white-space: nowrap; }
/* 窄桌面：压缩留白并微缩字号，保证描述文案始终单行 */
@media (max-width: 1100px) {
  .login-hero { padding-left: 34px; padding-right: 34px; }
  .hero-main h1 { font-size: 42px; }
  .hero-main p { font-size: 14px; }
}

/* 流程链 */
.hero-flow {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: 36px; position: relative; z-index: 1;
}
.hero-flow span {
  padding: 7px 17px; border-radius: 20px; font-size: 14px;
  color: rgba(233,242,254,.92);
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16);
}
.hero-flow span:last-child { background: rgba(255,166,43,.22); border-color: rgba(255,166,43,.55); color: #ffd79a; }
.hero-flow i { font-style: normal; color: rgba(255,166,43,.85); font-size: 15px; }

/* 特性卡（横向三列） */
.hero-feats {
  margin-top: max(72px, 10vh); display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  position: relative; z-index: 1;
}
.feat {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px; padding: 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
  transition: background .28s ease, border-color .28s ease, box-shadow .28s ease;
  animation: featFloat 6.6s ease-in-out infinite;
}
/* 三张卡错相漂浮，避免整齐划一 */
.feat:nth-child(1) { animation-delay: 0s; }
.feat:nth-child(2) { animation-delay: -2.2s; }
.feat:nth-child(3) { animation-delay: -4.4s; }
/* 一览而过的柔光（比胶囊更淡） */
.feat::before {
  content: ''; position: absolute; top: 0; left: 0; width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.15) 50%, transparent 100%);
  pointer-events: none;
  animation: featSweep 7.2s ease-in-out infinite;
}
.feat:nth-child(2)::before { animation-delay: -2.4s; }
.feat:nth-child(3)::before { animation-delay: -4.8s; }
/* 悬停：冻结浮动（等于「它注意到你了」），边框转橙、图标停在同一帧 */
.feat:hover {
  background: rgba(255,255,255,.13);
  border-color: rgba(255,166,43,.55);
  box-shadow: 0 14px 28px rgba(4,16,38,.36);
  animation-play-state: paused;
}
.feat:hover::before, .feat:hover .ficon, .feat:hover .ficon::after { animation-play-state: paused; }
.feat:hover b { color: #ffd79a; }
@keyframes featFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
@keyframes featSweep {
  0%        { transform: translateX(-170%) skewX(-16deg); }
  45%, 100% { transform: translateX(300%)  skewX(-16deg); }
}
.ficon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  animation: ficonBreath 3.4s ease-in-out infinite;
}
/* 图标外扩涟漪环，颜色跟随各卡主色 */
.ficon::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 0 0 currentColor; pointer-events: none;
  animation: ficonRing 3.4s ease-out infinite;
}
.feat:nth-child(2) .ficon, .feat:nth-child(2) .ficon::after { animation-delay: -1.1s; }
.feat:nth-child(3) .ficon, .feat:nth-child(3) .ficon::after { animation-delay: -2.2s; }
@keyframes ficonBreath {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.07); }
}
@keyframes ficonRing {
  0%   { opacity: .5; box-shadow: 0 0 0 0 currentColor; }
  60%  { opacity: 0;  box-shadow: 0 0 0 7px currentColor; }
  100% { opacity: 0;  box-shadow: 0 0 0 7px currentColor; }
}
.fi-amber { background: rgba(255,166,43,.24); color: #ffcb7a; }
.fi-green { background: rgba(134,197,255,.22); color: #a9d5ff; }
.fi-sky { background: rgba(255,166,43,.22); color: #ffa62b; }
.feat b { display: block; font-size: 13.5px; color: #fff; font-weight: 600; transition: color .28s ease; }
.feat small { display: block; font-size: 11.5px; color: rgba(200,220,246,.66); margin-top: 2px; line-height: 1.5; }

.login-side {
  flex: 1; min-width: 380px; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border-left: 1px solid var(--line);
  padding: 40px 48px;
}
.login-box { width: 100%; max-width: 320px; }
.login-box h2 { font-size: 22px; color: var(--text); margin: 0 0 6px; font-weight: 700; }
.login-box .tip { color: var(--muted); font-size: 12.5px; margin-bottom: 26px; }
.login-box label { display: block; font-size: 12.5px; color: var(--text); font-weight: 600; margin: 14px 0 6px; }
.login-box .form-control {
  border-radius: 8px; padding: 10px 12px; font-size: 13.5px;
  border-color: var(--line); background: var(--surface-2); color: var(--text);
}
.login-box .form-control:focus { border-color: var(--citrus); box-shadow: 0 0 0 3px rgba(255,166,43,.28); background: var(--surface); }
.login-box .btn { margin-top: 22px; padding: 10px 0; font-size: 14px; font-weight: 600; }
.login-box .demo { margin-top: 18px; margin-bottom: 0; text-align: center; font-size: 11.5px; line-height: 1.7; }

/* ---- 企业微信扫码登录 ---- */
.login-alert {
  border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.6;
  margin-bottom: 16px; border: 1px solid transparent;
}
.login-alert.alert-danger { background: rgba(220,53,69,.12); border-color: rgba(220,53,69,.35); color: #c02a38; }
[data-theme="dark"] .login-alert.alert-danger { color: #ff9aa5; }

.wecom-box { text-align: center; }
.wecom-qr {
  width: 220px; height: 220px; margin: 0 auto;
  border-radius: 12px; overflow: hidden; background: #fff;
  border: 1px solid var(--line); position: relative;
  display: flex; align-items: center; justify-content: center;
}
/* 企业微信二维码固定为浅底，深色模式下也不反色，避免扫码识别率下降 */
[data-theme="dark"] .wecom-qr { border-color: rgba(255,255,255,.18); }
.wecom-qr iframe { width: 100%; height: 100%; border: 0; display: block; }
.wecom-qr .skel {
  width: 100%; height: 100%;
  background: linear-gradient(100deg, #f2f4f7 30%, #e6ebf2 50%, #f2f4f7 70%);
  background-size: 220% 100%; animation: qrSkel 1.4s ease-in-out infinite;
}
@keyframes qrSkel { 0% { background-position: 120% 0; } 100% { background-position: -20% 0; } }
.wecom-tip { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }
.wecom-tip b { color: var(--text); }
.wecom-warn {
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  background: var(--surface-2); border: 1px dashed var(--line);
  border-radius: 10px; padding: 16px;
}
.wecom-warn b { font-size: 13px; color: var(--text); }
.wecom-warn span { font-size: 12px; color: var(--muted); line-height: 1.7; }
.wecom-warn code { font-size: 11.5px; color: var(--citrus); background: transparent; padding: 0; }

/* ---- 应急通道：账号密码 --- */
.login-alt { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 6px; }
.alt-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: transparent; border: 0; padding: 10px 0; cursor: pointer;
  font-size: 12.5px; color: var(--muted);
}
.alt-toggle:hover { color: var(--text); }
.alt-toggle svg { transition: transform .2s ease; }
.alt-toggle.open svg { transform: rotate(180deg); }
.alt-body { padding-top: 2px; }
.alt-hint { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; line-height: 1.6; }
.alt-body .btn { margin-top: 18px; }

.login-box .tip.secure {
  margin: 20px 0 0; display: flex; align-items: center; justify-content: center;
  gap: 6px; font-size: 11.5px; color: var(--muted); opacity: .85;
}
.login-box .tip.secure svg { flex: none; }

/* 企业微信授权回调中转页 */
.wecom-callback {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: var(--surface); color: var(--muted); font-size: 13px;
}
.wecom-callback .spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--citrus);
  animation: cbSpin .8s linear infinite;
}
@keyframes cbSpin { to { transform: rotate(360deg); } }

/* 小标签：企业微信绑定状态等 */
.tag-ok, .tag-off {
  display: inline-block; padding: 1px 7px; border-radius: 10px;
  font-size: 11px; line-height: 1.7; white-space: nowrap;
}
.tag-ok { background: rgba(34,161,90,.14); color: #17864a; border: 1px solid rgba(34,161,90,.32); }
.tag-off { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
[data-theme="dark"] .tag-ok { color: #6bd39b; }

/* 登录页主题切换按钮（浮于登录区右上角） */
.login-side { position: relative; }
.login-side .login-theme-btn {
  position: absolute; top: 14px; right: 18px; z-index: 5;
  width: 38px; height: 38px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #16305c; border: 1px solid rgba(255,255,255,.18);
  color: #dbe9ff; cursor: pointer; padding: 0;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
[data-theme="dark"] .login-side .login-theme-btn {
  background: #ffffff; border-color: #dbe6f5; color: #16305c;
}
.login-side .login-theme-btn:hover {
  border-color: var(--citrus); color: var(--citrus);
}
[data-theme="dark"] .login-side .login-theme-btn:hover { color: var(--accent-warm-ink); }
.login-side .login-theme-btn svg { width: 18px; height: 18px; display: block; }

@media (max-width: 900px) {
  .login-split { flex-direction: column; height: auto; min-height: 100vh; }
  .login-hero { padding: 28px 24px 32px; }
  .hero-main { margin-top: 5vh; }
  .hero-main h1 { font-size: 30px; margin-bottom: 16px; }
  .hero-main p { white-space: normal; font-size: 15px; }
  .hero-flow { margin-top: 28px; gap: 8px; }
  .hero-flow span { padding: 5px 13px; border-radius: 16px; font-size: 13px; }
  .hero-flow i { font-size: 14px; }
  .hero-feats { margin-top: 30px; grid-template-columns: 1fr; }
  .login-side { min-width: 0; border-left: none; border-top: 1px solid var(--line); }
  .login-box { max-width: 420px; padding: 8px 0 40px; }
}

/* ===== 工作台布局 ===== */
.dash-row { display: grid; grid-template-columns: 1fr 320px; gap: 14px; }
@media (max-width: 1100px) { .dash-row { grid-template-columns: 1fr; } }
.welcome {
  background: linear-gradient(135deg, #22457e 0%, #122a52 100%);
  color: #fff; padding: 24px 28px; border-radius: 12px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.welcome::after {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,166,43,.26), transparent 70%);
  pointer-events: none;
}
.welcome h2 { margin: 0 0 6px; font-size: 19px; font-weight: 600; letter-spacing: .5px; color: var(--citrus); }
.welcome p { margin: 0; opacity: .88; font-size: 13px; }
.welcome .time { font-size: 12px; opacity: .65; margin-top: 4px; }
.welcome .slogan {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14); padding: 10px 16px; border-radius: 20px;
  font-size: 12px; backdrop-filter: blur(6px);
  border: 1px solid rgba(134,197,255,.4); font-weight: 500;
  letter-spacing: 1px;
  position: relative; overflow: hidden;
  animation: sloganBreath 3.8s ease-in-out infinite;
}
/* 流光：一道柔光周期性扫过胶囊 */
.welcome .slogan::after {
  content: ''; position: absolute; top: 0; left: 0; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.36) 50%, transparent 100%);
  pointer-events: none;
  animation: sloganSweep 4.8s ease-in-out infinite;
}
/* 光点：呼吸脉冲 + 涟漪扩散 */
.welcome .slogan::before {
  content: ''; width: 7px; height: 7px; background: var(--citrus); border-radius: 50%;
  position: relative; z-index: 1; flex: none;
  animation: sloganDot 2.4s ease-in-out infinite;
}
@keyframes sloganDot {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 6px rgba(255,166,43,.7), 0 0 0 0 rgba(255,166,43,.55); }
  50%      { transform: scale(1.16); box-shadow: 0 0 13px rgba(255,166,43,1), 0 0 0 6px rgba(255,166,43,0); }
}
@keyframes sloganSweep {
  0%        { transform: translateX(-170%) skewX(-14deg); }
  55%, 100% { transform: translateX(330%)  skewX(-14deg); }
}
@keyframes sloganBreath {
  0%, 100% { border-color: rgba(134,197,255,.34); box-shadow: 0 0 0 0 rgba(134,197,255,0); }
  50%      { border-color: rgba(134,197,255,.62); box-shadow: 0 0 14px rgba(93,160,255,.26); }
}
@media (prefers-reduced-motion: reduce) {
  .welcome .slogan, .welcome .slogan::before, .welcome .slogan::after,
  .feat, .feat::before, .ficon, .ficon::after { animation: none; }
}

.todo-list { list-style: none; padding: 0; margin: 0; }
.todo-list li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 8px; margin-bottom: 6px;
  background: var(--surface-2); font-size: 13px;
  border-left: 3px solid var(--accent);
  transition: transform .15s ease, background .15s ease;
}
.todo-list li:hover { transform: translateX(2px); }
.todo-list li.warn { background: var(--surface-warm); border-left-color: var(--citrus); }
.todo-list li.info { background: var(--surface-cool); border-left-color: var(--sea); }
.todo-list li.leaf { background: var(--surface-leaf); border-left-color: var(--cream); }
.todo-list li:last-child { margin-bottom: 0; }
.todo-list .name { color: var(--text); flex: 1; }
.todo-list .name b { color: var(--accent-warm-ink); font-weight: 700; }
.todo-list li.leaf .name b { color: var(--brand); }
.todo-list li.info .name b { color: var(--accent-sky-ink); }
.todo-list a { text-decoration: none; font-size: 12px; padding: 4px 10px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.todo-list a:hover { color: var(--brand); border-color: var(--brand); }

.quick-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.quick {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 14px 8px; text-align: center;
  text-decoration: none; color: var(--text); font-size: 12.5px;
  transition: all .15s ease;
}
.quick:hover { border-color: var(--citrus); color: var(--accent-warm-ink); transform: translateY(-2px); background: var(--surface-warm); box-shadow: 0 6px 16px rgba(255,166,43,.2); }
.quick svg { display: block; margin: 0 auto 6px; color: var(--brand); transition: color .15s ease, transform .15s ease; }
.quick:hover svg { color: var(--citrus); transform: scale(1.1); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
::-webkit-scrollbar-track { background: transparent; }

/* ===== Bootstrap 按钮配色覆盖（Citrus 强调） ===== */
.btn-primary {
  background: var(--amalfi); border-color: var(--amalfi); color: #fff;
  font-weight: 500; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background: var(--citrus); border-color: var(--citrus); color: var(--ink-on-accent);
  box-shadow: 0 4px 14px rgba(255,166,43,.35);
}
.btn-outline-primary { color: var(--brand); border-color: var(--brand); background: transparent; }
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
  background: var(--cream); border-color: var(--citrus); color: var(--ink-on-accent);
  box-shadow: 0 4px 14px rgba(255,166,43,.32);
}
.btn-outline-secondary { color: var(--muted); border-color: var(--line); background: transparent; }
.btn-outline-secondary:hover { background: var(--surface-3); border-color: var(--muted); color: var(--text); }
.btn-link { color: var(--brand); text-decoration: none; }
.btn-link:hover { color: var(--accent-warm-ink); }
.btn-link.text-danger { color: var(--up); }
.btn-link.text-danger:hover { color: #e25544; }
.btn { border-radius: 8px; }

/* 分页：Bootstrap 把变量定义在 .pagination 自身，需就地覆盖 */
.pagination {
  --bs-pagination-color: var(--brand);
  --bs-pagination-bg: var(--surface);
  --bs-pagination-border-color: var(--line);
  --bs-pagination-hover-color: var(--accent-warm-ink);
  --bs-pagination-hover-bg: var(--surface-3);
  --bs-pagination-hover-border-color: var(--citrus);
  --bs-pagination-active-bg: var(--brand);
  --bs-pagination-active-border-color: var(--brand);
  --bs-pagination-disabled-color: var(--muted);
  --bs-pagination-disabled-bg: var(--surface-2);
  --bs-pagination-disabled-border-color: var(--line);
}

/* ===== 移动端适配 ===== */
@media (max-width: 900px) {
  #shell { display: block; height: 100vh; overflow: hidden; }

  /* 侧边栏改为抽屉 */
  #sidebar {
    position: fixed; top: 0; left: 0;
    width: 280px; height: 100vh;
    z-index: 1040;
    transform: translateX(-100%);
    transition: transform .28s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.25);
  }
  #sidebar.open { transform: translateX(0); }
  #sidebarBackdrop {
    position: fixed; inset: 0;
    background: rgba(12,22,38,.55);
    z-index: 1030;
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
  }
  #sidebarBackdrop.show { opacity: 1; pointer-events: auto; }
  [data-theme="dark"] #sidebarBackdrop { background: rgba(0,0,0,.68); }

  #main { width: 100%; height: 100vh; display: flex; flex-direction: column; }

  /* 顶栏 */
  #topbar {
    padding: 0 14px; gap: 10px; height: 56px;
  }
  #topbar .start { display: flex; align-items: center; gap: 10px; min-width: 0; }
  #topbar .start .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  #sidebar .logo { padding-right: 14px; }
  #sidebar .sidebar-close { display: inline-flex; }
  #topbar .hamburger {
    display: inline-flex; width: 36px; height: 36px;
    align-items: center; justify-content: center;
    background: transparent; border: 1px solid var(--line);
    border-radius: 8px; color: var(--text); cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
  }
  #topbar .hamburger:hover { border-color: var(--citrus); color: var(--citrus); }
  #topbar .search { display: none; }
  #topbar #userName { display: none; }
  #topbar .actions { gap: 8px; }
  #topbar .actions .btn-outline-secondary { padding: 4px 8px; font-size: 12px; }
  #topbar .avatar { width: 30px; height: 30px; font-size: 11px; }

  /* 内容区 */
  #content { padding: 12px; }

  /* 工作台 */
  .welcome {
    flex-direction: column; align-items: flex-start; gap: 14px;
    padding: 18px 20px;
  }
  .welcome .slogan { align-self: flex-start; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 22px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .quick { padding: 14px 6px; font-size: 12px; }
  .quick svg { width: 20px; height: 20px; }

  /* 列表页 */
  .toolbar { gap: 6px; }
  .toolbar .btn, .toolbar .form-control, .toolbar .form-select { font-size: 12.5px; }
  .toolbar input[data-filter], .toolbar select[data-filter] { width: auto !important; flex: 1 1 120px; max-width: 150px; }
  .table { font-size: 12px; }
  .table-responsive { min-height: 160px; }

  /* 通知面板 */
  .notif-panel {
    position: fixed; top: 62px; right: 12px; left: 12px;
    width: auto; max-width: none;
  }

  /* Toast */
  #toast { max-width: calc(100vw - 32px); right: 16px; left: 16px; }

  /* 登录页 */
  .login-split { min-height: 100svh; }
  .login-hero { padding: 22px 20px 28px; }
  .hero-main { margin-top: 4vh; }
  .hero-main h1 { font-size: 26px; }
  .hero-flow { margin-top: 22px; }
  .hero-feats { margin-top: 26px; gap: 12px; }
  .login-side { padding: 28px 20px; }
  .login-box { max-width: 100%; padding: 0 0 24px; }
}

@media (max-width: 480px) {
  .hero-main h1 { font-size: 26px; margin-bottom: 14px; }
  .hero-main p { font-size: 14px; }
  .hero-flow { margin-top: 24px; }
  .hero-flow span { font-size: 12px; padding: 4px 11px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat .value { font-size: 20px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  #trend { height: 220px !important; }
  #customerDist { height: 190px !important; }
}

@media (min-width: 901px) {
  #sidebarBackdrop { display: none !important; }
  #topbar .hamburger { display: none; }
}
