/* ============ 智优 MaaS 全局基础 ============ */
:root {
  --bg: #f8fafc;
  --bg-grad: linear-gradient(135deg, #f0f4ff 0%, #e0f2fe 50%, #f0fdfa 100%);
  --card: #ffffff;
  --card-hover: #f8fafc;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-light: #e0f2fe;
  --primary-bg: rgba(14, 165, 233, 0.08);
  --accent: #06b6d4;
  --accent-dark: #0891b2;
  --success: #10b981;
  --success-bg: #d1fae5;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --sidebar: #0c1424;
  --sidebar-grad: linear-gradient(180deg, #0c1424 0%, #0f172a 100%);
  --sidebar-fg: #94a3b8;
  --sidebar-hover: #1e293b;
  --sidebar-active: #0ea5e9;
  --sidebar-active-bg: rgba(14, 165, 233, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; transition: var(--transition); }

pre {
  background: #0f172a; color: #e2e8f0; padding: 20px; border-radius: var(--radius-md);
  overflow-x: auto; font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 13px; line-height: 1.6; margin: 0;
}
pre code { background: transparent; color: inherit; padding: 0; font-size: inherit; border-radius: 0; }
code {
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  background: #f1f5f9; color: var(--primary-dark); padding: 2px 6px; border-radius: 5px;
  font-size: 12.5px;
}

input[type="text"], input[type="number"], input[type="email"],
input[type="password"], input[type="search"], input[type="url"],
input:not([type]), select, textarea {
  font-family: inherit; font-size: 13px; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 9px 12px; outline: none; transition: var(--transition);
  -webkit-appearance: none; appearance: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}
input:hover, select:hover, textarea:hover { border-color: #cbd5e1; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-bg); }
input::placeholder, textarea::placeholder { color: #b8c2d1; font-size: 13px; }
select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
  padding-right: 32px; cursor: pointer;
}
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; background: var(--sidebar-grad); color: var(--sidebar-fg);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
}
.sidebar .brand {
  display: flex; align-items: center; padding: 22px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.brand-logo {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex; align-items: center; justify-content: center; margin-right: 12px;
  flex-shrink: 0; box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}
.brand-logo svg { width: 22px; height: 22px; }
.brand-name { font-size: 16px; font-weight: 700; color: #fff; line-height: 1.2; }
.brand-sub { display: block; font-size: 11px; color: var(--sidebar-fg); font-weight: 400; margin-top: 2px; }

.nav { flex: 1; overflow-y: auto; padding: 12px 10px; scrollbar-width: none; -ms-overflow-style: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-section { margin-bottom: 4px; }
.nav-section-label {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  color: var(--sidebar-fg); font-size: 13px; font-weight: 600; cursor: pointer;
  border-radius: var(--radius-md); user-select: none;
}
.nav-section-label svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-section-label:hover { background: var(--sidebar-hover); color: #fff; }
.nav-section-arrow { margin-left: auto; font-size: 11px; transition: transform .2s; }
.nav-section.collapsed .nav-section-arrow { transform: rotate(-90deg); }
.nav-section-body { padding: 2px 0 4px 8px; }
.nav-section.collapsed .nav-section-body { display: none; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-md);
  color: var(--sidebar-fg); font-size: 13px; transition: var(--transition);
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active); }
.nav-sub { padding-left: 34px; }
.nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; padding: 1px 6px; border-radius: 999px;
}

.sidebar-foot {
  padding: 14px 14px 18px; border-top: 1px solid rgba(255,255,255,0.06);
}
.user-card {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { color: #fff; font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--sidebar-fg); }
.user-org { font-size: 11px; color: var(--sidebar-fg); margin-top: 2px; }
.user-balance { font-size: 11px; color: var(--accent); margin-top: 2px; }
.user-phone { font-size: 11px; color: var(--sidebar-fg); margin-top: 2px; }
.phone-bind-link { color: var(--primary); }
.user-settings {
  background: transparent; border: none; color: var(--sidebar-fg);
  font-size: 18px; cursor: pointer; padding: 4px;
}
.user-settings:hover { color: #fff; }

.main { flex: 1; margin-left: 250px; min-height: 100vh; display: flex; flex-direction: column; }
.main.no-sidebar { margin-left: 0; }
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 40;
}
.topbar-title { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.content { flex: 1; padding: 24px; }

.page-head { margin-bottom: 20px; }
.page-head h2 { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* 卡片与栅格 */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 16px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--text); }
.stat-sub { font-size: 12px; color: var(--muted); }
.stat-success { color: var(--success); }
.stat-num { font-size: 20px; font-weight: 700; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; display: flex; flex-direction: column; gap: 6px; transition: var(--transition); }
.stat-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-md); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .stat-grid { grid-template-columns: 1fr; } }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.summary-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; }
.summary-label { font-size: 12px; color: var(--muted); }
.summary-value { font-size: 20px; font-weight: 700; margin-top: 4px; }
.summary-hint { font-size: 11px; color: var(--muted-light); margin-top: 2px; }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border);
}
.tag-on { background: var(--success-bg); color: #166534; border-color: #bbf7d0; }
.tag-off { background: var(--danger-bg); color: #991b1b; border-color: #fecaca; }
.tag-warn { background: var(--warning-bg); color: #92400e; border-color: #fde68a; }
.tag-info { background: var(--primary-bg); color: #0c4a6e; border-color: #bae6fd; }
.tag-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.tag-agent { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.tag-user { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }
.tag-enterprise { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }

/* 按钮 */
.btn {
  background: #fff; border: 1px solid var(--border); padding: 7px 16px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); transition: var(--transition);
  display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 6px;
}
.btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #059669; border-color: #059669; color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }
.btn-danger { color: var(--danger); border-color: var(--danger-bg); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ghost { background: transparent; color: var(--sidebar-fg); border-color: rgba(255,255,255,0.1); width: 100%; }
.btn-ghost:hover { background: var(--sidebar-hover); color: #fff; border-color: rgba(255,255,255,0.2); }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-block { width: 100%; display: flex; justify-content: center; }
.seg { display: inline-flex; }
.seg .btn { border: none; border-radius: 0; border-right: 1px solid var(--border); }
.seg .btn:last-child { border-right: none; }
.seg .btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border-light); }
.table th { background: var(--bg); color: var(--text-secondary); font-size: 12px; font-weight: 600; }
.table tbody tr:hover { background: var(--card-hover); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); text-align: left; vertical-align: top; }
.data-table th { background: var(--bg); font-weight: 600; color: var(--text-secondary); font-size: 12px; }
.data-table tbody tr:hover { background: var(--card-hover); }

/* 表单 */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label, .form-row label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
}
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.required { color: var(--danger); font-weight: 700; }

/* 令牌弹窗 - 允许模型复选框 */
#modelCheckboxList .model-checkbox-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
  font-weight: normal;
}
#modelCheckboxList .model-checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--primary);
}
#modelCheckboxList {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  background: var(--bg);
}
#modelCheckboxList .model-checkbox-row.offline-row {
  opacity: 0.6;
  cursor: not-allowed;
}
#modelCheckboxList .model-checkbox-row.offline-row input[type="checkbox"] {
  cursor: not-allowed;
}
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { min-width: 140px; }
.date-field { position: relative; display: inline-flex; align-items: center; }
.date-field input { padding-right: 28px; }
.date-icon { position: absolute; right: 8px; font-size: 12px; pointer-events: none; }
.link { color: var(--primary); font-weight: 500; }
.link:hover { text-decoration: underline; }

/* 现有弹窗 */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 24px;
}
.modal.open { display: flex; }
.modal-card {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
  width: 100%; max-width: 540px; max-height: 88vh; overflow-y: auto;
  padding-bottom: 8px;
}
.modal-title { font-size: 16px; font-weight: 700; padding: 18px 46px 18px 24px; border-bottom: 1px solid var(--border-light); }
.modal-card { position: relative; }
.modal-card .form { padding: 22px 24px; }
.modal-close {
  position: absolute; top: 12px; right: 14px; z-index: 3;
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: transparent; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text); }

/* 弹框内容区内边距（非 form 容器） */
.modal-card > div[id$="Body"],
.modal-card > div[id$="body"],
.modal-card > .fb-detail-wrap {
  padding: 18px 24px;
}

/* 全局图片灯箱 */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.lightbox-overlay.open { opacity: 1; visibility: visible; }
.lightbox-overlay img {
  max-width: 88vw; max-height: 85vh; border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0,0,0,.4);
  transform: scale(.96); transition: transform .2s;
}
.lightbox-overlay.open img { transform: scale(1); }
.lightbox-close {
  position: absolute; top: 16px; right: 18px;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.15); color: #fff;
  font-size: 24px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }

/* 可点击缩略图样式 */
.img-clickable {
  cursor: pointer; border-radius: 6px; transition: transform .15s, box-shadow .15s;
  border: 1px solid var(--border-light, #f1f5f9);
}
.img-clickable:hover {
  transform: scale(1.06); box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

/* 右下角公告浮窗 + 右侧公告抽屉 */
.ann-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}
.ann-fab > * { pointer-events: auto; }
.ann-fab-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(34, 197, 94, 0.35);
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
}
.ann-fab-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(34, 197, 94, 0.45); }
.ann-fab-btn svg { width: 24px; height: 24px; }
.ann-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}
.ann-fab-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

.ann-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.ann-drawer-overlay.open { opacity: 1; visibility: visible; }

.ann-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 90vw;
  background: #fff;
  z-index: 1002;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform .3s ease;
  display: flex;
  flex-direction: column;
}
.ann-drawer.open { transform: translateX(0); }

.ann-drawer-header {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-shrink: 0;
}
.ann-drawer-header h3 { margin: 0; font-size: 18px; font-weight: 600; }
.ann-drawer-header p { margin: 4px 0 0; font-size: 12px; opacity: 0.9; }
.ann-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.ann-drawer-close:hover { background: rgba(255, 255, 255, 0.3); }

.ann-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 20px;
}
.ann-drawer-empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
  font-size: 14px;
}
.ann-drawer-item {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}
.ann-drawer-item:last-child { border-bottom: none; }
.ann-drawer-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3b82f6;
  margin-top: 5px;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.ann-drawer-content { flex: 1; min-width: 0; }
.ann-drawer-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 5px; line-height: 1.45; }
.ann-drawer-text {
  font-size: 13px;
  color: #64748b;
  line-height: 1.7;
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}
.ann-drawer-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ann-drawer-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.ann-drawer-time { font-size: 12px; color: var(--muted); }

@media (max-width: 640px) {
  .ann-fab { right: 16px; bottom: 16px; }
  .ann-fab-btn { width: 48px; height: 48px; }
  .ann-drawer { width: 100%; max-width: 100%; }
}

/* 分页 */
.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pager a { display: inline-block; padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: 13px; background: var(--card); }
.pager a:hover { border-color: var(--primary); color: var(--primary); }
.pager-info { font-size: 13px; color: var(--muted); padding: 0 6px; }
.pagination { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pagination .btn { min-width: 70px; justify-content: center; }
.pagination .btn-page { min-width: 34px; padding: 5px 8px; }
.pagination input[type="number"] { border: 1px solid var(--border); border-radius: var(--radius-md); width: 60px; text-align: center; }

/* 通用 */
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-16 { margin-top: 16px; }
.hint { color: var(--muted); font-size: 12px; cursor: help; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.ann-empty { text-align: center; padding: 24px; color: var(--muted); }
.ann-badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--warning-bg); color: #92400e; }
.legal-wrap { max-width: 800px; margin: 0 auto; background: #fff; padding: 40px; border-radius: var(--radius-lg); }
.legal-back { display: inline-block; margin-bottom: 20px; color: var(--primary); }

/* Tab */
.tab-bar {
  display: flex; align-items: center; background: var(--bg); border-bottom: 1px solid var(--border); padding: 0 6px;
}
.tab {
  background: transparent; border: none; padding: 10px 18px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; transition: var(--transition);
}
.tab:hover { color: var(--text); }
.tab.active, .tab.tab-active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tabs { display: flex; gap: 0; }

/* ============ 代码块 / API 调用示例 ============ */
.code-tabs {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.code-tabs .tab-bar {
  background: #0b1220;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding: 0 8px;
}
.code-tabs .tab {
  color: #94a3b8;
  padding: 10px 16px;
  border-bottom-color: transparent;
  font-size: 13px;
}
.code-tabs .tab:hover { color: #e2e8f0; }
.code-tabs .tab.active,
.code-tabs .tab.tab-active { color: #38bdf8; border-bottom-color: #38bdf8; }
.code-tabs .btn-sm {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
  color: #e2e8f0;
  font-size: 12px;
  padding: 5px 12px;
}
.code-tabs .btn-sm:hover { background: rgba(56, 189, 248, 0.15); border-color: rgba(56, 189, 248, 0.35); color: #38bdf8; }
.code-block {
  margin: 0;
  background: #0f172a;
  border-radius: 0;
  overflow: auto;
  padding: 0;
}
.code-block pre {
  background: transparent;
  padding: 0;
  margin: 0;
}
.code-area {
  width: 100%;
  min-height: 220px;
  background: transparent;
  color: #e2e8f0;
  border: none;
  padding: 16px 18px;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  resize: none;
  outline: none;
  white-space: pre;
  overflow: auto;
}
.code-area:focus {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.code-area::selection,
.code-area::-moz-selection {
  background-color: rgba(14, 165, 233, 0.45);
  color: #e0f2fe;
}

/* 宣传首页 */
.landing-page { background: #fff; min-height: 100vh; overflow-x: hidden; }
.landing-nav {
  position: fixed; top: 0; left: 0; right: 0; height: 64px;
  background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); z-index: 50;
  display: flex; align-items: center; justify-content: space-between; padding: 0 32px;
}
.landing-nav-brand { display: flex; align-items: center; gap: 10px; }
.landing-nav-brand .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}
.landing-nav-brand .logo svg { width: 22px; height: 22px; }
.landing-nav-brand .name { font-size: 18px; font-weight: 700; color: var(--text); }
.landing-nav-links { display: flex; gap: 28px; align-items: center; }
.landing-nav-links a { color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.landing-nav-links a:hover { color: var(--primary); }
.landing-nav-actions { display: flex; gap: 10px; }

.landing-hero {
  padding: 140px 32px 80px; text-align: center; background: var(--bg-grad); position: relative; overflow: hidden;
}
.landing-hero::before {
  content: ''; position: absolute; width: 800px; height: 800px; border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.08) 0%, transparent 70%);
  top: -300px; left: 50%; transform: translateX(-50%);
}
.landing-hero h1 {
  font-size: 48px; font-weight: 700; margin: 0 0 16px;
  background: linear-gradient(135deg, #0c447c 0%, #0ea5e9 50%, #06b6d4 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1.2; letter-spacing: -1px; position: relative;
}
.landing-hero .subtitle { font-size: 18px; color: var(--text-secondary); max-width: 640px; margin: 0 auto 32px; line-height: 1.7; position: relative; }
.landing-hero .cta-group { display: flex; gap: 14px; justify-content: center; position: relative; }
.landing-hero .cta {
  padding: 13px 32px; border-radius: var(--radius-md); font-size: 15px; font-weight: 600;
  transition: var(--transition); display: inline-flex; align-items: center; gap: 8px;
}
.landing-hero .cta-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%); color: #fff; box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3); }
.landing-hero .cta-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4); }
.landing-hero .cta-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
.landing-hero .cta-secondary:hover { border-color: var(--primary); color: var(--primary); }

.landing-features { padding: 80px 32px; max-width: 1100px; margin: 0 auto; }
.section-title { text-align: center; font-size: 32px; font-weight: 700; color: var(--text); margin: 0 0 8px; }
.section-desc { text-align: center; color: var(--muted); font-size: 15px; margin: 0 0 48px; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px 24px; transition: var(--transition); text-align: center;
}
.feature-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.feature-icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--primary-bg);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.feature-icon svg { width: 24px; height: 24px; }
.feature-card h3 { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.feature-card p { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0; }

.landing-pricing { padding: 60px 32px; max-width: 1100px; margin: 0 auto; }
.landing-pricing .table { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); }
.landing-pricing .table th { background: var(--bg); }
.landing-footer { background: #0f172a; color: #94a3b8; padding: 40px 32px; text-align: center; }
.landing-footer .brand-line { color: #fff; font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.landing-footer a { color: #cbd5e1; }
.landing-footer a:hover { color: var(--primary); }

@media (max-width: 900px) {
  .landing-hero h1 { font-size: 36px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .landing-nav { padding: 0 16px; }
  .landing-nav-links { display: none; }
  .landing-hero { padding: 100px 20px 60px; }
  .landing-hero h1 { font-size: 28px; }
  .features-grid { grid-template-columns: 1fr; }
  .landing-features, .landing-pricing { padding: 50px 20px; }
}

/* 旧分屏登录/注册（保留兼容） */
/* 左右分栏登录/注册（门户风格） */
.auth-split-page {
  min-height: 100vh; display: flex; flex-direction: column; padding-top: 64px;
}
.auth-split-main {
  flex: 1; display: grid; grid-template-columns: 1fr 520px; min-height: calc(100vh - 64px);
}
.auth-split-left {
  min-width: 0; background: linear-gradient(160deg, #f0f9ff 0%, #e0f2fe 40%, #f8fafc 100%);
  color: var(--text); position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 64px;
}
.auth-split-left::before,
.auth-split-left::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
.auth-split-left::before {
  width: 520px; height: 520px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.14) 0%, transparent 70%);
  top: -160px; right: -120px;
}
.auth-split-left::after {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.10) 0%, transparent 70%);
  bottom: -120px; left: -80px;
}
.auth-split-decoration {
  position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: .035;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230c4a6e' stroke-width='1' stroke-linejoin='round'%3E%3Cpath d='M12 2L2 7l10 5 10-5-10-5z'/%3E%3Cpath d='M2 17l10 5 10-5'/%3E%3Cpath d='M2 12l10 5 10-5'/%3E%3C/svg%3E") no-repeat 110% 110%;
  background-size: 55% auto;
}
.auth-split-glow {
  position: absolute; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.18) 0%, transparent 65%);
  top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; z-index: 0;
}

.auth-split-left-inner {
  position: relative; z-index: 1; width: 100%; max-width: 520px;
  display: flex; flex-direction: column; gap: 32px;
}

.auth-split-brand { display: flex; align-items: center; gap: 14px; }
.auth-split-brand .logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.32);
  flex-shrink: 0;
}
.auth-split-brand .logo svg { width: 26px; height: 26px; }
.auth-split-brand .brand-text { display: flex; flex-direction: column; gap: 2px; }
.auth-split-brand h1 { font-size: 22px; margin: 0; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.auth-split-brand .subtitle { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }

.auth-split-intro {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  width: 100%;
  padding: 0;
}
.auth-split-intro .intro-tag {
  display: inline-flex; align-items: center; gap: 8px;
  width: fit-content; padding: 6px 14px; border-radius: 999px;
  background: rgba(255,255,255,0.65); border: 1px solid rgba(14, 165, 233, 0.18);
  font-size: 12px; color: var(--primary-dark); font-weight: 500; margin-bottom: 22px;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.06);
}
.auth-split-intro .intro-tag .tag-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 6px #22c55e;
}
.auth-split-intro h2 { font-size: 38px; margin: 0 0 18px; font-weight: 800; line-height: 1.18; letter-spacing: -0.5px; color: var(--text); }
.auth-split-intro h2 .title-line { display: block; }
.auth-split-intro h2 .title-line.accent {
  background: linear-gradient(135deg, #0c4a6e 0%, #0ea5e9 50%, #06b6d4 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.auth-split-intro .intro-desc {
  font-size: 15px; color: var(--text-secondary); line-height: 1.8; margin: 0 0 30px; max-width: 480px;
}

.auth-split-features {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 480px;
  margin-bottom: 28px;
}
.auth-split-feature {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-md); background: rgba(255,255,255,0.55);
  border: 1px solid rgba(226, 232, 240, 0.7); transition: .15s;
}
.auth-split-feature:hover { background: rgba(255,255,255,0.85); border-color: rgba(14, 165, 233, 0.25); transform: translateY(-1px); }
.auth-split-feature .icon-check {
  width: 20px; height: 20px; border-radius: 50%; background: #dcfce7; color: #16a34a;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px;
}
.auth-split-feature .icon-check svg { width: 12px; height: 12px; }
.auth-split-feature .feature-text { display: flex; flex-direction: column; gap: 2px; }
.auth-split-feature .feature-text strong { font-size: 13px; font-weight: 600; color: var(--text); }
.auth-split-feature .feature-text span { font-size: 12px; color: var(--muted); line-height: 1.4; }

.auth-split-stats {
  display: inline-flex; align-items: center; gap: 24px;
  padding: 18px 24px; border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.55); border: 1px solid rgba(226, 232, 240, 0.7);
  width: fit-content; backdrop-filter: blur(4px);
}
.auth-split-stat .num { font-size: 28px; font-weight: 800; color: var(--primary); line-height: 1; letter-spacing: -0.5px; }
.auth-split-stat .label { font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 500; }
.auth-split-stats .stat-divider { width: 1px; height: 32px; background: rgba(148, 163, 184, 0.25); }

.auth-split-foot { position: relative; z-index: 1; font-size: 12px; color: var(--muted); text-align: center; }

.auth-split-right {
  display: flex; align-items: center; justify-content: center;
  padding: 48px; background: #fff; position: relative;
}
.auth-split-card {
  width: 100%; max-width: 420px;
  padding: 40px 44px; background: #fff; border-radius: var(--radius-lg);
  box-shadow: 0 12px 44px rgba(15, 23, 42, 0.07); border: 1px solid rgba(226, 232, 240, 0.7);
}
.auth-split-card h2 { font-size: 26px; margin: 0 0 6px; font-weight: 700; color: var(--text); }
.auth-split-card .hint { font-size: 14px; color: var(--muted); margin: 0 0 28px; }
.auth-split-foot-link { text-align: center; margin-top: 24px; font-size: 14px; color: var(--muted); }
.auth-split-foot-link a { color: var(--primary); font-weight: 600; }
.legal-footer { text-align: center; padding: 18px 12px; color: var(--muted); font-size: 13px; background: #fff; border-top: 1px solid var(--border); }
.legal-footer a { color: var(--muted); }
.legal-footer a:hover { color: var(--primary); }
.legal-footer .sep { margin: 0 8px; color: var(--border); }

/* 身份选择卡片（通用） */
.role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.role-card {
  border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 14px 8px;
  cursor: pointer; text-align: center; background: #fff; transition: .15s;
}
.role-card .rc-icon { font-size: 24px; line-height: 1; }
.role-card .rc-title { font-size: 13px; font-weight: 600; margin-top: 8px; color: var(--text); }
.role-card:hover { border-color: var(--primary); }
.role-card.active { border-color: var(--primary); background: var(--primary-bg); box-shadow: 0 0 0 2px var(--primary-bg); }

/* 表单（登录/注册通用） */
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.auth-form input, .auth-form select {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 14px; background: #fff; color: var(--text);
}
.auth-form input:focus, .auth-form select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); outline: none; }
.form-label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.form-label .required { color: var(--danger); font-size: 12px; }
.row-sms { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.row-sms .btn { white-space: nowrap; height: 42px; padding: 0 16px; cursor: pointer; transition: opacity .2s, background .2s; }
.row-sms .btn:disabled { opacity: .55; cursor: not-allowed; }
.row-sms .btn.btn-loading { position: relative; color: transparent !important; }
.row-sms .btn.btn-loading::after {
  content: ''; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin: auto;
  border: 2px solid var(--primary-light); border-top-color: var(--primary);
  border-radius: 50%; animation: sms-spin .6s linear infinite;
}
@keyframes sms-spin { to { transform: rotate(360deg); } }

/* Mock 验证码大字显示 */
.sms-code-display {
  display: inline-block; font-size: 22px; font-weight: 700;
  letter-spacing: 4px; color: #059669; background: #ecfdf5;
  padding: 4px 12px; border-radius: 8px; margin: 0 4px;
  font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
  user-select: all; cursor: text;
}
.auth-form button[type="submit"] { padding: 13px; font-size: 15px; font-weight: 600; margin-top: 4px; }
.auth-form-msg { color: var(--danger); font-size: 13px; min-height: 18px; text-align: center; }
.auth-form label.agree-box {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0 6px;
}
.agree-box input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0 0;
  flex-shrink: 0;
  cursor: pointer;
}
.agree-box span { line-height: 1.5; }
.invite-hint-box {
  margin-top: 4px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: var(--radius-md);
  background: var(--bg); font-size: 13px; color: var(--text-secondary);
}
.invite-hint-box b { color: var(--primary-dark); }

@media (max-width: 900px) {
  .auth-split-main { grid-template-columns: 1fr; }
  .auth-split-left { display: none; }
  .auth-split-right { padding: 32px 20px; }
}
@media (max-width: 480px) {
  .auth-split-card { padding: 28px 22px; }
  .role-cards { grid-template-columns: 1fr; }
  .row-sms { grid-template-columns: 1fr; }
}

/* 门户风格登录/注册页 */
/* 自定义弹框 */
.zy-modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(4px);
  z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity .18s, visibility .18s;
}
.zy-modal-overlay.open { opacity: 1; visibility: visible; }
.zy-modal-card {
  background: #fff; border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--border); width: 100%; max-width: 420px;
  transform: translateY(-10px) scale(0.98); transition: transform .18s; overflow: hidden;
}
.zy-modal-overlay.open .zy-modal-card { transform: translateY(0) scale(1); }
.zy-modal-header { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.zy-modal-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.zy-modal-icon.info { background: var(--primary-bg); color: var(--primary); }
.zy-modal-icon.success { background: var(--success-bg); color: var(--success); }
.zy-modal-icon.warning { background: var(--warning-bg); color: var(--warning); }
.zy-modal-icon.danger { background: var(--danger-bg); color: var(--danger); }
.zy-modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.zy-modal-body { padding: 12px 20px 20px; font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.zy-modal-body textarea { width: 100%; margin-top: 10px; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; font-family: inherit; font-size: 13px; }
.zy-modal-body input[type="text"] { width: 100%; margin-top: 10px; }
.zy-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 20px; }
.zy-modal-footer .btn { min-width: 80px; }
.zy-modal-close {
  margin-left: auto; flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 6px; border: none;
  background: transparent; color: var(--muted);
  font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.zy-modal-close:hover { background: var(--bg); color: var(--text); }

/* 操作审计页优化 */
.audit-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.audit-stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; display: flex; align-items: center; gap: 12px; }
.audit-stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--primary-bg); color: var(--primary); }
.audit-stat-icon.ok { background: var(--success-bg); color: var(--success); }
.audit-stat-icon.fail { background: var(--danger-bg); color: var(--danger); }
.audit-stat-icon.today { background: var(--warning-bg); color: var(--warning); }
.audit-stat-label { font-size: 12px; color: var(--muted); }
.audit-stat-value { font-size: 20px; font-weight: 700; color: var(--text); margin-top: 2px; }
.audit-toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 14px;
}
.audit-toolbar input, .audit-toolbar select { min-width: 120px; padding: 8px 10px; font-size: 13px; }
.audit-toolbar .btn { padding: 8px 14px; }
.audit-table th, .audit-table td { padding: 12px 14px; }
.audit-table td { border-bottom: 1px solid var(--border-light); vertical-align: top; }
.audit-table tr:hover td { background: var(--card-hover); }
.audit-detail { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ 聊天 / 效果演练 通用头部与输入区 ============ */
.chat-header {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--border-light);
  background: #fff; position: relative;
}
.chat-header-avatar {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
  flex-shrink: 0;
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name {
  font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.chat-header-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.chat-header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.chat-header-tag {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  background: var(--primary-bg); color: var(--primary); font-weight: 600;
}
.chat-header-tag.is-busy { background: var(--warning-bg); color: var(--warning); }
.chat-header-tag.is-error { background: var(--danger-bg); color: var(--danger); }
.chat-header .btn-sm { padding: 6px 12px; font-size: 12px; }

.chat-composer {
  border-top: 1px solid var(--border-light); background: #fff;
}
.chat-composer-toolbar {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 8px 14px; border-bottom: 1px solid var(--border-light); background: #f8fafc;
  min-height: 44px;
}
.chat-composer-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-composer-hint {
  font-size: 12px; color: var(--muted); white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.chat-composer-hint b { color: var(--primary); font-weight: 600; }
.chat-composer-toolbar .icon-btn {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  cursor: pointer; transition: var(--transition);
}
.chat-composer-toolbar .icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.chat-composer-toolbar .icon-btn:disabled { opacity: .5; cursor: not-allowed; }
.chat-composer-area {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 12px 14px 14px;
}
.chat-composer-textarea {
  flex: 1; min-width: 0; min-height: 48px; max-height: 160px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
  font-size: 14px; line-height: 1.5; resize: none;
  font-family: inherit; background: #fff; color: var(--text);
  transition: var(--transition);
}
.chat-composer-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); outline: none; }
.chat-composer-textarea:disabled { background: #f1f5f9; color: var(--muted); }
.chat-composer-textarea::placeholder { color: var(--muted-light); }
.chat-send-btn {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: var(--primary); color: #fff;
  cursor: pointer; transition: var(--transition); flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}
.chat-send-btn:hover { background: var(--primary-dark); }
.chat-send-btn:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; box-shadow: none; }
.chat-composer-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 14px 10px; font-size: 11px; color: var(--muted-light);
}

/* ============ 聊天 / 效果演练 消息气泡 ============ */
.chat-body {
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px; overflow-y: auto; background: #f8fafc;
}
.chat-msg {
  display: flex; align-items: flex-start; gap: 12px;
  max-width: 85%; animation: chat-msg-in .25s ease-out both;
}
@keyframes chat-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg-ai { margin-right: auto; }
.chat-msg-user { margin-left: auto; flex-direction: row-reverse; }
.chat-msg-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.22);
}
.chat-msg-ai .chat-msg-avatar { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); box-shadow: 0 2px 6px rgba(99, 102, 241, 0.22); }
.chat-msg-user .chat-msg-avatar { background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%); }
.chat-msg-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chat-msg-content {
  padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.65;
  word-break: break-word; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.chat-msg-ai .chat-msg-content {
  background: #fff; color: var(--text); border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-msg-user .chat-msg-content {
  background: var(--primary); color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-content pre {
  margin: 8px 0; padding: 10px 12px; border-radius: 8px;
  background: #0f172a; color: #e2e8f0; font-size: 13px;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace; overflow-x: auto;
}
.chat-msg-content code {
  background: rgba(14, 165, 233, 0.10); color: var(--primary-dark);
  padding: 2px 5px; border-radius: 4px; font-size: 13px;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
}
.chat-msg-user .chat-msg-content code { background: rgba(255, 255, 255, 0.18); color: #fff; }
.chat-msg-thinking { color: var(--muted); font-style: italic; }
.chat-msg-meta {
  font-size: 11px; color: var(--muted); padding: 0 4px;
}
.chat-msg-error { color: var(--danger); }

/* 效果演练页：选中模型信息增强 */
.playground-header .chat-header-avatar {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

@media (max-width: 900px) { .audit-stats { grid-template-columns: repeat(2, 1fr); } .sidebar { width: 220px; } .main { margin-left: 220px; } }
@media (max-width: 768px) { .sidebar { transform: translateX(-100%); } .main { margin-left: 0; } .audit-stats { grid-template-columns: 1fr; } .audit-toolbar { flex-direction: column; align-items: stretch; } .toolbar { flex-direction: column; align-items: stretch; } }
@media (max-width: 640px) {
  .chat-header { padding: 12px 14px; gap: 10px; }
  .chat-header-avatar { width: 38px; height: 38px; font-size: 15px; }
  .chat-header-actions { gap: 6px; }
  .chat-header-name { font-size: 15px; }
  .chat-composer-toolbar { flex-wrap: wrap; gap: 8px; }
  .chat-composer-hint { width: 100%; }
  .chat-composer-area { padding: 10px 12px 12px; }
}

/* ============ 在线充值页 ============ */
.recharge-section { margin-bottom: 24px; }
.recharge-section-title { font-size: 15px; font-weight: 600; color: var(--text); margin: 0 0 14px 0; }
.recharge-type-tabs { display: flex; gap: 12px; margin-bottom: 22px; }
.recharge-type-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: #fff; color: var(--text-secondary);
  font-size: 14px; cursor: pointer; transition: var(--transition);
}
.recharge-type-tab.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); font-weight: 600; }
.recharge-type-tab:hover:not(.active) { border-color: #cbd5e1; }

.amount-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.amount-card {
  position: relative; background: #fff; border: 2px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 12px; text-align: center; cursor: pointer; transition: var(--transition);
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 108px;
}
.amount-card:hover { border-color: #cbd5e1; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.amount-card.active { border-color: var(--primary); background: var(--primary-light); box-shadow: 0 0 0 3px rgba(14,165,233,0.12); }
.amount-card .price { font-size: 22px; font-weight: 700; color: var(--text); }
.amount-card .check {
  position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); color: #fff; display: none; align-items: center; justify-content: center; font-size: 11px;
}
.amount-card.active .check { display: flex; }

.amount-card.custom { border-style: dashed; }
.amount-card.custom .custom-title { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.amount-card.custom .custom-sub { font-size: 12px; color: var(--muted-light); }
.amount-card.custom.active { border-style: solid; }
.amount-card .custom-input-wrap { display: none; width: 100%; margin-top: 8px; }
.amount-card.custom.active .custom-input-wrap { display: block; }
.amount-card.custom.active .custom-title,
.amount-card.custom.active .custom-sub { display: none; }
.amount-card.custom .custom-input {
  width: 100%; text-align: center; font-size: 16px; font-weight: 700;
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 6px;
}
.amount-card.custom .custom-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(14,165,233,0.12); }

.recharge-summary {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px; margin: 22px 0;
}
.recharge-summary-label { font-size: 14px; color: var(--text-secondary); }
.recharge-summary-value { font-size: 18px; font-weight: 700; color: var(--success); }

.pay-method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pay-method-card {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #fff; border: 2px solid var(--border); border-radius: var(--radius-md);
  padding: 14px; cursor: pointer; transition: var(--transition); font-size: 14px; color: var(--text-secondary);
}
.pay-method-card:hover { border-color: #cbd5e1; }
.pay-method-card.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; }
.pay-method-card .icon { width: 20px; height: 20px; }
.pay-method-card.disabled { opacity: 0.55; cursor: not-allowed; }

.recharge-submit {
  width: 100%; margin-top: 24px; padding: 14px; font-size: 16px; font-weight: 600;
  border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.recharge-submit:disabled { opacity: 0.7; cursor: not-allowed; }

.recharge-tips { margin-top: 14px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.recharge-tips a { color: var(--primary); text-decoration: underline; }

/* 充值确认弹窗 */
.recharge-modal-card { max-width: 420px; width: 92%; }
.recharge-modal-body { padding: 24px; }
.recharge-confirm-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border-light);
}
.recharge-confirm-row:last-child { border-bottom: none; }
.recharge-confirm-label { color: var(--text-secondary); font-size: 14px; }
.recharge-confirm-value { font-size: 15px; font-weight: 600; color: var(--text); }
.recharge-confirm-value.amount { color: var(--danger); font-size: 18px; }
.recharge-confirm-value.quota { color: #f59e0b; }
.recharge-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border-light); }

/* 二维码支付弹窗 */
.qr-modal-card { max-width: 380px; width: 92%; text-align: center; }
.qr-modal-body { padding: 28px 24px 24px; }
.qr-order-no { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.qr-amount { font-size: 32px; font-weight: 800; color: var(--primary); margin-bottom: 20px; }
.qr-img-wrap {
  width: 240px; height: 240px; margin: 0 auto 18px; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.qr-img-wrap img { width: 100%; height: 100%; object-fit: contain; }
.qr-hint { color: var(--text-secondary); font-size: 14px; margin-bottom: 8px; }
.qr-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.qr-status .spinner { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: qrSpin 1s linear infinite; }
@keyframes qrSpin { to { transform: rotate(360deg); } }
.qr-status.success { color: var(--success); }
.qr-status.error { color: var(--danger); }

@media (max-width: 768px) {
  .amount-grid { grid-template-columns: repeat(2, 1fr); }
  .pay-method-grid { grid-template-columns: 1fr; }
}

/* ============ 系统设置：Tab 布局 ============ */
.settings-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.settings-tabs {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 12px; box-shadow: var(--shadow-sm); position: sticky; top: 20px;
}
.settings-tab {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); transition: var(--transition); user-select: none;
}
.settings-tab:hover { background: var(--card-hover); color: var(--text); }
.settings-tab.active { background: var(--primary-bg); color: var(--primary-dark); font-weight: 600; }
.settings-tab .st-ico { width: 20px; text-align: center; opacity: .85; }
.settings-content { min-width: 0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.mt-16 { margin-top: 16px; }

/* 支付配置总览 chips */
.pay-modes-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pay-mode-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: 999px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-secondary);
}
.pay-mode-chip.alipay { border-color: rgba(22,119,255,.3); color: #1677FF; }
.pay-mode-chip.wechat.on { background: #e7f8ef; color: #0a7c3a; border-color: #bbf7d0; }
.pay-mode-chip.wechat.off { background: var(--danger-bg); color: #991b1b; border-color: #fecaca; }

/* 支付子卡片 */
.pay-subcard { border-left: 3px solid var(--primary); }
.pm-badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; color: #fff; }
.pm-badge.alipay { background: #1677FF; }
.pm-badge.wechat { background: #07C160; }

@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-tabs { position: static; flex-direction: row; flex-wrap: wrap; }
  .settings-tab { flex: 1 1 auto; justify-content: center; }
}

/* ========== 营业执照上传组件（缩略图预览） ========== */
.license-upload-box {
  border: 2px dashed var(--border); border-radius: 12px; padding: 12px;
  background: var(--bg); transition: border-color .2s, background .2s;
}
.license-upload-box:hover { border-color: var(--primary-light); }

.license-drop-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px 16px; cursor: pointer; border-radius: 8px;
  transition: background .2s; min-height: 100px;
}
.license-drop-zone:hover { background: var(--primary-bg); }
.license-drop-zone.license-drag-over {
  background: #ecfdf5; border-color: #10b981;
}
.license-drop-icon { font-size: 32px; margin-bottom: 6px; opacity: .7; }
.license-drop-text { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.license-drop-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.license-preview-grid {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px;
}
.license-thumb-item {
  position: relative; width: 96px; height: 72px;
  border-radius: 10px; overflow: hidden; border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: transform .15s, box-shadow .15s;
  cursor: pointer; flex-shrink: 0;
}
.license-thumb-item:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.14); }
.license-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.license-thumb-mask {
  position: absolute; inset: 0; top:auto;
  background: linear-gradient(transparent 40%, rgba(0,0,0,.55));
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 3px 5px;
}
.license-thumb-idx {
  font-size: 11px; color: rgba(255,255,255,.9); font-weight: 600;
  background: rgba(0,0,0,.35); padding: 1px 6px; border-radius: 4px;
}
.license-thumb-del {
  width: 22px; height: 22px; border: none; border-radius: 50%;
  background: rgba(239,68,68,.85); color: #fff; font-size: 15px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  line-height: 1; padding: 0; transition: background .15s;
}
.license-thumb-del:hover { background: #ef4444; }

.license-count-hint {
  font-size: 13px; font-weight: 500; margin-top: 6px;
}

/* 灯箱（点击放大） */
.license-lightbox-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); backdrop-filter: blur(6px);
  z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.license-lightbox-box {
  position: relative; max-width: 90vw; max-height: 85vh;
}
.license-lightbox-box img {
  max-width: 100%; max-height: 85vh; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.license-lightbox-close {
  position: absolute; top: -12px; right: -12px;
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(0,0,0,.7); color: #fff; font-size: 22px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 1; transition: background .15s;
}
.license-lightbox-close:hover { background: #000; }
