
  /* 用 :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);
    --bg:#f5f6fa; --card:#ffffff; --ink:#1a1a1a; --ink2:#555555; --ink3:#999999;
    --red:#ff3b30; --red-dark:#e02f26; --line:#eeeeee; --radius:14px;
    --soft:#fafbfc; --green:#10b981; --amber:#f59e0b;
    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-logo2 {
    width: auto; height: 34px; border: none; border-radius: 0; background: none;
    overflow: visible; display: flex; align-items: center; gap: 5px;
  }
  .hd-logo2 img {
    width: 34px; height: 34px; border-radius: 10px; object-fit: cover;
    background: #05070d; border: 1px solid var(--line);
  }
  .hd-tt { font-size: 16px; font-weight: 700; letter-spacing: .5px; }
  .hd-sub { font-size: 11.5px; 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: 17px; 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); 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); 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: 13.5px; font-weight: 700; }
  .ri-main em, .ai-main em { font-style: normal; font-size: 11.5px; color: var(--ink3); }
  .ri-tag {
    flex: 0 0 auto; font-size: 10.5px; font-weight: 700; color: var(--red);
    background: rgba(255,59,48,.09); border-radius: 6px; padding: 2px 7px;
  }
  .ri-set {
    flex: 0 0 auto; font-size: 11.5px; 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); color: var(--red); }
  .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: 11.5px; 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); color: var(--red); }

  /* ---------- 一键日常页 ---------- */
  .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: 11.5px; 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); color: var(--red); }
  .d-norole { font-size: 11.5px; 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); color: #fff; }

  .d-grp { margin-bottom: 12px; }
  .d-grp:last-child { margin-bottom: 0; }
  .d-grp-hd {
    display: flex; align-items: center; font-size: 12.5px; font-weight: 700;
    color: var(--ink2); padding-bottom: 6px;
  }
  .d-grp-hd b {
    margin-left: auto; font-size: 11.5px; 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); color: var(--red); }
  .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: 12.5px; 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); }
  .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 2px; border-radius: 8px; background: transparent; color: var(--ink2);
    font-size: 11px; font-weight: 600; letter-spacing: -0.2px;
    transition: background .15s, color .15s, box-shadow .15s;
    white-space: nowrap; overflow: visible; text-overflow: clip;
  }
  .seg > button:active { transform: scale(.98); }
  .seg > button.on {
    background: #fff; color: var(--red); 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: 11.5px; color: var(--ink3); margin-top: 8px; }

  .d-logtip {
    text-align: center; font-size: 12.5px; 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: 11.5px; 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); color: var(--red); }
  .d-log { max-height: 300px; overflow-y: auto; }
  .d-log::-webkit-scrollbar { width: 0; }
  .d-log .ln { font-size: 11.5px; 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); }
  .d-log .ln.err { color: var(--red); }
  .d-log .ln.warn { color: var(--amber); }
  .d-log .ln.hl { color: #4c6ef5; font-weight: 600; }
  .d-log .ln.hit { color: var(--red); font-weight: 700; }
  .d-log .ln.hit .t { color: var(--red); }

  .dot-badge {
    display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto;
    padding: 4px 10px; border-radius: 999px; font-size: 11px; 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); 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); 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; position: relative; }
  .main::-webkit-scrollbar { width: 0; }
  .pg { display: none; }
  /* 模块切换：按导航顺序决定滑入方向，先滑入再淡入，形成左右推进的方向感 */
  .pg.on { display: block; animation: pgIn .26s cubic-bezier(.22,.61,.36,1) both; }
  .pg.on.pg-from-right { animation-name: pgInRight; }
  .pg.on.pg-from-left { animation-name: pgInLeft; }
  @keyframes pgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes pgInRight {
    from { opacity: 0; transform: translateX(22px) scale(.992); }
    to { opacity: 1; transform: none; }
  }
  @keyframes pgInLeft {
    from { opacity: 0; transform: translateX(-22px) scale(.992); }
    to { opacity: 1; transform: none; }
  }
  /* 离开的页面：以覆盖层形式淡出（绝对定位，不占布局也不挡点击） */
  .pg.pg-leaving { display: block; position: absolute; left: 16px; right: 16px; top: 12px;
    pointer-events: none; z-index: 1; animation: pgOut .18s ease both; }
  .pg.pg-leaving.pg-from-right { animation-name: pgOutLeft; }
  .pg.pg-leaving.pg-from-left { animation-name: pgOutRight; }
  @keyframes pgOut { from { opacity: 1; } to { opacity: 0; transform: translateY(4px); } }
  @keyframes pgOutLeft { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(-16px); } }
  @keyframes pgOutRight { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(16px); } }
  @media (prefers-reduced-motion: reduce) {
    .pg.on, .pg.pg-leaving { animation: 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); flex: 0 0 auto; }
  .sec-title .r { margin-left: auto; font-size: 11.5px; font-weight: 500; color: var(--ink3); }
  .sub-title { font-size: 12.5px; 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: 11.5px; 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); }
  .info-val.green { color: var(--green); }

  /* 统计格（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: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
  .stat span { font-size: 11px; color: var(--ink3); }
  .stat.r b { color: var(--red); }
  .stat.g b { color: var(--green); }

  /* 表单 */
  .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: 13.5px; color: var(--ink2); }
  .form-input, .form-select {
    flex: 1 1 auto; width: 100%; 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); }
  .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: 12.5px; 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); }
  .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: 9.5px; 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: 9.5px; font-weight: 800; line-height: 1; }
  /* 「展开 / 收起」小开关（放在卡片标题右侧） */
  .sec-toggle { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--red); 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: 12.5px;
    cursor: pointer; transition: .15s;
  }
  .cur-q-item:hover { border-color: #ddd; }
  .cur-q-item.locked { background: var(--soft); }
  .cur-q-slot { flex: 0 0 auto; font-size: 11px; 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: 10.5px; font-weight: 600; opacity: .62; margin-left: 3px; }

  /* 品质动效：只在描边上走光（mask 抠出边框），文字完全不动。
     白→金：光点从 1 个变到 3 个，转速加快，金/红再加反向第二环。 */
  .q-rank { --qc: #9aa4b2; position: relative; }
  .cur-q-item.q-rank {
    border-color: color-mix(in srgb, var(--qc) 55%, var(--line));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--qc) 18%, transparent);
  }
  .cur-q-item.q-rank .cur-q-name,
  .cur-q-item.q-rank .cur-q-val { color: var(--qc); }
  .q-fx {
    position: absolute; inset: 0; border-radius: inherit;
    pointer-events: none; z-index: 1; overflow: hidden;
    padding: 1.5px;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
  }
  .q-fx::before, .q-fx::after {
    content: ''; position: absolute; inset: -70%; border-radius: 50%;
    pointer-events: none; will-change: transform;
  }
  /* 白：一颗慢光点 */
  .q-rank-1 .q-fx::before {
    background: conic-gradient(from 0deg, transparent 0 86%, #fff 94%, transparent 100%);
    opacity: .55; animation: qSpin 5.2s linear infinite;
  }
  /* 绿：一颗光点 + 淡底环 */
  .q-rank-2 .q-fx::before {
    background: conic-gradient(from 0deg, transparent 0 78%, var(--qc) 90%, transparent 100%);
    opacity: .7; animation: qSpin 4.2s linear infinite;
  }
  /* 蓝：更亮的一颗，稍快 */
  .q-rank-3 .q-fx::before {
    background: conic-gradient(from 0deg, transparent 0 72%, #fff 78%, var(--qc) 88%, transparent 100%);
    opacity: .85; animation: qSpin 3.4s linear infinite;
  }
  /* 紫：两颗对称光点 */
  .q-rank-4 .q-fx::before {
    background: conic-gradient(from 0deg, transparent 0 32%, var(--qc) 42%, transparent 52%, transparent 78%, #fff 88%, transparent 100%);
    opacity: .9; animation: qSpin 2.8s linear infinite;
  }
  /* 橙：两颗更快，第二环反向慢转 */
  .q-rank-5 .q-fx::before {
    background: conic-gradient(from 0deg, transparent 0 28%, #fff 34%, var(--qc) 44%, transparent 54%, transparent 74%, var(--qc) 86%, transparent 100%);
    opacity: 1; animation: qSpin 2.1s linear infinite;
  }
  .q-rank-5 .q-fx::after {
    background: conic-gradient(from 90deg, transparent 0 82%, #fff 92%, transparent 100%);
    opacity: .55; animation: qSpinRev 3.6s linear infinite;
  }
  /* 红：两颗对射 + 反向第二环 */
  .q-rank-6 .q-fx { padding: 2px; }
  .q-rank-6 .q-fx::before {
    background: conic-gradient(from 0deg, transparent 0 18%, #fff 24%, #e0453e 36%, transparent 48%, transparent 68%, #ff8a7f 80%, transparent 92%);
    opacity: 1; animation: qSpin 1.6s linear infinite;
  }
  .q-rank-6 .q-fx::after {
    background: conic-gradient(from 180deg, transparent 0 78%, #fff 90%, transparent 100%);
    opacity: .7; animation: qSpinRev 2.4s linear infinite;
  }
  /* 金：三颗光点最快 + 反向密环 */
  .q-rank-7 .q-fx { padding: 2px; }
  .q-rank-7 .q-fx::before {
    background: conic-gradient(from 0deg, transparent 0 8%, #fff 12%, #f4c542 20%, transparent 28%, transparent 40%, #ffe9a8 48%, transparent 56%, transparent 72%, #fff 80%, #f4c542 88%, transparent 96%);
    opacity: 1; animation: qSpin 1.1s linear infinite;
  }
  .q-rank-7 .q-fx::after {
    background: conic-gradient(from 60deg, transparent 0 70%, #fff6cc 82%, transparent 94%);
    opacity: .8; animation: qSpinRev 1.8s linear infinite;
  }
  .p-orb .q-fx {
    border-radius: 50%; inset: auto; width: 96px; height: 96px;
    top: 0; left: 50%; margin-left: -48px;
  }
  @keyframes qSpin { to { transform: rotate(360deg); } }
  @keyframes qSpinRev { to { transform: rotate(-360deg); } }
  @media (prefers-reduced-motion: reduce) {
    .q-fx::before, .q-fx::after { animation: none; }
  }

  /* 装备淬炼：正面 / 反面 切换（标题右侧，胶囊小按钮） */
  .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: 11.5px; 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: 12.5px;
  }
  .q-slot.locked { background: var(--soft); }
  .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: 11px; 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: 12.5px; color: var(--ink2);
  }
  .q-mat-lbl { color: var(--ink3); font-size: 11.5px; }
  .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: 11px; 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: 11.5px; 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 提供） */
    background-color: var(--c, #565e6a);
    /* 球体：左上高光 -> 主体 -> 右下暗部 */
    background-image:
      radial-gradient(circle at 30% 24%, rgba(255,255,255,.95) 0%, rgba(255,255,255,.4) 10%, rgba(255,255,255,0) 30%),
      radial-gradient(circle at 68% 80%, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 55%),
      linear-gradient(145deg, rgba(255,255,255,.3) 0%, rgba(255,255,255,0) 45%, rgba(0,0,0,.18) 100%);
    box-shadow:
      0 3px 8px rgba(0,0,0,.22),
      0 0 0 3px rgba(255,255,255,.55),
      inset 0 -7px 14px rgba(0,0,0,.4),
      inset 0 7px 12px rgba(255,255,255,.3);
    text-shadow: 0 1px 2px rgba(0,0,0,.6), 0 0 3px 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,.95), 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,.45), 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,.45) 0%, rgba(255,255,255,0) 30%),
      radial-gradient(circle at 68% 80%, rgba(0,0,0,.4) 0%, rgba(0,0,0,0) 58%),
      linear-gradient(145deg, rgba(255,255,255,.12) 0%, rgba(0,0,0,.2) 100%);
    box-shadow:
      0 2px 6px rgba(0,0,0,.18),
      0 0 0 3px rgba(255,255,255,.3),
      inset 0 -6px 12px rgba(0,0,0,.35),
      inset 0 6px 10px rgba(255,255,255,.14);
    color: #aeb6c4; text-shadow: 0 1px 2px rgba(0,0,0,.4);
  }
  .p-orb.tmp .p-orb-in {
    background-color: #ffcd5a;
    background-image:
      radial-gradient(circle at 30% 24%, rgba(255,255,255,.98) 0%, rgba(255,255,255,.45) 10%, rgba(255,255,255,0) 30%),
      radial-gradient(circle at 68% 80%, rgba(120,80,0,.5) 0%, rgba(0,0,0,0) 55%),
      linear-gradient(145deg, rgba(255,255,255,.4) 0%, #ffcd5a 55%, #d99a12 100%);
    box-shadow:
      0 3px 8px rgba(0,0,0,.22),
      0 0 0 3px rgba(255,235,150,.9),
      0 0 16px 2px rgba(255,205,90,.5),
      inset 0 -7px 14px rgba(120,80,0,.4),
      inset 0 7px 12px rgba(255,255,255,.4);
    color: #5a3d00; text-shadow: 0 1px 1px rgba(255,255,255,.5);
  }
  .p-orb-name { font-size: 12.5px; font-weight: 800; letter-spacing: .3px; }
  .p-orb-real { font-size: 17px; font-weight: 900; margin-top: 1px; }
  .p-orb-pct { font-size: 10px; opacity: .92; margin-top: 1px; }
  .p-orb-max { font-size: 9.5px; opacity: .78; }
  .p-orb-tag { font-size: 10.5px; 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); }
  #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: 22px; 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: 10px; 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: var(--soft); }
  .pet-slot.empty { border-left-color: #c8cdd6; opacity: .75; }
  .pet-slot-hd {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11.5px; font-weight: 700; color: var(--ink2); margin-bottom: 5px;
  }
  .pet-slot-lk {
    font-size: 10px; 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: 11.5px; color: var(--ink2); line-height: 1.35; }
  .pet-attr b { color: var(--ink); font-weight: 700; }
  .pet-slot-none { font-size: 11.5px; color: var(--ink3); }

  /* 分段切换 */
  .seg { display: flex; gap: 4px; padding: 3px; background: var(--bg); border-radius: 11px; }
  /* 多页签横向排布：等分、不折行、文字不截断（窄屏自动缩字号） */
  .q-tabgrid {
    display: flex; gap: 4px; flex-wrap: nowrap;
    background: var(--bg); border-radius: 11px; padding: 3px;
    flex: 1 1 auto; min-width: 0; width: 100%; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .q-tabgrid::-webkit-scrollbar { display: none; }
  .q-tabgrid > button {
    flex: 1 0 auto; min-width: 0;
    border: none; cursor: pointer; font-family: inherit;
    padding: 8px 6px; border-radius: 8px; background: transparent; color: var(--ink2);
    font-size: 11px; font-weight: 600; letter-spacing: -0.3px;
    white-space: nowrap; overflow: visible; text-overflow: clip;
    transition: .15s;
  }
  .q-tabgrid > button.on { background: var(--card); color: var(--red); 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); 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: 11px; 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: 17px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: -1px; }
  .hole-val em { font-size: 10.5px; 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); 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: 11.5px; font-weight: 600; line-height: 1.3; }
  .item .qt { font-size: 11.5px; color: var(--red); 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: 13.5px;
  }
  .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: 13.5px; font-weight: 700; }
  .hero-sub { font-size: 11px; 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: 11.5px; 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);
    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 行） */
  .nav {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
    display: flex; align-items: flex-end; justify-content: space-between;
    background: var(--card); border-top: 1px solid var(--line);
    padding: 8px 6px calc(5px + env(safe-area-inset-bottom, 0px));
    gap: 4px;
  }
  .nav-side {
    flex: 1 1 0; min-width: 0;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 3px;
  }
  .nav-item {
    min-width: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1px;
    padding: 4px 2px; cursor: pointer; color: var(--ink3); transition: .15s; border-radius: 10px;
  }
  .nav-item svg { width: 19px; height: 19px; flex: 0 0 auto; }
  .nav-item span {
    font-size: 9.5px; font-weight: 600; line-height: 1.15; white-space: nowrap;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  }
  .nav-item.on { color: var(--red); }
  /* 中间圆：常态轻微浮动，外圈光环旋转，底部一圈呼吸脉冲 */
  .nav-home {
    flex: 0 0 auto; width: 66px; display: flex; flex-direction: column;
    align-items: center; gap: 1px; cursor: pointer; color: var(--ink3);
    transition: color .15s;
  }
  .nav-home > span {
    font-size: 9.5px; font-weight: 600; line-height: 1.15; white-space: nowrap;
  }
  .nav-home.on { color: var(--red); }
  /* 负 margin 抵消上移，保证标签仍贴住导航栏，不会把栏撑高 */
  .nav-home-btn {
    position: relative; width: 54px; height: 54px;
    transform: translateY(-16px); margin-bottom: -16px;
  }
  .nav-home-core {
    position: relative; z-index: 2; width: 54px; height: 54px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: #fff;
    background: radial-gradient(circle at 32% 26%, #ff8a7f 0%, #ff4b40 44%, #d92017 100%);
    box-shadow: 0 6px 14px rgba(255,59,48,.38), 0 0 0 3px var(--card),
                0 0 0 4px rgba(255,59,48,.18), inset 0 -4px 9px rgba(120,10,4,.28),
                inset 0 3px 7px rgba(255,255,255,.3);
    animation: navHomeFloat 2.8s ease-in-out infinite;
  }
  .nav-home-core svg { width: 23px; height: 23px; }
  .nav-home-ring {
    position: absolute; z-index: 1; inset: -5px; border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: rgba(255,59,48,.85);
    border-right-color: rgba(255,138,127,.5);
    animation: navHomeSpin 2.6s linear infinite;
  }
  .nav-home-pulse {
    position: absolute; z-index: 0; inset: 0; border-radius: 50%;
    animation: navHomePulse 2.4s ease-out infinite;
  }
  .nav-home.on .nav-home-core {
    background: radial-gradient(circle at 32% 26%, #ffa79e 0%, #ff5c50 42%, #e0231a 100%);
    box-shadow: 0 8px 20px rgba(255,59,48,.5), 0 0 0 3px var(--card),
                0 0 0 5px rgba(255,59,48,.22), inset 0 -4px 9px rgba(120,10,4,.28),
                inset 0 3px 7px rgba(255,255,255,.34);
  }
  @keyframes navHomeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
  }
  @keyframes navHomeSpin { to { transform: rotate(360deg); } }
  @keyframes navHomePulse {
    0% { box-shadow: 0 0 0 0 rgba(255,59,48,.42); }
    70% { box-shadow: 0 0 0 14px rgba(255,59,48,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,59,48,0); }
  }
  @media (prefers-reduced-motion: reduce) {
    .nav-home-core, .nav-home-ring, .nav-home-pulse { animation: none; }
  }
  #${ROOT_ID}.no-nav .nav { display: none; }
  #${ROOT_ID}.no-nav .main { padding-bottom: 24px; }

  /* 导航点击 / 长按的即时反馈 */
  .nav-item, .nav-home { -webkit-tap-highlight-color: transparent; }
  .nav-item { transition: transform .16s cubic-bezier(.34,1.56,.64,1), color .15s; }
  /* 圆的浮动弹在 core 上，所以缩放放在外层容器，避免被动画覆盖 */
  .nav-home { transition: transform .16s cubic-bezier(.34,1.56,.64,1), color .15s; }
  .nav-item:active { transform: scale(.9); }
  .nav-home:active { transform: scale(.92); }
  /* 中间圆被点亮时，外圈光环加速，强调「当前在这里」 */
  .nav-home.on .nav-home-ring { animation-duration: 1.4s; }

  /* 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: 12.5px; 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; }
  /* CC + 猫猫：登录页顶部并排两个圆形头像，比单个略小更协调 */
  .login-avatars { display: flex; align-items: center; justify-content: center; gap: 14px; }
  .login-avatars .login-avatar { width: 88px; height: 88px; }
  .login-title {
    font-size: 25px; font-weight: 800; letter-spacing: 5px; 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); 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; }
  /* 角色凭证：一长串 base64，字号小一点才不挤 */
  .form-input.tk-input { font-size: 11.5px; 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: 22px; font-weight: 800;
    color: #fff; background: linear-gradient(135deg, #ff8a80, #ff3b30);
    box-shadow: 0 6px 18px rgba(255,59,48,.28);
  }
  .role-main { min-width: 0; text-align: left; flex: 1 1 auto; }
  .role-name {
    font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 7px;
    flex-wrap: wrap;
  }
  .role-rank {
    font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--red);
    background: rgba(255,59,48,.09); 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: 11.5px; 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: 13.5px;
    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); font-size: 14px;
  }
  .bag-qty.zero { color: #c9ced8; font-weight: 500; }

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

  /* 视图切换条 */
  .view-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 0 0 12px; font-size: 12.5px; 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: 17px; font-weight: 800; display: grid; place-items: center;
  }
  .ic-name {
    font-size: 10.5px; line-height: 1.25; color: var(--ink2);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .ic-qty {
    font-size: 11.5px; font-weight: 700; color: var(--red);
    font-variant-numeric: tabular-nums; margin-top: 1px;
  }
  .igrid-tip {
    margin-top: 10px; font-size: 11px; 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); }
  .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);
  }
  .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: 13.5px; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .mail-tag {
    flex: 0 0 auto; font-size: 11px; 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); }
/* 已删除的邮件：整条压暗，和活着的邮件区分开 */
  .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); 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: 12.5px; font-weight: 600;
    background: var(--soft); border: 1px solid var(--line); color: var(--ink2);
    transition: .15s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .cdk-chip:active { transform: scale(.97); }
  .cdk-chip.done {
    background: #e8f7ee; border-color: #bfe6cf; color: var(--green);
    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); }
  .cdk-item.al { border-left-color: #d97706; }
  .cdk-item.bad { border-left-color: var(--red); }
  .cdk-item-hd { display: flex; align-items: center; gap: 8px; }
  .cdk-code {
    flex: 1 1 0; min-width: 0; font-weight: 700; font-size: 13.5px; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .cdk-tag {
    flex: 0 0 auto; font-size: 11px; padding: 1px 7px; border-radius: 5px;
    font-weight: 600;
  }
  .cdk-tag.ok { background: #e8f7ee; color: var(--green); }
  .cdk-tag.al { background: #fff7e6; color: #d97706; }
  .cdk-tag.bad { background: rgba(255,59,48,.09); color: var(--red); }
  .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: 11.5px; 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: 13.5px; font-weight: 600; color: var(--ink); }
  .del-cat span { font-size: 11.5px; 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: 12.5px; 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); text-decoration: none;
  }
  .chat-chip:active { transform: scale(.97); }
  /* 区服 chip：显示当前区服名，超长省略；它不是开关，不做删除线 */
  .chat-chip.reg {
    max-width: 108px; overflow: hidden; text-overflow: ellipsis;
    background: var(--card); border-color: var(--line); color: var(--ink2);
  }
  .chat-bar-tip {
    flex: 1 1 auto; min-width: 0; font-size: 11px; color: var(--amber);
    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); border-color: rgba(255,59,48,.35); background: #fff6f5; }
  .ico-sq:active { transform: scale(.96); }
  .chat-meta { flex: 0 0 auto; font-size: 11.5px; 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: 13.5px; color: var(--ink);
  }
  .chat-send input:focus { outline: none; border-color: var(--red); }
  .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.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: 11.5px; 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: 10px; font-weight: 700; color: var(--red);
    background: rgba(255,59,48,.09); border-radius: 5px; padding: 1px 5px;
  }
  .msg-leg {
    font-size: 10px; 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: 13.5px; 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: 10px; font-weight: 700; color: #fff;
    background: #7c4dff; border-radius: 5px; padding: 2px 6px;
  }
  .tm-nm { font-size: 13.5px; font-weight: 800; color: #4a2ea8; }
  .tm-cnt {
    flex: 0 0 auto; font-size: 10.5px; font-weight: 700; color: #7c4dff;
    background: rgba(124,77,255,.1); border-radius: 999px; padding: 2px 8px;
  }
  .tm-time {
    margin-left: auto; font-size: 11px; color: var(--ink3);
    font-variant-numeric: tabular-nums;
  }
  .tm-tip {
    padding: 0 11px 7px; font-size: 12.5px; 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: 11.5px; 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: 11.5px; 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; }
  .it-row.dim { opacity: .5; }
  .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: 17px; font-weight: 700;
    color: var(--ink3); background: #f2f3f7;
  }
  .it-main { flex: 1 1 auto; min-width: 0; }
  .it-name {
    font-size: 13.5px; font-weight: 600; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .it-sub { font-size: 11.5px; color: var(--ink3); margin-top: 2px; }
  .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); 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); }
  .d-log .ln.warn { color: var(--amber); }
  .d-log .ln.err { color: var(--red); }
  .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);
  }
  .wa-hd-ico svg { width: 15px; height: 15px; }
  .wa-ttl {
    flex: 1 1 auto; min-width: 0; font-size: 13.5px; 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: 11.5px; font-weight: 700;
    background: rgba(255,59,48,.08); color: var(--red);
    border: 1px solid rgba(255,59,48,.22);
  }
  .wa-round.done {
    background: rgba(16,185,129,.1); color: var(--green);
    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: 21px; 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: 11.5px; color: var(--ink3); margin-left: 3px; }
  .wa-figs .need { margin-left: auto; font-size: 11.5px; 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: 10.5px; 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); font-weight: 700; }
  .wa-tip { font-size: 11.5px; 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: 17px; font-weight: 800; color: var(--red);
    font-variant-numeric: tabular-nums;
  }
  .wa-bp .bp-k { font-size: 11.5px; color: var(--ink3); }
  .wa-bp .btn { margin-left: auto; flex: 0 0 auto; white-space: nowrap; }
  .wa-off {
    font-size: 11.5px; 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: 12.5px; font-weight: 600; transition: .15s;
  }
  .rt-pick > button em {
    font-style: normal; font-size: 10px; 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);
  }
  .rt-pick > button.on em { color: var(--red); }
  .rt-plan {
    font-size: 11.5px; 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); font-variant-numeric: tabular-nums; }
  .rt-plan .rt-short { color: var(--amber); }
  .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: 12.5px; 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: 11.5px;
    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: 11px; 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: 12.5px; color: var(--ink); }
  .bo-sc {
    flex: 0 0 auto; font-size: 10.5px; 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: 11.5px;
    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: 11px; 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: 11px; font-weight: 600;
    border: 1px solid rgba(255,59,48,.28); background: rgba(255,59,48,.06);
    color: var(--red); white-space: nowrap;
  }
  .it-step:active { transform: scale(.97); }

  /* ---------- 运行中进度条 ---------- */
  .rt-run {
    font-size: 11.5px; 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); font-variant-numeric: tabular-nums; }

  /* ---------- 支持 ---------- */
  .sp-hd { padding: 2px 2px 12px; }
  .sp-hd-ttl { font-size: 19px; 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: 15px; font-weight: 700; color: var(--ink); }
  .sp-qq-no { font-size: 12.5px; color: var(--ink2); margin-top: 5px; }
  .sp-qq-no b {
    font-size: 15px; color: var(--red); font-variant-numeric: tabular-nums;
    letter-spacing: .4px;
  }
  .sp-qq .btn { flex: 0 0 auto; white-space: nowrap; }
  .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: 11.5px; 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: 12.5px; color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  .dl-row input:focus { outline: none; border-color: var(--red); 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: 10.5px; 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); color: #fff; }
  .cl-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
  .cl-main b {
    font-size: 13.5px; font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .cl-main em { font-style: normal; font-size: 11px; 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: 10.5px; padding: 2px 7px; border-radius: 20px; }
  .cl-tag.ok { color: var(--green); 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: 11.5px; 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); background: #fff; }
  /* 八个页签在窄屏等分，不横向滑动。 */
  #cl-tabs, #lg-tabs { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; }
  #cl-tabs button, #lg-tabs button { padding: 8px 0; font-size: 11px; letter-spacing: 0; }
  .cl-main em { overflow-wrap: anywhere; }
  @media (max-width: 360px) {
    #cl-tabs button, #lg-tabs button { font-size: 10px; }
    .nav-item span, .nav-home > span { font-size: 9px; }
    .nav-home { width: 60px; }
  }

