/* PKHeX Web —— 参考 PKHeX 桌面版的结构：紧凑工具栏 + 箱子网格 + 独立编辑页 */
:root {
    --bg: #eef1f5;
    --panel: #ffffff;
    --panel2: #f7f9fb;
    --line: #ccd2da;
    --line2: #dde2e9;
    --text: #1d2129;
    --text2: #55606f;
    --text3: #8b95a3;
    --accent: #0a64c8;
    --accent2: #e8f2fd;
    --ok: #1c8a4b;
    --okbg: #e7f6ec;
    --bad: #c62b2b;
    --badbg: #fdeaea;
    --warn: #96650a;
    --warnbg: #fdf5e3;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #dae4f1 0%, #e5ecf6 50%, #edf2f8 100%);
    color: var(--text);
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    font-size: 12.5px;
    -webkit-font-smoothing: antialiased;
}

h1:focus { outline: none; }
#app { height: 100%; }

/* ---------- 启动 ---------- */
.boot { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.boot-ball {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(#d93a34 0 46%, #2b3140 46% 54%, #fff 54%);
    border: 2px solid #2b3140; box-shadow: inset 0 0 0 2px #fff;
    animation: bob 1.1s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }
.boot-text { font-size: 13px; color: var(--text2); }

/* ---------- 框架 ---------- */
.app { display: flex; flex-direction: column; height: 100vh; min-height: 0; }

.topbar {
    display: flex; align-items: center; gap: 10px;
    height: 46px; padding: 0 14px; flex: 0 0 auto;
    background: linear-gradient(180deg, #ffffff 0%, #ecf1f8 100%);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 3px rgba(24, 42, 70, .06);
    position: relative; z-index: 20;
}

.brand { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.brand .ball {
    width: 16px; height: 16px; border-radius: 50%;
    background: linear-gradient(#d93a34 0 46%, #2b3140 46% 54%, #fff 54%);
    border: 1.5px solid #2b3140; box-shadow: inset 0 0 0 1.5px #fff;
}
.brandsub { font-size: 10px; font-weight: 600; color: var(--text3); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; }

.fileinfo {
    display: flex; align-items: center; gap: 8px; min-width: 0;
    padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--line2);
    color: var(--text2);
}
.fileinfo b { color: var(--text); font-weight: 600; }
.fname { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text3); }

.pill { height: 18px; padding: 0 7px; border-radius: 3px; background: #e6ebf2; color: var(--text2); font-size: 10.5px; font-weight: 600; display: inline-flex; align-items: center; }
.pill.warn { background: var(--warnbg); color: var(--warn); }

.spacer { flex: 1 1 auto; }
.topactions { display: flex; align-items: center; gap: 10px; }
.menubtn { display: none; }
.hidden-input { display: none !important; }

/* ---------- 控件 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    height: 28px; padding: 0 12px; border-radius: 6px;
    border: 1px solid #b6bec9;
    background: linear-gradient(#ffffff, #eef1f5);
    color: var(--text); font-size: 12px; font-family: inherit; font-weight: 500;
    cursor: pointer; white-space: nowrap; transition: .14s;
}
.btn:hover { border-color: var(--accent); background: linear-gradient(#ffffff, #e9f3fe); box-shadow: 0 1px 4px rgba(10, 100, 200, .14); }
.btn:active { background: #dce9f8; box-shadow: none; }
.btn:disabled { color: var(--text3); background: #f2f4f7; border-color: var(--line2); cursor: default; box-shadow: none; }
.btn.primary {
    background: linear-gradient(#2f86e0, var(--accent));
    border-color: #0858ad; color: #fff; font-weight: 600;
    box-shadow: 0 1px 3px rgba(10, 100, 200, .25);
}
.btn.primary:hover { background: linear-gradient(#3d93ea, #0b6bd4); box-shadow: 0 2px 8px rgba(10, 100, 200, .3); }
/* 主按钮禁用时也要变灰：.btn.primary 在 .btn:disabled 后面，不加这条它会一直是蓝色的，
   排队弹窗里「你已经在队列里」的确认按钮就会看着像能点 */
.btn.primary:disabled {
    background: #f2f4f7; border-color: var(--line2); color: var(--text3);
    box-shadow: none;
}

input[type="text"], input[type="number"], select {
    height: 26px; padding: 0 7px; width: 100%;
    border: 1px solid #b6bec9; border-radius: 5px;
    background: #fff; color: var(--text); font-size: 12px; font-family: inherit;
    outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent2); }
select { padding-right: 4px; }
input.ro {
    background: #eef1f5; color: var(--text2); cursor: default;
    font-family: ui-monospace, Consolas, monospace; letter-spacing: .04em;
}
input.ro:focus { box-shadow: none; border-color: #b6bec9; }

.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text2); cursor: pointer; user-select: none; }
.chk input { width: 13px; height: 13px; accent-color: var(--accent); cursor: pointer; }

/* ---------- 首屏 ---------- */
/* 背景图整窗铺底，再压一层白色径向遮罩把图淡化成氛围；
   内容用毛玻璃卡片浮上来，避免长内容时把顶部裁掉（用 margin:auto 而不是 center） */
/* 背景图整窗铺底：先模糊成色块（省得轮廓抢字），再压白色径向 + 底部渐变遮罩，
   把图淡化成氛围。内容层抬到遮罩之上，毛玻璃卡片浮起来。 */
.app.hero-mode {
    position: relative;
    background: linear-gradient(180deg, #e9f1fa 0%, #eef4fb 100%);
    isolation: isolate;
}
.app.hero-mode::before {
    content: '';
    position: absolute; inset: -28px; z-index: 0;
    background: url('/bg/landing-hero.webp') center 58% / cover no-repeat;
    filter: blur(6px) saturate(130%);
    opacity: .95;
}
.app.hero-mode::after {
    content: '';
    position: absolute; inset: 0; z-index: 0;
    background:
        radial-gradient(120% 100% at 50% 44%, rgba(255, 255, 255, 0) 52%, rgba(124, 164, 206, .16) 100%),
        radial-gradient(50% 38% at 50% 44%, rgba(255, 255, 255, .70) 0%, rgba(255, 255, 255, 0) 100%),
        linear-gradient(180deg, rgba(255, 255, 255, .52) 0%, rgba(255, 255, 255, .06) 18%, rgba(248, 252, 255, .42) 62%, rgba(245, 250, 255, .95) 100%),
        radial-gradient(112% 82% at 50% 16%, rgba(255, 255, 255, .80) 0%, rgba(238, 246, 255, .82) 46%, rgba(210, 229, 248, .88) 100%);
}
.app.hero-mode > .topbar, .app.hero-mode > .landing { position: relative; z-index: 1; }
.hero-mode .topbar {
    background: rgba(255, 255, 255, .34);
    -webkit-backdrop-filter: blur(18px) saturate(120%);
    backdrop-filter: blur(18px) saturate(120%);
    border-bottom-color: rgba(255, 255, 255, .42);
    box-shadow: 0 1px 14px rgba(20, 60, 110, .04);
}
.landing { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 24px; overflow: auto; }
.hero { width: min(520px, 100%); margin: auto; text-align: center; }
.heroeyebrow {
    font-size: 10.5px; font-weight: 700; letter-spacing: .24em;
    color: #4d7ba8; margin-bottom: 12px;
}
.herotitle {
    margin: 0; font-size: 38px; line-height: 1.16; font-weight: 800;
    letter-spacing: -.02em; color: #0a2f56; text-shadow: 0 1px 0 rgba(255, 255, 255, .9);
}
.herosub { margin: 14px 0 26px; font-size: 12.5px; line-height: 1.9; color: #6b86a2; }
.herosub span { display: block; }

.herocard {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px; border-radius: 15px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(203, 220, 238, .95);
    box-shadow: 0 24px 52px rgba(24, 66, 116, .13), 0 1px 0 #fff inset;
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    backdrop-filter: blur(18px) saturate(130%);
}
.herocard select {
    flex: 1 1 auto; min-width: 0; max-width: 232px;
    height: 40px; font-size: 13px; border-radius: 9px;
    border-color: #c3d2e4; background: #fff;
}
.herocard .btn.primary { height: 40px; padding: 0 26px; font-size: 13.5px; border-radius: 9px; }

/* 首屏两个入口：做成看得出来的胶囊按钮，别让人误以为是备注文字 */
.heroactions { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.herolink {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px 7px 12px; border-radius: 999px;
    border: 1px solid rgba(180, 202, 226, .95);
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 1px 2px rgba(24, 66, 116, .06);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    backdrop-filter: blur(10px) saturate(120%);
    font-family: inherit; font-size: 12.5px; font-weight: 600; color: #2c5680;
    cursor: pointer; transition: color .15s, background .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.herolink svg { width: 14px; height: 14px; flex: 0 0 auto; opacity: .7; }
.herolink:hover {
    color: #fff; background: var(--accent); border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(24, 66, 116, .20);
}
.herolink:hover svg { opacity: .95; }
.herolink:active { transform: translateY(1px); }

/* 首屏反馈引导：Q 群号（点一下复制）+ 作者 B 站外链，一行小字，手机上自动折行 */
.herohelp {
    display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
    margin-top: 13px; font-size: 11.5px; line-height: 1.6; color: #6f8399;
}
.herohelp .qqnum {
    padding: 0 1px; border: 0; border-bottom: 1px dashed currentColor; background: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px; font-weight: 700; letter-spacing: .03em; color: var(--accent);
    cursor: pointer; transition: color .15s, border-color .15s;
}
.herohelp .qqnum:hover { color: #1d4977; border-bottom-style: solid; }
.herohelp .hhsep { color: #a8bccf; }
.herohelp .hhlink {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--accent); font-weight: 600; text-decoration: none;
}
.herohelp .hhlink svg { width: 13px; height: 13px; flex: 0 0 auto; opacity: .75; }
.herohelp .hhlink:hover { text-decoration: underline; }

/* 页脚备案号：内地备案要求展示，链到工信部备案系统。没有配置号码时整行不渲染 */
.icp {
    margin-top: 8px; text-align: center;
    font-size: 11.5px; line-height: 1.6; color: #8b95a3;
}
.icp a { color: inherit; text-decoration: none; }
.icp a:hover { color: var(--accent); text-decoration: underline; }

/* 首屏「常用工具」：卡片式外链（队列页 + 几个配套站点），以后加站点只改 Tools 数组 */
.herotools { margin-top: 24px; text-align: left; }
.hthead {
    display: flex; align-items: center; gap: 9px;
    margin: 0 2px 9px; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #55749a;
}
.hthead::after {
    content: ""; flex: 1 1 auto; height: 1px;
    background: linear-gradient(90deg, rgba(150, 175, 205, .55), rgba(150, 175, 205, 0));
}
.htgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.htcard {
    position: relative; display: flex; align-items: center; gap: 9px;
    padding: 10px 13px 10px 11px; border-radius: 13px; text-decoration: none;
    background: rgba(255, 255, 255, .74);
    border: 1px solid rgba(186, 204, 226, .9);
    box-shadow: 0 2px 8px rgba(24, 66, 116, .05);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    backdrop-filter: blur(10px) saturate(120%);
    transition: transform .14s, box-shadow .16s, border-color .16s, background .16s;
}
.htcard::after {
    content: "↗"; position: absolute; top: 8px; right: 10px;
    font-size: 10px; line-height: 1; color: #9db4ce;
    opacity: 0; transform: translate(-2px, 2px);
    transition: opacity .16s, transform .16s;
}
.htcard:hover {
    background: #fff; border-color: #a8c6e8; transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(24, 66, 116, .14);
}
.htcard:hover::after { opacity: 1; transform: none; }
.htico {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--accent); background: rgba(226, 238, 252, .95);
    box-shadow: inset 0 0 0 1px rgba(190, 214, 240, .9);
    transition: background .16s, color .16s, box-shadow .16s;
}
.htico svg { width: 15px; height: 15px; display: block; }
.htcard:hover .htico { background: var(--accent); color: #fff; box-shadow: none; }
.httext { display: block; min-width: 0; }
.httext b {
    display: block; padding-right: 10px;
    font-size: 12.5px; font-weight: 700; line-height: 1.45; color: #16395f;
}
.httext i {
    display: block; margin-top: 2px;
    font-style: normal; font-size: 11px; line-height: 1.5; color: #7089a4;
}
/* 首页卡片上的「需要身份组」小标：功能还在，但点进去只看到准入说明 */
.htneed {
    display: inline-block; margin-left: 5px; padding: 0 5px;
    font-style: normal; font-size: 9.5px; font-weight: 700; line-height: 15px;
    color: #9a6a12; background: #fdf3dc; border: 1px solid #f0dcae; border-radius: 5px;
    vertical-align: 1px; white-space: nowrap;
}
.htcard.locked { background: rgba(250, 251, 253, .7); border-style: dashed; }
.htcard.locked .htico { color: #9aa7b8; background: #f2f4f7; box-shadow: inset 0 0 0 1px #e3e8ef; }
/* 工具区下面的「主功能指路」一行：交换 / HOME 直传不在这一页，别让用户以为这里就是全部 */
.htnote {
    display: flex; align-items: flex-start; gap: 6px;
    margin: 9px 2px 0; padding: 7px 9px; border-radius: 9px;
    background: rgba(255, 255, 255, .55); border: 1px solid rgba(186, 204, 226, .7);
    font-size: 11px; line-height: 1.6; color: #62799a;
}
.htnote svg { flex: 0 0 auto; width: 13px; height: 13px; margin-top: 2px; color: #8aa6c6; }
.htnote b { color: #35577d; font-weight: 600; }
.htnote a { color: var(--accent); font-weight: 600; text-decoration: none; }
.htnote a:hover { text-decoration: underline; }

/* 初训家提示：紧跟在「用户信息 / 打开存档」那一行下面，所以上间距比原来小 */
.herohint { margin-top: 12px; font-size: 11.5px; line-height: 1.85; color: #6f8399; }
.herohint b { color: #33597f; font-weight: 600; }
.lnote { margin-top: 26px; font-size: 11px; color: #8194a8; }
.dropbox {
    display: block; text-align: center; cursor: pointer;
    border: 1.5px dashed #b6c2d1; border-radius: 5px; background: var(--panel2);
    padding: 26px 16px; transition: .15s;
}
.dropbox:hover, .dropbox.over { border-color: var(--accent); background: var(--accent2); }
.dico { font-size: 26px; }
.dt1 { font-size: 13px; font-weight: 600; margin-top: 8px; }
.dt2 { font-size: 11.5px; color: var(--text3); margin-top: 5px; letter-spacing: .02em; }
.errbox { margin-top: 14px; padding: 9px 11px; border-radius: 4px; background: var(--badbg); color: var(--bad); font-size: 12px; font-weight: 600; text-align: left; }

/* 存档编辑整体收进「打开存档」弹窗：用户大多是机器人用户，首屏不摆拖拽区 */
.opensave { width: 460px; }
.osbody { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.osbody .dropbox { padding: 22px 16px; }
.osver { font-size: 11.5px; color: var(--text3); line-height: 1.7; }
.osnote { font-size: 11px; color: var(--text3); line-height: 1.6; margin-top: -3px; }

/* ---------- 盒子视图 ---------- */
.boxview { flex: 1; min-height: 0; display: grid; grid-template-columns: 172px minmax(0, 1fr); }

.boxlist { border-right: 1px solid var(--line); background: var(--panel); overflow-y: auto; padding: 8px 6px 16px; }
.blabel { font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--text3); padding: 8px 8px 4px; text-transform: uppercase; }
.brow {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; height: 25px; padding: 0 8px; border: 0; border-radius: 3px;
    background: transparent; color: var(--text2); font-size: 12px; font-family: inherit;
    cursor: pointer; text-align: left;
}
.brow:hover { background: #eef3f9; color: var(--text); }
.brow.on { background: var(--accent); color: #fff; font-weight: 600; }
.bnum { font-size: 10.5px; color: var(--text3); font-variant-numeric: tabular-nums; }
.brow.on .bnum { color: rgba(255, 255, 255, .85); }

.gridpane { min-width: 0; overflow: auto; padding: 10px 14px 20px; }
.gridbar { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.gridbar b { font-size: 13px; }
.nav {
    width: 22px; height: 22px; line-height: 1;
    border: 1px solid #b6bec9; border-radius: 3px;
    background: linear-gradient(#fff, #eef1f5); color: var(--text2);
    font-size: 13px; font-family: inherit; cursor: pointer; padding: 0;
}
.nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.nav:disabled { opacity: .45; cursor: default; }
.hint { font-size: 11.5px; color: var(--text3); }
.hint.sep { margin-left: 6px; padding-left: 8px; border-left: 1px solid var(--line2); }

/* 盒区撑满面板剩下的高度，作为尺寸容器：格子用 cqw/cqh 直接读「真正可用的宽高」，
   不用猜顶栏/提示条占多少。 */
.slotfit { flex: 1 1 auto; min-height: 0; container-type: size; }

/* 格子是正方形，边长同时受可用宽、可用高约束，谁先到谁停；从左上角开始排，
   不居中、不拉伸。6 列 5 行的间隙：横 5×9=45、纵 4×9=36。 */
.slots {
    display: grid; gap: 9px; min-height: 0;
    --cell: min(calc((100cqw - 45px) / 6), calc((100cqh - 36px) / 5), 132px);
    grid-template-columns: repeat(6, var(--cell));
    grid-auto-rows: var(--cell);
    justify-content: start; align-content: start;
}
.slots.c6 { grid-template-columns: repeat(6, var(--cell)); }
/* 队伍是 5×5：横向只有 4 个间隙 */
.slots.c5 {
    --cell: min(calc((100cqw - 36px) / 5), calc((100cqh - 36px) / 5), 132px);
    grid-template-columns: repeat(5, var(--cell));
}

.slot {
    position: relative; width: 100%; height: auto; aspect-ratio: 1 / 1; min-height: 0; padding: 0;
    border: 1px solid var(--line2); border-radius: 10px; background: rgba(255, 255, 255, .92);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: .12s; overflow: hidden;
    box-shadow: 0 1px 2px rgba(30, 50, 80, .05);
}
.slot:hover { border-color: var(--accent); background: var(--accent2); box-shadow: 0 4px 12px rgba(10, 100, 200, .18); transform: translateY(-1px); }
.slot.empty { border-style: dashed; border-color: rgba(150, 172, 198, .3); background: rgba(255, 255, 255, .62); }
.slot.empty:hover { background: var(--accent2); }
.slot .plus { color: #c2cbd8; font-size: 18px; font-weight: 300; }
.slot.empty:hover .plus { color: var(--accent); }
.slot img { width: 86%; height: 86%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.slot .lv {
    position: absolute; right: 3px; bottom: 2px;
    font-size: 9.5px; font-weight: 700; color: var(--text2);
    background: rgba(255, 255, 255, .92); border-radius: 2px; padding: 0 2px;
    font-variant-numeric: tabular-nums;
}
.slot .star { position: absolute; left: 3px; top: 2px; font-size: 9px; color: #d99a12; }
.slot img.starimg { position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; object-fit: contain; pointer-events: none; }
.railname img.shinytagimg { width: 13px; height: 13px; vertical-align: -2px; }

/* 格子右上角：合法性（只在非法时出现）/ 头目 / 超极巨 / 太晶 */
.slot .marks {
    position: absolute; right: 2px; top: 2px; z-index: 2;
    display: flex; align-items: center; gap: 2px; pointer-events: none;
}
.mk {
    width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    font-size: 8.5px; font-weight: 800; line-height: 1; color: #fff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .95);
    pointer-events: none;
}
.mk.bad { background: #e0453b; }
/* 机器人盒子：直传不了 HOME（变灰 + ⊘，布局不变） */
.mk.nohome { background: #6b7686; }
/* 父级 .marks / .mk 都是 pointer-events:none，这里要单独放开，
   否则鼠标扫到 ⊘ 上命中不了元素，title 提示永远不弹 */
.mk.nohome { pointer-events: auto; cursor: help; }
.slot.nohome { background: #f6f7f9; }
.slot.nohome img.home { filter: grayscale(1); opacity: .38; }

.slot img.mk { object-fit: contain; }
.slot img.mk.pic { width: 14px; height: 14px; }
.artmarks img.mk.pic { width: 19px; height: 19px; }
.slot img.mk.tera { width: 13px; height: 13px; }
.artmarks img.mk.tera { width: 17px; height: 17px; }
.slot img.mk.tera,
.artmarks img.mk.tera {
    background: #fff; padding: 1px; object-fit: contain; border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(120, 140, 170, .45);
}

/* 格子右下角：携带道具（要压过 .slot img 的 68px 尺寸） */
.slot img.itemhold {
    position: absolute; right: 2px; bottom: 2px; z-index: 2;
    width: 17px; height: 17px; object-fit: contain; pointer-events: none;
    filter: drop-shadow(0 1px 1px rgba(20, 40, 70, .25));
}

/* 编辑页大图上的同类标记 */
.artmarks { position: absolute; right: 6px; top: 6px; z-index: 2; display: flex; gap: 3px; }
.artmarks .mk { width: 17px; height: 17px; font-size: 10.5px; }
.artcard span.artitem {
    position: absolute; right: 6px; bottom: 6px; z-index: 2;
    width: 30px; height: 30px; border-radius: 8px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 1px 4px rgba(20, 40, 70, .18);
    display: flex; align-items: center; justify-content: center;
}
.artcard span.artitem img { width: 24px; height: 24px; object-fit: contain; }



/* 箱子格选中 + 右键式操作浮层 */
.slot.cur { border-color: var(--accent); background: var(--accent2); box-shadow: 0 0 0 2px var(--accent) inset; }
.slotmenu-mask { position: fixed; inset: 0; z-index: 400; }
.slotmenu {
    position: fixed; z-index: 410; min-width: 150px;
    background: #fff; border: 1px solid var(--line); border-radius: 9px;
    box-shadow: 0 12px 32px rgba(15, 30, 55, .22); padding: 10px;
    display: flex; flex-direction: column; gap: 6px;
}
.slotmenu-title { font-size: 12px; color: var(--text2); margin-bottom: 2px; }
.slotmenu .btn { width: 100%; }
.btn.danger { border-color: #e2b3b3; color: #d33; }
.btn.danger:hover { background: #fdecec; border-color: #d33; }

/* ---------- 编辑视图（左标签 / 中字段 / 右箱子） ---------- */
/* 编辑界面底纹：按版本铺一层「封面神兽」水印 + 主色柔光（--editart / --edittint / --editglow1|2 由 EditView 内联给） */
.editwrap {
    flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; overflow: hidden;
    /* 整页底色跟着本作封面神的主色走：朱是暖红、紫是紫罗兰、剑是冰蓝、盾是品红… */
    background:
        radial-gradient(86% 68% at 82% 4%, rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, 0) 62%),
        linear-gradient(165deg,
            color-mix(in srgb, var(--edittint, #7ea6cf) 6%, #f8fbff) 0%,
            color-mix(in srgb, var(--edittint, #7ea6cf) 11%, #eef5fd) 46%,
            color-mix(in srgb, var(--edittint, #7ea6cf) 19%, #dfecfa) 100%);
    box-shadow: inset 0 0 130px color-mix(in srgb, var(--edittint, #1c4270) 13%, transparent);
}
/* 版本氛围：两只封面宝可梦一左一右，完整立在面板后面，相向而立。
   故意放在面板下层、透明度压得很低，只作为「玻璃后面隐约有个影子」的底纹。 */
.edart {
    position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
    /* 每只神兽脚下一团自己颜色的柔光，红配红、紫配紫，立绘不再是灰影子 */
    background:
        radial-gradient(42% 38% at 26% 82%, color-mix(in srgb, var(--editglow1, #9db4cd) 25%, transparent) 0%, transparent 72%),
        radial-gradient(42% 38% at 74% 82%, color-mix(in srgb, var(--editglow2, #9db4cd) 25%, transparent) 0%, transparent 72%);
}
.edart span {
    position: absolute; bottom: -6%;
    width: var(--artw, 40%); aspect-ratio: 1 / 1;
    background-position: center bottom; background-size: 100% 100%; background-repeat: no-repeat;
    /* 每只立绘的缩放/位移由 EditView 算好后内联给（按可见区域统一高度与脚底基线） */
    transform-origin: center bottom;
    opacity: .3;
    /* 只压一点饱和：保留神兽本来的颜色倾向，又不会把格子染花 */
    filter: saturate(.88) brightness(1.015) contrast(1.01);
}
.edart span:first-child { left: 7%; }
.edart span:last-child { right: 7%; }
/* 单只版本居中：用负 margin 而不是 transform，避免和上面的缩放打架 */
.edart span:only-child {
    left: 50%; right: auto;
    margin-left: calc(var(--artw, 40%) / -2);
}
.editwrap::after {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    /* 最外层是底部「雾气」：把立在画面下沿的立绘收进背景里，不会看到被硬切的半截身子 */
    background:
        linear-gradient(180deg, rgba(243, 249, 255, 0) 84%, rgba(243, 249, 255, .34) 94%, rgba(241, 248, 255, .66) 100%),
        radial-gradient(70% 58% at 8% -8%, color-mix(in srgb, var(--edittint, #7ea6cf) 16%, transparent) 0%, transparent 60%),
        radial-gradient(58% 46% at 96% 0%, color-mix(in srgb, var(--editglow2, #7ea6cf) 12%, transparent) 0%, transparent 60%);
    opacity: 1;
}
/* 主题色跟着版本走：标题下划线、选中格子、主按钮都用它 */
.ed3 { position: relative; z-index: 1; }
.editwrap .colhead::after { background: var(--edittint, var(--accent)); }
.editwrap.over::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 30;
    border: 2px dashed var(--accent); border-radius: 6px;
    background: rgba(232, 242, 253, .45);
}
.editempty { margin: auto; color: var(--text3); }

/* 三栏都做成浮在氛围底上的玻璃面板：面板之间的缝隙能透出版本主色与封面神兽 */
.ed3 {
    flex: 1; min-height: 0; display: grid; gap: 12px; padding: 12px;
    grid-template-columns: 208px 396px minmax(0, 1fr);
}
.rail, .colfields, .boxpanel {
    /* 玻璃面板：白色渐变 + 一层很淡的本作主色，既不死白，也还能透出后面的立绘 */
    background-color: transparent;
    background-image:
        linear-gradient(180deg,
            rgba(255, 255, 255, .74) 0%,
            rgba(255, 255, 255, .58) 44%,
            rgba(255, 255, 255, .64) 100%),
        linear-gradient(180deg,
            color-mix(in srgb, var(--edittint, #cfe0f2) 12%, transparent) 0%,
            color-mix(in srgb, var(--edittint, #cfe0f2) 5%, transparent) 100%);
    border: 1px solid rgba(255, 255, 255, .95);
    border-radius: 16px;
    box-shadow:
        0 18px 44px rgba(20, 60, 110, .12),
        0 1px 0 rgba(255, 255, 255, .9) inset;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* 左轨道 */
.rail {
    padding: 16px 12px 14px;
    display: flex; flex-direction: column; gap: 9px;
    overflow-y: auto; min-height: 0;
}
.artcard {
    position: relative;
    width: 100%; aspect-ratio: 1 / 1; border-radius: 15px;
    background:
        radial-gradient(78% 62% at 50% 30%, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
        linear-gradient(160deg, #f2f7fd 0%, #e4eefb 100%);
    border: 1px solid rgba(255, 255, 255, .95);
    display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 1px 10px rgba(30, 60, 100, .05), 0 10px 24px rgba(30, 60, 100, .09);
}
.artcard img { width: 88%; height: 88%; object-fit: contain; }

.legalbadge {
    position: absolute; left: 5px; top: 5px; z-index: 2;
    width: 27px; height: 27px; padding: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: inherit; font-size: 13px; font-weight: 800; line-height: 1;
    border: 2px solid #fff; cursor: pointer;
    box-shadow: 0 1px 5px rgba(20, 40, 70, .28);
    transition: transform .12s, filter .12s;
}
.legalbadge.ok { background: #2fa84f; color: #fff; }
.legalbadge.bad { background: #e0453b; color: #fff; }
.legalbadge.unk { background: #9aa5b4; color: #fff; }
.legalbadge:hover { transform: scale(1.08); filter: brightness(1.05); }
.legalbadge:active { transform: scale(.96); }

@keyframes badgePop {
    0% { transform: scale(1); }
    45% { transform: scale(1.28); }
    100% { transform: scale(1); }
}
.legalbadge.flash { animation: badgePop .42s ease; }

.railname { text-align: center; font-weight: 700; font-size: 15px; letter-spacing: .01em; margin-top: 5px; }
.shinytag { color: #d99a12; font-size: 12px; margin-left: 1px; }
.railsub { text-align: center; font-size: 11.5px; color: var(--text3); margin-bottom: 6px; }
.railmeta { min-width: 0; }

.railtabs { display: flex; flex-direction: column; gap: 4px; }
.vtab {
    display: flex; align-items: center; gap: 9px;
    height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 9px;
    background: transparent; color: var(--text2); font-size: 12.5px; font-family: inherit;
    cursor: pointer; text-align: left; transition: .12s; position: relative;
}
.vtab i { font-style: normal; width: 15px; text-align: center; color: var(--text3); font-size: 12px; }
.vtab:hover { background: #eaf2fb; color: var(--text); }
.vtab.on {
    background: #fff; border-color: var(--line); color: var(--accent); font-weight: 700;
    box-shadow: 0 1px 4px rgba(30, 60, 100, .07);
}
.vtab.on i { color: var(--accent); }
.vtab.on::before {
    content: ""; position: absolute; left: -11px; top: 7px; bottom: 7px; width: 3px;
    border-radius: 0 2px 2px 0; background: var(--accent);
}

.railstatus { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line2); text-align: center; }
.legal {
    padding: 6px 8px; border-radius: 7px; font-size: 11.5px; font-weight: 700;
    cursor: pointer; user-select: none;
}
.legal:hover { filter: brightness(.97); }
.legal.ok { background: var(--okbg); color: var(--ok); }
.legal.bad { background: var(--badbg); color: var(--bad); }
.legal.unk { background: #e9edf3; color: var(--text2); }
.minibtn {
    border: 1px solid currentColor; border-radius: 3px; background: transparent;
    color: inherit; font-size: 10.5px; font-family: inherit; cursor: pointer; padding: 0 5px; height: 18px;
}
.linkbtn {
    margin-top: 6px; border: 0; background: none; padding: 0;
    color: var(--accent); font-size: 11.5px; font-family: inherit; cursor: pointer;
}
.linkbtn:hover { text-decoration: underline; }

/* 中列字段 */
.colfields { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.colfields .colhead, .colfields .colbody { position: relative; z-index: 1; }
.colhead {
    height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 20px;
    font-size: 13.5px; font-weight: 700; color: var(--text); letter-spacing: .01em;
    border-bottom: 1px solid var(--line2);
    background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .5));
    border-radius: 16px 16px 0 0;
    position: relative;
}
.colhead::after {
    content: ""; position: absolute; left: 20px; bottom: -1px; width: 62px; height: 2px;
    background: var(--accent); border-radius: 2px 2px 0 0;
}
/* 主界面这栏没有标题，标题下的小蓝条也就没意义：只留版本小标 + 右侧按钮，像一条工具条 */
.colhead.nolabel::after { display: none; }
/* 标题旁的版本小标：一眼看出在改哪一作 */
.colver {
    display: inline-flex; align-items: center; height: 20px; padding: 0 9px;
    border-radius: 999px; border: 1px solid var(--line);
    background: rgba(255, 255, 255, .72);
    font-size: 10.5px; font-weight: 600; letter-spacing: .06em; color: var(--text2);
    white-space: nowrap;
}
.colhead-export { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.colbody { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px 28px; }

.frow { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.frow > label { flex: 0 0 66px; text-align: right; color: var(--text2); font-size: 12.5px; }
/* 编辑区里的控件比全局宽松一档：整栏看起来更舒展，也更好点 */
.colbody input[type="text"], .colbody input[type="number"], .colbody select {
    height: 30px; font-size: 12.5px; border-radius: 7px; padding: 0 9px;
}
.colbody .pidrow { margin-bottom: 14px; }
.colbody .flagrow { margin-top: 18px; padding-top: 16px; }
.fctl { flex: 1 1 auto; min-width: 0; }
.fctl.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* 相遇数据库的「个体」六格：三列两行，格子小到能塞进右侧筛选栏 */
.fctl.ivfilter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.fctl.ivfilter input {
    width: 100%; min-width: 0; box-sizing: border-box;
    padding: 4px 4px; text-align: center;
    font-size: 12px; border: 1px solid var(--line); border-radius: 4px;
    background: var(--panel); color: var(--text);
}
.fctl.ivfilter input::placeholder { color: var(--text3); }
.fctl.ivfilter input:focus { outline: none; border-color: var(--accent); }
.rovalue { height: 24px; line-height: 24px; color: var(--text2); font-size: 12px; }
.flagrow { display: flex; gap: 18px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line2); }
.note { margin-top: 14px; font-size: 11.5px; color: var(--text3); line-height: 1.7; }
.mono { margin-top: 16px; font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--text3); }

/* 右列箱子 */
.boxpanel { min-width: 0; display: flex; flex-direction: column; padding: 14px 16px 10px; overflow: hidden; }
/* 盒子面板顶部的相遇数据库引导提示 */
.enctip {
    background: linear-gradient(#fffdf4, #fff5d9);
    border: 1px solid #f0d693; border-radius: 8px;
    padding: 7px 9px; margin-bottom: 9px;
}
.enctip .et1 {
    display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
    font-size: 12px; font-weight: 600; color: #8a6410;
}
.enctip .etico { font-size: 13px; line-height: 1; }
.enctip .etbtn {
    margin-left: auto; flex: 0 0 auto;
    height: 23px; padding: 0 9px; border-radius: 6px;
    border: 1px solid #e6bb55; background: #ffe9a6; color: #7c5a0d;
    font-size: 11.5px; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.enctip .etbtn:hover { background: #ffdc84; border-color: #d9a93c; }

.boxtabs { display: flex; align-items: center; gap: 6px 6px; margin-bottom: 10px; flex-wrap: wrap; }
/* 盒子 / 队伍 / 机器人盒子 三个标签里，只有当前所在的那一个有深色高亮 */
.btab {
    height: 27px; padding: 0 16px; border: 1px solid var(--line); border-radius: 7px;
    background: #fff; color: var(--text2); font-size: 12px; font-family: inherit; cursor: pointer;
}
.btab:hover { border-color: var(--accent); color: var(--accent); }
.btab.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btab.bot:not(.on) { color: var(--accent); border-color: #b9d4f0; background: var(--accent2); }
.btab.bot:not(.on):hover { border-color: var(--accent); background: #d9eafb; }
.btab.on:hover { color: #fff; }
/* 导出 / 导入按钮组：位置不够时整体换到下一行，不会把标签挤变形 */
.boxacts { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }

.boxbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; max-width: 520px; }
.boxname {
    flex: 1 1 auto; text-align: center; height: 26px; line-height: 24px;
    background: #fff; border: 1px solid var(--line); border-radius: 6px;
    font-size: 12.5px; font-weight: 600;
}
.boxcount { font-size: 11px; color: var(--text3); font-variant-numeric: tabular-nums; }

.boxpanel .slots { min-height: 0; }
.slot.cur { border-color: var(--accent); background: var(--accent2); box-shadow: 0 0 0 1px var(--accent) inset; }
.boxhint { margin-top: 8px; text-align: center; font-size: 11px; color: var(--text3); }
/* 悬停不能被传的那格时，把原因直接显示在这里（原生 title 要等 1 秒） */
.boxhint .whynot {
    margin: 5px auto 0; max-width: 520px; text-align: left;
    font-size: 11px; line-height: 1.55; color: #55606f;
    background: #f2f4f7; border: 1px solid #e2e6ec; border-radius: 5px;
    padding: 5px 8px;
}
/* 盒子最底下：清空本箱 / 清空全部。做得低调一点，免得跟「整箱排队」抢注意力 */
.boxfoot {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
    gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line2);
}
.boxfoot .minibtn.danger { font-size: 11.5px; height: 25px; padding: 0 12px; }

/* ---- 直传 HOME 模式 ---- */
/* 收起左右两栏，盒子独占整屏：这一页只用来挑盒子、直传，不做详细编辑 */
.ed3.direct { grid-template-columns: minmax(0, 1fr); }
.ed3.direct > .rail, .ed3.direct > .colfields { display: none; }
/* 全宽的时候格子不放大就会在右边空出一大片：面板限宽居中，格子跟着放大到 160 */
.ed3.direct .boxpanel { width: 100%; max-width: 1060px; margin: 0 auto; }
.ed3.direct .slots {
    --cell: min(calc((100cqw - 45px) / 6), calc((100cqh - 36px) / 5), 160px);
}
.ed3.direct .slots.c5 {
    --cell: min(calc((100cqw - 36px) / 5), calc((100cqh - 36px) / 5), 170px);
}
/* 直传这一页不捏精灵，也不看队伍：相遇数据库引导条和「盒子 / 队伍」标签都收起来 */
.ed3.direct .enctip { display: none; }
.ed3.direct .btab:not(.bot) { display: none; }

/* 开关：胶囊 + 滑块，比原来那个「可传HOME」按钮更像一个状态 */
.hswitch {
    display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 9px 0 7px;
    border: 1px solid var(--line); border-radius: 999px; background: #fff;
    font-family: inherit; font-size: 11.5px; color: var(--text2); cursor: pointer; white-space: nowrap;
    transition: .16s;
}
.hswitch:hover { border-color: var(--accent); }
.hswitch .hstrack {
    position: relative; width: 26px; height: 15px; border-radius: 999px;
    background: #d5dde6; transition: .16s;
}
.hswitch .hsknob {
    position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(20, 30, 50, .28); transition: .16s;
}
.hswitch.on { color: var(--accent); border-color: #b9d4f0; background: var(--accent2); font-weight: 600; }
.hswitch.on .hstrack { background: var(--accent); }
.hswitch.on .hsknob { left: 13px; }

/* 直传 / 跨版本模式里的「退出」：只是个出口，别做成显眼按钮 */
.hexit {
    display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
    border: 1px dashed var(--line2); border-radius: 999px; background: transparent;
    font-family: inherit; font-size: 11.5px; color: var(--text3); cursor: pointer; white-space: nowrap;
    transition: .16s;
}
.hexit:hover { color: var(--accent); border-color: #b9d4f0; background: var(--accent2); }

/* 版本下拉 + 开关：窄屏时整组一起换行，不会各掉一行 */
.hgroup { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }

/* 版本下拉：机器人盒子按版本分开存，这里挑要看哪一份 */
.verpick {
    height: 26px; max-width: 118px; padding: 0 4px;
    border: 1px solid var(--line); border-radius: 6px; background: #fff;
    font-family: inherit; font-size: 11.5px; color: var(--text2);
}
.verpick:hover { border-color: var(--accent); }

/* 「全部版本」：不显示某一箱，改成各版本汇总 */
.allver {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    display: flex; flex-direction: column; gap: 5px;
}
.avhead, .avrow {
    display: grid; grid-template-columns: 20px 1fr repeat(3, 74px);
    align-items: center; gap: 10px; padding: 0 13px;
}
.avhead { height: 26px; font-size: 10.5px; letter-spacing: .04em; color: var(--text3); }
.avhead .avnum, .avrow .avnum { text-align: right; }
/* 全版本直传的勾选列：默认全勾，勾掉的版本整行淡下去 */
.avpick { display: flex; align-items: center; justify-content: center; }
.avpick input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.avpick input:disabled { cursor: default; opacity: .35; }
.avrow.unpicked { opacity: .5; background: transparent; border-style: dashed; }
.avrow {
    height: 38px; border: 1px solid var(--line); border-radius: 8px;
    background: rgba(255, 255, 255, .72);
}
.avrow.empty { opacity: .55; }
.avname { font-size: 12.5px; font-weight: 600; color: var(--text); }
.avempty { margin-left: 8px; font-style: normal; font-weight: 400; font-size: 11px; color: var(--text3); }
.avnum { font-size: 12.5px; color: var(--text2); font-variant-numeric: tabular-nums; }
.avnum.ok { color: var(--accent); font-weight: 600; }
.avnum.zero { color: var(--text3); }
.avnum.skip { color: var(--warn); }
/* 逐只校验合法性的进度：几千只时要算一会儿，得让用户看见它在动 */
.avprog { display: flex; align-items: center; gap: 8px; padding: 2px 2px 6px; font-size: 11px; color: var(--text3); }
.avptrack { flex: 0 0 108px; height: 5px; border-radius: 999px; background: #e6ecf3; overflow: hidden; }
.avptrack i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .2s; }
.avsum { margin-top: 4px; font-size: 11.5px; line-height: 1.7; color: var(--text2); }
.avhint { padding: 10px 2px; font-size: 12px; color: var(--text3); }
.avhint.bad { color: var(--bad); }

/* 「全部版本 · 直传 HOME」确认弹窗：复用 .allver 的表格样式，只是装在 modal 里 */
.modal.homeall { width: 520px; max-width: calc(100vw - 32px); max-height: 84vh; }
.modal.homeall .qbody { flex: 1 1 auto; min-height: 0; gap: 5px; padding: 10px 14px; }
.modal.homeall .avhead, .modal.homeall .avrow { padding: 0 10px; }
.modal.homeall .avhint { padding: 4px 2px; font-size: 11.5px; }

/* 直传方向的按钮给一点蓝，和普通排队区分开 */
.minibtn.home { color: var(--accent); border-color: #b9d4f0; background: var(--accent2); }
.minibtn.home:hover { background: #dcebfa; }

/* 底部条 / 浮层 */
.editfoot {
    flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
    /* 底栏现在只剩一行状态字（写入/排队按钮都挪走了），收窄到 34px，把高度让给盒子。
       z-index 必须抬起来：.editwrap::after 的底部薄雾是「最后一个子元素」，会盖在这条上面把文字洗白 */
    position: relative; z-index: 1;
    height: 34px; padding: 0 16px;
    background: linear-gradient(#fbfcfd, #f1f4f8);
    border-top: 1px solid var(--line);
}
.footnote { font-size: 11.5px; color: var(--text3); }
.footnote.bad { color: var(--bad); font-weight: 600; }
/* 自动保存成功：给一点绿，和「尚未改动」的灰区分开；颜色不抢眼，免得每次改都跳 */
.footnote.saved { color: var(--ok); }
/* 底栏里的小文字按钮（「看是哪几只」），比按钮轻，和旁边的状态字同一行 */
.footlink {
    flex: 0 0 auto; padding: 0; border: 0; background: none; cursor: pointer;
    font: inherit; font-size: 11.5px; color: var(--accent); text-decoration: underline;
    text-underline-offset: 2px;
}
.footlink:hover { color: var(--accent-dark, #084f9e); }
.foothint { font-size: 11px; color: var(--text3); opacity: .8; white-space: nowrap; }

.confirm {
    position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%);
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: #fff; border: 1px solid var(--line);
    border-radius: 9px; box-shadow: 0 10px 28px rgba(20, 40, 70, .18);
    font-size: 12.5px; z-index: 90;
}

/* 合法性报告：视野正中的小窗（原来是从底部抽 42% 高的一条，手机上正文挤成一条缝） */
.reportmodal { width: 520px; max-height: 78vh; }
.reportmodal .lreport { flex: 1 1 auto; min-height: 0; }
.reportmodal .modalfoot { padding: 8px 12px; }
.reportmodal .modalfoot .linkbtn { margin: 0; }
.pill.ok { background: var(--okbg); color: var(--ok); }
.pill.bad { background: var(--badbg); color: var(--bad); }
.reportstale { padding: 6px 14px; font-size: 11.5px; color: var(--warn); background: var(--warnbg); border-bottom: 1px solid #f0e2bd; }
.lreport {
    margin: 0; padding: 10px 14px; overflow: auto;
    font-family: ui-monospace, Consolas, monospace; font-size: 11px; line-height: 1.7;
    white-space: pre-wrap; color: var(--text2);
}

/* 垃圾字节修不了时的说明，跟在报告正文下面 */
.reportnote {
    padding: 8px 14px; border-top: 1px dashed var(--line, #e6e8ee);
    font-size: 11.5px; line-height: 1.7; color: #a3641a;
}

/* 数值表 */
.statgrid {
    display: grid; grid-template-columns: 52px 84px 84px 60px;
    gap: 10px; align-items: center; margin-bottom: 7px;
}
.statgrid.hdr { font-size: 11px; color: var(--text3); margin-bottom: 9px; }
.statgrid.hdr span:not(:first-child) { text-align: center; }
.statgrid .k { font-size: 12px; color: var(--text2); font-weight: 600; }
.statgrid .out { text-align: right; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.statgrid input[type="number"] { text-align: center; }
/* 努力值步进控件 */
.evctl { display: flex; align-items: center; gap: 3px; min-width: 0; }
.evctl input[type="number"] { width: 100%; min-width: 0; padding: 0 1px; }
.evbtn {
    flex: 0 0 auto; width: 17px; height: 22px; padding: 0; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line2); border-radius: 4px; background: #f6f8fb;
    color: var(--text2); font-size: 12px; font-family: inherit; cursor: pointer;
    transition: .1s;
}
.evbtn:hover { border-color: var(--accent); color: var(--accent); background: #ecf4fd; }
.evbtn:active { background: #dce9f8; }
/* 能力值：性格/薄荷提升标红、降低标蓝 */
.statgrid .out.up { color: #d33b3b; }
.statgrid .out.down { color: #1a6fd4; }
/* 太晶属性图标选择 */
/* 太晶属性下拉（图片 + 文字） */
.ts { position: relative; }
.ts-trigger {
    width: 100%; display: flex; align-items: center; gap: 6px;
    height: 26px; padding: 0 7px; border: 1px solid #b6bec9; border-radius: 4px;
    background: #fff; color: var(--text); font-size: 12px; font-family: inherit; cursor: pointer;
}
.ts-trigger:hover { border-color: var(--accent); }
.ts-ico { width: 20px; height: 20px; flex: 0 0 auto; object-fit: contain; }
.ts-trigger .ts-ico { width: 17px; height: 17px; }
.ts-trigger .ts-txt { flex: 1 1 auto; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-caret { color: var(--text3); font-size: 10px; flex: 0 0 auto; }
.ts-list {
    position: absolute; z-index: 60; left: 0; right: 0; top: 30px;
    max-height: 240px; overflow-y: auto; padding: 3px;
    background: #fff; border: 1px solid #b6bec9; border-radius: 4px;
    box-shadow: 0 6px 18px rgba(20, 30, 50, .12);
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.ts-item { display: flex; gap: 7px; align-items: center; padding: 4px 6px; border-radius: 3px; cursor: pointer; font-size: 12px; }
.ts-item:hover { background: var(--accent2); }
.ts-item.ts-sel { background: var(--accent); color: #fff; }
.ts-item .ts-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evtotal { margin-top: 10px; font-size: 11.5px; color: var(--text3); }
.evtotal.bad { color: var(--bad); font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chip {
    height: 21px; padding: 0 8px; border-radius: 4px;
    border: 1px solid #bfc7d2; background: #fff;
    color: var(--text2); font-size: 11px; font-family: inherit; cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }


/* 新增：行内组合、PP Ups、小节标题、缎带网格 */
.fctl.inline { display: flex; align-items: center; gap: 6px; }
.fctl.inline > .ss,
.fctl.inline > input[type="text"] { flex: 1 1 auto; min-width: 0; }
.fctl.inline > .chk,
.fctl.inline > .minibtn,
.fctl.inline > .hintx,
.fctl.inline > .ppups { flex: 0 0 auto; white-space: nowrap; }
.hintx { font-size: 11px; color: var(--text3); white-space: nowrap; }
.ppups { width: 52px !important; flex: 0 0 52px; text-align: center; }

.subhead {
    margin: 16px 0 8px; padding: 12px 0 6px; border-top: 1px solid var(--line2);
    font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--accent);
    display: flex; align-items: center; gap: 7px;
}
.subhead::before {
    content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--accent);
}
.checkgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; }

/* 极限特训：版本要求的等级 / 等级不够时的说明 */
.subhead .subnote {
    margin-left: 2px; padding: 1px 6px; border-radius: 999px;
    background: var(--line2); color: var(--text2);
    font-size: 10px; font-weight: 600; letter-spacing: 0;
}
.htwarn {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    margin: 0 0 8px; padding: 7px 9px; border-radius: 8px;
    background: color-mix(in srgb, var(--warn) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--warn) 38%, transparent);
    color: var(--text2); font-size: 11.5px; line-height: 1.5;
}
.htwarn b { color: var(--warn); }
.chk.off { opacity: .45; cursor: not-allowed; }
.chk.off input { cursor: not-allowed; }
.statgrid.c2 { grid-template-columns: 52px 84px; }
.ribbongrid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; }
.chk.rib {
    font-size: 11.5px; line-height: 1.45; align-items: center; gap: 6px;
    padding: 2px 6px 2px 2px; border-radius: 6px; transition: background .12s;
}
.chk.rib:hover { background: var(--accent2); }
.chk.rib img.medal {
    width: 20px; height: 20px; object-fit: contain; flex: 0 0 auto;
    background: #f3f6fa; border-radius: 50%; padding: 1px;
}
.chk.rib input { margin-top: 2px; flex: 0 0 auto; }

/* 奖章页顶部的一键按钮：左边按钮、右边一句说明，窄屏自动换行 */
.ribbonbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 0 0 12px; padding: 10px 12px;
    background: var(--accent2); border: 1px solid var(--line); border-radius: 8px;
}
.ribbonbar .qdetail { flex: 1 1 220px; margin: 0; }


/* 单只编辑 / 图标按钮 / 数值四列 */
.boxpanel.standalone { align-items: center; justify-content: center; }
.standinfo { max-width: 250px; text-align: center; }
.sic { font-size: 28px; }
.sit { font-weight: 700; margin-top: 8px; font-size: 13.5px; color: var(--text); }
.sid { font-size: 11.5px; color: var(--text3); line-height: 1.85; margin-top: 8px; }
.sid2 { margin-top: 10px; font-size: 11px; color: var(--text3); }

.pidrow { display: flex; align-items: center; gap: 6px; margin-bottom: 11px; }
.pklabel { font-size: 12px; color: var(--text2); }
.pidrow input.hex { flex: 1 1 auto; font-family: ui-monospace, Consolas, monospace; letter-spacing: .05em; }
.iconbtn {
    width: 26px; height: 24px; flex: 0 0 auto;
    border: 1px solid #b6bec9; border-radius: 4px; background: #fff;
    cursor: pointer; font-size: 12px; line-height: 1; color: var(--text2); padding: 0;
}
.iconbtn:hover { border-color: var(--accent); color: var(--accent); }
.iconbtn.star.on { color: #d99a12; border-color: #e8c06a; background: #fff8e6; }
.iconbtn.star.busy { color: #b8860b; border-color: #e8c06a; background: #fff8e6; animation: starpulse .9s ease-in-out infinite; }
@keyframes starpulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
/* 变闪按来源处理时的一句说明：走哪条路 / 为什么没改成 / 个体有没有被重掷 */
.shinynote {
    margin: -4px 0 10px;
    padding: 5px 8px;
    font-size: 11.5px; line-height: 1.6;
    color: #8a5a12; background: #fdf6e6; border: 1px solid #f0dcae; border-radius: 5px;
}
.iconbtn.gender.m { color: #2f6fed; border-color: #bcd2f7; background: #eef4ff; }
.iconbtn.gender.f { color: #e0559b; border-color: #f7c6dd; background: #fff0f6; }
.iconbtn.gender.n { color: var(--text3); }
/* 「语言 / 字体显示不了这个名字」的警告按钮：只在出问题时出现，琥珀色比红更不刺眼 */
.iconbtn.namewarn {
    flex: 0 0 auto;
    width: 26px; height: 24px; border-radius: 50%;
    font-size: 12px; font-weight: 700; color: #96650a;
    border-color: #e8c98a; background: #fdf5e3;
}
.iconbtn.namewarn:hover { border-color: #d3a53c; color: #7a5208; }

/* 名字被规则拦下时的说明（去皮去伊之前不能用中文名） */
.namenote {
    margin: -2px 0 6px 46px;
    font-size: 11.5px; line-height: 1.6; color: #a3641a;
}

/* 游戏内显示对照弹窗 */
.namewarndlg { width: 400px; max-width: 92vw; }
.nwbody { padding: 14px 16px 4px; }
.nwlead { margin: 0 0 10px; font-size: 12.5px; line-height: 1.75; color: var(--text2); }
.nwrow { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.nwk { flex: 0 0 46px; text-align: right; font-size: 11.5px; color: var(--text3); }
.nwv {
    flex: 1 1 auto; min-width: 0; word-break: break-all;
    font-family: ui-monospace, Consolas, monospace; font-size: 15px; color: var(--text);
    background: var(--panel2); border: 1px solid var(--line2); border-radius: 6px; padding: 5px 10px;
}
.nwv.game { color: var(--accent); background: #f4f9ff; border-color: #cfe1f8; }
.nwnote { margin: 12px 0 10px; font-size: 11.5px; line-height: 1.7; color: var(--text3); }
.chklabel {
    display: flex; align-items: center; gap: 5px; justify-content: flex-end;
    flex: 0 0 64px; color: var(--text2); font-size: 12px; cursor: pointer;
}

.statgrid.s4 { grid-template-columns: 44px 48px 1fr 1fr 48px; }
.statgrid.s4 .base,
.statgrid.s4 .mid { text-align: center; color: var(--text2); font-variant-numeric: tabular-nums; }
.statgrid.total { border-top: 1px solid var(--line2); padding-top: 7px; margin-top: 3px; }
.statgrid.total .k, .statgrid.total .out { font-weight: 700; }

.movehdr { display: grid; grid-template-columns: 22px 1fr 34px 46px; gap: 8px; font-size: 11px; color: var(--text3); margin-bottom: 8px; }
.movehdr .pp, .movehdr .up { text-align: center; }
.moverow { display: grid; grid-template-columns: 22px 1fr 34px 46px; gap: 8px; align-items: center; margin-bottom: 7px; }
.mvtype {
    width: 20px; height: 20px; object-fit: contain; justify-self: center;
    filter: drop-shadow(0 1px 1px rgba(20, 40, 70, .18)); pointer-events: none;
}
.mvtype.empty { opacity: 0; }
.ppval { text-align: center; font-size: 12px; color: var(--text2); font-variant-numeric: tabular-nums; }
.upval { text-align: center; }

/* 现时招式有问题：整行加红边，并在下面直接写原因（不用点开报告） */
.moverow.bad .ss-input { border-color: var(--bad); }
.moverow.bad { margin-bottom: 2px; }
.movenote {
    margin: 0 0 8px 30px; font-size: 11.5px; line-height: 1.45; color: var(--bad);
}
/* 合法时显示这条招式的来源（招式机 / 回忆 / 升级…），省得用户猜为什么判合法 */
.movesrc {
    margin: -3px 0 7px 30px; font-size: 11px; line-height: 1.4; color: var(--text3);
}

.contestrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.contestcell { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text2); text-align: center; }
.btnrow { display: flex; gap: 8px; margin-top: 14px; }
.eggbox { margin-top: 4px; }


.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.minibtn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 24px; padding: 0 9px; flex: 0 0 auto; white-space: nowrap;
    border: 1px solid #b6bec9; border-radius: 4px; background: #fff;
    color: var(--text2); font-size: 11.5px; font-family: inherit; cursor: pointer;
}
.minibtn:hover { border-color: var(--accent); color: var(--accent); }
.minibtn:disabled { color: var(--text3); background: #f5f7fa; border-color: var(--line2); cursor: default; }
.minibtn:disabled:hover { color: var(--text3); border-color: var(--line2); }

/* 机器人排队：提交给机器人的主操作，做成实心紫底白字，别混在一排描边小按钮里
   （和直传的蓝、跨版本的绿区分开，一眼能看出点的是哪条路） */
.minibtn.queue {
    border-color: transparent; color: #fff; font-weight: 600;
    background: linear-gradient(180deg, #9a72e8, #7b4bd8);
    box-shadow: 0 1px 4px rgba(110, 60, 200, .30);
}
.minibtn.queue:hover {
    border-color: transparent; color: #fff;
    background: linear-gradient(180deg, #a985f2, #6740c4);
}
.minibtn.queue:disabled, .minibtn.queue:disabled:hover {
    color: var(--text3); background: #f5f7fa; border-color: var(--line2);
    box-shadow: none; font-weight: 400;
}

/* 跨版本传输：一排「传到 XX」的目标版本按钮，选中的那个变实心（和直传按钮的蓝区分开，用青绿） */
.crosstip { font-size: 11px; color: #62799a; white-space: nowrap; }
.crosstip.warn { color: #b26a00; }
.minibtn.cross {
    padding: 0 8px; border-radius: 999px;
}
.minibtn.cross.on {
    color: #fff; border-color: transparent; font-weight: 600;
    background: linear-gradient(180deg, #2fa88a, #1d8670);
    box-shadow: 0 1px 4px rgba(20, 120, 100, .28);
}
.minibtn.cross.on:hover { border-color: transparent; color: #fff; background: #1d8670; }

/* 机器人盒子：「只看可传 HOME」开启态 */
.minibtn.homef.on {
    border-color: var(--accent); background: var(--accent2); color: var(--accent); font-weight: 600;
}

/* ---------- 可搜索下拉 ---------- */
.ss { position: relative; }
.ss-input { padding-right: 20px; }
.ss-list {
    position: absolute; z-index: 60; left: 0; right: 0; top: 27px;
    max-height: 230px; overflow-y: auto; padding: 3px;
    background: #fff; border: 1px solid #b6bec9; border-radius: 4px;
    box-shadow: 0 6px 18px rgba(20, 30, 50, .12);
}
.ss-item { display: flex; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 3px; cursor: pointer; font-size: 12px; }
.ss-item:hover { background: var(--accent2); }
.ss-item.ss-sel { background: var(--accent); color: #fff; }
.ss-item.ss-sel .ss-num { color: rgba(255, 255, 255, .8); }
.ss-num { flex: 0 0 30px; text-align: right; font-size: 10.5px; color: var(--text3); font-variant-numeric: tabular-nums; }
.ss-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-empty { padding: 8px; text-align: center; color: var(--text3); font-size: 11.5px; }


/* 弹窗：招式记录器 / 相遇数据库 / 神秘礼物 */
.modal-mask {
    position: fixed; inset: 0; z-index: 500;
    background: rgba(18, 28, 45, .34);
    display: flex; align-items: center; justify-content: center;
}
.modal {
    background: #fff; border-radius: 9px; overflow: hidden;
    box-shadow: 0 18px 50px rgba(10, 20, 40, .3);
    display: flex; flex-direction: column;
}
.trmodal { width: 430px; max-height: 78vh; }
.dbmodal { width: 640px; max-height: 78vh; }
.memmodal { width: 470px; max-height: 84vh; }
.memscroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 14px 4px; }
.botmodal { width: 440px; }
.botmodal.small { width: 340px; }
.botform { padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 11px; }
.botrow { display: flex; align-items: center; gap: 9px; }
.botrow > label { flex: 0 0 76px; text-align: right; font-size: 12px; color: var(--text2); }
.botrow > input, .botrow > select { flex: 1 1 auto; min-width: 0; }
/* 导入盒子时版本固定（跟当前存档一致），只显示不选 */
.binver { flex: 1 1 auto; font-size: 12px; color: var(--text2); }
.boterror { padding: 8px 10px; border-radius: 5px; background: var(--badbg); color: var(--bad); font-size: 12px; line-height: 1.6; }
.bothint { padding: 8px 10px; border-radius: 5px; background: #eef4fd; color: var(--text2); font-size: 12px; line-height: 1.6; }
.bothint b { color: var(--accent); font-weight: 500; }
.bothint { font-size: 11px; color: var(--text3); line-height: 1.7; }

/* 机器人盒子：导入本地 .bin 的拖放区 */
.binzone {
    border: 1.5px dashed #b6c2d1; border-radius: 5px; background: var(--panel2);
    padding: 14px 10px; text-align: center; transition: .15s;
}
.binzone.over { border-color: var(--accent); background: var(--accent2); }
.binzone-main { font-size: 12.5px; font-weight: 600; color: var(--text); }
.binzone-sub { font-size: 11px; color: var(--text3); margin-top: 5px; }
.binpick { color: var(--accent); cursor: pointer; text-decoration: underline; }
.binpick:hover { color: var(--accent2); }

/* 机器人批量盒子：导入前校验结果列表 */
.botissues { display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow-y: auto; padding-right: 2px; }
.botissue {
    display: flex; align-items: baseline; gap: 8px;
    padding: 6px 9px; border-radius: 5px;
    background: var(--badbg); border: 1px solid #f2d5d5;
    font-size: 12px; line-height: 1.55;
}
.botissue-where { flex: 0 0 auto; color: var(--text3); font-variant-numeric: tabular-nums; }
.botissue-sp { flex: 0 0 auto; color: var(--text); font-weight: 500; }
.botissue-why { flex: 1 1 auto; min-width: 0; color: var(--bad); }
.botissue-more { padding: 2px 9px; font-size: 11.5px; color: var(--text3); }

/* 机器人盒子弹窗：一键写入开关 */
.botcheck { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--text2); line-height: 1.6; cursor: pointer; }
.botcheck > input { margin: 2px 0 0; flex: 0 0 auto; }
.botcheck > span { flex: 1 1 auto; min-width: 0; }
.botcheck em { display: block; font-style: normal; font-size: 11px; margin-top: 1px; }
.botcheck em.on { color: var(--ok); }
.botcheck em.off { color: var(--warn); }

.botinfo {
    display: flex; flex-direction: column; gap: 4px;
    font-size: 11.5px; color: var(--text2); line-height: 1.6;
    background: #f4f7fb; border: 1px solid var(--line2); border-radius: 6px; padding: 8px 10px;
}
.botinfo .ik { display: inline-block; width: 60px; color: var(--text3); }
.botinfo code { font-family: ui-monospace, Consolas, monospace; font-size: 11px; word-break: break-all; }
.pill.bot { background: #e6f4ec; color: #1c8a4b; }

/* 登录 / 用户标签 */
.userchip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 28px; padding: 0 11px; border-radius: 999px; border: 0;
    background: #eaf2fb; color: var(--accent); font-size: 12px; font-weight: 600;
    max-width: 180px; cursor: pointer; font-family: inherit; transition: .12s;
}
.userchip:hover { background: #dcebfb; }
.userchip .ucdot { width: 7px; height: 7px; border-radius: 50%; background: #2fa84f; box-shadow: 0 0 0 2px rgba(47,168,79,.2); }
.authmodal { width: 400px; }
.authbody { padding: 12px 14px 6px; display: flex; flex-direction: column; gap: 10px; }
.authtabs { display: flex; gap: 4px; padding: 3px; background: #eef1f5; border-radius: 8px; margin-bottom: 2px; }
.authtab {
    flex: 1 1 0; height: 30px; border: 0; border-radius: 6px; background: transparent;
    color: var(--text2); font-size: 12.5px; font-family: inherit; font-weight: 600; cursor: pointer; transition: .12s;
}
.authtab:hover { color: var(--text); }
.authtab.on { background: #fff; color: var(--accent); box-shadow: 0 1px 4px rgba(20,40,70,.1); }

/* 账号信息 / 绑定 KOOK */
.userdialog { width: 440px; }
.userbody { padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.urow { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.urow .uk { flex: 0 0 56px; color: var(--text3); }
.urow .uv { color: var(--text); font-weight: 600; word-break: break-all; }
.usubhead { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line2); font-size: 11px; font-weight: 700; color: var(--accent); }
.uwrap { display: flex; flex-direction: column; gap: 6px; }
.uhint { font-size: 11.5px; color: var(--text3); line-height: 1.7; }
.ucmd {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; background: #f2f5f9; border: 1px solid var(--line2); border-radius: 6px;
}
.ucmd code { flex: 1 1 auto; font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--text2); word-break: break-all; }
.ukookrow { display: flex; gap: 8px; }
.ukookrow input { flex: 1 1 auto; min-width: 0; }
/* 头像 */
.uavatar { display: flex; align-items: center; gap: 12px; }
.uavatar > img, .uavatar > .ufallback {
    flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%;
    border: 1px solid var(--line2); object-fit: cover; background: #eef2f8;
}
.uavatar > .ufallback {
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700; color: var(--accent);
}
.uavatarmain { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.uavatarbtns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.uinput {
    width: 100%; max-width: 220px; padding: 5px 8px; font-size: 12.5px; font-family: inherit;
    border: 1px solid var(--line2); border-radius: 6px; background: #fff; color: var(--text);
}
.uinput:focus { outline: none; border-color: var(--accent); }
.urow .uv .minibtn { margin-left: 8px; }
/* KOOK 一次性绑定码 */
.ubindbox {
    display: flex; flex-direction: column; gap: 6px; align-items: center;
    padding: 12px 10px; background: #f2f5f9; border: 1px dashed var(--line2); border-radius: 8px;
}
.ubindcode {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 30px; font-weight: 700; letter-spacing: 7px;
    color: var(--accent); line-height: 1.15; text-indent: 7px;
    user-select: all;
}
.ubindrow { display: flex; align-items: center; gap: 10px; }
.umsg { padding: 7px 10px; border-radius: 5px; font-size: 12px; }
.umsg.ok { background: #e7f6ec; color: #1c8a4b; }
.umsg.bad { background: var(--badbg); color: var(--bad); }
.btn.danger { border-color: #e2b3b3; color: #d33; }
.btn.danger:hover { background: #fdecec; border-color: #d33; }

/* 管理员面板 */
.adminmodal { width: 560px; max-height: 86vh; }
.adminbody { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.adminlist { max-height: 40vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.adminrow {
    display: flex; flex-direction: column; gap: 2px;
    padding: 7px 10px; border: 1px solid var(--line2); border-radius: 7px;
    background: #fff; cursor: pointer; transition: .12s;
}
.adminrow:hover { border-color: var(--accent); background: var(--accent2); }
.adminrow.sel { border-color: var(--accent); background: #e8f2fd; box-shadow: 0 0 0 1px var(--accent) inset; }
.adminmain { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.adminmain b { font-weight: 600; }
.adminemail { color: var(--text3); font-size: 11.5px; }
.adminmeta { font-size: 11px; color: var(--text3); display: flex; align-items: center; gap: 6px; }
.invcode { font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; color: var(--accent); }
.pill.adminpill { background: #fff2d9; color: #a86b00; }
.adminedit {
    border-top: 1px solid var(--line2); padding-top: 10px;
    display: flex; flex-direction: column; gap: 8px;
}
.aehead { font-size: 12px; font-weight: 700; color: var(--accent); }
.aerow { display: flex; align-items: center; gap: 8px; }
.aerow-top { align-items: flex-start; }
.aerow-top > label { padding-top: 3px; }

/* 身份组徽标：管理页 / 用户信息里都用来一次列全（一个人可能同时有会员球 + 全图鉴 + BP）
   单行小胶囊，可换行；管理页的每个还可带一个 × 删掉 */
.aroles { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; flex: 1 1 auto; }
.rochip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 999px;
    background: var(--panel2); border: 1px solid var(--line2);
    font-size: 11px; font-weight: 600; color: var(--text2); white-space: nowrap;
}
.rochip.vip { background: #fdf3e3; border-color: #f0d6b0; color: #b45309; }
.roledit {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 4px 2px 8px; border-radius: 999px;
    background: var(--panel2); border: 1px solid var(--line2);
    font-size: 11px; font-weight: 600; color: var(--text2); white-space: nowrap;
}
.rolex {
    width: 15px; height: 15px; padding: 0; border: 0; border-radius: 50%;
    background: #e6ecf4; color: #6b7f95; font: inherit; font-size: 11px; line-height: 1;
    cursor: pointer;
}
.rolex:hover { background: #fde0e0; color: #b91c1c; }
.rolex:disabled { opacity: .5; cursor: default; }
/* 一次性身份组（订单成功后机器人会收回）：只在管理页标一下，网页不回收 */
.roonce {
    padding: 0 4px; border-radius: 999px; font-size: 10px; font-weight: 600;
    background: #fdf3e3; border: 1px solid #f0d6b0; color: #b45309;
}
.uroles { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.uroles .rochip { font-weight: 500; }
.aerow > label { flex: 0 0 66px; font-size: 11.5px; color: var(--text2); }
.aerow > label.ack { flex: 1 1 auto; font-size: 11.5px; color: var(--text2); }
.aerow > input[type="text"] { flex: 1 1 auto; min-width: 0; }
.aerow > input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); }
.modalhead {
    display: flex; align-items: center; justify-content: space-between;
    height: 38px; padding: 0 12px; font-size: 13px;
    background: linear-gradient(#fbfcfd, #f1f4f8); border-bottom: 1px solid var(--line);
}
.modalclose { border: 0; background: none; cursor: pointer; font-size: 13px; color: var(--text2); }
.modalclose:hover { color: var(--accent); }
.trlist { overflow-y: auto; padding: 6px; }
.trnote {
    margin: 0 12px 6px; padding: 6px 8px; border-radius: 6px; font-size: 11.5px; line-height: 1.5;
    color: var(--text2); background: var(--accent2); border: 1px solid var(--line);
}
.trrow {
    display: flex; align-items: center; gap: 8px; padding: 4px 6px;
    border-radius: 4px; font-size: 12px; cursor: pointer;
}
.trrow:hover { background: var(--accent2); }
.trrow.disabled { opacity: .45; }
.trrow input { accent-color: var(--accent); }
.trnum { font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--text3); }
.trname { flex: 1; }
.trtag {
    flex: 0 0 auto; padding: 0 5px; border-radius: 999px; font-size: 10px;
    color: var(--accent); border: 1px solid currentColor; opacity: .8;
}
.trnote.movenote-tr { color: var(--text); background: #fff8e8; border-color: #f0dcae; }
.trhint { margin: 2px 12px 6px; padding: 4px 8px; font-size: 11px; line-height: 1.5; color: var(--text3); }
.trrow img.mvtype { width: 18px; height: 18px; flex: 0 0 auto; object-fit: contain; }

/* 招式店铺（LA）：购买 + 精通 两列 */
.shopmodal { width: 470px; }
.shophead, .shoprow {
    display: grid; grid-template-columns: 20px 30px 1fr 52px 52px;
    gap: 8px; align-items: center; padding: 4px 6px; font-size: 12px;
}
.shophead { color: var(--text3); font-size: 11px; border-bottom: 1px solid var(--line2); padding: 6px; }
.shoprow { border-radius: 4px; cursor: pointer; }
.shoprow:hover { background: var(--accent2); }
.shoprow.disabled { opacity: .45; }
.shidx { font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--text3); }
.shcol, .shopchk { justify-self: center; }
.shopchk { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

.modalfoot {
    display: flex; gap: 8px; align-items: center; padding: 10px 12px;
    border-top: 1px solid var(--line); background: #fafbfd;
}

/* 加入机器人排队 */
.queuebox { width: 430px; max-height: 84vh; }
.qbody { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.qitem { display: flex; align-items: baseline; gap: 8px; }
.qname { font-size: 14px; font-weight: 700; }
.qmeta { font-size: 11.5px; color: var(--text3); }
.qrows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.qrows > div {
    background: #f6f9fd; border: 1px solid var(--line2); border-radius: 7px;
    padding: 7px 9px; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.qrows span { font-size: 11px; color: var(--text3); }
.qrows b { font-size: 13px; }
.qok { color: #1c8a4b; }
.qoff { color: #b26a00; }
.qnote { font-size: 11.5px; color: var(--text2); line-height: 1.7; display: flex; flex-direction: column; gap: 3px; }
/* 排队弹窗里的个人勾选（保留初训家 / ID） */
.qkeep {
    display: flex; flex-direction: column; gap: 3px;
    padding: 8px 10px; border: 1px solid var(--line2); border-radius: 7px; background: var(--panel2);
}
.qkeep label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.qkeep input[type=checkbox] { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; flex: none; }
.qkeep em { font-style: normal; font-size: 11px; color: var(--text3); line-height: 1.6; padding-left: 22px; }
/* 交易密码：8 个数字格（验证码样式）+ 一行说明，和「保留初训家」同一种卡片。
   注意类名不能再用 .qcode —— 队列页用 .qcode 显示 34px 大字密码，
   同名会让这里的标题/说明继承 letter-spacing:8px 和粗体，排版惨不忍睹。 */
.qcodeset {
    display: flex; flex-direction: column; gap: 6px;
    padding: 8px 10px; border: 1px solid var(--line2); border-radius: 7px; background: var(--panel2);
}
.qcodeset-head { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text); }
.qcodeset-head em { font-style: normal; padding: 0 5px; border-radius: 999px; background: var(--accent2); color: var(--accent); font-size: 10.5px; font-weight: 600; }
.qcodeset-tip { font-size: 11px; color: var(--text3); line-height: 1.5; }
/* 8 个格子铺满整行；真正的 input 透明叠在上面，点哪儿都能唤起键盘 */
.qpin {
    position: relative; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px;
}
/* 真正的 input 透明叠在格子上，点哪儿都能唤起键盘。
   选择器要写成 .qpin .qpin-real：全局 input[type=text] 的边框/内边距/文字色
   特异性比单个类名高，不压住的话会画出第二个白框、数字还会露在格子上。 */
.qpin .qpin-real {
    position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2;
    margin: 0; padding: 0; border: 0; border-radius: 0; outline: none; box-shadow: none;
    background: transparent; color: transparent; caret-color: transparent;
    font-size: 16px; /* 小于 16px 时 iOS 会自动放大页面 */
    cursor: text;
}
.qpin .qpin-real:focus { border: 0; outline: none; box-shadow: none; }
.qpin-box {
    display: flex; align-items: center; justify-content: center;
    height: 38px; border: 1px solid var(--line2); border-radius: 7px; background: #fff;
    font-size: 17px; font-weight: 600; color: var(--text);
    font-variant-numeric: tabular-nums; user-select: none;
    transition: border-color .12s, box-shadow .12s;
}
.qpin-box.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(58, 122, 232, .12); }
.qpin.bad .qpin-box { border-color: var(--bad); }
.qpin.bad .qpin-box.on { box-shadow: 0 0 0 3px rgba(210, 60, 60, .10); }
.qpin-err { font-size: 11px; color: var(--bad); }
@media (max-width: 420px) {
    .qpin { gap: 4px; }
    .qpin-box { height: 34px; font-size: 16px; border-radius: 6px; }
}
.qpick { display: flex; flex-direction: column; gap: 5px; }
.qpickhead {
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
    font-size: 12px; color: var(--text2);
}
.qpicktip { font-size: 11px; color: var(--text3); }
.qbot {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 7px;
    width: 100%; text-align: left; cursor: pointer; font: inherit;
    padding: 7px 9px; border: 1px solid var(--line2); border-radius: 7px; background: #fff;
    transition: border-color .12s, background .12s;
}
.qbot:hover:not(:disabled) { border-color: var(--accent); }
.qbot.on { border-color: var(--accent); background: #f2f8ff; box-shadow: inset 0 0 0 1px var(--accent); }
.qbot.dim { opacity: .45; cursor: not-allowed; }
/* 只是「这一档不能点」，但仍然要能看清在线 / 队列情况（HOME 直传非贵重球） */
.qbot.locked { opacity: .8; cursor: not-allowed; background: var(--panel2); border-style: dashed; }
.qbot.locked .qbname { color: var(--text2); }
/* 灰着的那几条只是「给你看在不在线」，标签也别太抢眼，免得以为能点 */
.qbot.locked .qbgame { background: var(--bg); color: var(--text3); }
.qbot.locked .qbtier { opacity: .6; }
.qbgame {
    font-size: 10.5px; font-weight: 700; color: var(--accent);
    background: var(--accent2); border-radius: 4px; padding: 1px 5px; white-space: nowrap;
}
.qbname {
    font-size: 12.5px; font-weight: 600; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qbmeta { font-size: 11px; color: var(--text3); white-space: nowrap; }
/* 免费机 / 会员机 徽标 */
.qbtier { font-size: 10px; font-weight: 700; border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.qbtier.vip { color: #8a5a00; background: #fff2d1; }
/* 贵重球专属机：只接贵重球，别人点不了 */
.qbtier.svip { color: #7c2d12; background: #ffe4d6; }
.qbtier.free { color: #1d6f4c; background: #e2f6ec; }
.qbtier.any { color: var(--text2); background: #eef1f5; }
/* 身份组等级 */
.qvip { color: #b45309; }
.qfree { color: var(--text2); }
.udim { color: var(--text3); font-weight: 500; }
/* 天星币：余额 + 最近一次变动（加=绿、扣=红） */
.upoints { color: #b45309; font-variant-numeric: tabular-nums; }
.updelta { margin-left: 4px; font-size: 11px; font-weight: 600; }
.updelta.up { color: #15803d; }
.updelta.down { color: #b91c1c; }

/* 管理页：用户列表里的天星币列 + 账号详情的变动记录 */
.appts { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.appts b { font-weight: 700; }
.ptslog { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ptslog-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.ptslog-list { display: grid; gap: 2px; max-height: 210px; overflow-y: auto; }
.ptsrow {
    display: grid; grid-template-columns: 58px 106px minmax(0, 1fr) 128px;
    align-items: center; gap: 8px; padding: 3px 6px; border-radius: 5px; font-size: 11.5px;
}
.ptsrow:nth-child(odd) { background: var(--panel2); }
.pts-d { font-weight: 700; font-variant-numeric: tabular-nums; }
.pts-d.up { color: #15803d; }
.pts-d.down { color: #b91c1c; }
.pts-b { color: var(--text2); font-variant-numeric: tabular-nums; }
.pts-s { color: var(--text3); }
.pts-t { text-align: right; font-variant-numeric: tabular-nums; }
/* 月卡已到期 */
.qexpired { color: var(--danger); font-weight: 600; }
.uactions { display: flex; gap: 8px; flex-wrap: wrap; }
.qpickwarn {
    font-size: 11.5px; line-height: 1.6; color: var(--warn); background: var(--warnbg);
    border: 1px solid #f0e2bd; border-radius: 6px; padding: 6px 8px;
}
.qpickwarn.inline { display: inline-block; padding: 2px 6px; }
.qmsg {
    font-size: 12.5px; line-height: 1.7; padding: 9px 11px; border-radius: 7px;
    background: #f1f6fd; color: var(--text2); display: flex; flex-direction: column; gap: 4px;
}
.qmsg.bad { background: var(--badbg); color: var(--bad); }
.qmsg.ok { background: var(--okbg); color: var(--ok); }
/* 说明文字按普通段落排：源码里的换行 / 缩进不能带进 DOM，否则第二行会缩进一大截。
   必须显式写 normal —— white-space 会继承，不写就等于跟着外层走，外层哪天用了 pre-wrap
   这些提示语又会整段缩进（2026-11-27 就是这么复发的）。 */
.qdetail { font-size: 11.5px; opacity: .92; white-space: normal; text-indent: 0; }
.qmsg, .qalert-tip, .qresult-msg { white-space: normal; text-indent: 0; }
/* 合法性报告是一段带换行的纯文本，只有它需要保留换行 */
.qdetail.report { white-space: pre-wrap; }
/* 机器人回报的最终结果：成功一行绿字，失败把原因单独框出来 */
.qresult {
    display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
    padding: 6px 9px; border-radius: 6px; background: #f7fcf8;
    border: 1px solid #cfe8d6;
}
.qresult.bad { background: #fff9f8; border-color: #f2cfcc; }
.qresult-msg { font-size: 12px; color: var(--text); }
.qresult.bad .qresult-msg { color: var(--bad); font-weight: 600; }
.qresult-at { font-size: 10.5px; color: var(--text3); margin-left: auto; }
.qlink { margin: 0; }
.dbsearch { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line2); }
.dbfield { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.dbfield > label { font-size: 12px; color: var(--text2); white-space: nowrap; }
.dbfield .ss { flex: 1 1 auto; min-width: 0; }
.dblist { overflow-y: auto; padding: 6px 8px; flex: 1 1 auto; min-height: 180px; }
.dbrow { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-bottom: 1px solid #f1f3f7; }
.dbrow:hover { background: #f7fafd; }
.dbtext { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.dbtext b { font-size: 12.5px; font-weight: 600; }
.dbtext span { font-size: 11px; color: var(--text3); }
/* 空结果 / 提示条要占满整行，否则会被格子的 74px 列宽挤成一列竖排 */
.dbempty { grid-column: 1 / -1; padding: 28px 18px; text-align: center; color: var(--text3); font-size: 12px; line-height: 1.9; }
.dbhint { font-size: 11px; color: var(--text3); }


/* 数据库窗口：左网格 + 右筛选 */
.dbwin { width: 960px; height: 650px; max-height: 90vh; }
.dbwinbar {
    display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px;
    background: linear-gradient(#fbfcfd, #f1f4f8); border-bottom: 1px solid var(--line);
    font-size: 13px;
}
.dbwinbody { flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1fr) 336px; min-height: 0; }
.dbgridpane { display: flex; flex-direction: column; min-height: 0; padding: 8px 8px 10px; border-right: 1px solid var(--line); }
.dbcount { text-align: center; font-size: 12px; color: var(--text2); margin-bottom: 6px; }
/* 窄屏才提示「点格子看详情」：手机上不能悬停 */
.dbcounttip { display: none; color: var(--text3); }
.dbtiles {
    flex: 1 1 auto; overflow-y: auto; align-content: start; justify-content: center;
    display: grid; grid-template-columns: repeat(6, 74px); gap: 2px;
}
.dbtile {
    position: relative; width: 74px; height: 74px; padding: 0;
    border: 1px solid #cfd6e0; background: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.dbtile:hover { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent2) inset; }
.dbtile .timg { width: 60px; height: 60px; object-fit: contain; pointer-events: none; }
.dbtile .tball { position: absolute; left: 2px; bottom: 1px; width: 15px; height: 15px; object-fit: contain; pointer-events: none; }
/* 固定闪光：和编辑页格子用同一个图标，压左上角 */
.dbtile .tshiny {
    position: absolute; left: 2px; top: 2px; width: 14px; height: 14px;
    object-fit: contain; pointer-events: none;
    filter: drop-shadow(0 1px 1px rgba(20, 40, 70, .3));
}
/* 携带道具：右下角 */
.dbtile .titem {
    position: absolute; right: 2px; bottom: 2px; width: 15px; height: 15px;
    object-fit: contain; pointer-events: none;
    filter: drop-shadow(0 1px 1px rgba(20, 40, 70, .3));
}
.dbtile .tgroup {
    position: absolute; left: 2px; bottom: 2px; padding: 0 3px; border-radius: 3px;
    font-size: 8px; line-height: 12px; color: #fff; background: rgba(30, 45, 70, .4);
}
/* 头目（LA / Z-A）：压右上角，和编辑页同一个图标；随机头目淡一点 */
.dbtile .talpha {
    position: absolute; right: 2px; top: 2px; width: 16px; height: 16px;
    object-fit: contain; pointer-events: none;
    filter: drop-shadow(0 1px 1px rgba(20, 40, 70, .35));
}
.dbtile .talpha.faint { opacity: .45; }
/* 检索被拦下的说明（存档版本对不上 / 存档里没有这只宝可梦） */
.dbnotice {
    margin: 0 4px 8px; padding: 6px 10px; border-radius: 4px;
    background: #fdf3e3; border: 1px solid #ecd4a8; color: #7a5a1e;
    font-size: 12px; line-height: 1.6; white-space: pre-line;
}
/* 分类配色：蛋 / 神秘礼物 / 定点 / 太晶坑 / 大量发生 / NPC 交换 / 野生 */
.dbtile.g-egg { background: #fbe6ec; border-color: #eac3d2; }
.dbtile.g-egg .tgroup { background: #c46b88; }
.dbtile.g-mystery { background: #fbf3d2; border-color: #e6d79a; }
.dbtile.g-mystery .tgroup { background: #b39116; }
.dbtile.g-static { background: #e3f0dd; border-color: #c2d8b4; }
.dbtile.g-static .tgroup { background: #5c8a44; }
.dbtile.g-tera { background: #ece3fb; border-color: #cdbaee; }
.dbtile.g-tera .tgroup { background: #7d5cbf; }
.dbtile.g-outbreak { background: #fde7d6; border-color: #eec5a4; }
.dbtile.g-outbreak .tgroup { background: #c1702d; }
.dbtile.g-trade { background: #e1ebfa; border-color: #bdd2f0; }
.dbtile.g-trade .tgroup { background: #4a7bbd; }
.dbtile.g-slot { background: #e8eaf0; border-color: #ccd2dd; }
.dbtile.g-slot .tgroup { background: #6b7688; }
.dbtile.g-item { background: #f3f4f6; cursor: default; }
.dbtile.g-item .timg { opacity: .32; }
/* 当前存档里没有的形态：能看不能用，淡一点 */
.dbtile.tileoff { opacity: .45; }
.dbtile.tileoff:hover { border-color: #cfd6e0; box-shadow: none; }


.dbfilters { display: flex; flex-direction: column; min-height: 0; }
.dbtabs { display: flex; gap: 4px; padding: 8px 8px 0; border-bottom: 1px solid var(--line2); }
.dbtab {
    display: inline-flex; align-items: center; gap: 5px;
    height: 26px; padding: 0 16px; border: 1px solid var(--line); border-bottom: 0;
    border-radius: 4px 4px 0 0; background: #f2f5f9; color: var(--text2);
    font-size: 12px; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.dbtab.on { background: #fff; color: var(--accent); font-weight: 700; margin-bottom: -1px; }
/* 「高级筛选」角标：设了几项条件，一眼能看到（在「一般」页签时也留着） */
.dbtabn {
    min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px;
    background: var(--accent); color: #fff; font-size: 9.5px; line-height: 15px;
    font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}
.dbfilterbody { flex: 1 1 auto; min-width: 0; overflow-y: auto; overflow-x: hidden; padding: 10px 12px; }
/* 高级筛选页的说明：只筛来源，不改模板 */
.advhint {
    margin: 0 0 12px; padding: 7px 9px; border-radius: 5px;
    background: #f4f7fb; border: 1px solid #e2e9f2;
    color: var(--text3); font-size: 11px; line-height: 1.65;
}
.chkrow { display: flex; gap: 18px; margin-bottom: 10px; }
.groupbox { margin-top: 12px; padding-left: 74px; display: flex; flex-direction: column; gap: 5px; }
.searchbtn { margin: 8px 12px 12px; height: 30px; }


/* 数据库悬停卡 */
.dbhover {
    position: fixed; z-index: 620; pointer-events: none;
    min-width: 150px; max-width: 230px;
    padding: 8px 10px; border-radius: 7px;
    background: rgba(26, 34, 48, .95);
    box-shadow: 0 8px 24px rgba(10, 20, 35, .3);
    color: #fff; font-size: 11.5px; line-height: 1.65;
}
.dbhover .hl:first-child { font-weight: 700; font-size: 12.5px; margin-bottom: 3px; }
.dbhover .hl + .hl { color: rgba(255, 255, 255, .82); }

/* 「筛选」开关：只有窄屏才显示（宽屏筛选面板一直在右侧） */
.dbfiltertoggle { display: none; }

/* 窄屏点格子后的详情抽屉（手机没有悬停） */
.dbdetailmask { position: fixed; inset: 0; z-index: 640; background: rgba(12, 20, 32, .3); }
.dbdetail {
    position: fixed; z-index: 650; left: 0; right: 0; bottom: 0;
    max-height: 64vh; display: flex; flex-direction: column;
    background: #fff; border-radius: 14px 14px 0 0;
    box-shadow: 0 -12px 34px rgba(10, 20, 40, .26);
    animation: dbsheet .18s ease-out;
}
@keyframes dbsheet { from { transform: translateY(16px); opacity: .5; } to { transform: none; opacity: 1; } }
.dbdetailhead {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px 8px; border-bottom: 1px solid var(--line2);
}
.dbdetailhead img { width: 52px; height: 52px; object-fit: contain; flex: 0 0 auto; }
.dbdetailhead img.dbshiny { width: 15px; height: 15px; vertical-align: -2px; margin-left: 2px; }
.dbdetailhead img.dbalpha.faint { opacity: .45; }
.dbdetailgift {
    width: 52px; height: 52px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.dbdetailtitle { flex: 1 1 auto; min-width: 0; }
.dbdetailtitle b { display: block; font-size: 14px; color: var(--text); }
.dbdetailtitle span { font-size: 11.5px; color: var(--text3); }
.dbdetailbody {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    padding: 9px 13px; font-size: 12.5px; line-height: 1.8; color: var(--text2);
}
.dbdetailbody .dl { border-bottom: 1px dashed #eef1f5; padding: 2px 0; }
.dbdetailbody .dl:last-child { border-bottom: 0; }
.dbdetailfoot {
    flex: 0 0 auto; display: flex; gap: 8px;
    padding: 9px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line2);
}
.dbdetailfoot .btn { flex: 1 1 auto; height: 34px; }

/* ---------- 提示 ---------- */
.toast {
    position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
    background: #2a3140; color: #fff; padding: 8px 15px; border-radius: 4px;
    font-size: 12px; font-weight: 600; box-shadow: 0 6px 20px rgba(0, 0, 0, .22); z-index: 300;
    animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px) } to { opacity: 1; transform: translate(-50%, 0) } }

#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff3cd; color: #664d03; padding: 9px 14px; font-size: 12.5px; z-index: 1000;
}
#blazor-error-ui .dismiss { float: right; cursor: pointer; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c8d0db; border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b1bbc8; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* 窄屏 */
@media (max-width: 1200px) {
    .ed3 { grid-template-columns: 176px 330px minmax(0, 1fr); }
}

/* 平板 / 小屏 */
@media (max-width: 900px) {
    html, body { overflow: auto; }
    .app { height: auto; min-height: 100vh; }
    .topbar { flex-wrap: wrap; height: auto; min-height: 46px; padding: 6px 10px; gap: 6px; }
    /* 换行后的「打开存档」不要孤零零贴左边，推到右侧跟上面一排按钮对齐 */
    .topbar > .btn.primary { margin-left: auto; }

    /* 首屏：手机用竖版背景，卡片改成上下两行 */
    .hero-mode .topbar { background: rgba(255, 255, 255, .62); }
    .app.hero-mode::before {
        background-image: url('/bg/landing-hero-mobile.webp');
        background-position: center 22%;
    }
    .landing { padding: 22px 18px 32px; align-items: flex-start; }
    .hero { padding-top: 4vh; }
    .heroeyebrow { letter-spacing: .18em; margin-bottom: 10px; }
    .herotitle { font-size: 27px; }
    .herosub { font-size: 12px; margin: 9px 0 20px; }
    .herocard { flex-direction: column; align-items: stretch; padding: 12px; gap: 9px; border-radius: 13px; }
    .herocard select { max-width: none; }
    .herocard .btn.primary { width: 100%; }
    .heroactions { margin-top: 13px; }
    /* 手机上两列会把「太晶坑 Seed 搜索器」挤成两行，改一行一张、图标贴左 */
    .herotools { margin-top: 20px; }
    .htgrid { grid-template-columns: 1fr; gap: 8px; }
    .htcard { padding: 10px 12px 10px 10px; align-items: center; }
    .httext i { font-size: 10px; }
    .herohint { margin-top: 10px; }
    .herohelp { margin-top: 14px; }
    .lnote { margin-top: 20px; }
    .fileinfo { order: 2; flex: 1 1 100%; padding-left: 0; margin-left: 0; border-left: 0; }
    .menubtn { display: inline-flex; }
    /* 菜单展开时按钮自己高亮，跟「关闭存档」彻底区分开 */
    .menubtn.open { border-color: var(--accent); color: var(--accent); background: var(--accent2); font-weight: 700; }
    .topactions {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        flex-wrap: wrap; gap: 6px; padding: 8px 10px;
        background: #fff; border-bottom: 1px solid var(--line2);
        box-shadow: 0 6px 16px rgba(20, 30, 50, .12);
    }
    .topactions.open { display: flex; }
    .boxview { grid-template-columns: 132px minmax(0, 1fr); }
    /* 直传那条工具条在手机上放不下一行：版本下拉和开关整体落到第二行 */
    .boxbar { max-width: none; flex-wrap: wrap; row-gap: 6px; }
    .boxbar .boxname { flex: 1 1 90px; }
    .hgroup { flex: 1 1 100%; margin-left: 0; }
    .hgroup .verpick { flex: 1 1 auto; max-width: none; }
    .allver { max-width: none; }
    .avhead, .avrow { grid-template-columns: 18px 1fr repeat(3, 50px); padding: 0 10px; gap: 8px; }
    /* 手机上三栏改成「浮在版本底色上的卡片」：留 10px 缝，底色从缝里透出来，
       整页从头到尾都带一点本作颜色，不会滚到下面就变成一片死白。 */
    .ed3 { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 82px 10px 18px; }
    .rail, .colfields, .boxpanel {
        border: 1px solid rgba(255, 255, 255, .95);
        border-radius: 14px;
        background-color: transparent;
        background-image:
            linear-gradient(180deg, rgba(255, 255, 255, .93) 0%, rgba(255, 255, 255, .86) 100%),
            linear-gradient(180deg, color-mix(in srgb, var(--edittint, #cfe0f2) 10%, transparent) 0%, color-mix(in srgb, var(--edittint, #cfe0f2) 4%, transparent) 100%);
        box-shadow: 0 8px 22px rgba(20, 60, 110, .07), 0 1px 0 rgba(255, 255, 255, .9) inset;
        -webkit-backdrop-filter: none; backdrop-filter: none;
    }
    .slotfit { container-type: normal; flex: 0 0 auto; }
    .slots, .slots.c6 {
        width: 100%; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: auto;
    }
    .slots.c5 { width: 100%; grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .slot { height: auto; aspect-ratio: 1 / 1; }
    /* 顶部一条版本色带：两只封面神从色带里探出上半身，被第一张卡压住，
       下面靠卡片缝隙继续透色。 */
    .editwrap {
        background:
            radial-gradient(150% 26% at 50% 0%, color-mix(in srgb, var(--edittint, #7ea6cf) 30%, #f7fbff) 0%, rgba(247, 251, 255, 0) 72%),
            linear-gradient(180deg,
                color-mix(in srgb, var(--edittint, #7ea6cf) 12%, #f2f8ff) 0%,
                color-mix(in srgb, var(--edittint, #7ea6cf) 8%, #eef5fd) 26%,
                color-mix(in srgb, var(--edittint, #7ea6cf) 5%, #f7fbff) 100%);
    }
    .edart { background: none; }
    /* 顶部只留一条窄窄的版本色带：立绘缩到 32%，半个身子藏在第一张卡后面，
       手机上不会为了氛围白占掉小半屏。top 用 px，百分比会按整页高度算把头部裁掉。 */
    .edart span {
        --artw: 33%; top: -6px; bottom: auto; opacity: .34;
    }
    .edart span:first-child { left: 4%; right: auto; }
    .edart span:last-child { right: 4%; left: auto; }
    .edart span:only-child { left: 50%; right: auto; margin-left: calc(var(--artw) / -2); }
    .rail { border-radius: 14px; }
    .rail {
        flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px;
        border-right: 0; border-bottom: 1px solid var(--line); overflow: visible;
    }
    .artcard { width: 78px; height: 78px; flex: 0 0 auto; }
    /* 手机上大图只有 68~78px，27px 的角标能盖掉半只精灵，缩到 20px；点按区域靠 ::after 外扩补回来 */
    .legalbadge { width: 19px; height: 19px; font-size: 10px; border-width: 1.5px; left: 3px; top: 3px; }
    .legalbadge::after { content: ""; position: absolute; inset: -7px; }
    .artmarks { right: 3px; top: 3px; gap: 2px; }
    .artmarks .mk { width: 14px; height: 14px; font-size: 9px; }
    .artmarks img.mk.pic { width: 15px; height: 15px; }
    .artmarks img.mk.tera { width: 14px; height: 14px; }
    .artcard span.artitem { width: 22px; height: 22px; right: 3px; bottom: 3px; border-radius: 6px; }
    .artcard span.artitem img { width: 17px; height: 17px; }
    .railmeta { flex: 1 1 auto; min-width: 0; }
    .railname { text-align: left; margin-top: 0; }
    .railsub { text-align: left; margin-bottom: 0; }
    .railtabs { flex-direction: row; flex: 1 1 100%; overflow-x: auto; padding-bottom: 2px; }
    .vtab { flex: 0 0 auto; }
    .vtab.on::before { display: none; }
    .railstatus { margin: 0; border: 0; padding: 0; }
    .colfields { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
    .colbody { overflow: visible; }
    .reportmodal { max-height: 84vh; }
    .slotmenu { max-width: 82vw; }
    /* 相遇数据库：手机上网格和筛选二选一，不叠在一起抢高度 */
    /* 相遇 / 礼物数据库：手机上直接铺满整屏。原来 88vh 居中会把标题栏顶到视口外，
       手机浏览器地址栏一占高度就叫唤着「上面滑不上去、按钮点不到」 */
    .dbwin {
        width: 100vw; height: 100vh; height: 100dvh; max-height: 100dvh;
        border-radius: 0; padding-top: env(safe-area-inset-top);
    }
    .dbwinbody { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); }
    .dbwin .dbfilters { display: none; }
    .dbwin.showfilters .dbgridpane { display: none; }
    .dbwin.showfilters .dbfilters { display: flex; }
    .dbgridpane { border-right: 0; }
    .dbfiltertoggle { display: inline-flex; }
    .dbcounttip { display: inline; }
    /* 「初训家版本」这类长标签在窄屏别折成两行 */
    .dbfilterbody .frow > label { flex: 0 0 68px; white-space: nowrap; }
    /* 页签在手机上左右留白收一档，两个页签不至于把标题栏挤满 */
    .dbtabs { padding: 6px 10px 0; }
    .dbtab { height: 28px; padding: 0 13px; font-size: 12.5px; }
    .dbfilterbody { padding: 10px 12px 6px; }
    .dbhover { display: none; }
    /* 每行 6 格、正方形（宽度按屏宽等分，矮屏 / 大屏都保持正方） */
    .dbtiles { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; justify-content: stretch; }
    .dbtile { width: 100%; height: auto; aspect-ratio: 1 / 1; }
    .dbtile .timg { width: 100%; height: 100%; padding: 3px; }
    .dbtile .tgroup { font-size: 8.5px; left: 2px; bottom: 1px; }
    /* 努力值 / 个体值步进：手机上加号减号放大到能稳点 */
    .evbtn { width: 28px; height: 30px; font-size: 15px; border-radius: 6px; touch-action: manipulation; }
    .evctl { gap: 4px; }
    .evctl input[type="number"] { -moz-appearance: textfield; }
    .evctl input[type="number"]::-webkit-outer-spin-button,
    .evctl input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    /* 改成卡片后栏与栏之间不需要分隔线了，否则卡片底边会多出一道灰线 */
    .rail, .colfields, .boxpanel {
        border-right: 1px solid rgba(255, 255, 255, .95);
        border-bottom: 1px solid rgba(255, 255, 255, .95);
    }
}

/* 手机 */
@media (max-width: 640px) {
    .topbar .btn { height: 30px; padding: 0 9px; font-size: 11.5px; }
    .brand { font-size: 13px; }
    .ed3 { grid-template-columns: minmax(0, 1fr); }
    .artcard { width: 68px; height: 68px; }
    /* 68px 的大图上，角标再收一档（19px→16px），否则盖掉大半个脑袋 */
    .legalbadge { width: 16px; height: 16px; font-size: 9px; border-width: 1.5px; left: 2px; top: 2px; }
    .artmarks .mk { width: 13px; height: 13px; font-size: 8.5px; }
    .artmarks img.mk.tera { width: 13px; height: 13px; }
    .artcard span.artitem { width: 20px; height: 20px; }
    .artcard span.artitem img { width: 15px; height: 15px; }
    /* 表头现在挤着「导入 / 导出 / 机器人排队」三个按钮，长版本名（Let's Go 皮卡丘）会把这一行撑破，
       允许换行：版本标留在第一行，按钮组掉到第二行右对齐，不会再溢出 */
    .colhead { padding: 8px 12px; height: auto; min-height: 46px; flex-wrap: wrap; row-gap: 6px; }
    .colhead::after { left: 12px; }
    .colhead-export { flex-wrap: wrap; row-gap: 6px; }
    .colbody { padding: 12px 12px 18px; }
    .frow { gap: 8px; }
    .frow > label { flex: 0 0 52px; font-size: 11px; }
    .chklabel { flex: 0 0 52px; font-size: 11px; }
    .fctl input[type="number"] { width: 110px; max-width: 110px; }
    /* 数据库「高级筛选」的个体六格：三列平分剩余宽度。上面那条 110px 会把它撑出屏幕，
       手机上就会出现「筛选框比屏幕还宽」的横向滚动 */
    .dbfilters .fctl.ivfilter { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
    .dbfilters .fctl.ivfilter input { width: 100%; max-width: none; min-width: 0; height: 30px; padding: 0 2px; }
    .pidrow input.hex { max-width: 140px; }
    .row2 { grid-template-columns: 1fr; }
    .statgrid.s4 { grid-template-columns: 40px 44px 1fr 1fr 44px; gap: 6px; }
    .moverow, .movehdr { grid-template-columns: 20px 1fr 30px 42px; gap: 6px; }
    .mvtype { width: 18px; height: 18px; }
    .slots.c6, .slots.c5 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
    .slot { width: auto; height: auto; aspect-ratio: 1 / 1; }
    .slot img { width: 44px; height: 44px; }
    .ribbongrid { grid-template-columns: 1fr; }
    .contestrow { grid-template-columns: repeat(2, 1fr); }
    .checkgrid { grid-template-columns: repeat(2, 1fr); }
    /* 手机上机器人名 + 状态挤一行会截断，状态另起一行 */
    .qbot { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 1px; }
    .qbmeta { grid-column: 2 / span 2; }
    .reportmodal { max-height: 86vh; }
    .modal, .trmodal, .dbmodal, .memmodal, .shopmodal, .adminmodal, .authmodal, .userdialog, .botmodal { width: 94vw; max-width: 94vw; }
    .editfoot { flex-wrap: wrap; height: auto; padding: 8px 10px; }
    /* 手机上底栏只有一行状态，右侧提示会挤成两行，直接不显示 */
    .foothint { display: none; }
    .footnote { flex: 1 1 100%; }
    .slotmenu { left: 8px !important; max-width: 92vw; }
    /* 导出 / 排队按钮：整组独占一行、等宽平分，五个也挤在一行里不折行 */
    .boxtabs { gap: 6px 4px; }
    .boxacts {
        flex: 1 1 100%; margin-left: 0;
        flex-wrap: nowrap; justify-content: stretch; gap: 3px;
    }
    .boxacts .minibtn {
        flex: 1 1 0; min-width: 0; height: 28px;
        padding: 0 3px; font-size: 11px; overflow: hidden;
    }
}

/* ---------- 排队提醒（提交排队后常驻右下角，轮到你了亮交易码） ---------- */
.qalert {
    /* 抬高一点，别压住编辑器底部那条「导出 / 排队」工具条（高 46px） */
    /* z-index 低于 .modal-mask(500)：弹窗打开时别盖住弹窗里的按钮 */
    position: fixed; right: 14px; bottom: 56px; z-index: 480;
    width: 306px; max-width: calc(100vw - 16px);
    padding: 10px 12px 11px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: 0 10px 30px rgba(20, 40, 70, .20);
    display: flex; flex-direction: column; gap: 6px;
    animation: qalertIn .16s ease-out;
}
.qalert.turn {
    border-color: #e0a13d;
    box-shadow: 0 12px 36px rgba(214, 138, 20, .30);
    background: linear-gradient(180deg, #fffaf0 0%, #ffffff 46%);
    /* 轮到你时必须盖过任何弹窗（.modal-mask 是 500）：
       手机上排队弹窗是全屏的，不提这一档，交易密码会被遮罩吃掉 */
    z-index: 620;
}
@keyframes qalertIn { from { transform: translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }

.qalert-close {
    position: absolute; top: 3px; right: 4px;
    width: 22px; height: 22px; padding: 0;
    border: 0; border-radius: 5px; background: transparent;
    color: var(--text3); font-size: 12px; line-height: 1; cursor: pointer;
}
.qalert-close:hover { background: var(--panel2); color: var(--text); }

.qalert-head { display: flex; align-items: center; gap: 6px; padding-right: 20px; }
.qalert-head b { font-size: 13px; }
.qalert-head b.qturn { color: #c2790a; font-size: 14.5px; }
/* 机器人断开：队位还在，但队列停住（倒计时暂停），用中性灰而不是告警橙 */
.qalert-head b.qoff { color: #7c6a55; font-size: 14px; }
.qalert-bot {
    margin-left: auto; padding: 1px 6px; border-radius: 999px;
    background: var(--accent2); color: var(--accent); font-size: 10.5px; font-weight: 600;
}
.qalert-botline { color: var(--text2); font-size: 11.5px; }
.qalert-tip { color: var(--text2); font-size: 11px; line-height: 1.55; }
/* 机器人回报的最终结果（提醒卡片里那一行） */
.qalert-result {
    display: inline-block; margin-bottom: 4px; padding: 2px 6px; border-radius: 5px;
    font-size: 11.5px; font-weight: 600;
}
.qalert-result.ok { color: var(--ok); background: var(--okbg); }
.qalert-result.bad { color: var(--bad); background: var(--badbg); }

.qalert-pos { display: flex; align-items: baseline; gap: 4px; }
.qposnum { font-size: 30px; font-weight: 700; line-height: 1; color: var(--accent); }
.qalert.turn .qposnum { color: #c2790a; }
.qposof { color: var(--text3); font-size: 11.5px; }
.qahead { margin-left: auto; color: var(--text2); font-size: 11.5px; }

.qcodebox {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 6px 9px; border-radius: 8px;
    background: #fff6e2; border: 1px solid #f0d49a;
}
.qcodelead { color: #8a6a1c; font-size: 10.5px; }
.qcode {
    font-size: 34px; font-weight: 700; line-height: 1.05;
    letter-spacing: 8px; color: #a15c00;
    font-variant-numeric: tabular-nums;
    /* 左边多出 8px 是为了让字距看起来居中 */
    text-indent: 8px;
}
.qcopy { height: 24px; padding: 0 12px; font-size: 11.5px; }

/* 去皮去伊：密码是 3 个图标，网页按 KOOK 私信那样显示成 3 个名字 */
.qcode.lgpe {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 5px 0;
    font-size: 18px; font-weight: 700; line-height: 1.1;
    letter-spacing: 0; text-indent: 0;
}
.qcode.lgpe .qicon {
    padding: 2px 8px; border-radius: 6px;
    background: #fff; border: 1px solid #f0d49a; color: #a15c00;
}
.qcode.lgpe .qplus { margin: 0 5px; color: #c9a25a; font-size: 14px; }

.qalert-pks { display: flex; flex-wrap: wrap; gap: 3px 5px; }
.qpk {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: 1px 6px; border-radius: 5px;
    background: var(--panel2); border: 1px solid var(--line2);
    color: var(--text2); font-size: 11px;
}
.qpk.dim { color: var(--text3); background: transparent; border-color: transparent; }

.qalert-foot {
    display: flex; align-items: center; gap: 8px;
    margin-top: 1px; padding-top: 6px; border-top: 1px dashed var(--line2);
    color: var(--text2); font-size: 11.5px;
}
.qalert-foot b { color: var(--text); font-variant-numeric: tabular-nums; }
.qcopied { margin-left: auto; color: var(--ok); font-size: 11px; }
.qalert-footright { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.qalert-foot .qcopied { margin-left: 0; }
.qalert-kill {
    padding: 0; border: 0; background: transparent;
    color: var(--text3); font-size: 11px; cursor: pointer;
    text-decoration: underline; text-underline-offset: 2px;
}
.qalert-kill:hover { color: #c0392b; }

/* 卡片底部的操作行（取消排队 / 去频道退出） */
.qalert-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qalert-acts .qalert-kill { margin-left: auto; }
.qcancel { height: 26px; padding: 0 10px; font-size: 11.5px; }
.qalert-hint { color: var(--text2); font-size: 11px; line-height: 1.5; }

/* 收起后的常驻小气泡：点一下把卡片叫回来 */
.qfab {
    position: fixed; right: 14px; bottom: 56px; z-index: 480;
    display: inline-flex; align-items: center; gap: 7px;
    height: 38px; padding: 0 14px 0 12px;
    border: 1px solid var(--line); border-radius: 999px;
    background: var(--panel); color: var(--text);
    box-shadow: 0 8px 22px rgba(20, 40, 70, .18);
    font-size: 12px; cursor: pointer;
    animation: qalertIn .16s ease-out;
}
.qfab:hover { border-color: var(--accent); }
.qfab.turn {
    background: #fff6e2; border-color: #e0a13d;
    box-shadow: 0 10px 28px rgba(214, 138, 20, .32);
}
.qfab-ico { font-size: 13px; line-height: 1; }
.qfab-num {
    font-size: 17px; font-weight: 700; line-height: 1;
    color: var(--accent); font-variant-numeric: tabular-nums;
}
.qfab.turn .qfab-num { color: #c2790a; }
.qfab-code {
    font-size: 20px; font-weight: 700; line-height: 1;
    letter-spacing: 3px; text-indent: 3px;
    color: #a15c00; font-variant-numeric: tabular-nums;
}
/* 3 个图标名比 4 位数字长得多，气泡里缩小并截断，别把气泡撑爆 */
.qfab-code.lgpe {
    font-size: 12.5px; letter-spacing: 0; text-indent: 0;
    max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qfab-lbl { color: var(--text2); font-size: 11.5px; white-space: nowrap; }
.qfab.turn .qfab-lbl { color: #8a6a1c; }

@media (max-width: 640px) {
    .qalert {
        left: 8px; right: 8px; bottom: calc(env(safe-area-inset-bottom, 0px) + 56px);
        width: auto; max-width: none;
        /* 登录卡比交易码高得多（二维码 + 输入框）：限高并允许滚动，别顶出屏幕看不见 */
        max-height: calc(100dvh - 72px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 9px 11px 10px;
    }
    .qcode { font-size: 31px; }
    .qfab {
        right: 8px; bottom: calc(env(safe-area-inset-bottom, 0px) + 56px);
        height: 36px; padding: 0 12px 0 10px; gap: 6px;
        max-width: calc(100vw - 16px);
    }
}

/* ---------- 管理后台（独立页 /admin） ---------- */
.adminp { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

.adminp-head {
    flex: none; display: flex; align-items: center; gap: 10px;
    height: 46px; padding: 0 14px;
    background: var(--panel); border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 3px rgba(24, 42, 70, .06); z-index: 5;
}
.adminp-brand { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; }
.adminp-brand .ball {
    width: 16px; height: 16px; border-radius: 50%;
    background: linear-gradient(#d93a34 0 46%, #2b3140 46% 54%, #fff 54%);
    border: 1.5px solid #2b3140; box-shadow: inset 0 0 0 1.5px #fff;
}
.adminp-sub { color: var(--text3); font-size: 11.5px; }
.adminp-who {
    font-size: 11.5px; color: var(--text2); background: var(--panel2);
    border: 1px solid var(--line2); border-radius: 999px; padding: 3px 9px;
}

.adminp-empty {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; color: var(--text2); font-size: 13px; text-align: center; padding: 24px;
}
.adminp-empty b { font-size: 16px; color: var(--text); }

.adminp-msg {
    flex: none; margin: 10px 16px 0; padding: 8px 12px; border-radius: 7px;
    font-size: 12px; border: 1px solid transparent;
}
.adminp-msg.ok { background: var(--okbg); color: var(--ok); border-color: #bfe4cc; }
.adminp-msg.bad { background: var(--badbg); color: var(--bad); border-color: #f2c7c7; }

.adminp-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 172px minmax(0, 1fr); }

.adminp-nav {
    display: flex; flex-direction: column; gap: 3px;
    padding: 10px 8px; overflow-y: auto;
    background: var(--panel); border-right: 1px solid var(--line);
}
.adminp-tab {
    display: flex; align-items: center; gap: 6px; text-align: left;
    padding: 8px 10px; border-radius: 7px; border: 1px solid transparent;
    background: transparent; color: var(--text2); font: inherit; font-size: 12.5px;
    cursor: pointer;
}
.adminp-tab:hover { background: var(--panel2); }
.adminp-tab.on {
    background: var(--accent2); color: var(--accent);
    border-color: #c9def7; font-weight: 600;
}
.adminp-dot {
    margin-left: auto; min-width: 16px; height: 16px; line-height: 16px;
    padding: 0 4px; border-radius: 999px; text-align: center;
    background: #fdecea; color: #c0392b; font-size: 10.5px; font-weight: 700;
}
.adminp-refresh { margin-top: 8px; }

.adminp-pane { overflow-y: auto; padding: 14px 16px 30px; display: flex; flex-direction: column; gap: 14px; }

.adminp-sec {
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
    padding: 12px 14px 14px; box-shadow: 0 1px 2px rgba(24, 42, 70, .04);
}
.adminp-sec h2 {
    margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
    color: var(--text3); text-transform: uppercase;
}

.ovgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.ovcard {
    border: 1px solid var(--line2); border-radius: 9px; padding: 10px 12px;
    background: var(--panel2); display: flex; flex-direction: column; gap: 3px;
}
.ovcard.warn { border-color: #f0d3a8; background: #fffaf0; }
.ovl { font-size: 11px; color: var(--text3); }
.ovv { font-size: 22px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; }
.ovs { font-size: 11px; color: var(--text2); }

.adminp-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.adminp-tools input[type="search"] {
    flex: 1 1 220px; min-width: 160px; height: 30px; padding: 0 10px;
    border: 1px solid var(--line); border-radius: 7px; background: var(--panel);
    font: inherit; font-size: 12.5px; color: var(--text);
}
.adminp-tools input[type="search"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent2); }
.adminp-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.adminp-chip {
    border: 1px solid var(--line2); background: var(--panel); color: var(--text2);
    border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 11.5px; cursor: pointer;
}
.adminp-chip.on { background: var(--accent2); border-color: #c9def7; color: var(--accent); font-weight: 600; }
.ap-lab { font-size: 11.5px; color: var(--text3); }
.ap-num { width: 64px; height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; font: inherit; }

.adminp-tip {
    margin: 0 0 10px; padding: 8px 10px; border-radius: 7px;
    background: var(--panel2); border: 1px dashed var(--line);
    color: var(--text2); font-size: 11.5px; line-height: 1.6;
}

.ap-list { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.ap-row {
    display: grid; gap: 8px; align-items: center;
    padding: 8px 12px; border-bottom: 1px solid var(--line2);
    font-size: 12px; min-height: 38px;
}
.ap-row:last-child { border-bottom: none; }
.ap-row.ap-head {
    background: var(--panel2); color: var(--text3);
    font-size: 11px; font-weight: 600; min-height: 32px;
    position: sticky; top: 0; z-index: 1;
}
.ap-row.ap-users { grid-template-columns: minmax(0, 1.7fr) 108px 96px minmax(0, 1fr) 110px 128px; }
.ap-row.ap-bots { grid-template-columns: minmax(0, 150px) minmax(0, 1fr) minmax(0, 1.5fr) 128px 74px; }
.ap-row.ap-inv { grid-template-columns: 150px 80px minmax(0, 1fr) 128px 120px; }
/* 首页「常用工具」排序：序号 · 名称 · 键名 · 上移/下移 */
.ap-row.ap-tools { grid-template-columns: 40px minmax(0, 1fr) 120px 96px; }
/* 管理页「身份组权限」：组名 · 类型 · 权利清单（清单要多行，不能省略号截断） */
.ap-row.ap-rights { grid-template-columns: minmax(0, 168px) 104px minmax(0, 1fr); align-items: start; }
.ap-row.ap-rights > span { white-space: normal; overflow: visible; text-overflow: clip; }
.rrtype { color: var(--text3); font-size: 11.5px; }
.rrlist { margin: 0; padding-left: 16px; color: var(--text2); font-size: 12px; line-height: 1.75; }
.rrlist li { margin: 0; }
.ap-row.sel { background: var(--accent2); }
.ap-row:not(.ap-head):hover { background: #f6f9fd; }

.ap-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-name { display: flex; align-items: center; gap: 6px; }
.ap-name b { font-weight: 600; }
.ap-name .ap-dim { margin-left: 2px; }
.ap-dim { color: var(--text3); font-size: 11.5px; }
.ap-mono { font-family: ui-monospace, Consolas, monospace; font-size: 11px; word-break: break-all; }
.ap-games { display: flex; gap: 5px; flex-wrap: wrap; white-space: normal; }
.ap-game {
    display: inline-flex; align-items: baseline; gap: 4px;
    background: var(--panel2); border: 1px solid var(--line2); border-radius: 5px;
    padding: 1px 6px; font-size: 11px; font-weight: 600; color: var(--text2);
}
.ap-game i { font-style: normal; font-weight: 400; color: var(--text3); font-size: 10.5px; }
.ap-ops { display: flex; gap: 4px; justify-content: flex-end; }
/* 机器人盒子「归属账号」：昵称一行（可点，跳到账号）+ 邮箱 / KOOK 一行，避免只看到一个目录名 */
.ap-owner { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ap-owner .aplink {
    display: block; max-width: 100%; padding: 0; border: 0; background: none;
    font: inherit; color: var(--accent); text-align: left; cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ap-owner .aplink b { font-weight: 600; }
.ap-owner .aplink:hover b { text-decoration: underline; }
.ap-owner i {
    font-style: normal; font-size: 11px; color: var(--text3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.minibtn.danger { color: var(--bad); border-color: #f0c8c8; background: #fff7f7; }
.minibtn.danger:hover { background: var(--badbg); }

.adminp-edit {
    margin-top: 12px; padding: 12px 14px;
    border: 1px solid #c9def7; border-radius: 9px; background: #f8fbff;
}
.ap-editgrid { display: grid; gap: 8px; margin-top: 8px; }
.ap-danger { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; }

.ap-kv {
    display: grid; grid-template-columns: 150px minmax(0, 1fr);
    gap: 6px 12px; font-size: 12px;
}
.ap-kv span { color: var(--text3); }
.ap-kv b { font-weight: 600; word-break: break-word; }

@media (max-width: 820px) {
    .adminp-sub { display: none; }
    .adminp-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
    .adminp-nav {
        flex-direction: row; align-items: center; gap: 4px;
        border-right: none; border-bottom: 1px solid var(--line);
        padding: 6px 8px; overflow-x: auto; overflow-y: hidden;
    }
    .adminp-tab { white-space: nowrap; padding: 6px 9px; }
    .adminp-refresh { margin-top: 0; margin-left: auto; }
    .adminp-dot { margin-left: 2px; }
    .adminp-pane { padding: 10px 10px 24px; }
    .adminp-sec { padding: 10px 10px 12px; }
    .ap-row.ap-head { display: none; }
    .ap-row.ap-users, .ap-row.ap-bots, .ap-row.ap-inv, .ap-row.ap-tools,
    .ap-row.ap-rights {
        grid-template-columns: 1fr auto; row-gap: 4px; padding: 9px 10px;
    }
    .ap-row.ap-rights > span:nth-child(3) { grid-column: 1 / -1; }
    .ap-row.ap-users > span, .ap-row.ap-bots > span, .ap-row.ap-inv > span,
    .ap-row.ap-tools > span { white-space: normal; }
    .ap-row.ap-users > span:nth-child(n+3),
    .ap-row.ap-bots > span:nth-child(n+3),
    .ap-row.ap-inv > span:nth-child(n+3),
    .ap-row.ap-tools > span:nth-child(3) { grid-column: 1 / -1; }
    .ap-ops { justify-content: flex-start; grid-column: 1 / -1; }
    .ap-kv { grid-template-columns: 110px minmax(0, 1fr); }
}

.adminp-panebar {
    display: flex; align-items: center; gap: 10px;
    margin: -2px 0 2px; flex: none;
}
.adminp-panebar b { font-size: 13px; font-weight: 700; }

/* HOME 直传登录卡片（排队弹窗里）：二维码链接 + 5 位码。
   链接和二维码都来自机器人本地解码，用户不用再保存截图去扫另一块屏幕 */
.hlogin {
    border: 1px solid var(--line2); border-radius: 7px; background: #fbfdff;
    padding: 9px 10px; display: flex; flex-direction: column; gap: 6px;
}
.hlogin-head { display: flex; align-items: baseline; gap: 8px; }
.hlogin-head b { font-size: 12.5px; font-weight: 700; color: var(--text); }
.hlogin-ttl { font-size: 11px; color: var(--text3); margin-left: auto; }
.hlogin-body { display: flex; gap: 12px; align-items: flex-start; }
.hlogin-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hlogin-act { display: flex; gap: 8px; flex-wrap: wrap; }
/* 输入框 + 提交按钮：窄容器（右下角提醒只有 306px）里必须能换行，
   否则这一行会横向顶出 .hlogin-main，被右边的二维码盖住，按钮点不到 */
.hlogin-code { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hcode {
    width: 132px; flex: 0 1 132px; min-width: 96px;
    font: inherit; font-size: 13px; letter-spacing: 2px; text-align: center;
    padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text);
}
.hlogin-code .btn { flex: 0 0 auto; }
.hcode:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent2); }
.hlogin .hok { color: var(--ok); }
.hlogin .hbad { color: var(--bad); }
.hlogin-qr { flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.hlogin-qr img {
    width: 108px; height: 108px; border: 1px solid var(--line2); border-radius: 6px;
    background: #fff; padding: 3px; image-rendering: pixelated;
}
.hlogin-qr span { font-size: 10.5px; color: var(--text3); }
/* 登录成功留的那几十秒：边框转绿，和「等码」区分开 */
.hlogin.hdone { border-color: var(--ok); background: #fbfefb; }
/* 卡里的小链接（「不用验证码」这类次要动作，别做成按钮抢眼） */
.hlinkbtn {
    font: inherit; font-size: 11.5px; padding: 0; border: 0; background: none;
    color: var(--accent); text-decoration: underline; cursor: pointer;
}
.hlinkbtn:disabled { color: var(--text3); cursor: default; text-decoration: none; }
/* 登录卡最下面那行「取消登录」：和 KOOK 私信卡片的取消同一种作用。
   手机上一行放不下「按钮 + 一整句说明」，改成上下两行更清爽 */
.hlogin-foot {
    display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
    margin-top: 2px; padding-top: 6px; border-top: 1px dashed var(--line2);
}
.hlogin-foot span { color: var(--text3); font-size: 10.5px; line-height: 1.5; }
.hcancel { color: #b4453a; font-weight: 600; }
.hcancel:hover { color: #c0392b; }
.hcancel:disabled { color: var(--text3); cursor: default; }
/* 右下角提醒固定 306px：左右并排时说明只剩 130px 宽，输入框那行会顶到二维码底下（按钮被盖住点不动）。
   这类窄卡片一律二维码在上、内容在下，按钮拿满整行 */
.qalert .hlogin-body { flex-direction: column-reverse; align-items: stretch; }
.qalert .hlogin-qr { align-self: center; }

@media (max-width: 640px) {
    .hlogin-body { flex-direction: column-reverse; }
    .hlogin-qr { align-self: center; }
}

/* 多版本直传进度：一箱混了几个版本时，机器人一个版本一个版本切过去传。
   已完成打勾、正在传的高亮、还没到的灰着，一眼看出走到哪了 */
.hprog {
    border: 1px solid var(--line2); border-radius: 7px; background: #fcfcfd;
    padding: 8px 10px; display: flex; flex-direction: column; gap: 6px;
}
.hprog-head { display: flex; align-items: baseline; gap: 8px; }
.hprog-head b { font-size: 12.5px; font-weight: 700; color: var(--text); }
.hprog-count { font-size: 11px; color: var(--text3); margin-left: auto; }
.hprog-vers { display: flex; flex-wrap: wrap; gap: 6px; }
.hver {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px; line-height: 1; padding: 4px 7px; border-radius: 999px;
    border: 1px solid var(--line2); background: #fff; color: var(--text2);
}
.hver .hvern { font-size: 10px; color: var(--text3); }
.hver .hverok { color: var(--ok); font-weight: 700; }
.hver.done { border-color: #cfe9d6; background: #f6fcf8; color: var(--text); }
.hver.current {
    border-color: var(--accent); background: var(--accent2); color: var(--text);
    box-shadow: 0 0 0 2px var(--accent2);
}
.hver.current .hvern { color: var(--text2); }
.hver.todo { opacity: .62; }

/* ===== 笨比定制台：整页嵌 Vue 成品页（benbi-app/） ===== */
.benbi-shell {
    position: fixed;
    inset: 0;
    background: #f2f2f7;
    overflow: hidden;
}
.benbi-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------------- 站内页：太晶坑搜索 / 道具商城（/tera、/tera-shop） ----------------
   顶栏沿用主站 .topbar；下面 #teraHost 由 js/tera-host.js 渲染：
   一条控制栏（KOOK 标识 + 机器人下拉）+ iframe（搜索器/商城本体）+ 可选底部发车条。 */

#teraHost {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #f4f5f9;
}

.terabar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.terakook {
    border: 1px solid #d9d4ff;
    background: #efedff;
    color: #5343cc;
    border-radius: 9px;
    padding: 4px 10px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: default;
}

.terabot {
    max-width: 230px;
    margin-left: auto;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 9px;
    padding: 4px 8px;
    font-size: 12.5px;
    color: var(--text);
}

.terapend {
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: #efedff;
    color: #5343cc;
    font-size: 12.5px;
    border-bottom: 1px solid #d9d4ff;
}

.terapend[hidden] {
    display: none;
}

.terapend i {
    width: 11px;
    height: 11px;
    border: 2px solid #d9d4ff;
    border-top-color: #6d5cff;
    border-radius: 50%;
    animation: teraspin .7s linear infinite;
}

@keyframes teraspin {
    to { transform: rotate(360deg); }
}

.terabody {
    flex: 1 1 auto;
    min-height: 0;
}

.teraframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #f4f5f9;
}

.teracart {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    background: #fff;
    border-top: 1px solid var(--line);
}

.teracart[hidden] {
    display: none;
}

.teracarttext {
    font-size: 13px;
    font-weight: 600;
    color: var(--text2);
}

.terasend {
    margin-left: auto;
    border: 0;
    border-radius: 10px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 650;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(180deg, #7a6bff, #5f4cf5);
}

.terasend:disabled {
    background: #c9cbd6;
    cursor: not-allowed;
}

.teratoast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 14px);
    max-width: min(560px, 90vw);
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(24, 30, 44, .94);
    color: #fff;
    font-size: 13px;
    line-height: 1.6;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 9999;
}

.teratoast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.teratoast.bad {
    background: rgba(160, 42, 42, .95);
}

/* ------------- 点坑即时小浮标：点了就有、不挡页面 ------------- */

.teraquepop {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9998;
    width: min(300px, calc(100vw - 32px));
    padding: 11px 13px 12px;
    border: 1px solid var(--line2);
    border-left: 3px solid #7a6bff;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(16, 30, 52, .18);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.teraquepop.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.teraquepop.ok {
    border-left-color: #1f9d63;
}

.teraquepop.bad {
    border-left-color: #d14343;
}

.teraquepop-head {
    display: flex;
    align-items: center;
    gap: 7px;
}

.teraquepop-dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7a6bff;
}

.teraquepop.ok .teraquepop-dot {
    background: #1f9d63;
}

.teraquepop.bad .teraquepop-dot {
    background: #d14343;
}

.teraquepop.wait .teraquepop-dot {
    animation: terapop-pulse 1.1s ease-in-out infinite;
}

@keyframes terapop-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .25; }
}

.teraquepop-title {
    flex: 1;
    font-size: 13.5px;
    font-weight: 650;
    color: var(--text);
}

.teraquepop-x {
    flex: none;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text3);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.teraquepop-x:hover {
    color: var(--text);
}

.teraquepop-text {
    margin-top: 5px;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--text2);
}

.teraquepop-go {
    display: inline-block;
    margin-top: 7px;
    font-size: 12.5px;
    color: var(--accent);
    text-decoration: none;
}

.teraquepop-go:hover {
    text-decoration: underline;
}

@media (max-width: 560px) {
    .teraquepop {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
    }
}

/* ---------------- 面板弹窗：已排队 / 轮到你了（密语） ---------------- */

.teraalertmask {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(16, 24, 38, .42);
    z-index: 10000;
}

.teraalert {
    width: min(420px, 100%);
    padding: 22px 22px 18px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(16, 30, 52, .28);
    text-align: center;
}

.teraalerttitle {
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 650;
    color: var(--text);
}

.teraalerttext {
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text2);
}

.teraalertlabel {
    margin-bottom: 2px;
    font-size: 12px;
    color: var(--text3);
}

.teraalertcode {
    padding: 6px 0 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--accent);
    user-select: all;
}

.teraalertcopy {
    margin-bottom: 14px;
    padding: 7px 16px;
    border: 1px solid var(--line2);
    border-radius: 9px;
    background: var(--panel2);
    color: var(--text2);
    font-size: 13px;
    cursor: pointer;
}

.teraalertcopy:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.teraalertacts {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.teraalertacts a,
.teraalertacts button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 116px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid var(--line2);
    border-radius: 10px;
    background: #fff;
    color: var(--text2);
    font-size: 13.5px;
    text-decoration: none;
    cursor: pointer;
}

.teraalertacts a {
    border-color: transparent;
    background: linear-gradient(180deg, #7a6bff, #5f4cf5);
    color: #fff;
    font-weight: 600;
}

.teraalertacts a:hover {
    filter: brightness(1.05);
}

.teraalertacts button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ------------- 我的这一坑：进度弹窗（排队 › 开坑 › 密语） ------------- */

.teraalert-progress {
    width: min(440px, 100%);
}

.terasteps {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 4px 0 14px;
}

.terastep {
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--panel2);
    color: var(--text3);
    font-size: 12px;
    line-height: 1.6;
}

.terastep.done {
    color: var(--text2);
}

.terastep.on {
    background: linear-gradient(180deg, #7a6bff, #5f4cf5);
    color: #fff;
    font-weight: 600;
}

.teraprogress-meta {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text2);
}

.teraprogress-clock {
    /* 密语是主角（30px），倒计时让一档，别跟密语抢视线 */
    margin: 8px 0 2px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 19px;
    font-weight: 650;
    letter-spacing: .5px;
    color: var(--text2);
}

.teraprogress-clock.hot {
    color: #d94848;
}

.teraprogress-hint {
    margin-bottom: 14px;
    padding: 0 6px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text3);
}

/* 工具条上的入口：只在「有我的坑」时出现 */
.teraprog {
    flex: none;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--line2);
    border-radius: 999px;
    background: var(--panel2);
    color: var(--text2);
    font-size: 12.5px;
    white-space: nowrap;
    cursor: pointer;
}

.teraprog:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.teraprog.hot {
    border-color: transparent;
    background: linear-gradient(180deg, #7a6bff, #5f4cf5);
    color: #fff;
    font-weight: 600;
}

@media (max-width: 600px) {
    .terabot {
        max-width: 46vw;
    }

    .teracarttext {
        font-size: 12px;
    }
}

.teragate {
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background: #f4f5f9;
    overflow: auto;
}

.teracard {
    width: min(460px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 12px 36px rgba(24, 42, 70, .08);
}

.teracard h2 {
    margin: 0 0 10px;
    font-size: 17px;
}

.teracard p {
    margin: 0 0 14px;
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--text2);
}

.teracard .teradim {
    color: var(--text3);
    font-size: 12.5px;
}

.teracard .btn.primary {
    margin-top: 4px;
}

/* ---- 弹窗里的「精灵信息小卡片」（.teracard 是准入卡片，别混） ---- */
.teraminicard {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 8px 14px;
    align-items: center;
    margin: 12px 0 10px;
    padding: 12px;
    border: 1px solid var(--line2);
    border-radius: 12px;
    background: var(--panel2);
    text-align: left;
}

.teraminicard-art {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line2);
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.teraminicard-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.teraminicard-art.gift {
    border-color: #ecd7f6;
    background: #fdf4ff;
}

.teraminicard-art.none {
    font-size: 20px;
    font-weight: 700;
    color: var(--text3);
}

.teraminicard-emoji {
    font-size: 28px;
    line-height: 1;
}

.teraminicard-main {
    min-width: 0;
}

.teraminicard-name {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.teraminicard-species {
    font-size: 15px;
    font-weight: 650;
    color: var(--text);
}

.teraminicard-gender.male {
    color: #2f7fd6;
    font-weight: 700;
}

.teraminicard-gender.female {
    color: #e0518a;
    font-weight: 700;
}

.teraminicard-shiny {
    padding: 0 5px;
    border: 1px solid #f0dcae;
    border-radius: 999px;
    background: #fff5dc;
    font-size: 10px;
    font-weight: 600;
    line-height: 15px;
    color: #a2660a;
}

.teraminicard-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.teraminicard-gem {
    width: 14px;
    height: 14px;
}

.teraminicard-tera {
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
}

.teraminicard-chip {
    padding: 0 5px;
    border: 1px solid var(--line2);
    border-radius: 6px;
    background: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    color: var(--text2);
}

.teraminicard-sub {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.teraminicard-extra {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.teraminicard-ivs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

.teraminicard-iv {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 3px 0;
    border: 1px solid var(--line2);
    border-radius: 6px;
    background: #fff;
}

.teraminicard-iv-label {
    font-size: 9px;
    line-height: 1.1;
    color: var(--text3);
}

.teraminicard-iv-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.2;
    color: var(--text2);
}

.teraminicard-iv.max {
    border-color: #cfe6cf;
    background: #f1f8f1;
}

.teraminicard-iv.max .teraminicard-iv-value {
    color: #2f7a37;
}

.teraminicard-moves {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.teraminicard-move {
    padding: 1px 8px;
    border: 1px solid var(--line2);
    border-radius: 999px;
    background: #fff;
    font-size: 11px;
    color: var(--text2);
}

/* ---------------- /tera、/tera-shop：整页只有一个 iframe ----------------
   窄屏样式（max-width:900px）会把 .app 改成 height:auto；这里是满屏 iframe，
   没有确定高度时 flex 子项会塌成一条，手机上看就只剩很短一截、内容显示不全。
   所以这一页永远按视口高度算，用 dvh 跟着手机地址栏伸缩。 */
.app.terapage {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

@media (max-width: 900px) {
    /* 手机地址栏收起/展开时别让整页跟着滚，滚动交给 iframe 自己 */
    body:has(> #app > .app.terapage) {
        overflow: hidden;
        overscroll-behavior: none;
    }

    .app.terapage > .topbar {
        flex: 0 0 auto;
    }

    /* 顶栏、控制栏按内容占位，剩下的全给 iframe */
    .app.terapage #teraHost {
        flex: 1 1 0;
        min-height: 0;
    }
}

/* =====================================================================
   /dex —— 全图鉴 HOME 直传
   整页独立：自己的顶栏 + 控制栏 + 左盒子 / 右精简编辑面板。
   生成走 AutoMod（ModLogic.GetRandomEncounter + LegalityAnalysis），
   编辑只写回原来那一格，页面里没有任何「新增 / 挪位」的入口。
   ===================================================================== */
.dexshell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #dae4f1 0%, #e5ecf6 50%, #edf2f8 100%);
}

/* ---------- 顶栏 ---------- */
.dextop {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 14px;
    background: linear-gradient(180deg, #ffffff 0%, #ecf1f8 100%);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 3px rgba(24, 42, 70, .06);
    position: relative;
    z-index: 30;
}

.dexback {
    display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
    border: 1px solid var(--line); border-radius: 4px; background: #fff;
    color: var(--text2); font-size: 11.5px; font-weight: 600; text-decoration: none;
    white-space: nowrap;
}
.dexback:hover { border-color: var(--accent); color: var(--accent); background: var(--accent2); }

.dextitle { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.dextitle b { font-size: 14px; letter-spacing: -.01em; white-space: nowrap; }
.dextitle i { font-style: normal; font-size: 11px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dexpills { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.dpill {
    height: 20px; padding: 0 7px; border-radius: 3px; background: #e6ebf2; color: var(--text2);
    font-size: 10.5px; font-weight: 600; display: inline-flex; align-items: center; white-space: nowrap;
}
.dpill.warn { background: var(--warnbg); color: var(--warn); }

/* ---------- 起始卡：选版本 ---------- */
.dexstart {
    flex: 1 1 auto; min-height: 0; overflow: auto;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 28px 18px 60px; text-align: center;
}
.dexstart h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.dexstart p { margin: 0; max-width: 620px; font-size: 12px; line-height: 1.7; color: var(--text2); }
.dexstartrow { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; justify-content: center; }
.dexstartrow select { width: auto; flex: 0 0 auto; min-width: 190px; height: 30px; font-size: 12.5px; }
.dexstartrow .btn { flex: none; height: 30px; padding: 0 16px; }
.dexfacts { display: flex; flex-direction: column; gap: 2px; font-size: 11px; line-height: 1.7; color: var(--text3); }
.dexfacts b { color: var(--text2); }
.dectrainer {
    max-width: 620px; font-size: 11.5px; line-height: 1.7; color: var(--text2);
    background: rgba(255, 255, 255, .74); border: 1px solid var(--line2); border-radius: 6px;
    padding: 8px 12px;
}
.dectrainer b { color: var(--text); }
.dectrainer a { color: var(--accent); }
.dexerr {
    font-size: 11.5px; color: var(--bad); background: var(--badbg);
    border: 1px solid #f0c9c9; border-radius: 5px; padding: 6px 11px;
}

/* ---------- 控制栏 ---------- */
.dexbar {
    flex: 0 0 auto;
    display: flex; flex-direction: column; gap: 6px;
    padding: 8px 14px 9px;
    background: rgba(255, 255, 255, .82);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(6px);
}
.dexbarline { display: flex; align-items: center; gap: 6px; font-size: 12px; min-width: 0; flex-wrap: wrap; }
.dexbarline b { font-size: 13px; white-space: nowrap; }
.dexsep { color: var(--text3); }
.dextrain { color: var(--text2); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dexctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dexctl .btn { height: 26px; padding: 0 12px; }
/* 「清缓存」和生成按钮同一行：高度对齐，别看着像个小一号的挂件 */
.dexctl .minibtn { height: 26px; padding: 0 10px; font-size: 11.5px; }
.dexchk {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; color: var(--text2); cursor: pointer; user-select: none;
}
.dexchk input[type="checkbox"] { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); cursor: pointer; }
/* 生成选项里的「闪光」下拉：和复选框同高，别把 control 行撑高 */
.dexpick select {
    width: auto; min-width: 92px; height: 24px; font-size: 11.5px; padding: 0 4px;
}

.dexprog { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text2); min-width: 0; }
.dexprogtrack {
    flex: 0 0 190px; height: 6px; border-radius: 3px; background: #dde5ef; overflow: hidden;
    border: 1px solid #cfd9e6;
}
.dexprogtrack > i { display: block; height: 100%; background: linear-gradient(90deg, #4a9bea, #0a64c8); transition: width .18s linear; }
.dexprog em { font-style: normal; color: var(--accent); font-weight: 600; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dexsum { font-size: 11.5px; color: var(--text2); }
.dexsum b { color: var(--text); }

.dexmissing {
    font-size: 11px; color: var(--text2);
    background: var(--warnbg); border: 1px solid #ecd9ae; border-radius: 5px; padding: 5px 9px;
}
.dexmissing > summary { cursor: pointer; color: var(--warn); font-weight: 600; }
.dexmissing p { margin: 6px 0 0; line-height: 1.7; word-break: break-word; }
.dexmissing b { color: var(--text); }

.dexdock {
    display: flex; align-items: center; gap: 10px;
    border-top: 1px dashed var(--line2); padding-top: 6px;
}
.dexdocktext { flex: 1 1 auto; min-width: 0; font-size: 11px; line-height: 1.6; color: var(--text3); }
.dexdocktext a { color: var(--accent); }
.dexdockbtns { display: flex; gap: 6px; flex: none; }
.dexdockbtns .minibtn { height: 24px; padding: 0 11px; font-size: 11.5px; }

/* ---------- 三栏：左精灵 / 中字段 / 右盒子（和原版网页 PK 编辑页一个布局） ---------- */
.dex3 {
    flex: 1 1 auto; min-height: 0;
    display: grid; grid-template-columns: 208px 396px minmax(0, 1fr);
    gap: 10px; padding: 10px;
}

/* 右栏：盒子塞进原来的 .boxpanel 面板里 */
.dexboxpanel { padding: 12px 12px 8px; }
.dexboxpanel .dexboxhead {
    flex: 0 0 auto; display: flex; align-items: center; gap: 7px;
    padding: 0 0 8px; border-bottom: 1px solid var(--line2); background: none;
}
.dexboxpanel .dexslots { padding: 8px 0 0; }
.dexboxpanel .dexhint {
    flex: 0 0 auto; margin-top: 6px; padding: 7px 2px 0;
    border-top: 1px solid var(--line2); background: none;
}
.dexboxhead .nav {
    width: 24px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 3px;
    background: #fff; color: var(--text2); font-size: 10px; font-family: inherit; cursor: pointer;
}
.dexboxhead .nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent2); }
.dexboxhead .nav:disabled { color: #c3cbd6; background: #f5f7fa; cursor: default; }
.dexboxname { font-size: 12px; font-weight: 700; white-space: nowrap; }
.dexcount { font-size: 10.5px; color: var(--text3); white-space: nowrap; }
.dexjump { flex: 0 0 180px; display: flex; align-items: center; gap: 4px; }
.dexjumplbl { flex: none; font-size: 10.5px; color: var(--text3); }
.dexjump .ss-input { height: 22px; font-size: 11px; }

.dexslots {
    flex: 1 1 auto; min-height: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: 5px;
    overflow: auto;
}
.dexslot {
    position: relative; min-width: 0; min-height: 0;
    border: 1px solid var(--line2); border-radius: 6px;
    background: linear-gradient(180deg, #ffffff, #f4f8fc);
    padding: 0; cursor: pointer; overflow: hidden;
    font-family: inherit; color: var(--text2);
    transition: border-color .12s ease, box-shadow .12s ease, transform .08s ease;
}
.dexslot:hover { border-color: var(--accent); box-shadow: 0 1px 6px rgba(10, 100, 200, .16); }
.dexslot:active { transform: scale(.985); }
.dexslot.empty { background: repeating-linear-gradient(45deg, #fafcff, #fafcff 5px, #f2f6fb 5px, #f2f6fb 10px); border-style: dashed; }
.dexslot .plus { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #c6d0dc; font-size: 15px; }
.dexslot img {
    position: absolute; left: 4%; top: 4%; width: 92%; height: 80%;
    object-fit: contain; pointer-events: none;
}
.dexslot .dexno {
    position: absolute; left: 3px; bottom: 1px;
    font-size: 9px; color: var(--text3); font-variant-numeric: tabular-nums;
}
.dexslot .dexstar { position: absolute; right: 2px; top: 2px; width: 11px; height: 11px; object-fit: contain; }
.dexslot.cur { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent2), 0 2px 8px rgba(10, 100, 200, .2); background: linear-gradient(180deg, #ffffff, #eaf4fe); }

.dexhint {
    font-size: 10.5px; line-height: 1.6; color: var(--text3);
}
.dexhint b { color: var(--text2); }

/* 中栏：数值表在 396px 里要收着点，不然四列加条子会顶出去 */
.dex3 .statgrid.s4 { grid-template-columns: 36px 40px minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 6px; }
.dex3 .statgrid input[type="number"] { min-width: 0; padding: 0 2px; }
.dex3 .moverow, .dex3 .movehdr { grid-template-columns: 20px minmax(0, 1fr) 30px 40px; gap: 6px; }

/* 奖章页：中栏窄，两张一排刚好 */
.dexribbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.dexribbar .btn { height: 28px; padding: 0 13px; }
.dex3 .ribbongrid { gap: 3px 10px; }

.dexmsg { font-size: 10.5px; line-height: 1.6; color: var(--text3); min-height: 14px; word-break: break-word; margin-top: 10px; }
.dexmsg.ok { color: var(--ok); }

.dexreport { font-size: 10.5px; margin-top: 6px; }
.dexreport > summary { cursor: pointer; color: var(--text2); font-weight: 600; }
.dexreport pre {
    margin: 5px 0 0; padding: 7px 8px; max-height: 190px; overflow: auto;
    background: #f7f9fc; border: 1px solid var(--line2); border-radius: 5px;
    font-size: 10px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}

/* 没选中时的空态 */
.dexemptypanel {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    color: var(--text3);
}
.dexemptypanel .de { font-size: 12.5px; font-weight: 700; color: var(--text2); }
.dechips { display: flex; flex-wrap: wrap; gap: 4px; }
.dechips > span {
    font-size: 10px; color: var(--text2); background: #f1f5fa;
    border: 1px solid var(--line2); border-radius: 10px; padding: 1px 8px; line-height: 16px;
}

/* ---------- 窄屏：整页滚动，编辑列自动折行，盒子跟在下面 ---------- */
@media (max-width: 900px) {
    .dexshell { height: auto; min-height: 100dvh; overflow: visible; }
    .dextop { position: sticky; top: 0; height: auto; min-height: 46px; flex-wrap: wrap; padding: 6px 10px; gap: 6px; }
    .dextitle i { display: none; }
    .dexpills { flex-basis: 100%; justify-content: flex-start; }
    .dexboxhead { flex-wrap: wrap; row-gap: 6px; }
    .dexboxhead .spacer { display: none; }
    .dexboxhead .dexjump { flex: 1 1 100%; }
    .dexbar { position: static; }
    .dexprogtrack { flex-basis: 110px; }
    .dex3 { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 8px; }
    .dexboxpanel { flex: none; }
    .dexslots { grid-auto-rows: auto; }
    .dexslot { aspect-ratio: 1; }
    .dexdock { flex-wrap: wrap; }
    .dexdocktext { flex-basis: 100%; }
    .dexdockbtns { width: 100%; }
    .dexdockbtns .minibtn { flex: 1 1 0; }
    .dexstart { justify-content: flex-start; padding-top: 34px; }
}

@media (max-width: 640px) {
    .dexemptypanel .ds { display: none; }
}

@media (max-width: 520px) {
    .dexslots { gap: 4px; padding: 6px; }
    .dexslot .dexstar { width: 9px; height: 9px; }
    .dexpick select { min-width: 82px; }
}

/* =====================================================================
   /home-dir —— HOME 直传功能（三个入口 + 任天堂账号绑定）
   页面本体是 Blazor（不是 iframe）：入口卡沿用首页 .htcard，绑定区独立一套。
   ===================================================================== */
.hdwrap {
    flex: 1 1 auto; min-height: 0; overflow: auto;
    padding: 22px 16px 60px;
}
.hdhead { max-width: 860px; margin: 0 auto 14px; }
.hdhead h1 { margin: 0 0 6px; font-size: 20px; font-weight: 700; color: #16395f; }
.hdhead p { margin: 0; font-size: 12px; line-height: 1.7; color: #62799a; }
/* 三张入口卡：宽屏一行三张，窄了自动折 */
.hdwrap .htgrid { max-width: 860px; margin: 0 auto; grid-template-columns: repeat(auto-fit, minmax(236px, 1fr)); }
/* 第一张「整箱直传」是最常用的入口，给它一点主推的份量，但别抢成主按钮 */
.hdwrap .htcard.hdmain { border-color: #a8c6e8; background: rgba(240, 247, 255, .92); }
.hdwrap .htcard.hdmain .htico { color: #fff; background: var(--accent); box-shadow: none; }
.hdwrap .htcard.hdmain .httext b { font-size: 13px; }

.hdaccount {
    max-width: 860px; margin: 16px auto 0;
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    padding: 14px 16px 15px;
    box-shadow: 0 2px 10px rgba(24, 66, 116, .05);
}
.hdacc-head { display: flex; align-items: center; gap: 8px; }
.hdacc-head b { font-size: 13.5px; color: #16395f; }
.hdbadge {
    padding: 0 7px; line-height: 18px; border-radius: 999px;
    font-size: 10.5px; font-weight: 700; color: #1d7a45;
    background: #eaf7ef; border: 1px solid #bfe3cd;
}
.hdnote { margin: 7px 0 0; font-size: 11.5px; line-height: 1.7; color: #5e7592; }
.hdnote b { color: #34567c; }
.hdnote code {
    padding: 0 3px; border-radius: 4px; background: #f1f4f9;
    font-size: 11px; color: #35577d;
}
.hdwarn {
    color: #8a5a00; background: #fff8e8;
    border: 1px solid #f1dcae; border-radius: 8px; padding: 7px 9px;
}
.hdok { color: var(--ok); }
.hdbad { color: var(--bad); }
/* 点了压灰的卡片：在页头下面挂一句原因，别把卡片挤变形（和卡片区同宽居中） */
.hdneedbar { max-width: 860px; margin: -4px auto 10px; }
.hddim { color: #7d8fa6; }
.hdcurrent {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-top: 9px; padding: 7px 10px; border-radius: 8px;
    background: #f6f9fd; border: 1px solid #dbe7f5;
    font-size: 12px; color: #4a6a8d;
}
.hdcurrent b { color: #16395f; }
.hdcurrent i { font-style: normal; font-size: 11px; color: #7d8fa6; }
.hdfields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 11px; }
.hdfield { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hdfield > span { font-size: 11px; font-weight: 600; color: #4a6a8d; }
.hdinput {
    height: 30px; padding: 0 9px; min-width: 0;
    font: inherit; font-size: 12.5px; color: var(--text);
    border: 1px solid var(--line); border-radius: 7px; background: #fff;
}
.hdinput:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent2); }
.hdacts { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }

@media (max-width: 640px) {
    .hdwrap { padding: 16px 12px 48px; }
    .hdfields { grid-template-columns: minmax(0, 1fr); }
}
/* 聚合页卡片上的资格小标：比标题矮一行，别和标题挤在一行里换行 */
.hdneed {
    display: inline-block; margin-top: 5px; padding: 0 6px;
    font-style: normal; font-size: 10px; font-weight: 700; line-height: 16px;
    color: #9a6a12; background: #fdf3dc; border: 1px solid #f0dcae; border-radius: 5px;
    white-space: nowrap;
}
