/* ===== AI 中转站 · 用户中心 — Nuxt UI 风格 ===== */
:root {
  --primary: #059669;
  --primary-hover: #047857;
  --primary-tint: #ecfdf5;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #1f2328;
  --text-soft: #6b7280;
  --text-mute: #9ca3af;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05);
  --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.04);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.16);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  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;
}
.hidden { display: none !important; }
a { color: var(--primary); }

/* ===== 登录 / 注册（首页） ===== */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  gap: 56px; flex-wrap: wrap; padding: 40px 24px;
  background:
    radial-gradient(900px 520px at 18% 0%, #d1fae5 0%, transparent 55%),
    radial-gradient(700px 480px at 100% 100%, #e0f2fe 0%, transparent 55%),
    var(--bg);
}
.auth-hero { max-width: 420px; }
.auth-logo {
  width: 52px; height: 52px; border-radius: 14px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; margin-bottom: 18px;
}
.auth-title { font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.auth-tagline { color: var(--text-soft); font-size: 15px; margin: 10px 0 22px; line-height: 1.6; }
.auth-points { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.auth-points li {
  position: relative; padding-left: 26px; color: var(--text); font-size: 14px; line-height: 1.6;
}
.auth-points li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 18px; height: 18px; border-radius: 50%; background: var(--primary-tint);
  color: var(--primary); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.auth-box {
  background: var(--surface); padding: 32px 30px; border-radius: 16px;
  width: 380px; max-width: 100%; border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.auth-box .sub { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 20px; }
.auth-box .field { margin-bottom: 14px; }
.auth-box label { display: block; font-size: 12px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.auth-box input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
.auth-box input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5,150,105,.14);
}
.auth-box button.main {
  width: 100%; padding: 11px; border: none; border-radius: var(--radius);
  background: var(--primary); color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; margin-top: 8px; transition: background .15s;
}
.auth-box button.main:hover { background: var(--primary-hover); }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-soft); }
.auth-switch a { cursor: pointer; font-weight: 600; }

/* ===== 顶栏 ===== */
header {
  display: flex; align-items: center; gap: 16px; background: var(--surface);
  padding: 0 22px; height: 56px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
}
nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.tab {
  border: none; background: none; padding: 7px 14px; cursor: pointer;
  font-size: 13px; color: var(--text-soft); border-radius: 7px; transition: background .12s, color .12s;
}
.tab:hover { background: #f3f4f6; color: var(--text); }
.tab.active { background: var(--primary-tint); color: var(--primary); font-weight: 600; }
.balance-chip { font-size: 13px; color: var(--text-soft); white-space: nowrap; }
.balance-chip b { color: var(--primary); font-size: 15px; }
main { padding: 24px; max-width: 1120px; margin: 0 auto; }

.bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; gap: 12px; }
.bar h2 { font-size: 19px; font-weight: 700; }
.hint { color: var(--text-soft); font-size: 13px; margin-bottom: 18px; line-height: 1.7; }

/* ===== 按钮 ===== */
button.primary {
  background: var(--primary); color: #fff; border: none; padding: 8px 15px;
  border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; transition: background .15s;
}
button.primary:hover { background: var(--primary-hover); }
button.ghost {
  background: var(--surface); color: var(--text-soft); border: 1px solid var(--border-strong);
  padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; transition: background .15s, color .15s;
}
button.ghost:hover { background: #f9fafb; color: var(--text); }
button.mini {
  padding: 4px 10px; font-size: 12px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; margin-right: 6px; color: var(--text-soft);
  transition: background .12s, color .12s, border-color .12s;
}
button.mini:hover { background: #f3f4f6; color: var(--text); border-color: var(--border-strong); }
button.danger, button.mini.danger { color: #dc2626; }
button.mini.danger:hover { background: #fef2f2; border-color: #fecaca; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: #fafbfc; color: var(--text-soft); font-weight: 600; font-size: 12px; }
tr:last-child td { border-bottom: none; }
table tr:hover td { background: #fafafa; }
table tr:first-child:hover td { background: #fafbfc; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; }
.pill.on, .pill.ok { background: #ecfdf5; color: #059669; }
.pill.off, .pill.bad { background: #fef2f2; color: #dc2626; }
.pill.openai { background: #ecfdf5; color: #059669; }
.pill.anthropic { background: #fff7ed; color: #c2570c; }
code.key {
  background: #f3f4f6; padding: 2px 6px; border-radius: 5px; font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; word-break: break-all; color: #374151;
}
.model-icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 5px; }

/* ===== 概览卡片 ===== */
.summary { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.summary .card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; flex: 1; min-width: 150px; box-shadow: var(--shadow-sm);
}
.summary .card .n { font-size: 26px; font-weight: 800; }
.summary .card .l { font-size: 12px; color: var(--text-soft); margin-top: 4px; }

/* ===== 弹窗 ===== */
.modal {
  position: fixed; inset: 0; background: rgba(17,24,39,.45);
  display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(2px);
}
.modal-box {
  background: var(--surface); border-radius: 14px; padding: 24px; width: 460px;
  max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
.modal-box h3 { margin-bottom: 16px; font-size: 16px; font-weight: 700; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 6px; font-weight: 500; }
.field input, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 8px;
  font-size: 13px; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5,150,105,.14);
}
.field .tip { font-size: 12px; color: var(--text-mute); margin-top: 5px; line-height: 1.6; }
.row2 { display: flex; gap: 12px; }
.row2 .field { flex: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.err { color: #dc2626; font-size: 13px; margin-top: 10px; min-height: 18px; }
.pager { display: flex; gap: 10px; justify-content: center; margin-top: 18px; align-items: center; font-size: 13px; color: var(--text-soft); }

/* ===== 卡片容器 ===== */
.card-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.card-box h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.doc p { line-height: 1.8; margin: 6px 0; }
.doc h3 { margin-top: 18px; }
.doc h3:first-child { margin-top: 0; }
.doc pre {
  background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px;
  overflow-x: auto; font-size: 12px; line-height: 1.6; margin: 8px 0;
}
.redeem-row { display: flex; gap: 10px; }
.redeem-row input {
  flex: 1; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 8px; font-size: 13px;
}
.redeem-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5,150,105,.14); }

/* ===== toast ===== */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 10px 20px; border-radius: 10px;
  font-size: 13px; z-index: 200; box-shadow: var(--shadow-lg);
}

/* ===== 流畅过渡 ===== */
html { scroll-behavior: smooth; }
@keyframes panelIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.tab-panel:not(.hidden) { animation: panelIn .26s cubic-bezier(.2,.7,.2,1); }
table tr { animation: rowIn .22s ease both; }
.modal:not(.hidden) { animation: fadeIn .16s ease; }
.modal:not(.hidden) .modal-box { animation: modalIn .2s cubic-bezier(.2,.7,.2,1); }
.summary .card, .card-box { animation: panelIn .3s cubic-bezier(.2,.7,.2,1); }
.toast { animation: panelIn .2s ease; }
button, .tab, .pill, code.key, input, select, textarea, a { transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s, transform .12s; }
button.primary:active, button.ghost:active, button.mini:active, button.main:active, .tab:active { transform: scale(.97); }

/* 顶部加载条 */
#loadbar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--primary); z-index: 999; border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px var(--primary); opacity: 0;
  transition: width .3s ease, opacity .35s ease;
}
#loadbar.active { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tab-panel:not(.hidden), table tr, .modal:not(.hidden), .modal-box,
  .summary .card, .card-box, .toast { animation: none !important; }
}

/* 模型勾选框 */
.model-checklist {
  max-height: 160px; overflow-y: auto;
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 5px;
}
.model-checklist label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.model-checklist input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); flex-shrink: 0; }
