/* ==================================================================
 * 活动中心页样式（活动列表 / 转盘抽奖 / 结果弹窗 / 优惠券规则说明）
 * 依赖 common.css 的 --c-* 变量；暗色模式 html[data-theme="dark"]
 * ================================================================== */

/* ---------- 布局容器 ---------- */
.act-wrap {
    max-width: 100%;
    margin: 0 auto;
    padding: 16px 16px 32px;
}
/* PC 端（≥769px）扩展到 1000px，与商城/会员中心保持一致 */
@media (min-width: 769px) {
    .act-wrap { max-width: 1000px; padding: 24px 16px 60px; }

    /* 页头放大 */
    .act-hero { padding: 32px 28px; margin-bottom: 20px; }
    .act-hero h1 { font-size: 26px; }
    .act-hero p { font-size: 14px; margin-top: 8px; }

    /* 优惠券说明：4 列铺满 */
    .act-rules { padding: 20px 24px; margin-bottom: 28px; }
    .act-rules-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }

    /* 活动卡片：2 列网格 */
    .act-section { margin-bottom: 28px; }
    .act-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    /* 转盘：多转盘并排（最多 3 列自适应） */
    #wheelList {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 16px;
    }
    .act-wheel-panel { margin-top: 0 !important; } /* 覆盖原来的兄弟选择器 */
}

/* ---------- 页头 ---------- */
.act-hero {
    background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
    border-radius: var(--radius-lg);
    color: var(--c-white);
    padding: 26px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.act-hero h1 {
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.act-hero p {
    margin-top: 6px;
    font-size: 13px;
    opacity: .88;
}

/* ---------- 优惠券规则说明 ---------- */
.act-rules {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border);
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}
.act-rules-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--c-primary);
}
.act-rules-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.act-rule-item {
    background: var(--c-bg-2);
    border-radius: var(--radius);
    padding: 12px;
}
.act-rule-item .t {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--c-text);
}
.act-rule-item .t i { color: var(--c-primary); font-size: 12px; }
.act-rule-item p {
    font-size: 12px;
    color: var(--c-text-2);
    line-height: 1.7;
}
.act-rules-link {
    margin-top: 12px;
    text-align: center;
}
.act-rules-link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--c-primary);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid var(--c-primary-light);
    border-radius: 999px;
    background: var(--c-primary-light);
    transition: opacity .15s ease;
}
.act-rules-link a:hover { opacity: .85; }

/* ---------- 区块标题 ---------- */
.act-section { margin-bottom: 24px; }
.act-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 12px;
}
.act-section-title i { color: var(--c-primary); font-size: 15px; }

/* ---------- 活动卡片 ---------- */
.act-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.act-empty {
    text-align: center;
    color: var(--c-text-3);
    font-size: 14px;
    padding: 40px 0;
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--c-border);
}
.act-card {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border);
    padding: 16px;
    box-shadow: var(--shadow);
}
.act-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.act-card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}
.act-card-desc {
    font-size: 13px;
    color: var(--c-text-2);
    margin-top: 4px;
    line-height: 1.6;
    white-space: pre-line;
}
.act-reward {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--c-primary-light);
    color: var(--c-primary-dark);
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    padding: 4px 12px;
    margin-top: 10px;
    white-space: nowrap;
}
.act-reward i { font-size: 12px; }
.act-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.act-progress {
    flex: 1 1 140px;
    min-width: 120px;
}
.act-progress-text {
    font-size: 12px;
    color: var(--c-text-3);
    margin-bottom: 4px;
}
.act-progress-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--c-bg-2);
    overflow: hidden;
}
.act-progress-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--c-primary), var(--c-primary-dark));
    transition: width .4s ease;
}
.act-claim-btn {
    appearance: none;
    border: 0;
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
    color: var(--c-white);
    font-size: 14px;
    font-weight: 600;
    border-radius: 999px;
    padding: 9px 22px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(24, 144, 255, .35);
    transition: transform .15s ease, opacity .15s ease;
}
.act-claim-btn:hover { transform: translateY(-1px); }
.act-claim-btn:active { transform: scale(.96); }
.act-claim-btn:disabled {
    background: var(--c-border);
    color: var(--c-text-3);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}
.act-card-time {
    font-size: 12px;
    color: var(--c-text-3);
    margin-top: 8px;
}

/* ---------- 转盘抽奖（多转盘并行） ---------- */
.act-wheel-panel {
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border);
    padding: 20px 16px 16px;
    box-shadow: var(--shadow);
    text-align: center;
}
/* 多个转盘面板之间的间距 */
.act-wheel-panel + .act-wheel-panel { margin-top: 16px; }

/* 转盘名称（区分不同抽奖活动） */
.act-wheel-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--c-text);
    margin-bottom: 10px;
}
.act-wheel-info {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--c-text-2);
    margin-bottom: 16px;
}
.act-wheel-info b { color: var(--c-primary); }

.act-wheel-box {
    position: relative;
    width: min(300px, 78vw);
    margin: 0 auto;
    aspect-ratio: 1;
}
.act-wheel-svg {
    width: 100%;
    height: 100%;
    display: block;
    transition: transform 4.2s cubic-bezier(.18, .78, .22, 1);
    will-change: transform;
}
.act-wheel-svg .sect-even { fill: var(--c-primary-light); }
.act-wheel-svg .sect-odd  { fill: var(--c-surface); }
.act-wheel-svg .sect-ring { fill: none; stroke: var(--c-primary); stroke-width: 3; }
.act-wheel-svg .sect-text {
    font-size: 11px;
    fill: var(--c-text);
    font-weight: 600;
}

.act-wheel-pointer {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-top: 22px solid var(--c-danger);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .2));
    z-index: 3;
}

.act-wheel-go {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 27%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 4px solid var(--c-surface);
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
    color: var(--c-white);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(24, 144, 255, .4);
    z-index: 2;
    transition: transform .15s ease;
}
.act-wheel-go:active { transform: translate(-50%, -50%) scale(.94); }
.act-wheel-go:disabled {
    background: var(--c-text-3);
    cursor: not-allowed;
    box-shadow: none;
}

.act-wheel-tip {
    margin-top: 14px;
    font-size: 12px;
    color: var(--c-text-3);
}

/* ---------- 结果弹窗 ---------- */
.act-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
}
.act-modal.show { display: block; }

.act-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    animation: actFadeIn .2s ease;
}
@keyframes actFadeIn { from { opacity: 0; } to { opacity: 1; } }

.act-modal-dialog {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(340px, calc(100vw - 48px));
    background: var(--c-surface);
    border-radius: 16px;
    padding: 28px 20px 20px;
    text-align: center;
    animation: actPop .28s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes actPop {
    from { opacity: 0; transform: translate(-50%, -46%) scale(.8); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.act-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    appearance: none;
    border: 0;
    background: transparent;
    font-size: 22px;
    color: var(--c-text-3);
    cursor: pointer;
    line-height: 1;
}

.act-result-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--c-white);
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
}
.act-result-icon.none { background: linear-gradient(135deg, #b8c0cc, #8d98a8); }
.act-result-icon i { font-size: 26px; }

.act-result-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}
.act-result-desc {
    font-size: 13px;
    color: var(--c-text-2);
    line-height: 1.7;
    margin-bottom: 18px;
    white-space: pre-line;
}
.act-result-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 999px;
    font-size: 14px;
    padding: 9px 22px;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: opacity .15s ease, transform .15s ease;
}
.act-btn:active { transform: scale(.96); }
.act-btn-primary {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
    color: var(--c-white);
    border: 0;
}
.act-btn-ghost {
    background: transparent;
    color: var(--c-text-2);
    border-color: var(--c-border);
}

/* ---------- 暗色模式 ---------- */
html[data-theme="dark"] .act-rules,
html[data-theme="dark"] .act-card,
html[data-theme="dark"] .act-wheel-panel {
    border-color: rgba(255, 255, 255, .08);
}
html[data-theme="dark"] .act-rule-item,
html[data-theme="dark"] .act-progress-bar {
    background: rgba(255, 255, 255, .05);
}
html[data-theme="dark"] .act-wheel-svg .sect-even { fill: rgba(24, 144, 255, .28); }
html[data-theme="dark"] .act-wheel-svg .sect-odd  { fill: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .act-wheel-svg .sect-text { fill: rgba(255, 255, 255, .9); }
html[data-theme="dark"] .act-claim-btn:disabled { background: rgba(255, 255, 255, .14); }

/* ---------- 移动端适配 ---------- */
@media (max-width: 600px) {
    .act-wrap { padding: 12px 12px 24px; }
    .act-hero { padding: 20px 16px; }
    .act-hero h1 { font-size: 19px; }

    .act-rules-grid { grid-template-columns: 1fr; }
    .act-rules { padding: 14px; }

    .act-card { padding: 14px; }
    .act-card-top { flex-direction: column; }
    .act-reward { margin-top: 8px; }
    .act-claim-btn { width: 100%; }

    .act-wheel-box { width: min(280px, 82vw); }
    .act-wheel-go { font-size: 16px; }
}

@media (max-width: 360px) {
    .act-hero h1 { font-size: 17px; }
    .act-section-title { font-size: 15px; }
}
