/* ===== 管理员控制台（/admin）· 深色渐变控制台风格 ===== */
:root {
  --ac-sidebar: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  --ac-primary: linear-gradient(135deg, #1769ff 0%, #5264e6 100%);
  --ac-teal: linear-gradient(135deg, #1cb99d 0%, #0e9f8a 100%);
  --ac-amber: linear-gradient(135deg, #f29a38 0%, #d66a25 100%);
  --ac-rose: linear-gradient(135deg, #f472b6 0%, #e14d6d 100%);
  --ac-card: #131a2a;
  --ac-line: #232c42;
  --ac-ink: #e5e7eb;
  --ac-muted: #8b96ad;
  --ac-faint: #5d6780;
  --ac-blue: #6d9aff;
  --ac-shadow: 0 10px 30px rgba(2, 8, 26, .45);
}

.ac-shell { display: flex; min-height: 100vh; background: #0b101c; color: var(--ac-ink); font-size: 13px; }

/* ---- 侧边栏 ---- */
.ac-sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 40;
  width: 252px; flex-shrink: 0; padding: 22px 16px;
  background: var(--ac-sidebar); overflow-y: auto;
  box-shadow: 4px 0 24px rgba(2, 8, 26, .5);
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent;
}
.ac-sidebar::-webkit-scrollbar { width: 5px; }
.ac-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 4px; }

.ac-brand { text-align: center; padding: 10px 0 22px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 20px; }
.ac-brand-logo { position: relative; display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 10px; border-radius: 50%; background: linear-gradient(135deg, rgba(23,105,255,.16), rgba(82,100,230,.16)); }
.ac-brand-logo::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 1.5px solid rgba(23,105,255,.22); animation: ac-spin 22s linear infinite; }
.ac-brand-logo i { font-size: 32px; color: #7db1ff; filter: drop-shadow(0 0 12px rgba(23,105,255,.65)); }
@keyframes ac-spin { to { transform: rotate(360deg); } }
.ac-brand h2 { margin: 0; color: #fff; font-size: 15px; letter-spacing: .02em; }
.ac-brand small { display: block; margin-top: 3px; color: var(--ac-faint); font-size: 9px; font-weight: 800; letter-spacing: .22em; }
.ac-admin-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 9px; padding: 4px 12px; border-radius: 999px; background: rgba(23,105,255,.14); border: 1px solid rgba(23,105,255,.32); color: #9cc3ff; font-size: 10px; font-weight: 800; letter-spacing: .08em; }

.ac-nav { display: grid; gap: 5px; }
.ac-nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 11px; overflow: hidden;
  color: #9aa5bd; font-size: 13px; font-weight: 600; text-decoration: none;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.ac-nav a::before { content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%; border-radius: 0 4px 4px 0; background: var(--ac-primary); transform: scaleY(0); transition: transform .2s ease; }
.ac-nav a:hover { background: rgba(23,105,255,.12); color: #fff; transform: translateX(3px); }
.ac-nav a:hover::before { transform: scaleY(1); }
.ac-nav a.active { background: var(--ac-primary); color: #fff; box-shadow: 0 8px 22px rgba(23,105,255,.32); }
.ac-nav a.active::before { display: none; }
.ac-nav a i { font-size: 19px; }
.ac-nav a:hover i { transform: scale(1.08); }

.ac-sidebar-foot { margin-top: 22px; padding: 14px; border: 1px dashed rgba(255,255,255,.12); border-radius: 12px; color: var(--ac-faint); font-size: 10.5px; line-height: 1.7; }
.ac-sidebar-foot a { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: #9aa5bd; font-size: 11px; text-decoration: none; }
.ac-sidebar-foot a:hover { color: #9cc3ff; }

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

/* ---- 页头 ---- */
.ac-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ac-page-head h1 { margin: 0 0 4px; color: #fff; font-size: 22px; letter-spacing: -.01em; }
.ac-page-head h1 i { margin-right: 9px; color: #7db1ff; }
.ac-page-head p { margin: 0; color: var(--ac-muted); font-size: 12px; }
.ac-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border: 0; border-radius: 10px; background: var(--ac-primary); color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; transition: filter .16s ease, transform .16s ease; }
.ac-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.ac-btn:disabled { opacity: .55; cursor: wait; }
.ac-btn--ghost { background: transparent; border: 1px solid var(--ac-line); color: #9aa5bd; }
.ac-btn--ghost:hover { border-color: #3d4a6b; color: #c7d2fe; transform: none; filter: none; }
.ac-btn--teal { background: var(--ac-teal); }

/* ---- 欢迎卡 ---- */
.ac-welcome {
  position: relative; overflow: hidden; margin-bottom: 16px; padding: 24px 28px;
  border: 1px solid rgba(23,105,255,.28); border-radius: 16px; color: #fff;
  background: linear-gradient(120deg, #122052 0%, #17307c 55%, #14459c 100%);
  box-shadow: var(--ac-shadow);
}
.ac-welcome::after { content: ""; position: absolute; right: -70px; top: -90px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(28,185,157,.28), transparent 65%); }
.ac-welcome h2 { margin: 0 0 6px; font-size: 19px; }
.ac-welcome p { margin: 0; color: #b9cdf5; font-size: 12.5px; line-height: 1.7; }
.ac-welcome .ac-date { position: absolute; right: 26px; top: 24px; text-align: right; color: #9cc3ff; font-size: 11px; line-height: 1.8; }
.ac-welcome .ac-date b { display: block; font-size: 22px; color: #fff; }

/* ---- 统计卡 ---- */
.ac-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.ac-stat {
  position: relative; overflow: hidden; padding: 18px 20px;
  border: 1px solid var(--ac-line); border-radius: 14px; background: var(--ac-card);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.ac-stat::before, .ac-stat::after { content: ""; position: absolute; border-radius: 50%; opacity: .5; transition: opacity .22s ease; }
.ac-stat::before { right: -28px; top: -34px; width: 104px; height: 104px; background: rgba(23,105,255,.08); }
.ac-stat::after { right: -12px; bottom: -42px; width: 84px; height: 84px; background: rgba(28,185,157,.07); }
.ac-stat:hover { transform: translateY(-4px); border-color: #33405f; box-shadow: var(--ac-shadow); }
.ac-stat:hover::before, .ac-stat:hover::after { opacity: 1; }
.ac-stat-top { display: flex; align-items: center; gap: 12px; }
.ac-stat-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; color: #fff; font-size: 22px; box-shadow: 0 8px 20px rgba(2,8,26,.4); }
.ac-stat-icon.is-blue { background: var(--ac-primary); }
.ac-stat-icon.is-teal { background: var(--ac-teal); }
.ac-stat-icon.is-amber { background: var(--ac-amber); }
.ac-stat-icon.is-rose { background: var(--ac-rose); }
.ac-stat-label { color: var(--ac-muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.ac-stat-value { position: relative; z-index: 1; margin: 12px 0 4px; color: #fff; font-size: 28px; font-weight: 800; line-height: 1.1; }
.ac-stat-value.is-amber { color: #fbbf24; }
.ac-stat-value.is-teal { color: #34d399; }
.ac-stat-sub { position: relative; z-index: 1; color: var(--ac-faint); font-size: 10.5px; line-height: 1.6; }

/* ---- 通用卡片 ---- */
.ac-card { border: 1px solid var(--ac-line); border-radius: 14px; background: var(--ac-card); padding: 20px 22px; }
.ac-card + .ac-card { margin-top: 14px; }
.ac-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: #fff; font-size: 14px; }
.ac-card h3 i { color: #7db1ff; font-size: 17px; }
.ac-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ac-grid-31 { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; align-items: start; }
.ac-muted { color: var(--ac-muted); }
.ac-faint { color: var(--ac-faint); }

/* ---- 防幻觉三格 ---- */
.ac-tiles { display: flex; gap: 12px; flex-wrap: wrap; }
.ac-tile { flex: 1; min-width: 130px; padding: 14px; border-radius: 12px; border: 1px solid; }
.ac-tile b { display: block; font-size: 22px; margin-bottom: 3px; }
.ac-tile small { color: var(--ac-muted); font-size: 11px; line-height: 1.55; display: block; }
.ac-tile.is-ok { background: rgba(16,185,129,.09); border-color: rgba(16,185,129,.3); }.ac-tile.is-ok b { color: #34d399; }
.ac-tile.is-warn { background: rgba(245,158,11,.09); border-color: rgba(245,158,11,.3); }.ac-tile.is-warn b { color: #fbbf24; }
.ac-tile.is-bad { background: rgba(239,68,68,.09); border-color: rgba(239,68,68,.3); }.ac-tile.is-bad b { color: #f87171; }
.ac-note { margin: 14px 0 0; color: var(--ac-faint); font-size: 11px; line-height: 1.75; }

/* ---- 进度条 / 大数字 ---- */
.ac-bignum { display: flex; align-items: baseline; gap: 10px; }
.ac-bignum b { font-size: 34px; font-weight: 800; }
.ac-bignum.is-ok b { color: #34d399; }.ac-bignum.is-warn b { color: #fbbf24; }
.ac-bignum small { color: var(--ac-muted); }
.ac-bar { height: 8px; border-radius: 6px; background: var(--ac-line); overflow: hidden; margin: 10px 0; }
.ac-bar i { display: block; height: 100%; border-radius: inherit; }
.ac-bar i.is-ok { background: linear-gradient(90deg, #10b981, #34d399); }
.ac-bar i.is-warn { background: linear-gradient(90deg, #d97706, #f59e0b); }

/* ---- 表格 ---- */
.ac-table-wrap { overflow: auto; max-height: 340px; border-radius: 10px; border: 1px solid var(--ac-line); }
.ac-table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.ac-table-wrap::-webkit-scrollbar-thumb { background: #2a3552; border-radius: 4px; }
.ac-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ac-table thead th { position: sticky; top: 0; z-index: 1; padding: 9px 12px; text-align: left; color: var(--ac-muted); background: #101725; font-weight: 700; white-space: nowrap; }
.ac-table tbody td { padding: 9px 12px; border-top: 1px solid rgba(35,44,66,.7); color: #c4cde0; }
.ac-table tbody tr:hover td { background: rgba(23,105,255,.06); }
.ac-pass { color: #34d399; font-weight: 700; }
.ac-miss { color: #f87171; font-weight: 700; }
.ac-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #1c2438; color: #9aa5bd; font-size: 10.5px; margin: 0 6px 6px 0; }

/* ---- Agent 监控 ---- */
.ac-group-label { display: block; margin: 14px 0 6px; color: var(--ac-faint); font-size: 10.5px; font-weight: 800; letter-spacing: .1em; }
.ac-agent { display: flex; align-items: center; gap: 14px; margin-top: 8px; padding: 15px 18px; border: 1px solid var(--ac-line); border-radius: 14px; background: var(--ac-card); transition: border-color .18s ease, transform .18s ease; }
.ac-agent:hover { border-color: #33405f; transform: translateX(3px); }
.ac-agent-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: rgba(23,105,255,.16); flex-shrink: 0; }
.ac-agent-icon i { color: #7db1ff; font-size: 20px; }
.ac-agent-body { flex: 1; min-width: 0; }
.ac-agent-body b { color: #fff; font-size: 13px; }
.ac-agent-body small { color: var(--ac-muted); font-size: 11px; margin-left: 6px; }
.ac-agent-body .ac-agent-detail { margin-top: 3px; color: var(--ac-faint); font-size: 11px; }
.ac-agent-usage { text-align: right; color: var(--ac-muted); font-size: 11px; white-space: nowrap; }

.ac-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.ac-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent); }
.ac-badge.is-ok { background: rgba(16,185,129,.14); color: #34d399; }
.ac-badge.is-warn { background: rgba(245,158,11,.14); color: #fbbf24; }
.ac-badge.is-bad { background: rgba(239,68,68,.14); color: #f87171; }

/* ---- 知识库选择器 ---- */
.ac-kb { display: block; width: 100%; text-align: left; margin-bottom: 8px; padding: 11px 13px; border: 1px solid var(--ac-line); border-radius: 11px; background: #101725; color: #c7d2fe; cursor: pointer; transition: border-color .16s ease, background .16s ease; }
.ac-kb:hover { border-color: #33405f; }
.ac-kb.active { border-color: #1769ff; background: rgba(23,105,255,.14); }
.ac-kb b { font-size: 12.5px; }
.ac-kb small { display: block; margin-top: 3px; color: var(--ac-faint); font-size: 10.5px; }
.ac-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- 纠错队列 ---- */
.ac-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ac-filter { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--ac-line); background: #101725; color: #9aa5bd; font-size: 12px; cursor: pointer; transition: border-color .15s ease, color .15s ease; }
.ac-filter:hover { border-color: #3d4a6b; color: #c7d2fe; }
.ac-filter.active { border-color: #1769ff; background: rgba(23,105,255,.14); color: #c7d2fe; font-weight: 700; }
.ac-correction { border: 1px solid var(--ac-line); border-radius: 14px; background: var(--ac-card); padding: 16px 18px; }
.ac-correction + .ac-correction { margin-top: 10px; }
.ac-correction__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ac-correction__head b { color: #fff; font-size: 13.5px; line-height: 1.5; }
.ac-correction__meta { margin-top: 5px; color: var(--ac-muted); font-size: 11px; }
.ac-correction__ops { display: flex; gap: 8px; margin-top: 12px; align-items: stretch; }
.ac-correction__ops textarea { flex: 1; padding: 10px 12px; border: 1px solid #2a3552; border-radius: 10px; background: #0d1322; color: var(--ac-ink); font-size: 12px; resize: vertical; outline: none; font-family: inherit; }
.ac-correction__ops textarea:focus { border-color: #1769ff; }
.ac-correction__ops .ac-ops-col { display: flex; flex-direction: column; gap: 6px; }
.ac-btn--ok { background: var(--ac-teal); }
.ac-answer-box { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(16,185,129,.08); color: #86efac; font-size: 12px; white-space: pre-wrap; }
.ac-empty { padding: 40px; text-align: center; color: var(--ac-muted); }

/* ---- 加载/过渡 ---- */
.ac-loading { padding: 70px; text-align: center; color: var(--ac-muted); }
.ac-loading i { font-size: 32px; }
.ac-spin { animation: ac-spin-fast 1s linear infinite; }
@keyframes ac-spin-fast { to { transform: rotate(360deg); } }
.page-fade-enter-active, .page-fade-leave-active { transition: opacity .16s ease, transform .16s ease; }
.page-fade-enter-from, .page-fade-leave-to { opacity: 0; transform: translateY(6px); }

@media (max-width: 1100px) {
  .ac-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ac-grid-2, .ac-grid-31 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .ac-sidebar { width: 200px; padding: 16px 10px; }
  .ac-main { margin-left: 200px; }
  .ac-stats { grid-template-columns: 1fr; }
}
