/* ============================================================
   词海瞳GEO营销系统 · 全局样式
   主色：科技蓝 #2563eb ／ 强调橙 #f59e0b
   ============================================================ */

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #dbeafe;
  --orange: #f59e0b;
  --orange-light: #fef3c7;
  --green: #10b981;
  --green-light: #d1fae5;
  --red: #ef4444;
  --red-light: #fee2e2;
  --purple: #8b5cf6;
  --cyan: #06b6d4;
  --gray: #64748b;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --sidebar-bg: #0b1220;
  --sidebar-active: rgba(37, 99, 235, 0.18);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.14);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ========== 登录页 ========== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0b1220 0%, #1e3a8a 60%, #2563eb 100%);
  padding: 24px;
}
.login-card {
  width: 400px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 40px 36px 32px;
}
.login-logo {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.login-logo .logo-mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), #60a5fa);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 18px;
}
.login-logo h1 { font-size: 20px; color: var(--text); }
.login-sub { color: var(--text-secondary); font-size: 13px; margin-bottom: 28px; }
.login-tip {
  margin-top: 18px; padding: 10px 12px;
  background: var(--blue-light); color: var(--blue-dark);
  border-radius: var(--radius-sm); font-size: 12px; line-height: 1.8;
}
.login-error {
  display: none; margin-bottom: 14px; padding: 9px 12px;
  background: var(--red-light); color: var(--red);
  border-radius: var(--radius-sm); font-size: 13px;
}

/* ========== 员工端布局 ========== */
.shell { display: flex; min-height: 100vh; min-width: 1280px; }

.sidebar {
  width: 232px;
  background: var(--sidebar-bg);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 90;
}
.sidebar .logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}
.sidebar .logo .logo-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--blue), #60a5fa);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
}
.sidebar .logo .logo-text { font-size: 15px; font-weight: 600; color: #fff; line-height: 1.3; }
.sidebar .logo .logo-text small { display: block; font-size: 10px; color: #64748b; font-weight: 400; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar .nav-group-title {
  font-size: 11px; color: #475569; padding: 12px 10px 6px; letter-spacing: 1px;
}
.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: #94a3b8; cursor: pointer;
  font-size: 13.5px; user-select: none;
  transition: background .15s, color .15s;
}
.menu-item svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.menu-item:hover { background: rgba(148, 163, 184, 0.08); color: #e2e8f0; }
.menu-item.active { background: var(--sidebar-active); color: #fff; }
.menu-item.active svg { opacity: 1; color: #93c5fd; }

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

.topbar {
  height: 60px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 80;
}
.topbar .page-title { font-size: 16px; font-weight: 600; }
.topbar .spacer { flex: 1; }

.brand-select-wrap { display: flex; align-items: center; gap: 8px; }
.brand-select-wrap label { font-size: 13px; color: var(--text-secondary); }

.content { padding: 20px 24px 40px; flex: 1; }
.page-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.page-head h2 { font-size: 18px; font-weight: 600; }
.page-head .sub { color: var(--text-secondary); font-size: 13px; }
.page-head .spacer { flex: 1; }

/* ========== 卡片 ========== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-title .spacer { flex: 1; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
}
.stat-card .stat-label { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-card .stat-sub { font-size: 12px; color: var(--text-muted); }
.stat-card .stat-icon {
  position: absolute; right: 14px; top: 14px;
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.stat-card .stat-icon svg { width: 20px; height: 20px; }
.stat-card.stat-blue .stat-icon { background: var(--blue-light); color: var(--blue); }
.stat-card.stat-orange .stat-icon { background: var(--orange-light); color: var(--orange); }
.stat-card.stat-green .stat-icon { background: var(--green-light); color: var(--green); }
.stat-card.stat-purple .stat-icon { background: #ede9fe; color: var(--purple); }

/* ========== 图表 ========== */
.chart { width: 100%; height: 300px; }
.chart-tall { height: 340px; }
.chart-grid-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.chart-grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1440px) {
  .chart-grid-2 { grid-template-columns: 1fr 1fr; }
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 13px; font-family: var(--font);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-orange { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-orange:hover { background: #d97706; border-color: #d97706; }
.btn-danger { background: var(--card); border-color: #fecaca; color: var(--red); }
.btn-danger:hover { background: var(--red-light); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--blue); }
.btn-ghost:hover { background: var(--blue-light); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-link {
  border: none; background: none; color: var(--blue);
  cursor: pointer; font-size: 13px; font-family: var(--font); padding: 2px 6px;
}
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--red); }
.btn-link.warn { color: var(--orange); }

/* ========== 表单 ========== */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.field label .req { color: var(--red); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: var(--font);
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.textarea { resize: vertical; min-height: 72px; line-height: 1.6; }
.select { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.radio-group { display: flex; gap: 12px; }
.radio-group label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text); cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 14px;
}
.radio-group input { accent-color: var(--blue); }
.radio-group label:has(input:checked) { border-color: var(--blue); background: var(--blue-light); color: var(--blue-dark); }

/* range slider */
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--blue); }
.slider-val { font-weight: 600; color: var(--blue); min-width: 30px; text-align: right; font-variant-numeric: tabular-nums; }

/* ========== 表格 ========== */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 10px 12px;
  color: var(--text-secondary); font-weight: 500;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr.clickable { cursor: pointer; }
.table .col-actions { white-space: nowrap; text-align: right; }

/* ========== 徽标 / 标签 ========== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 12px; line-height: 1.7; white-space: nowrap;
}
.badge-blue { background: var(--blue-light); color: var(--blue-dark); }
.badge-orange { background: var(--orange-light); color: #b45309; }
.badge-green { background: var(--green-light); color: #047857; }
.badge-red { background: var(--red-light); color: #b91c1c; }
.badge-gray { background: #f1f5f9; color: var(--text-secondary); }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-cyan { background: #cffafe; color: #0e7490; }

.tag-chip {
  display: inline-flex; align-items: center;
  background: #eef2ff; color: #4338ca;
  border-radius: 6px; padding: 1px 8px;
  font-size: 12px; margin: 2px 4px 2px 0;
}
.tag-chip.clickable { cursor: pointer; }
.tag-chip.clickable:hover { background: var(--blue); color: #fff; }

/* chips 输入 */
.chips-input {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 5px 8px; display: flex; flex-wrap: wrap; gap: 4px;
  cursor: text; background: #fff;
}
.chips-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.chips-input .chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--blue-light); color: var(--blue-dark);
  border-radius: 6px; padding: 2px 4px 2px 8px; font-size: 12.5px;
}
.chips-input .chip button {
  border: none; background: none; cursor: pointer; color: var(--blue-dark);
  font-size: 13px; line-height: 1; padding: 1px 3px; border-radius: 4px;
}
.chips-input .chip button:hover { background: rgba(37, 99, 235, .18); }
.chips-input input { border: none; outline: none; flex: 1; min-width: 90px; font-size: 13px; font-family: var(--font); padding: 3px 2px; }

/* ========== 弹窗 ========== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .15s ease;
  padding: 24px;
}
.modal {
  background: var(--card); border-radius: 14px;
  box-shadow: var(--shadow-lg);
  width: 560px; max-width: 96vw;
  max-height: 88vh; display: flex; flex-direction: column;
  animation: slideUp .18s ease;
}
.modal.modal-lg { width: 720px; }
.modal.modal-sm { width: 420px; }
.modal-head {
  display: flex; align-items: center; padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15.5px; font-weight: 600; flex: 1; }
.modal-close {
  border: none; background: none; cursor: pointer;
  font-size: 20px; color: var(--text-muted); line-height: 1;
  padding: 2px 6px; border-radius: 6px;
}
.modal-close:hover { background: #f1f5f9; color: var(--text); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ========== Toast ========== */
.toast-wrap {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: #0f172a; color: #f8fafc;
  border-radius: 8px; padding: 9px 18px;
  font-size: 13.5px; box-shadow: var(--shadow-lg);
  animation: slideDown .2s ease;
  max-width: 70vw;
}
.toast.toast-success { background: #065f46; }
.toast.toast-error { background: #991b1b; }
.toast.toast-warn { background: #92400e; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ========== 分页 ========== */
.pagination {
  display: flex; align-items: center; gap: 6px;
  justify-content: flex-end; padding-top: 14px; flex-wrap: wrap;
}
.pagination .page-info { color: var(--text-secondary); font-size: 12.5px; margin-right: auto; }
.pagination button {
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid var(--border); background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--text);
  font-family: var(--font);
}
.pagination button:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.pagination button.cur { background: var(--blue); border-color: var(--blue); color: #fff; }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }

/* ========== 筛选栏 ========== */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.filter-bar .select, .filter-bar .input { width: auto; min-width: 130px; }
.filter-bar .spacer { flex: 1; }

/* ========== Tabs（平台切换） ========== */
.tabs { display: inline-flex; background: #f1f5f9; border-radius: 8px; padding: 3px; gap: 2px; }
.tabs .tab {
  border: none; background: none; padding: 5px 13px;
  font-size: 12.5px; border-radius: 6px; cursor: pointer;
  color: var(--text-secondary); font-family: var(--font); white-space: nowrap;
}
.tabs .tab:hover { color: var(--text); }
.tabs .tab.active { background: #fff; color: var(--blue); font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,.08); }

/* ========== 空状态 ========== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 70px 20px; color: var(--text-secondary); gap: 12px;
}
.empty-state .empty-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: #eef2ff; display: flex; align-items: center; justify-content: center;
  color: var(--blue); font-size: 30px;
}
.empty-state p { font-size: 14px; }

/* ========== 抽屉 ========== */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 190;
  background: rgba(15, 23, 42, 0.35);
  animation: fadeIn .15s ease;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 195;
  width: 620px; max-width: 92vw;
  background: #fff; box-shadow: -8px 0 30px rgba(15, 23, 42, 0.15);
  display: flex; flex-direction: column;
  animation: drawerIn .2s ease;
}
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.drawer-head h3 { font-size: 15.5px; font-weight: 600; flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.answer-box {
  background: #f8fafc; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-size: 13.5px; line-height: 1.9; white-space: pre-wrap; word-break: break-word;
  color: #334155;
}
.citation-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid #f1f5f9;
}
.citation-item .citation-idx {
  flex: none; width: 20px; height: 20px; border-radius: 6px;
  background: var(--blue-light); color: var(--blue-dark);
  font-size: 11.5px; display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.citation-item .citation-domain { font-size: 12px; color: var(--text-muted); }
.citation-item a { font-size: 13px; }

/* ========== 品牌卡片 ========== */
.brand-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1440px) { .brand-grid { grid-template-columns: repeat(2, 1fr); } }
.brand-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
  border-top: 3px solid transparent;
  transition: box-shadow .15s;
}
.brand-card:hover { box-shadow: var(--shadow-lg); }
.brand-card.current { border-top-color: var(--blue); }
.brand-card .brand-head { display: flex; align-items: flex-start; gap: 10px; }
.brand-card .brand-logo {
  width: 42px; height: 42px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--blue), #60a5fa);
  color: #fff; font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.brand-card .brand-name { font-size: 15.5px; font-weight: 600; }
.brand-card .brand-meta { font-size: 12.5px; color: var(--text-secondary); line-height: 1.9; }
.brand-card .brand-foot {
  display: flex; align-items: center; gap: 8px;
  border-top: 1px solid #f1f5f9; padding-top: 12px; margin-top: 2px;
}

/* ========== 排名表（竞品） ========== */
.rank-table td.rank-cell { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.rank-num { display: inline-block; min-width: 24px; height: 24px; line-height: 24px; border-radius: 6px; }
.rank-1, .rank-2, .rank-3 { background: #fef3c7; color: #b45309; }
.rank-cell.main-brand { background: var(--blue-light); }
.rank-cell.main-brand .rank-num { background: var(--blue); color: #fff; }
.rank-null { color: #cbd5e1; }

/* ========== 声誉页 ========== */
.rep-hero {
  display: flex; align-items: center; gap: 28px;
  background: linear-gradient(120deg, #eff6ff, #ffffff);
  border: 1px solid #dbeafe;
}
.rep-hero .rep-big { font-size: 46px; font-weight: 800; color: var(--blue); line-height: 1.1; font-variant-numeric: tabular-nums; }
.rep-hero .rep-label { color: var(--text-secondary); font-size: 13.5px; margin-top: 4px; }

/* ========== 风险列表 ========== */
.risk-item {
  display: flex; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid #f1f5f9;
}
.risk-item:last-child { border-bottom: none; }
.risk-item .risk-main { flex: 1; min-width: 0; }
.risk-item .risk-q { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.risk-item .risk-answer {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.7;
  background: #f8fafc; border-radius: 6px; padding: 7px 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.risk-item .risk-meta { font-size: 12px; color: var(--text-muted); margin-top: 5px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ========== 用户菜单 ========== */
.user-menu-wrap { position: relative; }
.user-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
  border: none; background: none; font-family: var(--font);
}
.user-trigger:hover { background: #f1f5f9; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), #60a5fa);
  color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.user-name { font-size: 13px; color: var(--text); text-align: left; line-height: 1.25; }
.user-name small { display: block; color: var(--text-muted); font-size: 11px; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  min-width: 180px; padding: 6px; z-index: 120;
  animation: slideUp .13s ease;
}
.dropdown .dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 7px;
  font-size: 13px; color: var(--text); cursor: pointer;
  width: 100%; border: none; background: none; text-align: left; font-family: var(--font);
}
.dropdown .dropdown-item:hover { background: #f1f5f9; }
.dropdown .dropdown-item.danger { color: var(--red); }
.dropdown .dropdown-divider { height: 1px; background: var(--border); margin: 5px 8px; }

/* ========== 设置页平台行 ========== */
.platform-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 4px; border-bottom: 1px solid #f1f5f9;
}
.platform-row:last-child { border-bottom: none; }
.platform-row .platform-name { font-weight: 600; font-size: 14px; min-width: 110px; }
.platform-row .platform-code { font-size: 12px; color: var(--text-muted); }
.platform-row .platform-note { flex: 1; font-size: 12.5px; color: var(--text-secondary); }

/* 开关 */
.switch { position: relative; width: 40px; height: 22px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: #cbd5e1; transition: .18s;
}
.switch .slider::before {
  content: ""; position: absolute; width: 18px; height: 18px;
  left: 2px; top: 2px; border-radius: 50%; background: #fff;
  transition: .18s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ========== AI 拓展结果 ========== */
.expand-result-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 10px; border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 8px; cursor: pointer;
}
.expand-result-item:hover { border-color: var(--blue); background: #f8faff; }
.expand-result-item.checked { border-color: var(--blue); background: var(--blue-light); }
.expand-result-item input { margin-top: 3px; accent-color: var(--blue); }
.expand-result-item .q-text { font-size: 13px; line-height: 1.6; }

/* ========== 分享管理链接 ========== */
.share-url {
  font-size: 12.5px; color: var(--text-secondary);
  background: #f8fafc; border: 1px dashed var(--border);
  padding: 5px 9px; border-radius: 6px;
  word-break: break-all;
}

/* ========== 加载 ========== */
.loading-block {
  display: flex; align-items: center; justify-content: center;
  padding: 60px 0; color: var(--text-muted); font-size: 13px; gap: 8px;
}
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid #cbd5e1; border-top-color: var(--blue);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.boot-splash {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); gap: 10px;
}

/* ========== 客户分享页 ========== */
.share-page { min-height: 100vh; background: #f3f6fb; }
.share-header {
  background: linear-gradient(120deg, #0b1220 0%, #1e3a8a 55%, #2563eb 100%);
  color: #fff; padding: 34px 0 30px;
}
.share-header .container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.share-brand-name { font-size: 26px; font-weight: 700; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.share-brand-meta { margin-top: 10px; color: #bfdbfe; font-size: 13.5px; display: flex; gap: 18px; flex-wrap: wrap; }
.share-header .share-for { margin-top: 14px; font-size: 13px; color: #dbeafe; }
.share-header .share-for strong { color: #fbbf24; }
.share-body { max-width: 1180px; margin: -22px auto 0; padding: 0 24px 40px; }
.share-foot {
  text-align: center; color: var(--text-muted); font-size: 12.5px;
  padding: 18px 0 30px;
}
.share-foot .brand-mark { font-weight: 600; color: var(--blue); }

.share-lock-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0b1220 0%, #1e3a8a 60%, #2563eb 100%);
  padding: 24px;
}
.share-lock-card {
  width: 380px; background: #fff; border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 34px 30px;
  text-align: center;
}
.share-lock-card .lock-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--blue-light); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; font-size: 24px;
}
.share-lock-card h2 { font-size: 17px; margin-bottom: 6px; }
.share-lock-card p { font-size: 13px; color: var(--text-secondary); margin-bottom: 18px; }
.share-lock-error {
  display: none; margin-bottom: 12px; padding: 8px 12px;
  background: var(--red-light); color: var(--red);
  border-radius: var(--radius-sm); font-size: 12.5px;
}

.share-error-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #f3f6fb; padding: 24px;
}
.share-error-card {
  width: 440px; background: #fff; border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 44px 36px; text-align: center;
}
.share-error-card .err-icon {
  width: 70px; height: 70px; border-radius: 50%;
  background: var(--orange-light); color: var(--orange);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; font-size: 32px;
}
.share-error-card h2 { font-size: 18px; margin-bottom: 10px; }
.share-error-card p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.8; }

/* 通用工具 */
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--text-muted); font-size: 12.5px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.text-right { text-align: right; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; }

/* 告警中心 */
.muted-row { opacity: .62; }
.link-btn { border: none; background: none; color: var(--blue); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.link-btn:hover { text-decoration: underline; }
.alert-bell { position: relative; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; color: var(--text-secondary); }
.alert-bell:hover { color: var(--blue); border-color: var(--blue); }
.alert-bell svg { width: 18px; height: 18px; }
.alert-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.link-btn.danger { color: #dc2626; }

/* viewer（只读角色）隐藏全部修改类操作；权限仍由服务端强制 */
body.role-viewer #btn-add,
body.role-viewer #btn-expand,
body.role-viewer #al-read-all,
body.role-viewer #btn-trigger,
body.role-viewer .col-actions [data-act="toggle"],
body.role-viewer .col-actions [data-act="edit"],
body.role-viewer .col-actions [data-act="del"],
body.role-viewer .brand-foot [data-act="toggle"],
body.role-viewer .brand-foot [data-act="edit"],
body.role-viewer .brand-foot [data-act="del"],
body.role-viewer [data-act="revoke"],
body.role-viewer [data-read],
body.role-viewer [data-del-lead],
body.role-viewer [data-del-diag],
body.role-viewer .platform-row .switch { display: none !important; }
body.role-viewer [data-batch] { display: none !important; }

/* 国内/海外监测切换 */
.region-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-right: 10px; }
.region-btn { border: none; background: #fff; color: var(--text-secondary); padding: 7px 14px; font-size: 13px; cursor: pointer; }
.region-btn + .region-btn { border-left: 1px solid var(--border); }
.region-btn.active { background: var(--blue); color: #fff; font-weight: 600; }

/* 移动端：抽屉导航与自适应内容 */
.mobile-nav-toggle, .mobile-nav-backdrop { display: none; }
@media (max-width: 760px) {
  .shell { width: 100%; min-width: 0; }
  .sidebar { width: min(280px, 84vw); transform: translateX(-100%); transition: transform .2s ease; }
  .main { width: 100%; min-width: 0; margin-left: 0; }
  .mobile-nav-toggle {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    width: 38px; height: 38px; flex: none; padding: 0; border: 1px solid var(--border);
    border-radius: 8px; background: #fff; cursor: pointer;
  }
  .mobile-nav-toggle span { display: block; width: 17px; height: 1.5px; background: var(--text); }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .mobile-nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 85; border: 0;
    background: rgba(15, 23, 42, .38);
  }
  .topbar { height: auto; min-height: 60px; flex-wrap: wrap; gap: 9px; padding: 10px 12px; }
  .topbar .spacer { display: none; }
  .topbar .page-title { flex: 1; min-width: 110px; }
  .brand-select-wrap { order: 5; width: 100%; }
  .brand-select-wrap .select { flex: 1; width: auto; min-width: 0 !important; }
  .page-head .spacer { display: none; }
  .page-head .btn { flex: none; }
  .region-toggle { margin-right: 0; }
  .region-btn { padding: 7px 10px; font-size: 12px; }
  .user-name { display: none; }
  .user-trigger { padding: 4px; }
  #btn-monitor-now { padding: 8px 11px; }
  .content { width: 100%; padding: 16px 12px 32px; overflow: hidden; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 16px 14px; }
  .stat-card .stat-value { font-size: 25px; }
  .stat-card .stat-icon { right: 10px; top: 10px; width: 30px; height: 30px; }
  .chart-grid-2, .chart-grid-2-even { grid-template-columns: 1fr; }
  .chart { height: 260px; }
  .card { padding: 16px 14px; }
  .page-head { align-items: flex-start; }
  .page-head .sub { width: 100%; }
  .form-row, .brand-grid { grid-template-columns: 1fr; }
  .table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .filter-bar .select, .filter-bar .input { max-width: 100%; }
  .tabs { display: flex; max-width: 100%; overflow-x: auto; }
  .rep-hero { flex-wrap: wrap; gap: 16px; }
  .platform-row { flex-wrap: wrap; gap: 9px; }
  .platform-row .platform-note { flex-basis: 100%; }
  .login-card { width: 100%; padding: 30px 22px; }
  .modal-overlay { padding: 12px; }
  .share-header .container { padding: 0 16px; }
  .share-body { padding: 0 12px 32px; }
  .share-brand-name { font-size: 22px; }
}
@media (max-width: 370px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar .page-title { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}
