/* ScriptDock 设计系统 —— 深色 + 青柠绿 */
:root {
  --bg: #0b0e13;
  --bg-elev: #0f131a;
  --card: #12161d;
  --card-2: #171d26;
  --line: #232a35;
  --line-2: #2a323d;
  --accent: #c6f24e;
  --accent-dim: #9dc72f;
  --text: #e9eef6;
  --text-2: #f2f5fa;
  --muted: #8a94a6;
  --dim: #646e7f;
  --faint: #4e5766;
  --orange: #f2a33c;
  --red: #ef6b6b;
  --green: #3fb950;
  --blue: #4e7df0;
  --radius: 12px;
  --radius-lg: 16px;
  --sans: "Inter", -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
  --max: 1240px;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

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

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }
::selection { background: rgba(198, 242, 78, 0.28); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #2c3441; border-radius: 8px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #3d4757; background-clip: padding-box; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 32px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 19, 26, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 32px;
  height: 60px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15.5px; letter-spacing: -0.2px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent); color: #0b0e13;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.nav { display: flex; align-items: center; gap: 22px; font-size: 13.5px; color: var(--muted); }
.nav a { padding: 4px 0; border-bottom: 1.5px solid transparent; transition: color 0.15s; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text-2); border-bottom-color: var(--accent); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* ---------- 通用控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--card-2); color: var(--text); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.btn:hover { border-color: #3a4453; background: #1d242e; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #0b0e13; font-weight: 600; }
.btn-primary:hover { background: #d4ff5e; border-color: #d4ff5e; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); border-color: #3a2528; }
.btn-danger:hover { background: #221517; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-icon { width: 34px; padding: 0; }

.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 12px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 9px; color: var(--text); font-size: 13.5px; font-family: inherit;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.7; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: #4a5668; box-shadow: 0 0 0 3px rgba(198, 242, 78, 0.09);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' fill='none' stroke='%238A94A6' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px;
}
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.field-note { font-size: 11.5px; color: var(--faint); margin-top: 6px; }
.mono { font-family: var(--mono); }

/* ---------- 卡片 / 徽标 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-pad { padding: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px;
  border-radius: 8px; background: var(--card-2); border: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px; cursor: pointer; transition: all 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.active { background: rgba(198, 242, 78, 0.12); border-color: rgba(198, 242, 78, 0.4); color: var(--accent); }
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px;
  border-radius: 6px; font-size: 11.5px; font-weight: 500; background: var(--card-2); color: var(--muted);
  border: 1px solid var(--line);
}
.badge-accent { background: rgba(198, 242, 78, 0.12); color: var(--accent); border-color: rgba(198, 242, 78, 0.32); }
.badge-orange { background: rgba(242, 163, 60, 0.12); color: var(--orange); border-color: rgba(242, 163, 60, 0.3); }
.badge-red { background: rgba(239, 107, 107, 0.12); color: var(--red); border-color: rgba(239, 107, 107, 0.3); }
.badge-green { background: rgba(63, 185, 80, 0.12); color: var(--green); border-color: rgba(63, 185, 80, 0.3); }
.badge-blue { background: rgba(78, 125, 240, 0.12); color: #7d9df5; border-color: rgba(78, 125, 240, 0.3); }

.ico-badge {
  width: 42px; height: 42px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 800; font-size: 17px; color: #0b0e13;
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; color: #0b0e13; flex: 0 0 auto;
}
.stars { color: var(--accent); letter-spacing: 1px; font-size: 11.5px; }

/* ---------- 头部区块 ---------- */
.page-head { padding: 38px 0 26px; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; margin: 0 0 8px; color: var(--text-2); }
.page-sub { color: var(--muted); font-size: 13.5px; margin: 0; }
.crumbs { font-size: 12.5px; color: var(--faint); margin-bottom: 18px; display: flex; gap: 8px; align-items: center; }
.crumbs a:hover { color: var(--muted); }

/* ---------- 首页 Hero ---------- */
.hero { padding: 72px 0 52px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; left: 50%; top: -220px; width: 900px; height: 520px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(198, 242, 78, 0.1), transparent 62%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px;
  border-radius: 999px; background: rgba(198, 242, 78, 0.1);
  border: 1px solid rgba(198, 242, 78, 0.28); color: var(--accent);
  font-size: 11.5px; font-weight: 500; margin-bottom: 22px;
}
.hero h1 {
  font-size: 50px; line-height: 1.14; font-weight: 800; letter-spacing: -1.6px;
  margin: 0 0 18px; color: var(--text-2); max-width: 720px;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { font-size: 15.5px; color: var(--muted); max-width: 600px; margin: 0 0 30px; line-height: 1.75; }

.search-hero { display: flex; gap: 10px; max-width: 620px; }
.search-hero .input { height: 46px; font-size: 14px; border-radius: 11px; padding-left: 40px;
  background: var(--bg-elev) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23646E7F' stroke-width='1.7'><circle cx='7' cy='7' r='5'/><path d='M11 11l4 4'/></svg>") no-repeat 13px center;
}
.search-hero .btn { height: 46px; padding: 0 22px; border-radius: 11px; }
.hero-stats { display: flex; gap: 30px; margin-top: 26px; font-size: 12.5px; color: var(--dim); }
.hero-stats b { color: var(--text); font-weight: 650; font-family: var(--mono); font-size: 13px; }

/* ---------- 布局 ---------- */
.layout-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; padding-bottom: 64px; }
.layout-side { display: flex; flex-direction: column; gap: 16px; }
.section-head { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.section-title { font-size: 16px; font-weight: 650; margin: 0; color: var(--text-2); letter-spacing: -0.2px; }
.section-more { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.section-more:hover { color: var(--accent); }

/* ---------- 脚本列表行 ---------- */
.script-list { display: flex; flex-direction: column; gap: 10px; }
.script-row {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px;
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
  transition: border-color 0.16s, background 0.16s, transform 0.16s;
}
.script-row:hover { border-color: #33404f; background: #141a22; transform: translateY(-1px); }
.script-row .meta { flex: 1; min-width: 0; }
.script-row .name { font-size: 14.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.script-row .desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.script-row .facts { display: flex; align-items: center; gap: 14px; font-size: 11.5px; color: var(--dim); margin-top: 7px; font-family: var(--mono); }
.script-row .actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* ---------- 卡片网格 ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.script-card {
  display: flex; flex-direction: column; gap: 11px; padding: 17px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  transition: border-color 0.16s, transform 0.16s, background 0.16s;
}
.script-card:hover { border-color: #33404f; background: #141a22; transform: translateY(-2px); }
.script-card .head { display: flex; gap: 11px; align-items: flex-start; }
.script-card .name { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 3px; }
.script-card .desc { font-size: 12.5px; color: var(--muted); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.script-card .foot { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--dim);
  margin-top: auto; font-family: var(--mono); }

/* ---------- 侧栏小卡 ---------- */
.side-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 17px; }
.side-title { font-size: 13px; font-weight: 650; color: var(--text-2); margin: 0 0 13px;
  display: flex; align-items: center; gap: 7px; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 12.5px; }
.rank-item .no { width: 16px; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.rank-item .no.top { color: var(--accent); font-weight: 700; }
.rank-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.rank-item .n { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.side-cta {
  background: linear-gradient(160deg, rgba(198, 242, 78, 0.1), rgba(198, 242, 78, 0.02));
  border: 1px solid rgba(198, 242, 78, 0.22);
}

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 500; color: var(--dim);
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 13px 14px; border-bottom: 1px solid #1a2029; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #141a22; }
.table .cell-name { display: flex; align-items: center; gap: 10px; }
.table .cell-name b { font-weight: 600; color: var(--text-2); font-size: 13px; }
.table .cell-sub { font-size: 11px; color: var(--faint); font-family: var(--mono); margin-top: 2px; }
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }

.switch {
  position: relative; width: 34px; height: 19px; border-radius: 999px;
  background: #2a323d; cursor: pointer; transition: background 0.18s; flex: 0 0 auto;
  border: none; padding: 0;
}
.switch::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #8a94a6; transition: transform 0.18s, background 0.18s;
}
.switch.on { background: rgba(198, 242, 78, 0.3); }
.switch.on::after { transform: translateX(15px); background: var(--accent); }

/* ---------- 代码 ---------- */
.code-block {
  background: #0a0d12; border: 1px solid var(--line); border-radius: 12px;
  font-family: var(--mono); font-size: 12px; line-height: 1.75; color: #b9c3d3;
  overflow: auto; max-height: 460px;
}
.code-block pre { margin: 0; padding: 16px 18px; }
.code-line { display: flex; }
.code-line .ln { color: #3b4453; width: 34px; text-align: right; padding-right: 14px; flex: 0 0 auto; user-select: none; }
.code-line .src { white-space: pre; }
.tok-com { color: #5a6779; }
.tok-str { color: #a8d98a; }
.tok-kw { color: #c6f24e; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab {
  padding: 9px 14px; font-size: 13px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; border-top: 0; border-left: 0; border-right: 0;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text-2); border-bottom-color: var(--accent); }

/* ---------- 提示 ---------- */
.toast-host { position: fixed; right: 22px; bottom: 22px; z-index: 999; display: flex; flex-direction: column; gap: 9px; }
.toast {
  padding: 11px 16px; border-radius: 10px; background: #1a212b; border: 1px solid var(--line-2);
  color: var(--text); font-size: 13px; box-shadow: var(--shadow); animation: toastIn 0.2s ease;
  max-width: 340px;
}
.toast.ok { border-color: rgba(198, 242, 78, 0.42); }
.toast.bad { border-color: rgba(239, 107, 107, 0.45); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.empty { padding: 46px 20px; text-align: center; color: var(--dim); font-size: 13px; }
.empty b { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; font-weight: 600; }

.notice {
  display: flex; gap: 10px; padding: 12px 15px; border-radius: 10px;
  background: #131a15; border: 1px solid #2f4433; color: #a9c7a4; font-size: 12.5px; line-height: 1.65;
}
.notice.warn { background: #1d1810; border-color: #4a3a1c; color: #d9b57a; }
.notice.bad { background: #1e1414; border-color: #4a2626; color: #d99a9a; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); padding: 30px 0 40px; color: var(--faint); font-size: 12px; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 0 32px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.footer a:hover { color: var(--muted); }

/* ---------- 弹层 ---------- */
.modal-host {
  position: fixed; inset: 0; z-index: 200; display: none; place-items: center;
  background: rgba(6, 8, 12, 0.72); backdrop-filter: blur(6px); padding: 24px;
}
.modal-host.open { display: grid; }
.modal { width: 100%; max-width: 520px; background: var(--bg-elev); border: 1px solid var(--line-2);
  border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- 分布 ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .faint { color: var(--faint); }
.t-12 { font-size: 12px; } .t-13 { font-size: 13px; } .t-15 { font-size: 15px; }
.hide { display: none !important; }

@media (max-width: 1080px) {
  .layout-main { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h1 { font-size: 38px; }
}
@media (max-width: 760px) {
  .wrap, .topbar-inner, .footer-inner { padding: 0 18px; }
  .nav { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding: 44px 0 34px; }
  .hero h1 { font-size: 30px; letter-spacing: -0.8px; }
  .search-hero { flex-direction: column; }
}

/* ============================================================
   账号体系 / 后台管理 追加样式
   ============================================================ */

/* ---------- 认证页 ---------- */
.auth-wrap { min-height: calc(100vh - 190px); display: grid; place-items: center; padding: 46px 0 68px; }
.auth-card { width: 100%; max-width: 410px; }
.auth-card.wide { max-width: 460px; }
.auth-title { font-size: 23px; font-weight: 700; letter-spacing: -0.4px; margin: 0 0 6px; color: var(--text-2); }
.auth-sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.auth-tabs { display: flex; gap: 2px; padding: 4px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; height: 32px; border: none; background: none; border-radius: 7px; color: var(--muted); font-size: 13px; cursor: pointer; transition: all 0.15s; }
.auth-tabs button.active { background: var(--card-2); color: var(--text); }
.auth-hint { font-size: 12px; color: var(--faint); margin-top: 18px; line-height: 1.75; padding: 11px 13px; border: 1px dashed var(--line-2); border-radius: 9px; }
.auth-alt { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--dim); margin-top: 14px; }
.auth-alt a { color: var(--muted); }
.auth-alt a:hover { color: var(--accent); }

/* ---------- 表单附属 ---------- */
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.input-group .btn { flex: 0 0 auto; height: 36px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check-line { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--muted); line-height: 1.6; cursor: pointer; }
.check-line input { margin: 3px 0 0; accent-color: var(--accent); width: 14px; height: 14px; flex: 0 0 auto; }

/* ---------- 验证码 ---------- */
.code-input {
  letter-spacing: 0.4em; font-family: var(--mono); font-size: 20px; text-align: center;
  height: 54px; padding-left: 0.4em;
}
.dev-code {
  margin-top: 14px; padding: 11px 14px; border-radius: 10px;
  background: #1d1810; border: 1px solid #4a3a1c; color: #d9b57a; font-size: 12.5px;
}
.dev-code b { font-family: var(--mono); font-size: 15px; letter-spacing: 0.22em; color: var(--orange); }

/* ---------- 账号中心 ---------- */
.acct-grid { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 26px; padding-bottom: 60px; align-items: start; }
.acct-nav { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 78px; }
.acct-nav a {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 9px;
  font-size: 13px; color: var(--muted); cursor: pointer;
}
.acct-nav a:hover { background: #141a22; color: var(--text); }
.acct-nav a.active { background: rgba(198, 242, 78, 0.1); color: var(--accent); }
.acct-section { display: none; }
.acct-section.active { display: block; }
.set-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 18px; }
.set-card h2 { font-size: 15px; font-weight: 650; margin: 0 0 4px; color: var(--text-2); }
.set-card .set-desc { font-size: 12.5px; color: var(--dim); margin: 0 0 18px; line-height: 1.65; }
.set-card.danger { border-color: #3a2528; }
.set-card.danger h2 { color: var(--red); }
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; }
.profile-head .avatar-lg {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  font-size: 22px; font-weight: 800; color: #0b0e13; flex: 0 0 auto;
}
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: transform 0.12s; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { border-color: var(--text-2); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12); }

/* ---------- 设备列表 ---------- */
.device { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #1a2029; }
.device:last-child { border-bottom: none; }
.device .ico { width: 34px; height: 34px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 15px; flex: 0 0 auto; }
.device .info { flex: 1; min-width: 0; }
.device .info b { font-size: 13px; font-weight: 600; color: var(--text-2); }
.device .info div { font-size: 11.5px; color: var(--faint); font-family: var(--mono); margin-top: 2px; }

/* ---------- 后台外壳 ---------- */
body.admin-body { display: flex; min-height: 100vh; align-items: stretch; }
.admin-side {
  width: 214px; flex: 0 0 auto; background: var(--bg-elev); border-right: 1px solid var(--line);
  padding: 18px 12px 20px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-side .brand { padding: 4px 8px 18px; }
.side-label { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.1em; padding: 14px 9px 6px; }
.side-link { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.side-link:hover { background: #141a22; color: var(--text); }
.side-link.active { background: rgba(198, 242, 78, 0.1); color: var(--accent); }
.side-link .n { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.side-link.active .n { color: var(--accent); }
.side-link .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); margin-left: auto; }
.admin-main { flex: 1; min-width: 0; padding: 24px 30px 60px; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat { padding: 15px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.stat .k { font-size: 11px; color: var(--dim); margin-bottom: 5px; }
.stat .v { font-size: 21px; font-weight: 700; font-family: var(--mono); color: var(--text-2); letter-spacing: -0.4px; }
.stat .v small { font-size: 11px; color: var(--faint); font-weight: 400; margin-left: 3px; font-family: var(--sans); }
.stat.hl { border-color: rgba(198, 242, 78, 0.28); background: linear-gradient(160deg, rgba(198, 242, 78, 0.07), transparent); }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .input { max-width: 280px; height: 32px; font-size: 12.5px; }
.toolbar .select { width: auto; min-width: 110px; height: 32px; font-size: 12.5px; }
.row-actions { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- 趋势条 ---------- */
.trend { display: flex; align-items: flex-end; gap: 8px; height: 96px; padding: 4px 2px 0; }
.trend .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; height: 100%; }
.trend .bar i { display: block; background: linear-gradient(180deg, #c6f24e, rgba(198, 242, 78, 0.24)); border-radius: 3px 3px 0 0; min-height: 2px; }
.trend .bar span { text-align: center; font-size: 10px; color: var(--faint); font-family: var(--mono); }

/* ---------- 邮件中心 ---------- */
.mail-item { border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px; margin-bottom: 9px; background: var(--card); }
.mail-item .mh { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.mail-item .mh b { font-size: 13px; font-weight: 600; color: var(--text-2); }
.mail-item .mh .to { font-size: 11.5px; color: var(--faint); font-family: var(--mono); }
.mail-item .mbody { display: none; margin-top: 13px; border-top: 1px solid var(--line); padding-top: 13px; }
.mail-item.open .mbody { display: block; }
.mail-frame { width: 100%; height: 380px; border: 0; border-radius: 9px; background: #fff; }

/* ---------- 日志 ---------- */
.log-line { display: flex; gap: 12px; padding: 9px 2px; border-bottom: 1px solid #1a2029; font-size: 12.5px; }
.log-line:last-child { border-bottom: none; }
.log-line .t { color: var(--faint); font-family: var(--mono); font-size: 11px; flex: 0 0 132px; }
.log-line .a { color: var(--accent); font-family: var(--mono); font-size: 11.5px; flex: 0 0 152px; }
.log-line .who { color: var(--text); flex: 0 0 96px; }
.log-line .d { color: var(--dim); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1180px) {
  .stat-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .acct-grid { grid-template-columns: 1fr; }
  .acct-nav { position: static; flex-direction: row; overflow-x: auto; }
  .admin-side { display: none; }
  .stat-grid, .stat-grid.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-row { grid-template-columns: 1fr; }
}

/* ---------- 顶栏账号菜单 ---------- */
.acct-menu { position: relative; }
.acct-menu .avatar { border: 0; cursor: pointer; }
.acct-pop {
  position: absolute; right: 0; top: 34px; min-width: 192px; display: none; z-index: 90;
  background: var(--bg-elev); border: 1px solid var(--line-2); border-radius: 11px;
  box-shadow: var(--shadow); padding: 6px;
}
.acct-menu.open .acct-pop { display: block; }
.acct-pop a, .acct-pop button {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px;
  font-size: 13px; color: var(--muted); background: none; border: 0; cursor: pointer;
}
.acct-pop a:hover, .acct-pop button:hover { background: #1d242e; color: var(--text); }
.acct-pop .sep { height: 1px; background: var(--line); margin: 5px 4px; }
.acct-pop .who { padding: 8px 10px 9px; }
.acct-pop .who b { display: block; font-size: 13px; color: var(--text-2); }
.acct-pop .who span { font-size: 11.5px; color: var(--faint); font-family: var(--mono); }

/* ============================================================
   设计系统 v2 —— 整站打磨层（2026-10-22）
   原则：不改动既有类名契约，只升级观感、交互态与一致性
   ============================================================ */

:root {
  --ring: 0 0 0 3px rgba(198, 242, 78, 0.13);
  --ring-strong: 0 0 0 3px rgba(198, 242, 78, 0.22);
  --btn-glow: 0 4px 18px rgba(198, 242, 78, 0.22);
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
}

/* ---------- 全局氛围 ---------- */
body {
  background:
    radial-gradient(1100px 480px at 78% -160px, rgba(198, 242, 78, 0.05), transparent 60%),
    radial-gradient(900px 500px at -140px 110%, rgba(78, 125, 240, 0.045), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
}
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 76px; }

h1, h2, h3, .page-title, .section-title, .auth-title { text-wrap: balance; }

/* 键盘焦点环：只用 :focus-visible，鼠标点击不出现 */
:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: 2px; border-radius: 4px; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; }

/* 行内代码与键帽：此前完全无样式 */
code {
  font-family: var(--mono); font-size: 0.92em;
  background: #1a212b; border: 1px solid var(--line);
  padding: 1px 6px; border-radius: 5px; color: #c9d4e3;
}
kbd {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  background: var(--card-2); border: 1px solid var(--line-2); border-bottom-width: 2px;
  padding: 2px 7px; border-radius: 6px; white-space: nowrap;
}
pre code { background: none; border: 0; padding: 0; }

/* 数字对齐：统计、表格、代码行统一等宽数字 */
.mono, .stat .v, .script-row .facts, .script-card .foot,
.table td, .rank-item .n, .hero-stats b, .log-line {
  font-variant-numeric: tabular-nums;
}

/* 滚动条更纤细 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2b333f; border: 0; border-radius: 8px; }

/* ---------- 按钮：按压反馈 / 主按钮辉光 / 加载态 ---------- */
.btn { will-change: transform; }
.btn:active:not(:disabled) { transform: translateY(0.5px) scale(0.985); }
.btn-primary:hover { box-shadow: var(--btn-glow); }
.btn-primary:active:not(:disabled) { background: #b6dd45; border-color: #b6dd45; box-shadow: none; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.045); }
.btn-danger:hover { border-color: rgba(239, 107, 107, 0.55); color: #f48e8e; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { filter: saturate(0.6); }

/* 加载态：文字透明 + 居中旋转环（由 app.js 的 api() 自动触发） */
.btn.loading {
  color: transparent !important; pointer-events: none; position: relative;
}
.btn.loading > * { opacity: 0; }
.btn.loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(233, 238, 246, 0.25); border-top-color: var(--text);
  animation: sd-spin 0.65s linear infinite;
}
.btn-primary.loading::after { border-color: rgba(11, 14, 19, 0.28); border-top-color: #0b0e13; }
@keyframes sd-spin { to { transform: rotate(360deg); } }

/* ---------- 输入框 / 选择框 ---------- */
.input, .select, .textarea {
  height: 38px; border-radius: 10px; padding: 0 13px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22);
}
.textarea { height: auto; padding: 11px 13px; }
.input:hover, .select:hover, .textarea:hover { border-color: #333e4d; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent-dim);
  box-shadow: var(--ring), inset 0 1px 2px rgba(0, 0, 0, 0.22);
}
.input:disabled, .select:disabled, .textarea:disabled { opacity: 0.55; cursor: not-allowed; }
.input-group .btn { height: 38px; }
.toolbar .input, .toolbar .select { height: 34px; }

/* select：更大的箭头 + hover */
.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='7'><path d='M1 1l5 5 5-5' fill='none' stroke='%238A94A6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-position: right 13px center; padding-right: 34px;
  cursor: pointer;
}
.select option { background: #12161d; color: var(--text); }

/* 复选 / 单选 */
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer;
}

/* 验证码输入框聚焦时更明显 */
.code-input:focus { box-shadow: var(--ring-strong); }

/* ---------- 表格 ---------- */
.table th { letter-spacing: 0.04em; text-transform: uppercase; font-size: 10.5px; padding: 11px 14px; }
.table td { transition: background 0.12s; }
.table tbody tr { transition: background 0.12s; }

/* ---------- 开关 ---------- */
.switch { width: 38px; height: 21px; }
.switch::after { width: 17px; height: 17px; top: 2px; left: 2px; }
.switch.on { background: rgba(198, 242, 78, 0.38); box-shadow: 0 0 10px rgba(198, 242, 78, 0.18); }
.switch.on::after { transform: translateX(17px); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); }

/* ---------- 弹层：入场动画 ---------- */
.modal-host.open { animation: fadeIn 0.16s ease; }
.modal-host.open .modal { animation: modalIn 0.24s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }

/* ---------- Toast：色点 + 阴影层次 ---------- */
.toast { display: flex; align-items: center; gap: 9px; padding: 11px 16px 11px 14px; }
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.toast.ok::before { background: var(--accent); box-shadow: 0 0 8px rgba(198, 242, 78, 0.6); }
.toast.bad::before { background: var(--red); box-shadow: 0 0 8px rgba(239, 107, 107, 0.6); }

/* ---------- 导航下划线动画 ---------- */
.nav a { transition: color 0.15s, border-color 0.2s; }

/* ---------- 空状态 ---------- */
.empty { position: relative; }
.empty::before {
  content: "◌"; display: block; font-size: 30px; color: var(--faint);
  margin-bottom: 10px; line-height: 1;
}

/* ---------- 顶栏与页脚微调 ---------- */
.topbar { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset, 0 6px 24px rgba(0, 0, 0, 0.18); }
.footer a { transition: color 0.15s; }

/* ---------- 卡片阴影层次 ---------- */
.script-row:hover, .script-card:hover { box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22); }
.set-card, .side-card, .stat { transition: border-color 0.15s; }

/* ---------- 侧栏导航（后台 / 账号中心）动效 ---------- */
.side-link, .acct-nav a { transition: background 0.14s, color 0.14s; }

/* ---------- 图标徽标微光 ---------- */
.ico-badge { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22); }

/* ---------- 弱动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
