/* ============================================================
   三岁CRM · 网页版预览版 — iOS 风格设计系统
   ============================================================ */
:root {
  --bg: #F4F5F9;
  --bg2: #EDF0F7;
  --card: #FFFFFF;
  --text: #1D1D1F;
  --text2: #6E6E73;
  --text3: #A1A1A6;
  --accent: #00B8D9;
  --accent2: #3D7BFF;
  --accent3: #FF8A3D;
  --success: #34C759;
  --warn: #FF9F0A;
  --danger: #FF3B30;
  --grad: linear-gradient(135deg, #00B8D9 0%, #3D7BFF 48%, #FF8A3D 100%);
  --grad-soft: linear-gradient(135deg, rgba(0,184,217,.12) 0%, rgba(255,138,61,.12) 100%);
  --line: rgba(29,29,31,.08);
  --line-strong: rgba(29,29,31,.12);
  --shadow-sm: 0 2px 10px rgba(29,29,31,.05);
  --shadow: 0 8px 30px rgba(29,29,31,.07);
  --shadow-lg: 0 24px 70px rgba(29,29,31,.16);
  --glass: rgba(255,255,255,.66);
  --nav-w: 248px;
  --top-h: 58px;
  --radius: 18px;
  --radius-lg: 24px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
}
[data-theme="dark"] {
  --bg: #0F1118;
  --bg2: #151824;
  --card: #1A1E2C;
  --text: #F5F5F7;
  --text2: #9AA0AE;
  --text3: #6A7080;
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.15);
  --shadow-sm: 0 2px 10px rgba(0,0,0,.3);
  --shadow: 0 8px 30px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 70px rgba(0,0,0,.5);
  --glass: rgba(22,26,38,.72);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.6; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(29,29,31,.16); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); }
::selection { background: rgba(61,123,255,.22); }

/* ================= 登录页 ================= */
.login-screen {
  position: fixed; inset: 0; z-index: 1000; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #EEF4FF 0%, #F7F3FF 45%, #FFF4EA 100%);
}
[data-theme="dark"] .login-screen { background: linear-gradient(160deg, #0D1428 0%, #16122E 45%, #2A1A12 100%); }
.login-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; animation: orbFloat 9s ease-in-out infinite; }
.login-orb--1 { width: 380px; height: 380px; background: #6FD8EA; top: -90px; right: 8%; }
.login-orb--2 { width: 320px; height: 320px; background: #B7A6FF; bottom: -70px; left: 6%; animation-delay: -3s; }
.login-orb--3 { width: 240px; height: 240px; background: #FFC9A1; top: 40%; left: 30%; animation-delay: -6s; opacity: .35; }
@keyframes orbFloat { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-26px) scale(1.06); } }
.login-card {
  position: relative; z-index: 2; width: min(420px, 92vw); padding: 38px 34px 30px;
  background: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.6);
  border-radius: 28px; box-shadow: 0 30px 80px rgba(29,29,31,.14);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  animation: popIn .6s var(--ease);
}
[data-theme="dark"] .login-card { background: rgba(26,30,44,.8); border-color: rgba(255,255,255,.08); }
@keyframes popIn { from { opacity: 0; transform: translateY(22px) scale(.98); } to { opacity: 1; transform: none; } }
.login-logo {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 18px;
  background: var(--grad); color: #fff; font-size: 32px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 34px rgba(61,123,255,.4);
}
.login-title { text-align: center; font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.login-sub { text-align: center; color: var(--text2); font-size: 13px; margin: 8px 0 22px; }
.login-tabs { display: flex; background: var(--bg2); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.login-tab { flex: 1; padding: 9px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--text2); transition: .25s; }
.login-tab.active { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.check { display: flex; align-items: center; gap: 7px; color: var(--text2); cursor: pointer; }
.check input { accent-color: var(--accent2); }
.link-btn { color: var(--accent2); font-size: 13px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.login-tip { text-align: center; color: var(--text3); font-size: 12px; margin-top: 6px; }
.login-foot { position: absolute; bottom: 22px; z-index: 2; color: var(--text3); font-size: 12px; }

/* ================= 通用元素 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; transition: transform .18s var(--ease), box-shadow .25s, background .2s, opacity .2s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(61,123,255,.32); }
.btn--primary:hover { box-shadow: 0 12px 28px rgba(61,123,255,.44); }
.btn--accent { background: var(--accent2); color: #fff; box-shadow: 0 8px 20px rgba(61,123,255,.3); }
.btn--success { background: var(--success); color: #fff; box-shadow: 0 8px 20px rgba(52,199,89,.32); }
.btn--ghost { background: var(--bg2); color: var(--text); }
.btn--ghost:hover { background: var(--line-strong); }
.btn--outline { border-color: var(--line-strong); color: var(--text2); background: transparent; }
.btn--outline:hover { background: var(--bg2); color: var(--text); }
.btn--danger { background: rgba(255,59,48,.1); color: var(--danger); }
.btn--sm { padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--icon { width: 38px; height: 38px; padding: 0; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; }
.icon { display: inline-block; width: 1em; height: 1em; flex-shrink: 0; vertical-align: -.13em; }
.icon svg { width: 100%; height: 100%; display: block; }

.input, .select, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: 12px; font-size: 14px;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--text);
  transition: border-color .2s, box-shadow .2s; outline: none;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--accent2); box-shadow: 0 0 0 4px rgba(61,123,255,.14); }
textarea.input { resize: vertical; min-height: 80px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text2); }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 100px;
  font-size: 12px; font-weight: 600;
}
.badge--gray { background: var(--bg2); color: var(--text2); }
.badge--blue { background: rgba(61,123,255,.12); color: #2B6BFF; }
.badge--cyan { background: rgba(0,184,217,.12); color: #00A8C8; }
.badge--green { background: rgba(52,199,89,.13); color: #1F9E52; }
.badge--orange { background: rgba(255,159,10,.15); color: #E2890A; }
.badge--red { background: rgba(255,59,48,.12); color: #E5372C; }
.badge--purple { background: rgba(168,85,247,.13); color: #9B3FF5; }
.muted { color: var(--text2); }
.small { font-size: 12px; }
.text-right { text-align: right; }

/* ================= 应用外壳 ================= */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--nav-w); flex-shrink: 0; height: 100vh; position: sticky; top: 0;
  display: flex; flex-direction: column;
  background: var(--glass); border-right: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  z-index: 120; transition: transform .35s var(--ease);
}
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 14px; }
.sidebar__logo {
  width: 38px; height: 38px; border-radius: 12px; background: var(--grad); color: #fff;
  font-size: 19px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(61,123,255,.38);
}
.sidebar__title { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.sidebar__subtitle { font-size: 11px; color: var(--text3); }
.sidebar__nav { flex: 1; overflow-y: auto; padding: 4px 12px; }
.nav-group { margin-bottom: 6px; }
.nav-group__head {
  display: flex; align-items: center; gap: 6px; padding: 10px 12px 5px;
  font-size: 11px; font-weight: 700; color: var(--text3); letter-spacing: .04em; cursor: pointer; user-select: none;
}
.nav-group__head .caret { transition: transform .25s; font-size: 9px; }
.nav-group.collapsed .caret { transform: rotate(-90deg); }
.nav-group.collapsed .nav-group__items { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 12px; border-radius: 11px; font-size: 13.5px; font-weight: 500; color: var(--text2);
  transition: background .18s, color .18s, transform .18s var(--ease); text-align: left;
}
.nav-item:hover { background: rgba(29,29,31,.06); color: var(--text); }
[data-theme="dark"] .nav-item:hover { background: rgba(255,255,255,.07); }
.nav-item.active { background: var(--grad-soft); color: var(--text); font-weight: 700; }
.nav-item__icon { width: 19px; height: 19px; color: var(--text3); flex-shrink: 0; }
.nav-item.active .nav-item__icon { color: var(--accent2); }
.nav-item--pinned { position: sticky; }
.sidebar__bottom { padding: 6px 12px; border-top: 1px solid var(--line); }
.sidebar__footer { padding: 12px 16px; border-top: 1px solid var(--line); }
.account-card {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 6px; border-radius: 12px; transition: background .2s;
}
.account-card:hover { background: rgba(29,29,31,.05); }
[data-theme="dark"] .account-card:hover { background: rgba(255,255,255,.06); }
.account-card__avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff;
  font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.account-card__meta { flex: 1; min-width: 0; }
.account-card__name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-card__status { font-size: 11px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-card__chev { color: var(--text3); font-size: 18px; transform: rotate(-90deg); }
.sidebar__site { text-align: center; font-size: 12px; color: var(--text3); padding: 6px 0 2px; cursor: pointer; }
.sidebar__site:hover { color: var(--accent2); }
.sidebar__version { text-align: center; font-size: 11px; color: var(--text3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 100; height: var(--top-h);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: var(--glass); backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--line);
}
.topbar__menu { display: none; width: 38px; height: 38px; border-radius: 10px; font-size: 20px; color: var(--text); }
.topbar__title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.topbar__spacer { flex: 1; }
.topbar__search { position: relative; }
.topbar__search-input {
  width: 220px; padding: 8px 14px 8px 34px; border-radius: 11px; font-size: 13px;
  border: 1px solid transparent; background: var(--bg2); color: var(--text); outline: none; transition: .25s;
}
.topbar__search-input:focus { width: 280px; background: var(--card); border-color: var(--accent2); box-shadow: 0 0 0 4px rgba(61,123,255,.12); }
.topbar__search::before { content: "⌕"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 15px; }
.topbar__date { font-size: 13px; color: var(--text3); white-space: nowrap; }
.ann-bell { position: relative; }
.topbar__bell { width: 38px; height: 38px; border-radius: 11px; font-size: 17px; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.topbar__bell:hover { background: var(--bg2); }
.ann-bell__dot {
  position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 100px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.content { flex: 1; padding: 24px 28px 60px; max-width: 1280px; width: 100%; margin: 0 auto; animation: pageIn .4s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ================= 页面通用结构 ================= */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.page-head__sub { font-size: 13px; color: var(--text2); margin-top: 3px; }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input { width: 230px; }
.search-box { position: relative; }
.search-box .input { padding-left: 34px; }
.search-box::before { content: "⌕"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text3); }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px; border-radius: 100px; font-size: 13px; font-weight: 600; color: var(--text2);
  background: var(--card); border: 1px solid var(--line-strong); transition: .2s;
}
.chip:hover { border-color: var(--accent2); color: var(--accent2); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(61,123,255,.3); }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card--flat { box-shadow: none; }
.card__head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.card__title { font-size: 15px; font-weight: 700; flex: 1; }
.card__sub { font-size: 12px; color: var(--text3); }
.card__body { padding: 16px 18px; }
.card__body--tight { padding: 10px 12px; }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  position: relative; overflow: hidden; padding: 20px 20px 16px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .28s var(--ease), box-shadow .28s; cursor: pointer;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.stat-card__glow { position: absolute; top: -40px; right: -40px; width: 130px; height: 130px; border-radius: 50%; opacity: .16; filter: blur(6px); }
.stat-card__icon { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; color: #fff; box-shadow: 0 8px 18px rgba(0,0,0,.14); }
.stat-card__icon .icon { width: 21px; height: 21px; }
.stat-card__value { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat-card__label { font-size: 13px; color: var(--text2); margin-top: 3px; }
.stat-card__trend { font-size: 12px; font-weight: 600; margin-top: 7px; display: inline-flex; align-items: center; gap: 4px; }

/* 列表 / 表格 */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 13px; padding: 13px 16px; border-radius: 13px;
  transition: background .18s; border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--bg2); }
.list-item__avatar {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: #fff;
}
.list-item__main { flex: 1; min-width: 0; }
.list-item__title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item__sub { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item__right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.list-item__value { font-weight: 700; font-size: 14px; text-align: right; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 11px 14px; color: var(--text3); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--bg2); }
.table tbody tr:last-child td { border-bottom: none; }
.table td { vertical-align: middle; }
.tbl-cust { display: flex; align-items: center; gap: 10px; }
.tbl-title { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl-sub { font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl-num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-desc { min-width: 160px; max-width: 260px; white-space: normal; color: var(--text2); line-height: 1.5; }
.tbl-center { text-align: center; }
.tbl-ops { display: flex; gap: 6px; }
.tbl-ops .btn { white-space: nowrap; }
.product-thumb { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--bg2), var(--line)); color: var(--text3); }
.product-thumb .icon { width: 20px; height: 20px; }

/* 空状态 */
.empty { text-align: center; padding: 48px 20px; color: var(--text3); }
.empty__icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; background: var(--bg2); display: flex; align-items: center; justify-content: center; color: var(--text3); }
.empty__icon .icon { width: 30px; height: 30px; }
.empty__title { font-size: 15px; font-weight: 700; color: var(--text2); }
.empty__sub { font-size: 13px; margin-top: 4px; }

/* ================= 弹窗 ================= */
.modal-mask {
  position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15,17,24,.42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn .25s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(560px, 94vw); max-height: 86vh; display: flex; flex-direction: column;
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow-lg);
  animation: modalIn .38s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(26px) scale(.97); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: center; gap: 10px; padding: 20px 22px 0; }
.modal__title { font-size: 17px; font-weight: 800; flex: 1; }
.modal__close { width: 32px; height: 32px; border-radius: 10px; color: var(--text2); font-size: 15px; }
.modal__close:hover { background: var(--bg2); }
.modal__body { padding: 16px 22px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 13px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; }

/* Toast */
.toast-box { position: fixed; top: 70px; right: 22px; z-index: 900; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; min-width: 240px; max-width: 360px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: toastIn .4s var(--ease); font-size: 13.5px; font-weight: 500;
}
.toast--success { border-left: 4px solid var(--success); }
.toast--danger { border-left: 4px solid var(--danger); }
.toast--info { border-left: 4px solid var(--accent2); }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* 通知面板 */
.ann-panel {
  position: fixed; top: calc(var(--top-h) + 8px); right: 20px; z-index: 300; width: 340px; max-height: 72vh;
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg); animation: popIn .3s var(--ease); overflow: hidden;
}
.ann-panel__head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.ann-panel__body { overflow-y: auto; flex: 1; }
.ann-item { padding: 13px 18px; border-bottom: 1px solid var(--line); transition: background .15s; cursor: pointer; }
.ann-item:hover { background: var(--bg2); }
.ann-item:last-child { border-bottom: none; }
.ann-item.unread { background: rgba(61,123,255,.05); }
.ann-item__title { font-size: 13.5px; font-weight: 700; }
.ann-item__sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.ann-item__time { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* 抽屉遮罩 */
.drawer-mask { position: fixed; inset: 0; z-index: 110; background: rgba(15,17,24,.4); }

/* ================= 首页数据看板 ================= */
.hero-band {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 30px 32px; margin-bottom: 22px;
  background: linear-gradient(135deg, #0E1730 0%, #14307A 55%, #2A1A55 100%); color: #fff;
  box-shadow: 0 20px 50px rgba(20,48,122,.28);
}
[data-theme="dark"] .hero-band { background: linear-gradient(135deg, #0B1226 0%, #14265E 55%, #241749 100%); }
.hero-band::before { content: ""; position: absolute; inset: 0; opacity: .35; background-image: radial-gradient(rgba(255,255,255,.5) 1px, transparent 1px); background-size: 26px 26px; mask-image: linear-gradient(120deg, #000, transparent 70%); }
.hero-band__hi { font-size: 14px; opacity: .85; }
.hero-band__title { font-size: clamp(24px, 3.2vw, 34px); font-weight: 800; letter-spacing: -.02em; margin-top: 4px; position: relative; }
.hero-band__title b { background: linear-gradient(120deg, #6FE3FF, #9DB8FF 55%, #FFC29B); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-band__actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; position: relative; }
.hero-band .btn--glass { background: rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.22); }
.hero-band .btn--glass:hover { background: rgba(255,255,255,.22); }
.hero-band .btn--white { background: #fff; color: #14307A; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.dash-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.dash-card__head { display: flex; align-items: center; gap: 9px; padding: 15px 18px 0; }
.dash-card__title { font-weight: 700; font-size: 15px; flex: 1; }
.dash-card__more { font-size: 12px; color: var(--accent2); font-weight: 600; }
.dash-card__body { padding: 13px 18px 16px; }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; padding: 9px 0; position: relative; }
.tl-item__dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.tl-item__body { flex: 1; min-width: 0; }
.tl-item__txt { font-size: 13px; line-height: 1.5; }
.tl-item__txt b { font-weight: 700; }
.tl-item__time { font-size: 11px; color: var(--text3); margin-top: 2px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.quick-card {
  display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 18px 10px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line); transition: transform .25s var(--ease), box-shadow .25s;
}
.quick-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.quick-card__icon { width: 46px; height: 46px; border-radius: 15px; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 8px 18px rgba(0,0,0,.16); }
.quick-card__icon .icon { width: 22px; height: 22px; }
.quick-card__label { font-size: 13px; font-weight: 600; }

/* ================= 客户 / 产品卡片 ================= */
.cust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.cust-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm); transition: transform .28s var(--ease), box-shadow .28s; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px;
}
.cust-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cust-card__top { display: flex; align-items: center; gap: 12px; }
.cust-card__name { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-card__company { font-size: 12px; color: var(--text2); }
.cust-card__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.cust-card__meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text2); border-top: 1px solid var(--line); padding-top: 10px; }
.cust-card__value { font-weight: 800; color: var(--text); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.product-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .28s var(--ease), box-shadow .28s; cursor: pointer;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-card__thumb { height: 120px; background: var(--grad-soft); display: flex; align-items: center; justify-content: center; font-size: 40px; }
.product-card__body { padding: 14px 16px; }
.product-card__name { font-size: 14px; font-weight: 800; }
.product-card__sku { font-size: 11px; color: var(--text3); margin-top: 2px; }
.product-card__price { font-size: 16px; font-weight: 800; color: var(--accent2); margin-top: 8px; }
.product-card__meta { font-size: 12px; color: var(--text2); margin-top: 4px; }

/* ================= 库存 / 报价 ================= */
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.inv-card {
  position: relative; overflow: hidden; padding: 18px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .28s var(--ease), box-shadow .28s;
}
.inv-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.inv-card__glow { position: absolute; top: -30px; right: -30px; width: 90px; height: 90px; border-radius: 50%; opacity: .18; filter: blur(4px); }
.inv-card__name { font-size: 14px; font-weight: 800; position: relative; }
.inv-card__sku { font-size: 11px; color: var(--text3); position: relative; }
.inv-card__qty { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 2px; position: relative; }
.inv-card__unit { font-size: 13px; color: var(--text2); position: relative; }
.inv-card__actions { display: flex; gap: 8px; margin-top: 12px; position: relative; }
.quote-item { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-radius: 13px; border: 1px solid var(--line); margin-bottom: 10px; transition: .2s; background: var(--card); }
.quote-item:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

/* ================= 知识库 / 术语 ================= */
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.kb-card { padding: 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); cursor: pointer; transition: .28s var(--ease); }
.kb-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kb-card__cat { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 100px; }
.kb-card__title { font-size: 14px; font-weight: 700; margin: 10px 0 4px; }
.kb-card__body { font-size: 12.5px; color: var(--text2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kb-card__meta { font-size: 11px; color: var(--text3); margin-top: 10px; }
.term-item { padding: 13px 16px; border-bottom: 1px solid var(--line); transition: background .15s; cursor: pointer; }
.term-item:hover { background: var(--bg2); }
.term-item:last-child { border-bottom: none; }
.term-item__term { font-size: 14px; font-weight: 700; }
.term-item__en { font-size: 12px; color: var(--text2); }
.term-item__def { font-size: 12.5px; color: var(--text2); margin-top: 4px; }

/* ================= 获客 ================= */
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 18px; }
.channel-card { position: relative; overflow: hidden; padding: 20px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: .28s var(--ease); }
.channel-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.channel-card__glow { position: absolute; top: -30px; right: -30px; width: 110px; height: 110px; border-radius: 50%; opacity: .16; filter: blur(5px); }
.channel-card__icon { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 8px 18px rgba(0,0,0,.16); margin-bottom: 12px; }
.channel-card__icon .icon { width: 21px; height: 21px; }
.channel-card__name { font-size: 15px; font-weight: 800; }
.channel-card__desc { font-size: 12px; color: var(--text2); margin: 5px 0 12px; min-height: 34px; }
.lead-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 13px; border: 1px solid var(--line); margin-bottom: 10px; background: var(--card); transition: .2s; }
.lead-row:hover { box-shadow: var(--shadow-sm); }
.lead-row__name { font-size: 14px; font-weight: 700; }
.lead-row__sub { font-size: 12px; color: var(--text2); }
.lead-row__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ================= 地图 ================= */
.map-card { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #DBEAFB; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.map-card[data-minimap] { height: 220px; }
[data-theme="dark"] .map-card { background: #0E1626; }
.map-card canvas { display: block; width: 100%; height: auto; }
.map-legend { display: flex; gap: 14px; padding: 12px 16px; font-size: 12px; color: var(--text2); background: var(--card); border-top: 1px solid var(--line); }

/* ================= 排行 / 分析 ================= */
.rank-row { display: flex; align-items: center; gap: 12px; padding: 11px 8px; }
.rank-row__no { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; background: var(--bg2); color: var(--text2); flex-shrink: 0; }
.rank-row__no.top { background: var(--grad); color: #fff; }
.rank-row__bar { height: 22px; border-radius: 8px; background: var(--grad); opacity: .85; transition: width .8s var(--ease); min-width: 4px; }
.rank-row__name { width: 110px; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.rank-row__val { font-size: 13px; font-weight: 800; color: var(--accent2); }
.bar-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text2); margin-bottom: 4px; }

/* ================= AI 聊天 ================= */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 200px); min-height: 420px; }
.chat-suggest { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chat-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 6px 2px; }
.chat-msg { display: flex; gap: 11px; max-width: 86%; animation: msgIn .35s var(--ease); }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.chat-msg--me { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg__avatar { width: 34px; height: 34px; border-radius: 11px; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; flex-shrink: 0; }
.chat-msg--me .chat-msg__avatar { background: var(--accent2); }
.chat-msg__bubble { padding: 12px 15px; border-radius: 16px; font-size: 13.5px; line-height: 1.65; background: var(--card); border: 1px solid var(--line); border-top-left-radius: 5px; }
.chat-msg--me .chat-msg__bubble { background: var(--grad); color: #fff; border: none; border-top-right-radius: 5px; }
.chat-msg__bubble pre { white-space: pre-wrap; font-family: inherit; }
.chat-input { display: flex; gap: 10px; margin-top: 14px; }
.chat-input .input { flex: 1; }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text3); animation: typing 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* ================= 汇率 / 设置 ================= */
.rate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.rate-card { padding: 16px; border-radius: 15px; background: var(--card); border: 1px solid var(--line); text-align: center; }
.rate-card__cur { font-size: 15px; font-weight: 800; }
.rate-card__val { font-size: 20px; font-weight: 800; color: var(--accent2); margin-top: 4px; }
.rate-card__trend { font-size: 12px; font-weight: 600; margin-top: 2px; }
.setting-group { margin-bottom: 22px; }
.setting-group__title { font-size: 13px; font-weight: 800; color: var(--text3); letter-spacing: .03em; margin-bottom: 10px; }
.setting-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; }
.setting-row__main { flex: 1; }
.setting-row__title { font-size: 14px; font-weight: 700; }
.setting-row__sub { font-size: 12px; color: var(--text2); }
.switch { position: relative; width: 46px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider { position: absolute; inset: 0; background: var(--line-strong); border-radius: 100px; transition: .25s; }
.switch__slider::before { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .25s; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.switch input:checked + .switch__slider { background: var(--success); }
.switch input:checked + .switch__slider::before { transform: translateX(18px); }

/* ================= 素材库 / 日志 ================= */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.asset-card { border-radius: 15px; overflow: hidden; background: var(--card); border: 1px solid var(--line); cursor: pointer; transition: .25s var(--ease); }
.asset-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.asset-card__thumb { height: 96px; background: var(--grad-soft); display: flex; align-items: center; justify-content: center; font-size: 34px; }
.asset-card__name { font-size: 12px; font-weight: 600; padding: 9px 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-row { display: flex; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line); }
.log-row:last-child { border-bottom: none; }
.log-row__time { width: 72px; flex-shrink: 0; font-size: 12px; color: var(--text3); font-variant-numeric: tabular-nums; }
.log-row__main { flex: 1; font-size: 13px; }
.log-row__action { font-weight: 700; }
.log-row__detail { color: var(--text2); }

/* ================= 响应式 ================= */
@media (max-width: 1024px) {
  .dash-grid { grid-template-columns: 1fr; }
  .topbar__search { display: none; }
}
@media (max-width: 768px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .topbar__menu { display: flex; }
  .content { padding: 16px 14px 60px; }
  .topbar__date { display: none; }
  .cust-grid, .product-grid, .inv-grid, .kb-grid, .channel-grid { grid-template-columns: 1fr 1fr; }
  .hero-band { padding: 22px 20px; }
  .ann-panel { right: 10px; width: calc(100vw - 20px); }
}
@media (max-width: 480px) {
  .cust-grid, .product-grid, .inv-grid, .kb-grid, .channel-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page-head h1 { font-size: 20px; }
}
