/* 随机抽 · 课堂大屏版
   视觉系统完全沿用小程序：
   - 主渐变 linear-gradient(135deg, #5b5cf7 0%, #8a5cf6 60%, #b06ef8 100%)
   - 主色 #4a3fd6 / #5b5cf7，浅紫底 #eef0ff，页底 #f4f5fa
   - 停止态红色 linear-gradient(135deg, #f0554b 0%, #e34d59 100%)
   大屏适配：字号按视口高度缩放，点击区 ≥44px，浅紫底深字投影不泛白
*/

:root {
    --page: #f4f5fa;
    --card: #ffffff;
    --ink: #1f2329;
    --ink-2: #4a4f63;
    --ink-3: #9aa0b5;
    --line: #ebedf5;
    --line-2: #e5e7f2;

    --violet: #5b5cf7;
    --violet-deep: #4a3fd6;
    --violet-mid: #8a5cf6;
    --violet-light: #b06ef8;
    --violet-soft: #eef0ff;
    --violet-wash: #f7f5ff;

    --grad: linear-gradient(135deg, #5b5cf7 0%, #8a5cf6 60%, #b06ef8 100%);
    --grad-flat: linear-gradient(135deg, #5b5cf7 0%, #8a5cf6 100%);
    --grad-hot: linear-gradient(135deg, #f0554b 0%, #e34d59 100%);

    --shadow-hero: 0 18px 40px rgba(91, 92, 247, 0.28);
    --shadow-card: 0 10px 30px rgba(30, 36, 66, 0.07);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    background: var(--page);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

/* ---------------- 登录 ---------------- */

.login {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 卡片比屏幕高时（小笔记本 1280×720 实测卡片 953px 高）允许滚动，
       否则上下被裁、底部「登录」按钮永远点不到。
       ★ 必须是 safe center：普通 center 在内容超高时会把顶部推到滚动区之外，
         滚到底也回不到上面（手机窄屏实测按钮永远差 40px 点不到）。 */
    align-items: safe center;
    overflow-y: auto;
    padding: 16px 0;
    background:
        radial-gradient(circle at 22% 18%, rgba(176, 110, 248, 0.22) 0%, rgba(176, 110, 248, 0) 46%),
        radial-gradient(circle at 78% 82%, rgba(91, 92, 247, 0.18) 0%, rgba(91, 92, 247, 0) 48%),
        linear-gradient(160deg, #f7f5ff 0%, #f2f1fc 50%, #eef0ff 100%);
}

.login.is-hidden {
    display: none;
}

.login-card {
    margin: 0;
    width: min(560px, 88vw);
    padding: clamp(26px, 4.6vh, 48px);
    border-radius: 32px;
    background: var(--card);
    box-shadow: 0 24px 70px rgba(70, 60, 160, 0.16);
    text-align: center;
}

.login-crest {
    width: clamp(60px, 8.6vh, 88px);
    height: clamp(60px, 8.6vh, 88px);
    border-radius: 50%;
    box-shadow: 0 8px 22px rgba(70, 60, 160, 0.22);
}

.login-brand {
    margin-top: 12px;
    font-size: clamp(32px, 4.4vh, 50px);
    font-weight: 800;
    letter-spacing: 2px;
    background: var(--grad-flat);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 副标题做成紫色胶囊，与小程序注册页标语保持一致
   line-height 写死：inline-block 用 normal 时行框会吃掉下方空间，
   跟下面那排登录方式标签挤在一起（实测间距 0px） */
.login-sub {
    display: inline-block;
    margin-top: 12px;
    padding: 7px 22px;
    border-radius: 999px;
    background: var(--grad-flat);
    box-shadow: 0 6px 16px rgba(91, 92, 247, 0.26);
    color: #ffffff;
    font-size: clamp(15px, 1.9vh, 20px);
    font-weight: 600;
    letter-spacing: 1.5px;
    line-height: 1.25;
}

.login-label {
    display: block;
    margin-top: clamp(16px, 2.4vh, 26px);
    color: var(--ink-2);
    font-size: clamp(14px, 1.7vh, 18px);
    font-weight: 600;
    text-align: left;
}

.login-input {
    width: 100%;
    height: clamp(50px, 6.6vh, 64px);
    margin-top: 8px;
    padding: 0 18px;
    border: 2px solid var(--line-2);
    border-radius: 14px;
    background: #fbfbff;
    color: var(--ink);
    font-size: clamp(17px, 2.2vh, 22px);
    font-family: inherit;
    outline: none;
    text-align: left;
}

.login-input:focus {
    border-color: var(--violet);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(91, 92, 247, 0.12);
}

.login-code-row {
    display: flex;
    gap: 12px;
}

.login-code-row .login-input {
    flex: 1;
    min-width: 0;
}

.login-code-btn {
    flex-shrink: 0;
    height: clamp(50px, 6.6vh, 64px);
    margin-top: 8px;
    padding: 0 20px;
    border: 2px solid var(--violet);
    border-radius: 14px;
    background: #fff;
    color: var(--violet-deep);
    font-size: clamp(15px, 2vh, 19px);
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.login-code-btn:disabled {
    border-color: var(--line-2);
    color: var(--ink-3);
    cursor: default;
}

/* 次要按钮：显示/隐藏密码，比主按钮弱一档 */
.login-code-btn-ghost {
    border-color: var(--line-2);
    color: var(--ink-2);
}

/* 登录方式切换：验证码 / 密码，与小程序端一致。
   margin-top 给足：上方是标题胶囊，两者原来贴着（0px），看着像叠在一起 */
.login-tabs {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    margin-bottom: 6px;
}

.login-tab {
    flex: 1;
    padding: 10px 0;
    border: 2px solid var(--line-2);
    border-radius: 14px;
    background: #fff;
    color: var(--ink-2);
    font-size: clamp(14px, 1.9vh, 18px);
    font-weight: 600;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
}

.login-tab.is-on {
    border-color: var(--violet);
    background: var(--violet-soft);
    color: var(--violet-deep);
    font-weight: 700;
}

.login-tab.is-hidden {
    display: none;
}

/* 卡片内文字链接：忘记密码 / 返回登录，独立一行避免误触 */
.login-link {
    margin-top: 6px;
    padding: 10px 0;
    color: var(--violet-deep);
    font-size: clamp(13px, 1.8vh, 17px);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

/* 记住手机号和密码的勾选行（照「小喇叭」那套）
   勾用 SVG 背景画，不用字符 ✓ —— 字符勾和样式勾会叠成两个对号 */
.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 10px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.remember-box {
    width: 18px;
    height: 18px;
    flex: none;
    border-radius: 6px;
    border: 1.5px solid #d5d8e6;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.14s ease, border-color 0.14s ease;
    position: relative;
}

.remember-box::after {
    content: "";
    width: 11px;
    height: 11px;
    background: no-repeat center/contain url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.remember-row.is-on .remember-box {
    background: var(--violet);
    border-color: var(--violet);
}

.remember-row.is-on .remember-box::after {
    opacity: 1;
    transform: scale(1);
}

.remember-text {
    font-size: clamp(12px, 1.6vh, 16px);
    color: var(--ink-3);
}

    /* 最近登录过的手机号（复刻「小喇叭」2026-11-05：输入框聚焦时下拉选择） */
    .phone-wrap {
        position: relative;
    }
    .recent-pop {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        margin-top: 8px;
        z-index: 60;
        background: #fff;
        border: 2px solid #e3dcff;
        border-radius: 16px;
        box-shadow: 0 12px 30px rgba(40, 30, 90, 0.18);
        padding: 8px;
        text-align: left;
        max-height: 260px;
        overflow-y: auto;
    }
    .recent-pop[hidden] {
        display: none;
    }
    .rp-tip {
        display: block;
        margin: 4px 8px 6px;
        color: #9aa0b5;
        font-size: 13px;
    }
    .rp-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 11px 14px;
        border-radius: 12px;
        cursor: pointer;
    }
    .rp-item:hover {
        background: #f3f0ff;
    }
    .rp-num {
        color: #23263a;
        font-size: 17px;
        font-weight: 600;
        letter-spacing: 1px;
    }
    .rp-x {
        display: flex;
        width: 26px;
        height: 26px;
        flex: none;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #f0edff;
        color: #7a6bd6;
        font-size: 18px;
        font-weight: 700;
        cursor: pointer;
    }
    .rp-x:hover {
        background: #e4ddff;
    }

.login-error {
    min-height: 22px;
    margin-top: 10px;
    color: #e34d59;
    font-size: clamp(13px, 1.7vh, 17px);
    text-align: left;
}

.login-btn {
    width: 100%;
    height: clamp(54px, 7.2vh, 70px);
    margin-top: 4px;
    border: 0;
    border-radius: 16px;
    background: var(--grad-flat);
    color: #fff;
    font-size: clamp(18px, 2.4vh, 24px);
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(91, 92, 247, 0.32);
}

.login-btn:disabled {
    background: #b9bcd4;
    box-shadow: none;
    cursor: default;
}

.login-tip {
    margin-top: 14px;
    color: var(--ink-3);
    font-size: clamp(12px, 1.6vh, 16px);
    line-height: 1.6;
}

.login-tip-ok {
    color: #2f8f5b;
}

.login-tip-warn {
    color: #e34d59;
}

/* ---------------- 主界面 ---------------- */

.app {
    display: none;
    height: 100%;
    flex-direction: column;
}

.app.is-on {
    display: flex;
}

/* ---------------- 顶部紫色信息栏 ---------------- */

.hero {
    /* sticky 兜底：只要外层容器滚动，品牌卡就贴顶不动。
       手机上另外把 .app 改成不滚、只让 .stage 滚（见文末适配层），
       那种情况下 hero 本来就不会动，这条不用担心出现缝隙。 */
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-shrink: 0;
    /* 固定高度：校名再长、组再多也不许把下面的抽取区挤扁 */
    height: clamp(86px, 12.5vh, 150px);
    margin: clamp(8px, 1.4vh, 16px) clamp(14px, 1.8vw, 30px) 0;
    padding: 0 clamp(16px, 2vw, 32px);
    align-items: center;
    justify-content: space-between;
    gap: clamp(10px, 1.4vw, 24px);
    border-radius: 30px;
    background: var(--grad);
    box-shadow: var(--shadow-hero);
    overflow: hidden;
}

/* 右上角一团亮光，让渐变有层次 */
.hero::after {
    position: absolute;
    top: -70px;
    right: -50px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 68%);
    content: "";
    pointer-events: none;
}

.hero-main {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: clamp(10px, 1.3vw, 20px);
    z-index: 1;
}

.hero-crest {
    width: clamp(54px, 7.6vh, 84px);
    height: clamp(54px, 7.6vh, 84px);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 20px rgba(30, 20, 90, 0.3);
    flex-shrink: 0;
    object-fit: cover;
}

.hero-text {
    min-width: 0;
}

.hero-school {
    /* 不再截断：长校名让字号自动降一档（--school-adj 由 JS 按字数设置） */
    max-width: 34vw;
    color: #fff;
    font-size: calc(clamp(19px, 2.9vh, 33px) * var(--school-adj, 1));
    font-weight: 800;
    letter-spacing: calc(2px * var(--school-adj, 1));
    line-height: 1.24;
    /* ★ 2026-11-30 老板「学校名怎么换行了」：校名必须一行。
       hero-text 是 hero-main 里唯一可收缩的项，窗口一窄就被压到一百多像素，
       原来靠 word-break 允许折行 → 「山东省昌乐第一中学」折成两行。
       现在禁止折行，放不下由 JS（bigscreen.js 的 fitSchoolWidth）按实测宽度降字号。
       word-break 留着是给手机档做省略号截断用的兜底。 */
    white-space: nowrap;
    word-break: break-word;
    text-shadow: 0 2px 10px rgba(40, 24, 110, 0.22);
}

.hero-meta {
    display: flex;
    margin-top: 5px;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hero-member {
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(12px, 1.6vh, 17px);
    letter-spacing: 1px;
}

.hero-tag {
    overflow: hidden;
    max-width: 22vw;
    padding: 3px 13px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.96);
    font-size: clamp(11px, 1.45vh, 15px);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 三个关键数字 */

.hero-stats {
    display: flex;
    padding: clamp(6px, 1vh, 12px) clamp(12px, 1.6vw, 24px);
    align-items: center;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.16);
    flex-shrink: 0;
    z-index: 1;
}

.stat {
    display: flex;
    min-width: clamp(72px, 6.6vw, 104px);
    align-items: center;
    flex-direction: column;
}

.stat-num {
    color: #fff;
    font-size: clamp(22px, 3.2vh, 38px);
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.84);
    font-size: clamp(11px, 1.35vh, 14px);
    letter-spacing: 1px;
    white-space: nowrap;
}

.stat-line {
    width: 1px;
    height: clamp(26px, 3.6vh, 40px);
    background: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

/* 右侧操作区 */

.hero-ops {
    display: flex;
    align-items: center;
    gap: clamp(4px, 0.55vw, 9px);
    flex-wrap: wrap;
    justify-content: flex-end;
    /* 2026-11-30 老板「右侧胶囊太拥挤，往左一点」：
       按钮整体收小一档、行距收紧之后，再往左让一点，别贴着品牌卡右边沿。
       版本号是这排的最后一项（占着原全屏按钮的位置），所以它也跟着一起进来。 */
    margin-right: clamp(10px, 1.4vw, 24px);
    z-index: 1;
}

.seg {
    display: flex;
    padding: 3px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
}

.seg-btn {
    /* 2026-11-30 老板「右侧胶囊太拥挤，整体小一点」：
       三颗（学生/老师/抽签）原来 min-width 到 84px、字 18px，把整排挤到折行；
       现在收到 60px / 16px 封顶，靠文字+内边距撑，不再硬占宽度。 */
    min-width: clamp(46px, 3.6vw, 60px);
    height: clamp(34px, 4.2vh, 46px);
    padding: 0 11px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.84);
    font-size: clamp(12px, 1.5vh, 16px);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.seg-btn.is-on {
    background: #fff;
    color: var(--violet-deep);
    box-shadow: 0 3px 10px rgba(40, 24, 110, 0.18);
}

.glass-btn {
    height: clamp(34px, 4.2vh, 46px);
    padding: 0 clamp(10px, 1vw, 17px);
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: clamp(11.5px, 1.5vh, 15.5px);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.glass-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

.glass-btn-quiet {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.82);
}

/* ---------------- 舞台 ---------------- */

.stage {
    position: relative;
    display: flex;
    flex: 1;
    min-height: 0;
    margin: clamp(8px, 1.4vh, 16px) clamp(14px, 1.8vw, 30px) 0;
    padding: clamp(12px, 2.2vh, 28px);
    align-items: center;
    justify-content: center;
    border-radius: 28px;
    background: radial-gradient(circle at 50% 0%, #faf9ff 0%, #ffffff 62%);
    box-shadow: var(--shadow-card);
}

.pane {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.pane.is-on {
    display: flex;
}

/* 待机 */

.idle-ring {
    display: flex;
    width: clamp(96px, 14vh, 150px);
    height: clamp(96px, 14vh, 150px);
    margin-bottom: clamp(10px, 1.8vh, 22px);
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--grad-flat);
    box-shadow: 0 16px 40px rgba(91, 92, 247, 0.3);
}

.idle-crest {
    width: 62%;
    height: 62%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    object-fit: cover;
}

.idle-mark {
    color: var(--ink);
    font-size: clamp(32px, 5.4vh, 70px);
    font-weight: 800;
    letter-spacing: 6px;
}

.idle-hint {
    margin-top: clamp(8px, 1.4vh, 18px);
    color: var(--ink-3);
    font-size: clamp(14px, 1.9vh, 21px);
    letter-spacing: 1px;
}

/* 滚动 */

.roll-mode,
.result-mode {
    flex-shrink: 0;
    margin-bottom: clamp(8px, 1.6vh, 20px);
    padding: 5px 20px;
    border-radius: 999px;
    background: var(--violet-soft);
    color: var(--violet-deep);
    font-size: clamp(14px, 1.9vh, 21px);
    font-weight: 700;
    letter-spacing: 1px;
}

.roll-grid {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(8px, 1.4vw, 22px);
}

.roll-tile {
    display: flex;
    min-width: clamp(160px, 16vw, 300px);
    padding: clamp(14px, 2.6vh, 36px) clamp(22px, 2.8vw, 48px);
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: var(--grad-flat);
    color: #fff;
    font-size: clamp(30px, 5.8vh, 76px);
    font-weight: 800;
    letter-spacing: 2px;
    box-shadow: 0 14px 34px rgba(91, 92, 247, 0.3);
}

/* 停止瞬间「落定」：滚动格定格成真正中奖者时的高亮，强调「随机收敛到这个结果」 */
.roll-tile.is-win {
    background: linear-gradient(135deg, #6a6cf8, #9b5cf7);
    font-size: clamp(22px, 4vh, 56px);
    box-shadow: 0 14px 34px rgba(91, 92, 247, 0.45);
}

/* 结果 */

.result-grid {
    display: flex;
    width: 100%;
    flex: 1;
    min-height: 0;
    align-content: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: calc(clamp(8px, 1.2vw, 20px) * var(--tile-scale, 1));
    /* 人多时由 JS 设 --tile-scale 整体缩小，这里兜底防止溢出盖住按钮 */
    overflow: hidden;
}

.result-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    /* --tile-scale 由 JS 按人数设置：人越多卡越小，保证一屏放得下 */
    padding: calc(clamp(12px, 2.2vh, 28px) * var(--tile-scale, 1)) calc(clamp(18px, 2.2vw, 40px) * var(--tile-scale, 1));
    border: 2px solid rgba(91, 92, 247, 0.18);
    border-radius: calc(22px * var(--tile-scale, 1));
    background: var(--violet-soft);
    color: var(--violet-deep);
    font-size: calc(clamp(28px, 5.2vh, 70px) * var(--tile-scale, 1));
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.15;
    animation: pop 0.36s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

@keyframes pop {
    from {
        opacity: 0;
        transform: scale(0.84) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.result-group-name {
    padding: 4px 18px;
    border-radius: 999px;
    background: var(--violet-soft);
    color: var(--violet-deep);
}

.result-foot {
    flex-shrink: 0;
    margin-top: clamp(8px, 1.6vh, 18px);
    color: var(--ink-3);
    font-size: clamp(13px, 1.8vh, 20px);
    letter-spacing: 1px;
}

/* 提示条 */

.toast {
    position: absolute;
    bottom: 16px;
    left: 50%;
    padding: 11px 24px;
    border-radius: 999px;
    background: rgba(31, 35, 41, 0.9);
    color: #fff;
    font-size: clamp(13px, 1.8vh, 18px);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity 0.2s, transform 0.2s;
}

.toast.is-on {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ===== 左右滑动切换抽法：闪现抽法名 + 待机提示 ===== */
.mode-flash {
    position: absolute;
    left: 50%;
    top: 18px;
    transform: translateX(-50%) translateY(-6px);
    padding: 7px 18px;
    border-radius: 999px;
    background: rgba(91, 92, 247, .92);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 6px 18px rgba(91, 92, 247, .3);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 30;
}
.mode-flash.is-on {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------------- 底部控制台 ---------------- */

.dock {
    flex-shrink: 0;
    padding: clamp(6px, 1.2vh, 14px) clamp(14px, 1.8vw, 30px) clamp(8px, 1.6vh, 18px);
}

.dock-row {
    display: flex;
    align-items: center;
    gap: clamp(7px, 0.9vw, 15px);
}

.dock-modes {
    justify-content: center;
    flex-wrap: wrap;
}

.seg-mode {
    padding: 4px;
    background: #e9e9f7;
}

.seg-mode .seg-btn {
    min-width: clamp(90px, 8.4vw, 126px);
    height: clamp(44px, 5.6vh, 60px);
    color: var(--ink-2);
    font-size: clamp(15px, 2vh, 21px);
}

.seg-mode .seg-btn.is-on {
    background: #fff;
    color: var(--violet-deep);
}

/* 抽签按钮已融合成抽法切换栏的第 4 个同款胶囊（.seg-btn），
   不再单独做紫色小胶囊；样式完全继承 .seg-btn，逻辑靠 data-act="lottery" 区分。 */

.stepper {
    display: flex;
    height: clamp(44px, 5.6vh, 60px);
    padding: 0 5px;
    align-items: center;
    border: 2px solid var(--line-2);
    border-radius: 14px;
    background: #fff;
}

.stepper-label {
    padding: 0 10px 0 8px;
    color: var(--ink-2);
    font-size: clamp(12px, 1.75vh, 17px);
    font-weight: 600;
    white-space: nowrap;
}

.step-btn {
    width: clamp(42px, 4.8vh, 54px);
    height: clamp(32px, 4.2vh, 44px);
    border: 0;
    border-radius: 10px;
    background: var(--violet-soft);
    color: var(--violet-deep);
    font-size: clamp(20px, 2.8vh, 28px);
    font-weight: 700;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
}

.step-val {
    min-width: clamp(42px, 3.4vw, 58px);
    color: var(--ink);
    font-size: clamp(20px, 2.8vh, 30px);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.soft-btn {
    height: clamp(44px, 5.6vh, 60px);
    padding: 0 20px;
    border: 2px solid #fbd9dc;
    border-radius: 14px;
    background: #fff5f6;
    color: #d93a45;
    font-size: clamp(13px, 1.75vh, 17px);
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.dock-scope {
    margin-top: clamp(5px, 0.9vh, 11px);
    justify-content: center;
    flex-wrap: nowrap;
    /* 预留一行高度：切到抽小组/组内抽时不再隐藏本行，避免控制台高度变化导致整页上下窜动 */
    min-height: clamp(40px, 4.8vh, 54px);
}

/* 切到非「抽人」模式时：保留整行在布局里（只藏内容、不塌高度），
   页面整体高度不变 → 中间「准备就绪」区域不再上下跳。
   必须显式把 display 改回 flex：全局 `.is-hidden{display:none}` 优先级低但属性是 display，
   只设 visibility 盖不住它，隐藏行仍会塌陷（这就是之前「还会跳」的根因）。 */
.dock-scope.is-hidden {
    display: flex;
    visibility: hidden;
}

.scope-label {
    color: var(--ink-3);
    font-size: clamp(12px, 1.65vh, 16px);
    font-weight: 600;
    white-space: nowrap;
}

.scope-chips {
    display: flex;
    /* 固定一行 + 横向滚动：组再多、组名再长，控制台高度都不变 */
    flex-wrap: nowrap;
    gap: clamp(5px, 0.7vw, 11px);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0;
    scrollbar-width: thin;
    /* 组少时居中；组多到需要滚动时从左开始（safe 防止居中把首项裁掉） */
    justify-content: safe center;
    max-width: min(100%, 1400px);
}

.scope-chips::-webkit-scrollbar {
    height: 6px;
}

.scope-chips::-webkit-scrollbar-thumb {
    border-radius: 3px;
    background: rgba(91, 92, 247, 0.28);
}

.scope-chip {
    height: clamp(36px, 4.6vh, 50px);
    padding: 0 16px;
    flex-shrink: 0;
    white-space: nowrap;
    border: 2px solid var(--line-2);
    border-radius: 999px;
    background: #fafbff;
    color: var(--ink-3);
    font-size: clamp(12px, 1.65vh, 16px);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.scope-chip.is-on {
    border-color: var(--violet);
    background: var(--violet-soft);
    color: var(--violet-deep);
}

.draw-btn {
    display: block;
    width: min(100%, 900px);
    height: clamp(66px, 10vh, 118px);
    margin: clamp(7px, 1.3vh, 14px) auto 0;
    border: 0;
    border-radius: 24px;
    background: var(--grad);
    color: #fff;
    font-size: clamp(23px, 3.6vh, 44px);
    font-weight: 800;
    font-family: inherit;
    letter-spacing: 8px;
    cursor: pointer;
    box-shadow: 0 16px 36px rgba(91, 92, 247, 0.34);
    transition: transform 0.08s, box-shadow 0.2s;
}

.draw-btn:active {
    transform: scale(0.988);
    box-shadow: 0 10px 24px rgba(91, 92, 247, 0.28);
}

.draw-btn.is-stop {
    background: var(--grad-hot);
    box-shadow: 0 16px 36px rgba(227, 77, 89, 0.34);
}

.draw-btn:disabled {
    background: #c3c6da;
    box-shadow: none;
    cursor: default;
}

/* ---------------- 历史 ---------------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(24, 20, 60, 0.52);
}

.modal.is-on {
    display: flex;
}

.modal-card {
    display: flex;
    width: min(920px, 90vw);
    max-height: 78vh;
    border-radius: 26px;
    background: #fff;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(30, 20, 90, 0.3);
}

.modal-head {
    display: flex;
    flex-shrink: 0;
    padding: 18px 24px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.modal-title {
    font-size: clamp(18px, 2.4vh, 24px);
    font-weight: 800;
}

.modal-close {
    height: 44px;
    padding: 0 20px;
    border: 2px solid var(--line-2);
    border-radius: 12px;
    background: #fff;
    color: var(--ink-2);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.modal-body {
    overflow-y: auto;
    padding: 18px 24px 24px;
}

.hist-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.hist-item:last-child {
    border-bottom: 0;
}

.hist-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.hist-time {
    color: var(--ink);
    font-size: clamp(15px, 2vh, 19px);
    font-weight: 700;
}

.hist-count {
    color: var(--ink-3);
    font-size: clamp(13px, 1.7vh, 16px);
}

.hist-mode {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--violet-soft);
    color: var(--violet-deep);
    font-size: clamp(12px, 1.6vh, 15px);
    font-weight: 600;
}

.hist-names {
    margin-top: 8px;
    color: var(--ink-2);
    font-size: clamp(14px, 1.9vh, 18px);
    line-height: 1.65;
}

.hist-group {
    color: var(--violet-deep);
    font-weight: 700;
}

.hist-empty {
    padding: 40px 0;
    color: var(--ink-3);
    font-size: 17px;
    text-align: center;
}

/* ---------------- 导入名单（网页端复刻小程序 roster.js） ---------------- */

.import-card {
    position: relative;
    width: min(680px, 92vw);
}

.import-tabs {
    display: flex;
    gap: 8px;
    padding: 14px 24px 0;
    flex-shrink: 0;
}

.import-tab {
    padding: 9px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--violet-soft);
    color: var(--violet-deep);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.import-tab.is-on {
    background: var(--violet);
    color: #fff;
}

.import-body {
    padding: 16px 24px 20px;
}

.import-text {
    width: 100%;
    min-height: 150px;
    max-height: 38vh;
    padding: 14px 16px;
    border: 2px solid var(--line-2);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.7;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.import-text:focus {
    outline: 0;
    border-color: var(--violet);
}

.import-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.import-mini-label {
    color: var(--ink-2);
    font-size: 15px;
    font-weight: 600;
}

.stepper-mini {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px;
    border: 2px solid var(--line-2);
    border-radius: 999px;
}

.stepper-mini .step-btn {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: var(--violet-soft);
    color: var(--violet-deep);
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
}

.stepper-mini .step-val {
    min-width: 26px;
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
}

.import-hint {
    color: var(--ink-3);
    font-size: 14px;
}

.import-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    justify-content: center;
}

.import-empty {
    width: 100%;
    padding: 18px 0;
    color: var(--ink-3);
    font-size: 15px;
    text-align: center;
}

.import-chip {
    padding: 6px 13px;
    border-radius: 999px;
    background: var(--grad-flat);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(91, 92, 247, 0.25);
}

.import-chip-more {
    background: var(--line);
    color: var(--ink-2);
}

/* 确认弹层里的胶囊预览（继承 .import-preview 居中） */
.import-confirm-chips {
    margin-top: 12px;
    max-height: 132px;
    overflow-y: auto;
}

/* 胶囊点击颤动：范围选择胶囊 + 导入预览胶囊 */
@keyframes capsule-tremble {
    0%   { transform: translateX(0) rotate(0); }
    15%  { transform: translateX(-3px) rotate(-2.5deg); }
    30%  { transform: translateX(3px) rotate(2.5deg); }
    45%  { transform: translateX(-2px) rotate(-1.5deg); }
    60%  { transform: translateX(2px) rotate(1.5deg); }
    75%  { transform: translateX(-1px) rotate(-0.8deg); }
    100% { transform: translateX(0) rotate(0); }
}

.scope-chip.is-shake,
.import-chip.is-shake {
    animation: capsule-tremble 0.42s ease;
}

.import-file-label {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 2px dashed var(--line-2);
    border-radius: 14px;
    color: var(--ink-2);
    font-size: 15px;
    cursor: pointer;
}

.import-file-label input[type="file"] {
    font-size: 14px;
}

.import-tpl-tip {
    margin: 0 0 10px;
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.6;
}

.import-tpl {
    margin: 0 0 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f6f5ff;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.7;
    white-space: pre;
    overflow-x: auto;
}

.modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 24px;
    border-top: 1px solid var(--line);
    flex-shrink: 0;
}

.draw-btn-sm {
    height: 44px;
    padding: 0 26px;
    border: 0;
    border-radius: 14px;
    background: var(--violet);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
}

.draw-btn-sm:active {
    transform: translateY(1px);
}

/* 二次确认：覆盖在卡片内的小弹层 */
.import-confirm {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(24, 20, 60, 0.42);
    border-radius: 26px;
    z-index: 2;
}

.import-confirm.is-on {
    display: flex;
}

.import-confirm-card {
    width: min(420px, 86%);
    padding: 22px 22px 18px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(30, 20, 90, 0.3);
}

.import-confirm-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
}

.import-confirm-text {
    margin: 12px 0 18px;
    color: var(--ink-2);
    font-size: 15px;
    line-height: 1.6;
}

.import-confirm-btns {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 手机 / 平板上导入弹层适配 */
html[data-device="phone"] .import-tabs,
html[data-device="phone-land"] .import-tabs {
    padding: 12px 16px 0;
}

html[data-device="phone"] .import-body,
html[data-device="phone-land"] .import-body {
    padding: 14px 16px 18px;
}

html[data-device="phone"] .import-text {
    min-height: 120px;
    font-size: 16px;
}

html[data-device="phone"] .import-tab,
html[data-device="phone-land"] .import-tab {
    padding: 8px 14px;
    font-size: 14px;
}

html[data-device="phone"] .modal-foot,
html[data-device="phone-land"] .modal-foot {
    padding: 12px 16px;
    flex-wrap: wrap;
}

html[data-device="phone"] .draw-btn-sm {
    height: 46px;
    flex: 1;
}

html[data-device="phone"] .import-confirm-card {
    width: 90%;
}

/* ---------------- 试用状态徽章（与小程序一致） ---------------- */

.hero-trial {
    padding: 3px 13px;
    border-radius: 20px;
    /* 试用剩余 / 到期提醒：统一红色，醒目地催老师尽快激活（老板要求） */
    background: rgba(255, 92, 92, 0.45);
    color: #fff;
    font-size: clamp(11px, 1.45vh, 15px);
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.hero-trial.is-low {
    background: rgba(255, 80, 80, 0.62);
    color: #fff;
}

.hero-trial.is-out {
    background: rgba(255, 58, 58, 0.85);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.hero-trial.is-hidden {
    display: none;
}

/* ---------------- 试用到期 / 停用 拦截面板 ---------------- */

.modal-gate {
    z-index: 60;
}

.gate-card {
    width: min(680px, 88vw);
    max-height: 82vh;
    padding: clamp(24px, 4vh, 44px);
    align-items: center;
    text-align: center;
}

.gate-icon {
    display: flex;
    width: clamp(56px, 8vh, 76px);
    height: clamp(56px, 8vh, 76px);
    margin: 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0554b 0%, #e34d59 100%);
    color: #fff;
    font-size: clamp(28px, 4vh, 40px);
    font-weight: 800;
}

.gate-title {
    margin-top: clamp(14px, 2.2vh, 22px);
    color: var(--ink);
    font-size: clamp(20px, 2.8vh, 28px);
    font-weight: 800;
}

.gate-text {
    margin-top: 8px;
    color: var(--ink-2);
    font-size: clamp(14px, 1.9vh, 18px);
    line-height: 1.6;
}

.gate-code {
    display: flex;
    width: 100%;
    margin-top: clamp(16px, 2.4vh, 26px);
    gap: 10px;
}

.gate-input {
    flex: 1;
    min-width: 0;
    height: clamp(48px, 6.4vh, 62px);
    padding: 0 16px;
    border: 2px solid var(--line-2);
    border-radius: 14px;
    background: #fbfbff;
    color: var(--ink);
    font-size: clamp(15px, 2vh, 19px);
    font-family: inherit;
    outline: none;
    letter-spacing: 1px;
}

.gate-input:focus {
    border-color: var(--violet);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(91, 92, 247, 0.12);
}

.gate-btn {
    flex-shrink: 0;
    height: clamp(48px, 6.4vh, 62px);
    padding: 0 26px;
    border: 0;
    border-radius: 14px;
    background: var(--grad-flat);
    color: #fff;
    font-size: clamp(15px, 2vh, 19px);
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(91, 92, 247, 0.28);
}

.gate-btn:disabled {
    background: #b9bcc4;
    box-shadow: none;
    cursor: default;
}

.gate-error {
    min-height: 22px;
    margin-top: 8px;
    color: #e34d59;
    font-size: clamp(13px, 1.7vh, 17px);
}

.gate-tip {
    margin-top: 6px;
    color: var(--ink-3);
    font-size: clamp(12px, 1.6vh, 16px);
    line-height: 1.6;
}

.gate-close {
    margin-top: clamp(14px, 2vh, 22px);
    height: clamp(44px, 5.6vh, 56px);
    padding: 0 32px;
    border: 2px solid var(--line-2);
    border-radius: 14px;
    background: #fff;
    color: var(--ink-2);
    font-size: clamp(14px, 1.8vh, 18px);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.gate-card .gate-code.is-hidden {
    display: none;
}

/* ---------------- 版本号（与小程序页脚同一版） ---------------- */

.login-version,
.app-version {
    color: #b8bccd;
    font-size: clamp(11px, 1.5vh, 15px);
    letter-spacing: 1px;
    text-align: center;
}

.login-version {
    margin-top: 12px;
}

/* 品牌卡右上角版本号：亮色描边小药丸，点了看更新说明。
   ★ 2026-11-30 老板最终定：全屏按钮去掉，版本号接过它原来的位置 —— 按钮排最右。
     所以这里是普通 flex 项（不是绝对定位），跟「退出」并排；靠 margin-left 往右顶到边。
     尺寸比玻璃胶囊小一圈：它是信息，不是操作，不该跟按钮一样重。 */
.hero-version {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    z-index: 3;
    padding: 3px 11px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: clamp(10px, 1.25vh, 13px);
    font-weight: 600;
    letter-spacing: 0.4px;
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 版本号可点：点开看更新说明。给足点按区，但视觉上仍是一行小字 */
.ver-tap {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}

.ver-tap:hover {
    background: var(--violet-soft);
    color: var(--violet-deep);
}

/* 品牌卡右上角药丸被 paintVersion 挂了 .ver-tap，这里覆盖它的 padding/圆角/hover，
   保持紫底上的白字亮药丸观感（.hero-version.ver-tap 优先级高于单独的 .ver-tap） */
.hero-version.ver-tap {
    padding: 3px 11px;
    border-radius: 20px;
}
.hero-version.ver-tap:hover {
    background: rgba(255, 255, 255, 0.42);
    color: #fff;
}

/* 更新说明弹层要能盖住登录页（登录页 z-index 是 50，通用弹层只有 40，
   不单独提就点不到——版本号在登录页上也有入口） */
#modal-verlog {
    z-index: 60;
}

/* ---------- 更新说明弹层 ---------- */
.verlog-now {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    color: var(--ink-3);
    font-size: clamp(12px, 1.6vh, 16px);
    font-weight: 600;
}

.verlog-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.verlog-item:last-child {
    border-bottom: 0;
}

.verlog-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.verlog-no {
    color: var(--violet-deep);
    font-size: clamp(14px, 1.9vh, 18px);
    font-weight: 800;
}

.verlog-date {
    color: var(--ink-3);
    font-size: clamp(11px, 1.5vh, 15px);
}

.verlog-line {
    margin-top: 8px;
    color: var(--ink-2);
    font-size: clamp(12px, 1.7vh, 17px);
    line-height: 1.7;
}

/* 主界面这行贴着底部控制台，别抢抽取按钮的高度 */
.app-version {
    margin-top: clamp(3px, 0.7vh, 9px);
    line-height: 1.2;
}

/* ---------------- 抽签 ---------------- */
.lottery-card {
    max-width: 580px;
    width: calc(100% - 32px);
}
.lottery-config {
    display: flex;
    flex-direction: column;
}
.lottery-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 60vh;
    overflow-y: auto;
}
.lottery-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lottery-label {
    color: var(--ink-1);
    font-size: clamp(13px, 1.7vh, 17px);
    font-weight: 700;
}
.lottery-sub {
    margin-left: 8px;
    color: var(--ink-3);
    font-size: clamp(11px, 1.4vh, 14px);
    font-weight: 400;
}
.lottery-text {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #f4f5fb;
    color: var(--ink-1);
    font-size: clamp(13px, 1.7vh, 16px);
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
}
.lottery-people-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.lottery-err {
    color: #e0484b;
    font-size: clamp(12px, 1.5vh, 15px);
    min-height: 16px;
}
.lottery-result {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 4px 2px 8px;
    max-height: 72vh;
    overflow-y: auto;
}
.lottery-drawing {
    text-align: center;
    color: var(--violet-deep);
    font-size: clamp(18px, 2.6vh, 26px);
    font-weight: 800;
    padding: 40px 0;
}
.lottery-summary {
    color: var(--ink-2);
    font-size: clamp(13px, 1.7vh, 16px);
    text-align: center;
}
.lottery-pairs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lottery-pair {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--grad);
    color: #fff;
    box-shadow: var(--shadow-hero);
}
.lottery-person {
    font-size: clamp(16px, 2.2vh, 22px);
    font-weight: 800;
}
.lottery-arrow {
    opacity: 0.85;
    font-size: clamp(12px, 1.6vh, 15px);
}
.lottery-lot {
    margin-left: auto;
    font-size: clamp(16px, 2.2vh, 22px);
    font-weight: 700;
}
.lottery-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
}

/* 抽签记录入口 + 历史区 */
.modal-hist-link {
    margin-left: auto;
    padding: 4px 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: clamp(12px, 1.6vh, 15px);
    cursor: pointer;
}
.modal-hist-link:hover {
    background: rgba(255, 255, 255, 0.34);
}
.lottery-history {
    display: flex;
    flex-direction: column;
}
.lottery-hist-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 64vh;
    overflow-y: auto;
}
.lottery-hist-pair {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: #f4f5fb;
    color: var(--ink-1);
    font-size: clamp(13px, 1.7vh, 16px);
}
.lottery-hist-person {
    font-weight: 700;
}
.lottery-hist-arrow {
    opacity: 0.6;
    font-size: clamp(11px, 1.4vh, 14px);
}
.lottery-hist-lot {
    margin-left: auto;
    font-weight: 600;
    color: var(--violet-deep);
}

/* 通用隐藏：登录方式切换要按块显示/隐藏，原来只有 .login / .login-tab 等
   各自带 is-hidden，块级元素加上没效果，两个块会同时显示 */
.is-hidden {
    display: none;
}

/* 内容变高时（比如切到密码登录、进了重设页）还能滚到按钮，别把顶部裁掉 */
.login {
    overflow-y: auto;
    padding: 24px 0;
}

/* 邀请同事换长期授权：主界面顶部一条紧凑提示，已授权的自动隐藏 */
/* 做得尽量矮：这一条会占掉舞台（抽人显示区）的高度，大屏上舞台比什么都重要 */
.refbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    padding: 5px 14px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: #fafbff;
}

.refbar.is-hidden {
    display: none;
}

.refbar-title {
    flex-shrink: 0;
    color: var(--ink-2);
    font-size: clamp(13px, 1.7vh, 17px);
    font-weight: 700;
}

.refbar-count {
    flex-shrink: 0;
    color: var(--violet-deep);
    font-size: clamp(14px, 1.8vh, 18px);
    font-weight: 800;
}

.refbar-track {
    flex: 1;
    min-width: 60px;
    height: 8px;
    border-radius: 999px;
    background: #e6e8f6;
    overflow: hidden;
}

.refbar-fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--grad-flat);
}

.refbar-tip {
    flex-shrink: 0;
    color: var(--ink-3);
    font-size: clamp(12px, 1.5vh, 15px);
}

.refbar-btn {
    flex-shrink: 0;
    padding: 4px 14px;
    border: 0;
    border-radius: 10px;
    background: var(--grad-flat);
    color: #fff;
    font-size: clamp(12px, 1.5vh, 15px);
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.refbar-btn:disabled {
    background: #c9ccdd;
    cursor: default;
}

/* 人实在太多、缩到最小也放不下时：开放滚动，保证人名只是要滚一下，而不是被裁掉看不见 */
.result-grid.is-scrollable {
    /* 关键修复：人数过多需要滚动时，必须从顶部开始排，
       否则 align-content:center + overflow:auto 会把顶部挤到滚动区外、滚不上来，
       表现为「显示不全、像被遮挡」。仅在溢出滚动时生效，不影响一屏放得下时的居中。 */
    align-content: flex-start;
    overflow-y: auto;
    padding: 2px 4px;
}

/* ================================================================================
   手机 / 平板适配层（2026-11-05）
   --------------------------------------------------------------------------------
   为什么要这一层：上面所有尺寸都是按「教室大屏投影」写的 —— 字号跟视口高度走
   （clamp(…vh…)）、整页 overflow:hidden 不允许滚动、三个控制行并排。
   搬到手机上就三处硬伤：
     1. 手机上 vh 很小，clamp 全部落到最小值，字小得看不清
     2. 不允许滚动 → 内容超出一屏的部分直接看不见，连按钮都点不到
     3. 控制台三行横排 → 一行塞不下，胶囊和按钮互相挤

   设备档位由 bigscreen.js 的 detectDevice() 打在 <html data-device>：
     bigscreen（≥1600，投影） / desktop（1024~1599，电脑）
     tablet（641~1023，平板竖屏、触屏笔记本缩窗）
     phone / phone-land（手机竖屏 / 横屏）
   判断靠宽度 + 指针粗细 + UA，所以触屏笔记本不会被误判成手机。

   原则：**不改桌面/投影的既有表现**，只在手机档位上覆盖。
   ================================================================================ */

/* ---------- 1. 通用：手机上必须能滚，且用 dvh 而不是 vh ---------- */
/* 100vh 在手机浏览器里是「地址栏收起时」的高度，地址栏一出现内容就被顶出屏幕；
   dvh 才是当前可见高度。旧浏览器不认识 dvh 时退回 vh（上面一行）。 */
/* 手机上页面一定比屏幕高（登录卡片 759px vs 屏高 568px 是很常见的）。
   注意别去放开 html/body 的 overflow —— 那样 html 会被内容撑到 759px，
   撑高之后它自己就没有可滚空间了（实测滚不动）。
   做法：锁定到视口高度，让登录层 / 主界面各自内部滚动，行为确定。 */
/* 品牌卡必须固定：不能再让 .app 整体滚（那样顶部的校徽校名会跟着滚走）。
   改成 .app 锁死不滚，只让中间的抽取区 .stage 内部滚。
   这样顶部品牌卡、底部控制台都定住，符合"进入主页面后品牌卡不动"的要求。 */
html[data-device="phone"] .app,
html[data-device="phone-land"] .app {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}
html[data-device="phone"] .stage,
html[data-device="phone-land"] .stage {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* iOS 上输入框字号小于 16px 会自动放大整个页面，之后退不回去。
   这条比任何视觉考虑都优先。 */
html[data-device="phone"] input,
html[data-device="phone-land"] input,
html[data-device="tablet"] input {
    font-size: 16px !important;
}

/* ---------- 2. 登录页 ---------- */
html[data-device="phone"] .login,
html[data-device="phone-land"] .login {
    /* 固定成视口高度、自己内部滚（不再 fixed 全屏，也不再让内容撑高） */
    position: static;
    inset: auto;
    display: block;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* 顶部留白 + 底部避开 iPhone 横条 */
    padding: 16px 14px calc(24px + env(safe-area-inset-bottom));
    background: var(--violet-wash);
}

html[data-device="phone"] .login-card,
html[data-device="phone-land"] .login-card {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 26px 20px 22px;
    border-radius: 24px;
    text-align: left;
}

/* 手机竖屏：招牌区收小，别把输入框挤到屏幕外 */
html[data-device="phone"] .login-crest {
    width: 56px;
    height: 56px;
    margin: 0 auto 10px;
}

html[data-device="phone"] .login-brand {
    font-size: 20px;
    line-height: 1.3;
}

html[data-device="phone"] .login-sub {
    margin-top: 4px;
    font-size: 12.5px;
}

html[data-device="phone"] .login-tabs {
    margin-top: 16px;
}

html[data-device="phone"] .login-tab {
    height: 42px;
    font-size: 14.5px;
}

html[data-device="phone"] .login-label {
    margin-top: 14px;
    font-size: 13px;
}

html[data-device="phone"] .login-input,
html[data-device="phone"] #in-phone,
html[data-device="phone"] #in-password,
html[data-device="phone"] #in-code {
    height: 46px;
    font-size: 16px;
    border-radius: 12px;
}

html[data-device="phone"] .login-code-btn,
html[data-device="phone"] .code-btn {
    height: 46px;
    min-width: 74px;
    font-size: 13.5px;
}

html[data-device="phone"] #btn-login,
html[data-device="phone"] .login-btn {
    height: 48px;
    margin-top: 16px;
    font-size: 16.5px;
    border-radius: 14px;
}

/* 记住密码行：手机上点按区至少 44px，否则手指点不准 */
html[data-device="phone"] .remember-row,
html[data-device="phone-land"] .remember-row {
    min-height: 44px;
    margin: 6px 0 4px;
    padding: 4px 0;
}

html[data-device="phone"] .remember-box {
    width: 22px;
    height: 22px;
    border-radius: 7px;
}

html[data-device="phone"] .remember-box::after {
    width: 13px;
    height: 13px;
}

html[data-device="phone"] .remember-text {
    font-size: 14px;
}

html[data-device="phone"] .login-link,
html[data-device="phone"] #link-forgot,
html[data-device="phone-land"] .login-link,
html[data-device="phone-land"] #link-forgot {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

html[data-device="phone"] .login-version,
html[data-device="phone"] .login-tip {
    font-size: 12px;
}

/* ---------- 3. 主界面：顶部信息栏 ---------- */
/* 大屏是「校徽 + 校名 + 统计 + 按钮」一行排开；手机上必须换行分成两三行，
   否则校名会被挤成 0 宽（实测过，字直接没了）。 */

/* ★★★ 2026-11-30 老板「学校名换行了」+「新服务器各文字、胶囊偏大」
   ------------------------------------------------------------
   第一版修法是「窗口窄就把按钮组整体换到第二行」。老板看过说偏大、不和谐 ——
   因为那一改让整个头部从一行变两行、高度多出四成，视觉上就是"全都放大了"。
   现在改成**紧凑档**：一行不变，只是把统计块和那排胶囊按比例收小一号，
   把省下的宽度让给校名。这样窗口变窄时是整个头部一起紧凑，而不是变胖。

   实测（2026-11-30 二改）：断点从 1180 提到 **1400**。
   为什么：原来 1181~1400 这段既没进紧凑档、又已经挤不下 ——
   CDP 实测 1200px 时校名被 flex 压到 15.7px（比统计数字还小），
   而 1180px 时因为是紧凑档反而有 19.3px，**窗口越宽字越小**，看着就"不和谐"。
   提到 1400 后这一段都进紧凑档，校名一律 19~23px、且不再被压扁。
   1920 / 1536 不受影响（仍在断点之外，按 vh 取原始字号）。 */
@media (max-width: 1400px) {
    html:not([data-device="phone"]):not([data-device="phone-land"]) .hero {
        gap: 10px;
        padding-left: clamp(12px, 1.5vw, 24px);
        padding-right: clamp(12px, 1.5vw, 24px);
    }

    html:not([data-device="phone"]):not([data-device="phone-land"]) .hero-main {
        gap: 10px;
    }

    html:not([data-device="phone"]):not([data-device="phone-land"]) .hero-crest {
        width: 50px;
        height: 50px;
    }

    html:not([data-device="phone"]):not([data-device="phone-land"]) .hero-stats {
        padding: 4px 12px;
    }

    html:not([data-device="phone"]):not([data-device="phone-land"]) .stat {
        min-width: 54px;
    }

    html:not([data-device="phone"]):not([data-device="phone-land"]) .stat-num {
        font-size: clamp(19px, 2.5vh, 27px);
    }

    html:not([data-device="phone"]):not([data-device="phone-land"]) .stat-label {
        margin-top: 1px;
        font-size: 10.5px;
        letter-spacing: 0;
    }

    html:not([data-device="phone"]):not([data-device="phone-land"]) .stat-line {
        height: 26px;
    }

    html:not([data-device="phone"]):not([data-device="phone-land"]) .hero-ops {
        gap: 5px;
    }

    html:not([data-device="phone"]):not([data-device="phone-land"]) .seg {
        padding: 3px;
        border-radius: 12px;
    }

    html:not([data-device="phone"]):not([data-device="phone-land"]) .seg-btn {
        min-width: 0;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
        border-radius: 9px;
    }

    html:not([data-device="phone"]):not([data-device="phone-land"]) .glass-btn {
        height: 36px;
        padding: 0 11px;
        font-size: 12.5px;
        border-radius: 11px;
    }
}

/* 再窄就得真的换行了：这时候先让统计块下去（它不是按钮，换行不别扭），
   按钮组留在校名那一行。 */
@media (max-width: 1000px) {
    html:not([data-device="phone"]):not([data-device="phone-land"]) .hero {
        height: auto;
        flex-wrap: wrap;
        padding-top: 10px;
        padding-bottom: 10px;
        row-gap: 8px;
    }

    html:not([data-device="phone"]):not([data-device="phone-land"]) .hero-main {
        flex: 1 1 auto;
        /* ★ 必须加：统计块是 hero-main 的子项，不给它 wrap，
           下面的「统计块占满一整行」就落不到第二行，只会把校名挤没。 */
        flex-wrap: wrap;
        row-gap: 8px;
    }

    html:not([data-device="phone"]):not([data-device="phone-land"]) .hero-stats {
        order: 3;
        flex: 1 1 100%;
        justify-content: center;
    }

    html:not([data-device="phone"]):not([data-device="phone-land"]) .hero-ops {
        flex: 0 1 auto;
    }
}

html[data-device="phone"] .hero,
html[data-device="phone-land"] .hero {
    height: auto;
    margin: 10px 12px 0;
    padding: 12px 14px;
    flex-wrap: wrap;
    row-gap: 10px;
    border-radius: 20px;
}

html[data-device="phone"] .hero-main,
html[data-device="phone-land"] .hero-main {
    flex: 1 1 100%;
    gap: 10px;
    min-width: 0;
    /* 关键：统计块要能换到第二行。不加这行，下面的 flex:1 1 100% 会把校名挤成 0 宽 */
    flex-wrap: wrap;
}

html[data-device="phone"] .hero-crest {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
}

html[data-device="phone"] .hero-text {
    /* 允许收缩（长校名靠省略号截断），但基础宽度按内容算，不会被压成 0 */
    flex: 1 1 auto;
    min-width: 0;
}

html[data-device="phone"] .hero-school {
    font-size: 15px;
    line-height: 1.3;
    /* 校名太长就省略，绝不允许把它挤成 0 宽 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[data-device="phone"] .hero-meta {
    gap: 6px;
    margin-top: 3px;
    flex-wrap: wrap;
}

html[data-device="phone"] .hero-member {
    font-size: 12px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[data-device="phone"] .hero-tag {
    height: 20px;
    padding: 0 7px;
    font-size: 11px;
    line-height: 20px;
}

/* 三个统计数字：手机上单独一行，等分 */
html[data-device="phone"] .hero-stats {
    flex: 1 1 100%;
    max-width: 100%;
    padding: 8px 10px;
    justify-content: space-around;
    border-radius: 16px;
    gap: 0;
}

html[data-device="phone"] .stat-num {
    font-size: 17px;
}

html[data-device="phone"] .stat-label {
    font-size: 10.5px;
    margin-top: 2px;
}

html[data-device="phone"] .stat {
    flex: 1 1 0;
    text-align: center;
}

html[data-device="phone"] .stat-line {
    height: 20px;
}

/* 右上角操作按钮：再单独一行，可以横向滚动不换行溢出 */
html[data-device="phone"] .hero-ops,
html[data-device="phone-land"] .hero-ops {
    flex: 1 1 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
}

html[data-device="phone"] .glass-btn {
    height: 36px;
    min-width: 36px;
    font-size: 12px;
}

html[data-device="phone"] .hero-trial {
    font-size: 12px;
    height: 28px;
    font-weight: 800;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
    /* 手机上更醒目：轻轻脉动一下 */
    animation: trialPulse 1.4s ease-in-out infinite;
}
@keyframes trialPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}

/* ---------- 4. 舞台：手机上也由它自己滚，不再把整页撑高 ----------
   老板要求「进入主页面后顶部品牌卡固定」。原来这里是 flex:0 0 auto，
   舞台按内容长高 → 整页被撑开 → 品牌卡跟着滚走。
   改成可压缩 + 自己能滚：品牌卡和底部抽取按钮定住，只让中间这块滚。 */
html[data-device="phone"] .stage,
html[data-device="phone-land"] .stage {
    flex: 1 1 0%;
    min-height: 0;
    /* 关键：舞台自己对 .pane 不能硬居中。硬居中会把超高的 pane 上下对称推出可视区，
       滚动容器只算得到底部溢出，顶部就永远滚不到（第一行被切掉）。
       safe center：不溢出时照旧居中，溢出时自动退回顶部对齐。 */
    align-items: safe center;
    justify-content: safe center;
    margin: 10px 12px 0;
    padding: 14px 12px;
    border-radius: 20px;
}

/* 舞台改成"自己滚"之后，里面的 .pane 必须跟着改，否则结果多的时候看不全：
   · height:auto + min-height:100% → 内容多时 pane 自然长高，不再被 100% 高度裁掉；
   · safe center → 内容超出时不再硬居中（硬居中会把顶部推到滚动区之外，滚不上去）。
   这两条是 2026-11-02 那个「滚不到顶」老坑的同款，这里必须一起改。 */
html[data-device="phone"] .pane,
html[data-device="phone-land"] .pane {
    height: auto;
    min-height: 100%;
    justify-content: safe center;
    align-items: safe center;
}

html[data-device="phone"] .idle-mark {
    font-size: 22px;
}

html[data-device="phone"] .idle-hint {
    font-size: 12.5px;
}

/* ---------- 5. 控制台：三行竖排，每行都能完整放下 ---------- */
html[data-device="phone"] .dock,
html[data-device="phone-land"] .dock {
    padding: 12px 12px calc(14px + env(safe-area-inset-bottom));
}

html[data-device="phone"] .dock-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

html[data-device="phone"] .dock-modes {
    flex-wrap: wrap;
    row-gap: 8px;
}

/* 抽法分段器：手机上三格铺满一行，每格至少 44px 高 */
html[data-device="phone"] .seg-mode {
    width: 100%;
    padding: 4px;
    border-radius: 14px;
}

html[data-device="phone"] .seg-mode .seg-btn,
html[data-device="phone"] .seg-btn {
    flex: 1 1 0;
    min-width: 0;
    height: 44px;
    padding: 0 6px;
    font-size: 14px;
    border-radius: 11px;
}

/* 数量加减器 */
html[data-device="phone"] .stepper {
    height: 44px;
    padding: 0 4px;
    border-radius: 12px;
}

html[data-device="phone"] .step-btn {
    width: 44px;
    height: 40px;
    font-size: 20px;
    border-radius: 10px;
}

html[data-device="phone"] .step-val,
html[data-device="phone"] .stepper-label {
    font-size: 15px;
    min-width: 44px;
}

html[data-device="phone"] .stepper-label {
    min-width: 0;
}

html[data-device="phone"] .soft-btn {
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
}

/* 抽取范围：横向滚动，一行不换行（胶囊多了换行会把控制台顶得很高） */
html[data-device="phone"] .dock-scope {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow: hidden;
}

html[data-device="phone"] .scope-label {
    font-size: 12px;
    flex: none;
}

html[data-device="phone"] .scope-chips {
    justify-content: flex-start;
    overflow-x: auto;
    /* 手指滑动时别让整页跟着滚 */
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 2px;
}

html[data-device="phone"] .scope-chip {
    height: 38px;
    padding: 0 12px;
    font-size: 12.5px;
    border-width: 1.5px;
    flex: none;
}

/* 开始抽取：手机上固定高度，不用 vh（否则只有 60px 上下，手指容易点偏） */
html[data-device="phone"] .draw-btn {
    height: 62px;
    margin-top: 4px;
    border-radius: 18px;
    font-size: 21px;
    letter-spacing: 2px;
}

html[data-device="phone"] .app-version {
    margin-top: 8px;
    font-size: 11.5px;
}

/* ---------- 6. 结果页：手机上不缩字号，改成换行 + 滚动 ---------- */
/* 大屏的策略是「人越多卡越小，保证一屏塞下」；手机上照搬会缩成 8px 看不清，
   所以手机上固定字号、允许纵向滚动。 */
html[data-device="phone"] .result-grid,
html[data-device="phone-land"] .result-grid {
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: center;
    gap: 8px;
    max-height: 52vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

html[data-device="phone"] .result-tile {
    /* 不管 JS 算出多小，手机上都不低于这个尺寸 */
    padding: 10px 14px !important;
    font-size: 17px !important;
    border-radius: 12px;
    min-height: 42px;
}

html[data-device="phone"] .result-block {
    flex-wrap: wrap;
}

html[data-device="phone"] .result-foot,
html[data-device="phone"] .result-mode {
    font-size: 12.5px;
}

/* ---------- 7. 弹层：手机上贴边全宽 ---------- */
html[data-device="phone"] .modal-card {
    width: calc(100% - 24px);
    max-height: 82vh;
    max-height: 82dvh;
    border-radius: 20px;
}

html[data-device="phone"] .modal-head {
    padding: 14px 16px;
}

html[data-device="phone"] .modal-title {
    font-size: 16px;
}

html[data-device="phone"] .modal-close {
    height: 36px;
    padding: 0 14px;
    font-size: 13.5px;
}

html[data-device="phone"] .modal-body {
    padding: 14px 16px 18px;
}

html[data-device="phone"] .verlog-no {
    font-size: 15px;
}

html[data-device="phone"] .verlog-line {
    font-size: 13.5px;
    line-height: 1.65;
}

/* 试用到期 / 停用的拦截面板：手机上按钮要够大 */
html[data-device="phone"] .gate-btn {
    height: 46px;
    font-size: 15px;
}

html[data-device="phone"] .gate-input {
    height: 46px;
    font-size: 16px;
}

/* ---------- 8. 平板：只做折中微调，不动大屏外观 ---------- */
html[data-device="tablet"] .hero {
    height: auto;
    flex-wrap: wrap;
    row-gap: 8px;
}

html[data-device="tablet"] .hero-ops {
    flex: 1 1 100%;
    justify-content: flex-start;
}

html[data-device="tablet"] .seg-mode .seg-btn {
    min-width: 0;
    font-size: 14px;
}

html[data-device="tablet"] .stage {
    min-height: 300px;
}

/* ---------- 9. 横屏手机：高度紧，压缩上下留白，别让控制台跑出屏幕 ---------- */
html[data-device="phone-land"] .hero {
    margin: 6px 10px 0;
    padding: 8px 12px;
    row-gap: 6px;
}

html[data-device="phone-land"] .hero-crest {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
}

html[data-device="phone-land"] .hero-school {
    font-size: 13px;
}

html[data-device="phone-land"] .hero-stats {
    flex: 0 1 auto;
}

html[data-device="phone-land"] .stage {
    min-height: 150px;
    margin: 6px 10px 0;
    padding: 10px;
}

html[data-device="phone-land"] .dock {
    padding: 6px 10px 8px;
}

html[data-device="phone-land"] .dock-row {
    margin-bottom: 6px;
}

html[data-device="phone-land"] .draw-btn {
    height: 54px;
    font-size: 18px;
}

/* 横屏控件不能低于 42px：38px 手指容易点偏（实测横屏整屏高度只有 393~430） */
html[data-device="phone-land"] .seg-btn,
html[data-device="phone-land"] .stepper,
html[data-device="phone-land"] .soft-btn {
    height: 42px;
}

html[data-device="phone-land"] .result-grid {
    max-height: 46vh;
}

/* ---------------- 云端抽签 ---------------- */
.cl-card { max-width: 460px; }
.cl-head {
    display: flex; align-items: center; gap: 10px;
    background: var(--grad);
    border-bottom: none;
    padding: 16px 20px;
    box-shadow: 0 6px 18px rgba(91, 92, 247, 0.22);
}
.cl-title-text { flex: 1; color: #fff; }
.cl-head .modal-title { color: #fff; }
.cl-head .modal-close {
    height: 34px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px; background: rgba(255, 255, 255, 0.16); color: #fff;
    font-size: 14px; font-weight: 600; font-family: inherit;
}
.cl-head .modal-close:active { background: rgba(255, 255, 255, 0.3); }
.cl-stage { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.cl-stage.is-hidden { display: none; }
.cl-body { padding: 18px 20px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.cl-field { margin-bottom: 16px; }
.cl-label {
    display: block; font-size: 13px; font-weight: 600; color: var(--ink-2);
    margin-bottom: 8px;
}
.cl-sub { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; margin-top: 3px; }
.cl-title, .cl-lots, .cl-name, .cl-link-input {
    width: 100%; box-sizing: border-box; border: 1.5px solid var(--line-2);
    border-radius: 12px; padding: 11px 13px; font-size: 15px; color: var(--ink);
    background: #fbfbff; outline: none; transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.cl-title:focus, .cl-lots:focus, .cl-name:focus {
    border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft);
}
.cl-batch-toggle {
    width: 100%; margin-bottom: 8px; padding: 9px 12px;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--violet-wash); color: var(--violet-deep);
    font-size: 13px; font-weight: 600; font-family: inherit; text-align: left; cursor: pointer;
}
.cl-batch {
    padding: 10px; margin-bottom: 10px;
    border-radius: 10px; background: var(--violet-wash);
}
.cl-batch-input {
    width: 100%; min-height: 92px; padding: 10px; box-sizing: border-box;
    border: 1px solid var(--line); border-radius: 8px; background: #fff;
    color: var(--ink); font-size: 13px; line-height: 1.6; font-family: inherit; resize: vertical;
}
.cl-batch-apply {
    width: 100%; margin-top: 8px; padding: 9px 0;
    border: 0; border-radius: 8px; background: var(--violet); color: #fff;
    font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer;
}
.cl-batch-apply:hover { opacity: .9; }
.cl-lots-list { display: flex; flex-direction: column; gap: 8px; }
.cl-lot-row {
    display: flex; align-items: center; gap: 8px;
    background: var(--violet-wash); border: 1px solid var(--line);
    border-radius: 12px; padding: 5px 6px 5px 5px;
    transition: border-color .15s, box-shadow .15s;
}
.cl-lot-row:focus-within { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.cl-lot-no {
    flex: 0 0 auto; width: 24px; height: 24px; border-radius: 8px;
    background: var(--violet-soft); color: var(--violet-deep);
    font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.cl-lot-input {
    flex: 1 1 auto; min-width: 0; border: none; background: transparent;
    padding: 9px 6px; font-size: 15px; color: var(--ink); outline: none; font-family: inherit;
}
.cl-lot-input::placeholder { color: var(--ink-3); }
.cl-lot-del {
    flex: 0 0 auto; width: 30px; height: 30px; border: none; border-radius: 9px;
    background: transparent; color: var(--ink-3); cursor: pointer; font-size: 16px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.cl-lot-del:hover { background: #ffe7ea; color: #e34d59; }
.cl-lot-del:active { transform: scale(.92); }
.cl-lot-del.is-hidden { visibility: hidden; }
.cl-lot-add {
    margin-top: 10px; width: 100%; border: 1px dashed var(--violet); border-radius: 12px;
    padding: 11px; background: transparent; color: var(--violet-deep);
    font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
    transition: background .15s;
}
.cl-lot-add:hover { background: var(--violet-wash); }
.cl-lot-add:active { transform: scale(.99); }
.cl-err { color: #e34d59; font-size: 13px; min-height: 18px; margin-top: 4px; }

/* ===== 分享页：紫色渐变头区 + 叠在上面的本签卡片 + 按钮组 ===== */
/* 顶部不留内边距，让渐变头区能通栏贴边 */
/* ===== 分享页：整个弹窗共用一条紫→白渐变 =====
   头部透明、内容透明，从标题栏到按钮没有任何色块边界 */
/* 过渡曲线经过实测重调：
   ① 改纯垂直 180deg —— 原来 178deg 让同一水平线左右差近 30 个色阶，边缘发脏
   ② 色停按"等感知亮度"分布，中段不再猛掉（原来 45%~55% 饱和度一次掉 0.16）
   ③ 底部停在 #faf7ff 浅紫白，不是纯白 —— 卡片和按钮落在稳定的浅色区，
      不会出现"卡片自己还在渐变"的脏感 */
#modal-cloud-lottery.is-share .cl-card {
    background: linear-gradient(180deg,
        #5f54ee 0%,
        #6659f0 10%,
        #705df3 20%,
        #7c63f5 30%,
        #8b6af5 40%,
        #a27ff6 50%,
        #bc96f8 60%,
        #d2acfa 70%,
        #e3c3fc 80%,
        #f0dafe 90%,
        #faf0ff 100%);
}
#modal-cloud-lottery.is-share .cl-head {
    background: transparent;
    /* 去掉头部那道下投影——它在紫色内容上会压出一条暗带，看着就是"过渡不柔和" */
    box-shadow: none;
}

.cl-share-body {
    text-align: center;
    padding: 0 20px 22px;
    /* 内容在弹窗里垂直居中；超高时 safe center 退回顶部 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    justify-content: safe center;
    /* 背景交给整个弹窗的渐变，这里透明 */
    background: transparent;
}

/* ---- 渐变头区：紫色 + 两个光斑，把上方填满 ---- */
.cl-share-hero {
    position: relative;
    margin: 0 -20px;
    padding: 30px 22px 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* 透明：颜色交给整页渐变，避免两块紫的分界线 */
    background: transparent;
}
/* 原来这里有一团白光（::before）。它的中心正好落在"标题栏下沿、骰子上方"，
   会在本该平滑的渐变上叠出一条亮带（实测相邻两行亮度跳 +0.06，其他位置仅 0.002），
   老板反馈"骰子上面的过渡不好"就是它。整页渐变已经够有层次，不需要再加光。 */
.cl-share-hero::after {
    content: "";
    position: absolute;
    width: 140px; height: 140px;
    right: -55px; bottom: -12px;
    border-radius: 50%;
    /* 粉光大幅减弱并收回：原来 .38 且超出 hero 40px，直接盖在卡片区，让背景局部偏粉发脏 */
    background: radial-gradient(circle, rgba(255,140,220,.12) 0%, rgba(255,140,220,0) 74%);
}

/* 骰子：和分享封面同一套图（透明底，紫骰+粉骰），放大填满头区 */
.cl-share-dice {
    position: relative;
    z-index: 1;
    display: block;
    /* 随弹窗宽度自适应：小屏 190px 起，大屏按 26% 放大但不超过 260px */
    width: clamp(190px, 26%, 260px);
    height: auto;
    margin: 0 auto 6px;
    user-select: none;
}
.cl-share-hero-title {
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 8px rgba(24, 10, 80, .3);
}
.cl-share-hero-sub {
    position: relative;
    z-index: 1;
    margin-top: 6px;
    color: rgba(255, 255, 255, .86);
    font-size: 13px;
    letter-spacing: .5px;
}

/* 这张卡片＝即将发出去的东西；上移叠到渐变头区上，做出层次 */
.cl-share-card {
    position: relative;
    z-index: 2;
    text-align: left;
    margin: 14px 0 0;
    padding: 18px 18px 16px;
    border-radius: 17px;
    /* 纯白不透明：落在浅紫白底上颜色均匀干净。
       之前用半透明白叠在"还在渐变的背景"上，卡片自身从上到下有颜色差，显脏 */
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 0 10px 26px rgba(78, 52, 150, .13), 0 1px 2px rgba(78, 52, 150, .06);
}
.cl-share-card-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 10px; margin-bottom: 12px;
}
.cl-share-card-title {
    flex: 0 1 auto; min-width: 0;
    font-size: 19px; font-weight: 700; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cl-share-card-meta {
    flex: none; font-size: 12px; font-weight: 600; color: var(--ink-3);
    white-space: nowrap;
}
.cl-share-lots { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-share-lot {
    max-width: 100%;
    padding: 5px 12px;
    border-radius: 999px;
    background: #f0f1fb;
    border: 1px solid #e3e0fb;
    color: var(--violet-deep);
    font-size: 13px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    box-sizing: border-box;
}

.cl-share-tip {
    margin: 26px 0 26px; color: var(--ink-3);
    font-size: 12.5px; line-height: 1.6;
}

/* 按钮区：一颗主按钮 + 一行两颗次按钮 */
.cl-share-acts {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.cl-share-main {
    /* 居中胶囊：不拉满整行 */
    width: 240px; max-width: 100%;
    margin: 0 auto; height: 50px;
    padding: 0 10px; box-sizing: border-box;
    border: none; border-radius: 999px;
    background: var(--grad); color: #fff;
    font-size: 16px; font-weight: 700; font-family: inherit;
    box-shadow: var(--shadow-hero); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    white-space: nowrap; transition: transform .08s;
}
.cl-share-main:active { transform: scale(.985); }

.cl-share-sub-row { display: flex; gap: 10px; width: 100%; margin-top: 14px; }
/* 两颗次按钮：浅绿底深绿字，和「历史」胶囊同一套语义色 */
.cl-share-sub {
    flex: 1 1 0; width: 0; min-width: 0; height: 42px;
    padding: 0 8px; box-sizing: border-box;
    border-radius: 999px;
    background: #e9f8ef; border: 1px solid #c6ecd6; color: #1f9d55;
    font-size: 13.5px; font-weight: 600; font-family: inherit;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    white-space: nowrap; transition: background .15s, transform .08s;
}
.cl-share-sub:hover { background: #d5f2e0; }
.cl-share-sub:active { transform: scale(.97); }

/* ===== 抽签弹窗顶部统一「← 返回」胶囊 =====
   放在紫色弹窗头里，所以用半透明白底 + 白字；
   页面内不再放第二个返回，避免一堆按钮挤在一起 */
.cl-back-pill {
    flex: none;
    height: 34px;
    padding: 0 14px;
    box-sizing: border-box;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: background .15s, transform .08s;
}
.cl-back-pill:hover { background: rgba(255, 255, 255, 0.34); }
.cl-back-pill:active { transform: scale(.97); }

/* 参与 / 结果 */
.cl-play-body { padding: 18px 20px; }

/* 已被发起人删除：整块只留说明，不留任何抽取入口
   （2026-11-30 加，配合云端 status='deleted'） */
.cl-deleted {
    display: flex; flex-direction: column; align-items: center;
    padding: 34px 20px 40px; text-align: center;
}
.cl-deleted-icon { font-size: 40px; line-height: 1; margin-bottom: 12px; }
.cl-deleted-title { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.cl-deleted-tip { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }

.cl-progress {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.cl-prog-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.cl-prog-count { font-size: 13px; color: var(--violet-deep); background: var(--violet-soft); padding: 4px 10px; border-radius: 999px; }
.cl-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; margin-bottom: 18px; }
.cl-slot {
    border-radius: 14px; background: #f1f2fb; color: var(--ink-3);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 8px 6px; min-height: 58px; text-align: center; border: 1.5px dashed var(--line-2);
}
.cl-slot.is-taken {
    border-style: solid; border-color: var(--violet); background: var(--violet-soft);
}
.cl-slot-no { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.cl-slot-lot { font-size: 14px; font-weight: 700; color: var(--violet-deep); line-height: 1.25; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-slot-lot-idle { color: var(--ink-3); font-weight: 600; }
.cl-slot-ph {
    width: 22px; height: 22px; border-radius: 50%; background: var(--grad-flat); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.cl-idcard {
    background: var(--violet-wash); border: 1.5px solid var(--violet-soft);
    border-radius: 16px; padding: 16px; margin-bottom: 14px;
}
.cl-id-tip { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.cl-name { margin-bottom: 12px; }
.cl-draw-btn {
    width: 100%; border: none; border-radius: 14px; padding: 13px;
    background: var(--grad); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
    box-shadow: var(--shadow-hero);
}
.cl-draw-btn:disabled { opacity: .6; cursor: default; }
.cl-draw-btn:active { transform: scale(.98); }
.cl-mine {
    text-align: center; background: var(--violet-wash); border: 1.5px solid var(--violet-soft);
    border-radius: 16px; padding: 20px; margin-bottom: 14px;
}
.cl-mine-label { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.cl-mine-lot {
    font-size: 30px; font-weight: 800; color: var(--violet-deep);
    background: #fff; border-radius: 14px; padding: 12px 18px; display: inline-block;
    box-shadow: var(--shadow-card);
}
.cl-board { margin-top: 4px; }
.cl-board-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.cl-board-list { display: flex; flex-direction: column; gap: 8px; }
.cl-board-item {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px;
}
.cl-board-ph {
    width: 30px; height: 30px; border-radius: 50%; background: var(--grad-flat); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: 0 0 auto;
}
.cl-board-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.cl-board-arrow { font-size: 12px; color: var(--ink-3); margin-left: auto; }
.cl-board-lot { font-size: 15px; font-weight: 700; color: var(--violet-deep); }
.cl-mine-name { font-size: 12px; color: var(--ink-3); margin-top: 10px; }
.cl-board-item.is-mine { border-color: var(--violet); background: var(--violet-wash); }
.cl-board-mine {
    display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
    background: var(--violet); color: #fff; font-size: 11px; font-weight: 700; vertical-align: 1px;
}

/* 发起人管理条：本机创建的抽签才出现 */
.cl-owner-bar {
    margin-top: 16px; padding: 14px 16px; border-radius: 16px;
    background: var(--violet-wash); border: 1.5px dashed var(--violet-soft);
}
.cl-owner-tip { font-size: 13px; font-weight: 600; color: var(--violet-deep); margin-bottom: 10px; }
.cl-owner-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.cl-owner-btn {
    flex: 1 1 auto; min-width: 120px; border: 1px solid var(--violet-soft); border-radius: 12px;
    padding: 10px 12px; background: #fff; color: var(--violet-deep);
    font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer;
}
.cl-owner-btn-main { border-color: transparent; background: var(--grad); color: #fff; box-shadow: var(--shadow-hero); }
.cl-owner-btn:active { transform: scale(.97); }

/* 常用模板 */
.cl-templates { margin-bottom: 16px; }
/* 模板标题行：左标题，右「历史」胶囊 */
.cl-tpl-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 8px;
}
.cl-tpl-label { display: block; flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cl-tpl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-tpl-chip {
    border: 1.5px solid var(--violet-soft); background: var(--violet-wash);
    color: var(--violet-deep); font-size: 13px; font-weight: 600; font-family: inherit;
    padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: background .15s, border-color .15s, transform .08s;
}
.cl-tpl-chip:hover { background: var(--violet-soft); border-color: var(--violet); }
.cl-tpl-chip:active { transform: scale(.97); }

/* 自定义模板（2026-11-30）：和内置的区分开，右上角带删除叉 */
.cl-tpl-chip.is-custom {
    position: relative;
    padding-right: 26px;
    background: #f6f3ff;
    border-color: #d9d2fb;
    border-style: dashed;
}
.cl-tpl-del {
    position: absolute; top: -7px; right: -5px;
    width: 17px; height: 17px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid #d9d2fb;
    color: #8b83c9; font-size: 10px; line-height: 1;
    cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.cl-tpl-del:hover { background: #ffe9e9; border-color: #f3b8b8; color: #d9534f; }

/* 「＋ 存为模板」：虚线胶囊，和实线模板一眼分开 */
.cl-tpl-add {
    border: 1.5px dashed #b9b3f0;
    background: #fff;
    color: #6b63d8;
    font-size: 13px; font-weight: 600; font-family: inherit;
    padding: 7px 14px; border-radius: 999px; cursor: pointer;
    transition: background .15s, border-color .15s, transform .08s;
}
.cl-tpl-add:hover { background: #f4f2ff; border-color: var(--violet); }
.cl-tpl-add:active { transform: scale(.97); }

/* 历史入口（发起页底部） */
/* 我的抽签历史：发起抽签下面的浅绿小胶囊，居中小巧 */
.cl-hist-pill {
    flex: none; margin: 0; height: 28px; padding: 0 13px;
    border: 1px solid #c6ecd6; border-radius: 999px;
    background: #e9f8ef; color: #1f9d55;
    font-size: 12px; font-weight: 600; font-family: inherit;
    cursor: pointer; white-space: nowrap;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, transform .08s;
}
.cl-hist-pill:hover { background: #d5f2e0; }
.cl-hist-pill:active { transform: scale(.97); }

/* 发起胶囊 + 居中页脚 */
.cl-foot { flex-shrink: 0; flex-direction: column; gap: 12px; padding: 16px 20px 22px; }
.cl-cancel-btn {
    align-self: center; border: none; background: transparent;
    color: var(--ink-3); font-size: 14px; cursor: pointer; padding: 4px 12px; font-family: inherit;
}
.cl-cancel-btn:hover { color: var(--ink-2); }
.cl-create-btn {
    width: 100%; height: 52px; border: 0; border-radius: 26px;
    background: var(--grad); color: #fff; font-size: 17px; font-weight: 800;
    font-family: inherit; cursor: pointer; box-shadow: var(--shadow-hero);
    letter-spacing: 2px; display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: transform .08s;
}
.cl-create-btn:active { transform: scale(.985); }
/* 发起中：按钮变灰、鼠标变等待，明确告诉用户"已经在建了，别再点" */
.cl-create-btn:disabled {
    background: #c9cbdd; box-shadow: none; cursor: wait; letter-spacing: 1px;
}

/* 历史阶段 */
/* 历史页头：说明文字 + 右侧「清理没用的」小胶囊 */
.cl-hist-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.cl-hist-title { display: block; font-size: 16px; font-weight: 700; color: var(--ink); }
.cl-hist-sub { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-3); }
.cl-hist-clean {
    flex: none; height: 30px; padding: 0 12px; box-sizing: border-box;
    border-radius: 999px; border: 1px solid #c6ecd6;
    background: #e9f8ef; color: #1f9d55;
    font-size: 12px; font-weight: 600; font-family: inherit;
    cursor: pointer; white-space: nowrap;
}
.cl-hist-clean:hover { background: #d5f2e0; }
.cl-hist-clean.is-hidden { display: none; }
.cl-hist-list { display: flex; flex-direction: column; gap: 10px; }
.cl-hist-empty { text-align: center; color: var(--ink-3); font-size: 14px; padding: 30px 0; }
.cl-hist-item {
    display: flex; align-items: center; gap: 10px; background: var(--violet-wash);
    border: 1px solid var(--violet-soft); border-radius: 14px; padding: 12px 14px;
}
.cl-hist-item-main { flex: 1; min-width: 0; }
/* 标题行：抽签名 + 紧跟其后的「进行中 x/y」 */
.cl-hist-title-row {
    display: flex; align-items: center; gap: 8px; min-width: 0;
}
.cl-hist-item-title {
    flex: 0 1 auto; min-width: 0;
    font-size: 15px; font-weight: 700; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cl-hist-item-time { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.cl-hist-item-acts { display: flex; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.cl-hist-open, .cl-hist-copy, .cl-hist-reuse, .cl-hist-del {
    border: none; border-radius: 10px; padding: 7px 10px; font-size: 13px; font-weight: 600;
    font-family: inherit; cursor: pointer; transition: transform .08s;
}
/* 打开：浅紫底紫字，和旁边几颗统一为浅色，不再深色实心抢眼 */
.cl-hist-open { background: #eef0fe; color: var(--violet-deep); border: 1px solid #dcdcfb; }
.cl-hist-copy { background: #fff; color: var(--violet-deep); border: 1px solid var(--violet-soft); }
.cl-hist-reuse { background: #fff7ed; color: #b26a00; border: 1px solid #ffd9a8; }
/* 删除：灰色小圆叉，悬停变红，避免误触也够显眼 */
.cl-hist-del {
    width: 30px; padding: 0; height: 30px; border-radius: 50%;
    background: #f0eefb; color: #a9adc4; font-size: 13px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.cl-hist-del:hover { background: #ffe8e8; color: #e5484d; }
/* 进行中的那条「分享邀请」：浅绿底，和顶部「历史」胶囊呼应 */
.cl-hist-copy.is-primary { background: #e9f8ef; color: #1f9d55; border: 1px solid #c6ecd6; box-shadow: none; }
.cl-hist-open:active, .cl-hist-copy:active, .cl-hist-reuse:active, .cl-hist-del:active { transform: scale(.96); }
.cl-hist-status { flex: none; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.cl-hist-status.s-loading { color: var(--ink-3); background: #f0f0f5; }
.cl-hist-status.s-doing { color: #b26a00; background: #fff3e0; }
.cl-hist-status.s-done { color: var(--violet-deep); background: var(--violet-soft); }
.cl-hist-status.s-unknown { color: #888; background: #f0f0f5; }
.cl-hist-tip { font-size: 12px; color: var(--ink-3); font-weight: 400; }

/* 本地抽签微调（更精致） */
.lottery-card { border-radius: 18px; }
.lottery-label { color: var(--violet-deep); }
.lottery-sub { color: var(--ink-3); }
.lottery-text {
    border: 1.5px solid var(--line-2); border-radius: 12px; background: #fbfbff;
    padding: 10px 12px; font-size: 15px; line-height: 1.7;
}
.lottery-text:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); outline: none; }

/* ============================================================
   退出胶囊（浅红）+ 我的信息 / 修改信息两层弹窗（2026-11-30）
   与小程序 .hero-btn.is-logout / .me-panel / 资料编辑表单同一套规则
   ============================================================ */

/* 2026-11-30 老板要求：退出胶囊从最右挪到「我的信息」右侧，浅红色（老规矩）。
   参数直接照抄「教室小喇叭」web 端的 .hero-btn.is-logout 同结构配方，
   只把「染红」的力度按浅红调（老板要浅红，不是深红）。
   ★ 踩过的坑（小喇叭那边记着的）：卡片底是紫色渐变，红层太透明（alpha<0.82）
     会被紫底冲成「淡紫」、红色根本看不见 —— 所以底色要够亮，玻璃感靠
     顶部反光带 + 白细边 + 内高光 + 柔和外投影来做。 */
.glass-btn.is-logout {
    background:
        linear-gradient(180deg,
            rgba(255, 255, 255, 0.20) 0%,
            rgba(255, 255, 255, 0.06) 46%,
            rgba(255, 255, 255, 0) 100%),
        linear-gradient(135deg,
            rgba(255, 200, 210, 0.95) 0%,
            rgba(255, 214, 222, 0.95) 42%,
            rgba(255, 192, 204, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.74);
    color: #a22b43;
    font-weight: 800;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        inset 0 -1px 0 rgba(190, 60, 72, 0.10),
        0 2px 8px rgba(45, 24, 130, 0.14);
    backdrop-filter: blur(10px) saturate(1.1);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
}
.glass-btn.is-logout:hover {
    background: linear-gradient(135deg,
        rgba(255, 168, 182, 0.98) 0%,
        rgba(255, 186, 198, 0.98) 42%,
        rgba(255, 158, 174, 0.98) 100%);
    color: #8e1f36;
}
.glass-btn.is-logout:active { background: rgba(255, 150, 166, 0.98); }

/* ---------- 我的信息卡片（照小喇叭 me-card） ---------- */
.me-card { width: min(460px, 92vw); max-height: 86vh; }
.me-body { text-align: center; padding: 20px 26px 8px; }

.me-crest {
    width: 62px;
    height: 62px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.me-school {
    margin-top: 10px;
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.35;
    word-break: break-all;
}
/* 授权状态胶囊：管理员紫 / 长期授权绿 / 试用橙 —— 三色区分，和试用徽章同一套语义 */
.me-plan {
    display: table;
    margin: 10px auto 0;
    padding: 3px 13px;
    border-radius: 999px;
    background: #fff4e6;
    color: #c8860a;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.me-plan.is-admin { background: #eef2ff; color: var(--violet-deep); }
.me-plan.is-invited { background: #e8f8ef; color: #1f9d5b; }
.me-plan.is-empty { display: none; }

.me-rows {
    margin-top: 18px;
    padding: 4px 16px;
    border: 1px solid #eef0f8;
    border-radius: 14px;
    background: #fafbff;
    text-align: left;
}
.me-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f4f5fa;
}
.me-row:last-child { border-bottom: none; }
.me-label { flex: none; color: var(--ink-3); font-size: 13px; }
.me-value {
    flex: 1;
    min-width: 0;
    color: var(--ink-1);
    font-size: 13.5px;
    font-weight: 600;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.me-value.is-empty { color: var(--ink-3); font-weight: 400; }

.me-tip {
    margin-top: 12px;
    color: var(--ink-3);
    font-size: 11.5px;
    line-height: 1.7;
    text-align: left;
}

.me-ops { display: flex; gap: 10px; margin-top: 16px; }
/* 按钮区固定在卡片底部（不跟内容滚）：矮视口下内容再长，入口也一直在 */
.me-foot {
    display: flex;
    flex: none;
    gap: 10px;
    padding: 0 26px 20px;
}
.me-btn {
    flex: 1;
    height: 44px;
    border: 1.5px solid var(--line-2);
    border-radius: 13px;
    background: #fff;
    color: var(--ink-2);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
.me-btn:hover { background: #f6f6fb; border-color: var(--violet-soft); color: var(--violet-deep); }
.me-btn:active { transform: scale(0.97); }

/* ---------- 修改信息表单弹窗 ---------- */
.profile-card { width: min(640px, 92vw); max-height: 84vh; }

.profile-body { padding: 18px 24px 20px; }

.profile-desc {
    margin: 0 0 14px;
    color: var(--ink-3);
    font-size: 13px;
    line-height: 1.65;
}

/* 锁死字段：灰底绿字旁标注，一眼看出「不是漏了，是不让改」 */
.profile-locked {
    margin-bottom: 16px;
    padding: 10px 14px;
    border: 1px dashed var(--line-2);
    border-radius: 14px;
    background: #fafafd;
}
.profile-locked-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-size: 13px;
}
.profile-locked-row + .profile-locked-row { border-top: 1px solid #f0f0f6; }
.profile-locked-label { flex: none; width: 68px; color: var(--ink-3); }
.profile-locked-value {
    flex: 1;
    min-width: 0;
    color: var(--ink-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-locked-tag {
    flex: none;
    padding: 1px 8px;
    border-radius: 999px;
    background: #f0f0f6;
    color: var(--ink-3);
    font-size: 11px;
}

/* 表单栅格 */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
}
.profile-grid-3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }

.profile-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.profile-block { margin-top: 16px; }
.profile-block > .profile-label { display: block; margin-bottom: 8px; }

.profile-label {
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
}

.profile-select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1.5px solid var(--line-2);
    border-radius: 12px;
    background: #fbfbff;
    color: var(--ink);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}
.profile-select:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 3px var(--violet-soft);
    outline: none;
}

/* 校徽选择 */
.profile-crest-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.profile-crest-item {
    display: flex;
    width: 74px;
    padding: 8px 4px;
    border: 2px solid var(--line-2);
    border-radius: 14px;
    background: #fff;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.profile-crest-item:hover { border-color: var(--violet-soft); }
.profile-crest-item.is-on {
    border-color: var(--violet);
    background: var(--violet-wash);
}
.profile-crest-item img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}
.profile-crest-item span {
    color: var(--ink-3);
    font-size: 11px;
    white-space: nowrap;
}
.profile-crest-item.is-on span { color: var(--violet-deep); font-weight: 600; }

.profile-hint {
    margin: 8px 0 0;
    color: var(--ink-3);
    font-size: 12px;
    line-height: 1.6;
}

.profile-error {
    margin: 12px 0 0;
    color: #d93a45;
    font-size: 13px;
    font-weight: 600;
    min-height: 18px;
}

.profile-foot { padding: 14px 24px; }
.profile-btn-ghost,
.profile-btn-primary {
    height: 44px;
    padding: 0 22px;
    border-radius: 13px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, transform 0.08s;
}
.profile-btn-ghost {
    border: 1.5px solid var(--line-2);
    background: #fff;
    color: var(--ink-2);
}
.profile-btn-ghost:hover { background: #f6f6fb; }
.profile-btn-primary {
    border: 0;
    background: var(--violet);
    color: #fff;
}
.profile-btn-primary:hover { filter: brightness(1.08); }
.profile-btn-primary:active { transform: scale(0.97); }
.profile-btn-primary[disabled] { opacity: 0.6; cursor: default; }

/* 手机 / 平板：字段改单列，弹窗占满宽度 */
html[data-device="phone"] .profile-grid,
html[data-device="tablet"] .profile-grid { grid-template-columns: 1fr; }
html[data-device="phone"] .profile-grid-3 { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
html[data-device="phone"] .profile-card { width: 94vw; max-height: 88vh; }
html[data-device="phone"] .profile-crest-item { width: 62px; }
html[data-device="phone"] .profile-foot { flex-direction: column-reverse; gap: 8px; }
html[data-device="phone"] .profile-btn-ghost,
html[data-device="phone"] .profile-btn-primary { width: 100%; }
html[data-device="phone"] .me-card { width: 94vw; }
html[data-device="phone"] .me-crest { width: 54px; height: 54px; }
html[data-device="phone"] .me-school { font-size: 16px; }
