/* ============================================
   真人验证系统 - 响应式样式
   适配PC端 / 手机端 / 平板端
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "微软雅黑", sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
}

/* ---------- Container ---------- */
.verify-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    animation: fadeInUp 0.4s ease-out;
}

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

/* ---------- Header ---------- */
.verify-header {
    text-align: center;
    padding: 32px 24px 20px;
    background: #fafbff;
    border-bottom: 1px solid #f0f0f5;
}

.shield-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.verify-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.verify-header .subtitle {
    font-size: 14px;
    color: #888;
    line-height: 1.5;
}

/* ---------- Verify Box ---------- */
.verify-box {
    padding: 28px 24px;
    position: relative;
}

/* ---------- Prompt ---------- */
.verify-prompt {
    text-align: center;
    font-size: 18px;
    color: #555;
    margin-bottom: 24px;
    line-height: 1.8;
    padding: 12px;
    background: #f8f9ff;
    border-radius: 10px;
    border: 1px dashed #d0d5f0;
}

.target-text {
    display: inline-block;
    color: #e74c3c;
    font-size: 26px;
    font-weight: 900;
    padding: 2px 10px;
    background: #fff5f5;
    border-radius: 6px;
    border: 2px solid #e74c3c;
    margin: 0 4px;
    vertical-align: middle;
}

/* ---------- Character Options ---------- */
.char-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

.char-btn {
    flex: 0 0 calc(50% - 6px);
    max-width: calc(50% - 6px);
    min-width: 80px;
    height: 72px;
    font-size: 28px;
    font-weight: 700;
    font-family: "Microsoft YaHei", "微软雅黑", "STSong", serif;
    color: #333;
    background: #ffffff;
    border: 2px solid #dde;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.char-btn:hover {
    border-color: #667eea;
    background: #f5f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.char-btn:active {
    transform: scale(0.96);
    background: #eef0ff;
}

.char-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.char-btn.correct {
    border-color: #27ae60;
    background: #eafaf1;
    color: #27ae60;
    animation: pulse 0.3s ease;
}

.char-btn.wrong {
    border-color: #e74c3c;
    background: #fdedec;
    animation: shake 0.4s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* ---------- Status ---------- */
.verify-status {
    text-align: center;
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.remain-info strong {
    color: #e74c3c;
    font-weight: 700;
}

.countdown-info strong {
    color: #667eea;
    font-weight: 700;
    transition: color 0.5s ease;
}

/* 倒计时紧急状态 */
.countdown-info.urgent strong {
    color: #e74c3c;
}

/* ---------- Message Bar ---------- */
.verify-message {
    text-align: center;
    padding: 10px;
    margin-top: 8px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    display: none;
}

.verify-message.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.verify-message.error {
    background: #fdedec;
    color: #c0392b;
}

.verify-message.success {
    background: #eafaf1;
    color: #27ae60;
}

/* ---------- Loading Overlay ---------- */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-bottom: 12px;
}

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

.loading-overlay span {
    font-size: 14px;
    color: #666;
}

/* ---------- Footer ---------- */
.verify-footer {
    text-align: center;
    padding: 16px 24px;
    background: #fafbff;
    border-top: 1px solid #f0f0f5;
}

.verify-footer p {
    font-size: 12px;
    color: #aaa;
    line-height: 1.5;
}

/* ============================================
   响应式适配
   ============================================ */

/* 平板端 (768px 以下) */
@media (max-width: 768px) {
    .verify-container {
        max-width: 400px;
    }
}

/* 手机端 (480px 以下) */
@media (max-width: 480px) {
    body {
        padding: 12px;
        align-items: flex-start;
        padding-top: 30px;
    }

    .verify-container {
        max-width: 100%;
        border-radius: 12px;
    }

    .verify-header {
        padding: 24px 16px 16px;
    }

    .shield-icon {
        font-size: 36px;
    }

    .verify-header h1 {
        font-size: 20px;
    }

    .verify-header .subtitle {
        font-size: 13px;
    }

    .verify-box {
        padding: 20px 16px;
    }

    .verify-prompt {
        font-size: 16px;
        padding: 10px;
    }

    .target-text {
        font-size: 22px;
    }

    .char-btn {
        height: 64px;
        font-size: 24px;
        border-radius: 10px;
    }

    .char-options {
        gap: 10px;
    }

    .verify-footer {
        padding: 12px 16px;
    }

    .verify-footer p {
        font-size: 11px;
    }
}

/* 超小屏 (360px 以下) */
@media (max-width: 360px) {
    .char-btn {
        height: 56px;
        font-size: 22px;
    }

    .verify-prompt {
        font-size: 15px;
    }

    .target-text {
        font-size: 20px;
    }
}
