/* 后台样式 · 克制的工具界面 */
:root {
  --ink: #101014;
  --ink-2: #3a3a44;
  --mute: #77777f;
  --line: #e6e6ea;
  --line-2: #f1f1f3;
  --soft: #f7f7f8;
  --bg: #fff;
  --ok: #0f9468;
  --danger: #c8405f;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--soft); color: var(--ink);
  font-family: var(--sans); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid #19d3c5; outline-offset: 2px; }

/* 侧栏 */
.aside {
  position: fixed; inset: 0 auto 0 0; width: 216px; z-index: 10;
  display: flex; flex-direction: column;
  background: #fff; border-right: 1px solid var(--line); padding: 22px 14px 14px;
}
.abrand { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; padding: 0 8px; }
.abrand span {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  background: var(--ink); color: #fff; font-size: 11px; letter-spacing: 0.02em;
}
.anav { margin-top: 26px; display: flex; flex-direction: column; gap: 2px; }
.anav-k {
  margin: 16px 0 6px; padding-left: 9px; font-size: 10.5px; letter-spacing: 0.12em;
  color: #a8a8b0; text-transform: uppercase;
}
.anav-a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 9px; border-radius: 7px; font-size: 13.5px; color: var(--ink-2);
  transition: background 0.18s, color 0.18s;
}
.anav-a:hover { background: var(--soft); color: var(--ink); }
.anav-a.on { background: var(--ink); color: #fff; }
.anav-a b {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: #e5456a; color: #fff; font-size: 11px; font-weight: 500;
  display: grid; place-items: center;
}
.aside-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 9px 4px; border-top: 1px solid var(--line); }
.aside-foot a, .aside-foot button { font-size: 12.5px; color: var(--mute); padding: 0; background: none; border: 0; text-align: left; cursor: pointer; }
.aside-foot a:hover, .aside-foot button:hover { color: var(--ink); }

/* 主区 */
.amain { margin-left: 216px; padding: 34px clamp(20px, 3vw, 48px) 80px; max-width: 1180px; }
.ahead { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.ahead h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.ahead p { margin-top: 6px; font-size: 12.5px; color: var(--mute); }
.ahead p code { font-family: var(--mono); font-size: 11.5px; background: #fff; border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; }
.ahead-actions { display: flex; gap: 8px; }

/* 按钮 */
.abtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 15px; border-radius: 7px; border: 1px solid var(--line); background: #fff;
  font-size: 13px; font-weight: 500; cursor: pointer; transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.abtn:hover { border-color: #cfcfd6; background: #fcfcfd; }
.abtn--primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.abtn--primary:hover { background: #26262c; border-color: #26262c; }
.abtn--danger { color: var(--danger); border-color: #edd3da; background: #fff; }
.abtn--danger:hover { background: #fff7f9; border-color: #dfa9b8; }
.abtn--wide { width: 100%; padding: 12px; }
.alink { font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--line); padding-bottom: 1px; }
.alink:hover { border-color: var(--ink); }

/* 统计卡 */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat-card {
  display: block; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(16, 16, 20, 0.06); }
.stat-card span { font-size: 11.5px; color: var(--mute); }
.stat-card b { display: block; margin-top: 6px; font-size: 28px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.stat-card em { display: block; margin-top: 4px; font-size: 11.5px; color: #a0a0a8; }

/* 面板 / 表格 */
.apanel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 18px; }
.apanel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.apanel-head h2 { font-size: 15px; font-weight: 600; }
.apanel-head a { font-size: 12.5px; color: var(--mute); }
.apanel-head a:hover { color: var(--ink); }
.atable { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.apanel .atable { border: 0; }
.atable th {
  padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 500; letter-spacing: 0.06em;
  color: #9a9aa3; text-transform: uppercase; background: #fbfbfc; border-bottom: 1px solid var(--line);
}
.atable td { padding: 12px; font-size: 13px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.atable tr:last-child td { border-bottom: 0; }
.atable tr.is-new td { background: #fffdf6; }
.atable b { font-weight: 600; }
.asub { display: block; margin-top: 2px; font-family: var(--mono); font-size: 11px; color: #a0a0a8; font-style: normal; }
.clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.off { color: #a0a0a8; font-size: 12px; }
.tag-new { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #fff1d6; color: #a9751a; font-size: 11px; }
.aempty { padding: 22px 0; font-size: 13px; color: var(--mute); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; background: var(--line-2); color: var(--mute); }
.pill--online { background: #eefbf5; color: var(--ok); }
.pill--beta { background: #fff7e8; color: #b47a12; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; }

/* 表单 */
.aform {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 22px; margin-bottom: 16px; display: grid; gap: 14px;
}
.aform h2 { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.aform h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.aform--inline { padding: 16px 18px; }
.aform--new { border-style: dashed; background: #fcfcfd; }
.arow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.arow--3 { grid-template-columns: 1fr 1fr 110px; }
.arow--check { display: flex; gap: 24px; }
.afield { display: block; }
.afield > span { display: block; margin-bottom: 6px; font-size: 11.5px; color: var(--mute); }
.afield input, .afield textarea, .afield select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px;
  background: #fcfcfd; font-size: 13.5px; transition: border-color 0.18s, background 0.18s;
}
.afield textarea { resize: vertical; line-height: 1.65; }
.afield input:focus, .afield textarea:focus, .afield select:focus { outline: none; border-color: var(--ink); background: #fff; }
.afield--narrow { max-width: 120px; }
.afield .mono, textarea.mono { font-family: var(--mono); font-size: 12.5px; line-height: 1.7; }
.acheck { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.aform-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 6px; flex-wrap: wrap; }
.aform-btns { display: flex; gap: 8px; }
.flash {
  margin-bottom: 16px; padding: 11px 15px; border-radius: 8px; background: #eefbf5;
  color: #0f7a58; font-size: 13px; border: 1px solid #d3f0e3;
}
.kv { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.kv span { flex: 0 0 90px; color: var(--mute); }
.kv b { font-weight: 500; }
.kv--block { display: block; }
.kv--block p { margin-top: 8px; padding: 14px; background: var(--soft); border-radius: 8px; line-height: 1.8; white-space: pre-wrap; }

/* 登录 */
.login-body { display: grid; place-items: center; min-height: 100vh; background: #fafaf8; }
.login { width: min(380px, calc(100vw - 40px)); background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 30px; box-shadow: 0 24px 60px rgba(16,16,20,.08); display: grid; gap: 14px; }
.login .abrand { padding: 0; }
.login h1 { margin-top: 14px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.login-note { font-size: 12.5px; color: var(--mute); line-height: 1.7; }
.login-err { font-size: 12.5px; color: var(--danger); }
.login-back { text-align: center; font-size: 12px; color: var(--mute); }
.login .abtn { margin-top: 4px; }

@media (max-width: 860px) {
  .aside { position: static; width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .anav { flex-direction: row; flex-wrap: wrap; margin: 0; gap: 4px; width: 100%; }
  .anav-k { display: none; }
  .anav-a { padding: 6px 10px; font-size: 12.5px; }
  .anav-a.on { background: var(--soft); color: var(--ink); }
  .aside-foot { margin: 0; border: 0; flex-direction: row; padding: 0; }
  .amain { margin-left: 0; padding: 20px 16px 60px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .arow { grid-template-columns: 1fr; }
  .atable { display: block; overflow-x: auto; white-space: nowrap; }
}
