/* 海鸥CRM · 淡蓝玻璃质感 UI（纯 CSS，无第三方依赖） */
:root {
  --accent: #2f8bfd;
  --accent-2: #5fc8ff;
  --ink: #12263f;
  --ink-2: #3c5a7d;
  --ink-3: #7d95ae;
  --line: rgba(255, 255, 255, .72);
  --line-soft: rgba(120, 170, 220, .18);
  --glass: rgba(255, 255, 255, .64);
  --glass-strong: rgba(255, 255, 255, .84);
  --shadow: 0 18px 44px rgba(28, 80, 145, .12);
  --shadow-sm: 0 8px 22px rgba(28, 80, 145, .09);
  --radius: 18px;
  --radius-sm: 12px;
  --bg-a: #eff7ff;
  --bg-b: #dceafd;
  --bg-c: #e9f6ff;
}
body.theme-mist { --bg-a: #f3f7fb; --bg-b: #e2ecf6; --bg-c: #eef4fb; }
body.theme-teal { --bg-a: #eef9fa; --bg-b: #dceff5; --bg-c: #e6f8f8; }
body.theme-lilac { --bg-a: #f2f4fd; --bg-b: #e4e9fb; --bg-c: #eff3fe; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg-a), var(--bg-b) 48%, var(--bg-c));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* 背景光斑 */
.bg-blobs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 18s ease-in-out infinite; }
.b1 { width: 520px; height: 520px; left: -140px; top: -120px; background: radial-gradient(circle, #a9d6ff, transparent 68%); }
.b2 { width: 460px; height: 460px; right: -120px; top: 12%; background: radial-gradient(circle, #b8f0ff, transparent 70%); animation-delay: -6s; }
.b3 { width: 620px; height: 620px; left: 30%; bottom: -280px; background: radial-gradient(circle, #cfe4ff, transparent 70%); animation-delay: -12s; }
@keyframes float { 0%,100% { transform: translate3d(0,0,0) scale(1);} 50% { transform: translate3d(24px,-28px,0) scale(1.06);} }

/* ---------- 侧边栏 ---------- */
.sidebar {
  position: fixed; left: 16px; top: 16px; bottom: 16px; width: 236px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  padding: 18px 12px 12px;
  z-index: 30;
  animation: slideIn .5s cubic-bezier(.22,.9,.3,1) both;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(-16px);} to { opacity: 1; transform: none;} }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 13px; overflow: hidden; flex: none;
  background: linear-gradient(140deg, #eaf6ff, #cfe9ff);
  box-shadow: 0 6px 16px rgba(47,139,253,.22), inset 0 1px 0 rgba(255,255,255,.9);
  display: grid; place-items: center;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { min-width: 0; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 10px; letter-spacing: 2px; color: var(--ink-3); margin-top: 2px; }
.sidebar-close { display: none !important; }

.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 4px 2px; scrollbar-width: thin; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: rgba(47,139,253,.22); border-radius: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  font-size: 13.5px; color: var(--ink-2);
  position: relative; transition: background .25s, color .25s, transform .25s;
}
.nav-ic { width: 20px; height: 20px; display: grid; place-items: center; color: var(--ink-3); transition: color .25s; }
.nav-ic svg { width: 18px; height: 18px; }
.nav-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: rgba(255,255,255,.75); transform: translateX(2px); }
.nav-item.active {
  background: linear-gradient(102deg, rgba(47,139,253,.14), rgba(255,255,255,.86));
  color: var(--ink); font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.9), 0 6px 16px rgba(47,139,253,.12);
}
.nav-item.active .nav-ic { color: var(--accent); }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 20%; bottom: 20%; width: 3px;
  border-radius: 3px; background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.nav-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  font-size: 11px; display: grid; place-items: center; font-weight: 600;
  box-shadow: 0 3px 8px rgba(47,139,253,.35);
}
.nav-badge.warn { background: linear-gradient(135deg,#ff9b52,#ff6f52); }
.side-foot { padding-top: 8px; border-top: 1px solid var(--line-soft); }
.side-note { font-size: 10.5px; color: var(--ink-3); text-align: center; padding: 10px 6px 2px; letter-spacing: .3px; }

/* ---------- 主区域 ---------- */
.main { margin-left: 268px; padding: 16px 22px 40px 0; min-height: 100vh; position: relative; z-index: 1; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px; margin-bottom: 18px;
  background: rgba(255,255,255,.55);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-sm);
  position: sticky; top: 12px; z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-title { font-size: 19px; font-weight: 700; margin: 0; letter-spacing: .4px; }
.page-crumb { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; letter-spacing: .3px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(255,255,255,.8);
  background: rgba(255,255,255,.6); color: var(--ink-2); display: grid; place-items: center; cursor: pointer;
  transition: .2s;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: #fff; color: var(--accent); transform: translateY(-1px); }
.nav-toggle { display: none; }

.ai-pill {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 8px;
  border-radius: 18px; cursor: pointer; font-size: 13px; font-weight: 600; color: #12487e;
  border: 1px solid rgba(255,255,255,.9);
  background: linear-gradient(120deg, rgba(255,255,255,.92), rgba(214,238,255,.9));
  box-shadow: 0 6px 18px rgba(47,139,253,.18);
  transition: .25s;
}
.ai-pill:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(47,139,253,.26); }
.ai-orb {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ffffff, #8fd8ff 32%, #2f8bfd 72%);
  box-shadow: 0 0 12px rgba(47,139,253,.55), inset 0 0 6px rgba(255,255,255,.7);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); box-shadow: 0 0 10px rgba(47,139,253,.45);} 50% { transform: scale(1.08); box-shadow: 0 0 18px rgba(47,139,253,.7);} }

.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; position: relative; padding: 4px 8px; border-radius: 14px; transition: background .2s; }
.user-chip:hover { background: rgba(255,255,255,.7); }
.avatar {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff;
  font-weight: 700; font-size: 15px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 12px rgba(47,139,253,.3);
}
.user-meta { line-height: 1.25; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 10.5px; color: var(--ink-3); }
.chev { font-size: 10px; color: var(--ink-3); }
.user-menu {
  position: absolute; right: 0; top: 52px; width: 262px; padding: 12px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(20px);
  border: 1px solid #fff; border-radius: 16px; box-shadow: var(--shadow);
  display: none; z-index: 40;
}
.user-menu.show { display: block; animation: fadeUp .22s ease both; }
.um-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 6px 6px; color: var(--ink-3); }
.um-row b { color: var(--ink-2); font-weight: 500; max-width: 165px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-link { display: block; margin-top: 8px; padding: 8px; text-align: center; border-radius: 10px; font-size: 12.5px; color: var(--accent); background: rgba(47,139,253,.08); }

.content { padding-right: 4px; }
.toasts { position: fixed; top: 86px; right: 26px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 11px 16px; border-radius: 12px; font-size: 13px; color: #0f3f6b;
  background: rgba(255,255,255,.94); border: 1px solid #fff; box-shadow: var(--shadow-sm);
  animation: fadeUp .3s ease both, fadeOut .4s ease 3.6s both; max-width: 420px;
}
.toast.error { color: #9c2b2b; border-left: 3px solid #ff7d7d; }
.toast.success { border-left: 3px solid var(--accent); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none;} }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-6px);} }

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 18px 20px;
  animation: fadeUp .45s ease both;
}
.card.strong { background: var(--glass-strong); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title h3 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.card-title h3 .dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 8px rgba(47,139,253,.5); }
.card-title .hint { font-size: 11.5px; color: var(--ink-3); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 11px; border: 1px solid rgba(255,255,255,.85);
  background: rgba(255,255,255,.75); color: var(--ink-2); font-size: 13px; cursor: pointer;
  transition: .2s; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(28,80,145,.12); }
.btn.primary {
  color: #fff; border-color: transparent;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px rgba(47, 139, 253, .32);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: rgba(255,255,255,.4); }
.btn.danger { color: #b23a3a; border-color: rgba(255,190,190,.7); background: rgba(255,240,240,.8); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 11px; font-size: 13px;
  border: 1px solid rgba(150,190,225,.35); background: rgba(255,255,255,.85); color: var(--ink);
  outline: none; transition: .2s;
}
.textarea { height: auto; min-height: 92px; padding: 10px 12px; line-height: 1.65; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(47, 139, 253, .5);
  box-shadow: 0 0 0 3px rgba(47, 139, 253, .12);
}
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 5px; letter-spacing: .3px; }
.field .req { color: #e26060; margin-left: 2px; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0,1fr)); }

.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px;
  font-size: 11px; font-weight: 600; letter-spacing: .2px; white-space: nowrap;
}
.badge.blue { background: rgba(47,139,253,.12); color: #1f6fce; }
.badge.cyan { background: rgba(60,200,230,.14); color: #12859c; }
.badge.green { background: rgba(52,190,130,.14); color: #1b8a5c; }
.badge.amber { background: rgba(255,170,60,.16); color: #b57613; }
.badge.red { background: rgba(255,110,110,.14); color: #bf3d3d; }
.badge.gray { background: rgba(125,149,174,.13); color: #5a7188; }
.badge.purple { background: rgba(150,120,240,.14); color: #6a4fc3; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: 14px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
thead th {
  text-align: left; padding: 11px 12px; font-size: 11.5px; font-weight: 600; color: var(--ink-3);
  letter-spacing: .5px; background: rgba(236,246,255,.75); white-space: nowrap;
}
thead th:first-child { border-radius: 11px 0 0 11px; }
thead th:last-child { border-radius: 0 11px 11px 0; }
tbody td { padding: 12px; border-bottom: 1px solid rgba(190,215,235,.22); color: var(--ink-2); vertical-align: middle; }
tbody tr { transition: background .2s; }
tbody tr:hover { background: rgba(255,255,255,.72); }
tbody tr:last-child td { border-bottom: none; }
td.strong { color: var(--ink); font-weight: 600; }
td.money { font-variant-numeric: tabular-nums; font-weight: 600; color: #1c6fb8; }
.row-actions { display: flex; gap: 6px; }
.empty { padding: 44px 12px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty .emo { font-size: 30px; display: block; margin-bottom: 10px; opacity: .5; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.search-box { position: relative; flex: 1; max-width: 320px; }
.search-box svg { position: absolute; left: 11px; top: 10px; width: 17px; height: 17px; color: var(--ink-3); }
.search-box .input { padding-left: 35px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; font-size: 12px; color: var(--ink-3); }
.pager a { padding: 5px 11px; border-radius: 9px; background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.9); }
.pager a.active { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(23,58,95,.18); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 24px;
}
.modal-mask.show { display: flex; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0;} to { opacity: 1;} }
.modal {
  width: 100%; max-width: 620px; max-height: 88vh; overflow-y: auto;
  background: rgba(255,255,255,.95); backdrop-filter: blur(24px);
  border: 1px solid #fff; border-radius: 20px; box-shadow: 0 26px 70px rgba(23,58,95,.24);
  padding: 20px 22px; animation: pop .3s cubic-bezier(.22,.9,.3,1) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98);} to { opacity: 1; transform: none;} }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- 工作台 ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 24px 26px;
  background: linear-gradient(120deg, rgba(255,255,255,.92), rgba(214,238,255,.72));
  border: 1px solid #fff; box-shadow: var(--shadow); margin-bottom: 16px;
  animation: fadeUp .5s ease both;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(120,200,255,.35), transparent 68%);
}
.hero-top { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.hero-logo { width: 54px; height: 54px; border-radius: 15px; overflow: hidden; background: #fff; box-shadow: 0 10px 24px rgba(47,139,253,.25); }
.hero-logo img { width: 100%; height: 100%; object-fit: cover; }
.hero-title { font-size: 22px; font-weight: 800; letter-spacing: .6px; margin: 0; }
.hero-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; letter-spacing: .4px; }
.hero-greet { margin-left: auto; font-size: 12.5px; color: var(--ink-2); text-align: right; line-height: 1.6; }
.hero-greet b { color: var(--ink); }

.stat {
  display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: 16px;
  background: linear-gradient(150deg, rgba(255,255,255,.92), rgba(232,245,255,.8));
  border: 1px solid #fff; box-shadow: 0 10px 26px rgba(28,80,145,.08);
  transition: .28s; position: relative; overflow: hidden;
}
.stat:hover { transform: translateY(-3px); box-shadow: 0 18px 34px rgba(28,80,145,.14); }
.stat::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: .8; }
.stat-label { font-size: 11.5px; color: var(--ink-3); letter-spacing: .4px; display: flex; align-items: center; gap: 6px; }
.stat-label svg { width: 14px; height: 14px; color: var(--accent); }
.stat-val { font-size: 25px; font-weight: 800; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.stat-val small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.stat-foot { font-size: 11px; color: var(--ink-3); }

.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.quick {
  display: flex; align-items: center; gap: 9px; padding: 12px 12px; border-radius: 13px;
  background: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.9); font-size: 12.5px;
  color: var(--ink-2); transition: .22s;
}
.quick:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(28,80,145,.12); color: var(--accent); }
.quick .qic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(47,139,253,.1); color: var(--accent); flex: none; }
.quick .qic svg { width: 16px; height: 16px; }

.pipeline-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12.5px; }
.pipeline-row .stage { width: 76px; color: var(--ink-2); flex: none; }
.pipeline-row .bar { flex: 1; height: 9px; border-radius: 9px; background: rgba(210,230,248,.5); overflow: hidden; }
.pipeline-row .bar span {
  display: block; height: 100%; border-radius: 9px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: grow 1s cubic-bezier(.22,.9,.3,1) both; transform-origin: left;
}
@keyframes grow { from { transform: scaleX(0);} to { transform: scaleX(1);} }
.pipeline-row .num { width: 96px; text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.task-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed rgba(180,210,235,.35); font-size: 13px; }
.task-item:last-child { border-bottom: none; }
.task-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.task-item .t { flex: 1; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-item .d { font-size: 11px; color: var(--ink-3); }

.ann-item { padding: 11px 0; border-bottom: 1px dashed rgba(180,210,235,.32); }
.ann-item:last-child { border-bottom: none; }
.ann-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.ann-body { font-size: 12px; color: var(--ink-3); margin-top: 5px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pin { font-size: 10px; color: #fff; background: linear-gradient(120deg,#ff9d5c,#ff6f6f); padding: 1px 6px; border-radius: 6px; }

.ai-panel { background: linear-gradient(140deg, rgba(238,249,255,.95), rgba(212,236,255,.85)); }
.ai-quick-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ai-chip, .ai-chip2 { padding: 6px 11px; border-radius: 11px; background: rgba(255,255,255,.8); font-size: 11.5px; color: var(--ink-2); cursor: pointer; border: 1px solid rgba(255,255,255,.9); transition: .2s; }
.ai-chip:hover, .ai-chip2:hover { color: var(--accent); transform: translateY(-1px); }
.ai-answer { margin-top: 10px; font-size: 12.5px; line-height: 1.8; color: var(--ink-2); background: rgba(255,255,255,.7); border-radius: 12px; padding: 10px 12px; min-height: 62px; white-space: pre-wrap; }

/* ---------- AI 抽屉 ---------- */
.ai-drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: 400px; max-width: 92vw; z-index: 55;
  background: rgba(252,254,255,.9); backdrop-filter: blur(26px) saturate(150%);
  border-left: 1px solid #fff; box-shadow: -20px 0 60px rgba(23,58,95,.18);
  transform: translateX(104%); transition: transform .34s cubic-bezier(.22,.9,.3,1);
  display: flex; flex-direction: column;
}
.ai-drawer.open { transform: none; }
.ai-mask { position: fixed; inset: 0; background: rgba(23,58,95,.12); backdrop-filter: blur(3px); z-index: 54; display: none; }
.ai-mask.show { display: block; animation: fade .2s both; }
.ai-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid rgba(180,210,235,.28); }
.ai-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
.ai-title small { font-size: 11px; color: var(--ink-3); font-weight: 400; }
.ai-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg {
  max-width: 88%; padding: 11px 13px; border-radius: 14px; font-size: 13px; line-height: 1.75;
  white-space: pre-wrap; word-break: break-word;
}
.ai-msg.bot { background: rgba(233,246,255,.95); color: var(--ink-2); border: 1px solid rgba(255,255,255,.9); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-msg.me { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; box-shadow: 0 8px 18px rgba(47,139,253,.25); }
.ai-msg.typing { color: var(--ink-3); font-style: italic; }
.ai-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid rgba(180,210,235,.28); }
.ai-input input { flex: 1; height: 38px; border-radius: 11px; border: 1px solid rgba(150,190,225,.4); padding: 0 12px; outline: none; background: #fff; font-size: 13px; }
.ai-input input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47,139,253,.12); }

/* ---------- 登录页 ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px; position: relative; z-index: 1; }
.auth-card {
  width: 100%; max-width: 420px; padding: 34px 32px 26px; border-radius: 26px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid #fff; box-shadow: 0 30px 80px rgba(23,58,95,.18);
  animation: authIn .6s cubic-bezier(.22,.9,.3,1) both; position: relative;
}
@keyframes authIn { from { opacity: 0; transform: translateY(22px) scale(.98);} to { opacity: 1; transform: none;} }
.auth-logo { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 14px 30px rgba(47,139,253,.25); position: relative; }
.auth-logo img { width: 100%; height: 100%; object-fit: cover; }
.auth-logo::after { content: ""; position: absolute; inset: 0; border-radius: 20px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.9); }
.auth-title { text-align: center; font-size: 24px; font-weight: 800; letter-spacing: 1px; margin: 0; }
.auth-sub { text-align: center; font-size: 11.5px; color: var(--ink-3); letter-spacing: 2px; margin: 6px 0 20px; text-transform: uppercase; }
.auth-slogan { text-align: center; font-size: 12.5px; color: var(--ink-2); margin: -6px 0 22px; letter-spacing: .4px; }
.auth-field { margin-bottom: 12px; }
.auth-field .input { height: 44px; border-radius: 13px; background: rgba(255,255,255,.92); }
.auth-btn { width: 100%; height: 44px; border-radius: 13px; border: none; color: #fff; font-size: 14.5px; font-weight: 600; letter-spacing: 2px; cursor: pointer;
  background: linear-gradient(120deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 26px rgba(47,139,253,.32); transition: .22s; margin-top: 6px; }
.auth-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.auth-err { background: rgba(255,235,235,.9); color: #b23a3a; font-size: 12.5px; padding: 9px 12px; border-radius: 10px; margin-bottom: 12px; }
.auth-foot { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 16px; line-height: 1.9; }
.auth-foot a { color: var(--accent); }
.tenant-badge { display: inline-flex; align-items: center; gap: 6px; margin: 0 auto 16px; padding: 5px 12px; border-radius: 12px; font-size: 11.5px; color: #1f6fce; background: rgba(47,139,253,.1); border: 1px solid rgba(47,139,253,.16); }
.auth-note { font-size: 11px; color: var(--ink-3); text-align: center; margin-top: 14px; letter-spacing: .3px; }

/* ---------- 列表 / 内部信 / 设置 ---------- */
.badge-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px dashed rgba(180,210,235,.3); }
.list-row:last-child { border-bottom: none; }
.mail-unread { font-weight: 700; color: var(--ink); position: relative; }
.mail-unread::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: middle; }
.mail-text { flex: 1; min-width: 0; }
.mail-sub { font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.mail-time { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.mail-body { font-size: 14px; line-height: 1.95; color: var(--ink-2); white-space: pre-wrap; padding: 8px 2px; }
.compose-row { display: flex; flex-wrap: wrap; gap: 8px; max-height: 180px; overflow-y: auto; padding: 6px 0; }

.tabs { display: flex; gap: 6px; padding: 5px; background: rgba(255,255,255,.5); border-radius: 13px; width: fit-content; margin-bottom: 16px; border: 1px solid rgba(255,255,255,.8); }
.tab { padding: 7px 16px; border-radius: 10px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; border: none; background: transparent; }
.tab.active { background: #fff; color: var(--accent); font-weight: 600; box-shadow: 0 4px 12px rgba(28,80,145,.1); }
.tab-panel { display: none; }
.tab-panel.show { display: block; animation: fadeUp .3s both; }

.swatch { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch label { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 11px; border: 1px solid rgba(255,255,255,.9); background: rgba(255,255,255,.72); font-size: 12px; cursor: pointer; }
.swatch label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(47,139,253,.16); }
.swatch .c { width: 14px; height: 14px; border-radius: 50%; }

.module-row { display: grid; grid-template-columns: 34px 1.2fr 1fr 70px 86px 1fr; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed rgba(180,210,235,.3); font-size: 12.5px; }
.module-row .mic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(47,139,253,.1); color: var(--accent); }
.module-row .mic svg { width: 16px; height: 16px; }
.module-row .mname { font-weight: 600; color: var(--ink); }
.module-row .mkey { font-size: 10.5px; color: var(--ink-3); }
.module-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; }
.switch { position: relative; width: 36px; height: 20px; border-radius: 10px; background: rgba(150,180,210,.35); transition: .2s; display: inline-block; }
.switch::after { content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%; background: #fff; top: 2.5px; left: 3px; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
input[type=checkbox].hidden-check { display: none; }
input[type=checkbox].hidden-check:checked + .switch { background: linear-gradient(120deg, var(--accent), var(--accent-2)); }
input[type=checkbox].hidden-check:checked + .switch::after { transform: translateX(15px); }

.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px; }
.perm-item { display: flex; align-items: center; gap: 7px; font-size: 12px; padding: 7px 9px; background: rgba(255,255,255,.6); border-radius: 9px; }
.perm-item input { accent-color: var(--accent); }

.progress { height: 6px; border-radius: 6px; background: rgba(210,230,248,.6); overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 6px; }

.alert { padding: 12px 14px; border-radius: 12px; font-size: 12.5px; line-height: 1.7; background: rgba(255,248,225,.8); border: 1px solid rgba(255,220,150,.5); color: #8a6412; }
.alert.blue { background: rgba(228,244,255,.85); border-color: rgba(160,210,255,.5); color: #1a5b96; }

.kv { display: flex; justify-content: space-between; font-size: 12.5px; padding: 7px 0; color: var(--ink-3); border-bottom: 1px dashed rgba(180,210,235,.24); }
.kv b { color: var(--ink-2); font-weight: 600; }

.code-link { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: #1f6fce; background: rgba(47,139,253,.08); padding: 5px 9px; border-radius: 8px; display: inline-block; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .quick-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .sidebar { animation: none; transform: translateX(-108%); transition: transform .3s; width: 250px; }
  .sidebar.open { transform: none; }
  .sidebar-close { display: grid !important; margin-left: auto; }
  .nav-mask { position: fixed; inset: 0; background: rgba(23,58,95,.18); backdrop-filter: blur(2px); z-index: 25; display: none; }
  .nav-mask.show { display: block; }
  .main { margin-left: 0; padding: 12px 14px 30px; }
  .nav-toggle { display: grid; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-row { grid-template-columns: 1fr; }
  .ai-drawer { width: 100%; }
  .hero-greet { display: none; }
  .user-meta { display: none; }
}
@media (max-width: 520px) {
  .quick-grid { grid-template-columns: 1fr; }
  .topbar { padding: 10px 12px; }
  .hero { padding: 18px; }
  .stat-val { font-size: 21px; }
}

/* ---------- 简体 / 繁体切换 ---------- */
.lang-switch { display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px;
  background: rgba(255,255,255,.62); border: 1px solid rgba(180,212,240,.5); backdrop-filter: blur(12px); }
.lang-switch a { display: grid; place-items: center; width: 26px; height: 24px; border-radius: 999px;
  font-size: 12px; color: var(--ink-3); text-decoration: none; transition: all .25s ease; }
.lang-switch a.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 6px 14px rgba(47,139,253,.28); }
.lang-switch a:hover { color: var(--ink-2); }
.lang-switch a.on:hover { color: #fff; }

/* ---------- 演示模式 ---------- */
.demo-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: 12px; color: #1a5b96; background: rgba(228,244,255,.85); border: 1px solid rgba(160,210,255,.55);
  white-space: nowrap; }
.demo-chip #demoClock { font-variant-numeric: tabular-nums; font-weight: 700; color: #1f6fce; }
.demo-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 0 3px rgba(47,139,253,.14);
  animation: dotPulse 2.2s ease-in-out infinite; }
@keyframes dotPulse { 0%,100% { box-shadow: 0 0 0 3px rgba(47,139,253,.14); } 50% { box-shadow: 0 0 0 6px rgba(47,139,253,.05); } }

.demo-box { margin-top: 16px; padding: 14px; border-radius: 14px;
  background: rgba(255,255,255,.6); border: 1px dashed rgba(150,196,240,.6); }
.demo-head { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.demo-desc { font-size: 11.5px; line-height: 1.75; color: var(--ink-3); margin: 8px 0 11px; }
.demo-btn { width: 100%; height: 40px; border-radius: 12px; border: 1px solid rgba(47,139,253,.35);
  background: rgba(47,139,253,.1); color: #1f6fce; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: all .25s ease; letter-spacing: .5px; }
.demo-btn:hover { background: rgba(47,139,253,.18); transform: translateY(-1px); }
.demo-cred { margin-top: 9px; font-size: 11px; color: var(--ink-3); text-align: center; }
.demo-cred b { color: #1f6fce; font-family: ui-monospace, Menlo, Consolas, monospace; }

@media (max-width: 900px) {
  .demo-label { display: none; }
  .demo-chip { padding: 5px 9px; font-size: 11.5px; }
  .lang-switch a { width: 24px; height: 22px; }
}
@media (max-width: 520px) {
  .topbar-right { gap: 6px; }
  .lang-switch a { width: 22px; }
}

.auth-lang { position: absolute; top: 14px; right: 16px; display: flex; align-items: center; gap: 3px;
  font-size: 11.5px; color: var(--ink-3); }
.auth-lang a { color: var(--ink-3); text-decoration: none; padding: 2px 6px; border-radius: 7px; transition: all .2s ease; }
.auth-lang a.on { color: #1f6fce; font-weight: 700; background: rgba(47,139,253,.1); }

/* ---------- 窄屏顶栏紧凑化（含演示计时 / 简繁切换时的空间） ---------- */
@media (max-width: 900px) {
  .page-crumb { display: none; }
  .topbar { padding: 9px 12px 9px 12px; }
  .topbar-right { gap: 7px; }
  .ai-pill { padding: 6px 10px; font-size: 12px; }
  .page-title { font-size: 17px; }
}

/* ---------- 窄屏表格：横向滚动而非挤压换行 ---------- */
@media (max-width: 900px) {
  table { min-width: 640px; }
  thead th, tbody td { white-space: nowrap; }
  tbody td { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
}
