:root { --bg: #f5f6f8; --card: #fff; --line: #e4e7ec; --text: #1d2433; --muted: #667085; --pri: #2563eb; --pri-soft: #eaf1ff; --red: #c62828; --green: #2e7d32; --amber: #b26a00; --side: #1f2937; --head-h: 52px; }
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.6 "Microsoft YaHei", "PingFang SC", sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
button { cursor: pointer; white-space: nowrap; padding: 5px 14px; border: 1px solid #cfd4dc; background: #fff; border-radius: 6px; font: inherit; color: inherit; transition: background .15s, border-color .15s, box-shadow .15s; }
button:hover:not(:disabled) { background: #f2f4f7; border-color: #b6bcc7; }
button.primary { background: var(--pri); color: #fff; border-color: var(--pri); }
button.primary:hover:not(:disabled) { background: #1d4fd7; border-color: #1d4fd7; }
button.danger { color: var(--red); border-color: var(--red); }
button.danger:hover:not(:disabled) { background: #fdecec; border-color: var(--red); }
button.link { border: 0; background: none; padding: 0; color: var(--pri); }
button.link:hover:not(:disabled) { background: none; text-decoration: underline; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: inherit; padding: 5px 8px; border: 1px solid #cfd4dc; border-radius: 6px; background: #fff; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--pri); outline-offset: 1px; }
a { color: var(--pri); }
.w80 { width: 80px; } .w100 { width: 100px; } .w120 { width: 120px; } .w160 { width: 160px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
main .card + .card, main .card + [data-list], main .card + [data-res] { margin-top: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tbl-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
pre { white-space: pre-wrap; word-break: break-all; margin: 0; }
h4 { margin: 10px 0 4px; }
.card > .filter { margin: 8px 0 0; }
.card > b + .grid, .card > b + .snap, .card > b + table { margin-top: 6px; }
.err { color: var(--red); margin-left: 8px; }
.ok { color: var(--green); }
.login { display: flex; justify-content: center; align-items: flex-start; min-height: 100vh; padding: 14vh 16px 16px; background: linear-gradient(160deg, #e8efff 0%, #f5f6f8 55%); }
.login form { width: 360px; max-width: 100%; display: flex; flex-direction: column; gap: 14px; padding: 28px; box-shadow: 0 8px 30px rgba(16, 24, 40, .1); }
.login label { display: flex; flex-direction: column; gap: 4px; }
.login h1 { font-size: 22px; margin: 0; }
.login .tip { color: var(--muted); margin: -8px 0 4px; }
.login button.primary { padding: 8px 14px; }
.login .err { margin-left: 0; }
.login .err:empty { display: none; }
header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; height: var(--head-h); padding: 0 20px; background: var(--side); color: #fff; }
header .brand { font-size: 16px; }
header .me { margin-left: auto; display: flex; align-items: center; gap: 10px; }
header button { background: transparent; border-color: #4b5563; color: #fff; }
header button:hover:not(:disabled) { background: #374151; border-color: #6b7280; }
#menuBtn { display: none; padding: 3px 10px; font-size: 16px; }
#menuMask { display: none; }
.body { display: flex; min-height: calc(100vh - var(--head-h)); }
#menu { position: sticky; top: var(--head-h); align-self: flex-start; width: 200px; height: calc(100vh - var(--head-h)); overflow-y: auto; flex: none; background: #fff; border-right: 1px solid var(--line); padding: 8px; }
#menu .grp { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 8px 10px; margin-top: 2px; border: 0; background: none; border-radius: 6px; color: var(--muted); font-size: 13px; font-weight: bold; text-align: left; }
#menu .grp:hover { background: #f2f4f7; color: var(--text); }
#menu .grp::after { content: "▾"; font-size: 12px; transition: transform .15s; }
#menu .grp.fold::after { transform: rotate(-90deg); }
#menu .grp.fold + .grp-items { display: none; }
#menu a { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 6px 20px; margin: 1px 0; border-radius: 6px; color: var(--text); text-decoration: none; }
#menu a:hover { background: #f2f4f7; }
#menu a.on { background: var(--pri-soft); color: var(--pri); font-weight: bold; }
.badge { min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--red); color: #fff; font-size: 12px; font-weight: normal; line-height: 18px; text-align: center; }
main { flex: 1; min-width: 0; padding: 16px 20px; }
main h2 { font-size: 18px; margin: 0 0 12px; }
.filter { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; background: var(--card); padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.filter label { display: flex; align-items: center; gap: 6px; color: #475467; }
.grid { width: 100%; border-collapse: collapse; background: var(--card); transition: opacity .15s; }
.grid.loading { opacity: .55; }
.grid th, .grid td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.grid th { background: #f9fafb; color: #475467; font-weight: 600; white-space: nowrap; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover td { background: #f7f9fc; }
.grid td.num { text-align: right; white-space: nowrap; }
.grid td.wrap { word-break: break-all; max-width: 420px; }
.grid td.empty { padding: 32px 10px; text-align: center; color: var(--muted); }
.grid td.empty .err { display: block; margin: 0 0 8px; }
.sub { color: var(--muted); font-size: 12px; }
.st0 { color: var(--amber); font-weight: bold; } .st1, .st4, .st5, .st6 { color: var(--green); } .st2 { color: var(--pri); } .st3 { color: var(--red); font-weight: bold; } .st7 { color: var(--muted); }
.hi { color: var(--red); font-weight: bold; } .lo { color: var(--pri); font-weight: bold; }
.pager { margin: 12px 0; display: flex; gap: 10px; align-items: center; color: #475467; }
.mask { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: flex; justify-content: center; align-items: flex-start; padding: 5vh 8px; overflow: auto; z-index: 10; }
.dlg { width: min(900px, 96vw); box-shadow: 0 16px 48px rgba(16, 24, 40, .25); }
.dlg.small { width: min(460px, 96vw); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 15px; }
.dlg-head [data-close] { border: 0; background: none; padding: 0 6px; font-size: 20px; line-height: 1.2; color: var(--muted); }
/* 名称列按文字宽度、不折行，值列占剩下的宽度 */
.kv { display: grid; grid-template-columns: max-content 1fr max-content 1fr; gap: 4px 16px; margin-bottom: 10px; }
.kv .k { color: var(--muted); white-space: nowrap; }
.snap { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.snap td { border: 1px solid var(--line); padding: 3px 6px; word-break: break-all; }
.snap td:first-child { width: 1%; white-space: nowrap; color: var(--muted); }
.decide { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.vform { display: flex; flex-direction: column; gap: 10px; }
.vform > label { display: flex; flex-direction: column; gap: 4px; }
.decide .row, .vform .row { display: flex; gap: 16px; align-items: center; }
.decide .block { display: flex; flex-direction: column; gap: 4px; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.stats .card { min-width: 280px; }
.perm-table td.c { text-align: center; }
/* 右上角提示：代替浏览器原生 alert，不挡操作；长内容不自动消失 */
#toasts { position: fixed; top: calc(var(--head-h) + 10px); right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { position: relative; padding: 10px 32px 10px 14px; background: #1f2937; color: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(16, 24, 40, .3); white-space: pre-wrap; word-break: break-word; cursor: pointer; }
.toast::after { content: "×"; position: absolute; right: 12px; top: 8px; color: #9ca3af; font-size: 16px; }
@media (max-width: 800px) {
  header { padding: 0 12px; }
  #menuBtn { display: block; }
  #meName { display: none; }
  #menu { position: fixed; left: 0; z-index: 7; display: none; box-shadow: 4px 0 20px rgba(16, 24, 40, .2); }
  body.menu-open #menu { display: block; }
  body.menu-open #menuMask { display: block; position: fixed; inset: var(--head-h) 0 0; z-index: 6; background: rgba(16, 24, 40, .35); }
  main { padding: 12px; }
  .kv { grid-template-columns: max-content 1fr; }
}

/* 滑块验证（同官网 site.css） */
.slider-mask { position: fixed; inset: 0; background: rgba(40, 20, 8, .55); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.slider-mask.show { display: flex; }
.slider-panel { width: 100%; max-width: 332px; background: #fffaf0; border: 1px solid #dde1e6; border-radius: 8px; padding: 12px 16px 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.slider-head { display: flex; justify-content: space-between; align-items: center; color: #1f2328; margin-bottom: 8px; }
.slider-head button { border: 0; background: none; font-size: 22px; line-height: 1; color: #6a737d; cursor: pointer; }
.slider-stage { position: relative; width: 100%; aspect-ratio: 2 / 1; border-radius: 4px; overflow: hidden; background: #f4efe4; user-select: none; }
.slider-stage img { position: absolute; left: 0; top: 0; display: block; pointer-events: none; -webkit-user-drag: none; }
.slider-stage [data-bg] { width: 100%; height: 100%; }
.slider-stage [data-piece] { filter: drop-shadow(0 0 3px rgba(0, 0, 0, .6)); }
.slider-load { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #6a737d; background: #f4efe4; }
.slider-bar { position: relative; height: 40px; margin-top: 10px; border: 1px solid #dde1e6; border-radius: 4px; background: #fff; overflow: hidden; touch-action: none; user-select: none; }
.slider-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #f0dcc0; }
.slider-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #6a737d; font-size: 13px; pointer-events: none; }
.slider-handle { position: absolute; left: 0; top: 0; width: 44px; height: 38px; background: var(--pri); color: #fff; display: flex; align-items: center; justify-content: center; cursor: grab; z-index: 1; touch-action: none; border-radius: 3px; }
.slider-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; }
.slider-msg { color: #d32f2f; min-height: 1.2em; }
.slider-msg.ok { color: #2e7d32; }
.slider-foot button { border: 1px solid var(--pri); color: var(--pri); background: #fff; border-radius: 4px; padding: 2px 10px; cursor: pointer; font: inherit; }
.otp-secret { font: 16px/1.6 Consolas, monospace; word-break: break-all; user-select: all; padding: 6px 8px; background: #f4f5f7; border-radius: 4px; }
.otp-qr { display: block; margin: 8px auto; max-width: 100%; }
