/* 门户样式。自托管，不引任何 CDN —— CSP 的 script-src/style-src 只允许 'self'。 */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --line: #e4e2dd;
  --ink: #1f1d1a;
  --ink-soft: #6b665e;
  --ink-faint: #9a948a;
  --accent: #1c5d4a;
  --accent-soft: #e8f1ee;
  --high: #a8321f;
  --high-bg: #fbeae6;
  --medium: #97650f;
  --medium-bg: #fdf3e0;
  --low: #5b6b7c;
  --low-bg: #eef1f4;
  --ok: #1c5d4a;
  --ok-bg: #e8f1ee;
  --radius: 6px;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17181a; --surface: #1f2123; --line: #32353a;
    --ink: #e9e7e3; --ink-soft: #a7a29a; --ink-faint: #767169;
    --accent: #6fb8a0; --accent-soft: #1d2b28;
    --high: #e98a76; --high-bg: #33211d;
    --medium: #d9a94e; --medium-bg: #322819;
    --low: #9fb0c0; --low-bg: #22262b;
    --ok: #6fb8a0; --ok-bg: #1d2b28;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 16px; background: var(--surface);
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.brand {
  font-weight: 650; color: var(--ink); display: inline-flex;
  align-items: center; gap: 8px; letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.mark {
  width: 14px; height: 14px; border-radius: 3px;
  background: var(--accent); display: inline-block;
}
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .linkish {
  padding: 5px 10px; border-radius: var(--radius); color: var(--ink-soft);
  font-size: 14px;
}
.nav a:hover, .linkish:hover { background: var(--accent-soft); text-decoration: none; }
.nav a.on { color: var(--ink); background: var(--accent-soft); font-weight: 550; }
.linkish {
  background: none; border: 0; cursor: pointer; font: inherit; font-size: 14px;
  color: var(--ink-faint);
}
.inline { display: inline; }

/* ---------------------------------------------------------------- 布局 */
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; }
.wrap.narrow { max-width: 620px; }
.wrap.wide { max-width: 1400px; }

h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -0.015em; }
h2 { font-size: 18px; margin: 28px 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 15px; margin: 18px 0 6px; }
.sub { color: var(--ink-soft); margin: 0 0 20px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
}
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid.c4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ---------------------------------------------------------------- 统计块 */
.stat { background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--radius); padding: 14px 16px; }
.stat .n { font-size: 28px; font-weight: 600; line-height: 1.2;
           font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .k { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

/* ---------------------------------------------------------------- 表格 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line);
         vertical-align: top; }
th { color: var(--ink-soft); font-weight: 550; font-size: 13px;
     white-space: nowrap; }
tbody tr:hover { background: var(--accent-soft); }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.domain { font-family: var(--mono); word-break: break-all; }

/* ---------------------------------------------------------------- 徽标 */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 12px; font-weight: 550; white-space: nowrap;
}
.tag.high { background: var(--high-bg); color: var(--high); }
.tag.medium { background: var(--medium-bg); color: var(--medium); }
.tag.low { background: var(--low-bg); color: var(--low); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.flat { background: var(--low-bg); color: var(--ink-soft); }

/* ---------------------------------------------------------------- 表单 */
label { display: block; font-size: 13px; color: var(--ink-soft);
        margin: 14px 0 4px; font-weight: 550; }
label .hint { font-weight: 400; color: var(--ink-faint); }
/* 不按 type 列举：没写 type 的 <input>（比如 TOTP 验证码框）也要吃到同一套样式，
   否则它会退回浏览器默认的又小又方的样子。
   用 :where() 包住排除项：它的特异性是 0，否则六个 :not([type=…]) 叠出 (0,6,0)，
   会压过 .pw-wrap input 的 padding-right，口令文字钻到眼睛按钮底下。 */
input:where(:not([type=checkbox], [type=radio], [type=file], [type=hidden], [type=submit], [type=button])),
select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--bg); color: var(--ink);
  font: inherit; font-size: 14px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent);
}
textarea { min-height: 88px; resize: vertical; font-family: var(--mono); font-size: 13px; }
.checkline { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.checkline input { width: auto; }
.checkline label { margin: 0; color: var(--ink); font-weight: 400; }

.btn {
  display: inline-block; padding: 9px 16px; border-radius: var(--radius);
  background: var(--accent); color: #fff; border: 0; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 550;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--high); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
           margin-top: 18px; }

/* ---------------------------------------------------------------- 提示条 */
.alert { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 16px;
         font-size: 14px; border: 1px solid transparent; }
.alert.error { background: var(--high-bg); color: var(--high);
               border-color: color-mix(in srgb, var(--high) 25%, transparent); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.warn { background: var(--medium-bg); color: var(--medium); }

/* ---------------------------------------------------------------- 筛选条 */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end;
           margin-bottom: 14px; }
.filters label { margin: 0 0 3px; }
.filters .f { min-width: 130px; }
.filters .f.grow { flex: 1; min-width: 180px; }

/* ---------------------------------------------------------------- 时间线 */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 0 0 14px 18px; border-left: 2px solid var(--line);
               position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -5px; top: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent);
}
.timeline .when { color: var(--ink-faint); font-size: 12px;
                  font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 键值表 */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px;
      font-size: 14px; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; word-break: break-word; }

/* ---------------------------------------------------------------- 落地页 */
.hero { padding: 40px 0 28px; }
.hero h1 { font-size: 32px; max-width: 18em; line-height: 1.25; }
.hero p.lede { font-size: 17px; color: var(--ink-soft); max-width: 36em; }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; padding-left: 38px; position: relative;
            margin-bottom: 14px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); font-size: 13px; font-weight: 600;
  display: grid; place-items: center;
}

.fine { color: var(--ink-faint); font-size: 12.5px; line-height: 1.6; }
.foot { border-top: 1px solid var(--line); padding: 20px 16px 40px;
        max-width: 1120px; margin: 0 auto; }
.foot a { color: var(--ink-soft); }

.muted { color: var(--ink-soft); }
.empty { color: var(--ink-faint); padding: 28px 0; text-align: center; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 16px;
         font-size: 14px; }

/* 手机宽度：表格允许横向滚动，顶栏换行 */
@media (max-width: 640px) {
  .wrap { padding: 16px 16px 40px; }
  .hero h1 { font-size: 26px; }
  .nav { gap: 2px; }
  .nav a, .linkish { padding: 4px 7px; font-size: 13px; }
}

/* ---------------------------------------------------------------- 口令显示/隐藏 */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 42px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; border-radius: var(--radius);
  background: transparent; color: var(--ink-faint); cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.pw-toggle:hover { color: var(--ink); background: var(--accent-soft); }
.pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pw-toggle[aria-pressed="true"] { color: var(--accent); }

/* 审核动作：四个按钮 + 折叠的误报表单 */
.review-actions{display:flex;flex-wrap:wrap;gap:6px;align-items:flex-start}
.review-actions .inline{margin:0}
.fp-details summary{list-style:none;cursor:pointer;display:inline-block}
.fp-details summary::-webkit-details-marker{display:none}
.fp-form{margin-top:8px;padding:10px;border:1px solid var(--line);border-radius:8px;min-width:240px;background:var(--bg)}
.fp-form label{display:block;margin-top:6px;font-size:.85em}
.fp-form select,.fp-form input{width:100%;margin-top:2px}
.fp-form .btn{margin-top:8px}
.btn.danger{border-color:var(--high);color:var(--high)}
