/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
                 "Microsoft YaHei", "Source Han Sans CN", sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #ffe9d6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

input, button {
    font-family: inherit;
    outline: none;
    border: none;
    background: none;
}

button {
    cursor: pointer;
}

ol, ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

/* ========== 页面容器 ========== */
.page {
    position: relative;
    width: 100%;
    max-width: 750px;
    min-height: 100vh;
    margin: 0 auto;
    background-color: #fff4ea;
    overflow: hidden;
    padding-bottom: 24px;
}

/* ========== Banner ========== */
.banner {
    position: relative;
    width: 100%;
    line-height: 0;
}

.banner-img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* 活动规则按钮 */
.rule-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    padding: 0 14px;
    border-radius: 15px;
    background: rgba(255, 90, 60, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.7);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(255, 60, 30, 0.35);
    animation: rulePulse 2.5s ease-in-out infinite;
    transition: transform 0.15s ease, background 0.15s ease;
    z-index: 5;
}

@keyframes rulePulse {
    0%, 100% {
        box-shadow: 0 2px 12px rgba(255, 60, 30, 0.35);
    }
    50% {
        box-shadow: 0 2px 22px rgba(255, 60, 30, 0.55), 0 0 0 6px rgba(255, 255, 255, 0.12);
    }
}

.rule-btn:active {
    transform: scale(0.96);
    background: rgba(255, 70, 40, 0.9);
}

.rule-icon {
    display: inline-flex;
    align-items: center;
}

/* ========== 主体内容 ========== */
.content {
    position: relative;
    z-index: 2;
    margin-top: 14px;
    padding: 0 14px 0;
}

/* ========== 三个功能入口 ========== */
.action-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(255, 90, 60, 0.12);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.action-item {
    position: relative;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
    transition: transform 0.18s ease;
}

.action-item:active {
    transform: translateY(2px);
}

.action-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.action-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
}

.action-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.action-desc {
    font-size: 11px;
    opacity: 0.92;
    line-height: 1.3;
}

.action-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    margin-top: auto;
}

/* ========== 中奖名单（垂直滚动卡片） ========== */
.winner-card {
    margin-top: 12px;
    background: #ffffff;
    border-radius: 18px;
    padding: 14px 16px 12px;
    box-shadow: 0 6px 20px rgba(255, 120, 60, 0.08);
}

.winner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
}

.winner-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.winner-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
}

.winner-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.winner-title-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
}

.winner-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.15;
    letter-spacing: 0.3px;
}

.winner-subtitle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #9a9a9a;
    line-height: 1.2;
}

.winner-subtitle::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff5a3c;
    box-shadow: 0 0 0 0 rgba(255, 90, 60, 0.45);
    animation: winnerPulse 1.4s ease-out infinite;
}

@keyframes winnerPulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 90, 60, 0.45); }
    70%  { box-shadow: 0 0 0 7px rgba(255, 90, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 90, 60, 0); }
}

/* 可视区 */
.winner-viewport {
    position: relative;
    height: 132px;
    overflow: hidden;
}

/* 上下渐变遮罩：用伪元素替代 mask-image，避免移动端长时动画下 mask 周期性重绘导致的闪烁 */
.winner-viewport::before,
.winner-viewport::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 18px;
    pointer-events: none;
    z-index: 2;
}

.winner-viewport::before {
    top: 0;
    background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0));
}

.winner-viewport::after {
    bottom: 0;
    background: linear-gradient(0deg, #ffffff, rgba(255, 255, 255, 0));
}

.winner-track {
    list-style: none;
    margin: 0;
    padding: 0;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.winner-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 4px;
    font-size: 17px;
    line-height: 1;
}

.winner-item .w-name {
    color: #333;
    font-weight: 600;
    flex-shrink: 0;
}

.winner-item .w-phone {
    color: #999;
    font-size: 14px;
    flex-shrink: 0;
}

.winner-item .w-action {
    color: #888;
    font-size: 14px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.winner-item .w-prize {
    color: #ff5a3c;
    font-weight: 700;
    font-size: 17px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #fff5ec, #ffe4d0);
    padding: 4px 10px;
    border-radius: 10px;
    border: 1px solid #ffd9bf;
}

/* 跑马灯骨架占位（独立 overlay，不影响 track 滚动） */
.winner-skeleton-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    pointer-events: none;
    opacity: 1;
    transition: opacity 220ms ease;
}

.winner-skeleton-overlay.is-hidden {
    opacity: 0;
}

.winner-skeleton {
    pointer-events: none;
}

.w-skeleton-bar {
    display: inline-block;
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e6e6e6 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: winnerSkeletonShimmer 1.4s ease infinite;
}

.w-skeleton-bar--name   { width: 56px; }
.w-skeleton-bar--phone  { width: 92px; }
.w-skeleton-bar--action { flex: 1; min-width: 0; height: 12px; }
.w-skeleton-bar--prize  { width: 64px; height: 22px; border-radius: 10px; }

@keyframes winnerSkeletonShimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ========== KOA 问答 ========== */
.koa-card {
    margin-top: 12px;
    background: #ffffff;
    border-radius: 18px;
    padding: 14px 16px 6px;
    box-shadow: 0 6px 20px rgba(255, 120, 60, 0.08);
}

.koa-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 12px;
}

.koa-logo {
    height: 44px;
    width: auto;
    max-width: 60%;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.koa-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #9a9a9a;
    flex-shrink: 0;
    padding-left: 8px;
}

.koa-more-text {
    line-height: 1;
}

.koa-more-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffb18a 0%, #ff7a47 100%);
    box-shadow: 0 2px 4px rgba(255, 122, 71, 0.3);
}

/* QA 列表 */
.qa-list {
    padding: 0;
}

.qa-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 4px;
    border-top: 1px solid #f1f1f1;
    transition: background 0.15s ease;
}

.qa-item:first-child {
    border-top: 1px solid #f1f1f1;
}

.qa-item:active {
    background: #fafafa;
}

.qa-tag {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff7a5c, #ff5a3c);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    line-height: 22px;
    box-shadow: 0 1px 3px rgba(255, 90, 60, 0.35);
}

.qa-text {
    flex: 1;
    font-size: 17px;
    color: #333;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qa-chevron {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* ========== 底部 ========== */
.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 22px 0 8px;
    color: #c0c0c0;
    font-size: 12px;
}

.footer-icon {
    display: inline-flex;
    align-items: center;
}

/* ========== 弹窗 ========== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.modal-box {
    position: relative;
    width: 86%;
    max-width: 360px;
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 18px 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    animation: popIn 0.22s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 12px;
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #333;
}

.modal-close {
    position: absolute;
    right: -4px;
    top: -4px;
    padding: 4px;
}

.modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 4px;
    margin-bottom: 14px;
}

.modal-rules {
    counter-reset: rule;
    padding: 0;
}

.modal-rules li {
    position: relative;
    padding-left: 22px;
    font-size: 13px;
    color: #555;
    line-height: 1.7;
    counter-increment: rule;
    margin-bottom: 6px;
}

.modal-rules li::before {
    content: counter(rule);
    position: absolute;
    left: 0;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff7a47, #ff5a3c);
    color: #ffffff;
    font-size: 11px;
    text-align: center;
    line-height: 16px;
    font-weight: 700;
}

.modal-confirm {
    display: block;
    width: 100%;
    height: 42px;
    line-height: 42px;
    text-align: center;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    border-radius: 21px;
    background: linear-gradient(90deg, #ff7a47 0%, #ff5a3c 100%);
    box-shadow: 0 6px 14px rgba(255, 110, 70, 0.32);
}

.modal-confirm:active {
    transform: scale(0.98);
}

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

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.78);
    color: #ffffff;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: 8px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    max-width: 80%;
    text-align: center;
}

.toast.show {
    opacity: 1;
}

[hidden] {
    display: none !important;
}

/* ========== 响应式适配 ========== */
@media (max-width: 360px) {
    .content {
        padding: 0 10px;
    }

    .action-card {
        padding: 5px;
        border-radius: 16px;
    }

    .action-grid {
        gap: 5px;
    }

    .action-item {
        border-radius: 10px;
    }

    .koa-card {
        padding: 12px 12px 4px;
    }

    .koa-logo {
        height: 38px;
    }

    .koa-more {
        font-size: 12px;
    }

    .qa-text {
        font-size: 15px;
    }

    .winner-card {
        padding: 12px 12px 10px;
    }

    .winner-icon {
        width: 52px;
        height: 52px;
    }

    .winner-title {
        font-size: 15px;
    }

    .winner-subtitle {
        font-size: 11px;
    }

    .winner-viewport {
        height: 120px;
    }

    .winner-item {
        height: 42px;
        font-size: 14px;
        gap: 8px;
    }

    .winner-item .w-phone {
        font-size: 13px;
    }

    .winner-item .w-prize {
        font-size: 14px;
        padding: 3px 8px;
    }
}

@media (min-width: 480px) {
    .content {
        margin-top: -6px;
        padding: 0 18px;
    }

    .action-card {
        padding: 8px;
    }

    .action-grid {
        gap: 8px;
    }

    .action-item {
        border-radius: 14px;
    }
}

@media (min-width: 750px) {
    .page {
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
    }

    .content {
        margin-top: -22px;
        padding: 0 24px;
    }

    .action-card {
        padding: 10px;
        border-radius: 22px;
    }

    .action-grid {
        gap: 10px;
    }

    .action-item {
        border-radius: 16px;
    }

    .koa-card {
        padding: 18px 20px 8px;
        border-radius: 22px;
    }

    .koa-logo {
        height: 54px;
    }

    .koa-more {
        font-size: 14px;
    }

    .koa-more-arrow {
        width: 22px;
        height: 22px;
    }

    .qa-item {
        padding: 16px 4px;
    }

    .qa-text {
        font-size: 18px;
    }

    .qa-tag {
        width: 24px;
        height: 24px;
        line-height: 24px;
        font-size: 14px;
    }

    .rule-btn {
        top: 18px;
        right: 18px;
        height: 34px;
        padding: 0 16px;
        border-radius: 17px;
        font-size: 14px;
    }

    .winner-card {
        padding: 18px 20px 14px;
        border-radius: 22px;
    }

    .winner-icon {
        width: 52px;
        height: 52px;
    }

    .winner-title {
        font-size: 19px;
    }

    .winner-subtitle {
        font-size: 13px;
    }

    .winner-viewport {
        height: 156px;
    }

    .winner-item {
        height: 54px;
        font-size: 17px;
    }

    .winner-item .w-phone {
        font-size: 14px;
    }

    .winner-item .w-prize {
        font-size: 16px;
        padding: 5px 12px;
    }
}

/* ========== 全屏加载页 ========== */
.page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    transition: opacity 0.4s ease;
}

.page-loader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    height: 150px;
}

.letters {
    display: flex;
    gap: 8px;
    font-size: 20px;
}

.letters span {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    font-weight: bold;
    color: #ff0000;
    background-color: #ffe0e0;
    border-radius: 6px;
    min-width: 30px;
    height: 40px;
    animation: peek 1s both infinite;
    animation-delay: var(--d);
}

@keyframes peek {
    25% {
        transform: rotateX(30deg) rotate(-13deg);
    }
    50% {
        transform: translateY(-22px) rotate(3deg) scale(1.1);
        color: #cc0000;
    }
}

.progress-bar {
    width: 300px;
    height: 4px;
    background-color: #ffe0e0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-inner {
    height: 100%;
    background-color: #ff0000;
    border-radius: 2px;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        width: 0%;
    }
    50% {
        width: 100%;
    }
    100% {
        width: 100%;
    }
}

.support-text {
    font-size: 12px;
    color: #000000;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

/* 加载页打开时禁止页面滚动 */
body.is-loading {
    overflow: hidden;
}
