/* style.css */
body {
    /* 移除原有的背景色 */
    /* background-color: #f8f9fa; */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 添加背景图片 */
    background-image: url('https://img.kexig.cn/bing/api.php?random=1');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.card {
    border: none;
    border-radius: 20px; /* 增加圆角 */
    transition: all 0.3s ease;
    overflow: hidden;
    /* 降低透明度 */
    background-color: rgba(255, 255, 255, 0.7);
    /* 添加 backdrop-filter 增强效果 */
    backdrop-filter: blur(5px);
}

.card:hover {
    transform: translateY(-5px); /* 卡片悬停上浮效果 */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1); /* 增强阴影 */
}

.card-header {
    border-radius: 20px 20px 0 0 !important;
    background: linear-gradient(135deg, #007bff, #0056b3); /* 渐变背景 */
    padding: 1.5rem;
    border: none;
}

.card-header h2 {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.card-body {
    padding: 2rem;
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control {
    border-radius: 12px; /* 增加输入框圆角 */
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1); /* 焦点发光效果 */
    outline: none;
}

.form-control:hover {
    border-color: #007bff;
}

.btn {
    border-radius: 12px; /* 增加按钮圆角 */
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #545b62;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(108, 117, 125, 0.3);
}

/* 按钮点击波纹效果 */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.result-area {
    /* 增强透明效果 */
    background-color: rgba(255, 255, 255, 0);
    /* 增强玻璃模糊效果 */
    backdrop-filter: blur(8px);
    /* 增加圆角使其更圆润 */
    border-radius: 20px;
    /* 移除边框黑线 */
    border: none;
    /* 添加柔和阴影增强UI */
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
    /* 保持其他现有样式 */
    transition: all 0.5s ease-in-out;
    opacity: 0;
    transform: translateY(20px);
    padding: 1.5rem;
}

/* 优化显示动画 */
.result-area.show {
    opacity: 1;
    transform: translateY(0);
    /* 添加微妙的缩放效果 */
    transform: scale(1.02);
}

/* 优化验证码信息内的文本样式 */
.result-area h4 {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
    text-align: center;
}

.result-area .d-flex {
    margin-bottom: 0.75rem;
}

.result-area strong {
    color: #2b6cb0;
    font-weight: 600;
}

.result-area.show {
    opacity: 1;
    transform: translateY(0);
}

.result-area h4 {
    font-weight: 600;
    color: #495057;
    margin-bottom: 1.5rem;
}

.progress {
    border-radius: 10px; /* 增加进度条圆角 */
    height: 12px;
    overflow: hidden;
    background-color: #e9ecef;
}

#countdownBar {
    transition: width 1s linear, background-color 0.3s ease;
    border-radius: 10px;
}

/* 优化倒计时条不同状态的颜色 */
#countdownBar.bg-success {
    background: linear-gradient(90deg, #28a745, #20c997);
}

#countdownBar.bg-warning {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

#countdownBar.bg-danger {
    background: linear-gradient(90deg, #dc3545, #e83e8c);
}

.expired {
    color: #dc3545;
    font-weight: bold;
}

/* 过期提示脉动动画 */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

/* 调整倒计时文本样式 */
#countdownText {
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 500;
}

/* 验证码显示样式优化 */
#codeDisplay {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    letter-spacing: 2px;
    color: #007bff;
}

/* 统计区样式 */
.stat-container {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 25%, #fad0c4 50%, #a18cd1 75%, #fbc2eb 100%);
    background-size: 400% 400%;
    color: #333;
    text-align: center;
    border-radius: 50px; /* 高圆润度 */
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: block;
    width: fit-content;
    padding: 0.5rem 1.5rem; /* 垂直内边距减少，仅比文字高度多一点 */
    animation: gradientMove 8s ease infinite, pulse 3s infinite;
    margin: 0 auto; /* 左右居中 */
}

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

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    }
    100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
}

.stat-container:hover {
    transform: scale(1.05); /* 鼠标悬停放大 */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    animation: gradientMove 8s ease infinite; /* 悬停时保留渐变动画 */
}

.stat-text {
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
}

#otpCount {
    font-weight: bold;
    color: #fff;
    margin: 0 5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.stat-container:hover #otpCount {
    transform: scale(1.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.stat-container:hover .stat-value {
    transform: scale(1.05);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.countdown-container {
    background-color: transparent !important;
}

/* 确保过期提示也不会影响背景 */
#countdownText {
    background-color: transparent !important;
}