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

:root {
    --primary-color: #10b981;
    --secondary-color: #059669;
    --accent-color: #34d399;
    --text-dark: #1f2937;
    --text-gray: #4b5563;
    --text-light: #9ca3af;
    --bg-white: #ffffff;
    --bg-gray: #f9fafb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --shield-gradient-start: #10b981;
    --shield-gradient-end: #059669;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 50%, #a7f3d0 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom);
    overflow-x: hidden;
    position: relative;
}

/* 背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 100%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    left: -15%;
    width: 60%;
    height: 80%;
    background: radial-gradient(circle, rgba(5, 150, 105, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 48px 38px;
    box-shadow: 
        0 25px 70px rgba(16, 185, 129, 0.15),
        0 10px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
    width: 100%;
    max-width: 500px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(16, 185, 129, 0.1);
}

/* 盾牌图标区域 */
.icon-wrapper {
    width: 110px;
    height: 110px;
    margin: 0 auto 32px;
    background: linear-gradient(135deg, var(--shield-gradient-start) 0%, var(--shield-gradient-end) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: shieldPulse 2.5s ease-in-out infinite;
    box-shadow: 
        0 15px 40px rgba(16, 185, 129, 0.35),
        0 5px 15px rgba(16, 185, 129, 0.25);
    position: relative;
}

.icon-wrapper::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    opacity: 0.3;
    animation: ringRotate 8s linear infinite;
    z-index: -1;
}

@keyframes ringRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.icon-wrapper svg {
    width: 55px;
    height: 55px;
    fill: white;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}

@keyframes shieldPulse {
    0%, 100% { 
        transform: translateY(0px) scale(1); 
        box-shadow: 
            0 15px 40px rgba(16, 185, 129, 0.35),
            0 5px 15px rgba(16, 185, 129, 0.25);
    }
    50% { 
        transform: translateY(-6px) scale(1.03); 
        box-shadow: 
            0 20px 50px rgba(16, 185, 129, 0.45),
            0 8px 20px rgba(16, 185, 129, 0.35);
    }
}

/* 扫描动画 */
.scan-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    transform: translate(-50%, -50%);
    animation: scanMove 2s ease-in-out infinite;
}

@keyframes scanMove {
    0%, 100% { 
        top: 20%; 
        opacity: 0;
    }
    50% { 
        top: 80%; 
        opacity: 1;
    }
}

/* 标题 */
h1 {
    font-size: clamp(26px, 5.5vw, 32px);
    color: var(--text-dark);
    margin-bottom: 14px;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

h1::before {
    content: '🛡️';
    font-size: clamp(24px, 5vw, 30px);
}

/* 描述文字 */
.description {
    color: var(--text-gray);
    font-size: clamp(14px, 3.5vw, 16px);
    line-height: 1.7;
    margin-bottom: 32px;
    padding: 0 8px;
}

/* 检测状态区域 */
.check-section {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-radius: 18px;
    padding: 28px 26px;
    margin-bottom: 28px;
    position: relative;
    border: 2px solid rgba(16, 185, 129, 0.15);
    overflow: hidden;
}

.check-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--primary-color));
    background-size: 200% 100%;
    animation: gradientSlide 3s ease infinite;
}

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

.status-label {
    font-size: clamp(15px, 3.5vw, 17px);
    color: var(--text-gray);
    margin-bottom: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.status-icon {
    display: inline-block;
    animation: spin 1.5s linear infinite;
}

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

.countdown-number {
    font-size: clamp(44px, 11vw, 60px);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.countdown-number::after {
    content: '秒';
    font-size: clamp(14px, 3vw, 18px);
    font-weight: 600;
    color: var(--text-gray);
    -webkit-text-fill-color: var(--text-gray);
    margin-left: 4px;
}

/* 进度条 */
.progress-container {
    width: 100%;
    height: 10px;
    background: rgba(16, 185, 129, 0.12);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--primary-color));
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.15s linear;
    border-radius: 5px;
    position: relative;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
    animation: progressGradient 2s ease infinite;
}

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

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.5),
        transparent
    );
    animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 检测项列表 */
.check-list {
    margin-top: 22px;
    text-align: left;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: clamp(13px, 3vw, 15px);
    color: var(--text-gray);
    opacity: 0.4;
    transition: all 0.4s ease;
}

.check-item.active {
    opacity: 1;
    color: var(--success-color);
    font-weight: 600;
}

.check-item.completed {
    opacity: 1;
    color: var(--text-dark);
}

.check-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* 状态消息 */
.status-message {
    color: var(--success-color);
    font-size: clamp(14px, 3.2vw, 16px);
    margin-top: 20px;
    font-weight: 700;
    display: none;
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 12px 20px;
    background: rgba(16, 185, 129, 0.08);
    border-radius: 25px;
}

.status-message.is-visible {
    display: inline-block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 操作按钮 */
.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 300px;
    padding: 16px 36px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: clamp(16px, 3.6vw, 18px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 8px 25px rgba(16, 185, 129, 0.4),
        0 4px 12px rgba(16, 185, 129, 0.3);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
    letter-spacing: 0.3px;
}

.action-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.35),
        transparent
    );
    transition: left 0.5s;
}

.action-button:hover::before {
    left: 100%;
}

.action-button:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(16, 185, 129, 0.5),
        0 6px 18px rgba(16, 185, 129, 0.4);
}

.action-button:active {
    transform: translateY(-1px);
    box-shadow: 
        0 8px 28px rgba(16, 185, 129, 0.45),
        0 4px 14px rgba(16, 185, 129, 0.35);
}

/* 底部提示 */
.footer-text {
    margin-top: 28px;
    font-size: clamp(12px, 2.8vw, 14px);
    color: var(--text-light);
    line-height: 1.6;
}

/* 安全标识 */
.security-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(5, 150, 105, 0.06));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 25px;
    font-size: clamp(12px, 2.6vw, 14px);
    color: var(--primary-color);
    font-weight: 600;
}

.security-badge svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ==================== 响应式设计 ==================== */

/* 大屏幕 PC 端 (≥1200px) */
@media screen and (min-width: 1200px) {
    body {
        padding: 50px;
    }
    
    .container {
        padding: 58px 55px;
        max-width: 540px;
    }

    .icon-wrapper {
        width: 120px;
        height: 120px;
    }

    .icon-wrapper svg {
        width: 60px;
        height: 60px;
    }
}

/* 平板设备 (768px - 1199px) */
@media screen and (min-width: 768px) and (max-width: 1199px) {
    body {
        padding: 35px;
    }
    
    .container {
        padding: 52px 45px;
    }
}

/* 手机竖屏 (<768px) */
@media screen and (max-width: 767px) {
    body {
        padding: 18px;
        padding-top: calc(18px + env(safe-area-inset-top));
        padding-bottom: calc(18px + env(safe-area-inset-bottom));
        align-items: flex-start;
        padding-top: 7vh;
    }
    
    .container {
        padding: 38px 26px;
        border-radius: 20px;
    }

    .icon-wrapper {
        width: 95px;
        height: 95px;
        margin-bottom: 28px;
    }

    .icon-wrapper svg {
        width: 48px;
        height: 48px;
    }

    .check-section {
        padding: 24px 22px;
        margin-bottom: 24px;
    }

    .action-button {
        max-width: 100%;
        padding: 15px 32px;
    }
}

/* 超小屏幕手机 (<375px) */
@media screen and (max-width: 374px) {
    body {
        padding: 14px;
    }
    
    .container {
        padding: 30px 20px;
        border-radius: 16px;
    }

    h1 {
        font-size: 23px;
    }

    .countdown-number {
        font-size: 40px;
    }

    .check-section {
        padding: 20px 18px;
    }
}

/* 横屏模式 */
@media screen and (orientation: landscape) and (max-height: 550px) {
    body {
        padding: 18px;
        align-items: center;
    }
    
    .container {
        padding: 28px 32px;
    }

    .icon-wrapper {
        width: 75px;
        height: 75px;
        margin-bottom: 20px;
    }

    .icon-wrapper svg {
        width: 37px;
        height: 37px;
    }

    h1 {
        font-size: 22px;
        margin-bottom: 10px;
    }

    .description {
        margin-bottom: 22px;
        font-size: 13px;
    }

    .check-section {
        padding: 20px 22px;
        margin-bottom: 20px;
    }

    .countdown-number {
        font-size: 38px;
        margin-bottom: 14px;
    }

    .check-list {
        display: none; /* 横屏时隐藏检测项列表以节省空间 */
    }

    .footer-text {
        margin-top: 18px;
    }

    .security-badge {
        margin-top: 12px;
        padding: 8px 16px;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .container {
        box-shadow: 
            0 25px 70px rgba(16, 185, 129, 0.12),
            0 10px 30px rgba(0, 0, 0, 0.06);
    }
    
    .icon-wrapper {
        box-shadow: 
            0 15px 40px rgba(16, 185, 129, 0.3),
            0 5px 15px rgba(16, 185, 129, 0.2);
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .action-button {
        min-height: 52px;
    }
    
    .action-button:hover {
        transform: none;
    }
    
    .action-button:active {
        transform: scale(0.98);
    }
}

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

/* 打印样式 */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

.btn-spin {
    animation: btnSpin 1s linear infinite;
}

@keyframes btnSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

#wechat-mask {
    padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}

#wechat-mask > div {
    max-width: min(360px, calc(100vw - 32px));
    margin: max(24px, env(safe-area-inset-top, 0px)) auto 0;
}