:root {
  --bg: #08080f;
  --bg-soft: #0d0d18;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0ff;
  --text-dim: #a8adc8;
  --text-mute: #71779a;
  --brand: #7c6cff;
  --brand-2: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  --grad: linear-gradient(120deg, var(--brand), var(--brand-2));
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(124, 108, 255, 0.22), transparent 60%),
    radial-gradient(800px 500px at 95% 0%, rgba(34, 211, 238, 0.14), transparent 55%),
    radial-gradient(700px 500px at 50% 110%, rgba(124, 108, 255, 0.10), transparent 60%);
  z-index: 0;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
.muted { color: var(--text-dim); }
.mute-2 { color: var(--text-mute); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap-row { flex-wrap: wrap; }
.spacer { flex: 1; }
.hide { display: none !important; }
.center { text-align: center; }

/* ---------------------------------- 顶栏 ---------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(18px);
  background: rgba(8, 8, 15, 0.72);
  border-bottom: 1px solid var(--line);
}
.topbar .inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: .3px; }
.logo .mark {
  width: 34px; height: 34px; border-radius: 11px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: 0 8px 22px rgba(124, 108, 255, 0.45);
}
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 8px 13px; border-radius: 10px; color: var(--text-dim); font-weight: 500;
  transition: .18s;
}
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.active { color: #fff; background: var(--panel-strong); }
.topbar .search-mini {
  display: flex; align-items: center; gap: 8px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 7px 12px; width: 240px;
}
.topbar .search-mini input { background: none; border: 0; outline: 0; width: 100%; }

/* ---------------------------------- 按钮 ---------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; font-weight: 600; transition: .18s; white-space: nowrap;
}
.btn:hover { background: var(--panel-strong); border-color: var(--line-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 10px 26px rgba(124, 108, 255, 0.35); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; border-radius: 10px; font-size: 13px; }
.btn-danger { color: var(--danger); border-color: rgba(251, 113, 133, 0.35); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }

/* ---------------------------------- 表单 ---------------------------------- */
.input, .select, .textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px; background: rgba(255,255,255,0.04);
  border: 1px solid var(--line); outline: 0; transition: .18s;
}
.input:focus, .select:focus, .textarea:focus { border-color: rgba(124,108,255,0.6); background: rgba(124,108,255,0.07); }
.textarea { min-height: 130px; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-mute) 50%), linear-gradient(135deg, var(--text-mute) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 7px; font-size: 13px; color: var(--text-dim); font-weight: 500; }
.hint { font-size: 12px; color: var(--text-mute); margin-top: 6px; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 13px; }
.switch input { display: none; }
.switch .track { width: 40px; height: 22px; border-radius: 99px; background: rgba(255,255,255,0.14); position: relative; transition: .2s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* ---------------------------------- 卡片 ---------------------------------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(12px); padding: 20px;
}
.panel.tight { padding: 14px; }
.panel-title { font-weight: 700; font-size: 15px; margin: 0 0 14px; display: flex; align-items: center; gap: 9px; }
.panel-title .bar { width: 3px; height: 15px; border-radius: 3px; background: var(--grad); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 700; border: 1px solid transparent;
}
.badge.vip { background: linear-gradient(120deg, rgba(251,191,36,.22), rgba(251,113,133,.18)); color: #fcd34d; border-color: rgba(251,191,36,.35); }
.badge.login { background: rgba(34,211,238,.14); color: #67e8f9; border-color: rgba(34,211,238,.3); }
.badge.free { background: rgba(52,211,153,.13); color: #6ee7b7; border-color: rgba(52,211,153,.28); }
.badge.hot { background: rgba(251,113,133,.16); color: #fda4af; border-color: rgba(251,113,133,.3); }
.badge.info { background: rgba(124,108,255,.16); color: #c4b5fd; border-color: rgba(124,108,255,.3); }
.badge.warn { background: rgba(251,191,36,.14); color: #fcd34d; border-color: rgba(251,191,36,.3); }
.badge.ok { background: rgba(52,211,153,.14); color: #6ee7b7; border-color: rgba(52,211,153,.28); }
.badge.danger { background: rgba(251,113,133,.16); color: #fda4af; border-color: rgba(251,113,133,.3); }

/* ---------------------------------- 首页 Hero ---------------------------------- */
.hero { padding: 46px 0 30px; }
.hero h1 { font-size: 40px; line-height: 1.25; margin: 0 0 14px; letter-spacing: -.5px; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--text-dim); font-size: 16px; margin: 0 0 26px; max-width: 640px; }
.big-search {
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 20px; border-radius: 18px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); max-width: 720px;
}
.big-search input { flex: 1; background: none; border: 0; outline: 0; font-size: 15px; }
.big-search .btn { padding: 11px 22px; }
.hero-stats { display: flex; gap: 28px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats .stat b { display: block; font-size: 22px; font-weight: 700; }
.hero-stats .stat span { font-size: 12.5px; color: var(--text-mute); }

/* ---------------------------------- 广告位 ---------------------------------- */
.ad-hero { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); min-height: 168px; }
.ad-slide {
  display: none; padding: 30px 32px; position: relative; align-items: center; gap: 24px;
  background: linear-gradient(120deg, rgba(124,108,255,.22), rgba(34,211,238,.10));
}
.ad-slide.active { display: flex; animation: fadeIn .45s ease; }
.ad-slide.theme-cyan { background: linear-gradient(120deg, rgba(34,211,238,.22), rgba(124,108,255,.10)); }
.ad-slide.theme-amber { background: linear-gradient(120deg, rgba(251,191,36,.20), rgba(251,113,133,.12)); }
.ad-slide.theme-rose { background: linear-gradient(120deg, rgba(251,113,133,.22), rgba(124,108,255,.12)); }
.ad-slide.theme-emerald { background: linear-gradient(120deg, rgba(52,211,153,.20), rgba(34,211,238,.12)); }
.ad-slide h3 { margin: 0 0 8px; font-size: 21px; }
.ad-slide p { margin: 0; color: var(--text-dim); max-width: 620px; }
.ad-slide img { max-height: 110px; border-radius: 12px; object-fit: cover; }
.ad-dots { position: absolute; right: 20px; bottom: 14px; display: flex; gap: 7px; z-index: 3; }
.ad-dots i { width: 8px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.28); cursor: pointer; transition: .2s; }
.ad-dots i.on { width: 22px; background: #fff; }
.ad-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; }
.ad-nav.prev { left: 10px; } .ad-nav.next { right: 10px; }
.ad-nav button {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(8,8,15,.6); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.ad-side { display: flex; flex-direction: column; gap: 12px; }
.ad-card {
  padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line-strong);
  background: linear-gradient(120deg, rgba(124,108,255,.10), transparent);
}
.ad-card b { display: block; margin-bottom: 4px; }
.ad-card small { color: var(--text-mute); display: block; margin-bottom: 8px; line-height: 1.5; }
.ad-tag { font-size: 10.5px; color: var(--text-mute); letter-spacing: 1px; margin-bottom: 8px; display: block; }

/* ---------------------------------- 公告 ---------------------------------- */
.notice-bar {
  display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel); margin-bottom: 18px; overflow: hidden;
}
.notice-bar .tag { flex: none; font-weight: 700; color: #fcd34d; display: flex; align-items: center; gap: 6px; }
.notice-track { overflow: hidden; flex: 1; height: 22px; position: relative; }
.notice-track .notice-item {
  height: 22px; line-height: 22px; color: var(--text-dim); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; transition: opacity .28s ease, transform .28s ease;
}
.notice-track .notice-item.out { opacity: 0; transform: translateY(-8px); }

/* ---------------------------------- 功能网格 ---------------------------------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.chip {
  padding: 7px 15px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel);
  cursor: pointer; color: var(--text-dim); font-size: 13px; transition: .18s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.on { background: var(--grad); color: #fff; border-color: transparent; font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 14px; }
.tool-card {
  position: relative; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; transition: .2s; overflow: hidden; display: flex; flex-direction: column; gap: 9px;
}
.tool-card::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; opacity: 0;
  background: linear-gradient(120deg, rgba(124,108,255,.18), rgba(34,211,238,.12)); transition: .2s; z-index: -1;
}
.tool-card:hover { transform: translateY(-3px); border-color: rgba(124,108,255,.45); box-shadow: 0 16px 34px rgba(0,0,0,.4); }
.tool-card .ic {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 21px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line);
}
.tool-card h4 { margin: 4px 0 0; font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.tool-card p { margin: 0; color: var(--text-mute); font-size: 12.6px; line-height: 1.6; min-height: 40px; }
.tool-card .foot { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.tool-card .go { margin-left: auto; color: var(--text-mute); font-size: 12px; }
.tool-card:hover .go { color: #c4b5fd; }

.layout-main { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }

/* ---------------------------------- 工具页 ---------------------------------- */
.crumb { display: flex; align-items: center; gap: 8px; color: var(--text-mute); font-size: 13px; padding: 22px 0 10px; }
.tool-head { display: flex; align-items: flex-start; gap: 16px; padding: 8px 0 20px; }
.tool-head .ic { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: var(--panel-strong); border: 1px solid var(--line); }
.tool-head h1 { margin: 0 0 6px; font-size: 25px; }
.form-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.result-panel { margin-top: 20px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.kv > div { padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13px; word-break: break-all; }
.kv > div:nth-child(odd) { background: rgba(255,255,255,0.03); color: var(--text-dim); width: 180px; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.pre {
  background: rgba(0,0,0,.42); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  overflow: auto; max-height: 520px; font-family: ui-monospace, Menlo, monospace; font-size: 12.6px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-all; margin: 0;
}
.verdict { display: flex; gap: 10px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); margin-bottom: 9px; }
.verdict .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--text-mute); }
.verdict.ok .dot { background: var(--ok); } .verdict.warn .dot { background: var(--warn); }
.verdict.danger .dot { background: var(--danger); } .verdict.info .dot { background: var(--brand-2); }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; display: flex; gap: 10px; align-items: center; }
.list-plain li:last-child { border-bottom: 0; }
.bar-track { height: 6px; border-radius: 99px; background: rgba(255,255,255,.09); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--grad); }

/* ---------------------------------- 表格 ---------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--text-mute); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.table tbody tr:hover { background: rgba(255,255,255,.03); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; }

/* ---------------------------------- 弹窗 ---------------------------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(4,4,10,.72); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; z-index: 90; padding: 20px;
}
.modal-mask.on { display: flex; animation: fadeIn .2s ease; }
.modal {
  width: 100%; max-width: 480px; background: var(--bg-soft); border: 1px solid var(--line-strong);
  border-radius: 20px; padding: 24px; box-shadow: var(--shadow); max-height: 88vh; overflow: auto;
}
.modal.wide { max-width: 760px; }
.modal h3 { margin: 0 0 6px; font-size: 19px; }
.modal .sub { color: var(--text-mute); margin-bottom: 18px; font-size: 13px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.toast-host { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 12px 18px; border-radius: 13px; background: rgba(20,20,32,.96); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); animation: fadeIn .2s ease; max-width: 360px; font-size: 13px;
}
.toast.ok { border-color: rgba(52,211,153,.4); } .toast.err { border-color: rgba(251,113,133,.45); }

/* ---------------------------------- 页脚 ---------------------------------- */
.footer { margin-top: 56px; border-top: 1px solid var(--line); padding: 34px 0 40px; color: var(--text-mute); font-size: 13px; }
.footer .cols { display: flex; gap: 40px; flex-wrap: wrap; margin-bottom: 20px; }
.footer h5 { margin: 0 0 10px; color: var(--text-dim); font-size: 13px; }
.footer a:hover { color: var(--text); }
.footer .fine { line-height: 1.9; }

/* ---------------------------------- 认证页 ---------------------------------- */
.auth-wrap { max-width: 460px; margin: 56px auto; }
.turnstile-slot { min-height: 66px; display: flex; align-items: center; margin: 6px 0 14px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.alert { padding: 11px 14px; border-radius: 12px; font-size: 13px; border: 1px solid var(--line); margin-bottom: 14px; }
.alert.err { background: rgba(251,113,133,.1); border-color: rgba(251,113,133,.35); color: #fecdd3; }
.alert.ok { background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.32); color: #bbf7d0; }
.alert.warn { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.32); color: #fde68a; }

/* ---------------------------------- 会员中心 ---------------------------------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.plan { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--panel); transition: .2s; position: relative; }
.plan:hover { transform: translateY(-2px); border-color: rgba(124,108,255,.45); }
.plan.recommend { border-color: rgba(124,108,255,.5); background: linear-gradient(150deg, rgba(124,108,255,.14), transparent); }
.plan .price { font-size: 30px; font-weight: 700; }
.plan .price small { font-size: 14px; color: var(--text-mute); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 14px 0 18px; color: var(--text-dim); font-size: 13px; }
.plan ul li { padding: 5px 0; }

/* ---------------------------------- 后台 ---------------------------------- */
.admin-shell { display: grid; grid-template-columns: 234px 1fr; min-height: 100vh; position: relative; z-index: 1; }
.admin-side { border-right: 1px solid var(--line); background: rgba(10,10,18,.7); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.admin-side .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 6px 8px 18px; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px;
  color: var(--text-dim); font-size: 13.5px; margin-bottom: 3px; cursor: pointer; transition: .16s;
}
.admin-nav a:hover { background: var(--panel); color: var(--text); }
.admin-nav a.on { background: linear-gradient(120deg, rgba(124,108,255,.25), rgba(34,211,238,.12)); color: #fff; font-weight: 600; }
.admin-main { padding: 22px 26px 60px; }
.admin-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.admin-head h2 { margin: 0; font-size: 21px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.kpi b { display: block; font-size: 25px; font-weight: 700; }
.kpi span { color: var(--text-mute); font-size: 12.5px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.section { margin-bottom: 26px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.drag-handle { cursor: grab; color: var(--text-mute); }
tr.dragging { opacity: .45; }

@media (max-width: 1024px) {
  .layout-main { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; }
  .cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .hero h1 { font-size: 29px; }
  .nav { display: none; }
  .topbar .search-mini { display: none; }
  .kv { grid-template-columns: 1fr; }
  .kv > div:nth-child(odd) { width: auto; }
  .form-row { grid-template-columns: 1fr; }
}
