/* ============ 基础样式 ============ */
:root {
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --primary-soft: #eef2ff;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --info: #0ea5e9;
  --info-soft: #f0f9ff;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --bg: #f4f6fb;
  --card: #ffffff;
  --radius: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .14);
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

/* ============ AI 直播助手 ============ */
.live-hero { padding: 26px; overflow: hidden; position: relative; }
.live-hero::after { content: ''; position: absolute; right: -70px; top: -90px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(99,102,241,.17), rgba(99,102,241,0) 68%); pointer-events: none; }
.live-hero-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; position: relative; z-index: 1; }
.live-eyebrow { color: #6366f1; font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.live-title-row { display: flex; align-items: center; gap: 11px; }
.live-title-row h2 { margin: 0; font-size: 25px; color: #172033; }
.live-hero-main p { margin: 8px 0 0; color: #64748b; font-size: 14px; }
.live-status-dot { width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; box-shadow: 0 0 0 5px rgba(203,213,225,.23); }
.live-status-dot.on { background: #10b981; box-shadow: 0 0 0 5px rgba(16,185,129,.14); animation: livePulse 1.8s infinite; }
.live-control-actions { display: flex; gap: 10px; }
@keyframes livePulse { 50% { box-shadow: 0 0 0 9px rgba(16,185,129,0); } }
.live-now-speaking { margin-top: 22px; padding: 18px 20px; border: 1px solid #e0e7ff; border-radius: 14px; background: linear-gradient(135deg,#f8faff,#f5f3ff); position: relative; z-index: 1; }
.live-now-head { display: flex; justify-content: space-between; align-items: center; color: #6366f1; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
#liveNowText { color: #334155; font-size: 15px; line-height: 1.75; min-height: 26px; }
.live-sound-wave { height: 18px; display: inline-flex; align-items: center; gap: 3px; }
.live-sound-wave i { display: block; width: 3px; height: 5px; border-radius: 3px; background: #a5b4fc; }
.live-sound-wave.active i { background: #6366f1; animation: liveWave .8s ease-in-out infinite alternate; }
.live-sound-wave.active i:nth-child(2) { animation-delay: .16s; }
.live-sound-wave.active i:nth-child(3) { animation-delay: .32s; }
.live-sound-wave.active i:nth-child(4) { animation-delay: .48s; }
@keyframes liveWave { to { height: 17px; } }
.live-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-top: 18px; }
.live-stats > div { padding: 13px 16px; border-radius: 12px; background: #f8fafc; display: flex; align-items: baseline; justify-content: space-between; }
.live-stats strong { font-size: 22px; color: #1e293b; }
.live-stats span { font-size: 12px; color: #94a3b8; }
.live-flow { margin-top: 20px; padding: 22px 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-head h3 { margin: 0 0 5px; font-size: 17px; color: #1e293b; }
.section-head p { margin: 0; color: #94a3b8; font-size: 12px; }
.live-flow-lane { display: grid; grid-template-columns: 90px minmax(120px,1fr) 28px minmax(120px,1fr) 28px minmax(120px,1fr) minmax(160px,1.25fr); align-items: center; gap: 10px; margin-top: 12px; }
.live-flow-lane b { font-size: 13px; }
.live-flow-lane span { text-align: center; padding: 13px 10px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.live-flow-lane i { text-align: center; font-style: normal; font-size: 20px; color: #94a3b8; }
.live-flow-lane em { font-style: normal; font-size: 12px; color: #64748b; padding-left: 8px; }
.main-lane b { color: #4f46e5; }
.main-lane span { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.comment-lane b { color: #047857; }
.comment-lane span { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.live-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.live-config-card { padding: 22px; }
.live-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.live-form-grid label, .live-webhook-label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; font-weight: 600; color: #475569; }
.live-form-grid .wide { grid-column: 1 / -1; }
.live-form-grid input:not([type="checkbox"]):not([type="range"]), .live-form-grid select, .live-form-grid textarea,
.live-config-card > textarea, .live-webhook-label input, .live-test-row input { width: 100%; border: 1px solid #dbe2ea; border-radius: 9px; background: #fff; padding: 10px 12px; color: #1e293b; font: inherit; font-size: 13px; outline: none; transition: .2s; }
.live-form-grid input:focus, .live-form-grid select:focus, .live-form-grid textarea:focus, .live-config-card > textarea:focus, .live-test-row input:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.live-form-grid textarea { resize: vertical; min-height: 75px; line-height: 1.55; }
.live-form-grid input[type="range"] { width: 100%; accent-color: #6366f1; }
.live-form-grid label > span b { float: right; color: #6366f1; }
.live-toggle-list { display: flex; gap: 18px; padding: 11px 13px; border: 1px solid #e2e8f0; border-radius: 9px; background: #f8fafc; }
.live-toggle-list label { flex-direction: row; align-items: center; gap: 7px; }
.live-toggle-list input { accent-color: #6366f1; }
.live-voice-preview-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px dashed #c7d2fe; border-radius: 9px; background: #f7f7ff; }
.live-voice-preview-row span { color: #64748b; font-size: 12px; font-weight: 500; }
.live-voice-preview-row .btn { flex: 0 0 auto; white-space: nowrap; }
.live-save-row { display: flex; justify-content: flex-end; margin-top: 16px; }
.live-save-row .btn { min-width: 160px; }
.live-tools-grid { grid-template-columns: 1.3fr .7fr; }
.live-webhook-label > div { display: flex; gap: 8px; }
.live-webhook-label input { background: #f8fafc; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: 11px; }
.live-test-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; margin-top: 16px; }
.live-config-card > textarea { resize: vertical; line-height: 1.6; margin-bottom: 10px; }
.live-events-card { margin-top: 20px; padding: 22px; }
.live-event-question { display: flex; flex-direction: column; max-width: 180px; gap: 3px; }
.live-event-question b { font-size: 12px; color: #475569; }
.live-event-question span { color: #64748b; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-event-script { max-width: 520px; color: #334155; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.live-event-script + small { display: block; margin-top: 4px; max-width: 480px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) {
  .live-grid { grid-template-columns: 1fr; }
  .live-flow-lane { grid-template-columns: 78px 1fr 20px 1fr 20px 1fr; }
  .live-flow-lane em { grid-column: 2 / -1; padding-left: 0; }
}
@media (max-width: 720px) {
  .live-hero-main { flex-direction: column; }
  .live-stats { grid-template-columns: 1fr 1fr; }
  .live-flow-lane { grid-template-columns: 1fr; }
  .live-flow-lane i { transform: rotate(90deg); }
  .live-form-grid { grid-template-columns: 1fr; }
  .live-form-grid .wide { grid-column: auto; }
  .live-test-row { grid-template-columns: 1fr; }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--slate-900);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--slate-200); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 登录页 ============ */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #0f172a;
  overflow: hidden;
  position: relative;
}

.login-bg { position: fixed; inset: 0; z-index: 0; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .45;
  animation: float 12s ease-in-out infinite;
}
.blob-1 { width: 480px; height: 480px; background: #6366f1; top: -10%; left: -8%; }
.blob-2 { width: 420px; height: 420px; background: #8b5cf6; bottom: -12%; right: -5%; animation-delay: -4s; }
.blob-3 { width: 320px; height: 320px; background: #0ea5e9; top: 40%; left: 55%; animation-delay: -8s; opacity: .3; }
.grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.06); }
  66% { transform: translate(-20px, 20px) scale(.96); }
}

.login-wrap { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 20px; }

.login-card {
  background: rgba(255, 255, 255, .98);
  border-radius: 24px;
  padding: 44px 40px 32px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
  backdrop-filter: blur(20px);
  animation: rise .6s cubic-bezier(.22, 1, .36, 1);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(28px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-brand { text-align: center; margin-bottom: 32px; }
.brand-logo {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: var(--gradient);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 28px rgba(99, 102, 241, .4);
}
.brand-logo svg { width: 34px; height: 34px; }
.brand-logo.small { width: 42px; height: 42px; border-radius: 12px; margin: 0; box-shadow: none; }
.brand-logo.small svg { width: 22px; height: 22px; }
.login-brand h1 { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.login-brand p { color: var(--slate-500); margin-top: 6px; font-size: 13px; }

.login-form .field { margin-bottom: 18px; }
.login-form label { display: block; font-size: 13px; font-weight: 600; color: var(--slate-700); margin-bottom: 8px; }
.input-wrap {
  position: relative;
  display: flex; align-items: center;
}
.input-wrap svg {
  position: absolute; left: 14px; width: 18px; height: 18px; color: var(--slate-400);
  pointer-events: none;
}
.input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid var(--slate-200);
  border-radius: 12px;
  font-size: 14px;
  transition: all .2s;
  background: #fafbfd;
  outline: none;
  color: var(--slate-900);
}
.input-wrap input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
}

.btn-login {
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  background: var(--gradient);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 4px;
  margin-top: 8px;
  transition: all .25s;
  box-shadow: 0 8px 24px rgba(99, 102, 241, .35);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(99, 102, 241, .45); }
.btn-login:active { transform: translateY(0); }
.btn-login.loading .btn-text { opacity: 0; }
.btn-login .btn-loading {
  position: absolute; inset: 0;
  display: none; align-items: center; justify-content: center;
}
.btn-login.loading .btn-loading { display: flex; }
.btn-loading svg { width: 22px; height: 22px; }

.login-tip {
  margin-top: 24px;
  padding: 12px;
  border-radius: 10px;
  background: var(--slate-100);
  color: var(--slate-500);
  font-size: 12px;
  text-align: center;
  display: flex; gap: 6px; justify-content: center; align-items: center;
  flex-wrap: wrap;
}
.login-tip code {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  padding: 1px 8px;
  font-family: ui-monospace, Consolas, monospace;
  color: var(--primary);
  font-size: 12px;
}

/* ============ 应用布局 ============ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 252px;
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}

.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 24px 20px 20px;
  white-space: nowrap;
  overflow: hidden;
}
.logo-text strong { display: block; font-size: 16px; color: #fff; letter-spacing: .3px; }
.logo-text span { font-size: 11px; color: var(--slate-400); letter-spacing: 1px; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 8px 14px; overflow-y: auto; }
.nav-caption {
  font-size: 11px; color: var(--slate-400);
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: 8px 12px 10px;
  margin-top: 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  color: #cbd5e1;
  margin-bottom: 4px;
  transition: all .2s;
  font-size: 14px;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, .35);
}
.nav-item.active svg { opacity: 1; }

.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.user-card {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .06);
}
.user-meta { flex: 1; min-width: 0; }
.user-meta strong { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 11px; color: var(--slate-400); }

.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600;
  flex-shrink: 0;
}

.main {
  flex: 1;
  margin-left: 252px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 64px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-200);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 17px; font-weight: 700; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topbar-date { color: var(--slate-500); font-size: 13px; }

.content { padding: 28px; flex: 1; }

.page-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 80px;
  color: var(--primary);
}
.spin { animation: spin 1s linear infinite; width: 28px; height: 28px; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--slate-500);
  transition: all .2s;
}
.icon-btn:hover { background: var(--slate-100); color: var(--slate-900); }
.icon-btn svg { width: 20px; height: 20px; }
.logout-btn:hover { background: rgba(239, 68, 68, .15); color: var(--danger); }
.menu-toggle { display: none; }
.sidebar-collapse-btn {
  position: absolute;
  top: 25px;
  right: -14px;
  z-index: 2;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: var(--slate-500);
  border: 1px solid var(--slate-200);
  box-shadow: 0 4px 12px rgba(15,23,42,.16);
  transition: color .2s, transform .25s ease;
}
.sidebar-collapse-btn:hover { color: var(--primary); }
.sidebar-collapse-btn svg { width: 16px; height: 16px; }

@media (min-width: 901px) {
  body.sidebar-collapsed .sidebar { width: 78px; }
  body.sidebar-collapsed .main { margin-left: 78px; }
  body.sidebar-collapsed .sidebar-logo { justify-content: center; padding-left: 10px; padding-right: 10px; }
  body.sidebar-collapsed .logo-text,
  body.sidebar-collapsed .nav-caption,
  body.sidebar-collapsed .nav-item span,
  body.sidebar-collapsed .user-meta { display: none; }
  body.sidebar-collapsed .sidebar-nav { padding-left: 10px; padding-right: 10px; }
  body.sidebar-collapsed .nav-item { justify-content: center; padding-left: 10px; padding-right: 10px; }
  body.sidebar-collapsed .sidebar-footer { padding: 10px; }
  body.sidebar-collapsed .user-card { flex-direction: column; gap: 5px; padding: 8px 5px; }
  body.sidebar-collapsed .sidebar-collapse-btn { transform: rotate(180deg); }
}

.sidebar-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
  z-index: 90; opacity: 0; pointer-events: none; transition: opacity .3s;
}

/* ============ 卡片 & 统计 ============ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(15, 23, 42, .04);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.stat-card {
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all .25s;
  border: 1px solid rgba(15, 23, 42, .04);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 26px; height: 26px; }
.stat-icon.indigo { background: var(--primary-soft); color: var(--primary); }
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.amber { background: var(--warning-soft); color: var(--warning); }
.stat-icon.sky { background: var(--info-soft); color: var(--info); }
.stat-meta { min-width: 0; }
.stat-meta .stat-label { font-size: 13px; color: var(--slate-500); }
.stat-meta .stat-value { font-size: 26px; font-weight: 700; line-height: 1.3; }
.stat-meta .stat-sub { font-size: 12px; color: var(--slate-400); }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-bottom: 24px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid rgba(15,23,42,.04); overflow: hidden; }
.panel-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--slate-100);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.panel-title { font-size: 15px; font-weight: 700; }
.panel-body { padding: 22px; }

/* 角色分布条 */
.dist-row { margin-bottom: 16px; }
.dist-row:last-child { margin-bottom: 0; }
.dist-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.dist-top span:first-child { color: var(--slate-700); font-weight: 500; }
.dist-top span:last-child { color: var(--slate-500); }
.dist-bar { height: 8px; background: var(--slate-100); border-radius: 8px; overflow: hidden; }
.dist-fill { height: 100%; border-radius: 8px; background: var(--gradient); transition: width .8s cubic-bezier(.22,1,.36,1); }

/* 最近动态 */
.recent-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--slate-100);
}
.recent-item:last-child { border-bottom: none; }
.recent-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  flex-shrink: 0;
}
.recent-info { flex: 1; min-width: 0; }
.recent-info .r-name { font-size: 13px; font-weight: 600; }
.recent-info .r-desc { font-size: 12px; color: var(--slate-400); }
.recent-time { font-size: 12px; color: var(--slate-400); flex-shrink: 0; }

/* ============ 表格 ============ */
.table-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid rgba(15,23,42,.04); }
.table-toolbar {
  padding: 18px 22px;
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--slate-100);
}
.table-toolbar h3 { font-size: 15px; font-weight: 700; flex: 1; }

.search-box { position: relative; }
.search-box svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--slate-400);
}
.search-box input {
  padding: 9px 12px 9px 36px;
  border: 1.5px solid var(--slate-200);
  border-radius: 10px;
  font-size: 13px;
  width: 230px;
  background: #fafbfd;
  outline: none;
  transition: all .2s;
}
.search-box input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  padding: 13px 22px;
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: #fafbfe;
  border-bottom: 1px solid var(--slate-100);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 22px;
  border-bottom: 1px solid var(--slate-100);
  font-size: 13.5px;
  vertical-align: middle;
}
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: #f8faff; }
.data-table tbody tr:last-child td { border-bottom: none; }

.cell-user { display: flex; align-items: center; gap: 12px; }
.cell-user .avatar { width: 36px; height: 36px; font-size: 13px; }
.cell-user .u-name { font-weight: 600; }
.cell-user .u-username { font-size: 12px; color: var(--slate-400); }

.table-empty { padding: 48px; text-align: center; color: var(--slate-400); font-size: 13px; }

/* 徽章 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.badge.dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.gray { background: var(--slate-100); color: var(--slate-500); }
.badge.indigo { background: var(--primary-soft); color: var(--primary); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.amber { background: var(--warning-soft); color: var(--warning); }
.badge.sky { background: var(--info-soft); color: var(--info); }
.badge.rose { background: #fff1f2; color: #e11d48; }

/* 行操作按钮 */
.row-actions { display: flex; gap: 6px; }
.btn-mini {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  transition: all .2s;
  display: inline-flex; align-items: center; gap: 4px;
}
.btn-mini svg { width: 14px; height: 14px; }
.btn-mini.primary { background: var(--primary-soft); color: var(--primary); }
.btn-mini.primary:hover { background: var(--primary); color: #fff; }
.btn-mini.green { background: var(--success-soft); color: var(--success); }
.btn-mini.green:hover { background: var(--success); color: #fff; }
.btn-mini.danger { background: var(--danger-soft); color: var(--danger); }
.btn-mini.danger:hover { background: var(--danger); color: #fff; }
.btn-mini.gray { background: var(--slate-100); color: var(--slate-600); }
.btn-mini.gray:hover { background: var(--slate-200); }
.btn-mini:disabled { opacity: .5; cursor: not-allowed; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  transition: all .2s;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 6px 18px rgba(99, 102, 241, .3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(99, 102, 241, .4); }
.btn-ghost { background: var(--slate-100); color: var(--slate-700); }
.btn-ghost:hover { background: var(--slate-200); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

/* ============ 表单 ============ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-field label { display: block; font-size: 13px; font-weight: 600; color: var(--slate-700); margin-bottom: 7px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: 10px;
  font-size: 13.5px;
  background: #fafbfd;
  outline: none;
  transition: all .2s;
  color: var(--slate-900);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
}
.form-field textarea { resize: vertical; min-height: 70px; }

.switch-wrap { display: flex; align-items: center; gap: 10px; margin-top: 28px; }
.switch {
  position: relative;
  width: 42px; height: 24px;
  border-radius: 999px;
  background: var(--slate-200);
  transition: background .2s;
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  transition: transform .2s;
}
.switch.on { background: var(--success); }
.switch.on::after { transform: translateX(18px); }

/* ============ 模态框 ============ */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn .3s cubic-bezier(.22, 1, .36, 1);
  overflow: hidden;
}
.modal.wide { max-width: 640px; }
.modal.narrow { max-width: 400px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
  padding: 20px 24px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--slate-400);
  transition: all .2s;
}
.modal-close:hover { background: var(--slate-100); color: var(--slate-900); }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-foot {
  padding: 16px 24px 20px;
  display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--slate-100);
}

/* 权限树 */
.perm-group { margin-bottom: 18px; }
.perm-group:last-child { margin-bottom: 0; }
.perm-group-title {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 13.5px;
  color: var(--slate-700);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--slate-100);
}
.perm-group-title .p-count { font-size: 11px; color: var(--slate-400); font-weight: 500; }
.perm-check-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.perm-check {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  border: 1.5px solid var(--slate-200);
  border-radius: 10px;
  cursor: pointer;
  transition: all .18s;
  user-select: none;
}
.perm-check:hover { border-color: var(--primary); background: var(--primary-soft); }
.perm-check input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }
.perm-check .p-name { font-size: 13px; font-weight: 500; }
.perm-check .p-desc { font-size: 11px; color: var(--slate-400); display: block; }
.perm-check.checked { border-color: var(--primary); background: var(--primary-soft); }

/* 权限分配页 */
.perm-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
@media (max-width: 900px) { .perm-layout { grid-template-columns: 1fr; } }
.role-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all .2s;
  border: 1.5px solid transparent;
}
.role-list-item:hover { background: var(--slate-100); }
.role-list-item.active {
  background: var(--primary-soft);
  border-color: var(--primary);
}
.role-list-item .r-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
  flex-shrink: 0;
}
.role-list-item.active .r-icon { background: var(--gradient); color: #fff; }
.role-list-item .r-icon svg { width: 20px; height: 20px; }
.role-list-item .r-meta { flex: 1; min-width: 0; }
.role-list-item .r-name { font-weight: 600; font-size: 13.5px; }
.role-list-item .r-count { font-size: 12px; color: var(--slate-400); }

/* ============ Toast ============ */
#toastContainer {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  border-radius: 12px;
  padding: 13px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  min-width: 260px;
  max-width: 380px;
  animation: toastIn .35s cubic-bezier(.22, 1, .36, 1);
  border-left: 4px solid var(--primary);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

/* 线下订单开单 */
.offline-order-form { display: flex; flex-direction: column; gap: 18px; }
.offline-order-section { border: 1px solid #e8edf5; border-radius: 12px; padding: 16px; background: #fff; }
.offline-order-section-title { font-size: 14px; font-weight: 700; color: #1e293b; margin-bottom: 13px; }
.offline-order-section-title-row { display: flex; align-items: center; justify-content: space-between; }
.offline-order-section label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; font-weight: 600; color: #475569; }
.offline-order-section input:not([type="checkbox"]), .offline-order-section select, .offline-order-section textarea { width: 100%; border: 1px solid #dbe2ea; border-radius: 9px; background: #fff; padding: 9px 11px; color: #1e293b; font: inherit; font-size: 13px; outline: none; }
.offline-order-section input:focus, .offline-order-section select:focus, .offline-order-section textarea:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.offline-items-wrap { max-height: 280px; overflow: auto; }
.offline-items-table { min-width: 760px; }
.offline-items-table th, .offline-items-table td { padding: 8px; }
.offline-items-table .input-mini { min-width: 84px; padding: 7px 8px; }
.offline-unit-quantity { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 36px; border-radius: 9px; background: #eef2ff; color: #4338ca; font-weight: 700; }
.offline-item-name { min-width: 120px !important; }
.offline-image-picker { width: 46px; height: 40px; border: 1px dashed #a5b4fc; border-radius: 7px; display: grid !important; place-items: center; cursor: pointer; color: #6366f1; font-size: 11px !important; font-weight: 500 !important; overflow: hidden; }
.offline-image-picker img { width: 100%; height: 100%; object-fit: cover; }
.offline-image-tip { margin-top: 8px; font-size: 12px; }
.offline-print-toggle { flex-direction: row !important; align-items: center; gap: 8px !important; font-size: 13px !important; }
.offline-order-total { display: flex; justify-content: flex-end; gap: 28px; margin-top: 13px; color: #64748b; font-size: 13px; }
.offline-order-total b { color: #4f46e5; font-size: 17px; margin-left: 5px; }
.offline-catalog-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.offline-catalog-choice { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 6px !important; padding: 7px 10px; border: 1px solid #dbe2ea; border-radius: 8px; background: #f8fafc; cursor: pointer; font-size: 12px !important; font-weight: 600 !important; }
.offline-catalog-choice:has(input:checked) { border-color: #818cf8; background: #eef2ff; color: #4338ca; }
.offline-catalog-choice em { font-style: normal; color: #6366f1; font-weight: 700; }
.offline-member-suggestions { position: relative; z-index: 3; display: flex; flex-direction: column; gap: 3px; margin-top: 3px; }
.offline-member-suggestion { text-align: left; padding: 6px 8px; border-radius: 6px; background: #f8fafc; color: #475569; font-size: 12px; }
.offline-member-suggestion:hover { background: #eef2ff; color: #4338ca; }
.offline-member-suggestion span { float: right; color: #94a3b8; }
.toast .t-icon { width: 22px; height: 22px; flex-shrink: 0; }
.toast.out { animation: toastOut .3s forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(40px); }
}

/* ============ 通用工具 ============ */
.empty-state { text-align: center; padding: 40px 20px; color: var(--slate-400); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: .4; }
.empty-state p { font-size: 13px; }

.avatar.soft-indigo { background: var(--primary-soft); color: var(--primary); }
.avatar.soft-green { background: var(--success-soft); color: var(--success); }
.avatar.soft-amber { background: var(--warning-soft); color: var(--warning); }
.avatar.soft-sky { background: var(--info-soft); color: var(--info); }
.avatar.soft-rose { background: var(--danger-soft); color: var(--danger); }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.permission-tags { display: flex; flex-wrap: wrap; gap: 4px; max-width: 320px; }

.section-gap { margin-bottom: 24px; }
.muted { color: var(--slate-400); }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,.3); }
  .sidebar-mask.show { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .menu-toggle { display: flex; }
  .content { padding: 18px; }
  .topbar { padding: 0 18px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .sidebar-collapse-btn { display: none; }
}

/* ============ 订单监控 ============ */
.monitor-panel {
  padding: 24px 28px;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #312e81 100%);
  color: #fff;
  border: none;
  position: relative;
  overflow: hidden;
}
.monitor-panel::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(139,92,246,.25) 0%, transparent 70%);
  pointer-events: none;
}
.monitor-main { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; position: relative; }
.monitor-title { display: flex; align-items: center; gap: 10px; }
.monitor-title h3 { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.monitor-pulse { width: 12px; height: 12px; border-radius: 50%; position: relative; flex-shrink: 0; }
.monitor-pulse.on { background: #34d399; }
.monitor-pulse.on::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid rgba(52,211,153,.6); animation: pulse-ring 1.6s ease-out infinite;
}
.monitor-pulse.off { background: #64748b; }
@keyframes pulse-ring {
  0% { transform: scale(.5); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}
.monitor-meta { margin-top: 6px; font-size: 13px; color: #c7d2fe; max-width: 560px; }
.monitor-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.switch-wrap { display: flex; align-items: center; gap: 10px; }
.switch-label { font-size: 13px; color: #c7d2fe; }
.switch { position: relative; display: inline-block; width: 52px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(255,255,255,.18); border-radius: 28px;
  transition: background .3s;
}
.switch .slider::before {
  content: ''; position: absolute; height: 22px; width: 22px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.switch input:checked + .slider { background: linear-gradient(135deg, #34d399 0%, #10b981 100%); }
.switch input:checked + .slider::before { transform: translateX(24px); }
.switch input:disabled + .slider { opacity: .6; cursor: not-allowed; }
.sync-countdown {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 20px;
  background: rgba(255,255,255,.1); backdrop-filter: blur(6px);
  font-size: 13px; color: #c7d2fe;
  border: 1px solid rgba(255,255,255,.12);
}
.sync-countdown svg { width: 15px; height: 15px; }
.sync-countdown span { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 34px; }
.monitor-panel .btn-primary { box-shadow: 0 4px 14px rgba(99,102,241,.4); }
.monitor-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px; margin-top: 22px; position: relative;
}
.m-stat {
  background: rgba(255,255,255,.07); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.1); border-radius: 12px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
}
.m-num { font-size: 22px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.m-label { font-size: 12px; color: #a5b4fc; }
.monitor-panel .text-success { color: #6ee7b7; }
.monitor-panel .text-danger { color: #fda4af; }
.monitor-panel .text-muted { color: #a5b4fc; }

/* 短信通知节点 */
.sms-page { display: flex; flex-direction: column; gap: 18px; }
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-head-row h2 { font-size: 22px; margin-bottom: 5px; }
.sms-provider-card { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.sms-provider-main { display: flex; align-items: center; gap: 15px; }
.sms-provider-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 auto; color: white; font-size: 18px; font-weight: 800; background: linear-gradient(135deg,#1677ff,#60a5fa); box-shadow: 0 8px 18px rgba(22,119,255,.23); }
.sms-provider-main p { color: #334155; margin: 6px 0 4px; font-size: 14px; }
.sms-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sms-title-row h3 { font-size: 17px; }
.sms-node-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(520px,1fr)); gap: 18px; }
.sms-node-card { padding: 22px; }
.sms-node-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.sms-node-head p { margin-top: 7px; }
.sms-node-flow { margin: 20px 0; padding: 16px; border-radius: 12px; background: #f8fafc; border: 1px solid #e8edf5; display: flex; align-items: stretch; gap: 12px; }
.sms-node-flow > div:not(.sms-flow-arrow) { flex: 1; min-width: 0; }
.sms-node-flow span { display: block; color: #64748b; font-size: 12px; margin-bottom: 6px; }
.sms-node-flow strong { display: block; color: #1e293b; font-size: 13px; line-height: 1.5; }
.sms-node-flow small { display: block; margin-top: 5px; }
.sms-flow-arrow { display: grid; place-items: center; color: #94a3b8; font-size: 20px; }
.sms-variable { display: inline-block !important; color: #4f46e5 !important; background: #eef2ff; padding: 2px 6px; border-radius: 5px; margin: 2px 2px 0 0 !important; font-family: ui-monospace,SFMono-Regular,Menlo,monospace; }
.sms-stats-grid { display: grid; grid-template-columns: repeat(6,1fr); border: 1px solid #e8edf5; border-radius: 12px; overflow: hidden; }
.sms-stats-grid > div { padding: 13px 8px; text-align: center; border-right: 1px solid #e8edf5; background: white; }
.sms-stats-grid > div:last-child { border-right: 0; }
.sms-stats-grid strong { display: block; font-size: 20px; color: #1e293b; }
.sms-stats-grid span { display: block; color: #64748b; font-size: 12px; margin-top: 4px; }
.sms-node-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.sms-log-card { overflow: hidden; }
.sms-log-card .card-head { padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eef2f7; }
.sms-log-card .card-head h3 { margin-bottom: 4px; }
.sms-log-message { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #64748b; }
.sms-config-note { padding: 12px 14px; margin-bottom: 18px; border-radius: 9px; background: #eff6ff; color: #1e40af; font-size: 13px; line-height: 1.7; }
.sms-enable-line { display: flex; align-items: center; gap: 8px; margin-top: 16px; color: #334155; font-size: 14px; }
.sms-enable-line input { width: 16px; height: 16px; }
.sms-lookup-result { margin-top: 14px; padding: 12px 14px; border-radius: 9px; color: #64748b; background: #f8fafc; border: 1px dashed #cbd5e1; }
.sms-lookup-result.ok { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.sms-lookup-result.error { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.sms-lookup-result strong,.sms-lookup-result span { display: block; }
.sms-lookup-result span { margin-top: 4px; font-size: 13px; }

@media (max-width: 900px) {
  .sms-node-list { grid-template-columns: 1fr; }
  .sms-node-flow { flex-direction: column; }
  .sms-flow-arrow { transform: rotate(90deg); }
  .sms-stats-grid { grid-template-columns: repeat(3,1fr); }
  .sms-stats-grid > div:nth-child(3) { border-right: 0; }
  .sms-provider-card,.page-head-row { align-items: flex-start; flex-direction: column; }
}

/* ===== 订单趋势分析 ===== */
.order-analytics {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}
.analytics-card {
  padding: 22px 24px 20px;
  background: var(--card);
  border: 1px solid rgba(15,23,42,.05);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.analytics-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.analytics-head h3 { font-size: 16px; font-weight: 700; color: var(--slate-800); }
.analytics-head p { margin-top: 4px; font-size: 12px; color: var(--slate-400); }
.analytics-head-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.analytics-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
}
.analytics-switch button {
  padding: 6px 13px;
  border-radius: 7px;
  color: var(--slate-500);
  font-size: 12px;
  font-weight: 600;
  transition: background .2s, color .2s, box-shadow .2s;
}
.analytics-switch button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 7px rgba(15,23,42,.1);
}
.analytics-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.analytics-summary span {
  padding: 6px 10px;
  border-radius: 9px;
  background: #f8fafc;
  border: 1px solid var(--slate-100);
  color: var(--slate-500);
  font-size: 12px;
  white-space: nowrap;
}
.analytics-summary strong { margin-left: 3px; color: var(--slate-800); font-size: 14px; }
.analytics-timezone {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.analytics-loading { min-height: 170px; display: flex; align-items: center; justify-content: center; color: var(--slate-400); font-size: 13px; }
.analytics-loading.error { color: var(--danger); }

.daily-orders-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(var(--daily-group-min-width, 82px), 1fr));
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 6px;
}
.daily-order-item { min-width: var(--daily-group-min-width, 82px); text-align: center; }
.daily-order-count { height: 24px; color: var(--slate-700); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.daily-bar-stage {
  height: 150px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid var(--slate-200);
  background: repeating-linear-gradient(to top, transparent 0, transparent 36px, rgba(226,232,240,.65) 37px);
}
.daily-multi-bars {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding: 0 5px;
}
.daily-group-bar {
  flex: 1 1 0;
  max-width: 18px;
  min-width: 3px;
  border-radius: 5px 5px 2px 2px;
  box-shadow: 0 3px 8px rgba(15,23,42,.12);
  transition: height .3s ease;
}
.daily-group-bar:not(.zero) { min-height: 3px; }
.daily-group-bar.zero { box-shadow: none; opacity: .22; }
.daily-order-item.today .daily-bar-stage { background-color: rgba(16,185,129,.045); border-bottom-color: #6ee7b7; }
.daily-order-item.today .daily-order-count { color: #059669; }
.daily-order-date { margin-top: 9px; color: var(--slate-700); font-size: 12px; font-weight: 600; }
.daily-order-weekday { margin-top: 2px; min-height: 18px; color: var(--slate-400); font-size: 11px; white-space: nowrap; }
.daily-order-item.today .daily-order-weekday { color: #059669; font-weight: 600; }
.day-change { display: inline-flex; margin-top: 5px; padding: 2px 6px; border-radius: 999px; font-size: 10px; font-weight: 600; }
.day-change.up { background: #ecfdf5; color: #059669; }
.day-change.down { background: #fff1f2; color: #e11d48; }
.day-change.stable { background: var(--slate-100); color: var(--slate-500); }
.daily-breakdown-legend {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--slate-100);
}
.daily-legend-item { display: inline-flex; align-items: center; gap: 5px; color: var(--slate-500); font-size: 11px; }
.daily-legend-item i { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.daily-legend-item strong { color: var(--slate-700); font-variant-numeric: tabular-nums; }

.hourly-legend { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 8px; }
.hourly-legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--slate-500); font-size: 11px; }
.hourly-legend-item i { width: 18px; height: 3px; border-radius: 3px; }
.hourly-legend-item.today { color: var(--slate-800); font-weight: 700; }
.hourly-chart-scroll { width: 100%; overflow-x: auto; }
.hourly-chart-svg { display: block; width: 100%; min-width: 820px; height: auto; overflow: visible; }
.chart-grid-line { stroke: #e2e8f0; stroke-width: 1; }
.chart-grid-line.vertical { stroke-dasharray: 3 6; opacity: .7; }
.chart-axis-label { fill: #94a3b8; font-size: 10px; }
.chart-axis-label.y { font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .analytics-card { padding: 18px 16px; }
  .analytics-head { flex-direction: column; margin-bottom: 14px; }
  .analytics-head-actions { align-items: flex-start; width: 100%; }
  .analytics-summary { justify-content: flex-start; }
  .daily-orders-chart { grid-template-columns: repeat(7, minmax(var(--daily-group-min-width, 82px), 1fr)); }
  .daily-bar-stage { height: 130px; }
}

.order-code { font-family: 'SF Mono', Consolas, monospace; font-size: 12.5px; color: var(--slate-700); letter-spacing: .3px; }
.pkg-name {
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; color: var(--slate-700);
}
.brand-name {
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; color: var(--slate-700); font-weight: 500;
}
.brand-merchant-cell { min-width: 150px; max-width: 190px; }
.merchant-name {
  max-width: 190px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--slate-400);
  font-size: 11px;
}
.money { color: #f59e0b; font-weight: 600; font-variant-numeric: tabular-nums; }
.src-tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: var(--slate-100); color: var(--slate-500); font-size: 12px;
}
.customer-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.customer-tag.new { background: #dcfce7; color: #15803d; }
.customer-tag.returning { background: #dbeafe; color: #1d4ed8; }
.customer-tag.loyal { background: #f3e8ff; color: #7e22ce; }
.customer-repeat-dot {
  position: absolute;
  top: -7px;
  right: -7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}
.customer-tag.new .customer-repeat-dot { background: #16a34a; }
.customer-tag.returning .customer-repeat-dot { background: #2563eb; }
.customer-tag.loyal .customer-repeat-dot { background: #9333ea; }
.badge.violet { background: #f5f3ff; color: #8b5cf6; }
.badge.cyan { background: #ecfeff; color: #06b6d4; }

.select-mini {
  padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--slate-200);
  background: #fff; font-size: 13px; color: var(--slate-700); outline: none;
  cursor: pointer; transition: border-color .2s;
}
.select-mini:focus { border-color: var(--primary); }

.pagination { display: flex; align-items: center; gap: 6px; padding: 16px 20px; flex-wrap: wrap; }
.page-info { font-size: 13px; color: var(--slate-400); margin-right: auto; }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 10px; border-radius: 8px;
  background: #fff; border: 1px solid var(--slate-200); color: var(--slate-700);
  font-size: 13px; transition: all .2s;
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--gradient); color: #fff; border-color: transparent; font-weight: 600; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-dots { color: var(--slate-400); padding: 0 2px; }

.order-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.detail-section h4 {
  font-size: 13px; color: var(--primary); font-weight: 600;
  margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--slate-100);
}
.detail-row { display: flex; gap: 16px; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--slate-100); }
.detail-row:last-child { border-bottom: none; }
.detail-k { width: 84px; flex-shrink: 0; color: var(--slate-400); }
.detail-v { color: var(--slate-700); word-break: break-all; }
.detail-v.money { color: #f59e0b; font-weight: 600; }
@media (max-width: 720px) { .order-detail-grid { grid-template-columns: 1fr; } }

/* ===== 状态探测条 ===== */
.probe-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 16px; padding: 14px 18px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0; border-radius: 14px;
}
.probe-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.probe-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--slate-300); }
.probe-dot.on { background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.18); }
.probe-dot.off { background: var(--slate-300); }
.probe-title { font-size: 14px; font-weight: 600; color: var(--slate-800); }
.probe-meta { font-size: 12px; color: var(--slate-500); margin-top: 2px; line-height: 1.4; }
.probe-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

/* 迷你开关 */
.switch.mini { width: 42px; height: 24px; }
.switch.mini .slider::before { width: 16px; height: 16px; }
.switch.mini input:checked + .slider::before { transform: translateX(18px); }

/* ===== 高级搜索 ===== */
.adv-search {
  padding: 16px 18px; border-top: 1px dashed var(--slate-200);
  background: var(--slate-50); border-radius: 0 0 12px 12px;
}
.adv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.adv-row + .adv-row { margin-top: 12px; }
.adv-row label { font-size: 13px; color: var(--slate-500); }
.input-mini {
  height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--slate-200);
  font-size: 13px; color: var(--slate-700); background: #fff; min-width: 130px;
}
.input-mini:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }

/* 小按钮 */
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 8px; }
.btn-ghost.btn-sm { background: #fff; border: 1px solid var(--slate-200); color: var(--slate-600); }
.btn-ghost.btn-sm:hover { border-color: var(--primary); color: var(--primary); }

/* ============ 直播资源中心 ============ */
.content-center-page { display: flex; flex-direction: column; gap: 18px; }
.content-hero {
  position: relative; overflow: hidden; padding: 27px 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: linear-gradient(135deg,#10182d 0%,#253579 56%,#0e7490 100%); color: #fff;
}
.content-hero::after { content: ''; position: absolute; width: 320px; height: 320px; right: -70px; top: -160px; border-radius: 50%; background: radial-gradient(circle,rgba(103,232,249,.34),transparent 68%); }
.content-hero > * { position: relative; z-index: 1; }
.content-eyebrow { color: #a5f3fc; letter-spacing: .16em; font-size: 11px; font-weight: 800; margin-bottom: 6px; }
.content-hero h2 { font-size: 25px; margin-bottom: 5px; }
.content-hero p { color: #cbd5e1; font-size: 13px; }
.content-summary { display: grid; grid-template-columns: repeat(5,minmax(130px,1fr)); gap: 14px; }
.content-stat { padding: 17px 18px; border: 1px solid rgba(15,23,42,.05); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.content-stat span { display: block; color: var(--slate-500); font-size: 12px; }
.content-stat strong { display: block; margin: 4px 0 1px; color: var(--slate-900); font-size: 25px; line-height: 1.3; }
.content-stat small { color: var(--slate-400); font-size: 11px; }
.content-tabs { padding: 5px; display: flex; align-items: center; gap: 4px; width: max-content; max-width: 100%; overflow-x: auto; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; }
.content-tabs button { padding: 8px 15px; border-radius: 8px; color: var(--slate-500); font-size: 13px; white-space: nowrap; transition: .2s; }
.content-tabs button:hover { color: var(--primary); background: var(--primary-soft); }
.content-tabs button.active { color: #fff; background: var(--gradient); box-shadow: 0 5px 14px rgba(99,102,241,.25); }
.content-loading { min-height: 160px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--slate-400); }
.content-loading svg { width: 28px; height: 28px; }
.content-toolbar { padding: 19px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.content-toolbar h3 { font-size: 17px; color: var(--slate-900); }
.content-toolbar p { color: var(--slate-400); font-size: 12px; margin-top: 3px; }
.content-toolbar-actions { display: flex; align-items: center; gap: 10px; }
.content-toolbar .search-box { display: flex; }
.content-toolbar .search-box input { width: 250px; padding-left: 12px; border-radius: 9px 0 0 9px; }
.content-toolbar .search-box button { padding: 0 13px; border: 1.5px solid var(--slate-200); border-left: 0; border-radius: 0 9px 9px 0; color: var(--slate-600); background: #f8fafc; }
.content-empty { grid-column: 1 / -1; padding: 65px 20px; text-align: center; color: var(--slate-400); }
.content-empty.error { color: var(--danger); }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(225px,1fr)); gap: 16px; }
.asset-card { overflow: hidden; min-width: 0; transition: transform .2s,box-shadow .2s; }
.asset-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.asset-preview { height: 168px; position: relative; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg,#eef2ff,#e0f2fe); }
.asset-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.asset-card:hover .asset-preview img { transform: scale(1.035); }
.asset-type { position: absolute; left: 9px; top: 9px; padding: 3px 8px; border-radius: 999px; color: #fff; background: rgba(15,23,42,.72); font-size: 10px; text-transform: uppercase; backdrop-filter: blur(5px); }
.asset-file-icon { width: 78px; height: 78px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 20px; color: #fff; background: linear-gradient(135deg,#6366f1,#8b5cf6); box-shadow: 0 12px 28px rgba(99,102,241,.25); }
.asset-file-icon.video { background: linear-gradient(135deg,#0f766e,#22c55e); }
.asset-file-icon.audio { background: linear-gradient(135deg,#c2410c,#f59e0b); }
.asset-file-icon span { font-size: 21px; font-weight: 800; }
.asset-file-icon small { margin-top: 4px; font-size: 10px; opacity: .8; }
.asset-card-body { padding: 15px 16px 13px; }
.asset-card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asset-card-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--slate-900); }
.asset-card-title .badge { flex: 0 0 auto; padding: 2px 7px; font-size: 10px; }
.asset-card-body > p { margin-top: 7px; color: var(--slate-400); font-size: 11px; }
.asset-tags { min-height: 25px; display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.asset-tags span { padding: 2px 7px; border-radius: 6px; color: #4f46e5; background: #eef2ff; font-size: 10px; }
.asset-card-actions,.template-actions,.room-actions,.knowledge-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--slate-100); }
.asset-card-actions button,.template-actions button,.room-actions button,.knowledge-actions button { padding: 5px 8px; border-radius: 6px; color: var(--slate-500); background: #f8fafc; font-size: 11px; }
.asset-card-actions button:hover,.template-actions button:hover,.room-actions button:hover,.knowledge-actions button:hover { color: var(--primary); background: var(--primary-soft); }
.asset-card-actions button.danger,.template-actions button.danger,.room-actions button.danger,.knowledge-actions button.danger { color: var(--danger); }
.room-actions button.primary { color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.asset-upload-drop { position: relative; margin-bottom: 18px; padding: 28px; display: flex; flex-direction: column; align-items: center; border: 1.5px dashed #a5b4fc; border-radius: 14px; background: #f7f7ff; text-align: center; }
.asset-upload-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.asset-upload-drop strong { color: #4338ca; font-size: 15px; }
.asset-upload-drop span { color: var(--slate-400); font-size: 11px; margin-top: 5px; }

.content-form-grid .form-group { min-width: 0; }
.content-form-grid .form-group > label,.template-code-field > label { display: block; margin-bottom: 6px; color: var(--slate-700); font-size: 12px; font-weight: 700; }
.content-form-grid input,.content-form-grid select,.content-form-grid textarea,.template-code-field textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--slate-200); border-radius: 9px; color: var(--slate-900); background: #fafbfd; font-size: 13px; outline: none; resize: vertical; }
.content-form-grid input:focus,.content-form-grid select:focus,.content-form-grid textarea:focus,.template-code-field textarea:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }

.template-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 16px; }
.template-card { overflow: hidden; }
.template-cover { height: 170px; position: relative; display: grid; place-items: center; background: linear-gradient(135deg,#111827,#312e81 60%,#0e7490); background-size: cover; background-position: center; }
.template-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top,rgba(15,23,42,.45),transparent 55%); }
.template-code-mark { color: rgba(255,255,255,.8); font: 800 34px ui-monospace,Consolas,monospace; }
.template-cover > span { position: absolute; z-index: 1; right: 10px; bottom: 9px; color: #fff; font-size: 10px; }
.template-card-body { padding: 16px; }
.template-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.template-title strong { font-size: 15px; }
.template-card-body > p { min-height: 39px; margin-top: 7px; color: var(--slate-500); font-size: 12px; line-height: 1.6; }
.template-card-body > small { display: block; margin-top: 8px; color: var(--slate-400); }
.modal.content-modal { max-width: 1080px; }
.template-editor-grid { display: grid; grid-template-columns: 300px 1fr; gap: 18px; }
.template-code-field { display: flex; flex-direction: column; min-width: 0; }
.template-code-field textarea { min-height: 470px; resize: vertical; color: #dbeafe; background: #0f172a; border-color: #1e293b; font: 12px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace; tab-size: 2; }
.template-code-field textarea:focus { color: #e2e8f0; background: #0f172a; }
.template-code-field small { margin-top: 6px; color: var(--slate-400); font-size: 10px; }

.knowledge-list { display: flex; flex-direction: column; gap: 12px; }
.knowledge-card { padding: 17px 18px; display: grid; grid-template-columns: 92px 1fr auto; gap: 17px; align-items: center; }
.knowledge-kind { padding: 10px 8px; border-radius: 10px; color: #4f46e5; background: #eef2ff; text-align: center; font-size: 11px; font-weight: 700; }
.knowledge-main { min-width: 0; }
.knowledge-main h4 { font-size: 14px; }
.knowledge-main p { margin-top: 4px; color: var(--slate-500); font-size: 12px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.knowledge-meta { margin-top: 8px; display: flex; align-items: center; gap: 10px; color: var(--slate-400); font-size: 11px; }
.knowledge-meta .badge { padding: 2px 7px; font-size: 10px; }
.knowledge-actions { margin: 0; padding: 0; border: 0; }

.room-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(320px,1fr)); gap: 16px; }
.room-card { padding: 19px; border-top: 3px solid #6366f1; }
.room-card-top { display: grid; grid-template-columns: 45px 1fr auto; gap: 11px; align-items: center; }
.room-avatar { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(135deg,#6366f1,#0891b2); font-size: 10px; font-weight: 900; letter-spacing: .08em; box-shadow: 0 8px 18px rgba(99,102,241,.22); }
.room-card-top h3 { font-size: 15px; }
.room-card-top p { color: var(--slate-400); font-size: 11px; }
.room-template { margin-top: 16px; padding: 11px 12px; border-radius: 10px; background: #f8fafc; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.room-template span { color: var(--slate-400); font-size: 11px; }
.room-template strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.room-counts { display: flex; gap: 18px; margin-top: 12px; color: var(--slate-500); font-size: 11px; }
.room-counts b { color: var(--primary); font-size: 15px; }
.room-description { min-height: 38px; margin-top: 10px; color: var(--slate-400); font-size: 11px; line-height: 1.6; }
.room-editor { display: flex; flex-direction: column; gap: 18px; }
.room-library-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.room-library-grid > section { min-width: 0; border: 1px solid var(--slate-200); border-radius: 12px; overflow: hidden; }
.room-library-head { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; background: #f8fafc; border-bottom: 1px solid var(--slate-200); }
.room-library-head h4 { font-size: 13px; }
.room-library-head span { color: var(--slate-400); font-size: 10px; }
.room-pick-list { max-height: 260px; overflow-y: auto; padding: 8px; }
.room-pick { padding: 9px 10px; display: flex; gap: 9px; align-items: flex-start; border-radius: 8px; cursor: pointer; }
.room-pick:hover { background: #f8fafc; }
.room-pick input { margin-top: 3px; accent-color: var(--primary); }
.room-pick span { min-width: 0; display: flex; flex-direction: column; }
.room-pick strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--slate-700); font-size: 12px; }
.room-pick small { color: var(--slate-400); font-size: 10px; }

/* 统一面板视觉：让运营台的信息层级更清晰、操作反馈更明确 */
.card, .panel, .table-card, .analytics-card, .monitor-panel { border: 1px solid rgba(148,163,184,.18); box-shadow: 0 12px 32px rgba(15,23,42,.06); }
.table-card, .analytics-card { overflow: hidden; }
.table-toolbar { min-height: 66px; gap: 12px; background: linear-gradient(180deg,#fff 0%,#fbfcff 100%); }
.table-toolbar h3 { letter-spacing: .01em; }
.table-toolbar > div:first-child h3 { color: #1e293b; }
.table-toolbar .btn, .analytics-head-actions .btn { box-shadow: 0 5px 13px rgba(79,70,229,.12); }
.btn { border-radius: 9px; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 7px 16px rgba(15,23,42,.12); }
.btn-primary { background: linear-gradient(135deg,#6366f1,#4f46e5); }
.btn-ghost { background: #fff; border-color: #dbe3ef; }
.data-table thead th { background: #f7f9fd; color: #64748b; font-weight: 700; letter-spacing: .02em; }
.data-table tbody tr { transition: background .16s ease, transform .16s ease; }
.data-table tbody tr:hover { background: #f8faff; }
.data-table td { color: #334155; }
.search-box { border-color: #dbe3ef; background: #fff; box-shadow: 0 4px 12px rgba(15,23,42,.04); }
.search-box:focus-within { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.11); }
.select-mini, .input-mini { border-color: #dbe3ef; background: #fff; transition: border-color .18s ease, box-shadow .18s ease; }
.select-mini:focus, .input-mini:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.1); outline: none; }
.modal-mask { background: rgba(15,23,42,.48); backdrop-filter: blur(4px); }
.modal { border: 1px solid rgba(255,255,255,.7); box-shadow: 0 24px 70px rgba(15,23,42,.22); }
.modal-head { background: linear-gradient(180deg,#fff,#fafbff); }
.modal-title { color: #1e293b; letter-spacing: .01em; }
.modal-foot { background: #fbfcff; }
.offline-order-section { box-shadow: 0 5px 16px rgba(15,23,42,.035); }
.offline-catalog-choice { transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.offline-catalog-choice:hover { transform: translateY(-1px); border-color: #a5b4fc; }
.offline-image-picker:hover { background: #eef2ff; }
.page-btn { transition: color .16s ease, background .16s ease, transform .16s ease; }
.page-btn:hover:not(.active) { transform: translateY(-1px); background: #eef2ff; }
.table-empty { padding: 52px 20px; color: #94a3b8; }
.analytics-card { background: linear-gradient(180deg,#fff 0%,#fcfdff 100%); }
.analytics-card h3 { color: #1e293b; }
.probe-bar { border-color: rgba(148,163,184,.18); box-shadow: 0 5px 16px rgba(15,23,42,.035); }

@media (max-width: 1100px) {
  .content-summary { grid-template-columns: repeat(3,1fr); }
  .template-editor-grid { grid-template-columns: 1fr; }
  .template-code-field textarea { min-height: 360px; }
}
@media (max-width: 720px) {
  .content-hero,.content-toolbar { align-items: flex-start; flex-direction: column; }
  .content-summary { grid-template-columns: 1fr 1fr; }
  .content-toolbar-actions { width: 100%; flex-wrap: wrap; }
  .content-toolbar .search-box { width: 100%; }
  .content-toolbar .search-box input { width: 100%; }
  .asset-grid,.template-grid,.room-grid { grid-template-columns: 1fr; }
  .knowledge-card { grid-template-columns: 1fr; }
  .knowledge-kind { width: max-content; }
  .room-library-grid { grid-template-columns: 1fr; }
}
