/* 短链系统前端样式：无任何外部依赖，变量集中在 :root 便于换色。
   选择器名称与 app/views 里的 class 一一对应，改样式时不要重命名。 */
:root {
  --bg: #f4f6fb;
  --bg-2: #eef1f8;
  --panel: #ffffff;
  --line: #e7eaf2;
  --line-strong: #d4d9e6;
  --ink: #101728;
  --ink-2: #3d475c;
  --muted: #6d7789;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-soft: #eef1ff;
  --brand-2: #7c3aed;
  --ok: #0f9d6e;
  --warn: #c2760a;
  --bad: #dc2c48;
  --gold: #a0660f;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 26px -14px rgba(16, 24, 40, .18);
  --shadow-lg: 0 2px 6px rgba(16, 24, 40, .05), 0 26px 60px -28px rgba(16, 24, 40, .3);
  --ring: 0 0 0 3px rgba(79, 70, 229, .16);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14.5px/1.62 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 12px; font-weight: 680; line-height: 1.32; letter-spacing: -.011em; }
h1 { font-size: 23px; } h2 { font-size: 18.5px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0 0 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
::selection { background: #dbe2ff; color: #171b3c; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: none; }

/* ---------------------------------------------------------------- 骨架 */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 1420px; }
.topbar {
  background: rgba(255, 255, 255, .86); backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(16, 24, 40, .02), 0 6px 18px -18px rgba(16, 24, 40, .3);
  position: sticky; top: 0; z-index: 30;
}
.topbar-in { display: flex; align-items: center; gap: 18px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 720; color: var(--ink); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; color: var(--ink); }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .7);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.nav { display: flex; gap: 3px; margin-left: 6px; }
.nav a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 550; transition: .15s; }
.nav a:hover { background: var(--bg-2); text-decoration: none; color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 620; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.page { padding: 26px 0 46px; }
.footer { color: var(--muted); font-size: 12.5px; padding: 30px 0 40px; text-align: center; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--brand); }

/* 控制台（后台 / 用户中心）双栏 */
.console { display: flex; gap: 22px; align-items: flex-start; padding: 24px 0 46px; }
.side { width: 204px; flex: none; position: sticky; top: 84px; }
.side-group { margin-bottom: 18px; }
.side-title { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 0 10px 7px; font-weight: 650; }
.side a {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--ink-2); margin-bottom: 3px; font-size: 13.5px; font-weight: 550; transition: .14s;
}
.side a:hover { background: var(--bg-2); text-decoration: none; color: var(--ink); }
.side a.active {
  background: linear-gradient(120deg, var(--brand), #5b4bef); color: #fff; font-weight: 620;
  box-shadow: 0 6px 16px -8px rgba(79, 70, 229, .8);
}
.main { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- 卡片与栅格 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-head { padding: 15px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.card-head h3 { margin: 0; }
.card-head .right { margin-left: auto; }
.card-body { padding: 20px; }
.card-body.tight { padding: 13px 20px; }
.card-foot { padding: 13px 20px; border-top: 1px solid var(--line); background: var(--bg); border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: 1.5fr 1fr; }
.span2 { grid-column: span 2; }

/* ---------------------------------------------------------------- 统计块 */
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2)); opacity: .85;
}
.stat-label { color: var(--muted); font-size: 12px; margin-bottom: 5px; font-weight: 600; letter-spacing: .01em; }
.stat-num { font-size: 27px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stat-up { color: var(--ok); } .stat-down { color: var(--bad); }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  font-size: 13.5px; font-weight: 600; cursor: pointer; line-height: 1.45; transition: .15s ease; box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: #b6bfd2; text-decoration: none; background: #f9fafd; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn-primary {
  background: linear-gradient(120deg, var(--brand), #5a4bee); border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px -8px rgba(79, 70, 229, .75);
}
.btn-primary:hover { background: linear-gradient(120deg, var(--brand-dark), #4f3fd8); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .8); }
.btn-danger { background: #fff; border-color: #f2c3ca; color: var(--bad); box-shadow: none; }
.btn-danger:hover { background: var(--bad); border-color: var(--bad); color: #fff; box-shadow: 0 6px 16px -8px rgba(220, 44, 72, .7); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); box-shadow: none; }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); box-shadow: none; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------- 表单 */
.field { margin-bottom: 16px; }
.label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 650; }
.input, .select, .textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink); font-size: 14px; font-family: inherit; transition: .14s;
}
.input::placeholder, .textarea::placeholder { color: #a3acbd; }
.input:hover, .select:hover, .textarea:hover { border-color: #bdc5d6; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.textarea { min-height: 100px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat;
}
.input.inline, .select.inline { width: auto; display: inline-block; }
.help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.help.bad { color: var(--bad); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.input-prefix {
  display: flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--panel); transition: .14s;
}
.input-prefix span { display: flex; align-items: center; padding: 0 10px; background: var(--bg-2); color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.input-prefix input { border: 0 !important; box-shadow: none !important; flex: 1; padding: 10px; font-size: 14px; background: transparent; }
.input-prefix:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.input-prefix select.domain-select {
  flex: 0 1 auto; min-width: 0; max-width: 54%; border: 0; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #f3f5fc, #eceff8); color: var(--brand); font-family: inherit;
  font-size: 12.5px; font-weight: 650; padding: 0 11px; cursor: pointer; outline: none;
}
.input-prefix select.domain-select:hover { background: linear-gradient(180deg, #eef1fb, #e6eaf6); }
.input-prefix.suffix-line > span { padding: 0 6px; font-weight: 700; color: var(--ink-2); }
.input-prefix.suffix-line input { min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field { margin: 0; min-width: 132px; }
.filters .grow { flex: 1; min-width: 180px; }
.adv { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 0 14px; margin-bottom: 14px; }
.adv > summary { cursor: pointer; padding: 11px 0; font-weight: 600; font-size: 13.5px; list-style: none; display: flex; align-items: center; gap: 8px; }
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary::before { content: '\25B8'; color: var(--brand); font-size: 11px; transition: transform .15s; }
.adv[open] > summary::before { transform: rotate(90deg); }
.adv-note { font-weight: 400; font-size: 12.5px; color: var(--muted); }
.adv-body { padding-top: 3px; }
.adv[open] { padding-bottom: 1px; }

/* ---------------------------------------------------------------- 提示与徽标 */
.alert { padding: 12px 15px; border-radius: 12px; font-size: 13.5px; margin-bottom: 14px; border: 1px solid var(--line); border-left-width: 3px; }
.alert-ok { background: #ecf9f3; border-color: #b9e6d2; border-left-color: var(--ok); color: #0b6b4a; }
.alert-warn { background: #fef7ea; border-color: #f3dcae; border-left-color: var(--warn); color: #8a5406; }
.alert-bad { background: #fdeef0; border-color: #f4c3ca; border-left-color: var(--bad); color: #a91d33; }
.alert-info, .alert-mute { background: var(--brand-soft); border-color: #cfd7ff; border-left-color: var(--brand); color: #34337f; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 650;
  line-height: 1.7; white-space: nowrap; letter-spacing: .01em;
}
.badge::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; opacity: .8; }
.badge-ok { background: #e6f7ef; color: #0b7d57; }
.badge-warn { background: #fdf3e0; color: #8f5a06; }
.badge-bad { background: #fdecec; color: #b31f34; }
.badge-info { background: var(--brand-soft); color: var(--brand); }
.badge-gold { background: #fdf3dd; color: var(--gold); }
.badge-mute { background: #edf0f5; color: var(--ink-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border: 1px solid var(--line-strong); border-radius: 20px; font-size: 12.5px; color: var(--ink-2); background: var(--panel); transition: .14s; }
.chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.tag { display: inline-block; padding: 2px 8px; background: var(--bg-2); border-radius: 7px; font-size: 12px; color: var(--ink-2); }

/* ---------------------------------------------------------------- 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 12px 13px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 650; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; background: var(--bg); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f6f8fe; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.actions { white-space: nowrap; text-align: right; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .main-cell { min-width: 240px; }
.table td.code-cell { min-width: 250px; max-width: 340px; }
.table td.code-cell a.mono {
  display: inline-block; padding: 3px 9px; border-radius: 8px; background: var(--brand-soft);
  color: var(--brand); font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
.table td.code-cell a.mono:hover { background: #e2e8ff; text-decoration: none; }
.table-compact th, .table-compact td { padding: 9px 11px; }

/* ---------------------------------------------------------------- 其他组件 */
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 12px; }
.pager a.pg, .pager span.gap { padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink-2); font-size: 12.5px; background: var(--panel); transition: .14s; }
.pager a.pg:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pager a.cur { padding: 6px 11px; border-radius: 9px; background: linear-gradient(120deg, var(--brand), #5a4bee); color: #fff; font-size: 12.5px; font-weight: 650; box-shadow: 0 5px 14px -8px rgba(79, 70, 229, .8); }
.pager .total { color: var(--muted); font-size: 12.5px; margin-left: 6px; }
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13.5px; font-weight: 550; border-radius: 8px 8px 0 0; transition: .14s; }
.tabs a:hover { color: var(--ink); background: var(--bg-2); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 650; background: var(--brand-soft); }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-label { width: 122px; flex: none; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 9px; background: var(--bg-2); border-radius: 20px; overflow: hidden; }
.bar-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 20px; transition: width .5s ease; }
.bar-val { width: 78px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(255, 255, 255, .6); }
.empty h4 { color: var(--ink); margin-bottom: 6px; }
.kv { display: grid; grid-template-columns: 104px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.code-box { background: #0f1424; border: 1px solid #1f2740; border-radius: 12px; padding: 14px 16px; font-size: 12.5px; overflow-x: auto; }
.code-box code { font-family: ui-monospace, Menlo, Consolas, monospace; white-space: pre; color: #dbe4ff; }

/* ---------------- API 文档（详情式：色条 + 参数表 + 示例块） ---------------- */
.doc-h2 { margin: 30px 0 12px; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.doc-h2::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--brand); flex: none; }
.doc-sec { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); box-shadow: var(--shadow-sm); margin-bottom: 12px; overflow: hidden; }
.doc-bar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--brand); color: #fff; font-size: 13.5px; font-weight: 650; }
.doc-bar.ok { background: var(--ok); }
.doc-bar .doc-path { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; font-weight: 600; word-break: break-all; }
.doc-mth { display: inline-block; flex: none; padding: 2px 9px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .5px; color: #fff; background: var(--brand); }
.doc-mth.get { background: var(--ok); }
.doc-mth.post { background: var(--brand-2); }
.doc-bar .doc-mth { background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .42); padding: 1px 8px; }
.doc-body { padding: 13px 15px; }
.doc-line { display: flex; gap: 10px; align-items: baseline; margin-bottom: 7px; font-size: 13.5px; }
.doc-line:last-child { margin-bottom: 0; }
.doc-line .lab { flex: none; font-weight: 650; }
.doc-line .val { color: #d6336c; word-break: break-all; }
.doc-body .table-wrap { border: 1px solid var(--line); border-radius: 8px; }
.muted { color: var(--muted); } .right { margin-left: auto; } .center { text-align: center; }
.strong { font-weight: 650; } .nowrap { white-space: nowrap; } .block { display: block; }
.flex { display: flex; gap: 10px; align-items: center; } .flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; } .stack { display: flex; flex-direction: column; gap: 3px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; display: block; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.copy { cursor: pointer; border: 0; background: none; color: var(--brand); font-size: 12.5px; padding: 0; font-weight: 600; }
.copy:hover { text-decoration: underline; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; box-shadow: 0 0 0 3px rgba(15, 157, 110, .16); }
.dot-off { background: var(--muted); box-shadow: 0 0 0 3px rgba(109, 119, 137, .14); }
.section-title { font-size: 15px; margin: 24px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.check-row { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink-2); margin: 10px 0; cursor: pointer; }
.check-row input { margin-top: 3px; flex: none; accent-color: var(--brand); }
.field > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 650; }
.inline-form { display: inline; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 8px; }
.flash-stack { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 90; width: min(560px, 92vw); }
.flash-stack .alert { box-shadow: var(--shadow-lg); background: var(--panel); }
.side-quota { margin-top: 8px; }
.quota-line { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.quota-line b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 后台骨架（浅色：侧栏 + 顶栏 + 内容列） */
.admin-body { background: var(--bg); }
.admin-shell { display: flex; align-items: flex-start; min-height: 100vh; }
.admin-side {
  width: 236px; flex: none; background: var(--panel); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 16px 12px 12px;
}
.side-logo { padding: 4px 8px 16px; font-size: 15.5px; }
.tag-soft { background: var(--brand-soft); color: var(--brand); border: 1px solid #dfe4ff; border-radius: 6px; font-size: 11px; padding: 1px 6px; margin-left: 6px; font-weight: 620; }
.admin-me {
  display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 16px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.admin-me .stack { min-width: 0; }
.admin-me b { font-size: 13.5px; }
.me-role { margin-top: 2px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; color: #fff; font-size: 14px; font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 4px 12px -6px rgba(79, 70, 229, .8);
  display: inline-flex; align-items: center; justify-content: center;
}
.admin-nav { flex: 1; min-height: 0; overflow-y: auto; }
.admin-nav a, .side-foot a, .side-out {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; margin-bottom: 2px;
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink-2);
  font: 550 13.5px/1.5 inherit; text-align: left; cursor: pointer; transition: .14s;
}
.admin-nav a:hover, .side-foot a:hover, .side-out:hover { background: var(--bg-2); color: var(--ink); text-decoration: none; }
.admin-nav a.active {
  background: linear-gradient(120deg, var(--brand), #5b4bef); color: #fff; font-weight: 620;
  box-shadow: 0 6px 16px -9px rgba(79, 70, 229, .9);
}
.admin-nav a.active:hover { color: #fff; }
.ico { width: 16px; height: 16px; flex: none; }
.side-foot { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }
.side-foot a, .side-out { color: var(--muted); font-weight: 550; }
.side-out { display: flex; }
.admin-col { flex: 1; min-width: 0; }
.adminbar {
  background: rgba(255, 255, 255, .88); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.adminbar-in { display: flex; align-items: center; gap: 14px; height: 58px; padding: 0 24px; max-width: 1420px; }
.admin-h1 { margin: 0; font-size: 16.5px; font-weight: 680; letter-spacing: -.015em; }
.admin-clock { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.admin-out-link { border-color: var(--line-strong); }
.admin-page { padding: 22px 24px 46px; max-width: 1420px; }
.admin-page .card-head h3, .section-title { display: flex; align-items: center; gap: 8px; }
.admin-page .card-head h3::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px; flex: none;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}
.admin-page .stat { padding: 15px 16px; }
.admin-page .stat::before { display: none; }
.admin-page .stat-num { font-size: 24px; color: var(--brand); }
.admin-page .stat-label { margin-bottom: 4px; }
/* 手机端抽屉导航：桌面上隐藏，窄屏在 ≤900px 段落里显示 */
.menu-btn {
  display: none; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); color: var(--ink-2); cursor: pointer;
}
.menu-btn:hover { border-color: var(--brand); color: var(--brand); }
.menu-btn .ico { width: 18px; height: 18px; }
.side-backdrop { display: none; }
.side-count { margin-left: auto; background: var(--warn); color: #fff; border-radius: 20px; font-size: 11.5px; padding: 0 7px; line-height: 18px; font-weight: 700; }
.admin-nav a.active .side-count, .side a.active .side-count { background: #fff; color: var(--brand); }
/* 用户中心侧栏的配额小块：与 .admin-me 同款底色，手机上让位给导航 */
.side-plan { margin: 2px 0 6px; padding: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.side-plan .quota-line { margin-top: 6px; }
.side-plan .quota-line:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- 首页 */
.hero { padding: 44px 0 24px; text-align: center; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: -40px 0 auto; height: 340px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(52% 60% at 50% 0%, rgba(79, 70, 229, .16), rgba(79, 70, 229, 0) 70%),
    radial-gradient(38% 46% at 78% 6%, rgba(124, 58, 237, .13), rgba(124, 58, 237, 0) 70%),
    radial-gradient(30% 40% at 20% 10%, rgba(14, 165, 233, .1), rgba(14, 165, 233, 0) 70%);
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 14px; padding: 4px 13px 4px 11px;
  font-size: 12.5px; font-weight: 620; color: var(--brand); letter-spacing: -.005em;
  background: rgba(255, 255, 255, .78); border: 1px solid #dfe4ff; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.hero-eyebrow .dot { width: 7px; height: 7px; }
.hero h1 { font-size: 37px; letter-spacing: -.04em; margin-bottom: 10px; font-weight: 760; }
.hero h1 .grad {
  background: linear-gradient(112deg, var(--brand), #7c3aed 55%, #d946ef);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--brand);
}
.hero p.lead { color: var(--ink-2); font-size: 15.5px; max-width: 640px; margin: 0 auto 16px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.hero-tag {
  font-size: 12px; color: var(--ink-2); background: rgba(255, 255, 255, .72);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px;
}
.hero-stats { display: flex; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.hstat { padding: 0 26px; border-left: 1px solid var(--line-strong); text-align: center; }
.hstat:first-child { border-left: 0; }
.hstat b { display: block; font-size: 22px; font-weight: 720; letter-spacing: -.028em; font-variant-numeric: tabular-nums; }
.hstat span { font-size: 12px; color: var(--muted); }
.shorten { max-width: 800px; margin: 0 auto; text-align: left; }
.shorten > .card { box-shadow: var(--shadow-lg); border-color: var(--line); }
.shorten .card-body { padding: 20px; }
.gen-card .card-head { padding: 13px 18px; }
.gen-card .card-head h3 { font-size: 14.5px; }
.kbd-hint { font-size: 12px; color: var(--muted); font-weight: 400; }
kbd {
  background: #eef1f6; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
  padding: 1px 6px; font-size: 11.5px; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink-2);
}
.create-form .field { margin-bottom: 14px; }
.field > span .fstep {
  display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-right: 6px;
  border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  font-size: 10.5px; font-weight: 700; font-style: normal; vertical-align: -2px;
}
.field > span .fnote { font-style: normal; font-weight: 500; color: var(--muted); font-size: 11.5px; margin-left: 7px; }
.create-foot { margin-top: 4px; align-items: center; }
.create-foot .btn-lg .ico { width: 17px; height: 17px; }
.result { margin-top: 18px; padding: 14px; border: 1px solid #bce7d4; border-radius: 14px; background: linear-gradient(180deg, #f0fbf6, #fff); }
.result-head { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #0b6b4a; margin-bottom: 10px; }
.result-head .ico { width: 17px; height: 17px; color: var(--ok); }
.result-head .muted { margin-left: auto; font-size: 11.5px; }
.result-main {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #fff;
  border: 1px dashed #a4d7c1; border-radius: 11px;
}
.result-main .short-url { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 680; color: var(--brand); word-break: break-all; }
.result-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.result-line .short-url { font-size: 16.5px; font-weight: 660; color: var(--brand); word-break: break-all; }
.result-line > .result-from { margin-left: auto; }
.result-from { font-size: 12px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 800px; margin: 24px auto 0; }
.step { display: flex; align-items: flex-start; gap: 10px; }
.step-n {
  flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: var(--panel);
  border: 1px solid var(--line-strong); color: var(--brand); font-size: 12px; font-weight: 700; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center;
}
.step b { font-size: 13.5px; }
.step span { font-size: 12.5px; color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 34px 0 0; }
.feature {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  transition: .16s ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #dbe1ee; }
.f-ico {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 10px; margin-bottom: 11px;
}
.f-ico .ico { width: 18px; height: 18px; }
.f-ico-a { background: #eef1ff; color: #4f46e5; }
.f-ico-b { background: #e9f8f2; color: #0f9d6e; }
.f-ico-c { background: #fff5e6; color: #c2760a; }
.f-ico-d { background: #f4ecff; color: #7c3aed; }
.feature h4 { margin: 0 0 5px; font-size: 14.5px; }
.feature p { color: var(--muted); font-size: 13px; margin: 0; }
.upsell { background: linear-gradient(135deg, #eef1ff, #f6f0ff 55%, #fdf5e6); border: 1px solid #dfe4ff; }
.wrap-flex { flex-wrap: wrap; gap: 14px; }
.qr-box { text-align: center; }
.qr-box svg { width: 180px; height: 180px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.announce { background: #fef8ea; border: 1px solid #f2e2bd; border-left: 3px solid var(--warn); color: #7d5a12; padding: 11px 15px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.home-fb {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px;
  max-width: 800px; margin: 26px auto 0; padding: 12px 16px; text-align: center;
  background: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--radius);
  font-size: 13px; color: var(--muted);
}
.home-fb .btn .ico { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- 认证页 */
.auth-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 18px;
  background: radial-gradient(60% 50% at 50% 0%, rgba(79, 70, 229, .1), rgba(79, 70, 229, 0) 70%), var(--bg);
}
.auth-card { width: 100%; max-width: 424px; }
.auth-card .card { box-shadow: var(--shadow-lg); }
.auth-card .card-body { padding: 28px; }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-head .logo { justify-content: center; margin-bottom: 8px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
/* 后台登录沿用顶栏那套深色，跟前台登录页区分开 */
.auth-shell-dark { background: linear-gradient(150deg, #0f172a, #1c2338 55%, #241f3a); }
.auth-shell-dark .label, .auth-shell-dark .field > span { color: #c6cfe4; }
.auth-shell-dark .check { color: #c6cfe4; }
/* 后台登录页仍是深色卡片，跟浅色后台主界面分开 */
.logo-light { color: #fff; }
.logo-light .logo-mark { background: linear-gradient(135deg, #6366f1, #a855f7); box-shadow: none; }
.tag-dark { background: rgba(255, 255, 255, .14); color: #dde3f7; border: 1px solid rgba(255, 255, 255, .12); }
.btn-dark { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: #e8ecfa; box-shadow: none; }
.btn-dark:hover { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .34); color: #fff; box-shadow: none; }
.auth-shell-dark .auth-foot { color: #8f9cb8; }
.auth-shell-dark .auth-foot a { color: #b9c3f0; }

/* ---------------------------------------------------------------- 跳转/失效页 */
.state-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 18px; text-align: center;
  background: radial-gradient(60% 50% at 50% 0%, rgba(79, 70, 229, .08), rgba(79, 70, 229, 0) 70%), var(--bg);
}
.state-card { max-width: 470px; width: 100%; }
.state-card .card { box-shadow: var(--shadow-lg); }
.state-card .card-body { padding: 32px 28px; }
.state-icon { font-size: 36px; margin-bottom: 12px; }
.countdown { font-size: 13px; color: var(--muted); margin-top: 10px; }

@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-side, .g3 { grid-template-columns: 1fr; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-side { width: 210px; }
}
/* 手机端：侧栏收进抽屉，顶栏左侧按钮开合；前台生成表单收成一列 */
@media (max-width: 900px) {
  .admin-shell { display: block; min-height: 0; }
  .menu-btn { display: inline-flex; }
  .admin-side {
    position: fixed; top: 0; left: 0; bottom: 0; width: 276px; max-width: 84vw; height: 100%;
    z-index: 60; border-right: 1px solid var(--line); box-shadow: var(--shadow-lg);
    transform: translateX(-104%); transition: transform .24s ease; overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  body.side-open .admin-side { transform: none; }
  body.side-open { overflow: hidden; }
  body.side-open .side-backdrop { display: block; }
  .side-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(15, 23, 42, .44); }
  .admin-nav { flex: none; overflow: visible; }
  /* 顶栏窄屏：标题占剩余宽度并省略号，右侧按钮不换行不压缩 */
  .adminbar-in { padding: 0 14px; height: 52px; gap: 8px; }
  .admin-clock { display: none; }
  .admin-h1 { font-size: 15.5px; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .adminbar-in .top-right { flex: none; gap: 6px; margin-left: 0; }
  .adminbar-in .top-right .btn-sm { padding: 5px 9px; font-size: 12px; white-space: nowrap; }
  .admin-page { padding: 16px 14px 40px; }
}
@media (max-width: 760px) {
  .console { flex-direction: column; }
  .side { width: 100%; position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .side-group { width: 100%; margin-bottom: 6px; }
  .side a { display: inline-flex; width: auto; }
  .topbar-in { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 8px 10px; }
  .topbar-in .logo { font-size: 16px; }
  .top-right { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .top-right .nowrap { display: none; }
  .top-right .btn-sm { padding: 5px 10px; }
  /* 导航独占一行横向滚动：文字不许折行，隐藏滚动条 */
  .nav {
    order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; gap: 2px; margin-left: 0;
    flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; white-space: nowrap; padding: 6px 10px; font-size: 13.5px; }
  .g2, .g3, .g4, .features { grid-template-columns: 1fr; }
  .span2 { grid-column: span 1; }
  .hero { padding: 20px 0 12px; }
  .hero h1 { font-size: 24px; }
  .hero-eyebrow { margin-bottom: 10px; font-size: 12px; padding: 3px 11px 3px 9px; }
  .hero p.lead { font-size: 14px; margin-bottom: 12px; }
  .hero-stats { margin-top: 15px; }
  .hstat { padding: 0 14px; }
  .hstat b { font-size: 18px; }
  .gen-card .card-head { padding: 11px 14px; }
  .gen-card .kbd-hint { display: none; }
  .shorten .card-body { padding: 15px; }
  .shorten .field { margin-bottom: 12px; }
  .create-foot .btn-lg { width: 100%; }
  .create-foot .muted { width: 100%; }
  .result { padding: 12px; }
  .result-main { padding: 8px 10px; }
  .result-main .short-url { font-size: 14px; }
  .steps { grid-template-columns: 1fr; gap: 11px; margin-top: 18px; }
  .features { margin-top: 22px; gap: 12px; }
  .home-fb { margin-top: 18px; }
  .bar-label { width: 92px; }
  .kv { grid-template-columns: 88px 1fr; }
  .table th { position: static; }
  .card-head { padding: 13px 15px; }
  .card-body { padding: 15px; }
  .card-body.tight { padding: 11px 15px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .btn:active, .feature:hover { transform: none; }
}
