img { max-width: 100%; display: block; }

.page { width: 100%; min-height: 100vh; display: flex; flex-direction: column; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 clamp(0.5rem, 2vw, 0.9375rem); }

/* ===== 顶部栏 ===== */
.ad-header {
    background: var(--bg-sec-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--box-shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(0.75rem, 2vw, 1rem) 0;
    min-height: 3.5rem;
}

.logo { font-size: var(--fontsize-fir); font-weight: 700; color: var(--text-color-sec); }

.header-timer {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-color-sec);
    font-size: var(--fontsize-thr);
    font-weight: 600;
    background: rgba(255,255,255,0.12);
    padding: 0.3rem 0.8rem;
    border-radius: var(--border-radius);
}

.timer-num {
    color: var(--text-color-thr);
    background: var(--text-color-sec);
    min-width: 2.2rem;
    text-align: center;
    border-radius: 0.25rem;
    padding: 0 0.3rem;
    font-weight: 700;
}

/* ===== 广告卡 ===== */
.ad-main { flex: 1; padding: clamp(0.75rem, 3vw, 1.25rem) 0; }

.ad-card {
    background: var(--bg-fir-color);
    border: var(--border-width) solid var(--border-color-fir);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.ad-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(0.5rem, 2vw, 0.75rem) clamp(0.75rem, 3vw, 1rem);
    border-bottom: var(--border-width) solid var(--border-color-fir);
    background: var(--bg-fif-color);
}

.ad-tag {
    font-size: var(--fontsize-thr);
    font-weight: 700;
    color: var(--text-color-sec);
    background: var(--text-color-thr);
    padding: 0.15rem 0.6rem;
    border-radius: 0.25rem;
}

.ad-reward-tip { font-size: var(--fontsize-thr); color: var(--bg-thr-color); font-weight: 600; }
.ad-reward-tip b { color: var(--text-color-thr); }

.ad-body { padding: clamp(0.75rem, 3vw, 1.25rem); }

.ad-image-wrap {
    position: relative;
    width: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-fif-color);
}
.ad-image-wrap img { width: 100%; height: auto; }

.ad-article { margin-top: clamp(0.75rem, 3vw, 1.25rem); }
.ad-article h2 {
    font-size: var(--fontsize-sec);
    font-weight: 700;
    margin-bottom: clamp(0.5rem, 2vw, 0.75rem);
    line-height: 1.35;
}
.ad-article p {
    font-size: var(--fontsize-thr);
    color: var(--bg-thr-color);
    line-height: 1.8;
    margin-bottom: clamp(0.75rem, 2.5vw, 1rem);
}
.ad-article img { width: 100%; border-radius: var(--border-radius); margin: clamp(0.5rem, 2vw, 0.75rem) 0; }

/* ===== 视频 ===== */
.ad-video-wrap {
    position: relative;
    width: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-sec-color);
    aspect-ratio: 16 / 9;
}
.ad-video-wrap img,
.ad-video-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }

.video-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-sec-color);
    color: var(--text-color-sec);
    font-size: var(--fontsize-thr);
    z-index: 2;
}
.video-loading b { color: var(--text-color-thr); font-weight: 700; }
.video-loading.hide { display: none; }

.loading-spinner {
    width: clamp(2rem, 8vw, 2.75rem);
    height: clamp(2rem, 8vw, 2.75rem);
    border: 0.25rem solid rgba(255,255,255,0.25);
    border-top-color: var(--text-color-thr);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.video-play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.35);
    border: none;
    cursor: pointer;
    z-index: 3;
}
.video-play-btn.hide { display: none; }

.play-icon {
    width: clamp(3rem, 12vw, 4rem);
    height: clamp(3rem, 12vw, 4rem);
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}
.play-icon::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0.7rem 0 0.7rem 1.1rem;
    border-color: transparent transparent transparent var(--text-color-fir);
    margin-left: 0.25rem;
}

/* ===== 滑动提示（兼暂停状态） ===== */
.scroll-guide {
    position: fixed;
    left: 50%;
    bottom: clamp(1rem, 5vw, 1.5rem);
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0,0,0,0.85);
    color: var(--text-color-sec);
    font-size: var(--fontsize-thr);
    font-weight: 600;
    padding: clamp(0.5rem, 2.5vw, 0.75rem) clamp(0.9rem, 4vw, 1.4rem);
    border-radius: 2rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.3);
    z-index: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.scroll-guide.show {
    opacity: 1;
    pointer-events: auto;
    animation: guideFloat 1.6s ease-in-out infinite;
}
.scroll-guide.hide { opacity: 0; transform: translateX(-50%) translateY(1rem); }
@keyframes guideFloat {
    0%, 100% { transform: translateX(-50%) translateY(-10rem); }
    50%      { transform: translateX(-50%) translateY(-10.4rem); }
}
.guide-arrow {
    display: inline-block;
    font-size: 1.1em;
    color: var(--text-color-thr);
    animation: arrowBounce 1.2s ease-in-out infinite;
}
@keyframes arrowBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(0.25rem); }
}
.scroll-guide b { color: var(--text-color-thr); font-weight: 700; }

/* 暂停状态时，给提示加个暂停标识 */
.scroll-guide.paused {
    background: rgba(0,0,0,0.92);
    border: 1px solid var(--text-color-thr);
}
.scroll-guide.paused::before {
    content: '⏸';
    color: var(--text-color-thr);
    font-size: 1.1em;
    margin-right: 0.15rem;
}

/* ===== 弹窗 ===== */
.mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: clamp(0.5rem, 2vw, 1rem);
}
.mask.active { display: flex; }

.panel {
    width: 100%;
    max-width: 30rem;
    background: var(--bg-fir-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: clamp(1rem, 4vw, 1.5rem);
    animation: panelIn 0.3s ease;
}
@keyframes panelIn {
    from { opacity: 0; transform: translateY(1rem) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.panel-title { font-size: var(--fontsize-sec); font-weight: 700; text-align: center; margin-bottom: 0.5rem; }
.panel-tip { font-size: var(--fontsize-thr); color: var(--bg-thr-color); text-align: center; margin-bottom: clamp(1rem, 3vw, 1.5rem); }

.field { margin-bottom: clamp(0.75rem, 2.5vw, 1rem); }
.field label { display: block; font-size: var(--fontsize-thr); font-weight: 600; margin-bottom: 0.35rem; }
.field select {
    width: 100%;
    padding: clamp(0.5rem, 2vw, 0.75rem) clamp(0.75rem, 3vw, 1rem);
    font-size: var(--fontsize-thr);
    border: var(--border-width) solid var(--border-color-fir);
    border-radius: var(--border-radius);
    background-color: var(--bg-fir-color);
    color: var(--text-color-fir);
    box-shadow: var(--box-shadow);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right clamp(0.75rem, 3vw, 1rem) center;
    background-size: clamp(0.75rem, 2.5vw, 1rem);
    padding-right: clamp(2.5rem, 8vw, 3rem);
    transition: var(--transition);
}
.field select:focus {
    outline: none;
    border-color: var(--text-color-thr);
    box-shadow: 0 0 0 clamp(0.125rem, 0.5vw, 0.25rem) rgba(230,0,18,0.2);
}
.field select:disabled { opacity: 0.5; cursor: not-allowed; }

.btn {
    width: 100%;
    padding: clamp(0.6rem, 2.5vw, 0.85rem);
    font-size: var(--fontsize-sec);
    font-weight: 700;
    color: var(--text-color-sec);
    background: var(--text-color-thr);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}
.btn:hover { background: var(--text-color-fou); transform: translateY(-0.125rem); box-shadow: var(--box-shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { background: var(--bg-thr-color); cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: var(--bg-fir-color); color: var(--text-color-fir); border: var(--border-width) solid var(--border-color-fir); }
.btn.ghost:hover { border-color: var(--text-color-thr); color: var(--text-color-thr); background: var(--bg-fir-color); }

/* ===== 收益弹窗 ===== */
.reward-panel {
    width: 100%;
    max-width: 22rem;
    background: var(--bg-fir-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    text-align: center;
    animation: panelIn 0.3s ease;
}
.reward-head {
    background: var(--text-color-thr);
    color: var(--text-color-sec);
    padding: clamp(1rem, 4vw, 1.5rem);
    font-size: var(--fontsize-sec);
    font-weight: 700;
}
.reward-body { padding: clamp(1rem, 4vw, 1.5rem); }
.reward-amount {
    font-size: clamp(2rem, 10vw, 2.75rem);
    font-weight: 800;
    color: var(--text-color-thr);
    margin-bottom: 0.5rem;
}
.reward-amount small { font-size: var(--fontsize-thr); font-weight: 600; }
.reward-desc { font-size: var(--fontsize-thr); color: var(--bg-thr-color); margin-bottom: clamp(1rem, 4vw, 1.5rem); }
.reward-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0 clamp(1rem, 4vw, 1.5rem) clamp(1rem, 4vw, 1.5rem);
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    left: 50%;
    bottom: 15%;
    transform: translateX(-50%) translateY(1rem);
    background: rgba(0,0,0,0.85);
    color: var(--text-color-sec);
    font-size: var(--fontsize-thr);
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius);
    z-index: 4000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    max-width: 85vw;
    text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-50%); }

@media (max-width: 480px) {
    .logo { font-size: clamp(1.25rem, 5vw, 1.5rem); }
    .header-timer { font-size: clamp(0.95rem, 3.5vw, 1.1rem); }
    .panel-title { font-size: clamp(1.25rem, 5vw, 1.5rem); }
    .reward-amount { font-size: clamp(1.75rem, 9vw, 2.25rem); }
}