:root {
  --bg: #0a101b; --side: #080d16; --card: #111a29; --card2: #0e1622; --line: #1d2838; --line2: #263448;
  --text: #e8eef7; --muted: #8b9bb3; --dim: #5d6c84; --mint: #7fe3ba; --mint-ink: #06281c; --mint-soft: rgba(127, 227, 186, .12);
  --warn: #f2c063; --bad: #f08a8a; --bad-soft: rgba(240, 138, 138, .12); --blue: #7fb4f0;
  --r: 14px; --font: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--mint); text-decoration: none; }
a:hover { text-decoration: underline; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #223046; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* 登录 */
.login { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(0,1fr); place-items: center; padding: clamp(14px,4vw,28px); background: radial-gradient(900px 500px at 50% -10%, rgba(127, 227, 186, .08), transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: clamp(18px,4vw,30px); }
.login-card h1 { margin: 0 0 2px; font-size: 24px; line-height: 1.35; letter-spacing: -.01em; }
.login-card p { margin: 0 0 22px; color: var(--muted); }

/* 布局 */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 26px 22px 18px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-label { font-size: 11px; letter-spacing: .14em; color: var(--dim); padding: 0 16px 2px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 12px; color: var(--muted); font-size: 15px; text-decoration: none; border: 1px solid transparent; }
.nav a:hover { background: #0f1724; color: var(--text); }
.nav a.on { background: var(--mint-soft); color: var(--mint); border-color: rgba(127, 227, 186, .18); font-weight: 600; }
.nav a .cnt { margin-left: auto; font-size: 12px; padding: 1px 8px; border-radius: 8px; background: rgba(255, 255, 255, .06); color: var(--muted); font-weight: 400; }
.nav a.on .cnt { background: rgba(127, 227, 186, .14); color: var(--mint); }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.acct { border: 1px solid var(--line2); border-radius: var(--r); padding: 14px 15px; background: linear-gradient(180deg, #0f1826, #0b121d); }
.acct h4 { margin: 0 0 4px; font-size: 14px; }
.acct .mail { font-size: 12px; color: var(--muted); word-break: break-all; line-height: 1.45; }
.acct .credits { font-size: 28px; font-weight: 600; color: var(--mint); margin: 6px 0 4px; line-height: 1.1; }
.acct .credits small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.acct .credits.zero { color: var(--text); }
.acct .meta { font-size: 12px; color: var(--muted); }
.acct.err { border-color: rgba(240, 138, 138, .45); }
.side-note { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 15px; font-size: 13px; color: var(--muted); }
.side-note b { color: var(--text); font-weight: 500; display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); display: inline-block; }
.dot.ok { background: var(--mint); }
.dot.bad { background: var(--bad); }
.who { margin-top: auto; display: grid; gap: 10px; padding: 10px 2px 0; }
.who-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-text { min-width: 0; flex: 1; }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--mint-soft); color: var(--mint); display: grid; place-items: center; font-weight: 700; flex: none; }
.who .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .s { font-size: 12px; color: var(--muted); }
.who-out { width: 100%; color: var(--muted); background: transparent; }
.who-out:hover { color: var(--text); }
.top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pill-name { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 52px; border-bottom: 1px solid var(--line); }
.crumb { color: var(--muted); }
.crumb b { color: var(--text); font-weight: 500; }
.crumb span { margin: 0 12px; color: var(--dim); }
.pill { border: 1px solid var(--line2); border-radius: 999px; padding: 6px 14px; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; }
.view { padding: 44px 52px 80px; width: 100%; max-width: 1920px; margin: 0 auto; }
.wrap { max-width: 1810px; margin: 0 auto; padding: 0 clamp(0px, calc((100vw - 1400px) / 4.5), 220px); }
.eyebrow { color: var(--mint); font-size: 12px; letter-spacing: .16em; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 34px; }
.hero h1 { font-size: 38px; margin: 10px 0 12px; letter-spacing: -.02em; line-height: 1.2; }
.hero p { margin: 0; color: var(--muted); font-size: 16px; }
.hero .tag { color: var(--dim); font-size: 12px; letter-spacing: .14em; white-space: nowrap; }
h2.sec { font-size: 19px; margin: 0; font-weight: 600; }
h2.sec small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 8px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 26px; display: flex; align-items: center; justify-content: space-between; }
.stat .k { color: var(--muted); font-size: 13px; }
.stat .v { font-size: 36px; font-weight: 500; line-height: 1.25; margin-top: 4px; }
.stat .box { width: 56px; height: 56px; border-radius: 12px; border: 1px solid var(--line2); display: grid; place-items: center; color: var(--muted); background: var(--card2); }
.stat .box.warn { color: var(--warn); } .stat .box.ok { color: var(--mint); }
.steps { display: flex; gap: 30px; margin: 0 0 22px; color: var(--muted); }
.steps span { display: inline-flex; align-items: center; gap: 10px; }
.steps i { font-style: normal; font-size: 12px; border: 1px solid var(--line2); border-radius: 7px; padding: 2px 7px; }
.steps .on { color: var(--mint); } .steps .on i { border-color: rgba(127, 227, 186, .5); background: var(--mint-soft); }

.drop { border: 1.5px dashed var(--line2); border-radius: 18px; padding: 54px 24px 44px; text-align: center; background: linear-gradient(180deg, rgba(17, 26, 41, .7), rgba(11, 30, 34, .5)); transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--mint); background: rgba(127, 227, 186, .07); }
.drop .up { width: 56px; height: 56px; border-radius: 12px; background: var(--mint-soft); border: 1px solid rgba(127, 227, 186, .25); color: var(--mint); display: inline-grid; place-items: center; }
.drop h3 { font-size: 20px; margin: 18px 0 8px; font-weight: 600; }
.drop p { margin: 0 0 24px; color: var(--muted); }
.drop .hint { margin-top: 22px; font-size: 13px; color: var(--dim); }
.drop .hint span { margin: 0 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--line2); background: var(--card); border-radius: 11px; padding: 9px 16px; font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: #162235; border-color: #33455e; }
.btn.pri { background: var(--mint); border-color: var(--mint); color: var(--mint-ink); font-weight: 700; }
.btn.pri:hover { background: #93ecc8; }
.btn.lg { padding: 13px 26px; font-size: 16px; border-radius: 12px; }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 9px; }
.btn.danger { color: var(--bad); border-color: rgba(240, 138, 138, .3); background: var(--bad-soft); }
.btn.danger:hover { background: rgba(240, 138, 138, .2); }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn .ico { width: 18px; height: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sp { flex: 1; }
.bar-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 38px 0 16px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.panel.pad { padding: 22px 24px; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-weight: 400; color: var(--muted); font-size: 13px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: #0f1826; white-space: nowrap; }
table.t th:first-child { border-top-left-radius: var(--r); } table.t th:last-child { border-top-right-radius: var(--r); }
table.t td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.sel td { background: rgba(127, 227, 186, .04); }
.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty .ico { width: 34px; height: 34px; color: var(--dim); margin-bottom: 10px; }
.fname { font-weight: 500; word-break: break-all; }
.sub { font-size: 12px; color: var(--muted); word-break: break-all; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--mint-soft); color: var(--mint); border: 1px solid rgba(127, 227, 186, .2); white-space: nowrap; }
.chip.none { background: transparent; color: var(--warn); border-color: rgba(242, 192, 99, .35); }
.chip.grey { background: rgba(255, 255, 255, .05); color: var(--muted); border-color: var(--line2); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--mint); font-size: 12px; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn.red { color: var(--bad); }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 6px 12px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.seg button.on { background: var(--mint-soft); color: var(--mint); font-weight: 600; }
.spk { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.spk input, .inp, select.inp { background: var(--card2); border: 1px solid var(--line2); border-radius: 9px; padding: 7px 10px; outline: none; }
.spk input { width: 56px; padding: 3px 6px; }
.inp { width: 100%; padding: 10px 12px; }
.inp:focus, .spk input:focus { border-color: var(--mint); }
input[type=checkbox], input[type=radio] { accent-color: var(--mint); width: 16px; height: 16px; cursor: pointer; }
.submitbar { position: sticky; bottom: 0; margin-top: 18px; padding: 16px 20px; display: flex; align-items: center; gap: 14px; background: rgba(13, 20, 32, .92); backdrop-filter: blur(8px); border: 1px solid var(--line2); border-radius: var(--r); }

.prog { height: 6px; background: #1a2536; border-radius: 4px; overflow: hidden; }
.prog > i { display: block; height: 100%; background: var(--mint); border-radius: 4px; transition: width .4s; }
.prog > i.bad { background: var(--bad); }
.uplist { margin-top: 20px; text-align: left; display: grid; gap: 8px; max-width: 760px; margin-inline: auto; }
.upitem { display: grid; grid-template-columns: 1fr 120px 52px; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); }
.upitem .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.upitem.err .n { color: var(--bad); }

.batch { margin-bottom: 16px; }
.batch-head { padding: 20px 24px; }
.batch-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.batch-title h3 { margin: 0; font-size: 17px; font-weight: 600; }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; }
.badge.run { color: var(--blue); border-color: rgba(127, 180, 240, .35); background: rgba(127, 180, 240, .08); }
.badge.ok { color: var(--mint); border-color: rgba(127, 227, 186, .35); background: var(--mint-soft); }
.badge.bad { color: var(--bad); border-color: rgba(240, 138, 138, .35); background: var(--bad-soft); }
.badge.q { color: #1c1300; background: var(--warn); border-color: var(--warn); font-weight: 700; }
.batch-meta { display: flex; gap: 18px; color: var(--muted); font-size: 13px; margin: 10px 0 16px; flex-wrap: wrap; }
.batch-body { border-top: 1px solid var(--line); }
.st { font-size: 13px; white-space: nowrap; }
.st.ok { color: var(--mint); } .st.bad { color: var(--bad); } .st.run { color: var(--blue); } .st.q { color: var(--warn); }
.errmsg { font-size: 12px; color: var(--bad); margin-top: 4px; white-space: normal; max-width: 420px; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.kv .k { color: var(--muted); font-size: 13px; } .kv .v { font-size: 26px; font-weight: 500; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 24px; flex-wrap: wrap; }
.tabs a { border-bottom: 2px solid transparent; padding: 10px 12px; color: var(--muted); font-size: 14px; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--mint); border-color: var(--mint); font-weight: 600; }
.nav-admin { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.nav-admin a { padding-block: 9px; }
.avatar-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.avatar-library .row { margin-bottom: 16px; align-items: end; }
.avatar-library label { flex: 1; min-width: 0; }
.avatar-looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.avatar-looks:not(:empty) { margin-bottom: 14px; }
.avatar-look { display: grid; min-width: 0; gap: 7px; text-align: left; padding: 5px 5px 9px; border: 1px solid var(--line2); border-radius: 10px; background: var(--card2); }
.avatar-look:hover, .avatar-look[aria-pressed="true"] { border-color: var(--mint); }
.avatar-look[aria-pressed="true"] { background: var(--mint-soft); }
.avatar-look img, .avatar-look-fallback { width: 100%; aspect-ratio: 4/3; border-radius: 6px; object-fit: cover; background: var(--bg); }
.avatar-look-fallback { display: grid; place-items: center; }
.avatar-look > span:last-child { padding-inline: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.avatar-results { overflow-x: auto; }
.avatar-product-section { margin-bottom: 24px; }
@media (max-width: 820px) {
  .avatar-layout { grid-template-columns: minmax(0, 1fr); }
}
.admin-heading { margin: 0 0 12px; }
.admin-heading h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); }
.admin-account-import { margin-bottom: 24px; }
.admin-member-table { overflow-x: auto; }
.admin-member-table td.num { white-space: nowrap; }
.admin-member-actions { gap: 6px; }
@media (max-width: 1100px) {
  .nav-admin { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.form { display: grid; gap: 14px; max-width: 620px; }
.form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.note { font-size: 13px; color: var(--muted); line-height: 1.7; }
.note.box { border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; background: var(--card2); }
.note.warn { border-color: rgba(242, 192, 99, .35); color: #e9cf9a; }
.prose { max-width: 820px; color: #c5d0e0; line-height: 1.85; }
.prose h3 { color: var(--text); margin: 26px 0 8px; font-size: 16px; }
.prose code, code { background: #172234; border-radius: 6px; padding: 1px 7px; font-family: Consolas, "Cascadia Mono", monospace; font-size: 13px; color: #cfe8dc; }
ol.steps-list { padding-left: 20px; margin: 8px 0; } ol.steps-list li { margin: 6px 0; }

.modal-bg { position: fixed; inset: 0; background: rgba(3, 6, 12, .66); display: grid; place-items: center; padding: 24px; z-index: 50; }
.modal { width: min(560px, 100%); max-height: 86vh; overflow: auto; background: #101927; border: 1px solid var(--line2); border-radius: 18px; padding: 26px 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.modal.wide { width: min(760px, 100%); }
.modal h3 { margin: 0 0 6px; font-size: 19px; }
.modal .desc { color: var(--muted); margin: 0 0 18px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; align-items: center; flex-wrap: wrap; }
.optgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.opt { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line2); border-radius: 11px; padding: 11px 13px; cursor: pointer; background: var(--card2); }
.opt:has(input:checked) { border-color: rgba(127, 227, 186, .55); background: var(--mint-soft); color: var(--mint); }
.listbox { border: 1px solid var(--line2); border-radius: 12px; max-height: 300px; overflow: auto; }
.listbox > label, .listbox > div { display: flex; gap: 10px; align-items: flex-start; padding: 9px 13px; border-bottom: 1px solid var(--line); font-size: 13px; }
.listbox > :last-child { border-bottom: 0; }
.warnbox { border: 1px solid rgba(242, 192, 99, .5); background: rgba(242, 192, 99, .1); color: #f3d596; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-weight: 600; }
#toasts { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 80; justify-items: center; pointer-events: none; }
.toast { background: #17233a; border: 1px solid var(--line2); border-radius: 11px; padding: 10px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); max-width: 560px; }
.toast.ok { border-color: rgba(127, 227, 186, .5); } .toast.bad { border-color: rgba(240, 138, 138, .5); color: #f7b9b9; }
.smoke { position: fixed; right: 18px; bottom: 10px; font-size: 11px; color: #334156; user-select: none; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .top, .view { padding-inline: 20px; }
  .wrap { padding: 0; }
  .stats { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
  .panel { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.relay-form,.login-card{display:grid;gap:14px;align-content:start}
.relay-form label,.login-card label{display:grid;gap:6px}
.relay-form label:has(input[type=checkbox]){display:block}
.relay-form .inp,.login-card .inp{width:100%}
.relay-form h2{font-size:19px;margin:0}
.relay-form button{justify-self:start}
.login-card { grid-template-columns: minmax(0,1fr); gap: 16px; }
.login-card .inp { min-width: 0; }
.login-card > button[type=submit] { width: 100%; min-height: 44px; justify-content: center; }
.login-card nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; border-top: 1px solid var(--line2); padding-top: 12px; }
.login-card nav a { color: var(--muted); font-size: 13px; padding-block: 3px; }
.login-card nav a:hover { color: var(--mint); }
#puzzle-box { display: grid; gap: 5px; }
.puzzle-heading { display: flex; align-items: center; justify-content: space-between; }
#puzzle-new { border: 0; background: transparent; color: var(--mint); padding: 3px 0 3px 10px; font-size: 13px; }
.puzzle { position: relative; width: 100%; aspect-ratio: 4/1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line2); background: #123e4c; }
.puzzle .puzzle-bg { display: block; width: 100%; height: 100%; }
.puzzle .puzzle-piece { position: absolute; top: 28.333333%; left: 0; width: 11.666667%; height: auto; aspect-ratio: 1; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .6)); pointer-events: none; }
#puzzle-position { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 30px; margin: 4px 0 0; background: transparent; cursor: pointer; }
#puzzle-position::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: #1a2638; border: 1px solid var(--line2); }
#puzzle-position::-moz-range-track { height: 8px; border-radius: 999px; background: #1a2638; border: 1px solid var(--line2); }
#puzzle-position::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: var(--mint); border: 3px solid #0e1622; box-shadow: 0 0 0 1px var(--mint); }
#puzzle-position::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--mint); border: 3px solid #0e1622; box-shadow: 0 0 0 1px var(--mint); }
#puzzle-help { color: var(--muted); font-size: 12px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .inp { padding-right: 48px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.pw-eye:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.pw-eye[aria-pressed=true] { color: var(--mint); }
.pw-eye svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabs button .dot { margin-left: 6px; vertical-align: middle; }
.relay-form > .row h2 { margin-right: 4px; }
.relay-form > .row button { justify-self: auto; }
