:root {
    --ink: #151820;
    --ink-soft: #2c3340;
    --muted: #6a7380;
    --paper: #eef1f4;
    --paper-2: #e3e7ed;
    --line: rgba(21, 24, 32, .1);
    --accent: #d63b2c;
    --accent-deep: #b02c20;
    --ok: #1f7a4d;
    --danger: #b42318;
    --ok-bg: #ecfdf3;
    --err-bg: #fef3f2;
    --info-bg: #fff7e8;
    --card: #ffffff;
    --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    --display: "ZCOOL XiaoWei", "Noto Serif SC", serif;
    --pad: clamp(16px, 3vw, 40px);
    --radius: 16px;
    --shadow: 0 12px 40px rgba(21, 24, 32, .08);
    --control-h: 44px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; }
body {
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(900px 420px at 8% -10%, rgba(214, 59, 44, .12), transparent 55%),
        radial-gradient(700px 360px at 100% 0%, rgba(120, 150, 190, .16), transparent 50%),
        var(--paper);
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

/* 加载壳：不要用 place-items:center，否则整页会被收成窄条 */
#r {
    width: 100%;
    min-height: 100vh;
}
#r.boot-shell {
    display: flex;
    align-items: center;
    justify-content: center;
}
.boot-loading { color: var(--muted); letter-spacing: .08em; }

.page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px var(--pad);
    background: rgba(238, 241, 244, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--display);
    font-size: 22px;
    font-weight: 400;
}
.brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}
.nav-links {
    display: flex;
    gap: 18px;
    margin-left: 12px;
    color: var(--muted);
    font-size: 14px;
}
.nav-links a:hover,
.nav-links a.is-active { color: var(--accent); }
.nav-cta {
    margin-left: auto;
    background: var(--accent);
    color: #fff !important;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 14px;
}
.nav-cta:hover { background: var(--accent-deep); }

.hero {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 42px var(--pad) 28px;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(10,12,18,.15) 0%, rgba(10,12,18,.45) 55%, rgba(10,12,18,.08) 100%),
        linear-gradient(130deg, #1a1f2b 0%, #12151c 42%, #3a1a18 100%);
}
.hero-glow {
    position: absolute;
    width: 280px; height: 280px;
    right: 8%; top: -40px;
    background: radial-gradient(circle, rgba(214,59,44,.65), transparent 68%);
    filter: blur(8px);
    pointer-events: none;
}
.hero-kicker {
    position: relative;
    margin: 0 0 8px;
    letter-spacing: .18em;
    font-size: 12px;
    color: rgba(255,255,255,.7);
}
.hero h1 {
    position: relative;
    margin: 0;
    font-family: var(--display);
    font-size: clamp(34px, 5vw, 52px);
    font-weight: 400;
}
.hero-desc {
    position: relative;
    margin: 12px 0 0;
    max-width: 640px;
    color: rgba(255,255,255,.78);
    line-height: 1.7;
    font-size: 15px;
}

/* PC 全局宽度：内容区通栏，只留左右内边距 */
.wrap {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 22px var(--pad) 40px;
    display: grid;
    gap: 18px;
    flex: 1;
}

.panel {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}
.panel-head { margin-bottom: 16px; }
.panel-head h2 {
    margin: 0;
    font-family: var(--display);
    font-size: 28px;
    font-weight: 400;
}
.panel-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

/* 验证区：flex 避免 grid 把控件撑变形 */
.base-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.base-fields label {
    flex: 1 1 240px;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}
.base-fields #btnVerify {
    flex: 0 0 auto;
    height: var(--control-h);
    align-self: flex-end;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--muted);
}

input, select {
    width: 100%;
    height: var(--control-h);
    min-height: var(--control-h);
    max-height: var(--control-h);
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    line-height: var(--control-h);
    appearance: none;
    -webkit-appearance: none;
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236a7380' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
input:focus, select:focus {
    outline: 2px solid rgba(214, 59, 44, .22);
    border-color: var(--accent);
}

.btn-primary, button.btn-primary {
    border: 0;
    background: var(--accent);
    color: #fff;
    height: var(--control-h);
    padding: 0 18px;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
}
.btn-primary:hover { background: var(--accent-deep); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-ghost, button.btn-ghost {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    height: var(--control-h);
    padding: 0 12px;
    border-radius: 10px;
    cursor: pointer;
    line-height: 1;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.selected {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.selected strong {
    background: var(--ink);
    color: #fff;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
}
.selected span {
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
}

/* 关键：顶对齐，禁止三栏被最高列撑高后拉长表单 */
.ops-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}
.ops-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.card-form {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    background: linear-gradient(180deg, #fff, #f8f9fb);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    height: auto;
    min-height: 0;
}
.card-form h3 {
    margin: 0;
    font-family: var(--display);
    font-size: 22px;
    font-weight: 400;
}
.card-hint {
    margin: 4px 0 12px;
    color: var(--muted);
    font-size: 13px;
}
.jade-form { margin-top: 14px; }
.jade-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.jade-row > div { flex: 1 1 180px; }
.jade-row .grow { flex: 1 1 200px; margin-bottom: 0; }

.item-picker { margin-bottom: 8px; }
.item-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}
.item-toolbar .item-search {
    flex: 1 1 160px;
    margin: 0;
}
.item-toolbar .item-pagesize {
    flex: 0 0 100px;
    width: auto;
    margin: 0;
}
.item-toolbar .item-btn-search {
    flex: 0 0 auto;
}
.item-list {
    min-height: 160px;
    max-height: 260px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}
.item-option {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    border-radius: 0;
    text-align: left;
    cursor: pointer;
    height: auto;
    min-height: 0;
    max-height: none;
    line-height: 1.4;
}
.item-option:hover,
.item-option.is-active { background: rgba(214, 59, 44, .08); }
.item-option em { color: var(--muted); font-style: normal; font-size: 12px; }
.item-empty { padding: 16px; color: var(--muted); font-size: 13px; }
.item-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    font-size: 13px;
}
.item-pager .btn-ghost {
    height: 36px;
    padding: 0 10px;
}
.item-page-input {
    width: 64px;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    padding: 0 8px;
    display: inline-block;
    line-height: 36px;
}
.item-jump { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.item-chosen, .item-meta { font-size: 13px; margin-top: 6px; }
.ok-text { color: var(--ok); }
.muted { color: var(--muted); }

.msg {
    margin-top: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-all;
}
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.error { background: var(--err-bg); color: var(--danger); }
.msg.info { background: var(--info-bg); color: #93370d; }

.site-foot {
    width: 100%;
    margin-top: auto;
    padding: 28px var(--pad) 36px;
    border-top: 1px solid var(--line);
    background: #fff;
    display: grid;
    gap: 12px;
    justify-items: start;
}
.foot-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--display);
    font-size: 20px;
}
.foot-brand img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}
.foot-links { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 14px; }
.foot-links a:hover { color: var(--accent); }
.foot-copy { margin: 0; color: var(--muted); font-size: 13px; }

.role-pick { margin-top: 12px; }
.role-pick-title { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.role-pick-list { display: flex; flex-wrap: wrap; gap: 8px; }
.role-chip {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    height: auto;
    min-height: 0;
    max-height: none;
    line-height: 1.3;
}
.role-chip em { color: var(--muted); font-style: normal; font-size: 12px; margin-left: 4px; }
.role-chip.is-active,
.role-chip:hover {
    border-color: var(--accent);
    background: rgba(214, 59, 44, .08);
    color: var(--accent);
}

.toast-mask {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(21, 24, 32, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.toast-mask[hidden] { display: none !important; }
.toast-box {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 28px 24px 22px;
    text-align: center;
}
.toast-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}
.toast-icon.ok { background: var(--ok); }
.toast-icon.err { background: var(--danger); }
.toast-box h3 {
    margin: 0 0 8px;
    font-family: var(--display);
    font-size: 28px;
    font-weight: 400;
}
.toast-box p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    word-break: break-all;
}
.toast-box .btn-primary { width: 100%; }

@media (min-width: 1200px) {
    :root { --pad: 40px; }
    .item-list { max-height: 320px; }
}

@media (max-width: 980px) {
    .ops-grid,
    .ops-grid-2 { grid-template-columns: 1fr; }
    .nav-links { display: none; }
}

@media (max-width: 720px) {
    :root { --pad: 14px; --radius: 14px; --control-h: 46px; }
    .site-nav { padding: 12px var(--pad); gap: 10px; }
    .brand span { font-size: 18px; }
    .nav-cta { padding: 8px 12px; font-size: 13px; }
    .hero { padding: 28px var(--pad) 22px; }
    .hero h1 { font-size: 30px; }
    .wrap { padding: 14px var(--pad) 28px; gap: 12px; }
    .panel { padding: 16px; }
    .panel-head h2 { font-size: 24px; }
    .base-fields label { flex: 1 1 100%; min-width: 0; }
    .base-fields #btnVerify { width: 100%; }
    .item-toolbar { flex-direction: column; align-items: stretch; }
    .item-toolbar .item-pagesize { width: 100%; flex-basis: auto; }
    .item-list { min-height: 140px; max-height: 220px; }
    .item-jump { width: 100%; }
    .site-foot { padding: 22px var(--pad) 28px; }
}
