:root {
  --indigo: #4f46e5;
  --indigo-dark: #3730a3;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f6f7fb;
  --card: #ffffff;
  --green: #10b981;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
code { font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; font-size: 0.92em; }

/* 导航 */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--indigo), #7c3aed);
  display: grid;
  place-items: center;
}
.brand-mark svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-links {
  display: flex;
  gap: 26px;
  margin-left: auto;
  font-size: 14px;
  color: var(--muted);
}
.nav-links a:hover { color: var(--indigo); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-primary { background: var(--indigo); color: #fff; box-shadow: 0 6px 16px rgba(79, 70, 229, 0.24); }
.btn-primary:hover { background: var(--indigo-dark); }
.btn-light { background: #fff; color: var(--indigo-dark); }
.btn-ghost { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.28); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--indigo); color: var(--indigo); }

/* 首屏 */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(120deg, #312e81 0%, #4338ca 52%, #6366f1 100%);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: radial-gradient(ellipse at 70% 40%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 10%, transparent 72%);
}
.hero-inner {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 24px 84px;
}
.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 12px;
  letter-spacing: 0.4px;
}
.hero h1 {
  margin: 22px 0 18px;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: -1.5px;
}
.hero-sub {
  margin: 0;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  line-height: 1.8;
}
.hero-actions { display: flex; gap: 12px; margin-top: 30px; }
.hero-stats {
  display: flex;
  gap: 44px;
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  max-width: 600px;
}
.hero-stats div { display: flex; flex-direction: column; gap: 4px; }
.hero-stats strong { font-size: 20px; }
.hero-stats span { font-size: 12px; color: rgba(255, 255, 255, 0.66); }

/* 区块 */
.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 64px 24px 8px;
}
.section-head { margin-bottom: 26px; }
.section-head h2 {
  margin: 0 0 8px;
  font-size: 26px;
  letter-spacing: -0.5px;
}
.section-head p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.section-head p a { color: var(--indigo); font-weight: 600; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* 演示区 */
.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.demo-grid > .card { padding: 24px; }

.field-label {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}
.field-label:not(:first-child) { margin-top: 18px; }

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fbfcfe;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus,
.textarea:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  background: #fff;
}
.textarea { resize: vertical; line-height: 1.6; }

.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}
.hint { font-size: 12px; color: var(--muted); }

/* 结果 */
.result-card { min-height: 300px; display: flex; flex-direction: column; }
.empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
}
.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--indigo);
  background: rgba(79, 70, 229, 0.1);
}
.empty p { margin: 0 0 6px; font-weight: 600; color: #334155; }
.empty span { font-size: 12px; }

.result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.tag {
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--indigo-dark);
  font-size: 12px;
  font-weight: 600;
}
.result-meta { margin-left: auto; font-size: 12px; color: var(--muted); }

.cover {
  width: 100%;
  max-height: 210px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #eef2f7;
  display: block;
}
.result-title {
  margin: 14px 0 6px;
  font-size: 16px;
  line-height: 1.5;
  word-break: break-word;
}
.result-author { margin: 0 0 16px; font-size: 13px; color: var(--muted); }

.copy-row { display: flex; gap: 8px; }
.copy-row .input { flex: 1; font-size: 12px; }
.copy-row .btn { white-space: nowrap; padding: 10px 14px; }
.link-row { display: flex; gap: 10px; margin-top: 16px; }
.link-row a { font-size: 13px; color: var(--indigo); font-weight: 600; }
.link-row a:hover { text-decoration: underline; }

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.image-grid img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.error-box {
  margin: auto;
  text-align: center;
  max-width: 320px;
}
.error-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fef2f2;
  color: #dc2626;
  font-size: 22px;
  font-weight: 700;
}
.error-box h3 { margin: 0 0 8px; font-size: 15px; }
.error-box p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.7; }

/* 文档 */
.doc-card { padding: 26px; }
.endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.endpoint code { font-size: 15px; font-weight: 600; }
.method {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.method.post { background: var(--green); }
.tag-soft {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 999px;
}

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 6px 0 20px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; background: #fafbfd; white-space: nowrap; }
td code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 5px;
  color: #334155;
}

.code-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}
.code-block {
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
}
.code-title {
  padding: 10px 16px;
  font-size: 12px;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.7;
}
.code-block code { font-size: 12px; }

.doc-note {
  padding: 14px 16px;
  border-radius: 10px;
  background: #f8faff;
  border: 1px solid #e0e7ff;
  font-size: 13px;
  color: #475569;
  line-height: 1.8;
}
.doc-note code {
  background: #eef2ff;
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--indigo-dark);
}

/* 套餐 */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.plan {
  padding: 26px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.plan.featured { border-color: var(--indigo); box-shadow: 0 16px 40px rgba(79, 70, 229, 0.14); }
.plan-flag {
  position: absolute;
  top: -11px;
  right: 20px;
  background: var(--indigo);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.plan-name { font-size: 14px; color: var(--muted); font-weight: 600; }
.plan-limit {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 12px 0 18px;
}
.plan-limit strong { font-size: 34px; letter-spacing: -1px; }
.plan-limit span { font-size: 13px; color: var(--muted); }
.plan ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  font-size: 13px;
  color: #475569;
  line-height: 2.1;
  flex: 1;
}
.plan ul li::before { content: "✓"; color: var(--green); margin-right: 8px; font-weight: 700; }

/* 控制台 */
.console-card { padding: 24px; }
.console-row { display: flex; gap: 10px; }
.console-row .input { flex: 1; }
.usage-result { margin-top: 18px; }
.usage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.usage-item {
  padding: 16px;
  border-radius: 10px;
  background: #f8faff;
  border: 1px solid #e8edf7;
}
.usage-item span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.usage-item strong { font-size: 18px; }

/* 页脚 */
.footer {
  margin-top: 72px;
  background: #0f172a;
  color: #cbd5e1;
}
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  gap: 40px;
  justify-content: space-between;
  align-items: flex-start;
}
.footer strong { color: #fff; font-size: 15px; }
.footer p { margin: 6px 0 0; font-size: 12px; }
.disclaimer { max-width: 560px; line-height: 1.8; color: #94a3b8; }

/* 提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  background: #0f172a;
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 响应式 */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .demo-grid, .code-grid, .pricing-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 28px; }
  .usage-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { flex-direction: column; }
}
@media (max-width: 560px) {
  .hero-inner { padding: 52px 20px 64px; }
  .hero-actions { flex-wrap: wrap; }
  .section { padding-top: 48px; }
  .usage-grid { grid-template-columns: 1fr; }
  .console-row { flex-direction: column; }
}

/* 登录 / 注册 */
.auth-main {
  min-height: calc(100vh - 61px);
  display: grid;
  place-items: center;
  padding: 48px 20px;
}
.auth-card { width: 100%; max-width: 420px; padding: 28px; }
.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: #f1f5f9;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1;
  border: 0;
  padding: 9px 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.auth-tab.active { background: #fff; color: var(--indigo-dark); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08); }
.btn-block { width: 100%; margin-top: 22px; }
.auth-msg { margin: 14px 0 0; min-height: 18px; font-size: 13px; color: #dc2626; }
.auth-msg.ok { color: var(--green); }
.auth-foot { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.auth-foot a { color: var(--indigo); font-weight: 600; }

/* 控制台 / 后台 */
.page-shell { max-width: 1120px; margin: 0 auto; padding: 40px 24px 72px; }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.5px; }
.page-head p { margin: 0; font-size: 14px; color: var(--muted); }
.user-chip { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--indigo), #7c3aed);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card { padding: 18px 20px; }
.stat-card span { display: block; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.stat-card strong { font-size: 24px; letter-spacing: -0.5px; }
.stat-card.brand strong { color: var(--indigo); }

.progress { height: 8px; margin-top: 12px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--indigo), #7c3aed); }

.card-block { padding: 22px 24px; margin-bottom: 20px; }
.card-block h2 { margin: 0 0 6px; font-size: 17px; }
.card-block .sub { margin: 0 0 16px; font-size: 13px; color: var(--muted); line-height: 1.7; }

.key-display { display: flex; gap: 8px; flex-wrap: wrap; }
.key-display .input {
  flex: 1;
  min-width: 240px;
  font-family: "SF Mono", "JetBrains Mono", Menlo, monospace;
  font-size: 12px;
}

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { max-width: 280px; }
.toolbar .spacer { flex: 1; }
.select {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.status.off::before { background: #cbd5e1; }
.table-actions { display: flex; align-items: center; gap: 8px; }
.btn-danger { background: #fff; color: #dc2626; border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.data-table td { white-space: nowrap; }
.data-table td .email { display: block; font-size: 12px; color: var(--muted); }
.empty-row { padding: 30px 0; text-align: center; color: var(--muted); }
.mono { font-family: "SF Mono", "JetBrains Mono", Menlo, monospace; font-size: 12px; }

.mini-result {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #e8edf7;
  border-radius: 10px;
  background: #f8faff;
  font-size: 13px;
}
.mini-result h4 { margin: 0 0 6px; font-size: 14px; word-break: break-word; }
.mini-result p { margin: 0 0 10px; color: var(--muted); }
.mini-result .link-row { margin-top: 10px; }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page-shell { padding: 28px 20px 56px; }
  .key-display .input { min-width: 0; }
}

/* 管理后台 */
.admin-body { background: #f4f6fb; }
.admin-login[hidden],
.admin-shell[hidden],
.admin-view[hidden] { display: none; }

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

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 232px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--line);
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px;
}
.admin-brand strong { display: block; font-size: 15px; }
.admin-brand span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

.admin-nav { display: flex; flex-direction: column; gap: 4px; padding: 6px 12px; }
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.admin-nav-item svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.admin-nav-item:hover { background: #f5f7fb; color: var(--indigo); }
.admin-nav-item.active { background: rgba(79, 70, 229, 0.1); color: var(--indigo-dark); }

.admin-sidebar-foot { margin-top: auto; padding: 16px; border-top: 1px solid var(--line); }
.admin-account { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.admin-account strong { display: block; font-size: 13px; }
.admin-account .role { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.admin-sidebar-foot .btn { width: 100%; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 64px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.admin-topbar h1 { margin: 0; font-size: 18px; letter-spacing: -0.3px; }
.admin-topbar .topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.admin-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  place-items: center;
}
.admin-menu-btn svg { width: 18px; height: 18px; fill: none; stroke: #334155; stroke-width: 2; stroke-linecap: round; }

.admin-content { width: 100%; max-width: 1280px; padding: 24px; }
.admin-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.admin-columns .card-block { margin-bottom: 20px; }

.admin-stats .stat-card { display: flex; align-items: center; gap: 14px; }
.stat-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 11px;
  display: grid;
  place-items: center;
}
.stat-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.stat-icon.indigo { background: rgba(79, 70, 229, 0.1); color: var(--indigo); }
.stat-icon.green { background: rgba(16, 185, 129, 0.12); color: #059669; }
.stat-icon.sky { background: rgba(14, 165, 233, 0.12); color: #0284c7; }
.stat-icon.amber { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.stat-label { margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.admin-stats .stat-card strong { font-size: 22px; }

.block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.block-head .sub { margin-bottom: 0; }
.block-head + .toolbar,
.block-head + .table-wrap { margin-top: 16px; }

.plan-bars { margin-top: 6px; }
.plan-bar { margin-bottom: 16px; }
.plan-bar:last-child { margin-bottom: 0; }
.plan-bar-head { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; color: #475569; }
.plan-bar-track { height: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.plan-bar-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--indigo), #7c3aed); }

.usage-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.usage-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.usage-rank {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.usage-rank.top { background: rgba(79, 70, 229, 0.12); color: var(--indigo-dark); }
.usage-info { min-width: 0; flex: 1; }
.usage-info strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-info span { display: block; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-count { font-size: 13px; font-weight: 600; color: var(--indigo-dark); }

.platform-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 6px; }
.platform-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.platform-dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.platform-dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14); }
.platform-item strong { display: block; font-size: 13px; }
.platform-item span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

.table-user strong { display: block; font-size: 13px; }
.table-user span { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.key-chip {
  padding: 4px 8px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-family: "SF Mono", "JetBrains Mono", Menlo, monospace;
  font-size: 12px;
  cursor: pointer;
}
.key-chip:hover { border-color: var(--indigo); color: var(--indigo-dark); }

.endpoint-list { display: flex; flex-direction: column; gap: 10px; }
.endpoint-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  flex-wrap: wrap;
}
.endpoint-row code { font-size: 13px; font-weight: 600; }
.endpoint-desc { flex: 1; min-width: 160px; font-size: 12px; color: var(--muted); }
.method.get { background: #0ea5e9; }

/* 后台登录 */
.admin-login {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 46%, #4338ca 100%);
}
.admin-login::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 10%, transparent 72%);
}
.admin-login-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 32px 30px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.35);
}
.admin-login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.admin-login-brand strong { display: block; font-size: 17px; }
.admin-login-brand span { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.admin-login-sub { margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.admin-login-back { display: block; margin-top: 18px; text-align: center; font-size: 12px; color: var(--muted); }
.admin-login-back:hover { color: var(--indigo); }

@media (max-width: 960px) {
  .admin-menu-btn { display: grid; }
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 20px 0 50px rgba(15, 23, 42, 0.16);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-topbar { padding: 0 16px; }
  .admin-content { padding: 16px; }
  .admin-columns { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .admin-topbar h1 { font-size: 16px; }
  .topbar-right .tag-soft { display: none; }
  .admin-stats { grid-template-columns: 1fr; }
  .endpoint-row .method { order: 0; }
}

/* 用户中心 */
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.info-list { display: flex; flex-direction: column; gap: 12px; }
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.info-row:last-child { padding-bottom: 0; border-bottom: 0; }
.info-row span { color: var(--muted); }
.info-row strong { text-align: right; word-break: break-all; }
.usage-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.usage-line strong { font-size: 22px; letter-spacing: -0.5px; }
.usage-line span { font-size: 12px; color: var(--muted); }
.admin-login-card .auth-tabs { margin-top: 2px; }
.admin-login-card .field-label { margin-top: 16px; }
.admin-login-card .field-label:first-child { margin-top: 0; }

/* 解析记录 / IP 管理 */
.result-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.result-pill.ok { background: rgba(16, 185, 129, 0.12); color: #047857; }
.result-pill.fail { background: #fef2f2; color: #b91c1c; }
.log-url {
  display: block;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}
.ip-cell .mono { display: block; font-size: 12px; }
.ip-cell .ip-region {
  display: block;
  max-width: 240px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  white-space: normal;
}
.ip-rules { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ip-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: "SF Mono", "JetBrains Mono", Menlo, monospace;
  font-size: 12px;
}
.ip-chip.black { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.ip-chip.white { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.ip-chip button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}
.ip-chip button:hover { opacity: 1; }
