/* 寝签 · 界面样式
   设计基调：冷白 + 蓝色主色，弱化"后台感"，突出状态与操作。 */

:root {
  color-scheme: light dark;

  --bg: #e9eef5;
  --bg-elev: #f4f7fb;
  --card: #ffffff;
  --ink: #14171a;
  --ink-2: #3d454d;
  --muted: #626b78;
  --faint: #8e97a4;
  --line: #e4e8ee;
  --line-strong: #d3dae3;

  --pri: #2563eb;
  --pri-hover: #1d4ed8;
  --pri-soft: #e9f0fe;
  --pri-ring: rgba(37, 99, 235, .18);

  --warn: #9a5b09;
  --warn-soft: #fcf3e2;
  --danger: #b22a1e;
  --danger-soft: #fceceb;

  --shadow-sm: 0 1px 2px rgba(20, 23, 26, .05);
  --shadow-md: 0 1px 2px rgba(20, 23, 26, .04), 0 14px 30px -18px rgba(20, 23, 26, .30);

  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  /* 系统字体，零下载：楷体给页首页尾，宋体给正文 */
  --font-kai: "Kaiti SC", "STKaiti", KaiTi, "楷体", "KaiTi_GB2312", serif;
  --font-song: "Songti SC", "STSong", SimSun, "宋体", "Noto Serif CJK SC", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f16;
    --bg-elev: #10151d;
    --card: #151b25;
    --ink: #e9edf5;
    --ink-2: #c2cad6;
    --muted: #8b95a3;
    --faint: #6b7686;
    --line: #232a36;
    --line-strong: #303848;

    --pri: #6ea8fe;
    --pri-hover: #93c0ff;
    --pri-soft: #15243d;
    --pri-ring: rgba(110, 168, 254, .25);

    --warn: #e3b45c;
    --warn-soft: #2a2314;
    --danger: #ff8f84;
    --danger-soft: #2b1715;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, .45), 0 18px 40px -22px rgba(0, 0, 0, .9);
  }
}

* { box-sizing: border-box; }

html { overflow-x: clip; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;   /* 移动端地址栏收起/展开时，页脚始终贴底 */
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-size:17px;
  line-height: 1.66;
  font-family: var(--font-song);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--pri); text-decoration: none; }
a:hover { color: var(--pri-hover); }

:focus-visible {
  outline: 2px solid var(--pri);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------- 顶栏 ---------------- */

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  /* 页顶时完全透明，和背景融为一体；滚下去才浮起来 */
  background: transparent;
  box-shadow: none;
  transition: background .25s ease, box-shadow .25s ease;
}

.top.scrolled {
  background: var(--card);
  border-bottom: 0.5px solid var(--line);
  box-shadow: none;
}

.top-in {
  max-width: 1040px;
  margin: 0 auto;
  padding: 11px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
}
.brand:hover { color: var(--ink); }

.mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--pri-soft);
  color: var(--pri);
  border: 0.5px solid color-mix(in srgb, var(--pri) 22%, transparent);
  flex: none;
}
.mark svg { display: block; }
@media (prefers-color-scheme: dark) {
  .mark {
    background: color-mix(in srgb, var(--pri) 14%, transparent);
    color: #9cc4ff;
    border-color: color-mix(in srgb, var(--pri) 30%, transparent);
  }
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size:17px; font-weight: 600; letter-spacing: .2px; }
.brand-text i {
  font-style: normal;
  font-size:12.5px;
  color: var(--muted);
  letter-spacing: .1px;
}

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.nav a,
.nav button {
  font: inherit;
  font-size:14.5px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 7px 12px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
}
/* 导航项不做白色药丸：在毛玻璃上会像挖了个洞。
   悬停和当前页都用极淡的墨色底，靠字重和字色区分。 */
/* 导航不用灰底：hover 和选中都只改文字颜色 */
.nav a:hover,
.nav button:hover {
  background: none;
  color: var(--ink);
}
.nav a.on {
  background: none;
  color: var(--ink);
  font-weight: 600;
}

.nav .who {
  font-size:14px;
  color: var(--muted);
  padding: 0 8px 0 4px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- 容器 ---------------- */

/* 底色光场：一层很淡的斜向色温差，不用圆形光斑（那是最容易显“AI 模板”的做法） */
.wash {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* 直接用 rgba：color-mix 和 transparent 混合会按预乘算，
     颜色会被透明那侧的黑色压暗，出来的是一团灰而不是蓝 */
  background:
    radial-gradient(120% 80% at 8% -10%, rgba(96, 125, 175, .20), transparent 58%),
    radial-gradient(100% 70% at 96% 4%, rgba(129, 116, 175, .16), transparent 62%),
    radial-gradient(90% 60% at 50% 108%, rgba(110, 150, 180, .14), transparent 65%);
}

/* 点阵网格：毛玻璃靠它才能“看得出来”。
   边缘用 mask 淡出，避免像一块规整的桌布。 */
.grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 14%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 78% 62% at 50% 42%, #000 38%, transparent 100%);
  mask-image: radial-gradient(ellipse 78% 62% at 50% 42%, #000 38%, transparent 100%);
  opacity: .5;
}
@media (prefers-color-scheme: dark) {
  .grid {
    background-image: radial-gradient(color-mix(in srgb, #fff 16%, transparent) 1px, transparent 1px);
    opacity: .4;
  }
}

/* 纸感颗粒：叠在最上面，让大面积留白不显得塑料 */
.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { .grain { opacity: .045 } }

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 30px 24px 76px;
  flex: 1 0 auto;
}


/* 后台通用区块：面板与管理页共用一套 */
.sect { padding: 15px 18px; margin-bottom: 11px; }
.sect-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 11px; flex-wrap: wrap; }
.sect-h h2 { font-size:16px; letter-spacing: -.2px; }
.sect-h .hint { margin-left: auto; font-size:13px; color: var(--muted); }

/* 移动端还原字号：窄屏上 17px 太重，回到原来那一档 */
@media (max-width: 899px) {
  body { font-size: 15.5px; }
  .brand-text b { font-size: 15.5px; }
  .brand-text i { font-size: 11.5px; }
  .nav button { font-size: 13.5px; }
  .nav .who { font-size: 13px; }
  .sect-h h2 { font-size: 15px; }
  .sect-h .hint { font-size: 12px; }
  h1 { font-size: 30px; }
  h2 { font-size: 15.5px; }
  h3 { font-size: 14px; }
  .small { font-size: 13px; }
  .mono { font-size: 12.5px; }
  .btn { font-size: 14px; }
  .btn-sm { font-size: 12.5px; }
  label { font-size: 13px; }
  select { font-size: 12.5px; }
  .switch { font-size: 13.5px; }
  .flash { font-size: 13.5px; }
  .note { font-size: 12.5px; }
  .tip { font-size: 12.5px; }
  .seg button { font-size: 13px; }
  table { font-size: 13.5px; }
  th { font-size: 11px; }
  .tag { font-size: 11.5px; }
  .users-tbl .ops .btn { font-size: 12.5px; }
  .st { font-size: 12.5px; }
  .users-tbl select { font-size: 12.5px; }
  .chip-lite { font-size: 12px; }
  .op { font-size: 12.5px; }
  .ch-row .mono { font-size: 11.5px; }
  .chip { font-size: 11px; }
  .kicker { font-size: 11.5px; }
  .foldlist .list-h { font-size: 10.5px; }
  .foldlist .fh { font-size: 13.5px; }
  .foldlist .lazy-body table { font-size: 13px; }
  .doc h1 { font-size: 24px; }
  .doc .meta { font-size: 12.5px; }
  .doc h2 { font-size: 13.5px; }
  .doc p, .doc li { font-size: 13.5px; }
  .doc .warnbox { font-size: 12.5px; }
  .modal-box h3 { font-size: 15.5px; }
  .modal-box p, .modal-box li { font-size: 13.5px; }
  .linkbtn { font-size: 12.5px; }
  .toast { font-size: 13px; }
}

@media (max-width: 640px) {
  .sect { padding: 16px; }
  .sect-h { margin-bottom: 13px; }
  .sect-h h2 { font-size:14.5px; }
}

/* 宋体字面比黑体窄，负字距会挤在一起，改成归零 */
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: 0; }
h1 { font-size:38px; line-height: 1.26; }
h2 { font-size:17px; }
h3 { font-size:15px; }

.muted { color: var(--muted); }
.small { font-size:14px; }
.mono { font-family: var(--mono); font-size:13.5px; font-variant-numeric: tabular-nums; }

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size:15px;
  font-weight: 500;
  padding: 10px 18px;
  min-height: 40px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .06s;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(.5px); }

.btn-pri {
  background: var(--pri);
  color: #fff;
  box-shadow: none;
  transition: background .15s, box-shadow .18s, transform .1s;
}
.btn-pri:hover:not(:disabled) {
  background-color: var(--pri-hover);
  box-shadow: 0 2px 10px -2px rgba(37, 99, 235, .45);
  transform: translateY(-1px);
}
.btn-pri:active:not(:disabled) { transform: translateY(0); box-shadow: 0 1px 2px rgba(37, 99, 235, .3); }
@media (prefers-color-scheme: dark) {
  .btn-pri { color: #04214f; }
}

.btn-ghost {
  /* 描边款：不铺白底，压在浅色卡片上才不像贴纸 */
  background: transparent;
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 14%, transparent);
}
.btn-ghost:hover:not(:disabled) {
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  border-color: color-mix(in srgb, var(--ink) 24%, transparent);
}

.btn:disabled {
  /* 禁用态不要白底白边，那样像一张贴纸；用一层很淡的墨色压下去就行 */
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--faint);
  border-color: transparent;
  box-shadow: none;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-sm { min-height: 30px; padding: 4px 11px; font-size:13.5px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }

/* ---------------- 表单 ---------------- */

.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }

.field { margin-bottom: 12px; }
label { display: block; font-size:14px; font-weight: 500; color: var(--ink-2); margin-bottom: 5px; }

input[type=text],
input[type=password],
input[type=time],
select {
  font: inherit;
  font-size:15px;
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 10px 12px;
  min-height: 42px;
  width: 100%;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder { color: var(--faint); }
input[type=text]:focus,
input[type=password]:focus,
input[type=time]:focus,
select:focus {
  outline: none;
  background: var(--card);
  border-color: var(--pri);
  box-shadow: 0 0 0 3px var(--pri-ring);
}
select { min-height: 34px; padding: 4px 8px; font-size:13.5px; width: auto; }

/* 带图标的输入框 */
.ifield { position: relative; display: block; }
.ifield > svg.ico {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--faint);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: stroke .16s;
}
.ifield input { padding-left: 40px; min-height: 46px; }
.ifield:focus-within > svg.ico { stroke: var(--pri); }
.ifield.has-eye input { padding-right: 46px; }

.eye {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--faint);
  padding: 0;
  transition: background .15s, color .15s;
}
.eye:hover { background: var(--bg); color: var(--ink-2); }
.eye svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.eye .off { display: none; }
.eye.on .off { display: block; }
.eye.on .on { display: none; }

/* 验证码：输入框与图片拼成一个整体 */
.capfield {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.capfield:focus-within {
  border-color: var(--pri);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--pri-ring);
}
.capfield input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  letter-spacing: 5px;
  text-align: center;
  font-weight: 500;
}
.capfield input:focus { box-shadow: none; background: transparent; }
.capfield img {
  flex: 0 0 auto;
  width: 132px;
  height: auto;
  border-left: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  display: block;
}
.capfield img:hover { opacity: .86; }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size:14.5px;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
  cursor: pointer;
}
.switch input { width: 17px; height: 17px; accent-color: var(--pri); cursor: pointer; }

/* ---------------- 提示 ---------------- */

/* 站点通知：和 ui.css 保持同一套 alert 语言（左 4px 色条 + 浅底 + 图标 + 小号粗体） */
.flash {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 12px;
  border: 1px solid transparent;
  border-left: 4px solid transparent;
  transition: background-color .3s ease, transform .3s ease;
}
.flash:hover { transform: scale(1.008); }
.flash svg { width: 18px; height: 18px; flex: none; }
.flash.ok { background: #E7F8EE; border-left-color: #22C55E; color: #14532D; }
.flash.ok svg { color: #16A34A; }
.flash.err { background: #FDEDED; border-left-color: #EF4444; color: #7F1D1D; }
.flash.err svg { color: #DC2626; }
.flash b { font-weight: 600; }

/* 提示块：中性底 + 一道细的琥珀色左边，不用整片黄底 */
.note {
  padding: 11px 13px;
  border-radius: var(--r-sm);
  font-size:13.5px;
  line-height: 1.7;
  background: color-mix(in srgb, var(--ink) 3.5%, transparent);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-left: 2px solid color-mix(in srgb, var(--warn) 55%, transparent);
}
.note b { color: var(--ink); font-weight: 600; }
/* 未绑联系方式这类「必须处理」的提示，用红边 */
.note-danger { border-left-color: color-mix(in srgb, var(--danger) 70%, transparent); }
.note-danger b { color: var(--danger); }

.tip { margin-top: 12px; font-size:13.5px; color: var(--muted); line-height: 1.75; }
.tip b { color: var(--ink); font-weight: 600; }


/* ---------------- 分段控件 ---------------- */

.seg {
  display: flex;
  gap: 3px;
  padding: 4px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 18px;
}
.seg button {
  flex: 1;
  font: inherit;
  font-size:14px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-radius: var(--r-sm);
  padding: 8px 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: none; color: var(--ink); }
.seg { position: relative; isolation: isolate; }
.seg .slider {
  position: absolute;
  z-index: -1;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: var(--card);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
  transition: transform .24s cubic-bezier(.4, 0, .2, 1);
}
.seg[data-active="2"] .slider { transform: translateX(100%); }
.seg > button { position: relative; }

/* ---------------- 表格 ---------------- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table { width: 100%; border-collapse: collapse; font-size:14.5px; }
th {
  text-align: left;
  font-size:12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--ink-2);
  word-break: break-word;
}
tbody tr:hover td { background: var(--bg-elev); }
tbody tr:last-child td { border-bottom: none; }
td .mono { color: var(--ink); }
/* 时间、学号、IP 这类短字段别换行，否则表格一挤就断成两行 */
td.mono { white-space: nowrap; }
/* IP 后面的归属地：等宽字体里的一小段灰字 */
.geo { font-family: inherit; font-size:12.5px; font-weight: 400; color: var(--muted);
       white-space: nowrap; margin-left: 2px; }

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size:12.5px;
  font-weight: 500;
  line-height: 1.7;
  white-space: nowrap;
}
.tag.ok { background: var(--pri-soft); color: var(--pri); }
.tag.err { background: var(--danger-soft); color: var(--danger); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.mut { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }

/* 管理页：每行两个通知渠道，点一下切换 */
.users-tbl { min-width: 940px; }
.users-tbl .ops .btn { padding: 0 9px; height: 30px; font-size:13.5px; }

/* 用户表扁平化：状态用颜色区分，不再套一堆小框 */
.foldlist .note {
  background: none;
  border-radius: 0;
  border-top: 0; border-right: 0; border-bottom: 0;
  border-left-width: 2px;
  padding: 1px 0 1px 11px;
}

/* 状态文字：靠颜色区分，不套框。管理页和面板通用 */
.st { font-size:13.5px; font-weight: 500; white-space: nowrap; }
.st.on { color: var(--pri); }
.st.off { color: var(--faint); }
.st.bad { color: var(--danger); }

.users-tbl select {
  border: 0; background: transparent; padding: 2px 0;
  font: inherit; font-size:13.5px; color: var(--ink);
  cursor: pointer; max-width: 110px;
}
.users-tbl select:hover { color: var(--pri); }

.chip-lite {
  border: 0; background: none; padding: 0;
  font: inherit; font-size:13px; line-height: 1.6;
  color: var(--faint); cursor: pointer; white-space: nowrap;
}
.chip-lite.on { color: var(--pri); }
.chip-lite.miss { color: var(--danger); }
.chip-lite:hover { text-decoration: underline; }

.op {
  border: 0; background: none; padding: 0;
  font: inherit; font-size:13.5px; color: var(--pri); cursor: pointer;
}
.op.mut { color: var(--faint); }
.op:hover { text-decoration: underline; }
.op:disabled { opacity: .45; cursor: default; text-decoration: none; }
.users-tbl td, .users-tbl th { white-space: nowrap; }
.users-tbl td[data-label="通知"] { white-space: normal; }
/* 手机端表格是堆叠卡片，不能带最小宽度和 nowrap */
@media (max-width: 640px) {
  .users-tbl { min-width: 0; }
  .users-tbl td, .users-tbl th { white-space: normal; }
}

.ch-list { display: flex; flex-direction: column; gap: 5px; }
/* 管理页用户表：通知列并排，省一半行高 */
.ch-list.inline { flex-direction: row; align-items: center; gap: 12px; }
.ch-list.inline .ch-row .mono {
  max-width: 98px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ch-row { display: flex; align-items: center; gap: 7px; margin: 0; }
.ch-row .mono { font-size:12.5px; color: var(--muted); word-break: break-all; }
.chip {
  flex: 0 0 auto;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size:12px;
  line-height: 1.8;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--pri); color: var(--pri); }
.chip.on { background: var(--pri-soft); border-color: transparent; color: var(--pri); font-weight: 500; }
.chip.off { background: var(--bg); color: var(--faint); }
/* 完全没绑的渠道：淡琥珀底，一眼能挑出来 */
.chip.miss {
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 22%, transparent);
}

/* ---------------- 页脚 ---------------- */

.foot {
  margin-top: 56px;
}

@media (prefers-color-scheme: dark) {
  .top.scrolled {
    background: color-mix(in srgb, #0b0f16 70%, transparent);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .05), 0 10px 26px -22px rgba(0, 0, 0, .8);
  }
}

.fb-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12.5px;
}
.fb-nav a {
  position: relative;
  padding: 0 16px;
  color: var(--faint);
  transition: color .16s ease;
}
.fb-nav a:hover { color: var(--ink); }
.fb-nav a.on { color: var(--ink-2); }
/* 链接之间一根极细的竖线，比圆点干净 */
.fb-nav a + a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 11px;
  margin-top: -5.5px;
  background: currentColor;
  opacity: .25;
}

@media (max-width: 640px) {
  .foot { margin-top: 26px; }
  .fb-nav { font-size: 12px; }
  .fb-nav a { padding: 0 13px; }
}

/* 小标题：等宽 + 字距，首页与登录页共用 */
.kicker{display:flex;align-items:center;gap:9px;margin:0;
        font-size:12.5px;letter-spacing:.16em;color:var(--faint);
        font-family:var(--mono);text-transform:uppercase}
.kicker::before{content:"";width:22px;height:1px;background:var(--line-strong)}

/* ---------- 折叠区（面板与管理页共用）---------- */
/* 折叠列表：一张卡里若干行，发丝线分隔，比一排独立卡片干净 */
.foldlist{padding:0;overflow:hidden}
.foldlist .list-h{padding:14px 16px 5px;border-top:1px solid var(--line);
  font-size:11.5px;letter-spacing:.12em;text-transform:uppercase;
  color:var(--faint);font-weight:600}
.foldlist .list-h:first-child{border-top:0;padding-top:15px}
.foldlist details{border-top:1px solid var(--line)}
.foldlist .list-h + details{border-top:0}
.foldlist summary{display:flex;align-items:center;gap:10px;padding:12px 16px;
  cursor:pointer;list-style:none;-webkit-tap-highlight-color:transparent;
  transition:background-color .15s ease}
.foldlist summary::-webkit-details-marker{display:none}
.foldlist summary:hover{background:color-mix(in srgb,var(--pri) 4%,transparent)}
.foldlist .fh{font-size:14.5px;font-weight:500;color:var(--ink);letter-spacing:-.1px}
.foldlist .fh-warn{color:var(--warn);font-weight:600}
.foldlist .fh-meta{margin-left:auto;font-size:13px;color:var(--faint);
  font-variant-numeric:tabular-nums;letter-spacing:.01em}
.foldlist .chev{width:15px;height:15px;flex:none;color:var(--faint);transition:transform .2s ease}
.foldlist details[open] .chev{transform:rotate(180deg)}
.foldlist details[open] summary{padding-bottom:10px}
/* 展开的内容做成一块内嵌面板，和标题行分层 */
.foldlist .lazy-body{
  margin:0 10px 11px;
  padding:13px 14px;
  border-radius:10px;
  background:color-mix(in srgb,var(--ink) 2.5%,transparent);
  border:1px solid color-mix(in srgb,var(--line) 65%,transparent);
}
.foldlist .lazy-body > .table-wrap:first-child,
.foldlist .lazy-body > form:first-child{margin-top:0}
.foldlist .lazy-body .table-wrap{margin:0}
.foldlist .lazy-body table{font-size:14px}
.foldlist .lazy-body th{background:none}
@media(max-width:640px){
  .foldlist summary{padding:11px 13px}
  .foldlist .lazy-body{margin:0 8px 9px;padding:11px 11px}
  .foldlist .list-h{padding:12px 13px 4px}
}

/* 通用骨架条：状态卡、折叠区共用 */
.sk{display:inline-block;border-radius:5px;
  /* 用半透明墨色而不是固定灰：卡片底色是白还是淡蓝都能自然融合 */
  background:linear-gradient(90deg,rgba(20,23,26,.07) 25%,rgba(20,23,26,.02) 37%,rgba(20,23,26,.07) 63%);
  background-size:400% 100%;animation:shimmer 1.3s ease-in-out infinite}
@media(prefers-reduced-motion:reduce){.sk{animation:none}}

/* 折叠区首次展开才拉数据，先占位骨架 */
.skel{display:flex;flex-direction:column;gap:9px;padding:5px 0 2px}
.skel i{display:block;height:13px;border-radius:6px;
  /* 用半透明墨色而不是固定灰：卡片底色是白还是淡蓝都能自然融合 */
  background:linear-gradient(90deg,rgba(20,23,26,.07) 25%,rgba(20,23,26,.02) 37%,rgba(20,23,26,.07) 63%);
  background-size:400% 100%;animation:shimmer 1.3s ease-in-out infinite}
.skel i:nth-child(2){width:88%}
.skel i:nth-child(3){width:71%}
@keyframes shimmer{0%{background-position:100% 0}100%{background-position:0 0}}
@media(prefers-reduced-motion:reduce){.skel i{animation:none}}

/* ---------------- 条款页 ---------------- */

.doc { max-width: 760px; margin: 0 auto; }
.doc .card { padding: 30px 32px; }
.doc h1 { font-size:25px; letter-spacing: -.4px; }
.doc .meta { color: var(--muted); font-size:13.5px; margin: 8px 0 28px; }
.doc section { margin-bottom: 26px; }
.doc section:last-child { margin-bottom: 0; }
.doc h2 { font-size:14.5px; margin-bottom: 9px; }
.doc p, .doc li { font-size:14.5px; color: var(--ink-2); line-height: 1.85; }
.doc p { margin: 0 0 10px; }
.doc ul, .doc ol { margin: 0 0 10px; padding-left: 20px; }
.doc li { margin-bottom: 5px; }
.doc b { color: var(--ink); font-weight: 600; }
.doc .warnbox {
  margin: 0 0 12px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  font-size:13.5px;
  line-height: 1.75;
  background: color-mix(in srgb, var(--ink) 3.5%, transparent);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-left: 2px solid color-mix(in srgb, var(--warn) 55%, transparent);
}
@media (max-width: 640px) {
  .doc .card { padding: 20px 18px; }
  .doc h1 { font-size:21px; }
}


/* 弹层：纯 CSS :target 驱动，不依赖 JS */
.modal { position: fixed; inset: 0; z-index: 120; display: none; place-items: center; padding: 20px; }
.modal:target { display: grid; }
.modal-mask { position: absolute; inset: 0; background: rgba(8, 14, 24, .46); }
.modal-box {
  position: relative;
  max-width: 470px;
  width: 100%;
  max-height: 86vh;
  overflow: auto;
  padding: 22px 24px 20px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 64px -20px rgba(8, 14, 24, .5);
}
.modal-box h3 { font-size:17px; margin: 0 0 10px; letter-spacing: -.2px; }
.modal-box p, .modal-box li { font-size:14.5px; color: var(--ink-2); line-height: 1.8; }
.modal-box p { margin: 0 0 10px; }
.modal-box ol { margin: 8px 0 12px; padding-left: 20px; }
.modal-box li { margin-bottom: 8px; }
.modal-box b { color: var(--ink); font-weight: 600; }
.dlg-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
@media (max-width: 640px) {
  .dlg-acts .btn { flex: 1 1 auto; }
}

.linkbtn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size:13.5px;
  color: var(--pri);
  cursor: pointer;
}
.linkbtn:hover { text-decoration: underline; }
.field-help { margin: -4px 0 14px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------------- 移动端 ---------------- */

@media (max-width: 640px) {
  .wrap { padding: 12px 20px 40px; }
  .top-in { padding: 10px 16px; gap: 8px; }
  .brand-text i { display: none; }
  .nav { gap: 2px; }
  .nav a, .nav button { padding: 6px 9px; font-size:14px; }
  .nav .who { display: none; }
  h1 { font-size:27px; }

  /* 表格改成堆叠卡片：窄列被压成一字宽的问题只能这么根治 */
  .table-wrap { overflow: visible; }
  .table-wrap table,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td { display: block; width: auto; }
  .table-wrap thead { display: none; }
  /* 一行一条记录，字段横向流动、自然换行。
     原来是每个字段一行（5 字段 = 150px 高），现在压到两行左右。 */
  .table-wrap tbody tr {
    display: flex;
    flex-wrap: wrap;
    gap: 1px 14px;
    align-items: baseline;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 11px;
    margin-bottom: 6px;
    background: color-mix(in srgb, var(--card) 55%, transparent);
  }
  .table-wrap tbody tr:hover td { background: transparent; }
  .table-wrap td {
    display: inline-flex;
    gap: 5px;
    align-items: baseline;
    padding: 0;
    border: none;
    font-size:13.5px;
    line-height: 1.6;
    width: auto;
  }
  .table-wrap td::before {
    content: attr(data-label);
    flex: none;
    font-size:11.5px;
    letter-spacing: .02em;
    color: var(--faint);
    line-height: 1.7;
  }
  .table-wrap td:last-child { padding-bottom: 0; }
  .hide-sm { display: none !important; }
}


/* ---------------- 加载反馈 ---------------- */

/* 顶部细进度条：跳页时从左扫一下，替代白屏硬切 */
.pg {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 9999;
  background: var(--pri);
  transform: scaleX(0); transform-origin: 0 50%;
  opacity: 0; pointer-events: none;
  transition: transform .55s cubic-bezier(.1, .72, .3, 1), opacity .2s;
}
.pg.on { opacity: 1; transform: scaleX(.72); }
.pg.done { opacity: 0; transform: scaleX(1); transition: transform .16s ease-out, opacity .28s .08s; }

/* 提交中的按钮：转圈 + 不再响应点击 */
.btn.is-loading { pointer-events: none; opacity: .82; }
.btn.is-loading::before {
  content: ""; width: 13px; height: 13px; margin-right: 7px; flex: 0 0 auto;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .62s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 内容淡入：别一上来就砸在脸上。
   只动位移不动透明度——万一动画被浏览器节流卡住，文字也不会半透明看不清。 */
@keyframes riseIn { from { transform: translateY(6px); } to { transform: none; } }
.wrap { animation: riseIn .32s cubic-bezier(.22,1,.36,1); }

/* 页脚最后浮上来：等正文落位之后再出现，不要和内容抢 */
@keyframes footIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.foot { animation: footIn .55s cubic-bezier(.16,1,.3,1) .3s both; }

/* 验证码出图前先淡一下，避免高度/内容突跳 */
.capfield img { transition: opacity .18s, filter .18s; }
.capfield img.loading { opacity: .22; filter: blur(1.6px); }

@media (prefers-reduced-motion: reduce) {
  .pg, .wrap, .foot { animation: none !important; transition: none !important; }
  .btn.is-loading::before { animation-duration: 1.6s; }
}

/* 底部轻提示：管理页局部刷新后的反馈 */
.toast {
  /* 左上角：登录/验证码这类页没有顶栏，直接从左上进来，和面板页保持一致 */
  position: fixed; left: 20px; top: 20px; z-index: 9998;
  transform: translateX(-10px); opacity: 0;
  max-width: min(90vw, 420px); padding: 9px 16px;
  border-radius: 10px; font-size:14px; text-align: left;
  background: var(--ink); color: var(--bg);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.on { opacity: 1; transform: translateX(0); }
.toast.err { background: var(--danger); color: #fff; }

/* ================= 设置区：扁平卡片 · 实体拨杆 · 渠道三态 ================= */

.card {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
@media (prefers-color-scheme: dark) {
  .card { background: var(--card); border-color: var(--line); box-shadow: none; }
}

/* 设置行：左标签，右控件 */
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; }
.row + .row { border-top: 0.5px solid color-mix(in srgb, var(--ink) 8%, transparent); }
.row:first-child { padding-top: 2px; }
.row:last-child { padding-bottom: 2px; }
.row-t { font-size: 14px; color: var(--ink); }
.row-d { font-size: 12.5px; color: var(--faint); margin-top: 3px; }
.row-ctl { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }

/* 实体拨杆 */
.sw { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; }
.sw input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.sw i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong);
        transition: background .18s ease; cursor: pointer; }
.sw i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
               border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .22);
               transition: transform .18s cubic-bezier(.4, 0, .2, 1); }
.sw input:checked + i { background: var(--pri); }
.sw input:checked + i::after { transform: translateX(20px); }
.sw input:focus-visible + i { box-shadow: 0 0 0 3px var(--pri-ring); }
.sw input:disabled + i { opacity: .45; cursor: not-allowed; }
.sw.sm, .sw.sm i::after { width: 38px; height: 22px; }
.sw.sm i::after { width: 18px; height: 18px; }
.sw.sm input:checked + i::after { transform: translateX(16px); }

/* 两态胶囊 */
.tab { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px;
       background: var(--bg-elev); border: 0.5px solid var(--line); }
.tab button { height: 26px; padding: 0 12px; border: 0; border-radius: 999px; background: none;
              font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer;
              transition: background .15s, color .15s; }
.tab button:hover { color: var(--ink); }
.tab button.on { background: var(--card); color: var(--ink); font-weight: 500;
                 box-shadow: 0 1px 2px rgba(0, 0, 0, .07); }

/* 输入与按钮 */
.inp { height: 34px; padding: 0 11px; border-radius: var(--r-sm);
       border: 0.5px solid var(--line-strong); background: var(--card); color: var(--ink);
       font: inherit; font-size: 13px; width: 100%; box-sizing: border-box; }
.inp::placeholder { color: var(--faint); }
.inp:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-ring); }
.bp { height: 34px; padding: 0 14px; border-radius: var(--r-sm); border: 0; background: var(--pri);
      color: #fff; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
      white-space: nowrap; transition: background .15s; }
.bp:hover { background: var(--pri-hover); }
.bp:disabled { opacity: .5; cursor: default; }
.bg { height: 34px; padding: 0 14px; border-radius: var(--r-sm); background: var(--card);
      border: 0.5px solid var(--line-strong); color: var(--ink-2);
      font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
      transition: border-color .15s, color .15s; }
.bg:hover { border-color: var(--pri); color: var(--pri); }

/* 渠道卡：三态 */
.chgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .chgrid { grid-template-columns: 1fr; } }
.ch { background: var(--card); border: 0.5px solid var(--line); border-radius: var(--r-md);
      padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 92px; }
.ch-h { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--faint); }
.ch-ok { margin-left: auto; color: var(--pri); font-size: 11.5px; font-weight: 500; }
.ch-err { color: var(--danger); font-size: 11.5px; line-height: 1.5; }
.ch-line { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.ch-val { font-size: 12.5px; color: var(--muted); flex: 1; min-width: 0;
          overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-form { display: flex; gap: 6px; }
.ch-form .inp { height: 32px; font-size: 12.5px; }
.ch-form .bp { height: 32px; padding: 0 12px; font-size: 12.5px; }
.ch [data-when] { display: none; }
.ch[data-state="empty"] [data-when~="empty"],
.ch[data-state="join"]  [data-when~="join"],
.ch[data-state="on"]    [data-when~="on"] { display: flex; }

/* 渠道卡第四态：start 只有「去加群」，fill 才出输入框 */
.ch [data-when] { display: none; }
.ch[data-state="start"] [data-when~="start"],
.ch[data-state="fill"]  [data-when~="fill"],
.ch[data-state="join"]  [data-when~="join"],
.ch[data-state="on"]    [data-when~="on"],
.ch[data-state="empty"] [data-when~="empty"] { display: flex; }
.ch[data-when][style*="column"] { flex-direction: column; }
