:root {
  --bg: #f3f6fb;
  --bg-glow: radial-gradient(1100px 520px at 8% -10%, rgba(37, 99, 235, 0.10), transparent 62%),
             radial-gradient(900px 460px at 100% 0%, rgba(14, 165, 233, 0.09), transparent 58%);
  --panel: #ffffff;
  --panel-2: #ffffff;
  --panel-3: #f7f9fd;
  --line: #e5eaf3;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #5b6b84;
  --muted-2: #64748b;
  --brand: #2563eb;
  --brand-2: #0ea5e9;
  --brand-soft: #eaf2ff;
  --ok: #047857;
  --ok-soft: #e8f8f2;
  --warn: #b45309;
  --warn-soft: #fff7e6;
  --err: #dc2626;
  --err-soft: #fdeeee;
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar: 250px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.14);
  --font: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: 0.2px; }

.app { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  padding: 16px;
  border-right: 1px solid var(--line);
  background: #ffffff;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand { display: flex; gap: 8px; align-items: center; padding: 0 8px; }

.logo {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: 0.5px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.brand-name { font-size: 16px; font-weight: 700; letter-spacing: 0.6px; color: #0b1730; }
.brand-sub { font-size: 11px; color: var(--muted-2); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 16px; }

.nav-item {
  display: flex; align-items: center; gap: 8px;
  min-height: 40px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: 0.18s;
}

.nav-item .ico {
  flex: 0 0 20px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  text-align: center; opacity: 0.7; font-size: 14px;
}

.nav-item:hover { background: #f3f7fd; color: var(--text); }

.nav-item.active {
  background: linear-gradient(90deg, #e8f0ff, #f6faff);
  border-color: rgba(37, 99, 235, 0.28);
  color: #1d4ed8;
  box-shadow: inset 3px 0 0 var(--brand);
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 8px; }

.queue-pill {
  padding: 8px; border-radius: 10px;
  background: #f5f8fd;
  border: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}

.engine-line { font-size: 11px; color: var(--muted-2); word-break: break-all; }

.sidebar-account {
  display: flex; align-items: center; gap: 10px;
  margin-top: 4px; padding: 12px 6px 2px;
  border-top: 1px solid var(--line);
}
.sa-avatar {
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 13px; font-weight: 700;
}
.sa-body { flex: 1; min-width: 0; }
.sa-name { font-size: 12.5px; font-weight: 600; color: #14213b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-sub { font-size: 10.5px; color: var(--muted-2); margin-top: 2px; }
.sa-logout {
  border: none; background: transparent; color: var(--muted);
  font-family: inherit; font-size: 11px; cursor: pointer;
  padding: 4px 6px; border-radius: 6px;
}
.sa-logout:hover { color: var(--err); background: #fdeeee; }
.sa-login {
  flex: 0 0 auto;
  padding: 4px 8px; border-radius: 7px;
  color: var(--brand); font-size: 11px; font-weight: 600;
  background: var(--brand-soft);
}
.sa-login:hover { background: #dbe9ff; text-decoration: none; }

/* ---------- 主区域 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
}

.page-title { font-size: 20px; font-weight: 700; color: #0b1730; }
.page-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.content { padding: 24px 30px 48px; max-width: 1280px; width: 100%; }
/* 管理后台在大屏下加宽并居中，避免右侧留下大片空白 */
#adminApp .content { max-width: 1600px; margin: 0 auto; }

/* ---------- 极简转写主区 ---------- */
#view-transcribe { max-width: 920px; margin: 0 auto; }
.hero { text-align: center; padding: 52px 12px 30px; }
.hero-title { font-size: 30px; font-weight: 700; letter-spacing: 0.5px; color: #0b1730; }
.hero-sub { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.composer {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}
.composer-drop {
  min-height: 168px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}
.composer-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 14px; flex-wrap: wrap;
}
.composer-model { flex: 1; min-width: 260px; display: flex; align-items: center; gap: 10px; }
.composer-model .field-label { margin: 0; white-space: nowrap; }
.composer-model .model-select { flex: 1; min-width: 0; }
.composer-model .mt-tags { display: none; }
.composer-model .mt-main { gap: 0; }
.composer-actions { display: flex; align-items: center; gap: 12px; }
.result-card { max-width: 920px; margin: 22px auto 0; }

/* ---------- 音频来源切换与麦克风录音 ---------- */
.composer-modes {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 12px;
  background: #f3f7fd; border: 1px solid var(--line); border-radius: 12px;
}
.mode-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: 0.18s;
}
.mode-tab:hover { color: var(--text); }
.mode-tab.active { background: #fff; color: #1d4ed8; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08); }
.mode-ico { font-size: 11px; opacity: 0.8; }
.record-panel {
  min-height: 168px;
  padding: 22px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  text-align: center;
  border: 1.5px dashed #c9d6e8; border-radius: 14px;
  background: #f9fbff; transition: 0.2s;
}
.record-panel.recording { border-color: #f0a3a3; background: #fff8f8; }
.rec-btn {
  position: relative;
  width: 62px; height: 62px; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff; cursor: pointer;
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.28);
  transition: 0.18s;
}
.rec-btn:hover:not(:disabled) { transform: translateY(-1px); }
.rec-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.rec-btn.recording::after {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(220, 38, 38, 0.45);
  animation: recpulse 1.4s ease-out infinite;
}
@keyframes recpulse {
  from { transform: scale(0.92); opacity: 0.9; }
  to { transform: scale(1.22); opacity: 0; }
}
.rec-state { font-size: 13px; font-weight: 600; color: #17233d; }
.rec-timer { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: 1px; color: #0b1730; }
.rec-meter { width: min(320px, 80%); height: 6px; border-radius: 999px; background: #e6edf8; overflow: hidden; }
.rec-meter span {
  display: block; height: 100%; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c55e, #eab308 70%, #ef4444);
  transition: width 0.1s linear;
}
.rec-hint { font-size: 11.5px; color: var(--muted-2); }

.view { display: none; animation: fade 0.25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 基础组件 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: #f1f5f9;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); border-color: #bfe9d9; color: var(--ok); }
.badge-warn { background: var(--warn-soft); border-color: #fde3b0; color: var(--warn); }
.badge-err { background: var(--err-soft); border-color: #f7c8c8; color: var(--err); }
.badge-brand { background: var(--brand-soft); border-color: #c7dbff; color: #1d4ed8; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  min-width: 0;
}

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { font-size: 15px; color: #0b1730; }

.hint { font-size: 11px; color: var(--muted-2); }
.hint-block { font-size: 12px; color: var(--muted); line-height: 1.7; }
.hint-block.warn { color: var(--warn); }

.grid-2 { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 18px; align-items: start; }
.grid-2 > * { min-width: 0; }
/* 访客访问页：在线列表窄、访问记录宽 */
.visitors-grid { grid-template-columns: 0.85fr 1.15fr; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px;
  border: 1px solid transparent;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: 0.18s; white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #2f6ef0, #1d4ed8);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(37, 99, 235, 0.36); }
.btn-ghost { background: #f5f8fd; border-color: var(--line); color: #334155; }
.btn-ghost:hover:not(:disabled) { background: #eaf1fb; }
.btn-danger-ghost { background: #fef2f2; border-color: #f6cfcf; color: var(--err); }
.btn-danger-ghost:hover:not(:disabled) { background: #fee2e2; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line);
  background: #f5f8fd; color: var(--muted); font-size: 18px;
  cursor: pointer; line-height: 1;
}
.icon-btn:hover { color: var(--text); background: #eaf1fb; }

.field { margin-top: 18px; }
.field-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }

.input, select.input, textarea.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #dbe3ee;
  background: #ffffff;
  color: var(--text);
  font-family: inherit; font-size: 13px;
  outline: none; transition: 0.18s;
}
.input::placeholder { color: #9aa8bc; }
.input:focus { border-color: rgba(37, 99, 235, 0.65); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13); }
textarea.input { resize: vertical; min-height: 80px; font-family: var(--mono); }
select.input { appearance: none; cursor: pointer; }

.check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); margin-top: 16px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

.form { display: flex; flex-direction: column; gap: 4px; }
.form .btn { margin-top: 18px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .field { margin-top: 0; }
.form-grid .span-2 { grid-column: span 2; }

/* ---------- 上传 ---------- */
.dropzone {
  border: 1.5px dashed #c9d6e8;
  border-radius: 14px;
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  background: #f9fbff;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--brand);
  background: #eef5ff;
}
.dz-icon {
  width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #e3edff, #e7f7ff);
  border: 1px solid #c7dbff;
  font-size: 20px; color: #1d4ed8;
}
.dz-title { font-size: 14px; font-weight: 600; color: #17233d; }
.dz-sub { font-size: 12px; color: var(--muted-2); margin-top: 8px; }

.file-info {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 14px; padding: 12px 14px;
  border-radius: 12px; border: 1px solid var(--line);
  background: #f9fbff;
}
.fi-row { display: flex; align-items: center; gap: 12px; }
.fi-icon {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-soft); color: #1d4ed8; font-size: 16px;
}
.fi-body { flex: 1; min-width: 0; }
.fi-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fi-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

.audio-player { display: flex; align-items: center; gap: 10px; padding: 2px 2px 0; }
.ap-btn {
  width: 30px; height: 30px; flex: 0 0 30px;
  border: none; border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid; place-items: center;
  font-size: 10px; line-height: 1;
  cursor: pointer; transition: 0.18s;
}
.ap-btn:hover { background: #1d4ed8; }
.ap-track-wrap { flex: 1; min-width: 0; display: flex; align-items: center; }
.ap-track {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 16px; margin: 0;
  background: transparent; cursor: pointer;
  --fill: 0%;
}
.ap-track::-webkit-slider-runnable-track {
  height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2) var(--fill), #e3eaf5 var(--fill));
}
.ap-track::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 10px; height: 10px; margin-top: -3px;
  border-radius: 50%; background: #fff; border: 2px solid var(--brand);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
}
.ap-track::-moz-range-track { height: 4px; border-radius: 999px; background: #e3eaf5; }
.ap-track::-moz-range-progress {
  height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.ap-track::-moz-range-thumb {
  width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 2px solid var(--brand);
}
.ap-track:focus-visible { outline: 2px solid rgba(37, 99, 235, 0.45); outline-offset: 3px; }
.ap-time {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted-2);
  white-space: nowrap; flex: 0 0 auto;
}
#audioEl { display: none; }

/* 模型选择下拉 */
.model-select { position: relative; }
.model-trigger {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #ffffff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: 0.18s;
}
.model-trigger:hover:not(:disabled) { border-color: #b9c9e2; background: #fbfdff; }
.model-trigger[aria-expanded="true"] {
  border-color: rgba(37, 99, 235, 0.65);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.model-trigger:disabled { opacity: 0.6; cursor: not-allowed; }
.mt-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mt-name { font-size: 14px; font-weight: 600; color: #14213b; }
.mt-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.mt-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.mt-price { font-size: 12px; font-weight: 600; color: #1d4ed8; white-space: nowrap; }
.mt-arrow { color: var(--muted-2); font-size: 12px; transition: 0.18s; }
.model-trigger[aria-expanded="true"] .mt-arrow { transform: rotate(180deg); }

.model-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 40;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  padding: 6px;
  max-height: 320px;
  overflow: auto;
}
.model-option {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: 0.15s;
}
.model-option:hover:not(:disabled) { background: #f6f9ff; }
.model-option.selected { background: #eef5ff; border-color: #c7dbff; }
.model-option.disabled { opacity: 0.5; cursor: not-allowed; }
.mo-main { min-width: 0; }
.mo-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mo-name { font-size: 13px; font-weight: 600; color: #14213b; }
.mo-desc { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.mo-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.mo-price { font-size: 11.5px; font-weight: 600; color: #1d4ed8; white-space: nowrap; }
.mo-check { color: var(--brand); font-size: 13px; }
.model-desc { margin-top: 8px; min-height: 16px; font-size: 11px; color: var(--muted-2); line-height: 1.6; }

.tag {
  display: inline-block; margin-left: 0; padding: 1px 6px; border-radius: 5px;
  background: #e6f7ff; color: #0369a1; font-size: 10px;
}

.submit-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; flex-wrap: wrap; }
.cost-hint { font-size: 12px; color: var(--muted); }

/* ---------- 结果 ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: #f1f5f9; color: var(--muted);
  border: 1px solid var(--line);
}
.pill.queued { background: var(--warn-soft); color: var(--warn); border-color: #fde3b0; }
.pill.running { background: var(--brand-soft); color: #1d4ed8; border-color: #c7dbff; }
.pill.done { background: var(--ok-soft); color: var(--ok); border-color: #bfe9d9; }
.pill.failed, .pill.cancelled { background: var(--err-soft); color: var(--err); border-color: #f7c8c8; }

.queue-progress { margin-bottom: 14px; }
.qp-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.progress { height: 6px; border-radius: 999px; background: #e8eef7; overflow: hidden; }
.progress-bar {
  height: 100%; width: 30%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  animation: slide 1.4s ease-in-out infinite;
}
@keyframes slide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }

.result-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 10px 12px; margin-bottom: 12px;
  border-radius: 10px; background: #f8fafc;
  border: 1px solid var(--line);
  font-size: 11px; color: var(--muted);
}
.result-text {
  min-height: 220px; max-height: 420px; overflow: auto;
  margin: 0; padding: 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  font-family: var(--font); font-size: 14px; line-height: 1.9;
  white-space: pre-wrap; word-break: break-word;
  color: #1e293b;
}
.result-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 560px; }
.table th {
  text-align: left; padding: 11px 14px; font-weight: 600; font-size: 11px;
  color: var(--muted-2); background: #f7f9fd;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid #eef2f8; color: #334155; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8fbff; }
.table .empty { text-align: center; color: var(--muted-2); padding: 26px 14px; }
.mono { font-family: var(--mono); font-size: 11.5px; }
.text-muted { color: var(--muted); }
.text-ok { color: var(--ok); }
.text-err { color: var(--err); }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat {
  padding: 16px; border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #ffffff, #f7faff);
}
.stat-label { font-size: 11px; color: var(--muted); }
.stat-value { font-size: 23px; font-weight: 700; margin-top: 8px; letter-spacing: 0.3px; color: #0b1730; }
.stat-sub { font-size: 11px; color: var(--muted-2); margin-top: 5px; }

/* ---------- 提示 ---------- */
.tips { font-size: 12px; color: var(--muted); }
.tips-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.tips ul { margin: 0; padding-left: 18px; line-height: 1.9; }

.banner {
  padding: 12px 16px; border-radius: 12px; margin-bottom: 16px;
  font-size: 13px; border: 1px solid;
}
.banner-warn { background: var(--warn-soft); border-color: #fde3b0; color: var(--warn); }
.banner-info { background: var(--brand-soft); border-color: #c7dbff; color: #1d4ed8; }
.banner-err { background: var(--err-soft); border-color: #f7c8c8; color: var(--err); }

/* ---------- API ---------- */
.api-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid #eef2f8;
  font-size: 12px;
}
.api-row:last-of-type { border-bottom: none; }
.method {
  padding: 2px 7px; border-radius: 5px; font-size: 10px; font-weight: 700;
  font-family: var(--mono); letter-spacing: 0.4px;
}
.method.post { background: #e8f8f2; color: var(--ok); }
.method.get { background: #e6f7ff; color: #0369a1; }
.method.del { background: var(--err-soft); color: var(--err); }
.api-row code { font-family: var(--mono); font-size: 11.5px; color: #1e293b; }
.api-desc { color: var(--muted-2); font-size: 11px; }

.code {
  margin: 0; padding: 14px; border-radius: 10px;
  background: #0f172a;
  border: 1px solid #1e293b;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.7;
  color: #a5e3ff; white-space: pre-wrap; word-break: break-all;
  max-height: 300px; overflow: auto;
}
.new-key { margin-top: 14px; }
.new-key .code { margin-top: 8px; color: #86efac; }

/* ---------- 账户 ---------- */
.profile { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.avatar {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-weight: 700; font-size: 18px; color: #fff;
}
.profile-name { font-size: 16px; font-weight: 700; }
.profile-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- 模态框 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal.hidden { display: none; }
.modal-card {
  width: 100%; max-width: 720px; max-height: 86vh;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 15px; }
.modal-body { padding: 20px; overflow: auto; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px);
  min-width: 220px; max-width: 80vw;
  padding: 12px 18px; border-radius: 11px;
  background: #ffffff; border: 1px solid var(--line-strong);
  color: var(--text); font-size: 13px;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: 0.25s; z-index: 120;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: #f2b8b8; color: var(--err); }
.toast.ok { border-color: #a7e3cf; color: var(--ok); }

.hidden { display: none !important; }

/* ---------- 后台二级菜单 ---------- */
.link-btn {
  padding: 0; border: 0; background: transparent;
  color: var(--brand); font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-parent { width: 100%; }
.nav-caret { margin-left: auto; font-size: 10px; transition: 0.18s; }
.nav-parent.open .nav-caret { transform: rotate(180deg); }
.nav-sub {
  display: none;
  flex-direction: column;
  gap: 4px;
  margin-left: 24px;
  padding: 0;
}
.nav-sub.open { display: flex; }
.nav-sub-item {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: 0.15s;
}
.nav-sub-item:hover { background: #f5f8fd; color: var(--text); }
.nav-sub-item.active { background: #e8f0ff; color: #1d4ed8; font-weight: 600; }

/* ---------- 滚动广告预览 ---------- */
.ad-preview {
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #eef1ff;
}
.ad-preview-track {
  display: inline-flex;
  white-space: nowrap;
  transform: translateX(var(--ad-start, 100%));
  animation: ad-preview-scroll var(--ad-duration, 20s) linear infinite;
}
.ad-preview-item { padding-right: 80px; font-size: 12.5px; color: #3f4a63; }
.ad-preview:hover .ad-preview-track { animation-play-state: paused; }
@keyframes ad-preview-scroll {
  from { transform: translateX(var(--ad-start, 100%)); }
  to { transform: translateX(var(--ad-end, -100%)); }
}

/* ---------- 管理后台 ---------- */
.admin-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: #ffffff; border: 1px solid var(--line);
  border-radius: 20px; padding: 30px; box-shadow: var(--shadow-lg);
}
.login-card .logo { margin: 0 auto 16px; width: 50px; height: 50px; }
.login-title { text-align: center; font-size: 18px; font-weight: 700; }
.login-sub { text-align: center; font-size: 12px; color: var(--muted); margin-top: 6px; margin-bottom: 22px; }

.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 6px 0 14px; font-size: 14px; font-weight: 600;
}
.section-title .hint { font-weight: 400; }

.chart {
  display: flex; align-items: flex-end; gap: 10px;
  height: 150px; padding: 10px 4px 0;
  min-width: 0;
}
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bar {
  width: 100%; max-width: 46px; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  min-height: 3px; transition: 0.3s;
  position: relative;
}
.chart-bar:hover { filter: brightness(1.08); }
.chart-label { font-size: 10px; color: var(--muted-2); white-space: nowrap; }
.chart-value { font-size: 10px; color: var(--muted); }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; color: var(--muted); }
.switch input { display: none; }
.switch-track {
  width: 38px; height: 21px; border-radius: 999px;
  background: #cbd5e1; position: relative; transition: 0.2s; flex: 0 0 38px;
}
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: 0.2s;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}
.switch input:checked + .switch-track { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.switch input:checked + .switch-track::after { left: 20px; }

.inline-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-disabled { opacity: 0.55; }

.modal-card.wide { max-width: 820px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); }

@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1200px) {
  .stat-grid.eight { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: static;
    padding: 14px 16px; border-right: none; border-bottom: 1px solid var(--line);
    flex-direction: row; align-items: center; gap: 14px; overflow-x: auto;
  }
  .brand { flex: 0 0 auto; }
  .brand-sub { display: none; }
  .nav { flex-direction: row; gap: 16px; }
  .nav-item { padding: 8px; font-size: 12px; white-space: nowrap; }
  .nav-item .ico { display: grid; }
  .nav-group { flex-direction: row; align-items: center; gap: 4px; }
  .nav-parent { display: flex; }
  .nav-sub { display: none; flex-direction: row; gap: 4px; margin: 0; padding: 0; }
  .nav-sub.open { display: flex; }
  .nav-sub-item { min-height: 32px; padding: 0 8px; font-size: 12px; white-space: nowrap; }
  .sidebar-foot {
    display: flex; flex-direction: row; align-items: center;
    margin: 0 0 0 auto; padding: 0; gap: 8px;
  }
  .sidebar-foot .queue-pill, .sidebar-foot .engine-line { display: none; }
  .sidebar-account { border-top: none; padding: 0; margin: 0; }
  .sa-body { display: none; }
  .topbar { padding: 16px 18px; flex-direction: column; align-items: flex-start; }
  .content { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .stat-grid.eight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-grid.two { grid-template-columns: 1fr; }
  .stat-grid.eight { grid-template-columns: 1fr; }
  .top-actions .badge { display: none; }
  .submit-row { flex-direction: column; align-items: stretch; }
  .submit-row .btn { width: 100%; }
  .chart { gap: 4px; }
  .chart-label, .chart-value { font-size: 9px; }
  .hero { padding: 34px 8px 22px; }
  .hero-title { font-size: 23px; }
  .composer { padding: 12px; }
  .composer-model { min-width: 100%; }
  .composer-actions { width: 100%; justify-content: space-between; }
}

/* ============================================================
   管理后台 · 绿色商务主题
   参考 static/CSS/green.css：绿色主色、浅灰底、白色卡片、玻璃拟态
   仅作用于 admin.html（body.admin-body），不影响前台页面
   ============================================================ */
body.admin-body {
  --bg: #F2F3F5;
  --bg-glow: none;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --panel-3: #F0F7F1;
  --line: #E5E6EB;
  --line-strong: #C9CDD4;
  --text: #1D2129;
  --muted: #4E5969;
  --muted-2: #86909C;
  --brand: #00B42A;
  --brand-2: #0E8C31;
  --brand-soft: #F0F7F1;
  --ok: #0E8C31;
  --ok-soft: #E8F8EC;
  --warn: #D25F00;
  --warn-soft: #FFF3E8;
  --err: #F53F3F;
  --err-soft: #FEECEC;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 240px;
  --shadow: 0 2px 8px rgba(29, 33, 41, 0.05);
  --shadow-lg: 0 16px 40px rgba(29, 33, 41, 0.16);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 460px at 6% -12%, rgba(0, 180, 42, 0.10), transparent 60%),
    radial-gradient(760px 420px at 100% 0%, rgba(14, 140, 49, 0.06), transparent 58%);
  background-attachment: fixed;
}

/* ---------- 侧边栏 ---------- */
#adminApp .sidebar {
  padding: 18px 14px;
  gap: 14px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid rgba(0, 180, 42, 0.12);
  box-shadow: 4px 0 24px rgba(0, 180, 42, 0.05);
}

#adminApp .brand {
  padding: 2px 6px 14px;
  border-bottom: 1px solid var(--line);
}

#adminApp .logo {
  background: linear-gradient(135deg, #00B42A 0%, #0E8C31 100%);
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(0, 180, 42, 0.28);
}

#adminApp .brand-name { color: var(--text); }

#adminApp .nav-item { border-radius: 8px; color: var(--muted); }
#adminApp .nav-item:hover { background: var(--brand-soft); color: var(--brand); }

#adminApp .nav-item.active {
  background: linear-gradient(135deg, #00B42A 0%, #0E8C31 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 180, 42, 0.22);
}
#adminApp .nav-item.active .ico { color: #fff; opacity: 1; }

#adminApp .nav-sub {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
#adminApp .nav-sub-item { border-radius: 7px; }
#adminApp .nav-sub-item:hover { background: var(--brand-soft); color: var(--brand); }
#adminApp .nav-sub-item.active {
  background: var(--ok-soft);
  color: var(--brand-2);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brand);
}

#adminApp .queue-pill {
  background: var(--brand-soft);
  border-color: rgba(0, 180, 42, 0.16);
  border-radius: 8px;
}
#adminApp .sa-avatar, #adminApp .avatar {
  background: linear-gradient(135deg, #00B42A 0%, #0E8C31 100%);
}
#adminApp .sa-logout:hover { background: var(--err-soft); color: var(--err); }
#adminApp .sa-login { background: var(--brand-soft); color: var(--brand-2); }
#adminApp .sa-login:hover { background: #E2F5E8; }

/* ---------- 整体布局 ---------- */
#adminApp {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}
#adminApp .sidebar {
  height: 100vh;
  position: static;
  overflow-y: auto;
  transition: width 0.28s ease, flex-basis 0.28s ease, padding 0.28s ease;
}
#adminApp .nav { flex: 1; min-height: 0; }
#adminApp .main {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

/* ---------- 顶栏与内容区 ---------- */
#adminApp .topbar {
  flex: 0 0 60px;
  height: 60px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(29, 33, 41, 0.03);
  z-index: 10;
}
#adminApp .topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
#adminApp .topbar-title { min-width: 0; }
#adminApp .page-title { font-size: 19px; color: var(--text); }
#adminApp .page-sub { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
#adminApp .content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 40px;
}

#adminApp .menu-toggle {
  width: 36px; height: 36px;
  flex: 0 0 36px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 17px; line-height: 1;
  cursor: pointer;
  transition: 0.15s;
}
#adminApp .menu-toggle:hover { background: var(--brand-soft); color: var(--brand); }

#adminApp .top-user {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
#adminApp .top-user:hover,
#adminApp .top-user:focus-visible,
#adminApp .top-user.open {
  background: var(--brand-soft);
  border-color: #C9EBD2;
  outline: none;
}
#adminApp .top-avatar {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #00B42A 0%, #0E8C31 100%);
  color: #fff; font-size: 12px; font-weight: 700;
}
#adminApp .top-user-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px; font-weight: 500;
  color: var(--text);
}
#adminApp .top-caret { font-size: 10px; color: var(--muted-2); }

/* 顶部昵称下拉菜单（复用账号弹窗视觉与关闭逻辑） */
#adminApp .top-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 120;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
#adminApp .top-menu.show {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}
#adminApp .top-menu-item {
  display: flex; align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 0; border-radius: 7px;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  color: #374151;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: 0.15s;
}
#adminApp .top-menu-item:hover {
  background: var(--brand-soft);
  color: var(--brand-2);
  text-decoration: none;
}
#adminApp .top-menu-item.danger { color: var(--err); }
#adminApp .top-menu-item.danger:hover { background: var(--err-soft); color: var(--err); }

/* ---------- 标签页栏 ---------- */
#adminApp .tabs-container {
  flex: 0 0 auto;
  padding: 8px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(29, 33, 41, 0.03);
}
#adminApp .tabs-wrapper {
  display: flex;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}
#adminApp .tabs-wrapper::-webkit-scrollbar { height: 4px; }
#adminApp .tabs-wrapper::-webkit-scrollbar-thumb { background: #D9EFE0; border-radius: 999px; }
#adminApp .tab-card {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.15s;
}
#adminApp .tab-card:hover { border-color: #C9EBD2; color: var(--brand-2); }
#adminApp .tab-card.active {
  background: linear-gradient(135deg, #00B42A 0%, #0E8C31 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 180, 42, 0.22);
}
#adminApp .tab-content { display: flex; align-items: center; gap: 6px; }
#adminApp .tab-ico { font-size: 12px; opacity: 0.9; }
#adminApp .tab-close {
  width: 16px; height: 16px;
  display: grid; place-items: center;
  border: 0; border-radius: 4px;
  background: transparent;
  color: inherit;
  font-size: 13px; line-height: 1;
  opacity: 0.6;
  cursor: pointer;
}
#adminApp .tab-close:hover { opacity: 1; background: rgba(0, 0, 0, 0.10); }

/* ---------- 侧边栏收起 ---------- */
#adminApp.collapsed .sidebar {
  width: 64px;
  flex: 0 0 64px;
  padding: 18px 8px;
}
#adminApp.collapsed .brand { justify-content: center; padding: 2px 0 14px; }
#adminApp.collapsed .brand-name,
#adminApp.collapsed .brand-sub,
#adminApp.collapsed .nav-label,
#adminApp.collapsed .nav-caret,
#adminApp.collapsed .nav-sub,
#adminApp.collapsed .sidebar-foot,
#adminApp.collapsed .sidebar .badge { display: none; }
#adminApp.collapsed .nav-item { justify-content: center; padding: 10px 0; }
#adminApp.collapsed .nav-item .ico { width: 24px; font-size: 17px; }
#adminApp .nav-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#adminApp .nav-sub-item { gap: 8px; }
#adminApp .nav-dot {
  width: 5px; height: 5px; flex: 0 0 5px;
  border-radius: 50%;
  background: #C9CDD4;
  transition: 0.15s;
}
#adminApp .nav-sub-item.active .nav-dot { background: var(--brand); }
#adminApp .nav-sub-item:hover .nav-dot { background: var(--brand); }

/* ---------- 卡片与统计 ---------- */
#adminApp .card {
  border-radius: 12px;
  border-color: var(--line);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease;
}
#adminApp .card:hover { box-shadow: 0 10px 24px rgba(0, 180, 42, 0.08); }
#adminApp .card-head h3 { font-size: 16px; color: var(--text); }

#adminApp .stat {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border-radius: 12px;
  border-color: var(--line);
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#adminApp .stat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--brand), #7BE188);
}
#adminApp .stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 180, 42, 0.12);
}
#adminApp .stat-value { color: var(--text); }

/* 运营概览：8 张统计卡压缩为一行 */
.stat-grid.eight { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
#adminApp .stat-grid.eight .stat { padding: 12px 10px 10px; }
#adminApp .stat-grid.eight .stat-label,
#adminApp .stat-grid.eight .stat-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#adminApp .stat-grid.eight .stat-label { font-size: 11px; }
#adminApp .stat-grid.eight .stat-value { font-size: 19px; margin-top: 6px; }
#adminApp .stat-grid.eight .stat-sub { font-size: 10px; margin-top: 4px; }

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.pager-btns { display: flex; align-items: center; gap: 8px; }
.pager-page { font-family: var(--mono); font-size: 12px; color: var(--text); }
.pager .btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- 表格 ---------- */
#adminApp .table-wrap { border-radius: 8px; border-color: var(--line); }
#adminApp .table th {
  padding: 12px 14px;
  background: var(--brand-soft);
  color: var(--brand-2);
  border-bottom-color: var(--line);
}
#adminApp .table td { border-bottom-color: #F2F3F5; }
#adminApp .table tbody tr:hover { background: var(--brand-soft); }

/* ---------- 按钮与表单 ---------- */
#adminApp .btn, .admin-login .btn { border-radius: 8px; }

#adminApp .btn-primary, .admin-login .btn-primary {
  background: linear-gradient(135deg, #00B42A 0%, #0E8C31 100%);
  box-shadow: 0 8px 20px rgba(0, 180, 42, 0.26);
}
#adminApp .btn-primary:hover:not(:disabled),
.admin-login .btn-primary:hover:not(:disabled) {
  box-shadow: 0 12px 24px rgba(0, 180, 42, 0.34);
}

#adminApp .btn-ghost {
  background: var(--brand-soft);
  border-color: #D9EFE0;
  color: var(--brand-2);
}
#adminApp .btn-ghost:hover:not(:disabled) { background: #E4F5E9; }

#adminApp .icon-btn {
  background: var(--brand-soft);
  border-color: #D9EFE0;
  color: var(--muted);
  border-radius: 8px;
}
#adminApp .icon-btn:hover { background: #E4F5E9; color: var(--brand-2); }

#adminApp .input,
#adminApp select.input,
#adminApp textarea.input,
.admin-login .input {
  border-color: var(--line-strong);
  border-radius: 8px;
  background: #fff;
}
#adminApp .input:focus,
#adminApp select.input:focus,
#adminApp textarea.input:focus,
.admin-login .input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 180, 42, 0.14);
}
#adminApp .check input { accent-color: var(--brand); }

/* ---------- 徽章与提示 ---------- */
#adminApp .badge-brand {
  background: var(--brand-soft);
  border-color: #C9EBD2;
  color: var(--brand-2);
}
#adminApp .badge-ok { background: var(--ok-soft); border-color: #BFE9CD; color: var(--ok); }
#adminApp .pill.running {
  background: var(--brand-soft);
  border-color: #C9EBD2;
  color: var(--brand-2);
}
#adminApp .banner-info {
  background: var(--brand-soft);
  border-color: #C9EBD2;
  color: var(--brand-2);
}
#adminApp .link-btn { color: var(--brand-2); }

/* ---------- 图表、进度与广告预览 ---------- */
#adminApp .chart-bar { background: linear-gradient(180deg, #34C759, #00B42A); }
#adminApp .progress { background: #EAF3EC; }
#adminApp .progress-bar { background: linear-gradient(90deg, #00B42A, #34C759); }
#adminApp .ad-preview { background: var(--brand-soft); border-color: #D9EFE0; }
#adminApp .ad-preview-item { color: var(--brand-2); }

/* ---------- 模态框 ---------- */
#adminApp .modal { background: rgba(29, 33, 41, 0.38); backdrop-filter: blur(4px); }
#adminApp .modal-card { border-radius: 12px; border-color: var(--line); }
#adminApp .modal-head { border-bottom-color: var(--line); }
#adminApp .modal-head h3 { color: var(--text); }
#adminApp .modal-foot { border-top-color: var(--line); }

/* ---------- 后台登录页 ---------- */
.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 6%;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #F0F7F1 0%, #E7F7ED 50%, #C1E2C9 100%);
}
.admin-login::before,
.admin-login::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.admin-login::before {
  width: 560px; height: 560px;
  right: -180px; top: -200px;
  background: radial-gradient(circle, rgba(0, 180, 42, 0.20), transparent 68%);
}
.admin-login::after {
  width: 440px; height: 440px;
  left: -140px; bottom: -180px;
  background: radial-gradient(circle, rgba(14, 140, 49, 0.16), transparent 68%);
}

.login-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 64px;
  width: 100%;
  max-width: 1160px;
  position: relative;
  z-index: 1;
}

.login-brand { flex: 1; min-width: 0; }

.login-brand-title {
  margin: 0 0 14px;
  font-size: clamp(52px, 7vw, 88px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #00B42A 0%, #0E8C31 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: 0 0 60px rgba(0, 180, 42, 0.30);
}
.login-brand-subtitle {
  margin: 0;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--muted-2);
}
.login-features {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 56px;
}
.login-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text);
}
.lf-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(0, 180, 42, 0.18);
  color: var(--brand);
  font-size: 16px;
  box-shadow: 0 6px 16px rgba(0, 180, 42, 0.10);
}

.admin-login .login-card {
  width: 420px;
  max-width: 420px;
  flex: 0 0 420px;
  padding: 42px 40px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.10),
    0 0 0 1px rgba(0, 180, 42, 0.05) inset;
  position: relative;
}
.admin-login .login-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
}
.admin-login .login-card .logo {
  width: 70px; height: 70px;
  margin: 0 auto 20px;
  border-radius: 12px;
  font-size: 20px;
  background: linear-gradient(135deg, #00B42A 0%, #0E8C31 100%);
  box-shadow: 0 10px 30px -10px rgba(0, 180, 42, 0.5);
}
.admin-login .login-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text);
}
.admin-login .login-sub { margin-bottom: 26px; }
.admin-login .login-card .field-label { font-size: 13px; color: var(--text); }
.admin-login .login-card .input { height: 40px; padding: 0 14px; }
.admin-login .login-card .btn {
  width: 100%;
  height: 40px;
  margin-top: 24px;
  font-size: 15px;
}
.admin-login .login-card .hint-block { color: var(--muted-2); }

@media (max-width: 980px) {
  .login-layout {
    flex-direction: column;
    gap: 36px;
    text-align: center;
  }
  .login-brand { display: flex; flex-direction: column; align-items: center; }
  .login-features { margin-top: 30px; justify-content: center; gap: 16px; }
  .login-brand-title { font-size: 48px; }
  .login-brand-subtitle { letter-spacing: 4px; }
  .admin-login .login-card { flex: none; width: 100%; max-width: 400px; padding: 32px 26px; }
}

@media (max-width: 860px) {
  #adminApp { height: auto; min-height: 100vh; overflow: visible; }
  #adminApp .main { height: auto; min-height: 0; overflow: visible; }
  #adminApp .sidebar { height: auto; overflow: visible; }
  #adminApp .nav-sub { margin-left: 0; padding-left: 0; border-left: 0; }
  #adminApp .content { overflow: visible; padding: 16px; }
  #adminApp .topbar { flex: none; height: auto; padding: 14px 16px; }
  #adminApp .tabs-container { padding: 8px 16px; }
  #adminApp .menu-toggle { display: none; }
  #adminApp .top-user { padding: 4px 8px; }
}

@media (max-width: 560px) {
  .login-features { display: none; }
  .admin-login { padding: 24px 18px; }
  #adminApp .top-user-name, #adminApp .top-caret { display: none; }
  #adminApp .top-user { padding: 4px; }
}
