/* ==========================================================================
   2026 国庆抽奖 · 样式
   配色：中国红 + 鎏金 + 米白
   ========================================================================== */

:root {
    --red: #c8102e;
    --red-dark: #8f0d1c;
    --red-deep: #6d0813;
    --red-light: #e8364f;
    --gold: #e0a83c;
    --gold-light: #f8e0a0;
    --gold-dark: #a8761f;
    --cream: #fffbf4;
    --cream-2: #fdf3e4;
    --ink: #3a2318;
    --ink-2: #6f4d3c;
    --ink-3: #9c7d6c;
    --line: #f0ddd0;
    --green: #1a7f4b;
    --radius: 18px;
    --shadow: 0 10px 34px rgba(140, 20, 35, .13);
    --shadow-sm: 0 3px 12px rgba(140, 20, 35, .08);
}

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

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
        "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
    background: #fff7ef;
    color: var(--ink);
    line-height: 1.65;
    font-size: 15px;
    overflow-x: hidden;
}

/* ---------- 背景装饰 ---------- */
.bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 8%, rgba(232, 176, 75, .34), transparent 42%),
        radial-gradient(circle at 88% 12%, rgba(232, 176, 75, .26), transparent 40%),
        radial-gradient(circle at 50% 108%, rgba(200, 16, 46, .14), transparent 55%),
        linear-gradient(170deg, #fff9f2 0%, #fff3e6 45%, #ffece2 100%);
    pointer-events: none;
}

.bg i {
    position: absolute;
    display: block;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(224, 168, 60, .5), rgba(224, 168, 60, 0) 70%);
    animation: float 9s ease-in-out infinite;
}

.bg i:nth-child(1) { width: 190px; height: 190px; top: -40px; left: -50px; animation-delay: 0s; }
.bg i:nth-child(2) { width: 130px; height: 130px; top: 22%; right: -30px; animation-delay: 2.1s; }
.bg i:nth-child(3) { width: 240px; height: 240px; bottom: 4%; left: -80px; animation-delay: 3.4s; }
.bg i:nth-child(4) { width: 110px; height: 110px; bottom: 22%; right: 6%; animation-delay: 1.2s; }

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); opacity: .75; }
    50% { transform: translateY(-18px) scale(1.07); opacity: 1; }
}

/* 金色飘带 */
.ribbon-band {
    position: fixed;
    left: -10%;
    width: 120%;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(224, 168, 60, .55), transparent);
    z-index: 0;
    pointer-events: none;
}
.ribbon-band.b1 { top: 176px; transform: rotate(-3.2deg); }
.ribbon-band.b2 { top: 210px; transform: rotate(2.4deg); opacity: .6; }

.wrap {
    position: relative;
    z-index: 1;
    max-width: 620px;
    margin: 0 auto;
    padding: 26px 16px 60px;
}

/* ---------- 头部 ---------- */
.hero {
    text-align: center;
    padding: 8px 0 20px;
    position: relative;
}

.flag-stars {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    margin-bottom: 10px;
    height: 30px;
}

.flag-stars span {
    color: var(--gold);
    text-shadow: 0 2px 6px rgba(168, 118, 31, .45);
    font-size: 17px;
    line-height: 1;
    animation: twinkle 2.6s ease-in-out infinite;
}
.flag-stars span.big { font-size: 27px; }
.flag-stars span:nth-child(2) { animation-delay: .35s; }
.flag-stars span:nth-child(3) { animation-delay: .7s; }
.flag-stars span:nth-child(4) { animation-delay: 1.05s; }

@keyframes twinkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.18) rotate(-6deg); opacity: .8; }
}

.hero h1 {
    margin: 0;
    font-size: 31px;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(180deg, #e8364f 0%, var(--red) 42%, var(--red-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 0 rgba(255, 255, 255, .85));
}

.hero .sub {
    margin: 8px 0 0;
    color: var(--ink-2);
    font-size: 13.5px;
    letter-spacing: 3px;
}

.date-badge {
    display: inline-block;
    margin-top: 12px;
    padding: 4px 16px;
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--gold-dark);
    background: linear-gradient(180deg, #fff8e6, #fdeecd);
    border: 1px solid #f0d9a5;
    box-shadow: inset 0 1px 0 #fff;
}

/* ---------- 模式切换 ---------- */
.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 22px 0 16px;
}

.tab {
    position: relative;
    appearance: none;
    border: 1.5px solid var(--line);
    background: #fff;
    border-radius: 15px;
    padding: 13px 8px 12px;
    cursor: pointer;
    font-family: inherit;
    color: var(--ink-2);
    transition: all .22s ease;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.tab b {
    display: block;
    font-size: 15.5px;
    color: var(--ink);
    font-weight: 700;
    letter-spacing: .5px;
}

.tab i {
    display: block;
    font-style: normal;
    font-size: 11.5px;
    color: var(--ink-3);
    margin-top: 3px;
}

.tab.on {
    border-color: var(--red);
    background: linear-gradient(180deg, #fff 0%, #fff5f6 100%);
    box-shadow: 0 6px 20px rgba(200, 16, 46, .16);
}

.tab.on b { color: var(--red); }
.tab.on::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 42px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(90deg, var(--gold), var(--red));
}

/* ---------- 卡片 ---------- */
.card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px 18px;
    box-shadow: var(--shadow);
    border: 1px solid #fbe9dd;
    margin-bottom: 16px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--red-dark);
    margin: 0 0 12px;
    padding-left: 10px;
    border-left: 4px solid var(--gold);
    line-height: 1.3;
}

.notice {
    display: flex;
    gap: 9px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.notice.gold {
    background: linear-gradient(135deg, #fffaf0, #fff3d9);
    border: 1px solid #f3dfae;
    color: #7d5a15;
}

.notice.red {
    background: linear-gradient(135deg, #fff5f6, #ffecef);
    border: 1px solid #f8d3da;
    color: #a31128;
}

.notice .ico { flex: 0 0 auto; font-size: 15px; line-height: 1.7; }

/* ---------- 转盘 ---------- */
.wheel-stage {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 4px auto 6px;
    aspect-ratio: 1 / 1;
}

.wheel-glow {
    position: absolute;
    inset: -6%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(224, 168, 60, .3), rgba(224, 168, 60, 0) 68%);
    animation: pulse 3.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: .75; }
    50% { transform: scale(1.06); opacity: 1; }
}

#wheel-1,
#wheel-2 {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(0deg);
    /* 旋转由 JS 逐帧驱动（见 spinTo），这里不使用 transition，避免两套动画打架 */
    filter: drop-shadow(0 10px 24px rgba(140, 20, 35, .22));
    will-change: transform;
    backface-visibility: hidden;
}

#wheel-1 svg,
#wheel-2 svg { display: block; width: 100%; height: 100%; }

/* 中奖扇区高亮 */
#wheel-1 path.seg,
#wheel-2 path.seg {
    transition: filter .25s ease;
}

#wheel-1 path.seg.hit,
#wheel-2 path.seg.hit {
    animation: seghit .9s ease-in-out 3;
}

@keyframes seghit {
    0%, 100% { stroke: #ffd66b; stroke-width: 3; }
    50% { stroke: #fff6d8; stroke-width: 5.5; }
}

/* 灯泡：转动时跑马灯，停下时连闪 */
.bulb {
    opacity: .6;
    transition: opacity .2s linear;
}

.wheel-stage.running .bulb {
    animation: bulbchase .5s linear infinite;
    animation-delay: var(--d, 0ms);
}

@keyframes bulbchase {
    0%, 100% { opacity: .28; }
    45% { opacity: 1; }
}

.wheel-stage.hit .bulb {
    animation: bulbflash .32s ease-in-out 5;
    animation-delay: calc(var(--d, 0ms) * .45);
}

@keyframes bulbflash {
    0%, 100% { opacity: .5; }
    50% { opacity: 1; }
}

/* 停下瞬间整体轻微弹跳 */
.wheel-stage.hit {
    animation: stagepop .55s cubic-bezier(.2, 1.4, .4, 1);
}

@keyframes stagepop {
    0% { transform: scale(1); }
    38% { transform: scale(1.028); }
    100% { transform: scale(1); }
}

/* 转动时中心按钮呼吸 */
.wheel-stage.running .hub {
    animation: hubpulse .62s ease-in-out infinite;
}

@keyframes hubpulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(140, 20, 35, .3), inset 0 -3px 8px rgba(120, 80, 0, .3), 0 0 0 0 rgba(255, 214, 107, .55); }
    50% { box-shadow: 0 4px 16px rgba(140, 20, 35, .3), inset 0 -3px 8px rgba(120, 80, 0, .3), 0 0 0 14px rgba(255, 214, 107, 0); }
}

/* 音效开关 */
.sound-toggle {
    position: absolute;
    right: -2px;
    bottom: -2px;
    z-index: 6;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid rgba(224, 168, 60, .55);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 4px 12px rgba(140, 20, 35, .16);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: transform .18s ease, box-shadow .18s ease;
}

.sound-toggle:active {
    transform: scale(.92);
    box-shadow: 0 2px 6px rgba(140, 20, 35, .2);
}

/* 撒金片层 */
#gq-fx {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 60;
}

.gq-confetti {
    position: absolute;
    top: 0;
    display: block;
    border-radius: 2px;
    will-change: transform;
}

.pointer {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 52px;
    z-index: 4;
    filter: drop-shadow(0 3px 6px rgba(140, 20, 35, .35));
    transform-origin: 50% 36%;
}

.hub {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 27%;
    height: 27%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #fff6dd, var(--gold) 52%, var(--gold-dark) 100%);
    border: 3px solid #fff;
    box-shadow: 0 4px 16px rgba(140, 20, 35, .3), inset 0 -3px 8px rgba(120, 80, 0, .3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    font-size: 15px;
    font-weight: 800;
    color: #6b3f06;
    letter-spacing: 1px;
    text-align: center;
    line-height: 1.15;
}

/* ---------- 按钮 ---------- */
.btn {
    display: block;
    width: 100%;
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 15px 20px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 3px;
    font-family: inherit;
    color: #fff9ec;
    background: linear-gradient(180deg, var(--red-light) 0%, var(--red) 46%, var(--red-dark) 100%);
    box-shadow: 0 8px 22px rgba(200, 16, 46, .34), inset 0 1px 0 rgba(255, 255, 255, .3);
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, filter .2s;
    position: relative;
    overflow: hidden;
}

.btn:active { transform: translateY(2px) scale(.99); box-shadow: 0 4px 14px rgba(200, 16, 46, .3); }

.btn:disabled {
    filter: grayscale(.55) brightness(1.06);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn.gold {
    color: #5c3405;
    background: linear-gradient(180deg, #ffeec0 0%, var(--gold) 50%, var(--gold-dark) 100%);
    box-shadow: 0 8px 22px rgba(168, 118, 31, .32), inset 0 1px 0 rgba(255, 255, 255, .6);
}

.btn.ghost {
    background: #fff;
    color: var(--red);
    border: 1.5px solid #f3c6ce;
    box-shadow: none;
    font-size: 15px;
    letter-spacing: 1px;
    padding: 12px 18px;
}

.btn.sm { width: auto; display: inline-block; padding: 9px 22px; font-size: 14px; letter-spacing: 1px; }

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .42), transparent);
    transform: skewX(-20deg);
    animation: shine 3.4s ease-in-out infinite;
}

@keyframes shine {
    0% { left: -60%; }
    55%, 100% { left: 130%; }
}

.btn:disabled::after { display: none; }

/* ---------- 输入框 ---------- */
.field { margin-bottom: 14px; }

.field label {
    display: block;
    font-size: 13px;
    color: var(--ink-2);
    margin-bottom: 6px;
    font-weight: 600;
}

.input {
    width: 100%;
    appearance: none;
    border: 1.5px solid var(--line);
    background: #fffdfa;
    border-radius: 12px;
    padding: 13px 15px;
    font-size: 15px;
    font-family: inherit;
    color: var(--ink);
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

.input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(224, 168, 60, .16);
}

.input::placeholder { color: #c4ab9c; }

textarea.input { resize: vertical; min-height: 62px; }

/* ---------- 奖品列表 ---------- */
.prize-list { display: grid; gap: 9px; }

.prize-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    border-radius: 13px;
    background: linear-gradient(135deg, #fffaf3, #fff5e9);
    border: 1px solid #f6e6d3;
}

.prize-row.win { border-color: #f3dcae; background: linear-gradient(135deg, #fffaf0, #fff2d8); }

.prize-icon {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #fff;
    border: 1px solid #f5e2cd;
}

.prize-main { flex: 1; min-width: 0; }

.prize-name { font-size: 14.5px; font-weight: 700; color: var(--ink); }

.prize-desc { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

.prize-meta { flex: 0 0 auto; text-align: right; }

.prize-ratio {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--red);
    font-variant-numeric: tabular-nums;
}

.prize-stock { font-size: 11px; color: var(--ink-3); margin-top: 1px; }

.badge-left {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10.5px;
    background: #ffe9ec;
    color: var(--red);
    border: 1px solid #f8cfd7;
    margin-left: 5px;
    vertical-align: 1px;
}

/* ---------- 条款 ---------- */
.terms {
    font-size: 12.5px;
    color: var(--ink-2);
    background: #fffaf3;
    border: 1px dashed #efdcc6;
    border-radius: 12px;
    padding: 13px 15px;
    margin-top: 14px;
}

.terms b { color: var(--red-dark); }

.terms ul { margin: 7px 0 0; padding-left: 18px; }
.terms li { margin-bottom: 4px; }

/* ---------- 已参与状态 ---------- */
.result-box {
    text-align: center;
    padding: 20px 14px;
    border-radius: 15px;
    background: linear-gradient(160deg, #fff8f9, #fff1f3);
    border: 1px solid #f7d8de;
}

.result-box .big { font-size: 21px; font-weight: 800; color: var(--red); margin: 8px 0 4px; }

.result-box .line2 { font-size: 13px; color: var(--ink-2); }

.tick {
    width: 52px;
    height: 52px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(180deg, #fff0f2, #ffe0e5);
    border: 2px solid #f6c9d1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--red);
}

/* ---------- 弹窗 ---------- */
.mask {
    position: fixed;
    inset: 0;
    background: rgba(60, 16, 24, .58);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mask.show { display: flex; animation: fadein .25s ease; }

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.modal {
    width: 100%;
    max-width: 400px;
    max-height: 88vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-radius: 22px;
    padding: 26px 22px 22px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(80, 12, 24, .38);
    border-top: 5px solid var(--gold);
    animation: pop .4s cubic-bezier(.2, 1.3, .4, 1);
    position: relative;
}

@keyframes pop {
    from { transform: scale(.82) translateY(16px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal h3 {
    margin: 0 0 4px;
    font-size: 20px;
    color: var(--red);
    letter-spacing: 1px;
}

.modal .mtip { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; }

.modal .prize-name-big {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 1px;
    margin: 12px 0 6px;
    background: linear-gradient(180deg, #e8364f, var(--red-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal .prize-name-big.lose {
    font-size: 24px;
    background: linear-gradient(180deg, #a08a7d, #6f5a4e);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal .mdesc { font-size: 13.5px; color: var(--ink-2); line-height: 1.8; }

.modal .form-area { margin-top: 18px; text-align: left; }

.medal {
    width: 76px;
    height: 76px;
    margin: 0 auto 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background: radial-gradient(circle at 34% 28%, #fff8dd, var(--gold-light) 44%, var(--gold) 100%);
    border: 3px solid #fff;
    box-shadow: 0 8px 22px rgba(168, 118, 31, .35);
    animation: medalpop .6s cubic-bezier(.2, 1.4, .4, 1);
}

@keyframes medalpop {
    0% { transform: scale(.3) rotate(-24deg); opacity: 0; }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.alert {
    padding: 10px 13px;
    border-radius: 10px;
    font-size: 13px;
    margin-top: 12px;
    text-align: left;
    line-height: 1.7;
}
.alert.err { background: #fff2f4; border: 1px solid #f7ccd4; color: #a31128; }
.alert.ok { background: #f1fbf5; border: 1px solid #c4e8d3; color: var(--green); }
.alert.info { background: #fff9ec; border: 1px solid #f2e0b8; color: #7d5a15; }

.grant-info {
    margin-top: 14px;
    padding: 13px 15px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f2fbf6, #e9f8f0);
    border: 1px solid #c9e9d8;
    text-align: left;
    font-size: 13px;
    color: #14663c;
    line-height: 1.8;
}

.grant-info b { color: #0d5230; }

/* ---------- 加载 ---------- */
.spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    vertical-align: -2px;
    margin-right: 7px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* ---------- 页脚 ---------- */
.foot {
    text-align: center;
    font-size: 11.5px;
    color: var(--ink-3);
    margin-top: 26px;
    line-height: 1.9;
    padding-bottom: 10px;
}

.foot .sep {
    display: block;
    width: 46px;
    height: 2px;
    margin: 0 auto 12px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ---------- 小屏适配 ---------- */
@media (max-width: 420px) {
    .wrap { padding: 18px 12px 48px; }
    .hero h1 { font-size: 26px; }
    .card { padding: 17px 14px; }
    .btn { font-size: 16px; letter-spacing: 2px; padding: 14px 16px; }
    .tab b { font-size: 14.5px; }
    .modal { padding: 22px 17px 18px; }
    .prize-ratio { font-size: 12.5px; }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .2s !important;
    }
}
