:root {
  --bg: #f6f7f9; --panel: #fff; --panel2: #f0f2f5; --line: #e2e5ea;
  --text: #1b1f24; --muted: #6a737d; --accent: #2563eb; --accent-text: #fff;
  --ok: #15803d; --err: #dc2626; --err-bg: #fef2f2; --warn: #b45309;
  --mono: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117; --panel: #161b22; --panel2: #1f2630; --line: #2d333b;
    --text: #e6edf3; --muted: #8b949e; --accent: #4c8dff; --accent-text: #fff;
    --ok: #3fb950; --err: #f85149; --err-bg: #2d1416; --warn: #d29922;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, "Microsoft YaHei", sans-serif; }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 6px 12px; border-radius: 6px; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger:hover { border-color: var(--err); color: var(--err); }
input { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); }
code, pre { font-family: var(--mono); font-size: 13px; }
a { color: var(--accent); }

/* 登录页 */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 32px 28px; }
.login-card h1 { margin: 0 0 4px; font-size: 24px; }
.login-card p.sub { margin: 0 0 24px; color: var(--muted); }
.providers { display: grid; gap: 10px; }
.providers a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 500; }
.providers a:hover { border-color: var(--accent); }
.providers a.off { opacity: .45; pointer-events: none; }
.providers .dot { width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.providers .tag { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; }
.features { margin: 0 0 20px; padding-left: 18px; color: var(--muted); font-size: 13px; }
.features li { margin: 4px 0; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 12px; height: 44px; border: 1px solid #747775; border-radius: 22px; background: #fff; color: #1f1f1f; text-decoration: none; font-family: Roboto, system-ui, sans-serif; font-weight: 500; }
.gbtn:hover { background: #f2f2f2; }
.legal { margin: 8px 0 0; font-size: 12px; text-align: center; }
.alert { background: var(--err-bg); color: var(--err); border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; }
.note { margin-top: 20px; font-size: 12px; color: var(--muted); }

/* 隐私政策 / 服务条款 */
.doc { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; }
.doc h1 { font-size: 26px; margin: 0 0 4px; }
.doc h2 { font-size: 18px; margin: 28px 0 8px; }
.doc .date { color: var(--muted); margin: 0 0 24px; }
.doc p, .doc li { line-height: 1.75; }
.doc hr { border: none; border-top: 1px solid var(--line); margin: 40px 0; }
.doc nav { margin-bottom: 24px; font-size: 13px; }

/* 主界面 */
.app { display: grid; grid-template-rows: auto 1fr; height: 100%; }
header { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
header .logo { font-weight: 700; font-size: 16px; }
header .user { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); }
header .user img { width: 26px; height: 26px; border-radius: 50%; }
.main { display: grid; grid-template-columns: 220px 340px 1fr; min-height: 0; }
.col { border-right: 1px solid var(--line); overflow: auto; min-height: 0; }
.col-head { padding: 12px; display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 1; }
.col-head h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); flex: 1; }
.item { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.item:hover { background: var(--panel2); }
.item.active { background: var(--panel); box-shadow: inset 3px 0 var(--accent); }
.item .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .s { font-size: 12px; color: var(--muted); display: flex; gap: 8px; }
.item.err { box-shadow: inset 3px 0 var(--err); }
.m { font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 0 6px; border-radius: 4px; background: var(--panel2); }
.m.POST { color: var(--ok); } .m.GET { color: var(--accent); } .m.PUT, .m.PATCH { color: var(--warn); } .m.DELETE { color: var(--err); }
.badge-err { font-size: 11px; color: #fff; background: var(--err); padding: 0 6px; border-radius: 4px; }
.empty { padding: 32px 16px; color: var(--muted); text-align: center; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }

.detail { overflow: auto; padding: 16px 20px; min-height: 0; }
.endpoint { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.endpoint .url { display: flex; gap: 8px; align-items: center; }
.endpoint .url code { flex: 1; padding: 8px 10px; background: var(--panel2); border-radius: 6px; overflow-x: auto; white-space: nowrap; }
.endpoint details { margin-top: 10px; }
.endpoint summary { cursor: pointer; color: var(--muted); }
.endpoint pre { background: var(--panel2); padding: 10px; border-radius: 6px; overflow-x: auto; margin: 8px 0 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 12px 0; flex-wrap: wrap; }
.tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--muted); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.kv { width: 100%; border-collapse: collapse; }
.kv td { border-bottom: 1px solid var(--line); padding: 6px 8px; vertical-align: top; font-family: var(--mono); font-size: 13px; word-break: break-all; }
.kv td:first-child { color: var(--muted); width: 30%; white-space: nowrap; }
pre.body { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; white-space: pre-wrap; word-break: break-word; max-height: 70vh; margin: 0; }
.j-k { color: #a626a4; } .j-s { color: #50a14f; } .j-n { color: #c18401; } .j-b { color: #0184bc; } .j-null { color: var(--muted); }
@media (prefers-color-scheme: dark) { .j-k { color: #d2a8ff; } .j-s { color: #a5d6ff; } .j-n { color: #ffa657; } .j-b { color: #79c0ff; } }
.errbox { background: var(--err-bg); border: 1px solid var(--err); color: var(--err); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.errbox pre { margin: 6px 0 0; white-space: pre-wrap; color: var(--text); }
.meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: 6px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

@media (max-width: 900px) {
  .main { grid-template-columns: 1fr; grid-auto-rows: auto; overflow: auto; }
  .col { border-right: none; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .detail { padding: 16px; }
}
