/* =========================================================
   PDD 福袋互助广场 · 主题样式
   ========================================================= */

/* ---------- 设计变量 ---------- */
:root {
    --brand: #6366f1;
    --brand-2: #8b5cf6;
    --brand-3: #ec4899;
    --pdd: #e02e24;
    --ok: #10b981;
    --warn: #f59e0b;
    --danger: #ef4444;

    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 26px;

    --ease: cubic-bezier(.22, 1, .36, 1);
    --maxw: 860px;
    --shadow-1: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-2: 0 8px 24px -8px rgba(15, 23, 42, .14);
    --shadow-3: 0 24px 60px -20px rgba(79, 70, 229, .35);
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #f4f6fc;
    --bg-2: #eef2ff;
    --surface: rgba(255, 255, 255, .82);
    --surface-solid: #ffffff;
    --surface-soft: rgba(248, 250, 255, .9);
    --border: rgba(15, 23, 42, .07);
    --border-strong: rgba(15, 23, 42, .12);
    --text: #0f172a;
    --text-2: #4b5563;
    --text-3: #94a3b8;
    --hair: rgba(15, 23, 42, .06);
    --glass-blur: 18px;
    --orb-1: rgba(99, 102, 241, .30);
    --orb-2: rgba(236, 72, 153, .22);
    --orb-3: rgba(16, 185, 129, .18);
    --item-hover: rgba(99, 102, 241, .06);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #070a14;
    --bg-2: #0d1222;
    --surface: rgba(23, 28, 46, .68);
    --surface-solid: #151a2b;
    --surface-soft: rgba(30, 36, 56, .7);
    --border: rgba(255, 255, 255, .09);
    --border-strong: rgba(255, 255, 255, .16);
    --text: #eaeefb;
    --text-2: #a8b3cc;
    --text-3: #6b7794;
    --hair: rgba(255, 255, 255, .07);
    --glass-blur: 20px;
    --orb-1: rgba(99, 102, 241, .34);
    --orb-2: rgba(236, 72, 153, .26);
    --orb-3: rgba(56, 189, 248, .20);
    --item-hover: rgba(255, 255, 255, .05);
    --shadow-2: 0 8px 28px -10px rgba(0, 0, 0, .7);
    --shadow-3: 0 24px 60px -20px rgba(0, 0, 0, .8);
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom);
}

img { max-width: 100%; }
button { font-family: inherit; }
a { color: inherit; }

::selection { background: rgba(99, 102, 241, .28); }

/* ---------- 背景光斑 ---------- */
.orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .9;
    will-change: transform;
}
.orb-1 { width: 460px; height: 460px; top: -160px; left: -120px; background: var(--orb-1); animation: float1 22s var(--ease) infinite; }
.orb-2 { width: 400px; height: 400px; top: 120px; right: -140px; background: var(--orb-2); animation: float2 26s var(--ease) infinite; }
.orb-3 { width: 380px; height: 380px; bottom: -120px; left: 35%; background: var(--orb-3); animation: float3 30s var(--ease) infinite; }

@keyframes float1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px, 50px) scale(1.12); } }
@keyframes float2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-70px, 60px) scale(1.08); } }
@keyframes float3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px, -50px) scale(1.15); } }

/* =========================================================
   顶部导航
   ========================================================= */
.topbar {
    position: sticky; top: 0; z-index: 60;
    padding: 10px 16px;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--hair);
}
.topbar-inner {
    max-width: var(--maxw); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand-mark {
    width: 36px; height: 36px; flex: none;
    border-radius: 11px;
    display: grid; place-items: center;
    font-size: 19px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2) 55%, var(--brand-3));
    box-shadow: 0 6px 16px -6px rgba(99, 102, 241, .8);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
/* 顶栏横向空间紧张时，品牌文字用省略号收缩，绝不换行撑高顶栏 */
.brand-text b,
.brand-text i { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text b { font-size: 15px; letter-spacing: .2px; }
.brand-text i { font-style: normal; font-size: 11px; color: var(--text-3); }
/* 顶栏标语：原来在 Hero 区，现以小字号常驻顶栏 */
.topbar-slogan {
    display: inline-flex; align-items: center; gap: 5px;
    margin-right: auto;                 /* 紧贴品牌区，右侧按钮仍靠右 */
    padding: 3px 9px;
    font-size: 10.5px; font-weight: 600; letter-spacing: .2px;
    color: var(--text-3);
    border: 1px solid var(--hair);
    border-radius: 999px;
    background: var(--surface-soft);
    white-space: nowrap;
}
.topbar-slogan .dot {
    width: 5px; height: 5px; flex: none; border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, .6);
    animation: ping 2s ease-out infinite;
}
.topbar-actions { display: flex; gap: 8px; flex: none; }

.icon-btn {
    width: 36px; height: 36px; flex: none;
    display: grid; place-items: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    transition: transform .18s var(--ease), color .18s, border-color .18s, background .18s;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-1px); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }

#themeToggle .ico-moon { display: none; }
html[data-theme="dark"] #themeToggle .ico-sun { display: none; }
html[data-theme="dark"] #themeToggle .ico-moon { display: block; }

/* =========================================================
   布局
   ========================================================= */
.wrap {
    position: relative; z-index: 1;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 8px 16px 40px;
}

/* ---------- Hero ---------- */
/* 标语已移至顶栏（.topbar-slogan），此处只保留标题 + 副标题 + 统计 */
.hero { text-align: center; padding: 24px 4px 22px; }
/* ping 动画由 .topbar-slogan .dot 复用 */
@keyframes ping {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,.55); }
    70%  { box-shadow: 0 0 0 7px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

.hero-title {
    margin: 0 0 10px;
    font-size: clamp(26px, 6.4vw, 40px);
    font-weight: 800; letter-spacing: -.6px; line-height: 1.24;
}
.hero-title .grad {
    background: linear-gradient(100deg, var(--brand), var(--brand-2) 45%, var(--brand-3));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.hero-sub { margin: 0 auto; max-width: 460px; color: var(--text-2); font-size: 14px; }

/* ---------- 统计 ---------- */
.stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    margin-top: 24px;
}
.stat {
    padding: 10px 6px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--shadow-1);
    transition: transform .22s var(--ease), border-color .22s;
}
.stat:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.stat-num {
    font-size: clamp(17px, 4.4vw, 21px); font-weight: 800; letter-spacing: -.5px;
    line-height: 1.2;                    /* 收紧行高，避免大字号撑高卡片 */
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, var(--brand), var(--brand-2) 60%, var(--brand-3));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat:nth-child(2) .stat-num { background: linear-gradient(135deg, #10b981, #059669); -webkit-background-clip: text; background-clip: text; }
.stat:nth-child(3) .stat-num { background: linear-gradient(135deg, #f59e0b, #f97316); -webkit-background-clip: text; background-clip: text; }
.stat:nth-child(4) .stat-num { background: linear-gradient(135deg, #0ea5e9, #6366f1); -webkit-background-clip: text; background-clip: text; }
.stat-label { margin-top: 1px; font-size: 11px; line-height: 1.3; color: var(--text-3); white-space: nowrap; }

/* =========================================================
   卡片
   ========================================================= */
.card {
    position: relative;
    margin: 0 0 16px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
    backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    box-shadow: var(--shadow-2);
    animation: rise .5s var(--ease) both;
}
.card-glow::before {
    content: ""; position: absolute; inset: -1px;
    border-radius: inherit; padding: 1px;
    background: linear-gradient(140deg, rgba(99,102,241,.55), rgba(236,72,153,.35), transparent 60%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}
.card-title {
    margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.2px;
    display: flex; align-items: center; gap: 8px;
}
.card-title .emoji { font-size: 17px; }
.chip {
    padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 600;
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand) 26%, transparent);
}
.chip-warn {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 11%, transparent);
    border-color: color-mix(in srgb, var(--danger) 26%, transparent);
}
.card-x {
    position: absolute; top: 12px; right: 12px;
    width: 24px; height: 24px; line-height: 1;
    display: grid; place-items: center;
    border: 0; border-radius: 8px; cursor: pointer;
    background: transparent; color: var(--text-3); font-size: 18px;
    transition: color .18s, background .18s;
}
.card-x:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }

/* ---------- 提交区 ---------- */
.submit-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.field { position: relative; flex: 1 1 220px; min-width: 0; }
.field-ico {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: var(--text-3); pointer-events: none;
}
.field input {
    width: 100%; height: 48px;
    padding: 0 38px 0 38px;
    font-size: 16px; letter-spacing: .6px;
    color: var(--text);
    background: var(--surface-soft);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input::placeholder { color: var(--text-3); letter-spacing: 0; }
.field input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent);
}
.field-clear {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 24px; height: 24px; border: 0; border-radius: 7px;
    background: var(--border); color: var(--text-2);
    font-size: 16px; line-height: 1; cursor: pointer;
    display: none; place-items: center;
    transition: background .18s, color .18s;
}
.field-clear:hover { background: var(--danger); color: #fff; }
.field.has-value .field-clear { display: grid; }

.btn {
    position: relative; overflow: hidden;
    height: 48px; padding: 0 22px;
    border: 0; border-radius: var(--r-md);
    font-size: 15px; font-weight: 700; color: #fff;
    cursor: pointer; white-space: nowrap;
    transition: transform .18s var(--ease), box-shadow .22s, filter .2s;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }
.btn-primary {
    flex: 0 1 auto;
    background: linear-gradient(135deg, var(--pdd), #ff6a4d);
    box-shadow: 0 8px 22px -8px rgba(224, 46, 36, .75);
}
.btn-magic {
    flex: 1 1 190px; min-width: 168px;
    padding-right: 42px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2) 55%, var(--brand-3));
    box-shadow: 0 8px 24px -8px rgba(139, 92, 246, .8);
}
.btn-magic::after {
    content: ""; position: absolute; top: 0; left: -60%;
    width: 45%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.42), transparent);
    transform: skewX(-18deg);
    animation: sweep 3.4s ease-in-out infinite;
}
@keyframes sweep { 0% { left: -60%; } 55%,100% { left: 130%; } }
.btn:hover:not([disabled]) { transform: translateY(-2px); filter: brightness(1.05); }
.btn .btn-txt { position: relative; z-index: 1; }

.help-dot {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    width: 22px; height: 22px; z-index: 2;
    display: grid; place-items: center;
    border-radius: 50%; font-size: 12px; font-weight: 700;
    background: rgba(255, 255, 255, .26); color: #fff;
    cursor: pointer; transition: background .18s, transform .18s;
}
.help-dot:hover { background: rgba(255, 255, 255, .45); transform: translateY(-50%) scale(1.12); }

.hint {
    margin: 12px 0 0; padding: 10px 13px;
    font-size: 12.5px; line-height: 1.75; color: var(--text-2);
    background: var(--surface-soft);
    border: 1px solid var(--hair);
    border-radius: var(--r-sm);
}

.quick-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.quick-btn {
    flex: 1 1 200px;
    padding: 10px 12px;
    font-size: 13px; font-weight: 700;
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 8%, transparent);
    border: 1px dashed color-mix(in srgb, var(--brand) 34%, transparent);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: transform .18s var(--ease), background .2s, border-color .2s;
}
.quick-btn:hover { background: color-mix(in srgb, var(--brand) 15%, transparent); border-style: solid; }
.quick-btn:active { transform: scale(.98); }
.quick-btn-danger {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 8%, transparent);
    border-color: color-mix(in srgb, var(--danger) 32%, transparent);
}
.quick-btn-danger:hover { background: color-mix(in srgb, var(--danger) 15%, transparent); }

/* ---------- 折叠说明 ---------- */
.fold { margin-top: 14px; border-top: 1px solid var(--hair); padding-top: 10px; }
.fold summary {
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; list-style: none;
    font-size: 13.5px; font-weight: 700; color: var(--brand);
    padding: 4px 0; user-select: none;
}
.fold summary::-webkit-details-marker { display: none; }
.fold-arrow {
    width: 8px; height: 8px; margin-right: 3px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform .25s var(--ease);
}
.fold[open] .fold-arrow { transform: rotate(-135deg) translate(-2px, -2px); }
.fold-body { animation: rise .32s var(--ease) both; }
.tips {
    margin: 10px 0 0; padding-left: 20px;
    font-size: 13px; line-height: 1.9; color: var(--text-2);
}
.tips b { color: var(--danger); }
.img-wrapper { margin: 14px auto 2px; text-align: center; }
.img-wrapper img {
    max-width: 400px; width: 100%; height: auto;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-2);
    cursor: zoom-in;
}

/* =========================================================
   福利 / 双格入口
   ========================================================= */
.welfare-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.w-item {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 9px;
    text-decoration: none;
    border: 1px solid var(--hair);
    border-radius: var(--r-md);
    background: var(--surface-soft);
    transition: transform .2s var(--ease), box-shadow .2s, border-color .2s, background .2s;
}
.w-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.w-item:active { transform: scale(.97); }
.w-ico {
    width: 30px; height: 30px; flex: none;
    display: grid; place-items: center;
    border-radius: 9px; font-size: 13px; font-weight: 700;
}
.bg-meituan { background: #FFD000; color: #333; }
.bg-taobao { background: #FF5000; color: #fff; }
.bg-jingdong { background: #E1251B; color: #fff; }
.bg-didi { background: #FF8C00; color: #fff; }
.w-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.w-info b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-info i { font-style: normal; font-size: 10.5px; color: var(--danger); white-space: nowrap; }
.w-go { margin-left: auto; color: var(--text-3); font-size: 15px; }

.dual { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.dual-item {
    display: flex; align-items: center; gap: 11px;
    padding: 15px 14px;
    text-decoration: none; color: #fff;
    border-radius: var(--r-md);
    transition: transform .2s var(--ease), box-shadow .25s;
}
.dual-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.dual-item:active { transform: scale(.98); }
.dual-movie { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 10px 26px -12px rgba(245, 158, 11, .9); }
.dual-sim { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 10px 26px -12px rgba(16, 185, 129, .9); }
.dual-emoji { font-size: 22px; line-height: 1; }
.dual-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.dual-txt b { font-size: 14.5px; letter-spacing: .3px; }
.dual-txt i { font-style: normal; font-size: 11px; opacity: .85; }

/* =========================================================
   瓶盖比价网 入口横条
   ========================================================= */
.bj-entry {
    position: relative;
    display: flex; align-items: center; gap: 13px;
    margin-bottom: 16px; padding: 14px 15px;
    text-decoration: none; color: #fff;
    border-radius: var(--r-lg);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    background:
        radial-gradient(120% 150% at 100% 0%, rgba(255, 255, 255, .24), transparent 58%),
        linear-gradient(120deg, #06b6d4 0%, #2563eb 52%, #4f46e5 100%);
    box-shadow: 0 14px 32px -14px rgba(37, 99, 235, .72),
                inset 0 1px 0 rgba(255, 255, 255, .26);
    transition: transform .22s var(--ease), box-shadow .28s var(--ease);
}
/* 流光扫过 */
.bj-entry::before {
    content: "";
    position: absolute; top: 0; left: -55%;
    width: 40%; height: 100%;
    pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .32), transparent);
    transform: skewX(-18deg);
    animation: bj-shine 4.6s var(--ease) 1.2s infinite;
}
@keyframes bj-shine { 0%, 58% { left: -55%; } 100% { left: 130%; } }

.bj-entry:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px -14px rgba(37, 99, 235, .88),
                inset 0 1px 0 rgba(255, 255, 255, .32);
}
.bj-entry:active { transform: scale(.985); }

.bj-ico {
    flex: 0 0 auto;
    width: 42px; height: 42px;
    display: grid; place-items: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .32);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32);
}
.bj-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bj-title {
    display: flex; align-items: center; gap: 7px;
    font-size: 15.5px; font-weight: 800; letter-spacing: .4px; line-height: 1.2;
}
.bj-badge {
    flex: 0 0 auto;
    padding: 2px 5px; border-radius: 6px;
    font-size: 10px; font-weight: 700; letter-spacing: .6px;
    background: rgba(255, 255, 255, .24);
    border: 1px solid rgba(255, 255, 255, .3);
}
.bj-desc {
    font-size: 11.5px; opacity: .9;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bj-go {
    margin-left: auto;
    display: flex; align-items: center; gap: 4px;
    font-size: 12.5px; font-weight: 600; opacity: .92; white-space: nowrap;
}
.bj-go svg { transition: transform .25s var(--ease); }
.bj-entry:hover .bj-go svg { transform: translateX(3px); }

/* =========================================================
   公告栏
   ========================================================= */
.notice-bar {
    display: flex; align-items: center; gap: 8px;
    height: 46px; margin-bottom: 16px; padding: 0 8px 0 0;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    backdrop-filter: blur(12px);
    overflow: hidden;
    animation: rise .45s var(--ease) both;
}
.notice-accent {
    width: 4px; height: 20px; flex: none; margin-left: 10px;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, var(--brand), var(--brand-3));
}
.notice-tag { flex: none; font-size: 13px; font-weight: 800; color: var(--text-2); }
.notice-scroll { flex: 1; overflow: hidden; height: 100%; display: flex; align-items: center; min-width: 0; }
.notice-track { white-space: nowrap; padding-left: 8px; font-size: 13px; color: var(--text-2); animation: marquee 20s linear infinite; }
@keyframes marquee { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }
.notice-link {
    flex: none; border: 0; background: transparent; cursor: pointer;
    font-size: 12px; color: var(--text-3); padding: 4px 2px;
}
.notice-link:hover { color: var(--brand); }
.notice-close {
    width: 26px; height: 26px; flex: none;
    display: grid; place-items: center;
    border: 0; border-radius: 8px; cursor: pointer;
    background: var(--hair); color: var(--text-2);
    transition: background .18s, color .18s;
}
.notice-close:hover { background: var(--danger); color: #fff; }

/* =========================================================
   列表
   ========================================================= */
.list-card { padding: 16px 16px 12px; }

.list-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.tabs {
    display: inline-flex; gap: 3px; padding: 3px;
    background: var(--surface-soft);
    border: 1px solid var(--hair);
    border-radius: 11px;
}
.tab {
    padding: 6px 15px; border: 0; border-radius: 8px;
    background: transparent; color: var(--text-2);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: color .2s, background .25s var(--ease), box-shadow .25s;
}
.tab:hover { color: var(--text); }
.tab.is-on {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 5px 14px -6px rgba(99, 102, 241, .9);
}

.list-tools { display: flex; align-items: center; gap: 8px; }
.search {
    position: relative; display: flex; align-items: center;
    padding: 0 10px; height: 34px;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface-soft);
    transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 13%, transparent); }
.search svg { color: var(--text-3); flex: none; }
.search input {
    width: 108px; margin-left: 6px; border: 0; outline: none;
    background: transparent; color: var(--text); font-size: 13px;
}
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.sort-btn {
    display: inline-flex; align-items: center; gap: 5px;
    height: 34px; padding: 0 11px;
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface-soft); color: var(--text-2);
    font-size: 12.5px; font-weight: 600; cursor: pointer;
    transition: color .2s, border-color .2s;
}
.sort-btn:hover { color: var(--brand); border-color: var(--brand); }
.sort-btn:active { transform: scale(.96); }

.refresh-line {
    display: flex; align-items: center; gap: 7px;
    min-height: 20px; margin-bottom: 10px;
    font-size: 12.5px; color: var(--text-3);
}
.pulse-dot {
    width: 6px; height: 6px; border-radius: 50%; flex: none;
    background: var(--brand);
    animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }
.refresh-line .hl { color: var(--brand); font-weight: 700; }
.refresh-line .ok { color: var(--ok); font-weight: 700; }

.list { list-style: none; margin: 0; padding: 0; }

.item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 13px 15px; margin-bottom: 9px;
    border: 1px solid var(--hair);
    border-left: 3px solid var(--border-strong);
    border-radius: var(--r-md);
    background: var(--surface-soft);
    transition: transform .2s var(--ease), box-shadow .2s, border-color .2s, background .2s;
}
.item:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.item.is-new { animation: slideIn .42s var(--ease) both; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px) scale(.985); } to { opacity: 1; transform: none; } }

.item-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item-code { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.code-num {
    font-size: 17px; font-weight: 800; letter-spacing: 1.4px;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.item-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); }
.item-time { font-variant-numeric: tabular-nums; }

.badge {
    padding: 2px 7px; border-radius: 6px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
}
.badge-mine { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.badge-queue { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.badge-done { background: var(--hair); color: var(--text-3); }
.badge-hot { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }

.item-act { display: flex; align-items: center; gap: 8px; flex: none; }

.act-btn {
    height: 36px; padding: 0 16px;
    border: 0; border-radius: 10px;
    font-size: 13.5px; font-weight: 700; color: #fff;
    cursor: pointer; white-space: nowrap;
    transition: transform .18s var(--ease), box-shadow .2s, filter .2s;
}
.act-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.act-btn:active { transform: scale(.95); }
.act-go { background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 6px 16px -8px rgba(99,102,241,.95); }
.act-report {
    height: 32px; padding: 0 12px; font-size: 12.5px;
    background: transparent; color: var(--danger);
    border: 1px solid color-mix(in srgb, var(--danger) 34%, transparent);
    box-shadow: none;
}
.act-report:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.act-done { background: transparent; color: var(--text-3); font-size: 13px; font-weight: 600; padding: 0; }

.item.waiting { border-left-color: var(--brand); }
.item.waiting .code-num { color: var(--text); }
.item.used { opacity: .62; border-left-color: var(--text-3); }
.item.used .code-num { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.item.mine { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 7%, var(--surface-soft)); }
.item.mine.waiting .code-num { color: var(--ok); }

/* 骨架屏 */
.skeleton { display: none; }
.skeleton.on { display: block; }
.sk-row {
    height: 62px; margin-bottom: 9px; border-radius: var(--r-md);
    background: linear-gradient(90deg, var(--hair) 25%, var(--border) 37%, var(--hair) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.empty { text-align: center; padding: 34px 10px 26px; }
.empty-emoji { font-size: 40px; opacity: .55; }
.empty-title { margin: 10px 0 4px; font-size: 15px; font-weight: 700; color: var(--text-2); }
.empty-sub { margin: 0; font-size: 13px; color: var(--text-3); }

/* 列表底部提示：当日条数 / 隐藏条数 */
.list-foot {
    margin-top: 14px; padding: 11px 14px; border-radius: 12px;
    text-align: center; font-size: 12.5px; color: var(--text-3);
    background: var(--hair); border: 1px solid var(--border);
}
.list-foot b { color: var(--brand); font-weight: 700; }

/* =========================================================
   页脚 / 回到顶部
   ========================================================= */
.foot { text-align: center; padding: 18px 10px 0; font-size: 12px; color: var(--text-3); }
.foot p { margin: 3px 0; }
.foot-sub { opacity: .8; }

.to-top {
    position: fixed; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom));
    z-index: 50; width: 42px; height: 42px;
    display: grid; place-items: center;
    border: 1px solid var(--border); border-radius: 13px;
    background: var(--surface); color: var(--text-2);
    backdrop-filter: blur(10px);
    cursor: pointer;
    opacity: 0; transform: translateY(10px) scale(.9); pointer-events: none;
    transition: opacity .28s var(--ease), transform .28s var(--ease), color .2s, border-color .2s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--brand); border-color: var(--brand); }

/* =========================================================
   SweetAlert2 主题适配
   ========================================================= */
.swal2-popup {
    border-radius: var(--r-lg) !important;
    background: var(--surface-solid) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-3) !important;
    font-family: inherit !important;
}
.swal2-title { color: var(--text) !important; }
.swal2-content,
.swal2-html-container { color: var(--text-2) !important; font-size: 14.5px !important; }
.swal2-close { color: var(--text-3) !important; }
.swal2-close:hover { color: var(--danger) !important; }
.swal2-timer-progress-bar { background: color-mix(in srgb, var(--brand) 65%, transparent) !important; }

/* Toast 适配 */
.swal2-toast {
    background: var(--surface-solid) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-2) !important;
    border-radius: 13px !important;
}
.swal2-toast .swal2-title { color: var(--text) !important; font-size: 14px !important; margin: 0 .6em !important; }
.swal2-toast .swal2-icon { margin: 0 0 0 .5em !important; }

.swal2-popup .swal2-styled.swal-btn-custom {
    background: linear-gradient(135deg, var(--brand), var(--brand-2)) !important;
    box-shadow: 0 8px 20px -8px rgba(99,102,241,.9) !important;
    border-radius: 10px !important;
    padding: 10px 24px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
}
html[data-theme="dark"] .swal2-popup { background: #151a2b !important; }
html[data-theme="dark"] .swal2-content,
html[data-theme="dark"] .swal2-html-container { color: var(--text-2) !important; }
html[data-theme="dark"] .swal2-title { color: var(--text) !important; }
html[data-theme="dark"] .swal2-toast { background: #1b2136 !important; }
html[data-theme="dark"] .swal2-toast .swal2-title { color: var(--text) !important; }

/* 弹窗内自定义块（公告 / 联系）在新主题下的描边 */
.swal-html-box {
    text-align: left; font-size: 14px; line-height: 1.75; color: var(--text-2);
}
.swal-block {
    padding: 13px 15px; margin-bottom: 12px;
    border-radius: 12px; background: var(--surface-soft); border: 1px solid var(--hair);
}
.swal-block.brand { background: color-mix(in srgb, var(--brand) 9%, transparent); border-color: color-mix(in srgb, var(--brand) 24%, transparent); }
.swal-block.ok { background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 26%, transparent); }
.swal-block h4 { margin: 0 0 6px; font-size: 14px; color: var(--text); }
.swal-block ul { margin: 6px 0 0; padding-left: 20px; }
.swal-block li { margin-bottom: 6px; }
.swal-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 16px; font-weight: 700; letter-spacing: .5px;
}
.swal-bl-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.swal-bl-table th, .swal-bl-table td { padding: 7px 6px; text-align: left; border-bottom: 1px solid var(--hair); }
.swal-bl-table th { color: var(--text-3); font-weight: 600; }
.swal-bl-scroll { max-height: 300px; overflow-y: auto; }

/* Viewer 图片查看器暗色适配 */
html[data-theme="dark"] .viewer-backdrop { background-color: rgba(3, 6, 14, .94) !important; }

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 720px) {
    .welfare-grid { grid-template-columns: repeat(2, 1fr); }
}
/* =========================================================
   移动端：高信息密度布局（≤600px）
   目标：单屏尽可能多展示互助码。手段 = 收紧留白 + 压字号行高
   + 把纵向堆叠改回横向排列 + 隐藏次要元素。
   底线：可点按区域 ≥ 36px、正文不小于 10px、任何元素不得横向溢出。
   ========================================================= */
@media (max-width: 600px) {
    /* ---------- 全局节奏 ---------- */
    body { font-size: 14.5px; line-height: 1.5; }
    .wrap { padding: 4px 11px 26px; }

    /* ---------- 顶栏 ---------- */
    .topbar { padding: 7px 12px; }
    .brand { gap: 8px; }
    .brand-mark { width: 32px; height: 32px; border-radius: 10px; font-size: 17px; }
    .brand-text b { font-size: 14px; }
    .brand-text i { font-size: 10px; }
    /* 顶栏图标保持 36/32 不缩：这是高频点按区，触控优先于省空间 */
    .icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }

    /* 顶栏标语：移动端去掉边框底色、进一步缩小，把横向空间让给品牌名与按钮 */
    .topbar-slogan {
        padding: 0; border: 0; background: transparent;
        font-size: 10px; gap: 4px;
    }
    .topbar-slogan .dot { width: 4px; height: 4px; }

    /* ---------- Hero ---------- */
    .hero { padding: 14px 2px 10px; }
    .hero-title { margin-bottom: 4px; font-size: clamp(21px, 5.8vw, 27px); line-height: 1.18; letter-spacing: -.4px; }
    /* 副标题说明与下方 hint / 折叠说明重复，移动端隐藏以让出首屏 */
    .hero-sub { display: none; }
    .stats { margin-top: 10px; gap: 6px; }
    .stat { padding: 6px 3px; border-radius: 11px; }
    .stat-num { font-size: 15.5px; line-height: 1.2; }
    .stat-label { margin-top: 1px; font-size: 10px; line-height: 1.3; }

    /* ---------- 卡片通用 ---------- */
    .card { margin-bottom: 11px; padding: 13px 12px; border-radius: var(--r-md); }
    .card-head { margin-bottom: 9px; gap: 8px; }
    .card-title { font-size: 15px; gap: 6px; }
    .card-title .emoji { font-size: 15px; }
    .chip { padding: 2px 8px; font-size: 10.5px; }

    /* ---------- 提交区：输入框独占一行，两个按钮并排一行 ---------- */
    .submit-row {
        flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px;
    }
    .submit-row > * { flex: 0 0 auto; }
    .field { flex: 1 1 100%; }
    .field input {
        height: 44px; padding: 0 36px 0 34px;
        /* 必须保持 ≥16px：iOS Safari 在字号小于 16px 时聚焦会自动放大整页 */
        font-size: 16px; letter-spacing: .4px;
    }
    .field-ico { left: 11px; }
    .field-clear { right: 6px; }
    .btn { width: auto; height: 44px; padding: 0 12px; font-size: 14.5px; }
    .btn-primary { flex: 1 1 0; min-width: 0; }
    /* padding-right 为右侧 help-dot 预留位置，避免文字被圆点压住 */
    .btn-magic { flex: 1 1 0; min-width: 0; padding-right: 36px; }
    .help-dot { right: 7px; width: 20px; height: 20px; font-size: 11px; }

    .hint { margin-top: 9px; padding: 8px 10px; font-size: 11.5px; line-height: 1.55; }
    /* 两个快捷按钮并排一行，不再各自占满一行 */
    .quick-row { margin-top: 9px; gap: 8px; flex-wrap: nowrap; }
    .quick-btn { flex: 1 1 0; min-width: 0; padding: 8px 6px; font-size: 12px; line-height: 1.28; }
    .fold { margin-top: 10px; padding-top: 8px; }
    .fold summary { font-size: 13px; padding: 2px 0; }
    .tips { font-size: 12.5px; line-height: 1.65; }

    /* ---------- 福利入口：2×2 网格改 4 列单行，纵向紧凑 ---------- */
    .welfare .chip { display: none; }              /* 次要说明，隐藏 */
    .welfare-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
    .w-item {
        flex-direction: column; align-items: center; gap: 4px;
        padding: 7px 3px; text-align: center;
    }
    .w-ico { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; }
    .w-info { align-items: center; text-align: center; }
    .w-info b { font-size: 11px; }
    .w-info i { font-size: 10px; line-height: 1.25; }   /* 保持 ≥10px，确保可读 */
    .w-go { display: none; }

    /* ---------- 双格入口：保持两列，文字换行避免截断 ---------- */
    .dual { grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 10px; }
    .dual-item { padding: 10px; gap: 8px; }
    .dual-emoji { font-size: 18px; }
    .dual-txt b { font-size: 12.5px; line-height: 1.3; }
    .dual-txt i { font-size: 10px; line-height: 1.3; }

    /* ---------- 瓶盖比价网入口 ---------- */
    .bj-entry { margin-bottom: 10px; padding: 10px 11px; gap: 10px; }
    .bj-ico { width: 34px; height: 34px; border-radius: 11px; }
    .bj-ico svg { width: 19px; height: 19px; }
    .bj-title { font-size: 13.5px; }
    .bj-desc { font-size: 10.5px; }
    .bj-go { font-size: 12px; }

    /* ---------- 公告栏 ---------- */
    .notice-bar { height: 40px; margin-bottom: 10px; }

    /* ---------- 列表：恢复横向排列，单条高度接近减半 ---------- */
    .list-card { padding: 12px 11px 9px; }
    .list-head { flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 8px; }
    .tabs { gap: 2px; padding: 2px; }
    .tab { flex: 1; padding: 6px 4px; font-size: 12.5px; }
    .list-tools { gap: 6px; }
    .search { height: 32px; padding: 0 8px; }
    .search input { font-size: 12.5px; }
    .sort-btn { height: 32px; padding: 0 9px; font-size: 12px; }
    .refresh-line { min-height: 16px; margin-bottom: 6px; font-size: 11.5px; gap: 6px; }

    .item {
        flex-direction: row; align-items: center; justify-content: space-between;
        gap: 10px; padding: 9px 10px; margin-bottom: 7px;
    }
    .item-main { gap: 2px; min-width: 0; overflow: hidden; }
    .item-code { gap: 6px; flex-wrap: nowrap; min-width: 0; overflow: hidden; }
    .code-num {
        font-size: 15.5px; letter-spacing: .8px; line-height: 1.25;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .badge { flex: none; padding: 1.5px 6px; font-size: 10px; }
    .item-meta { gap: 5px; font-size: 10.5px; line-height: 1.3; }
    .item-act { flex: none; justify-content: flex-end; gap: 6px; }
    .act-btn { height: 40px; padding: 0 13px; font-size: 13px; }   /* ≥40px，保证好点 */
    .act-report { height: 36px; padding: 0 10px; font-size: 12px; }
    .act-done { font-size: 12px; }

    .sk-row { height: 56px; margin-bottom: 7px; }
    .empty { padding: 24px 10px 18px; }
    .empty-emoji { font-size: 32px; }
    .empty-title { margin: 8px 0 3px; font-size: 14px; }
    .empty-sub { font-size: 12px; }
    .list-foot { margin-top: 10px; padding: 9px 11px; font-size: 11.5px; }

    /* ---------- 页脚 / 回到顶部 ---------- */
    .foot { padding: 12px 8px 0; font-size: 11px; }
    .foot p:last-child { display: none; }          /* 次要信息，隐藏 */
    .to-top { width: 40px; height: 40px; right: 12px; border-radius: 12px; }
}
@media (max-width: 380px) {
    .w-ico { width: 24px; height: 24px; font-size: 11px; }
    .w-info b { font-size: 10.5px; }
    .w-info i { font-size: 10px; }
    .bj-go-txt { display: none; }
    .bj-desc { font-size: 10px; }
    .code-num { font-size: 14.5px; letter-spacing: .2px; }
    .act-btn { padding: 0 10px; font-size: 12.5px; }
    .tab { padding: 6px 2px; font-size: 12px; }
    .sort-btn { padding: 0 7px; }
}
/* 超小屏（≤340px）：顶栏横向放不下标语，隐藏以保证品牌名与按钮完整 */
@media (max-width: 340px) {
    .topbar-slogan { display: none; }
}
/* 超小屏（≤330px）四列统计过于拥挤，退回两列 */
@media (max-width: 330px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
}

/* 无障碍：降低动效 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* =========================================================
   手机 QQ（X5 内核）性能降级
   该内核对 backdrop-filter 毛玻璃、超大模糊光斑动画及持续动画
   的渲染开销极大，会严重卡顿。通过 <html class="qq"> 仅在 QQ 内
   关闭这些特效，微信 / 普通浏览器（Blink 内核）完全不受影响。
   ========================================================= */
html.qq .orbs { display: none; }                 /* 去掉巨型模糊光斑 + 浮动动画 */
html.qq * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;     /* 关闭毛玻璃，消除滚动重绘 */
}
html.qq .topbar { background: var(--bg); }        /* 顶栏改用纯色替代毛玻璃 */
html.qq .stat,
html.qq .card,
html.qq .notice-bar,
html.qq .to-top,
html.qq .topbar-slogan {
    background: var(--surface-solid);
    box-shadow: none !important;                  /* 去掉大模糊阴影 */
}
html.qq .card { animation: none !important; }
html.qq .item.is-new { animation: none !important; }
html.qq .btn-magic::after { display: none !important; }   /* 关闭扫光无限动画 */
html.qq .notice-track { animation: none !important; }
html.qq .notice-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
html.qq .topbar-slogan .dot { animation: none !important; }
html.qq .pulse-dot { animation: none !important; }
html.qq .bj-entry::before { display: none !important; }   /* 关闭瓶盖入口流光动画 */
html.qq .sk-row { animation: none !important; }
html.qq .orb { animation: none !important; }
