/* 登录 / 注册 / 管理后台：水墨底 + 宣纸卡片 + 朱印。单一深色外观，所有颜色都显式指定 */
:root {
  color-scheme: dark;
  --ink: #12100e;        /* 页面底：墨 */
  --ink-2: #1d1915;
  --paper: #efe6d2;      /* 宣纸 */
  --paper-2: #e2d6bc;
  --text: #2a1d12;       /* 纸上墨字 */
  --muted: #7a6650;
  --seal: #b8261c;       /* 朱印 */
  --gold: #a8821c;
  --ok: #2f6b3a;
  --line: #c9b994;
  --on-ink: #e8dfcc;
  --font-display: "Ma Shan Zheng", "STKaiti", "KaiTi", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: radial-gradient(ellipse at 50% 120%, #2a221a 0%, var(--ink) 60%) fixed, var(--ink);
  color: var(--on-ink); font: 15px/1.6 var(--font-body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 48px;
}
.sheet {
  max-width: 380px; margin: 0 auto; background: var(--paper); color: var(--text);
  padding: 32px 28px 24px; border-radius: 2px;
  box-shadow: 0 0 0 1px var(--line) inset, 0 20px 60px rgba(0, 0, 0, 0.5);
}
.sheet.wide { max-width: 980px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 4px; }
.brand h1 { font: 44px/1.1 var(--font-display); margin: 0; letter-spacing: 2px; text-wrap: balance; }
.seal {
  font: 20px/1 var(--font-display); color: var(--paper); background: var(--seal);
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 3px; transform: rotate(-4deg);
}
.lede { text-align: center; color: var(--muted); margin: 0 0 24px; font-size: 14px; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); letter-spacing: 0.5px; }
input, select {
  font: 16px var(--font-body); color: var(--text); background: #f8f2e4;
  border: 1px solid var(--line); border-radius: 2px; padding: 9px 10px; width: 100%;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }
button {
  font: 700 16px var(--font-body); color: var(--paper); background: var(--text);
  border: 0; border-radius: 2px; padding: 10px 14px; cursor: pointer; letter-spacing: 4px;
}
button:hover { background: #3d2b1c; }
button:disabled { opacity: 0.5; cursor: default; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); letter-spacing: 0; font-weight: 500; font-size: 13px; padding: 4px 10px; }
button.ghost:hover { background: var(--paper-2); }
button.danger { color: var(--seal); border-color: #d9a49c; }
.err { color: var(--seal); margin: 0; font-size: 14px; }
.okmsg { color: var(--ok); margin: 0; font-size: 14px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin: 20px 0 0; }
.foot a, .sheet a { color: var(--seal); }

/* 管理后台 */
.bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 24px; }
.bar h1 { font: 34px/1.1 var(--font-display); margin: 0; }
.bar nav { display: flex; gap: 16px; font-size: 14px; }
section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 24px; }
section h2 { font: 24px/1.2 var(--font-display); margin: 0 0 12px; font-weight: normal; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.row label { flex: 1 1 140px; min-width: 0; }
.row button { flex: 0 0 auto; }
.newlink { display: flex; gap: 8px; align-items: center; margin-top: 12px; background: #f8f2e4; border: 1px dashed var(--gold); padding: 8px 10px; }
.newlink code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: 1px; border-bottom: 1px solid var(--line); padding: 6px 8px; white-space: nowrap; }
td { border-bottom: 1px solid var(--paper-2); padding: 8px; vertical-align: middle; }
td.actions { white-space: nowrap; display: flex; gap: 6px; }
.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; border: 1px solid currentColor; white-space: nowrap; }
.pill.on { color: var(--ok); }
.pill.off { color: var(--muted); }
.pill.bad { color: var(--seal); }
.pill.admin { color: var(--gold); }
.empty { color: var(--muted); font-size: 14px; padding: 12px 8px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
