:root {
  --bg: #f5f6f8; --card: #fff; --ink: #1d2433; --ink2: #556070; --ink3: #8a93a3; --line: #e3e6eb;
  --brand: #1f5fbf; --brand-soft: #e8f0fc; --ok: #13804a; --ok-soft: #e5f5ec; --bad: #c22f2f; --bad-soft: #fcebeb;
  --warn: #a86400; --warn-soft: #fff4e0; --radius: 8px;
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; line-height: 1.55; -webkit-text-size-adjust: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 6px 0; }
small, .muted { color: var(--ink2); }
.faint { color: var(--ink3); }
code { background: #eef0f3; padding: 1px 5px; border-radius: 4px; font-size: 13px; word-break: break-all; }

.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .in { max-width: 1240px; margin: 0 auto; padding: 0 16px; height: 52px; display: flex; align-items: center; gap: 16px; }
.top .brand { font-weight: 700; color: var(--ink); white-space: nowrap; }
.top .brand small { font-weight: 400; margin-left: 6px; }
.top nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.top nav a { padding: 6px 10px; border-radius: 6px; color: var(--ink2); white-space: nowrap; }
.top nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; text-decoration: none; }
.top .who { color: var(--ink2); font-size: 13px; white-space: nowrap; }
.mask-flag { background: var(--warn-soft); color: var(--warn); border-radius: 4px; padding: 2px 6px; font-size: 12px; white-space: nowrap; }

main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 60px; }
main.narrow { max-width: 860px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card.flat { padding: 0; overflow: hidden; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
button.link { white-space: normal; text-align: left; overflow-wrap: anywhere; }
details summary { cursor: pointer; color: var(--ink2); font-size: 13px; }
.crumbs { font-size: 13px; color: var(--ink2); margin-bottom: 8px; }
.crumbs a { color: var(--ink2); }

button, .btn { font: inherit; font-size: 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 14px; border-radius: 6px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
button:hover, .btn:hover { border-color: #c4cad3; text-decoration: none; }
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover { background: #194f9f; }
button.danger { color: var(--bad); }
button.link { border: 0; background: none; color: var(--brand); padding: 0; }
button.small, .btn.small { padding: 3px 9px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }

input, select, textarea { font: inherit; font-size: 14px; border: 1px solid #cfd4db; border-radius: 6px; padding: 7px 9px; background: #fff; color: var(--ink); width: 100%; min-width: 0; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; color: var(--ink2); margin-bottom: 4px; }
label.f > span b { color: var(--bad); font-weight: 400; }
label.f .hint { font-size: 12px; color: var(--ink3); margin-top: 3px; }
label.f.need input, label.f.need select, label.f.need textarea { border-color: #e2a33c; background: #fffaf0; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.chk input { width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 2px; margin: 0 0 14px; }
legend { font-weight: 600; font-size: 14px; padding: 0 6px; }

.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 10px; background: #eef0f3; color: var(--ink2); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.blue { background: var(--brand-soft); color: var(--brand); }
.note { background: var(--brand-soft); border-radius: 6px; padding: 10px 12px; font-size: 14px; color: #23436e; margin: 8px 0; }
.note.warn { background: var(--warn-soft); color: #6f4700; }
.note.bad { background: var(--bad-soft); color: #7d1e1e; }
.note.ok { background: var(--ok-soft); color: #0f5a35; }
.empty { color: var(--ink3); padding: 26px 10px; text-align: center; }

.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink2); font-size: 13px; background: #fafbfc; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f7f9fc; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mx th:first-child, .mx td:first-child { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 130px; box-shadow: 1px 0 0 var(--line); }
.mx th:first-child { background: #fafbfc; }
.mx td { min-width: 150px; max-width: 260px; font-size: 13px; }
.mx td.best { background: var(--ok-soft); }
.mx td.miss { color: var(--bad); }
.mx tr.grp td { background: #f3f5f8; font-weight: 600; font-size: 13px; color: var(--ink2); }
.mx .diff::after { content: "●"; color: #d99a1e; font-size: 9px; margin-left: 4px; vertical-align: top; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 14px; color: var(--ink2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; text-decoration: none; }
.tabs a .n { font-size: 12px; color: var(--ink3); margin-left: 4px; }

.list > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > div:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; font-size: 14px; }
.kv > :nth-child(odd) { color: var(--ink2); }
.steps { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink2); }
.drop { border: 2px dashed #c9d0da; border-radius: var(--radius); padding: 22px; text-align: center; color: var(--ink2); cursor: pointer; background: #fafbfc; }
.drop.on { border-color: var(--brand); background: var(--brand-soft); }
.files { list-style: none; padding: 0; margin: 8px 0; font-size: 14px; }
.files li { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.stat { display: flex; gap: 22px; flex-wrap: wrap; }
.stat div b { display: block; font-size: 20px; }
.stat div span { font-size: 12px; color: var(--ink2); }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: sp 0.8s linear infinite; vertical-align: -1px; }
@keyframes sp { to { transform: rotate(360deg); } }

.modal-bg { position: fixed; inset: 0; background: rgba(20, 28, 40, .45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 40px 12px; overflow-y: auto; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 720px; padding: 18px 18px 14px; box-shadow: 0 10px 40px rgba(0, 0, 0, .2); }
.modal.wide { max-width: 980px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; position: sticky; bottom: -14px; background: #fff; padding: 10px 0 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1d2433; color: #fff; padding: 9px 16px; border-radius: 6px; z-index: 99; font-size: 14px; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); }

.login { max-width: 420px; margin: 50px auto; }
.foot-note { text-align: center; color: var(--ink3); font-size: 12px; margin-top: 30px; }

@media (max-width: 720px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .top .in { gap: 4px 10px; flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 4px; }
  .top nav { order: 3; flex: 1 0 100%; margin: 0 -6px; }
  .top .who { margin-left: auto; max-width: 55vw; overflow: hidden; text-overflow: ellipsis; }
  .top .brand small { display: none; }
  h1 { font-size: 19px; }
  .kv { grid-template-columns: 1fr; }
  .kv > :nth-child(odd) { margin-top: 6px; }
  .hide-m { display: none; }
  .tw table { min-width: 640px; }
  .tw table.mx { min-width: 0; }
  .card { padding: 14px 12px; }
  .modal { padding: 14px 12px 12px; }
}
