*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background: linear-gradient(135deg, #1f2933, #111827);
    color: #f9fafb;
    min-height: 100vh;
    display: block; /* 移动端整屏滚动，不用全局居中 */
}

.app-container {
    width: 100%;
    max-width: 480px; /* 以手机为主 */
    margin: 0 auto;
    padding: 12px 10px 20px;
}

.app-header {
    text-align: center;
    margin-bottom: 16px;
}

.app-header h1 {
    font-size: 24px;
    letter-spacing: 2px;
}

.app-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qr-section,
.wheel-section {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.qr-square {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    background: #ffffff; /* 白色背景，虚拟二维码在上面一点一点出现黑点 */
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.qr-square img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.qr-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 14px;
}

.qr-mask {
    position: absolute;
    inset: 0;
    display: grid;
    /* 21x21 的网格，更接近真实二维码点阵 */
    grid-template-columns: repeat(21, 1fr);
    grid-template-rows: repeat(21, 1fr);
    background: transparent;
}

.qr-cell {
    width: 100%;
    height: 100%;
    background: #ffffff; /* 默认白色格子 */
    opacity: 1;
    transition: opacity 0.25s ease-out;
}

.qr-cell.filled {
    background: #000000; /* 黑点单元格 */
}

.progress-wrapper {
    margin-top: 16px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #111827;
    overflow: hidden;
}

.progress-inner {
    height: 100%;
    width: 0;
    /* 彩色渐变进度条 */
    background: linear-gradient(90deg, #22c55e, #16a34a, #facc15, #f97316, #ef4444, #3b82f6, #22c55e);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.7);
    transition: width 0.4s ease-out;
}

.progress-text {
    margin-top: 6px;
    font-size: 13px;
    color: #e5e7eb;
    display: flex;
    justify-content: space-between;
}

.actions {
    margin-top: 16px;
    text-align: center;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 999px;
    border: none;
    outline: none;
    cursor: pointer;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(22, 163, 74, 0.4);
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, opacity 0.15s;
}

.btn-primary:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.5);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.wheel-section h2 {
    text-align: center;
    margin-bottom: 12px;
}

.wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.wheel-wrapper {
    position: relative;
    width: 82vw;
    max-width: 320px;
    aspect-ratio: 1 / 1;
}

.wheel {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #ffe4c7 0, #ffe4c7 55%, transparent 56%),
        conic-gradient(#ffedd5 0 45deg, #ffffff 45deg 90deg, #ffedd5 90deg 135deg, #ffffff 135deg 180deg, #ffedd5 180deg 225deg, #ffffff 225deg 270deg, #ffedd5 270deg 315deg, #ffffff 315deg 360deg);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wheel-inner {
    position: absolute;
    inset: 34px;
    border-radius: 50%;
    background: radial-gradient(circle at top, #f97316 0, #f97316 45%, #fb923c 70%, #f97316 100%);
    border: 4px solid rgba(255, 255, 255, 0.8);
    color: #fee2e2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    text-align: center;
    padding: 10px;
}

.wheel-prize-text {
    margin: 2px 0;
}

.wheel-pointer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -20%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-bottom: 32px solid #f97316;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.wheel-center-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    background: radial-gradient(circle at top, #ff6b3d, #f97316);
    color: #fff7ed;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 12px 28px rgba(248, 113, 113, 0.6);
    cursor: pointer;
}

.wheel-center-btn:active {
    transform: translate(-50%, -48%) scale(0.97);
}

.wheel-tip {
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
}

/* Modal 弹窗 */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
}

.modal-content {
    position: relative;
    background: #020617;
    border-radius: 16px;
    padding: 18px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
    animation: modalIn 0.28s ease-out;
}

.modal-content h3 {
    margin-bottom: 10px;
    font-size: 18px;
}

.modal-body {
    margin-bottom: 14px;
}

.modal-body img {
    width: 100%;
    border-radius: 12px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 不再区分 PC 布局，始终按手机 H5 单列排布 */
