/* =========================================================
   异常调查局：收容终端 —— 全局样式
   ========================================================= */

:root {
    --bg: #0d0e11;
    --panel: #13151a;
    --border: #232730;
    --border-focus: #3b4252;
    --text-dim: #5c6370;
    --text: #9aa2b1;
    --text-bright: #e2e4e9;
    --accent: #5e81ac;
    --warn: #d08770;
    --danger: #bf616a;
    --success: #a3be8c;
    --match-hi: #e5c07b;
    --font-mono: "Cascadia Code", "Consolas", "Courier New", monospace;
}

* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ================= 顶部导航 / 视图容器 ================= */
#app-nav {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 46px;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: #101216;
    z-index: 40;
}
.brand {
    font-size: 12px;
    letter-spacing: 0.14em;
    color: var(--text-bright);
    font-family: var(--font-mono);
    white-space: nowrap;
}
.brand span { color: var(--text-dim); letter-spacing: 0.06em; }

.nav-tabs { display: flex; gap: 6px; }
.nav-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 30px;
    padding: 4px 14px;
    font-size: 12px;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    background: #14171d;
}
.nav-tab.active { border-color: var(--accent); color: var(--text-bright); background: #1b2533; }
.nav-badge {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 2px;
    background: #222833;
    color: var(--text);
}
.nav-tab.active .nav-badge { background: #2a3a52; color: #cfe0f5; }

.view-stack { flex: 1; min-height: 0; display: flex; }
.view { flex: 1; min-height: 0; display: none; gap: 24px; padding: 24px; overflow: hidden; }
.view.active { display: flex; }

.col { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
#left-panel { flex: 1.1; min-height: 0; border-right: 1px solid var(--border); padding-right: 24px; overflow-y: auto; }
#right-panel { flex: 2; min-height: 0; overflow-y: auto; padding-right: 12px; }

.box {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 2px;
}

/* 顶部状态头：桌面端吸附在左栏顶部，滚动时始终可见 */
#status-box {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--panel);
    box-shadow: 0 10px 14px -10px rgba(0, 0, 0, 0.9);
}

h2, h3 {
    margin: 0 0 12px 0;
    color: var(--text-bright);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hud-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.currency { font-size: 30px; color: var(--text-bright); font-family: var(--font-mono); font-weight: 500; }
.lv-chip {
    font-size: 10px;
    font-family: var(--font-mono);
    padding: 2px 6px;
    border: 1px solid var(--border-focus);
    border-radius: 2px;
    color: var(--text-bright);
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex: none;
}
.sub-curr { font-size: 12px; color: var(--text-dim); margin-top: 6px; font-family: var(--font-mono); word-break: break-all; }

button {
    background: #181b22;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-family: var(--font-mono);
    min-height: 40px; /* 触控热区保护 */
}
button:hover:not(:disabled) { border-color: var(--border-focus); color: var(--text-bright); background: #1c2029; }
button:active:not(:disabled) { background: #222733; }
button:disabled { opacity: 0.3; cursor: not-allowed; }

#catch-btn {
    height: 64px;
    width: 100%;
    border: 1px solid var(--border-focus);
    background: #161920;
    color: var(--text-bright);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin: 12px 0;
    border-radius: 2px;
    touch-action: manipulation;
}
#catch-btn:hover { border-color: var(--accent); background: #1b202a; }
#catch-btn:active { background: #222733; }
#catch-btn .title { font-size: 13px; letter-spacing: 0.08em; font-weight: 600; }
#catch-btn .sub { font-size: 11px; color: var(--text-dim); margin-top: 4px; font-family: var(--font-mono); }

.dev-list { display: flex; flex-direction: column; gap: 6px; }

.module { margin-bottom: 10px; }
.mod-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 8px; }
.mod-header .desc { font-size: 12px; color: var(--text-dim); margin-top: 3px; line-height: 1.4; }
.tag { font-size: 10px; padding: 2px 5px; background: #1d212a; border-radius: 2px; color: var(--text-dim); font-family: var(--font-mono); white-space: nowrap; }

/* ================= 方案卡片：折叠 / 展开 ================= */
.module {
    border-left: 2px solid var(--border);
    transition: border-color 0.12s, background 0.12s;
}
.module .mod-header {
    cursor: pointer;
    margin-bottom: 0;
    padding: 2px 0;
    align-items: center;
}
.module .mod-header > div:first-child { min-width: 0; flex: 1; }

.mod-head-right { display: flex; align-items: center; gap: 8px; flex: none; }

.mod-caret {
    font-size: 10px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    transition: transform 0.15s, color 0.15s;
    display: inline-block;
}
.module.open .mod-caret { transform: rotate(180deg); color: var(--accent); }

/* 折叠态：单行截断，保持卡片高度一致 */
.module:not(.open) .mod-header .desc {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.module:not(.open) .mod-body { display: none; }
.module:not(.open):hover { border-left-color: var(--border-focus); background: #151821; }

/* 展开态 */
.module.open { border-left-color: var(--accent); }
.module.open .mod-header { margin-bottom: 12px; }
.mod-body { animation: mod-in 0.14s ease-out; }
@keyframes mod-in {
    from { opacity: 0; transform: translateY(-2px); }
    to { opacity: 1; transform: none; }
}

/* 模块左右分块容器 */
.mod-split {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.mod-play-area { flex: 1.25; min-width: 0; }
.mod-upgrades-area {
    flex: 0.95;
    border-left: 1px solid var(--border);
    padding-left: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mod-upgrades-area h3 { font-size: 11px; margin-bottom: 6px; }

/* 按钮内副标题（价格/等级说明） */
.upg-desc { font-size: 10px; color: var(--text-dim); }

/* 方案 02 档位按钮列表 */
.tier-list { display: flex; flex-direction: column; gap: 6px; }

/* 进度条 */
.progress-box {
    width: 100%;
    height: 6px;
    background: #0c0e12;
    border: 1px solid var(--border);
    margin: 8px 0;
    position: relative;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.05s linear;
}

/* 方案 01: 刮拓格 */
.grid-3x3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    max-width: 180px;
    margin: 10px 0;
    touch-action: none;
}
.grid-cell {
    aspect-ratio: 1;
    background: #0c0e12;
    border: 1px solid var(--border);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-dim);
    font-family: var(--font-mono);
}
.grid-cell:hover:not(.revealed) { border-color: var(--border-focus); color: var(--text); }
.grid-cell.revealed { color: var(--text-bright); background: #151821; }

/* 硬质高光（无呼吸/无模糊动画） */
.hit-win {
    border: 2px solid var(--success) !important;
    background: #1e2d22 !important;
    color: #d1f7b8 !important;
    font-weight: bold;
}

/* 方案 02 捕获面板高光 */
.bait-tier-btn.hit-win {
    border: 2px solid var(--success) !important;
    background: #17241b !important;
}

/* 方案 03: 老虎机高光 */
.slot-box { display: flex; gap: 8px; margin: 12px 0; }
.slot-item {
    width: 56px;
    height: 56px;
    border: 1px solid var(--border);
    background: #0c0e12;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-family: var(--font-mono);
    color: var(--text-bright);
}
.slot-item.hit-win {
    border: 2px solid var(--match-hi) !important;
    background: #2b2518 !important;
    color: var(--match-hi) !important;
    font-weight: bold;
}

/* 方案 04: 逆流深度显示 */
.crash-disp {
    font-size: 26px;
    color: var(--warn);
    margin: 10px 0;
    font-family: var(--font-mono);
    font-weight: 500;
}

/* 方案 05: Keno 高光 */
.keno-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; max-width: 280px; margin: 12px 0; }
.keno-cell {
    padding: 8px 0;
    text-align: center;
    background: #0c0e12;
    border: 1px solid var(--border);
    border-radius: 2px;
    cursor: pointer;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-dim);
}
.keno-cell:hover { border-color: var(--border-focus); }
.keno-cell.selected { border-color: var(--accent); background: #1b2533; color: var(--text-bright); }
.keno-cell.scanned { border-color: var(--border-focus); background: #161a22; color: var(--text-dim); }
.keno-cell.hit-win {
    border: 2px solid var(--success) !important;
    background: #1c2b20 !important;
    color: var(--success) !important;
    font-weight: bold;
}

.log {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 10px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
    min-height: 18px;
    font-family: var(--font-mono);
    line-height: 1.4;
}

/* 方案 06: 蜂巢阻断舱 */
.core-select { display: flex; gap: 6px; margin-bottom: 10px; }
.core-opt {
    flex: 1;
    justify-content: center;
    min-height: 34px;
    font-size: 11px;
}
.core-opt.active { border-color: var(--accent); background: #1b2533; color: var(--text-bright); }

.mines-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    max-width: 280px;
    margin: 10px 0;
}
.mines-cell {
    aspect-ratio: 1;
    background: #0c0e12;
    border: 1px solid var(--border);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-dim);
    cursor: pointer;
    touch-action: manipulation;
}
.mines-cell:hover:not(.locked) { border-color: var(--border-focus); color: var(--text); }
.mines-cell.marked { border-color: var(--accent); border-style: dashed; color: var(--accent); }
.mines-cell.opened { background: #151821; border-color: var(--border-focus); color: var(--text-bright); }
.mines-cell.core {
    background: #2b1416;
    border-color: var(--danger);
    color: var(--danger);
    font-weight: bold;
}
.mines-cell.locked { cursor: default; }

.mines-disp {
    font-size: 22px;
    color: var(--warn);
    margin: 8px 0 10px;
    font-family: var(--font-mono);
    font-weight: 500;
}

/* 通用按钮行（方案 09） */
.act-row { display: flex; gap: 6px; flex-wrap: wrap; }
.act-row button { flex: 1 1 120px; justify-content: center; }

/* 方案 09: 反应堆临界压制 */
.bj-board { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 12px; }
.bj-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    background: #0f1116;
    padding: 8px;
    border-radius: 2px;
}
.bj-label {
    font-size: 10px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    width: 84px;
    flex: none;
    line-height: 1.3;
}
.bj-cards { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; min-height: 38px; }
.bj-card {
    width: 30px;
    height: 38px;
    border: 1px solid var(--border);
    background: #0c0e12;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-bright);
}
.bj-card.hidden { color: var(--text-dim); border-style: dashed; }
.bj-total {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-bright);
    min-width: 46px;
    text-align: right;
    flex: none;
}
.bj-total.bust { color: var(--danger); }
.bj-total.perfect { color: var(--match-hi); }

/* ================= 移动端适配响应式规则 ================= */
@media screen and (max-width: 820px) {
    body {
        padding: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        gap: 16px;
    }

    #left-panel {
        flex: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-right: 0;
        padding-bottom: 16px;
        overflow: visible;
    }

    /* 移动端：状态头脱离文档流固定在视口顶部，高度由 JS 回填到 body padding-top */
    #status-box {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 60;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        border-top: 0;
        background: rgba(19, 21, 26, 0.97);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        box-shadow: 0 8px 16px -8px rgba(0, 0, 0, 0.95);
    }
    #status-box .hud-text { flex: 1; min-width: 0; }
    #status-box h3 { display: none; }
    #status-box .currency { font-size: 22px; line-height: 1.15; }
    #status-box .sub-curr {
        font-size: 10px;
        margin-top: 3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    #status-box #catch-btn {
        flex: none;
        width: auto;
        height: 46px;
        margin: 0;
        padding: 0 14px;
        min-width: 96px;
    }
    #status-box #catch-btn .sub { display: none; }

    #right-panel {
        flex: none;
        padding-right: 0;
        overflow: visible;
    }

    .mod-split {
        flex-direction: column;
        gap: 12px;
    }

    .mod-play-area { width: 100%; }

    .mod-upgrades-area {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
        padding-left: 0;
        padding-top: 12px;
    }

    .grid-3x3 {
        max-width: 220px;
        margin: 12px auto;
    }

    #slot-btn, #crash-action-btn, #keno-btn { width: 100% !important; }

    .keno-grid { max-width: 100%; }

    .mines-grid { max-width: 100%; }
    .bj-label { width: 64px; }
    .act-row button { flex: 1 1 100%; }
}

/* =========================================================
   收容库视图
   ========================================================= */
#view-archive.active { display: block; overflow-y: auto; }

.archive-wrap {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.archive-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}
.archive-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--text-bright);
    font-family: var(--font-mono);
}
.archive-sub {
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.archive-filter { display: flex; gap: 6px; flex: none; }
.filter-btn {
    justify-content: center;
    min-height: 30px;
    padding: 4px 12px;
    font-size: 11px;
    color: var(--text-dim);
}
.filter-btn.active { border-color: var(--accent); color: var(--text-bright); background: #1b2533; }

.archive-hint {
    font-size: 11px;
    line-height: 1.6;
    color: var(--text-dim);
    border-left: 2px solid var(--border-focus);
    padding: 6px 10px;
    background: #101216;
}
.archive-hint strong { color: var(--text-bright); font-weight: 600; }

.archive-empty {
    padding: 28px;
    text-align: center;
    font-size: 12px;
    color: var(--text-dim);
    border: 1px dashed var(--border);
    font-family: var(--font-mono);
}

/* 未解锁套组的模糊提示（不暴露任何条目信息） */
.archive-locked-note {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    padding: 13px 14px;
    border: 1px dashed var(--border);
    border-radius: 2px;
    background: #0f1116;
    font-size: 11px;
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
    color: var(--text-dim);
}
.aln-mark { color: var(--border-focus); letter-spacing: -3px; }
.aln-sub { margin-left: auto; color: #3a414e; font-size: 10px; }

/* ---------- 套组卡片 ---------- */
.set-list { display: flex; flex-direction: column; gap: 12px; }

.set-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-left: 2px solid var(--border);
    border-radius: 2px;
    padding: 14px;
}
.set-card.closed { border-left-color: var(--match-hi); }

.set-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}
.set-title {
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--text-bright);
    font-family: var(--font-mono);
}
.set-title .set-code { color: var(--text-dim); margin-right: 8px; }
.set-progress {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-dim);
    white-space: nowrap;
    flex: none;
}
.set-card.closed .set-progress { color: var(--match-hi); }

.set-bar {
    height: 3px;
    background: #0c0e12;
    border: 1px solid var(--border);
    margin: 9px 0;
    overflow: hidden;
}
.set-bar-fill { height: 100%; background: var(--accent); transition: width 0.3s ease; }
.set-card.closed .set-bar-fill { background: var(--match-hi); }

.set-desc {
    font-size: 11px;
    line-height: 1.55;
    color: var(--text-dim);
    margin-bottom: 11px;
}
.set-closed-note { color: var(--match-hi); white-space: nowrap; }

/* ---------- 条目卡 ---------- */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.item-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
    min-height: 78px;
    padding: 9px 10px;
    background: #0f1116;
    border: 1px solid var(--border);
    border-radius: 2px;
    transition: border-color 0.12s, background 0.12s;
}
.item-card.collected {
    border-left: 2px solid var(--rar);
    background: #12161d;
    cursor: pointer;
}
.item-card.collected:hover { background: #171c25; border-color: var(--rar); }
.item-card.locked { opacity: 0.55; }
.item-card.lv-locked { opacity: 0.3; }

.item-top { display: flex; align-items: center; justify-content: space-between; }
.item-code { font-size: 10px; font-family: var(--font-mono); color: var(--text-dim); }
.item-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--rar); flex: none; }
.item-card.locked .item-dot { background: transparent; border: 1px solid var(--rar); }

.item-name {
    font-size: 12px;
    line-height: 1.35;
    color: var(--text-bright);
    word-break: break-all;
}
.item-card.locked .item-name { color: var(--text-dim); letter-spacing: 0.06em; }

.item-foot { display: flex; align-items: center; justify-content: space-between; }
.item-rar { font-size: 10px; font-family: var(--font-mono); color: var(--rar); }
.item-count { font-size: 10px; font-family: var(--font-mono); color: var(--text-dim); }

/* =========================================================
   掉落提示
   ========================================================= */
#drop-layer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 268px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}
.drop-toast {
    border: 1px solid var(--border);
    border-left: 3px solid var(--rar);
    background: #12151b;
    padding: 8px 12px;
    border-radius: 2px;
    font-family: var(--font-mono);
    box-shadow: 0 10px 22px -10px rgba(0, 0, 0, 0.95);
    animation: drop-in 0.2s ease-out;
    transition: opacity 0.35s, transform 0.35s;
}
.drop-toast.out { opacity: 0; transform: translateX(16px); }
.drop-toast.dup { opacity: 0.88; border-left-width: 2px; }

@keyframes drop-in {
    from { opacity: 0; transform: translateX(18px); }
    to { opacity: 1; transform: none; }
}

.dt-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 10px;
    color: var(--text-dim);
    margin-bottom: 4px;
}
.dt-tag { color: var(--rar); letter-spacing: 0.06em; }
.dt-rar { border: 1px solid var(--rar); color: var(--rar); padding: 0 4px; border-radius: 2px; }
.dt-name {
    font-size: 12px;
    color: var(--text-bright);
    line-height: 1.4;
    word-break: break-all;
}
.dt-sub { font-size: 10px; color: var(--text-dim); margin-top: 3px; }
.dt-set {
    font-size: 10px;
    color: var(--match-hi);
    margin-top: 5px;
    border-top: 1px solid var(--border);
    padding-top: 4px;
}

/* =========================================================
   条目详情弹窗
   ========================================================= */
.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5, 6, 8, 0.8);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.modal-mask.show { display: flex; }

.modal-card {
    width: 100%;
    max-width: 420px;
    max-height: 82vh;
    overflow-y: auto;
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--border-focus);
    border-top: 2px solid var(--rar, var(--accent));
    border-radius: 2px;
    animation: mod-in 0.16s ease-out;
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.modal-code { font-size: 11px; font-family: var(--font-mono); color: var(--text-dim); }
.modal-close {
    min-height: 24px;
    padding: 2px 8px;
    font-size: 11px;
    color: var(--text-dim);
    border-color: var(--border);
}
.modal-name {
    font-size: 18px;
    color: var(--text-bright);
    margin: 10px 0 8px;
    line-height: 1.35;
}
.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.modal-tag {
    font-size: 10px;
    font-family: var(--font-mono);
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 2px;
    color: var(--text-dim);
}
.modal-tag.rar { border-color: var(--rar); color: var(--rar); }
.modal-desc {
    font-size: 12px;
    line-height: 1.75;
    color: var(--text);
    border-left: 2px solid var(--border-focus);
    padding-left: 10px;
}
.modal-meta {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 10px;
    line-height: 1.8;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

/* =========================================================
   新组件移动端适配
   ========================================================= */
@media screen and (max-width: 820px) {
    body { gap: 0; }

    /* 导航改为底部固定标签栏 */
    #app-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 54px;
        padding: 0 10px;
        border-bottom: none;
        border-top: 1px solid var(--border);
        background: rgba(16, 18, 22, 0.98);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        box-shadow: 0 -8px 16px -10px rgba(0, 0, 0, 0.95);
        z-index: 80;
    }
    .brand { display: none; }
    .nav-tabs { width: 100%; gap: 8px; }
    .nav-tab { flex: 1; min-height: 38px; font-size: 12px; }

    .view-stack { display: block; }
    .view { padding: 0; display: none; }
    .view.active { display: flex; flex-direction: column; gap: 16px; }
    #view-archive.active { display: block; overflow: visible; }

    .archive-head { align-items: flex-start; }
    .archive-title { font-size: 13px; }
    .archive-filter { width: 100%; }
    .filter-btn { flex: 1; }

    .set-card { padding: 12px; }
    .item-grid { grid-template-columns: repeat(2, 1fr); }
    .item-card { min-height: 72px; padding: 8px; }

    #drop-layer {
        top: auto;
        bottom: calc(54px + 14px + env(safe-area-inset-bottom));
        right: 10px;
        left: auto;
        width: calc(100% - 20px);
        max-width: 330px;
    }
}
