
  /* 用 :where() 把重置的优先级降为 0，否则它会压过后面所有单类选择器 */
  :where(#${ROOT_ID}), :where(#${ROOT_ID} *) {
    box-sizing: border-box; margin: 0; padding: 0;
    -webkit-tap-highlight-color: transparent;
  }
  #${ROOT_ID} {
    position: fixed; inset: 0; z-index: 2147483000;
    font-family: -apple-system, BlinkMacSystemFont, 'HarmonyOS Sans SC', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 14px; line-height: 1.55; color: var(--ink);
    /* ink3 从 #999 加深到 #767：白底上对比度 2.85:1 -> 4.54:1，达到 WCAG AA */
    --bg:#f5f6fa; --card:#ffffff; --ink:#1a1a1a; --ink2:#555555; --ink3:#6e6e6e;
    --red:#ff3b30; --red-dark:#e02f26; --red-ink:#c4271f; --line:#eeeeee; --radius:14px;
    --soft:#fafbfc; --green:#10b981; --green-ink:#047857; --amber:#f59e0b; --amber-ink:#b45309;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
  }
  #${ROOT_ID}.hide { display: none; }
  #${ROOT_ID} svg { width: 18px; height: 18px; display: block; }

  .app { height: 100%; display: flex; flex-direction: column; }

  /* 顶栏 */
  .hd {
    flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line);
  }
  .hd-logo {
    width: 34px; height: 34px; border-radius: 10px; overflow: hidden; flex: 0 0 auto;
    background: #05070d; border: 1px solid var(--line);
  }
  .hd-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
  /* 右上角小号 CC 图标：品牌标识，比左上角头像小一圈 */
  .hd-logo.sm {
    width: 26px; height: 26px; border-radius: 8px; margin-left: auto;
    cursor: pointer;
  }
  .hd-tt { font-size: 16px; font-weight: 700; letter-spacing: .5px; }
  .hd-sub { font-size: 12px; color: var(--ink3); margin-top: -1px; }
  .hd-sp { flex: 1 1 auto; }
  .ico-btn {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    color: var(--ink2); cursor: pointer; transition: .15s; flex: 0 0 auto;
    background: var(--bg);
  }
  .ico-btn:hover { background: #eceef3; color: var(--ink); }

  /* 顶栏第二行：加号 + 角色胶囊 + 状态 + 刷新 */
  .hd2 {
    flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--line);
  }
  .hd-acc { min-width: 0; flex: 1 1 auto; cursor: pointer; }
  .hd-off .hd, .hd-off .hd2 { display: none; }

  .hd-plus {
    position: relative; width: 30px; height: 30px; flex: 0 0 auto; cursor: pointer;
    border-radius: 9px; background: var(--soft); border: 1px solid var(--line);
    display: grid; place-items: center; color: var(--ink2); transition: .15s;
  }
  .hd-plus:hover { background: #f0f1f5; color: var(--ink); border-color: #e2e5ec; }
  .hd-plus b { display: none; font-size: 16px; font-weight: 700; line-height: 1; }
  .hd-plus i {
    width: 12px; height: 12px; position: relative; display: block;
  }
  .hd-plus i::before, .hd-plus i::after {
    content: ''; position: absolute; background: currentColor; border-radius: 1px;
  }
  .hd-plus i::before { left: 5px; top: 0; width: 2px; height: 12px; }
  .hd-plus i::after { top: 5px; left: 0; height: 2px; width: 12px; }
  .hd-plus:hover b { display: block; }
  .hd-plus:hover i { display: none; }

  .hd-chips { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; overflow-x: auto; }
  .hd-chips::-webkit-scrollbar { height: 0; }
  .hd-chips.busy { opacity: .5; pointer-events: none; }
  .rchip {
    width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto;
    display: grid; place-items: center; cursor: pointer; transition: .15s;
    background: var(--soft); border: 1px solid var(--line); color: var(--ink2);
  }
  .rchip i { font-style: normal; font-size: 12px; font-weight: 700; }
  .rchip:hover { border-color: #dfe3ea; color: var(--ink); }
  .rchip.on { background: var(--red); border-color: var(--red-ink); color: #fff; }
  .hd-chips:empty { flex: 0 0 0; }

  /* 角色 / 账号 列表（弹窗内） */
  .role-list, .acc-list { margin: 0 -4px; }
  .role-item, .acc-item {
    display: flex; align-items: center; gap: 10px; padding: 11px 10px;
    border-radius: 12px; cursor: pointer; transition: .15s;
  }
  .role-item:hover, .acc-item:hover { background: var(--soft); }
  .role-item.on, .acc-item.on { background: rgba(255,59,48,.06); }
  .ri-no {
    width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto;
    display: grid; place-items: center; background: var(--soft); border: 1px solid var(--line);
    font-size: 12px; font-weight: 700; color: var(--ink2);
  }
  .role-item.on .ri-no { background: var(--red); border-color: var(--red-ink); color: #fff; }
  .ri-main, .ai-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
  .ri-main b, .ai-main b { font-size: 14px; font-weight: 700; }
  .ri-main em, .ai-main em { font-style: normal; font-size: 12px; color: var(--ink3); }
  .ri-tag {
    flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--red-ink);
    background: rgba(255,59,48,.09); border-radius: 6px; padding: 2px 7px;
  }
  .ri-set {
    flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--ink2);
    background: var(--soft); border: 1px solid var(--line); border-radius: 999px;
    padding: 4px 11px; transition: .15s;
  }
  .ri-set:hover { border-color: var(--red-ink); color: var(--red-ink); }
  .ai-av {
    width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
    display: grid; place-items: center; font-size: 13px; font-weight: 800;
    color: #fff; background: linear-gradient(135deg, #ff8a80, #ff3b30);
  }
  .ai-del {
    flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--ink3);
    border-radius: 999px; padding: 4px 11px; border: 1px solid var(--line);
    transition: .15s;
  }
  .ai-del:hover { border-color: var(--red-ink); color: var(--red-ink); }

  /* ---------- 一键日常页 ---------- */
  .d-acc { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
  .d-acc:last-child { margin-bottom: 0; }
  .d-acc-hd { display: flex; align-items: center; gap: 10px; }
  .d-all {
    flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--ink2);
    border: 1px solid var(--line); background: var(--soft); border-radius: 999px;
    padding: 4px 11px; cursor: pointer; transition: .15s;
  }
  .d-all:hover { border-color: var(--red-ink); color: var(--red-ink); }
  .d-norole { font-size: 12px; color: var(--ink3); padding: 8px 2px 0; }
  .d-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
  .d-role {
    padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: var(--soft); border: 1px solid var(--line); color: var(--ink2);
    cursor: pointer; transition: .15s; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .d-role:hover { border-color: #dfe3ea; }
  .d-role.on { background: var(--red); border-color: var(--red-ink); color: #fff; }

  .d-grp { margin-bottom: 12px; }
  .d-grp:last-child { margin-bottom: 0; }
  .d-grp-hd {
    display: flex; align-items: center; font-size: 13px; font-weight: 700;
    color: var(--ink2); padding-bottom: 6px;
  }
  .d-grp-hd b {
    margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ink3);
    cursor: pointer; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line);
  }
  .d-grp-hd b:hover { border-color: var(--red-ink); color: var(--red-ink); }
  .d-grp-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 6px; }
  /* 网格里文字允许换行，长任务名不会被省略号截断 */
  .d-grp-body .d-name { white-space: normal; overflow: visible; text-overflow: clip; }

  .d-task {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--soft);
    cursor: pointer; transition: .15s; font-size: 13px; color: var(--ink2);
    max-width: 100%;
  }
  .d-task:hover { border-color: #dfe3ea; }
  .d-task.on { background: rgba(255,59,48,.06); border-color: rgba(255,59,48,.35); color: var(--ink); }
  .d-task input { position: absolute; opacity: 0; pointer-events: none; }
  .d-box {
    width: 15px; height: 15px; flex: 0 0 auto; border-radius: 4px;
    border: 1.5px solid #cfd4de; background: #fff; display: grid; place-items: center;
  }
  .d-task.on .d-box { background: var(--red); border-color: var(--red-ink); }
  .d-box::after {
    content: ''; width: 4px; height: 8px; border-right: 2px solid #fff;
    border-bottom: 2px solid #fff; transform: rotate(43deg) translateY(-1px); opacity: 0;
  }
  .d-task.on .d-box::after { opacity: 1; }
  .d-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .d-opt-row {
    display: flex; align-items: center; gap: 10px; padding: 9px 0;
    border-bottom: 1px solid var(--line); font-size: 13px;
  }
  .d-opt-row:last-child { border-bottom: none; }
  .d-opt-row > span:first-child { flex: 0 0 auto; color: var(--ink2); }
  .d-num { flex: 0 0 90px; max-width: 90px; margin-left: auto; text-align: right; }

  /* ---------- 紧凑下拉框 ----------
     原生 select 直接在行内显示会露出系统样式、右侧留一大片空白，
     这里统一成「浅灰底 + 圆角 + 自绘箭头」的小胶囊，宽度只包住内容。 */
  .sel {
    position: relative; display: inline-flex; align-items: center;
    margin-left: auto; flex: 0 0 auto;
  }
  .sel select {
    appearance: none; -webkit-appearance: none;
    border: 1px solid transparent; border-radius: 9px;
    background: var(--soft); color: var(--ink);
    font-family: inherit; font-size: 13px; font-weight: 500;
    padding: 6px 26px 6px 11px; cursor: pointer; outline: none;
    transition: border-color .15s, background .15s;
  }
  .sel select:focus { border-color: rgba(255,59,48,.45); background: #fff; }
  .sel::after {
    content: ''; position: absolute; right: 11px; top: 50%;
    width: 6px; height: 6px; margin-top: -4px; pointer-events: none;
    border-right: 1.7px solid var(--ink3); border-bottom: 1.7px solid var(--ink3);
    transform: rotate(45deg);
  }

  /* ---------- 分段控件 ----------
     比原生下拉更直观：选项全部可见、一眼能点。
     邮件筛选 / 聊天频道 都用它。 */
  .seg {
    display: flex; gap: 4px; padding: 3px; flex: 1; min-width: 0;
    background: var(--soft); border: 1px solid var(--line); border-radius: 11px;
  }
  .seg > button {
    flex: 1 1 0; min-width: 0; border: none; cursor: pointer; font-family: inherit;
    padding: 7px 4px; border-radius: 8px; background: transparent; color: var(--ink2);
    font-size: 13px; font-weight: 600; letter-spacing: .2px;
    transition: background .15s, color .15s, box-shadow .15s;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .seg > button:active { transform: scale(.98); }
  .seg > button.on {
    background: #fff; color: var(--red-ink); box-shadow: 0 1px 4px rgba(0,0,0,.08);
  }

  .d-progress { height: 6px; border-radius: 6px; background: #eef0f5; overflow: hidden; margin-bottom: 12px; }
  .d-progress > i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--red); transition: width .25s; }
  .d-note { font-size: 12px; color: var(--ink3); margin-top: 8px; }
  .hit-list { font-size: 13px; color: var(--ink2); line-height: 1.9; margin-top: 8px; }

  .d-logtip {
    text-align: center; font-size: 13px; color: var(--ink3);
    padding: 14px; background: var(--soft); border-radius: 10px; cursor: pointer;
  }
  .d-logtip:hover { color: var(--ink2); }
  .d-logbar {
    display: flex; align-items: center; gap: 8px; font-size: 12px;
    color: var(--ink3); margin-bottom: 8px;
  }
  .d-logbar b {
    font-size: 12px; font-weight: 600; color: var(--ink3); cursor: pointer;
    padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
  }
  .d-logbar b:hover { border-color: var(--red-ink); color: var(--red-ink); }
  .d-log { max-height: 300px; overflow-y: auto; }
  .d-log::-webkit-scrollbar { width: 0; }
  .d-log .ln { font-size: 12px; line-height: 1.75; word-break: break-all; color: var(--ink2); }
  .d-log .ln .t { color: #b4bac6; margin-right: 6px; font-variant-numeric: tabular-nums; }
  .d-log .ln.ok { color: var(--green-ink); }
  .d-log .ln.err { color: var(--red-ink); }
  .d-log .ln.warn { color: var(--amber-ink); }
  .d-log .ln.hl { color: #4c6ef5; font-weight: 600; }
  .d-log .ln.hit { color: var(--red-ink); font-weight: 700; }
  .d-log .ln.hit .t { color: var(--red-ink); }

  .dot-badge {
    display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto;
    padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
    background: var(--soft); color: var(--ink3); border: 1px solid var(--line);
  }
  .dot-badge i { width: 6px; height: 6px; border-radius: 50%; background: #ccc; }
  .dot-badge.on { color: var(--green-ink); border-color: rgba(16,185,129,.3); background: rgba(16,185,129,.08); }
  .dot-badge.on i { background: var(--green); }
  .dot-badge.err { color: var(--red-ink); border-color: rgba(255,59,48,.3); background: rgba(255,59,48,.07); }
  .dot-badge.err i { background: var(--red); }

  /* 主体 */
  .main { flex: 1 1 auto; overflow-y: auto; padding: 12px 16px 104px; -webkit-overflow-scrolling: touch; }
  .main::-webkit-scrollbar { width: 0; }
  .pg { display: none; }
  .pg.on { display: block; animation: fadeUp .22s ease both; }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

  /* 卡片 */
  .card {
    background: var(--card); border-radius: var(--radius); padding: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,.04); margin-bottom: 12px;
  }
  .card.tight { padding: 6px 0; }
  .sec-title {
    display: flex; align-items: center; gap: 7px;
    font-size: 14px; font-weight: 700; color: var(--ink); margin: 4px 0 10px;
  }
  .sec-title svg { width: 16px; height: 16px; color: var(--red-ink); flex: 0 0 auto; }
  .sec-title .r { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--ink3); }
  .sub-title { font-size: 13px; color: var(--ink2); margin: 12px 0 8px; font-weight: 600; }
  .sub-title:first-child { margin-top: 0; }

  /* 信息网格 */
  .info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .info-item {
    background: var(--soft); border-radius: 10px; padding: 9px 11px;
  }
  .info-key { font-size: 12px; color: var(--ink3); }
  .info-val {
    font-size: 16px; font-weight: 700; margin-top: 1px;
    font-variant-numeric: tabular-nums; word-break: break-all;
  }
  .info-val.sm { font-size: 13px; }
  .info-val.red { color: var(--red-ink); }
  .info-val.green { color: var(--green-ink); }

  /* 统计格（4 列紧凑） */
  .stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
  .stat { background: var(--soft); border-radius: 10px; padding: 9px; text-align: center; }
  .stat b { display: block; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
  .stat span { font-size: 12px; color: var(--ink3); }
  .stat.r b { color: var(--red-ink); }
  .stat.g b { color: var(--green-ink); }

  /* 表单 */
  .form-row { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
  .form-row:last-child { border-bottom: none; }
  .form-label { flex: 0 0 68px; font-size: 14px; color: var(--ink2); }
  .form-input, .form-select {
    flex: 1 1 auto; width: 100%; min-height: 46px; border: none; outline: none; font-size: 14px;
    color: var(--ink); background: transparent; font-family: inherit; min-width: 0;
  }
  .form-input::placeholder { color: #bbb; }
  .form-select { appearance: none; -webkit-appearance: none; cursor: pointer; }
  .sel-wrap { flex: 1 1 auto; position: relative; display: flex; align-items: center; }
  .sel-wrap::after {
    content: ''; width: 7px; height: 7px; border-right: 1.6px solid var(--ink3);
    border-bottom: 1.6px solid var(--ink3); transform: rotate(45deg) translateY(-2px);
    position: absolute; right: 4px; pointer-events: none;
  }

  /* 按钮 */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 11px 16px; border: none; border-radius: 12px; cursor: pointer;
    font-size: 14px; font-weight: 600; font-family: inherit; transition: .15s;
    background: #f0f1f5; color: var(--ink);
  }
  .btn:active { transform: scale(.985); }
  .btn:disabled { opacity: .45; cursor: not-allowed; }
  .btn.primary { background: var(--red); color: #fff; box-shadow: 0 4px 16px rgba(255,59,48,.25); }
  .btn.primary:disabled { background: #ffb3b0; box-shadow: none; }
  .btn.block { display: flex; width: 100%; }
  .btn.danger { background: rgba(255,59,48,.09); color: var(--red-ink); }
  .btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
  .btn.grow { flex: 1 1 0; min-width: 0; }
  .btn-row { display: flex; gap: 8px; }

  /* 标签胶囊 */
  .chips { display: flex; flex-wrap: wrap; gap: 7px; }
  .chip {
    padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 600;
    background: var(--soft); color: var(--ink2); border: 1px solid var(--line);
    cursor: pointer; transition: .15s; white-space: nowrap;
  }
  .chip:hover { border-color: #ddd; }
  /* 品质底色 q1~q7（1紫 2橙 3红 4红 5橙 6红 7金），与 D.COLOR_HEX 同一口径 */
  .chip.q7 { background: rgba(244,197,66,.14); border-color: rgba(244,197,66,.5); color: #997718; }
  .chip.q6, .chip.q4, .chip.q3 { background: rgba(224,69,62,.12); border-color: rgba(224,69,62,.42); color: #b8362f; }
  .chip.q5, .chip.q2 { background: rgba(224,138,30,.13); border-color: rgba(224,138,30,.45); color: #a8620f; }
  .chip.q1 { background: rgba(139,92,246,.11); border-color: rgba(139,92,246,.4); color: #6d3fc7; }
  .chip.on { background: var(--red); color: #fff; border-color: var(--red-ink); }
  .chip.sm { padding: 4px 10px; font-size: 12px; }
  .chip-off { opacity: .5; cursor: not-allowed; background: var(--bg); }

  /* 目标词条网格：每列等宽，行、列都对齐（词条名长短不一也不参差） */
  .attr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
    gap: 7px;
  }
  .attr-grid .chip { display: block; width: auto; text-align: center; padding-left: 4px; padding-right: 4px; }
  /* 武将胶囊上的小标（上阵 / 红淬） */
  .chip-tag {
    font-style: normal; font-size: 12px; font-weight: 800; line-height: 1;
    padding: 2px 5px; border-radius: 6px; margin-left: 5px; vertical-align: middle;
  }
  .chip-tag.onb { color: #fff; background: #2f7de1; }
  /* 红淬标记：红色实心菱形（矢量绘制，避免特殊字符字体回退错位），右侧可带数量 */
  .q-red { display: inline-flex; align-items: center; gap: 1px; margin-left: 4px; color: #e0453e; vertical-align: middle; }
  #${ROOT_ID} .q-red svg { width: 10px; height: 10px; }
  .q-red b { font-size: 12px; font-weight: 800; line-height: 1; }
  /* 「展开 / 收起」小开关（放在卡片标题右侧） */
  .sec-toggle { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--red-ink); cursor: pointer; }
  .sec-toggle:hover { text-decoration: underline; }

  /* 当前装备淬炼属性 */
  .cur-q { display: flex; flex-direction: column; gap: 6px; }
  .cur-q-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 8px;
    background: var(--soft); border: 1px solid var(--line); font-size: 13px;
    cursor: pointer; transition: .15s;
  }
  .cur-q-item:hover { border-color: #ddd; }
  .cur-q-item.locked { background: rgba(245,158,11,.06); border-color: rgba(245,158,11,.3); }
  .cur-q-slot { flex: 0 0 auto; font-size: 12px; color: var(--ink3); width: 34px; }
  .cur-q-name { flex: 1 1 auto; font-weight: 700; }
  .cur-q-val { flex: 0 0 auto; font-weight: 700; font-variant-numeric: tabular-nums; }
  /* 孔位锁定开关：iOS 滑动开关（与参考站一致：44x24 轨道 + 圆点滑动） */
  .lock-toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 auto; }
  .lock-toggle input { display: none; }
  .lock-track {
    position: absolute; inset: 0; border-radius: 12px; background: #e5e6e8;
    transition: .2s; cursor: pointer;
  }
  .lock-track::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: .2s;
  }
  .lock-toggle input:checked + .lock-track { background: var(--red); }
  .lock-toggle input:checked + .lock-track::after { left: 22px; }
  .lock-toggle input:disabled + .lock-track { opacity: .5; cursor: not-allowed; }
  .lock-toggle.busy .lock-track { opacity: .55; }
  /* 具体加成后面的洗练值 */
  .cur-q-roll { font-style: normal; font-size: 12px; font-weight: 600; opacity: .62; margin-left: 3px; }

  /* 装备淬炼：正面 / 反面 切换（标题右侧，胶囊小按钮） */
  .q-side { margin-left: auto; display: inline-flex; gap: 0; background: var(--bg); border-radius: 999px; padding: 2px; }
  .q-side > button {
    border: none; cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 700;
    padding: 4px 14px; border-radius: 999px; background: transparent; color: var(--ink3);
    transition: background .18s, color .18s, box-shadow .18s, transform .1s;
  }
  .q-side > button.on { background: var(--red); color: #fff; box-shadow: 0 2px 10px rgba(255,59,48,.28); }
  .q-side > button:active { transform: scale(.95); }

  /* 部位选择：一行排完 4 个（等宽网格，不换行） */
  .part-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
  .part-grid .chip {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 8px 4px; white-space: normal; line-height: 1.25;
  }

  /* 洗练动画（运行中的按钮）：红色流光扫过 + 图标自转 */
  @keyframes ccSheen { 0% { background-position: -180% 0; } 100% { background-position: 280% 0; } }
  @keyframes ccSpin { to { transform: rotate(360deg); } }
  .btn.primary.running {
    background-image: linear-gradient(100deg, rgba(255,255,255,0) 35%, rgba(255,255,255,.42) 50%, rgba(255,255,255,0) 65%);
    background-size: 220% 100%; background-repeat: no-repeat;
    animation: ccSheen 1.35s linear infinite;
  }
  .btn .spin { display: inline-flex; width: 14px; height: 14px; animation: ccSpin 1s linear infinite; }
  .spin-ring {
    width: 100%; height: 100%; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.42); border-top-color: #fff;
  }
  .cur-q-item { transition: background .18s, border-color .18s, box-shadow .18s; }
  .cur-q-item:hover { background: #fff; }

  /* 鱼珠孔位行 */
  .q-slot {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 8px; margin-bottom: 6px;
    background: var(--soft); border: 1px solid var(--line); font-size: 13px;
  }
  .q-slot.locked { background: rgba(245,158,11,.06); border-color: rgba(245,158,11,.3); }
  .q-slot.tmp { background: rgba(16,185,129,.06); border-color: rgba(16,185,129,.25); }
  .q-slot-num { flex: 0 0 auto; font-size: 12px; color: var(--ink3); width: 34px; }

  /* 材料条（带游戏内图标） */
  .q-mat {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
    font-size: 13px; color: var(--ink2);
  }
  .q-mat-lbl { color: var(--ink3); font-size: 12px; }
  .q-mat-item { display: inline-flex; align-items: center; gap: 5px; }
  .q-mat-ico {
    width: 22px; height: 22px; border-radius: 5px; object-fit: cover;
    background: var(--soft); border: 1px solid var(--line); flex: 0 0 auto;
  }
  .q-mat-ico.ph {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; color: var(--ink3);
  }
  .q-mat-num { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
  .q-mat-name { color: var(--ink2); font-size: 12px; font-weight: 600; }

  /* 鱼珠：珠宝球（网页版立体质感） */
  .p-orbs { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 4px 0; }
  .p-orb { display: flex; flex-direction: column; align-items: center; gap: 6px; }
  .p-orb-in {
    position: relative; width: 96px; height: 96px; border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #fff; text-align: center; line-height: 1.1; overflow: hidden;
    /* 球身渐变的中间色（--c 由内联 style 按品质色提供），旧浏览器/无 JS 时兜底 */
    background-color: var(--c, #565e6a);
    /* 球体：左上高光 -> 球身三色渐变（亮/中/暗，亮暗由 JS 从品质色推导） -> 右下暗部 */
    background-image:
      radial-gradient(circle at 30% 24%, rgba(255,255,255,.58) 0%, rgba(255,255,255,.2) 10%, rgba(255,255,255,0) 30%),
      radial-gradient(circle at 68% 80%, rgba(0,0,0,.24) 0%, rgba(0,0,0,0) 55%),
      linear-gradient(150deg, var(--c-light, #7b8494) 0%, var(--c, #565e6a) 46%, var(--c-dark, #353b45) 100%);
    box-shadow:
      0 3px 8px rgba(0,0,0,.14),
      0 0 0 2px rgba(255,255,255,.3),
      inset 0 -7px 14px rgba(0,0,0,.22),
      inset 0 7px 12px rgba(255,255,255,.14);
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
  }
  /* 玻璃高光条 */
  .p-orb-in::before {
    content: ''; position: absolute; left: 16%; top: 6%;
    width: 40%; height: 24%; border-radius: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0));
    transform: rotate(-24deg); filter: blur(.4px); pointer-events: none;
  }
  /* 底部小反光 */
  .p-orb-in::after {
    content: ''; position: absolute; left: 50%; bottom: 8%;
    width: 44%; height: 13%; border-radius: 50%; transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(255,255,255,.26), rgba(255,255,255,0));
    pointer-events: none;
  }
  .p-orb-in.empty {
    background-color: #3a4150;
    background-image:
      radial-gradient(circle at 30% 24%, rgba(255,255,255,.32) 0%, rgba(255,255,255,0) 30%),
      radial-gradient(circle at 68% 80%, rgba(0,0,0,.3) 0%, rgba(0,0,0,0) 58%),
      linear-gradient(150deg, #59626f 0%, #3a4150 50%, #262b33 100%);
    box-shadow:
      0 2px 6px rgba(0,0,0,.12),
      0 0 0 2px rgba(255,255,255,.18),
      inset 0 -6px 12px rgba(0,0,0,.2),
      inset 0 6px 10px rgba(255,255,255,.1);
    color: #aeb6c4; text-shadow: 0 1px 2px rgba(0,0,0,.3);
  }
  .p-orb.tmp .p-orb-in {
    background-color: #ffcd5a;
    background-image:
      radial-gradient(circle at 30% 24%, rgba(255,255,255,.6) 0%, rgba(255,255,255,.24) 10%, rgba(255,255,255,0) 30%),
      radial-gradient(circle at 68% 80%, rgba(120,80,0,.28) 0%, rgba(0,0,0,0) 55%),
      linear-gradient(150deg, #ffe9a8 0%, #ffcd5a 46%, #c98a0a 100%);
    box-shadow:
      0 3px 8px rgba(0,0,0,.14),
      0 0 0 2px rgba(255,235,150,.55),
      0 0 12px 1px rgba(255,205,90,.3),
      inset 0 -7px 14px rgba(120,80,0,.22),
      inset 0 7px 12px rgba(255,255,255,.2);
    color: #5a3d00; text-shadow: 0 1px 1px rgba(255,255,255,.4);
  }
  .p-orb-name { font-size: 13px; font-weight: 800; letter-spacing: .3px; }
  .p-orb-real { font-size: 16px; font-weight: 900; margin-top: 1px; }
  .p-orb-pct { font-size: 12px; opacity: .92; margin-top: 1px; }
  .p-orb-max { font-size: 12px; opacity: .78; }
  .p-orb-tag { font-size: 12px; color: var(--ink3); }

  /* 宠物头像选择 */
  .pet-avs { display: flex; flex-wrap: wrap; gap: 10px; }
  .pet-av {
    display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer;
    padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft);
    transition: .15s; min-width: 78px;
  }
  .pet-av:hover { border-color: #ddd; }
  #q-pet-list > span.on { background: rgba(255,59,48,.06); border-color: var(--red-ink); }
  #q-pet-list > span.on .pet-av-img { box-shadow: 0 0 0 2px var(--red); }
  .pet-av-img {
    width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
    background: var(--soft); border: 1px solid var(--line); flex: 0 0 auto;
  }
  /* 宠物头像容器：CDN 图挂了就露出品质色字母头像（不再是一个灰圈） */
  .pet-av-wrap { position: relative; width: 52px; height: 52px; flex: 0 0 auto; }
  .pet-av-wrap .pet-av-ico { position: absolute; inset: 0; display: none; }
  .pet-av-wrap.fallback .pet-av-ico { display: flex; }
  .pet-av-wrap.fallback .pet-av-img { display: none; }
  .pet-av-ico {
    width: 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 900; color: #fff;
    background-color: var(--c, #ff9500);
    background-image:
      radial-gradient(circle at 32% 26%, rgba(255,255,255,.9) 0%, rgba(255,255,255,.25) 12%, rgba(255,255,255,0) 40%),
      radial-gradient(circle at 70% 80%, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 60%);
  }
  .pet-av-nm { font-size: 12px; font-weight: 700; color: var(--ink); }
  .pet-av-sub { font-size: 12px; color: var(--ink3); }

  /* 宠物精炼槽位：左四右四（2 列网格） */
  .pet-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .pet-slot {
    cursor: pointer; padding: 8px 10px; border-radius: 10px;
    background: var(--soft); border: 1px solid var(--line); transition: .15s;
    border-left: 4px solid var(--c, #9aa4b2);
  }
  .pet-slot:hover { border-color: #ddd; }
  .pet-slot.locked { background: rgba(245,158,11,.07); border-color: rgba(245,158,11,.35); }
  .pet-slot.empty { border-left-color: #c8cdd6; opacity: .75; }
  .pet-slot-hd {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; font-weight: 700; color: var(--ink2); margin-bottom: 5px;
  }
  .pet-slot-lk {
    font-size: 12px; font-weight: 600; color: var(--ink3);
  }
  .pet-slot-hd .lock-toggle { transform: scale(.82); transform-origin: right center; }
  .pet-slot-bd { display: flex; flex-direction: column; gap: 2px; }
  .pet-attr { font-size: 12px; color: var(--ink2); line-height: 1.35; }
  .pet-attr b { color: var(--ink); font-weight: 700; }
  .pet-slot-none { font-size: 12px; color: var(--ink3); }

  /* 分段切换 */
  .seg { display: flex; gap: 4px; padding: 3px; background: var(--bg); border-radius: 11px; }
  /* 淬炼升级页签：单行等分（不再折成两行） */
  .q-tabgrid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)); gap: 4px;
    background: var(--bg); border-radius: 11px; padding: 3px;
    flex: 1 1 auto; min-width: 0; width: 100%;
  }
  .q-tabgrid > button {
    border: none; cursor: pointer; font-family: inherit; min-width: 0;
    padding: 8px 0; border-radius: 8px; background: transparent; color: var(--ink2);
    font-size: 12px; font-weight: 600; letter-spacing: -0.5px; white-space: nowrap;
    overflow: visible; transition: .15s;
  }
  .q-tabgrid > button.on { background: var(--card); color: var(--red-ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
  .q-tabgrid > button:disabled { opacity: .38; cursor: not-allowed; }
  .seg > b {
    flex: 1 1 0; text-align: center; padding: 7px 4px; border-radius: 9px;
    font-size: 13px; font-weight: 600; color: var(--ink2); cursor: pointer; transition: .15s;
  }
  .seg > b.on { background: var(--card); color: var(--red-ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

  /* 孔位 */
  .holes { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
  .hole {
    position: relative; background: var(--soft); border-radius: 10px; padding: 9px 10px;
    cursor: pointer; transition: .15s; border: 1.5px solid transparent;
  }
  .hole:hover { border-color: #e2e5ec; }
  .hole.locked { border-color: rgba(255,59,48,.35); background: rgba(255,59,48,.045); }
  .hole.empty { opacity: .5; }
  .hole-no { font-size: 12px; color: var(--ink3); display: flex; justify-content: space-between; align-items: center; }
  .hole-attr { font-size: 13px; font-weight: 700; margin-top: 4px; }
  .hole-val { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: -1px; }
  .hole-val em { font-size: 12px; font-style: normal; color: var(--ink3); font-weight: 600; margin-left: 3px; }
  .hole-bar { height: 4px; border-radius: 4px; background: #e6e8ee; margin-top: 7px; overflow: hidden; }
  .hole-bar > i { display: block; height: 100%; border-radius: 4px; background: var(--red); }
  .hole-lock {
    position: absolute; top: 8px; right: 8px; width: 15px; height: 15px;
    color: var(--red-ink); opacity: 0; transition: .15s;
  }
  .hole.locked .hole-lock { opacity: 1; }
  .hole-lock svg { width: 15px; height: 15px; }

  /* 品质色点 */
  .qdot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

  /* 道具格 */
  .items { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
  .item {
    background: var(--soft); border-radius: 10px; padding: 10px 6px; text-align: center;
    cursor: pointer; transition: .15s; border: 1px solid transparent;
  }
  .item:hover { border-color: #e2e5ec; background: #fff; }
  .item.dis { opacity: .45; }
  .item .thumb {
    width: 36px; height: 36px; border-radius: 9px; margin: 0 auto 6px;
    object-fit: cover; background: #eef0f5; display: grid; place-items: center;
    font-size: 14px; font-weight: 800; color: var(--ink3);
  }
  .item .nm { font-size: 12px; font-weight: 600; line-height: 1.3; }
  .item .qt { font-size: 12px; color: var(--red-ink); font-weight: 700; font-variant-numeric: tabular-nums; }

  /* 列表行 */
  .row {
    display: flex; align-items: center; gap: 10px; padding: 11px 14px;
    border-bottom: 1px solid var(--line); font-size: 14px;
  }
  .row:last-child { border-bottom: none; }
  .row .k { color: var(--ink2); flex: 0 0 auto; }
  .row .v { margin-left: auto; font-weight: 600; text-align: right; word-break: break-all; }
  .row .v.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }

  /* 英雄卡 */
  .hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .hero-card { background: var(--card); border-radius: var(--radius); padding: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.04); }
  .hero-head { display: flex; align-items: center; gap: 8px; }
  .hero-av {
    width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; display: grid;
    place-items: center; background: linear-gradient(135deg,#ffd9d6,#ffe9e7);
    color: var(--red-dark); font-weight: 800; font-size: 12px;
  }
  .hero-name { font-size: 14px; font-weight: 700; }
  .hero-sub { font-size: 12px; color: var(--ink3); }

  /* 日志 */
  .log {
    background: #16181d; color: #c8d4dc; border-radius: 12px; padding: 12px;
    max-height: 260px; overflow-y: auto; font-family: ui-monospace, 'SF Mono', Consolas, monospace;
    font-size: 12px; line-height: 1.75;
  }
  .log::-webkit-scrollbar { width: 0; }
  .log .ln { word-break: break-all; }
  .log .ln .t { color: #5f6b76; margin-right: 6px; }
  .log .ln.ok { color: #4ade80; }
  .log .ln.err { color: #f87171; }
  .log .ln.warn { color: #fbbf24; }
  .log .ln.hl { color: #93c5fd; }
  .log .ln .src { color: #7c8794; margin-right: 6px; }

  /* 空态 */
  .empty { text-align: center; color: var(--ink3); padding: 40px 20px; font-size: 13px; }
  .empty svg { width: 34px; height: 34px; margin: 0 auto 10px; color: #cfd4de; }

  .spin {
    width: 15px; height: 15px; border-radius: 50%; display: inline-block;
    vertical-align: -2px; border: 2px solid #e3e6ec; border-top-color: var(--red-ink);
    animation: sp .7s linear infinite;
  }
  @keyframes sp { to { transform: rotate(360deg); } }

  .switch {
    position: relative; width: 46px; height: 26px; border-radius: 999px;
    background: #dfe2e9; cursor: pointer; transition: .2s; flex: 0 0 auto;
  }
  .switch::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: .2s;
  }
  .switch.on { background: var(--red); }
  .switch.on::after { left: 22px; }

  /* 底部导航：三段式
     左组 3 列 × 2 行（6 入口） + 中间「总览」主按钮 + 右组 3 列 × 2 行（5 入口）。
     总览水平居中、垂直落在两行正中，左右各留间距。 */
  .nav {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
    display: flex; align-items: stretch; justify-content: center;
    background: var(--card); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  /* 左右两组：各占 3 列 × 2 行 */
  .nav-group {
    flex: 1 1 0; min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 2px 1px;
  }
  .nav-item {
    min-width: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1px;
    padding: 3px 1px; cursor: pointer; color: var(--ink3); transition: color .15s, background .15s;
    border-radius: 10px;
  }
  .nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; }
  .nav-item span {
    font-size: 12px; font-weight: 600; line-height: 1.15; white-space: nowrap;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  }
  .nav-item.on { color: var(--red-ink); }
  .nav-item:active { background: rgba(0,0,0,.035); }

  /* ---- 总览：两行正中的主按钮 ----
     固定宽度槽位，水平居中；按钮垂直落在两行入口的正中（上下各一行）。 */
  .nav-hero {
    flex: 0 0 auto; width: 72px; margin: 0 8px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; cursor: pointer; z-index: 6; position: relative;
    -webkit-tap-highlight-color: transparent;
  }
  /* 图标垂直对齐两行入口中线：图标占位居中，文字贴在图标下，
     整体相对两行中线居中偏移，保证 56px 圆正好卡在两行正中间 */
  .nav-hero .hero-ico { margin-top: 12px; }
  .nav-hero .hero-ico {
    width: 56px; height: 56px; border-radius: 50%;
    display: grid; place-items: center; color: #fff;
    background: linear-gradient(135deg, #ff6b60, #e02f26);
    box-shadow: 0 6px 18px rgba(224,47,38,.34), 0 2px 6px rgba(224,47,38,.20);
    /* 动画：入场弹跳 + 呼吸光晕 */
    animation: hero-in .5s cubic-bezier(.34,1.56,.64,1) both,
               hero-pulse 2.6s ease-in-out 0.5s infinite;
  }
  .nav-hero .hero-ico svg { width: 27px; height: 27px; }
  .nav-hero > span:last-child {
    font-size: 12px; font-weight: 800; color: var(--red-ink); line-height: 1.1;
  }
  .nav-hero.on .hero-ico {
    animation: hero-in .5s cubic-bezier(.34,1.56,.64,1) both,
               hero-pulse 2.6s ease-in-out 0.5s infinite;
  }
  .nav-hero:active .hero-ico { transform: scale(.92); }
  .nav-hero:active { animation: none; }

  @keyframes hero-in {
    0%   { transform: scale(0) translateY(20px); opacity: 0; }
    60%  { transform: scale(1.12) translateY(-2px); opacity: 1; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
  }
  @keyframes hero-pulse {
    0%, 100% { box-shadow: 0 6px 18px rgba(224,47,38,.34), 0 2px 6px rgba(224,47,38,.20); }
    50%      { box-shadow: 0 6px 24px rgba(224,47,38,.48), 0 0 0 6px rgba(224,47,38,.08); }
  }
  /* 主按钮较高，底部给内容区多留空间，别让最后一张卡片被压住 */
  #${ROOT_ID} .main { padding-bottom: 118px; }

  #${ROOT_ID}.no-nav .nav { display: none; }
  #${ROOT_ID}.no-nav .main { padding-bottom: 24px; }

  /* Toast */
  .toasts {
    position: absolute; left: 50%; top: 64px; transform: translateX(-50%);
    display: flex; flex-direction: column; gap: 8px; align-items: center;
    z-index: 40; pointer-events: none; width: max-content; max-width: 86%;
  }
  .toast {
    padding: 10px 18px; border-radius: 12px; font-size: 13px; font-weight: 600;
    background: rgba(22,24,29,.94); color: #fff; box-shadow: 0 8px 26px rgba(0,0,0,.22);
    animation: tin .22s ease both; text-align: center;
  }
  .toast.ok { background: rgba(16,185,129,.96); }
  .toast.err { background: rgba(255,59,48,.96); }
  .toast.warn { background: rgba(245,158,11,.96); }
  @keyframes tin { from { opacity: 0; transform: translateY(-10px) scale(.96); } to { opacity: 1; transform: none; } }

  /* 弹窗 */
  .mask {
    position: absolute; inset: 0; background: rgba(0,0,0,.42); z-index: 50;
    display: flex; align-items: flex-end; justify-content: center;
    animation: min .2s ease both;
  }
  @keyframes min { from { opacity: 0; } to { opacity: 1; } }
  .sheet {
    width: 100%; max-width: 520px; background: var(--card);
    border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    animation: sup .24s cubic-bezier(.2,.9,.3,1.1) both;
    max-height: 82vh; overflow-y: auto;
  }
  @keyframes sup { from { transform: translateY(100%); } to { transform: none; } }
  .sheet h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
  .sheet .desc { font-size: 13px; color: var(--ink2); margin-bottom: 14px; }
  .sheet .acts { display: flex; gap: 10px; margin-top: 18px; }
  .sheet .acts .btn { flex: 1 1 0; }

  /* 登录页（整体居中，两侧留白） */
  .login {
    min-height: 100%; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 24px 30px 48px; text-align: center;
  }
  .login-avatar {
    width: 100px; height: 100px; border-radius: 50%; overflow: hidden; flex: 0 0 auto;
    background: #05070d; box-shadow: 0 6px 24px rgba(0,0,0,.16);
  }
  .login-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .login-title {
    font-size: 26px; font-weight: 800; letter-spacing: 2px; text-indent: 2px; margin: 16px 0 4px;
  }
  .login-card {
    width: 100%; max-width: 322px; background: var(--card);
    border-radius: var(--radius); margin-top: 24px; padding: 4px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,.05); text-align: left;
  }
  .login-card .form-row { padding: 12px 18px; }
  .btn-login {
    width: 100%; max-width: 322px; margin: 18px 0 0; padding: 15px;
    background: var(--red-dark); color: #fff; border: none; border-radius: var(--radius);
    font-size: 16px; font-weight: 700; letter-spacing: 5px;
    font-family: inherit; cursor: pointer; transition: .15s;
    box-shadow: 0 4px 16px rgba(255,59,48,.25);
  }
  .btn-login:disabled { background: #ffb3b0; box-shadow: none; letter-spacing: 1px; }
  /* 已保存账号：一排可点的账号芯片，点多账号来回切不用重输密码 */
  .lg-accs {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
    margin: 2px 0 10px; padding: 0 8px; max-width: 322px;
  }
  .lg-acc {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 6px 14px; border-radius: 12px; cursor: pointer;
    background: var(--card); border: 1px solid var(--line);
    transition: .15s; max-width: 140px;
  }
  .lg-acc b {
    font-size: 13px; font-weight: 700; color: var(--ink);
    max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .lg-acc em { font-style: normal; font-size: 12px; color: var(--ink3); }
  .lg-acc:hover { border-color: #dfe3ea; }
  .lg-acc.on {
    background: rgba(255,59,48,.06); border-color: rgba(255,59,48,.35);
  }
  .lg-acc.on b { color: var(--red-ink); }

  /* 「保存账号和密码」勾选行 */
  .lg-remember {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; flex: 1 1 auto; min-width: 0; user-select: none;
  }
  /* 勾选框：布局占 44×44 满足可点尺寸，内部自绘 18px 小方块保持视觉不变。
     不能用 transform:scale —— 那会同时缩小 getBoundingClientRect，
     可点尺寸就还是 18px。负 margin 抵掉多出来的占位，行高不被撑高。 */
  .lg-remember input {
    /* 46 而不是 44：44 会被取整成 43.99 判定不达标，留 2px 余量 */
    width: 46px; height: 46px; flex: 0 0 auto;
    margin: -14px -13px -14px -15px; padding: 0;
    appearance: none; -webkit-appearance: none;
    background: transparent; border: none; position: relative; cursor: pointer;
  }
  .lg-remember input::before {
    content: '';
    position: absolute; left: 14px; top: 14px; width: 18px; height: 18px;
    border: 1.5px solid #c9ced8; border-radius: 5px; background: #fff;
    transition: background .15s, border-color .15s;
  }
  .lg-remember input:checked::before { background: var(--red); border-color: var(--red-ink); }
  .lg-remember input:checked::after {
    content: '';
    position: absolute; left: 20px; top: 17px; width: 5px; height: 10px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
  }
  .lg-remember span {
    font-size: 13px; color: var(--ink2); line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* 角色凭证：一长串 base64，字号小一点才不挤 */
  .form-input.tk-input { font-size: 12px; letter-spacing: 0; }
  .login-tip {
    width: 100%; max-width: 322px; margin: 10px 0 0;
    font-size: 12px; line-height: 1.65; color: var(--ink3); text-align: left;
  }

  /* 角色卡 */
  .role-card {
    display: flex; align-items: center; gap: 14px; padding: 4px 0;
  }
  .role-avatar {
    width: 58px; height: 58px; border-radius: 18px; flex: 0 0 auto;
    display: grid; place-items: center; font-size: 20px; font-weight: 800;
    color: #fff; background: linear-gradient(135deg, #ff8a80, #ff3b30);
    box-shadow: 0 6px 18px rgba(255,59,48,.28);
  }
  /* 有真实头像时：去掉渐变底色，图片撑满圆角，留一圈浅描边区分白底 */
  .role-avatar.has-img {
    background: var(--card); overflow: hidden; padding: 0;
    box-shadow: 0 6px 18px rgba(0,0,0,.10), inset 0 0 0 1px var(--line);
  }
  .role-avatar.has-img img {
    width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit;
  }
  .role-main { min-width: 0; text-align: left; flex: 1 1 auto; }
  .role-name {
    font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 7px;
    flex-wrap: wrap;
  }
  .role-rank {
    /* 深红 #B42318 配 8% 红底：对比度 3.15:1 -> 5.9:1，红仍是红但读得清 */
    font-style: normal; font-size: 12px; font-weight: 700; color: #B42318;
    background: rgba(255,59,48,.08); border-radius: 6px; padding: 2px 7px;
  }
  .role-line {
    font-size: 13px; color: var(--ink2); margin-top: 4px;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  }
  .role-line.sub { font-size: 12px; color: var(--ink3); }
  .role-line .sep {
    width: 1px; height: 11px; background: var(--line); display: inline-block;
  }

  /* 背包列表 */
  .bag { margin: 0 -14px; }
  .bag-row {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 16px; font-size: 13px;
    border-bottom: 1px solid #eef0f5;
  }
  .bag-row:nth-child(odd) { background: #fbfcfe; }
  .bag-row:last-child { border-bottom: none; }
  .bag-name {
    flex: 1 1 auto; min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
  }
  .bag-qty {
    flex: 0 0 auto; font-weight: 700; font-variant-numeric: tabular-nums;
    color: var(--red-ink); font-size: 14px;
  }
  .bag-qty.zero { color: #c9ced8; font-weight: 500; }

  /* 道具俗称（括号补注），比主名小一号弱一档 */
  .bag-alias {
    font-style: normal; font-size: 12px; color: #98a2b3;
    font-weight: 400; margin-left: 1px;
  }
  .ic-name .bag-alias { display: block; font-size: 12px; line-height: 1.2; }

  /* 视图切换条 */
  .view-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 0 0 12px; font-size: 13px; color: var(--ink3);
  }

  /* 图标网格 */
  .igrid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 8px;
  }
  .icard {
    background: var(--soft); border: 1px solid #eef0f5; border-radius: 10px;
    padding: 8px 4px 6px; text-align: center; transition: .15s;
  }
  .icard:hover { border-color: #e0e4ec; background: #fff; }
  .ic-img {
    width: 44px; height: 44px; margin: 0 auto 5px;
    display: grid; place-items: center;
  }
  .ic-thumb {
    width: 44px; height: 44px; object-fit: contain; display: block;
    image-rendering: -webkit-optimize-contrast;
  }
  .ic-thumb.ph {
    border-radius: 9px; background: #e8ebf2; color: #9aa3b2;
    font-size: 16px; font-weight: 800; display: grid; place-items: center;
  }
  .ic-name {
    font-size: 12px; line-height: 1.25; color: var(--ink2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .ic-qty {
    font-size: 12px; font-weight: 700; color: var(--red-ink);
    font-variant-numeric: tabular-nums; margin-top: 1px;
  }
  .igrid-tip {
    margin-top: 10px; font-size: 12px; color: var(--ink3); text-align: center;
  }

  /* 悬浮入口 */
  .fab {
    position: fixed; right: 16px; bottom: 84px; z-index: 2147482000;
    width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
    background: var(--red); color: #fff; cursor: pointer;
    box-shadow: 0 6px 22px rgba(255,59,48,.42); transition: .2s;
  }
  .fab:hover { transform: scale(1.06); }
  .fab svg { width: 23px; height: 23px; }

  @media (max-width: 360px) {
    .main { padding-left: 12px; padding-right: 12px; }
    .form-row { padding-left: 12px; padding-right: 12px; }
  }
  @media (min-width: 620px) {
    .main { padding-left: 24px; padding-right: 24px; }
    .hd { padding-left: 24px; padding-right: 24px; }
    .hero-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  }

  /* ================= 邮件 / 聊天 ================= */
  .tool-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
  .tool-row .grow { flex: 1; min-width: 0; }
  .tool-row .btn {
    padding: 8px 14px; font-size: 13px;
    /* 关键：按钮不许被压扁。否则一行挤 4 个控件时文字会折行，
       看起来就像按钮叠在一起。 */
    flex: 0 0 auto; white-space: nowrap;
  }
  /* 主操作占满剩余宽度，两个领取按钮各站一行、互不挤压 */
  .tool-row .btn.wide { flex: 1 1 0; min-width: 0; padding: 9px 12px; }
  .tool-row .mchk { flex: 0 0 auto; min-width: 62px; }
  .mchk {
    display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
    font-size: 13px; color: var(--ink2); cursor: pointer;
  }
  .mchk i {
    width: 18px; height: 18px; flex: 0 0 auto; border-radius: 5px;
    border: 1.6px solid #c8ccd4; background: #fff; position: relative;
  }
  .mchk.on i { background: var(--red); border-color: var(--red-ink); }
  .mchk.on i::after {
    content: ''; position: absolute; left: 5px; top: 1px; width: 5px; height: 9px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
  }
  /* 原生 checkbox 默认只有 13×13，点不中：自绘成 24×24 的热区当勾选框 */
  .mchk input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    flex: 0 0 auto; width: 24px; height: 24px; margin: 0; position: relative;
    border-radius: 7px; border: 1.6px solid #c8ccd4; background: #fff;
    cursor: pointer; transition: background .15s, border-color .15s;
  }
  .mchk input[type="checkbox"]:checked {
    background: var(--red); border-color: var(--red-ink);
  }
  .mchk input[type="checkbox"]:checked::after {
    content: ''; position: absolute; left: 8px; top: 4px; width: 6px; height: 10px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
  }
  .mchk input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--red-ink); outline-offset: 2px;
  }
  .mail-list { display: flex; flex-direction: column; gap: 8px; }
  .mail-item {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: 10px 12px; cursor: pointer;
  }
  .mail-hd { display: flex; align-items: center; gap: 6px; }
  .mail-tt {
    flex: 1; min-width: 0; font-weight: 600; font-size: 14px; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .mail-tag {
    flex: 0 0 auto; font-size: 12px; padding: 1px 6px; border-radius: 5px;
    background: #f0f1f5; color: var(--ink3);
  }
  .mail-tag.att { background: #fff2e8; color: #d97706; }
  .mail-tag.get { background: #e8f7ee; color: var(--green-ink); }
/* 已删除的邮件：整条压暗，和活着的邮件区分开 */
  .mail-item.dead { opacity: .55; background: var(--soft); }
  .mail-item.dead .mail-tt { text-decoration: line-through; }

  /* ================= 兑换码 ================= */
  .cdk-row { display: flex; gap: 8px; align-items: center; }
  .cdk-in {
    flex: 1 1 0; min-width: 0; font-family: inherit; font-size: 14px;
    padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--soft); color: var(--ink); outline: none; transition: .15s;
  }
  .cdk-in:focus { border-color: var(--red-ink); background: #fff; }
  .cdk-in::placeholder { color: var(--ink3); }
  .cdk-row .btn { flex: 0 0 auto; }

  /* 码列表（chip）：点一下 = 单独兑它；网格等宽对齐 */
  .cdk-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 7px; }
  .cdk-chip {
    position: relative; cursor: pointer; user-select: none;
    display: flex; align-items: center; justify-content: center; gap: 5px; width: auto;
    padding: 7px 12px; border-radius: 10px; font-size: 13px; font-weight: 600;
    background: var(--soft); border: 1px solid var(--line); color: var(--ink2);
    transition: .15s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* 长码（中文 5 字以上 / 混合 12 宽度以上）跨两格，否则会被省略号吃掉 */
  .cdk-chip.long { grid-column: span 2; }
  .cdk-chip.full { grid-column: 1 / -1; }
  .cdk-chip:active { transform: scale(.97); }
  .cdk-chip.done {
    background: #e8f7ee; border-color: #bfe6cf; color: var(--green-ink);
    text-decoration: line-through;
  }
  .cdk-tick {
    width: 5px; height: 9px; border: solid currentColor; border-width: 0 2px 2px 0;
    transform: rotate(45deg); margin-bottom: 2px;
  }

  /* 结果明细 */
  .cdk-res { display: flex; flex-direction: column; gap: 8px; }
  .cdk-item {
    border: 1px solid var(--line); border-left-width: 3px; border-radius: 12px;
    padding: 9px 12px; background: var(--card);
  }
  .cdk-item.ok { border-left-color: var(--green-ink); }
  .cdk-item.al { border-left-color: #d97706; }
  .cdk-item.bad { border-left-color: var(--red-ink); }
  .cdk-item-hd { display: flex; align-items: center; gap: 8px; }
  .cdk-code {
    flex: 1 1 0; min-width: 0; font-weight: 700; font-size: 14px; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .cdk-tag {
    flex: 0 0 auto; font-size: 12px; padding: 1px 7px; border-radius: 5px;
    font-weight: 600;
  }
  .cdk-tag.ok { background: #e8f7ee; color: var(--green-ink); }
  .cdk-tag.al { background: #fff7e6; color: #d97706; }
  .cdk-tag.bad { background: rgba(255,59,48,.09); color: var(--red-ink); }
  .cdk-msg { margin-top: 3px; font-size: 12px; color: var(--ink3); }
  .cdk-rewards { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
  .cdk-rw {
    font-size: 12px; padding: 2px 8px; border-radius: 6px;
    background: var(--soft); color: var(--ink2);
  }

  /* 删除分类选择（一键删除已领取 的弹窗里） */
  .del-cats { display: flex; flex-direction: column; gap: 8px; }
  .del-cat {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; text-align: left; cursor: pointer; font-family: inherit;
    padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--card); transition: .15s;
  }
  .del-cat:active { transform: scale(.985); }
  .del-cat b { font-size: 14px; font-weight: 600; color: var(--ink); }
  .del-cat span { font-size: 12px; color: var(--ink3); flex: 0 0 auto; }
  .mail-line {
    margin-top: 3px; font-size: 12px; color: var(--ink3);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .mail-content { margin-top: 4px; font-size: 13px; color: var(--ink2); }
  /* ---------- 聊天：整页通栏，自己撑满可视区 ----------
   消息区内部滚动，页面本身不产生纵向滚动。
   消息分三类：普通气泡 / 表情灰字 / 组队紫色卡片（一眼从聊天里跳出来）。 */
  .chat-wrap {
    display: flex; flex-direction: column;
    /* 兜底：约 8 条消息的高度；挂载后由 JS 精确测量覆盖 */
    height: 460px; max-height: calc(100vh - 180px); min-height: 240px;
  }
  .chat-top { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
  .chat-top .seg { flex: 1 1 auto; }

  /* 工具行：两个显示开关 + 状态提示 + 暂停/刷新按钮 */
  .chat-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; margin: 8px 0 0; }
  .chat-chip {
    flex: 0 0 auto; border: 1px solid var(--line); background: var(--soft);
    color: var(--ink3); font-family: inherit; font-size: 12px; font-weight: 600;
    padding: 6px 11px; border-radius: 999px; cursor: pointer; transition: .15s;
    white-space: nowrap; text-decoration: line-through;
  }
  .chat-chip.on {
    background: rgba(255,59,48,.07); border-color: rgba(255,59,48,.35);
    color: var(--red-ink); text-decoration: none;
  }
  .chat-chip:active { transform: scale(.97); }
  .chat-bar-tip {
    flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--amber-ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .ico-sq {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-family: inherit;
    background: var(--card); border: 1px solid var(--line); color: var(--ink2);
    transition: background .15s, color .15s, border-color .15s;
  }
  .ico-sq.on { color: var(--red-ink); border-color: rgba(255,59,48,.35); background: #fff6f5; }
  .ico-sq:active { transform: scale(.96); }
  .chat-meta { flex: 0 0 auto; font-size: 12px; color: var(--ink3); margin: 8px 2px 7px; }

  /* 消息区 + 「N 条新消息」浮标 */
  .chat-list-wrap { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
  .chat-list {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    padding: 9px; background: var(--soft); border-radius: 12px;
  }
  .chat-list::-webkit-scrollbar { width: 0; }
  .chat-new {
    position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
    border: none; cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 600;
    color: #fff; background: var(--red); border-radius: 999px; padding: 6px 14px;
    box-shadow: 0 4px 14px rgba(255,59,48,.35); animation: tin .2s ease both;
  }
  .chat-send { flex: 0 0 auto; display: flex; gap: 8px; margin-top: 8px; }
  .chat-send input {
    flex: 1 1 auto; min-width: 0; padding: 10px 12px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--card); font-family: inherit;
    font-size: 14px; color: var(--ink);
  }
  .chat-send input:focus { outline: none; border-color: var(--red-ink); }
  .chat-send .btn { flex: 0 0 auto; padding: 10px 18px; }

  /* 普通气泡 */
  .msg { display: flex; align-items: flex-start; gap: 7px; margin-bottom: 9px; }
  .msg.mine { flex-direction: row-reverse; }
  .msg-av {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, #9aa4b2, #6b7280); user-select: none;
  }
  .msg-av.has-img { overflow: hidden; padding: 0; background: var(--card); }
  .msg-av.has-img img {
    width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit;
  }
  .msg.mine .msg-av { background: linear-gradient(135deg, #ff8a80, #ff3b30); }
  .msg-bub {
    max-width: 78%; background: var(--card); border: 1px solid var(--line);
    border-radius: 12px; padding: 7px 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05);
  }
  .msg.mine .msg-bub { background: #fff0ef; border-color: #ffd9d6; }
  .msg-hd {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--ink3); margin-bottom: 2px;
  }
  .msg.mine .msg-hd { flex-direction: row-reverse; }
  .msg-hd b { font-weight: 700; color: var(--ink2); }
  .msg-me {
    font-style: normal; font-size: 12px; font-weight: 700; color: var(--red-ink);
    background: rgba(255,59,48,.09); border-radius: 5px; padding: 1px 5px;
  }
  .msg-leg {
    font-size: 12px; font-weight: 600; color: #b8860b;
    background: rgba(245,158,11,.1); border-radius: 5px; padding: 1px 5px;
  }
  .msg-time { font-variant-numeric: tabular-nums; }
  .msg-txt { font-size: 14px; color: var(--ink); word-break: break-word; line-height: 1.5; }
  .msg-txt.emoji { color: var(--ink3); }

  /* 组队卡片（紫色，跳脱出普通聊天） */
  .msg-team { margin-bottom: 10px; }
  .tm-card {
    border: 1px solid rgba(124,77,255,.28); border-radius: 12px; overflow: hidden;
    background: linear-gradient(180deg, #f6f3ff, #fbfaff);
    box-shadow: 0 1px 4px rgba(124,77,255,.08);
  }
  .msg-team.mine .tm-card { border-color: rgba(255,59,48,.3); }
  .tm-hd { display: flex; align-items: center; gap: 7px; padding: 9px 11px 6px; }
  .tm-tag {
    flex: 0 0 auto; font-size: 12px; font-weight: 700; color: #fff;
    background: #7c4dff; border-radius: 5px; padding: 2px 6px;
  }
  .tm-nm { font-size: 14px; font-weight: 800; color: #4a2ea8; }
  .tm-cnt {
    flex: 0 0 auto; font-size: 12px; font-weight: 700; color: #7c4dff;
    background: rgba(124,77,255,.1); border-radius: 999px; padding: 2px 8px;
  }
  .tm-time {
    margin-left: auto; font-size: 12px; color: var(--ink3);
    font-variant-numeric: tabular-nums;
  }
  .tm-tip {
    padding: 0 11px 7px; font-size: 13px; color: var(--ink2);
    line-height: 1.5; word-break: break-word;
  }
  .tm-ft {
    display: flex; align-items: center; gap: 8px; padding: 8px 11px;
    border-top: 1px dashed rgba(124,77,255,.22); font-size: 12px; color: var(--ink2);
  }
  .tm-no { font-weight: 700; color: #4a2ea8; font-variant-numeric: tabular-nums; }
  .tm-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tm-btn {
    margin-left: auto; flex: 0 0 auto; border: none; cursor: pointer; font-family: inherit;
    font-size: 12px; font-weight: 700; color: #fff; background: #7c4dff;
    border-radius: 8px; padding: 5px 11px; transition: .15s;
  }
  .tm-btn:active { transform: scale(.96); }

  /* ---------- 道具使用 ---------- */
  .it-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 0; border-bottom: 1px solid var(--line);
  }
  .it-row:last-child { border-bottom: none; }
  /* 置灰行不能整行降透明度：文字会跌破 4.5:1，改成分项降饱和 */
  .it-row.dim .it-ico { filter: grayscale(1); opacity: .72; }
  .it-row.dim .it-name, .it-row.dim .it-sub, .it-row.dim .it-qty { color: #6e6e6e; }
  .it-row.dim .it-qty { background: #f5f6fa; }
  .it-row.dim .it-step {
    color: #6e6e6e; background: #f2f3f7; border-color: #e2e5ec;
  }
  .it-iwrap { flex: 0 0 auto; }
  .it-ico {
    width: 42px; height: 42px; border-radius: 10px; display: block;
    object-fit: contain; background: var(--soft); border: 1px solid var(--line);
  }
  .it-ico.ph {
    display: grid; place-items: center; font-size: 16px; font-weight: 700;
    color: var(--ink3); background: #f2f3f7;
  }
  .it-main { flex: 1 1 auto; min-width: 0; }
  .it-name {
    font-size: 14px; font-weight: 600; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .it-sub {
    font-size: 12px; color: var(--ink3); margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .it-qty {
    flex: 0 0 62px; width: 62px; padding: 7px 8px; text-align: center;
    border: 1px solid var(--line); border-radius: 9px; background: var(--soft);
    font-family: inherit; font-size: 13px; color: var(--ink);
  }
  .it-qty:focus { outline: none; border-color: var(--red-ink); background: #fff; }
  .it-qty:disabled { opacity: .5; }
  .it-go {
    flex: 0 0 auto; padding: 8px 14px; font-size: 13px;
    border-radius: 10px; white-space: nowrap;
  }
  .d-log .ln.ok { color: var(--green-ink); }
  .d-log .ln.warn { color: var(--amber-ink); }
  .d-log .ln.err { color: var(--red-ink); }
  .d-log .ln.hl { font-weight: 600; }
  .d-log .ln .t { color: #b9bcc4; margin-right: 6px; }
  .d-log .ln { font-size: 12px; line-height: 1.7; }

  /* ---------- 消耗活动进度 ---------- */
  .wa-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
  .wa-hd-ico {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 8px;
    background: rgba(255,59,48,.08); color: var(--red-ink);
  }
  .wa-hd-ico svg { width: 15px; height: 15px; }
  .wa-ttl {
    flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 700; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .wa-round {
    flex: 0 0 auto; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
    background: rgba(255,59,48,.08); color: var(--red-ink);
    border: 1px solid rgba(255,59,48,.22);
  }
  .wa-round.done {
    background: rgba(16,185,129,.1); color: var(--green-ink);
    border-color: rgba(16,185,129,.28);
  }
  .wa-figs {
    display: flex; align-items: baseline; gap: 4px; margin-bottom: 9px;
    font-variant-numeric: tabular-nums;
  }
  .wa-figs b { font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -.4px; }
  .wa-figs .sep { font-size: 13px; color: #c4c8d2; margin: 0 2px; }
  .wa-figs .tot { font-size: 14px; font-weight: 600; color: var(--ink2); }
  .wa-figs .unit { font-size: 12px; color: var(--ink3); margin-left: 3px; }
  .wa-figs .need { margin-left: auto; font-size: 12px; color: var(--ink3); }
  .wa-bar { position: relative; height: 9px; border-radius: 999px; background: #eceef4; }
  .wa-bar > i {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, #ff8177, var(--red));
    transition: width .35s ease;
  }
  .wa-bar > i.full { background: linear-gradient(90deg, #34d399, var(--green)); }
  .wa-scale { position: relative; height: 15px; margin-top: 6px; }
  .wa-scale em {
    position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap;
    font-size: 12px; font-style: normal; color: var(--ink3);
    font-variant-numeric: tabular-nums;
  }
  .wa-scale em:first-child { transform: none; }
  .wa-scale em:last-child { transform: translateX(-100%); }
  .wa-scale em.hit { color: var(--red-ink); font-weight: 700; }
  .wa-tip { font-size: 12px; color: var(--ink3); margin-top: 4px; }
  .wa-bp {
    display: flex; align-items: center; gap: 8px;
    margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--line);
  }
  .wa-bp .bp-v {
    font-size: 16px; font-weight: 800; color: var(--red-ink);
    font-variant-numeric: tabular-nums;
  }
  .wa-bp .bp-k { font-size: 12px; color: var(--ink3); }
  .wa-bp .btn { margin-left: auto; flex: 0 0 auto; white-space: nowrap; }
  .wa-off {
    font-size: 12px; color: var(--ink3); text-align: center;
    padding: 6px 0 2px;
  }

  /* ---------- 轮次目标选择 ---------- */
  .rt-pick {
    display: flex; gap: 6px; margin-top: 11px;
    overflow-x: auto; padding-bottom: 2px;
  }
  .rt-pick::-webkit-scrollbar { height: 0; }
  .rt-pick > button {
    flex: 0 0 auto; cursor: pointer; font-family: inherit;
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 7px 11px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--soft); color: var(--ink2);
    font-size: 13px; font-weight: 600; transition: .15s;
  }
  .rt-pick > button em {
    font-style: normal; font-size: 12px; font-weight: 500;
    color: var(--ink3); font-variant-numeric: tabular-nums;
  }
  .rt-pick > button:active { transform: scale(.97); }
  .rt-pick > button.on {
    background: rgba(255,59,48,.07); border-color: rgba(255,59,48,.38);
    color: var(--red-ink);
  }
  .rt-pick > button.on em { color: var(--red-ink); }
  .rt-plan {
    font-size: 12px; color: var(--ink2); line-height: 1.7;
    margin-top: 9px; padding: 8px 10px; border-radius: 10px;
    background: var(--soft); border: 1px solid var(--line);
  }
  .rt-plan b { color: var(--red-ink); font-variant-numeric: tabular-nums; }
  .rt-plan .rt-short { color: var(--amber-ink); }
  .rt-acts { display: flex; gap: 8px; margin-top: 9px; }
  .rt-acts .btn { flex: 1 1 auto; white-space: nowrap; }

  /* ---------- 宝箱消耗顺序 ---------- */
  .bo-head {
    display: flex; align-items: center; gap: 8px;
    margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line);
  }
  .bo-ttl { flex: 1 1 auto; font-size: 13px; font-weight: 700; color: var(--ink); }
  .bo-reset {
    flex: 0 0 auto; cursor: pointer; font-family: inherit;
    padding: 4px 10px; border-radius: 999px; font-size: 12px;
    border: 1px solid var(--line); background: var(--soft); color: var(--ink3);
  }
  .bo-reset:active { transform: scale(.97); }
  .bo-list { margin-top: 8px; }
  .bo-row {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 0; border-bottom: 1px solid var(--line);
  }
  .bo-row:last-child { border-bottom: none; }
  .bo-idx {
    flex: 0 0 20px; height: 20px; border-radius: 6px;
    display: grid; place-items: center;
    font-size: 12px; font-weight: 700;
    background: var(--soft); color: var(--ink3);
    border: 1px solid var(--line);
  }
  .bo-nm { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--ink); }
  .bo-sc {
    flex: 0 0 auto; font-size: 12px; color: var(--ink3);
    font-variant-numeric: tabular-nums;
  }
  .bo-mv {
    flex: 0 0 auto; cursor: pointer; font-family: inherit;
    padding: 4px 9px; border-radius: 8px; font-size: 12px;
    border: 1px solid var(--line); background: var(--soft); color: var(--ink2);
  }
  .bo-mv:active { transform: scale(.97); }
  .bo-mv:disabled { opacity: .35; }
  .bo-tip { font-size: 12px; color: var(--ink3); margin-top: 7px; line-height: 1.6; }

  /* ---------- 单次数量切换徽章 ---------- */
  .it-step {
    flex: 0 0 auto; cursor: pointer; font-family: inherit;
    padding: 5px 9px; border-radius: 8px; font-size: 12px; font-weight: 600;
    border: 1px solid rgba(255,59,48,.28); background: rgba(255,59,48,.06);
    color: var(--red-ink); white-space: nowrap;
  }
  .it-step:active { transform: scale(.97); }

  /* ---------- 运行中进度条 ---------- */
  .rt-run {
    font-size: 12px; color: var(--ink2); line-height: 1.7;
    margin-top: 9px; padding: 8px 10px; border-radius: 10px;
    background: rgba(255,59,48,.05); border: 1px solid rgba(255,59,48,.2);
  }
  .rt-run b { color: var(--red-ink); font-variant-numeric: tabular-nums; }

  /* ---------- 支持 ---------- */
  .sp-hd { padding: 2px 2px 12px; }
  .sp-hd-ttl { font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -.3px; }
  .sp-hd-sub { font-size: 12px; color: var(--ink3); margin-top: 5px; line-height: 1.6; }
  .sp-qq { display: flex; align-items: center; gap: 12px; }
  .sp-qq-l { flex: 1 1 auto; min-width: 0; }
  .sp-qq-nm { font-size: 14px; font-weight: 700; color: var(--ink); }
  .sp-qq-no { font-size: 13px; color: var(--ink2); margin-top: 5px; }
  .sp-qq-no b {
    font-size: 14px; color: var(--red-ink); font-variant-numeric: tabular-nums;
    letter-spacing: .4px;
  }
  .sp-qq .btn { flex: 0 0 auto; white-space: nowrap; }
  /* 复制群号 + 一键加群：两个按钮并排，窄屏自动换到下一行 */
  .sp-qq { flex-wrap: wrap; }
  .sp-qq-acts { display: flex; gap: 8px; flex: 0 0 auto; margin-left: auto; }
  .sp-qq-acts .btn { text-decoration: none; }
  .sp-qr { display: block; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
  .sp-qr.big { width: 100%; max-width: 360px; margin: 14px auto 0; }
  .sp-qr.pay { width: 100%; max-width: 320px; margin: 0 auto; }
  .sp-tip {
    font-size: 12px; color: var(--ink3); line-height: 1.7;
    margin-top: 10px; text-align: center;
  }

  /* ---------- 延迟设置 ---------- */
  .dl-row { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink3); }
  .dl-row input {
    flex: 0 0 60px; width: 60px; padding: 6px 8px; text-align: center;
    border: 1px solid var(--line); border-radius: 9px; background: var(--soft);
    font-family: inherit; font-size: 13px; color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  .dl-row input:focus { outline: none; border-color: var(--red-ink); background: #fff; }
  .dl-row .dl-u { color: #c4c8d2; }

  /* 密码管理页：三行表单，输入框撑满剩余宽度 */
  .pwd-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
  .pwd-form .dl-row > span { flex: 0 0 52px; }
  .pwd-form .dl-row input { flex: 1 1 auto; width: auto; text-align: left; }

  /* ---------- 俱乐部 ---------- */
  .cl-row {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 2px; border-bottom: 1px solid var(--line);
  }
  .cl-row:last-child { border-bottom: none; }
  .cl-job {
    flex: 0 0 auto; font-size: 12px; padding: 2px 7px; border-radius: 20px;
    border: 1px solid var(--line); color: var(--ink2); background: var(--soft);
  }
  .cl-job.on { background: var(--red); border-color: var(--red-ink); color: #fff; }
  .cl-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
  .cl-main b {
    font-size: 14px; font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .cl-main em { font-style: normal; font-size: 12px; color: var(--ink3); }
  /* 功法仓库：功法名允许两行显示，长名字（如「对穿肠文功术」）不再被单行截断 */
  .cl-main b.cl-nm {
    white-space: normal; overflow: hidden;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    line-height: 1.35; word-break: break-all;
  }
  .cl-pw {
    flex: 0 0 auto; font-size: 12px; color: var(--ink2);
    font-variant-numeric: tabular-nums;
  }
  .cl-tag { flex: 0 0 auto; font-size: 12px; padding: 2px 7px; border-radius: 20px; }
  .cl-tag.ok { color: var(--green-ink); background: rgba(16,185,129,.1); }
  .cl-tag.no { color: var(--ink3); background: var(--soft); }
  .cl-note { font-size: 12px; color: var(--ink2); line-height: 1.75; word-break: break-all; }
  .cl-mnum { font-size: 12px; color: var(--ink3); }
  .cl-input {
    flex: 1 1 auto; min-width: 0; padding: 9px 11px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--soft);
    font-family: inherit; font-size: 13px; color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  .cl-input:focus { outline: none; border-color: var(--red-ink); background: #fff; }

  /* ---------- 消耗活动 ---------- */
  .ac-name { display: flex; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
  .ac-name em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--ink3); }
  .ac-desc { margin-top: 4px; font-size: 12px; color: var(--ink3); line-height: 1.6; }
  .ac-bar {
    margin-top: 12px; height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden;
  }
  .ac-bar i { display: block; height: 100%; border-radius: 999px; background: var(--red); transition: width .3s; }
  .ac-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--ink3); }
  .ac-meta b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
  .ac-list { display: flex; flex-direction: column; gap: 8px; }
  .ac-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--soft);
  }
  .ac-row.ready { border-color: rgba(255,59,48,.3); background: rgba(255,59,48,.06); }
  .ac-row.done { opacity: .62; }
  .ac-th {
    flex: 0 0 auto; min-width: 62px; font-size: 14px; font-weight: 700;
    color: var(--ink); font-variant-numeric: tabular-nums;
  }
  .ac-rw { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
  .ac-it { font-size: 12px; color: var(--ink2); }
  .ac-st { flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--ink3); }
  .ac-row.ready .ac-st { color: var(--red-ink); }
  .ac-row.done .ac-st { color: var(--green-ink); }
  .ac-logs { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow: auto; }
  .ac-lg { font-size: 12px; color: var(--ink2); line-height: 1.6; }
  .ac-lg span { color: var(--ink3); margin-right: 8px; font-variant-numeric: tabular-nums; }
  .ac-lg.ok { color: var(--green-ink); }
  .ac-lg.warn { color: var(--amber-ink); }
  .ac-lg.err { color: var(--red-ink); }

  /* ---------- 中秋悬赏 ---------- */
  .fe-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 8px; font-size: 12px; color: var(--ink3); }
  .fe-line b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
  .fe-prog b { font-size: 14px; }
  .fe-next { color: var(--amber-ink); }
  .fe-next.done { color: var(--green-ink); }
  .fe-done { margin-left: auto; }

  /* ---------- 中秋悬赏 ---------- */
  .fe-title { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: .5px; }
  .fe-cd { margin-top: 4px; font-size: 12px; color: var(--amber-ink); font-weight: 600; }
  .fe-stat { margin-top: 6px; font-size: 13px; color: var(--ink2); }
  .fe-stat b { font-size: 16px; color: var(--red-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
  .fe-stat-x { font-size: 12px; color: var(--ink3); margin-left: 4px; }

  .fe-card { margin-bottom: 8px; padding: 12px !important; }
  .fe-row { display: flex; align-items: center; gap: 10px; }
  .fe-left { flex: 1 1 auto; min-width: 0; }
  .fe-name {
    display: flex; align-items: baseline; gap: 6px;
    font-size: 13px; font-weight: 600; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .fe-pos { font-style: normal; font-size: 12px; font-weight: 600; color: var(--ink3); margin-left: auto; }

  .fe-barwrap { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
  .fe-bar { flex: 1 1 auto; height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; }
  .fe-bar i { display: block; height: 100%; border-radius: 999px; background: var(--red); transition: width .3s; }
  .fe-barnum { flex: 0 0 auto; font-size: 12px; color: var(--ink2); font-variant-numeric: tabular-nums; }

  .fe-mid { flex: 0 0 auto; display: flex; gap: 6px; }
  .fe-rw {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    width: 46px; text-align: center;
  }
  .fe-ico {
    width: 30px; height: 30px; border-radius: 8px; display: block;
    object-fit: contain; background: var(--soft); border: 1px solid var(--line);
  }
  .fe-ico.ph {
    display: grid; place-items: center; font-size: 12px; font-weight: 700;
    color: var(--ink3);
  }
  .fe-rwn { font-size: 12px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46px; }
  .fe-rwx { font-size: 12px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

  .fe-right { flex: 0 0 auto; }
  .fe-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 62px; height: 32px; padding: 0 10px;
    border-radius: 9px; font-size: 12px; font-weight: 700;
    font-family: inherit; border: 1px solid var(--line);
    background: var(--soft); color: var(--ink3);
  }
  .fe-btn.primary { background: var(--red); border-color: var(--red-ink); color: #fff; cursor: pointer; }
  .fe-btn.primary:active { transform: scale(.97); }
  .fe-btn.done { background: rgba(4,120,87,.08); border-color: rgba(4,120,87,.28); color: var(--green-ink); }
  .fe-btn.lock { background: var(--bg); color: var(--ink3); }

  .fe-total { margin-top: 4px; font-size: 12px; color: var(--ink3); font-variant-numeric: tabular-nums; }

  /* ---------- 功法页：仓库紧凑按钮 / 满属性标记 / 残卷图标 / 赠礼功法列表 ---------- */
  .btn.lg-mini {
    height: 28px; min-height: 28px; padding: 0 10px; line-height: 1;
    font-size: 12px; border-radius: 8px; flex: 0 0 auto;
  }
  .cl-max {
    font-style: normal; font-size: 12px; font-weight: 700;
    color: var(--red-ink); margin-left: 2px;
  }
  .lg-scroll { display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }
  .lg-scroll-ico {
    width: 18px; height: 18px; border-radius: 5px; flex: 0 0 auto;
    object-fit: contain; background: var(--soft); border: 1px solid var(--line);
  }
  .lg-scroll-ico.ph {
    display: inline-grid; place-items: center;
    font-size: 12px; font-weight: 700; color: var(--ink3);
  }
  .lg-scroll-nm { font-size: 12px; color: var(--ink3); }
  .lg-scroll-num {
    font-size: 14px; font-weight: 700; color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  .lg-gift-books { display: flex; flex-direction: column; gap: 6px; }

  /* ---------- 功法仓库行：按钮组 / 勾选框 / 属性标注 ---------- */
  /* 按钮组之前没有样式，按钮和名字挤在一行里溢出，表现为「文字叠在一起」 */
  .lg-row-btns { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

  /* 原生 checkbox 只有 13×13，点不中；自绘成 44 热区 + 18 视觉 */
  .cl-row input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    flex: 0 0 auto; width: 44px; height: 44px;
    margin: -12px -12px -12px -8px; position: relative;
    cursor: pointer; background: transparent;
  }
  .cl-row input[type="checkbox"]::after {
    content: ''; position: absolute; left: 13px; top: 13px;
    width: 18px; height: 18px; border-radius: 5px;
    border: 1.6px solid #c8ccd4; background: #fff;
  }
  .cl-row input[type="checkbox"]:checked::after {
    background: var(--red); border-color: var(--red-ink);
  }
  .cl-row input[type="checkbox"]:checked::before {
    content: ''; position: absolute; left: 18px; top: 16px;
    width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }

  /* 属性文字不许折行：「气定1%」被挤成两行是宽度不够 */
  .cl-mnum { white-space: nowrap; }

  /* 气定 / 走火 和普通攻击血量区分开：不同颜色 + 加粗 */
  .cl-mnum.cl-qd { color: #1d4ed8; font-weight: 600; }
  .cl-mnum.cl-zh { color: #b45309; font-weight: 600; }

  .cl-mnum.cl-strong { font-weight: 700; }
  .btn.lg-mini.on { background: var(--soft); color: var(--ink2); border-color: var(--line); }
  .btn.lg-mini[disabled] { opacity: .62; cursor: default; }

  .cl-mnum.cl-atk { color: #e11d48; font-weight: 600; }
  .cl-mnum.cl-hp  { color: #15803d; font-weight: 600; }
