/* ================================================================
   GMP 短剧前台样式
   ================================================================ */
:root {
    --brand: #e11d48;
    --brand-soft: #fff1f4;
    --ink: #111114;
    --ink-2: #333338;
    --muted: #8a8a91;
    --muted-2: #b3b3ba;
    --line: #ededf0;
    --soft: #f5f5f7;
    --card: #fff;
    --radius: 12px;
    --max: 760px;
    --header-h: 56px;
}

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

html { background: #f0f0f3; }

body {
    margin: 0 auto;
    max-width: var(--max);
    min-height: 100vh;
    background: var(--card);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img { max-width: 100%; }
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

@media (min-width: 820px) {
    body { box-shadow: 0 0 70px rgba(0, 0, 0, .10); }
}

/* ---------------- 顶栏 ---------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--header-h);
    padding: 0 14px;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, .045);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    max-width: 46%;
}

.brand-mark {
    width: 25px;
    height: 25px;
    border-radius: 7px;
    background: var(--ink);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-name {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: -.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topnav {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 8px 0;
}
.topnav::-webkit-scrollbar { display: none; }

.topnav a {
    position: relative;
    flex-shrink: 0;
    font-size: 12.5px;
    color: #6f6f76;
    font-weight: 500;
    padding: 2px 0;
    white-space: nowrap;
}

.topnav a.active { color: var(--ink); font-weight: 800; }
.topnav a.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -3px;
    width: 14px;
    height: 2px;
    border-radius: 2px;
    transform: translateX(-50%);
    background: var(--brand);
}

.icon-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    margin-left: auto;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.icon-btn:active { background: var(--soft); }

/* ---------------- 公告 ---------------- */
.notice {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 10px 14px 0;
    padding: 8px 12px;
    border-radius: 9px;
    background: var(--brand-soft);
    color: #b0183a;
    font-size: 12px;
    line-height: 1.5;
}
.notice-icon { flex-shrink: 0; }

/* ---------------- 分类胶囊 ---------------- */
.chips {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px 2px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
    flex-shrink: 0;
    height: 31px;
    padding: 0 15px;
    border: 0;
    border-radius: 999px;
    background: var(--soft);
    color: #4a4a51;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.chip:active { transform: scale(.97); }
.chip.active { background: var(--ink); color: #fff; font-weight: 700; }

.chip-sort {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--line);
    color: #55555c;
}
.chip-sort.asc { border-color: #111; color: #111; }

/* ---------------- 页面 ---------------- */
.page { padding: 0 14px 40px; }

/* ---------------- 首页栏目 ---------------- */
.rack { margin-top: 24px; }

.rack-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.rack-title h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 900;
    letter-spacing: -.5px;
}

.rack-title p {
    margin: 3px 0 0;
    font-size: 11.5px;
    color: var(--muted);
    line-height: 1.4;
}

.rack-more {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 1px;
    border: 0;
    background: none;
    padding: 3px 0;
    color: var(--brand);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
}

.rack-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.rack-refresh {
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 11px;
    cursor: pointer;
    padding: 3px 0;
}
.rack-refresh:disabled { opacity: .5; }

/* 横向滚动：一屏约 2.2 个封面，露出第三张的一角提示可以右滑 */
.rail {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: auto;
    grid-auto-columns: 44%;
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 1px 0 3px;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

/* ---------------- 卡片 ---------------- */
.card {
    min-width: 0;
    cursor: pointer;
    outline: none;
    scroll-snap-align: start;
}

.card-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #ececf1, #dedee5);
    isolation: isolate;
}

@supports not (aspect-ratio: 1 / 1) {
    .card-cover { height: 0; padding-top: 62.5%; }
    .card-cover img { position: absolute; inset: 0; }
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
    background: var(--soft);
}
.card:active .card-cover img { transform: scale(1.025); }

.card-shade {
    position: absolute;
    inset: auto 0 0 0;
    height: 46%;
    background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent);
    pointer-events: none;
    z-index: 1;
}

.badge {
    position: absolute;
    z-index: 3;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    padding: 4px 6px;
    border-radius: 4px;
    letter-spacing: .2px;
}

.badge-cat {
    top: 7px;
    left: 7px;
    color: #fff;
    background: rgba(47, 107, 255, .94);
}

.badge-vip {
    top: 7px;
    right: 7px;
    color: #3a2408;
    background: linear-gradient(135deg, #ffe3a1, #e5b95e);
    box-shadow: 0 1px 5px rgba(0, 0, 0, .18);
}
body.vip-unlocked .badge-vip { display: none; }

.badge-hot {
    left: 7px;
    bottom: 7px;
    color: #fff;
    background: linear-gradient(135deg, #ff5a76, #e11d48);
}

.card-eps {
    position: absolute;
    z-index: 3;
    right: 7px;
    bottom: 7px;
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .48);
    color: #fff;
    font-size: 10px;
    line-height: 1.2;
    backdrop-filter: blur(2px);
}

.card-title {
    margin: 7px 0 0;
    font-size: 13.5px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    font-size: 10.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-meta .dot { color: var(--muted-2); }

/* 查看更多卡片 */
.more-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 1px dashed #d9d9e0;
    border-radius: 10px;
    background: #fbfbfd;
    color: #55555c;
    cursor: pointer;
    min-height: 100%;
    padding: 12px;
}
.more-tile:active { background: #f3f3f6; }
.more-plus {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 300;
    color: #333;
    margin-bottom: 4px;
}
.more-text { font-size: 12.5px; font-weight: 700; color: #333; }
.more-num { font-size: 10.5px; color: var(--muted); }

/* 展开后的网格 */
.rack-expanded { display: none; margin-top: 2px; }
.rack.is-expanded .rack-expanded { display: block; }
.rack.is-expanded .rail { display: none; }
.rack-expanded .collapse-row {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}
.collapse-btn {
    border: 1px solid var(--line);
    background: #fff;
    color: #444;
    border-radius: 999px;
    padding: 9px 26px;
    font-size: 12px;
    cursor: pointer;
}

/* ---------------- 通用网格 ---------------- */
.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 10px;
}

/* ---------------- 分类列表 ---------------- */
.list-view { margin-top: 18px; }

.list-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.list-head h2 { margin: 0; font-size: 21px; font-weight: 900; letter-spacing: -.5px; }
.list-head p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.list-back {
    border: 1px solid var(--line);
    background: #fff;
    color: #555;
    border-radius: 999px;
    padding: 6px 13px;
    font-size: 11.5px;
    cursor: pointer;
    flex-shrink: 0;
}

.list-foot { display: flex; justify-content: center; margin-top: 22px; }
.load-more {
    border: 1px solid var(--line);
    background: #fff;
    color: #333;
    padding: 10px 34px;
    border-radius: 999px;
    font-size: 12.5px;
    cursor: pointer;
}
.load-more:disabled { opacity: .55; cursor: default; }

.list-empty, .empty {
    text-align: center;
    padding: 46px 16px;
    color: var(--muted);
}
.empty-icon { font-size: 36px; line-height: 1; margin-bottom: 12px; }
.empty h3, .list-empty h3 { margin: 0 0 6px; font-size: 15px; color: #333; }
.empty p, .list-empty p { margin: 0; font-size: 12px; }

/* ---------------- 搜索层 ---------------- */
.search-layer {
    position: fixed;
    inset: 0;
    z-index: 90;
    margin: 0 auto;
    max-width: var(--max);
    background: #fff;
    display: flex;
    flex-direction: column;
    animation: fadeIn .18s ease;
}

.search-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    border-bottom: 1px solid var(--line);
}

.search-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: var(--soft);
    border-radius: 999px;
    color: var(--muted);
}
.search-box input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--ink);
    font-family: inherit;
}
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search-cancel {
    border: 0;
    background: none;
    color: #555;
    font-size: 13px;
    padding: 6px 0;
    cursor: pointer;
}

.search-body { flex: 1; overflow-y: auto; padding: 16px 14px 40px; }
.search-hint { color: var(--muted); font-size: 12.5px; padding: 18px 2px; text-align: center; }
.search-hint strong { color: var(--ink); }

/* ---------------- 解锁界面（点击封面先出现） ---------------- */
.unlock-sheet {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.unlock-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(3px);
    animation: fadeIn .18s ease;
}
.unlock-panel {
    position: relative;
    z-index: 1;
    width: min(430px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -12px 50px rgba(0, 0, 0, .2);
    animation: slideUp .26s cubic-bezier(.2, .9, .3, 1);
}
.unlock-close {
    position: absolute;
    z-index: 3;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: #f4f4f7;
    color: #666;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.unlock-body { padding: 22px 18px calc(20px + env(safe-area-inset-bottom)); }
.unlock-top { display: flex; gap: 11px; align-items: center; padding-right: 30px; }
.unlock-cover {
    width: 88px;
    height: 56px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 8px;
    background: var(--soft);
    border: 1px solid var(--line);
}
.unlock-kicker {
    display: block;
    font-size: 10px;
    font-weight: 800;
    color: var(--brand);
    letter-spacing: .5px;
    margin-bottom: 2px;
}
.unlock-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 900;
    letter-spacing: -.3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.unlock-meta {
    margin: 3px 0 0;
    font-size: 10.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.unlock-price-note {
    margin: 18px 0 9px;
    padding: 11px 13px;
    border-radius: 10px;
    background: #fff5f7;
    color: #7c2438;
    font-size: 12px;
    line-height: 1.5;
}
.unlock-price-note b { font-size: 21px; font-weight: 900; color: var(--brand); letter-spacing: -.5px; }
.unlock-paid {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff4d6d, var(--brand));
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(225, 29, 72, .28);
}
.unlock-paid:disabled { opacity: .5; cursor: default; box-shadow: none; }
.unlock-free {
    width: 100%;
    height: 50px;
    margin-top: 9px;
    border: 1px dashed #f0c98b;
    border-radius: 999px;
    background: #fffaf0;
    color: #8a5b00;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 800;
}
.unlock-free small {
    font-size: 10.5px;
    font-weight: 500;
    color: #b07a1a;
}
.unlock-free:active { background: #fff3d9; }
.unlock-hint {
    margin: 7px 2px 0;
    font-size: 10px;
    line-height: 1.6;
    color: var(--muted);
    text-align: center;
}
.unlock-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 10px;
    color: var(--muted);
    font-size: 10.5px;
}
.unlock-divider::before,
.unlock-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}
.unlock-code-row { display: flex; gap: 8px; }
.unlock-code-row input {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 13px;
    border: 1px solid #dedee5;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.unlock-code-row input:focus { border-color: #111; }
.unlock-code-row button {
    width: 88px;
    height: 46px;
    flex-shrink: 0;
    border: 0;
    border-radius: 10px;
    background: #111;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.unlock-code-row button:disabled { opacity: .55; }
.unlock-code-error {
    min-height: 16px;
    margin: 5px 2px 0;
    font-size: 10.5px;
    color: #d92d20;
}
.unlock-detail-link {
    display: block;
    margin: 4px auto 0;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 11px;
    text-decoration: underline;
    cursor: pointer;
}
@media (min-width: 760px) {
    .unlock-sheet { align-items: center; }
    .unlock-panel { border-radius: 20px; max-width: 420px; }
}

/* 详情 */
.sheet {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.sheet-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .52);
    backdrop-filter: blur(2px);
    animation: fadeIn .2s ease;
}
.sheet-panel {
    position: relative;
    z-index: 1;
    width: min(var(--max), 100%);
    max-height: 92vh;
    background: #fff;
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp .26s cubic-bezier(.2, .9, .3, 1);
    box-shadow: 0 -12px 50px rgba(0, 0, 0, .18);
}
.sheet-scroll {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom);
}
.sheet-close {
    position: absolute;
    z-index: 5;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.detail-hero {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #ddd;
    overflow: hidden;
}
.detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.detail-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent 55%);
}
.detail-hero .detail-cat {
    position: absolute;
    z-index: 2;
    left: 14px;
    bottom: 12px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    background: var(--brand);
    padding: 3px 9px;
    border-radius: 4px;
}

.detail-main { padding: 16px 16px 8px; }
.detail-main h1 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -.4px;
    line-height: 1.3;
}
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.detail-tag {
    font-size: 11px;
    color: #666;
    background: var(--soft);
    border-radius: 4px;
    padding: 3px 7px;
}
.detail-meta {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    margin-bottom: 12px;
}
.detail-desc {
    font-size: 13px;
    color: #55555c;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 14px;
}
.detail-block-title {
    font-size: 13px;
    font-weight: 800;
    margin: 18px 0 8px;
}
.detail-cta {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 11px 16px calc(11px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(10px);
}
.detail-price { flex-shrink: 0; line-height: 1.15; }
.detail-price b { font-size: 21px; font-weight: 900; color: var(--brand); }
.detail-price s { display: block; font-size: 10.5px; color: var(--muted); }
.btn-pay {
    flex: 1;
    height: 46px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff4d6d, var(--brand));
    color: #fff;
    font-size: 14.5px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(225, 29, 72, .28);
}
.btn-pay:active { transform: scale(.99); }
.btn-ghost {
    flex: 1;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #333;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}
.detail-tip {
    font-size: 10.5px;
    color: var(--muted);
    text-align: center;
    margin: 9px 16px 6px;
}
.detail-code-link {
    display: block;
    margin: 0 auto 16px;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 11.5px;
    text-decoration: underline;
    cursor: pointer;
}
.detail-res {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.detail-res a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fafafc;
    font-size: 13px;
    color: #333;
}
.detail-res a span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-res a span:last-child { color: var(--brand); flex-shrink: 0; }
.detail-vip-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff8e8;
    border: 1px solid #f5dfae;
    color: #8a5b00;
    border-radius: 9px;
    font-size: 12px;
    margin-bottom: 14px;
}

/* ---------------- 页脚 ---------------- */
.site-foot {
    padding: 30px 20px calc(34px + env(safe-area-inset-bottom));
    text-align: center;
    color: #a5a5ad;
    font-size: 11px;
    line-height: 1.9;
    border-top: 1px solid var(--line);
    margin-top: 20px;
}
.foot-brand { font-weight: 900; color: #444; font-size: 13px; margin-bottom: 6px; letter-spacing: .5px; }
.site-foot p { margin: 0; }

/* ---------------- 提示 ---------------- */
.toast-host {
    position: fixed;
    z-index: 300;
    left: 50%;
    bottom: 42px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    width: max-content;
    max-width: 84vw;
}
.toast {
    background: rgba(17, 17, 20, .92);
    color: #fff;
    font-size: 12.5px;
    line-height: 1.45;
    padding: 9px 16px;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    animation: toastIn .2s ease;
    text-align: center;
}
.toast.success { background: rgba(10, 143, 77, .94); }
.toast.error { background: rgba(190, 25, 45, .94); }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: .22s; }

/* 解锁悬浮条 */
.unlock-bar {
    position: fixed;
    z-index: 60;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(17, 17, 20, .92);
    color: #fff;
    font-size: 12px;
    padding: 8px 10px 8px 16px;
    border-radius: 999px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
    width: max-content;
    max-width: 92vw;
}
.unlock-bar button {
    border: 0;
    border-radius: 999px;
    background: #f7d488;
    color: #3a2408;
    font-size: 11.5px;
    font-weight: 800;
    padding: 5px 11px;
    cursor: pointer;
}

/* 骨架 / 加载 */
.loading-line {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #f0f0f3 25%, #f8f8fa 37%, #f0f0f3 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
    margin: 10px 0;
}

/* ---------------- 动画 ---------------- */
@keyframes slideUp { from { transform: translateY(40px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------- 小屏微调 ---------------- */
@media (max-width: 360px) {
    .topbar { padding: 0 11px; gap: 7px; }
    .brand-name { font-size: 14.5px; }
    .chips { padding-left: 11px; padding-right: 11px; }
    .page { padding-left: 11px; padding-right: 11px; }
    .rack-title h2 { font-size: 18.5px; }
    .card-title { font-size: 12.5px; }
    .rail { grid-auto-columns: 45%; gap: 9px; }
    .grid { gap: 14px 8px; }
}
