:root {
  --bg: #f3f7f6;
  --panel: #ffffff;
  --border: #e7ecf0;
  --border-strong: #d8e0e6;
  --text: #0f1b24;
  --muted: #667685;
  --brand: #10b981;
  --brand-600: #059669;
  --brand-700: #047857;
  --brand-soft: #ecfdf5;
  --brand-grad: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
  --brand-grad-soft: linear-gradient(135deg, rgba(16,185,129,.10), rgba(20,184,166,.10));
  --ok: #10b981;
  --warn: #f59e0b;
  --err: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 10px 30px rgba(15,23,42,.06);
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05), 0 4px 14px rgba(15,23,42,.05);
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* ---------------- header ---------------- */
header {
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.2px; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 10px; background: var(--brand-grad);
  display: grid; place-items: center; color: #fff; font-size: 15px;
  box-shadow: 0 4px 12px rgba(16,185,129,.35);
}
nav.top { display: flex; align-items: center; gap: 4px; }
nav.top a {
  margin-left: 4px; padding: 8px 12px; border-radius: 9px; color: var(--muted);
  font-size: 13.5px; transition: .15s;
}
nav.top a:hover { color: var(--brand-700); background: var(--brand-soft); text-decoration: none; }
nav.top .nav-cta {
  background: var(--brand-grad); color: #fff; font-weight: 600; margin-left: 8px;
  box-shadow: 0 4px 12px rgba(16,185,129,.28);
}
nav.top .nav-cta:hover { color: #fff; filter: brightness(1.05); }
nav.top a.nav-view.active { color: var(--brand-700); background: var(--brand-soft); font-weight: 600; }

/* ---------------- 首页分类视图 ---------------- */
.views { margin-top: 10px; }
.view { display: none; }
.view.on { display: block; animation: viewIn .28s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------- hero ---------------- */
.hero { position: relative; padding: 56px 0 30px; text-align: center; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 420px; z-index: 0;
  background:
    radial-gradient(420px 220px at 22% 0%, rgba(16,185,129,.16), transparent 70%),
    radial-gradient(420px 220px at 80% 10%, rgba(20,184,166,.14), transparent 70%);
  filter: blur(8px); pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: 33px; margin: 0 0 12px; letter-spacing: -1px; line-height: 1.2; }
.hero h1 .hl { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); margin: 0 auto 26px; max-width: 560px; font-size: 15px; }

.search-box {
  display: flex; gap: 8px; background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 14px; padding: 7px; box-shadow: var(--shadow); max-width: 720px; margin: 0 auto;
  transition: .18s;
}
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(16,185,129,.14), var(--shadow); }
.search-box input {
  flex: 1; border: none; outline: none; padding: 11px 14px; font-size: 14.5px;
  background: transparent; color: var(--text);
}
.search-box input::placeholder { color: #9aa6b2; }

.btn {
  border: none; border-radius: 11px; padding: 11px 22px; cursor: pointer;
  font-size: 14px; font-weight: 600; font-family: inherit; transition: transform .12s, opacity .12s, background .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 16px rgba(16,185,129,.30); }
.btn-primary:hover { filter: brightness(1.04); }
.btn-ghost { background: #f1f4f6; color: var(--text); }
.btn-ghost:hover { background: #e9edf1; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 9px; }
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: #fff; color: var(--muted); cursor: pointer; }
.btn-xs:hover { border-color: var(--brand); color: var(--brand-700); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.chip {
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; font-size: 12.5px; color: var(--muted); cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-soft); }

/* ---------------- feature strip ---------------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 8px 0 30px; }
.feature {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 16px; box-shadow: var(--shadow-sm); transition: .18s;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.feature .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-700); display: grid; place-items: center; font-size: 18px; margin-bottom: 10px; }
.feature h3 { font-size: 14.5px; margin: 0 0 4px; }
.feature p { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.55; }

/* ---------------- panels ---------------- */
section.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.panel h2 { font-size: 18px; margin: 0 0 4px; letter-spacing: -.2px; }
.panel .sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

/* ---------------- result ---------------- */
.result { display: none; }
.result.show { display: block; }
.result-grid { display: grid; grid-template-columns: 260px 1fr; gap: 22px; }
.cover {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px;
  background: #eef1f4; border: 1px solid var(--border);
}
.meta-title { font-size: 17px; font-weight: 600; margin: 0 0 10px; line-height: 1.45; }
.meta-line { color: var(--muted); font-size: 13px; margin-bottom: 7px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 7px; font-size: 12px; font-weight: 500;
  background: var(--brand-soft); color: var(--brand-700);
}
.badge.warn { background: #fff5e6; color: #b45309; }
.badge.ok { background: var(--brand-soft); color: var(--brand-700); }
.badge.no { background: #fdeaea; color: #dc2626; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chk { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; color: #9aa; cursor: pointer; user-select: none; }
.chk input { width: 15px; height: 15px; cursor: pointer; }

.video-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.video-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fafdfc;
}
.video-item:hover { border-color: var(--brand); }
.video-item > div:first-child { flex: 1; min-width: 0; }
.video-item .q { font-weight: 600; font-size: 13px; display: block; margin-bottom: 2px; }
.video-item .u { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-more summary { list-style: none; }
.video-more summary::-webkit-details-marker { display: none; }

.images { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.images img { width: 100%; border-radius: 8px; border: 1px solid var(--border); }

.alert { border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-top: 12px; line-height: 1.6; }
.alert.err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert.info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

.skeleton { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.spinner {
  width: 16px; height: 16px; border: 2px solid #cfe9e0; border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- docs ---------------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; background: #f8fafb; white-space: nowrap; }
code { background: #f1f5f4; padding: 2px 7px; border-radius: 6px; font-size: 12.5px; font-family: ui-monospace, Consolas, "SFMono-Regular", monospace; color: #0f766e; }
pre {
  background: #0f1b24; color: #d7e3ee; border: 1px solid #1c2b36; border-radius: 12px;
  padding: 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.7;
  font-family: ui-monospace, Consolas, "SFMono-Regular", monospace;
}
pre code { background: none; padding: 0; color: inherit; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--muted); background: #f1f4f6; transition: .15s; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--brand-grad); color: #fff; font-weight: 600; }

/* ---------------- stats ---------------- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; background: linear-gradient(180deg,#fff,#fbfdfc); }
.stat-card .n { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.stat-card .l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.bar-row .nm { width: 92px; color: var(--muted); flex-shrink: 0; }
.bar-row .bar { flex: 1; height: 8px; background: #eef2f1; border-radius: 99px; overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; background: var(--brand-grad); }
.bar-row .v { width: 60px; text-align: right; color: var(--muted); font-size: 12px; }

/* ---------------- misc ---------------- */
footer { padding: 30px 0 44px; color: var(--muted); font-size: 12.5px; text-align: center; line-height: 1.8; }
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: #0f1b24; color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: .22s; z-index: 99;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.key-row { display: flex; align-items: center; gap: 8px; margin: 14px auto 0; max-width: 720px; }
.key-row #keyInput { flex: 1; height: 40px; border: 1px solid var(--border-strong); border-radius: 9px; padding: 0 12px; font-size: 13px; background: #fff; outline: none; transition: .15s; }
.key-row #keyInput:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.key-hint { font-size: 12px; color: var(--muted); }
.meta-line.quota { margin-top: 8px; padding: 7px 11px; background: var(--brand-soft); border: 1px solid #c7eee0; border-radius: 8px; color: var(--brand-700); font-size: 12.5px; }

/* ---------------- 登录 / 注册 ---------------- */
.auth-bg {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(480px 280px at 18% 12%, rgba(16,185,129,.16), transparent 70%),
    radial-gradient(480px 280px at 86% 88%, rgba(20,184,166,.14), transparent 70%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding: 34px 32px; }
.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-logo .mark { width: 46px; height: 46px; border-radius: 13px; background: var(--brand-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: 0 6px 16px rgba(16,185,129,.32); }
.auth-logo h1 { font-size: 19px; margin: 12px 0 3px; color: var(--text); }
.auth-logo p { font-size: 12.5px; color: var(--muted); margin: 0; }
.auth-tabs { display: flex; background: #f1f4f6; border-radius: 11px; padding: 4px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; background: none; border: none; padding: 10px 0; font-size: 14.5px; color: var(--muted); cursor: pointer; border-radius: 8px; transition: .15s; font-family: inherit; }
.auth-tabs button.on { background: #fff; color: var(--brand-700); font-weight: 600; box-shadow: var(--shadow-sm); }
.auth-form .f { margin-bottom: 14px; }
.auth-form label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.auth-form input { width: 100%; box-sizing: border-box; padding: 12px 13px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 14px; outline: none; background: #fff; color: var(--text); transition: .15s; font-family: inherit; }
.auth-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.auth-form .btn { width: 100%; padding: 12px; border-radius: 10px; font-size: 15px; margin-top: 4px; }
.auth-msg { font-size: 13px; margin-top: 12px; display: none; padding: 10px 12px; border-radius: 9px; line-height: 1.5; }
.auth-msg.err { display: block; background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.auth-msg.ok { display: block; background: var(--brand-soft); color: var(--brand-700); border: 1px solid #c7eee0; }
.auth-tip { text-align: center; font-size: 12px; color: #9aa6b2; margin-top: 16px; }
.auth-links { display: flex; flex-direction: column; gap: 6px; align-items: center; margin-top: 14px; font-size: 11.5px; color: #9aa6b2; }
.auth-links a { color: var(--brand-600); font-size: 12.5px; }
.auth-links a:hover { text-decoration: none; }

/* ---------------- 用户中心 ---------------- */
.topbar { height: 58px; background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(12px); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; box-shadow: 0 1px 4px rgba(15,23,42,.05); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; color: var(--brand-700); }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.userbox { position: relative; }
.userbox .u { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; color: var(--text); padding: 6px 4px; }
.userbox .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.dropdown { display: none; position: absolute; right: 0; top: 46px; width: 160px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; flex-direction: column; z-index: 30; }
.dropdown.open { display: flex; }
.dropdown button { background: none; border: none; text-align: left; padding: 10px 12px; font-size: 13px; border-radius: 8px; cursor: pointer; color: var(--text); font-family: inherit; }
.dropdown button:hover { background: var(--brand-soft); color: var(--brand-700); }

.layout { display: flex; min-height: calc(100vh - 58px); }
.side { width: 184px; background: #fff; border-right: 1px solid var(--border); padding: 16px 12px; flex-shrink: 0; }
.side button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; padding: 11px 14px; font-size: 14px; color: var(--muted); border-radius: 10px; cursor: pointer; margin-bottom: 4px; font-family: inherit; transition: .15s; }
.side button:hover { background: #f5f8f7; color: var(--text); }
.side button.on { background: var(--brand-soft); color: var(--brand-700); font-weight: 600; }
.main { flex: 1; padding: 28px; max-width: 1320px; margin: 0 auto; width: 100%; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.card h2 { font-size: 18px; margin: 0 0 4px; letter-spacing: -.2px; }
.card .sub { font-size: 12.5px; color: var(--muted); margin: 0 0 18px; }

.doc-row { display: flex; border-bottom: 1px solid #f0f3f5; padding: 12px 0; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.doc-row:last-child { border-bottom: none; }
.doc-row .k { width: 92px; flex-shrink: 0; font-size: 13px; color: var(--muted); }
.doc-row .v { flex: 1; min-width: 0; font-size: 13px; color: var(--text); word-break: break-all; }
.doc-row .v.mono { font-family: ui-monospace, Consolas, monospace; background: var(--brand-soft); padding: 6px 10px; border-radius: 7px; color: var(--brand-700); font-size: 12.5px; }
table.doc { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0 18px; }
table.doc th { background: #f8fafb; color: var(--muted); font-weight: 600; text-align: left; }
table.doc th, table.doc td { padding: 10px 12px; border-bottom: 1px solid #f0f3f5; }
pre.code { background: #0f1b24; color: #d7e3ee; font-family: ui-monospace, Consolas, monospace; font-size: 12px; padding: 14px; border-radius: 10px; overflow: auto; line-height: 1.6; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.plan { text-align: center; border: 1px solid var(--border); border-radius: 14px; padding: 22px 14px; transition: .18s; background: #fff; }
.plan:hover { border-color: var(--brand); box-shadow: 0 8px 22px rgba(16,185,129,.14); transform: translateY(-2px); }
.plan h3 { margin: 0 0 10px; font-size: 15px; }
.plan .desc { font-size: 12px; color: var(--muted); line-height: 1.7; min-height: 42px; }
.plan .price { font-size: 26px; font-weight: 700; color: var(--brand-700); margin: 8px 0; letter-spacing: -.5px; }
.plan .price small { font-size: 12px; font-weight: 400; color: var(--muted); }
.plan .btn { width: 100%; }
.buy-tip { background: var(--brand-soft); border: 1px solid #c7eee0; border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--brand-700); margin-top: 16px; }
.buy-tip b { color: var(--brand-700); }

.inline { display: flex; gap: 10px; flex-wrap: wrap; }
.inline input { flex: 1; min-width: 220px; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 14px; outline: none; background: #fff; font-family: inherit; color: var(--text); transition: .15s; }
.inline input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.msg { font-size: 13px; margin-top: 12px; display: none; padding: 10px 12px; border-radius: 9px; line-height: 1.5; }
.msg.err { display: block; background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.msg.ok { display: block; background: var(--brand-soft); color: var(--brand-700); border: 1px solid #c7eee0; }

.kv { display: flex; border-bottom: 1px solid #f0f3f5; padding: 13px 0; font-size: 14px; }
.kv .k { width: 110px; color: var(--muted); flex-shrink: 0; }
.kv .v { flex: 1; word-break: break-all; }
.kv .v.mono { font-family: ui-monospace, Consolas, monospace; }
.row-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ---------------- 管理后台 ---------------- */
.admin-wrap { max-width: 1480px; margin: 0 auto; padding: 28px 32px 60px; }
.admin-wrap h1 { font-size: 21px; margin: 10px 0 4px; letter-spacing: -.3px; }
.admin-wrap .sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.admin-tabs { display: flex; gap: 8px; margin: 18px 0; flex-wrap: wrap; }
.admin-tabs button { padding: 9px 20px; border-radius: 10px; border: 1px solid var(--border-strong); background: #fff; font-size: 14px; color: var(--muted); cursor: pointer; font-family: inherit; transition: .15s; }
.admin-tabs button:hover { color: var(--text); }
.admin-tabs button.on { background: var(--brand-grad); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(16,185,129,.26); }
.admin-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.admin-card h2 { font-size: 16px; margin: 0 0 14px; }
.admin-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.admin-form .f { display: flex; flex-direction: column; gap: 5px; }
.admin-form label { font-size: 12.5px; color: var(--muted); }
.admin-form input, .admin-form select { height: 38px; border: 1px solid var(--border-strong); border-radius: 9px; padding: 0 11px; font-size: 13px; min-width: 150px; background: #fff; font-family: inherit; color: var(--text); outline: none; transition: .15s; }
.admin-form input:focus, .admin-form select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.admin-form .f.col { flex: 1 1 100%; }
.admin-form textarea { width: 100%; border: 1px solid var(--border-strong); border-radius: 9px; padding: 9px 11px; font-size: 13px; background: #fff; font-family: inherit; color: var(--text); outline: none; transition: .15s; resize: vertical; line-height: 1.6; }
.admin-form textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.risk-actions { display: flex; align-items: center; gap: 14px; flex: 1 1 100%; margin-top: 4px; }
.risk-actions .qr-status { margin: 0; }
table.admin-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin-tbl th, table.admin-tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #f0f3f5; vertical-align: middle; }
table.admin-tbl th { color: var(--muted); font-weight: 600; background: #f8fafb; white-space: nowrap; }
.badge.sm { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 11px; background: #eef2f1; color: #5a6573; }
.badge.sm.ok { background: var(--brand-soft); color: var(--brand-700); }
.badge.sm.no { background: #fdeaea; color: #dc2626; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
/* 生成卡密结果：提示与卡密合并为一张白底卡片，点击卡密即可复制 */
.code-result { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; margin-top: 18px; box-shadow: var(--shadow-sm); display: none; }
.code-result-head { font-size: 13px; margin-bottom: 10px; }
.code-result-head.info { color: var(--brand-700); }
.code-result-head.err { color: #dc2626; }
.code-list { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.code-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid #e8ecee; border-radius: 10px; margin-bottom: 10px; cursor: pointer; background: #f8fafb; transition: .12s; }
.code-row:last-child { margin-bottom: 0; }
.code-row:hover { background: #eef8f3; border-color: var(--brand); }
.code-row.copied { background: #e3f7ed; border-color: var(--brand); }
.code-txt { flex: 1; min-width: 0; word-break: break-all; line-height: 1.6; color: var(--text); user-select: all; }
.code-row .copy-hint { flex-shrink: 0; font-size: 12px; color: var(--brand-700); font-weight: 600; }

/* ---------------- 平台能力网格 ---------------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 10px 0 18px; }
.section-head h2 { font-size: 20px; margin: 0; letter-spacing: -.3px; }
.section-head .sub { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.section-head .link { font-size: 13px; color: var(--brand-600); white-space: nowrap; }
.platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pf {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 15px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 9px;
  transition: .18s;
}
.pf:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.pf .nm { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pf .nm .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex-shrink: 0; }
.pf .mt { font-size: 11.5px; color: var(--muted); line-height: 1.55; min-height: 34px; }
.pf .mode { align-self: flex-start; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 99px; }
.mode.native { background: var(--brand-soft); color: var(--brand-700); }
.mode.engine { background: #fff5e6; color: #b45309; }
.mode.both { background: #eef2ff; color: #4338ca; }

/* ---------------- 三步接入 ---------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 16px; box-shadow: var(--shadow-sm); position: relative;
}
.step .num {
  width: 30px; height: 30px; border-radius: 9px; background: var(--brand-grad); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(16,185,129,.28);
}
.step h3 { font-size: 14.5px; margin: 0 0 5px; }
.step p { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.55; }
.step p code { font-size: 11.5px; }

/* ---------------- 用户中心：我的专属接口 ---------------- */
.endpoint {
  background: #0f1b24; color: #d7e3ee; border-radius: 12px; padding: 13px 15px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; word-break: break-all;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; line-height: 1.5;
}
.endpoint .url { flex: 1; }
.endpoint .copy { flex-shrink: 0; }
.quick-test { margin-top: 14px; }
.quick-test .qt-row { display: flex; gap: 8px; }
.quick-test .qt-row input { flex: 1; height: 40px; border: 1px solid var(--border-strong); border-radius: 9px; padding: 0 12px; font-size: 13px; outline: none; background: #fff; color: var(--text); font-family: inherit; transition: .15s; }
.quick-test .qt-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.qt-out { margin-top: 12px; font-size: 12.5px; }
.quota-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 2px; }
.quota-chip { background: var(--brand-soft); border: 1px solid #c7eee0; color: var(--brand-700); border-radius: 9px; padding: 8px 13px; font-size: 12.5px; }
.quota-chip b { font-size: 15px; }
.doc-link { display: inline-block; margin-top: 6px; font-size: 12.5px; color: var(--brand-600); }

/* ---------------- 管理后台头部 ---------------- */
.admin-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0 4px; flex-wrap: wrap;
}
.admin-top .brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; color: var(--brand-700); }
.admin-top .brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.admin-top .nav a { margin-left: 14px; font-size: 13px; color: var(--muted); }
.admin-top .nav a:hover { color: var(--brand-700); text-decoration: none; }

/* ---------------- 管理控制台布局（深色侧栏） ---------------- */
.console { display: flex; min-height: 100vh; background: #f4f6f8; }

.side { width: 232px; flex-shrink: 0; background: linear-gradient(180deg,#0f2a22 0%,#0d2230 100%); color: #cfe9de; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-brand .mark { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; box-shadow: 0 4px 12px rgba(16,185,129,.35); flex-shrink: 0; }
.side-brand strong { display: block; font-size: 14.5px; color: #fff; letter-spacing: -.2px; }
.side-brand small { color: #7fb8a3; font-size: 11.5px; }

.side-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 16px; flex: 1; }
.nav-group { font-size: 11px; color: #5f8a7c; letter-spacing: 1px; padding: 10px 12px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 13px; border: none; background: transparent; border-radius: 9px; font-size: 14px; color: #b7d6cb; cursor: pointer; font-family: inherit; transition: .15s; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.on { background: var(--brand-grad); color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(16,185,129,.3); }
.nav-item .ico { font-size: 15px; width: 20px; text-align: center; }

.side-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.side-foot a { font-size: 12.5px; color: #7fb8a3; }
.side-foot a:hover { color: #fff; text-decoration: none; }
.conn { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 7px 11px; border-radius: 9px; background: rgba(255,255,255,.06); color: #9fc3b6; }
.conn .dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; }
.conn.on { background: rgba(16,185,129,.16); color: #6ee7b7; }
.conn.on .dot { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.25); }
.conn.off { background: rgba(239,68,68,.16); color: #fca5a5; }
.conn.off .dot { background: #ef4444; }

.cmain { flex: 1; min-width: 0; padding: 28px 36px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid #e6eaed; }
.crumb { font-size: 13px; color: #8a97a1; }
.crumb .sep { margin: 0 8px; color: #c3ccd2; }
.crumb b { color: #1f2d28; font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.env-tag { font-size: 12px; color: #5f8a7c; background: #e7f5ef; border: 1px solid #cdeadd; padding: 5px 10px; border-radius: 8px; }

/* 解锁门：未登录时全屏覆盖，避免露出后台侧边栏/顶栏 */
.gate { display: flex; align-items: center; justify-content: center; position: fixed; inset: 0; z-index: 100; background: var(--bg); padding: 20px; }
.gate-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 34px 32px 26px; max-width: 430px; width: 100%; text-align: center; box-shadow: var(--shadow-sm); }
.gate-ico { font-size: 34px; margin-bottom: 8px; }
.gate-card h2 { font-size: 18px; margin: 0 0 8px; }
.gate-card p { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0 0 16px; }
.gate-card code { background: #f2f6f4; border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 12px; }
.gate-row { display: flex; gap: 9px; }
.gate-row input { flex: 1; height: 42px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 13px; font-size: 13.5px; outline: none; transition: .15s; font-family: inherit; }
.gate-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
/* 账号密码登录表单（纵向堆叠） */
.gate-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.gate-form input { width: 100%; height: 44px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 14px; font-size: 14px; outline: none; background: #fff; color: var(--text); transition: .15s; font-family: inherit; box-sizing: border-box; }
.gate-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.gate-form .btn { width: 100%; height: 44px; margin-top: 2px; }
.gate-msg { min-height: 20px; font-size: 12.5px; margin-top: 9px; }
.gate-msg.ok { color: #047857; }
.gate-msg.err { color: #dc2626; }
.gate-hint { font-size: 11.5px !important; color: #9aa6b2 !important; margin-top: 14px !important; word-break: break-all; }

/* 概览统计 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 15px 17px; box-shadow: var(--shadow-sm); }
.stat-num { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.stat-num.ok { color: var(--brand-700); }
.stat-lab { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* 面板 */
.panel { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { font-size: 16px; margin: 0; }
.panel-sub { color: var(--muted); font-size: 12px; margin: 3px 0 0; }
.panel-tools { display: flex; gap: 8px; align-items: center; }
.mini-select { height: 34px; border: 1px solid var(--border-strong); border-radius: 9px; padding: 0 9px; font-size: 12.5px; background: #fff; color: var(--text); font-family: inherit; outline: none; }
.tbl-empty { color: var(--muted); text-align: center; padding: 22px 8px !important; }
.btn-xs.danger { color: #b91c1c; }
.btn-xs.danger:hover { border-color: #fecaca; background: #fef2f2; }
.cfoot { padding: 18px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .platforms { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
@media (max-width: 760px) {
  .result-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 25px; }
  .search-box { flex-direction: column; }
  .search-box .btn { width: 100%; }
  nav.top { flex-wrap: wrap; justify-content: center; gap: 6px; }
  nav.top a { margin-left: 0; }
  .layout { flex-direction: column; }
  .side { width: 100%; display: flex; gap: 8px; border-right: none; border-bottom: 1px solid var(--border); overflow-x: auto; padding: 10px; }
  .side button { width: auto; white-space: nowrap; margin-bottom: 0; }
}
@media (max-width: 480px) {
  .features { grid-template-columns: 1fr; }
}

/* 工作台 */
.wb-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-top: 4px; }
.wb-grid .panel { margin-bottom: 0; }
.parse-panel .parse-row { display: flex; gap: 9px; }
.parse-row input { flex: 1; height: 42px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 13px; font-size: 13.5px; outline: none; transition: .15s; }
.parse-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(16,185,129,.12); }
.parse-out { margin-top: 14px; border-radius: 11px; padding: 14px; font-size: 13px; display: none; }
.parse-out.loading { background: #f1f5f4; color: var(--muted); }
.parse-out.err { background: #fef2f2; color: #b91c1c; }
.parse-out.ok { background: #ecfdf5; border: 1px solid #cdeadd; }
.pr { display: flex; gap: 14px; align-items: center; }
.pr img { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; background: #e6edea; flex-shrink: 0; }
.pr-meta { flex: 1; min-width: 0; }
.pr-title { font-size: 14px; font-weight: 600; color: #1f2d28; margin-bottom: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-url { display: flex; gap: 8px; }
.pr-url input { flex: 1; min-width: 0; height: 34px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 0 10px; font-size: 12px; background: #fff; color: #1f2d28; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-item { display: flex; align-items: center; gap: 9px; padding: 13px 14px; border: 1px solid var(--border); border-radius: 11px; background: #fafcfb; font-size: 13.5px; color: var(--text); cursor: pointer; text-decoration: none; font-family: inherit; transition: .15s; text-align: left; }
.quick-item:hover { border-color: var(--brand); background: #f0faf6; color: var(--brand-700); text-decoration: none; }
.quick-item span { font-size: 17px; }

/* ---------------- 控制台响应式 ---------------- */
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .console { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; gap: 12px; padding: 10px 12px; border-right: none; border-bottom: 1px solid var(--border); overflow-x: auto; }
  .side-brand { border-bottom: none; padding: 0 4px; flex-shrink: 0; }
  .side-brand small { display: none; }
  .side-nav { flex-direction: row; margin: 0; flex: 1; }
  .nav-item { width: auto; white-space: nowrap; padding: 9px 13px; }
  .side-foot { border-top: none; padding: 0; flex-direction: row; align-items: center; flex-shrink: 0; }
  .side-foot a { display: none; }
  .cmain { padding: 18px 14px 40px; }
  .wb-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 12px 13px; }
  .stat-num { font-size: 20px; }
  .gate-card { padding: 26px 18px 20px; }
}

/* ---------------- 客服二维码弹窗 ---------------- */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 27, 36, .45); backdrop-filter: blur(2px); }
.modal-card { position: relative; background: #fff; border-radius: 16px; width: min(92vw, 420px); box-shadow: 0 20px 60px rgba(15, 27, 36, .18); overflow: hidden; animation: modalIn .22s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { background: transparent; border: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px 20px 24px; text-align: center; }
.modal-body p { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.modal-body img { max-width: 260px; width: 100%; border-radius: 12px; border: 1px solid var(--border); background: #f8faf9; }
.qr-fallback { padding: 30px 10px; background: #f8faf9; border-radius: 12px; border: 1px dashed var(--border-strong); color: var(--muted); font-size: 13px; }

/* ---------------- 首页风控拦截提示 ---------------- */
.risk-block { display: flex; gap: 14px; align-items: flex-start; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px; padding: 18px; }
.risk-ico { font-size: 26px; line-height: 1; flex-shrink: 0; }
.risk-body { flex: 1; }
.risk-title { font-size: 15px; font-weight: 700; color: #c2410c; margin-bottom: 6px; }
.risk-desc { font-size: 13px; color: #7c2d12; line-height: 1.6; margin-bottom: 12px; }
.risk-acts { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.risk-detail { font-size: 12.5px; color: var(--muted); }
.risk-detail summary { cursor: pointer; user-select: none; }
.risk-detail pre { margin: 8px 0 0; white-space: pre-wrap; word-break: break-all; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-size: 12px; color: #9a3412; max-height: 220px; overflow: auto; }

/* ---------------- 后台二维码上传 ---------------- */
.qr-uploader { display: flex; flex-direction: column; gap: 14px; }
.qr-uploader input[type="file"] { font-size: 13px; }
.qr-preview { max-width: 220px; border-radius: 12px; border: 1px solid var(--border); background: #f8faf9; }
.qr-status { font-size: 12.5px; color: var(--muted); }

/* ---------------- 宽屏增强 ---------------- */
@media (min-width: 1400px) {
  .cmain { padding: 32px 48px 70px; }
  .main { padding: 32px; }
  .admin-wrap { padding: 32px 48px 70px; }
  .stats { gap: 18px; margin-bottom: 26px; }
  .wb-grid { gap: 24px; }
  .card, .panel, .admin-card { margin-bottom: 24px; }
}
@media (min-width: 1600px) {
  .admin-wrap { max-width: 1620px; }
  .main { max-width: 1440px; }
}
