/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: all 0.3s ease;
}

.container {
    width: 100%;
    max-width: 500px;
    animation: slideInUp 0.8s ease-out;
}

/* 玻璃态卡片 */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 
        0 8px 32px rgba(31, 38, 135, 0.37),
        0 2px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.6s ease;
}

.glass-card:hover::before {
    left: 100%;
}

/* 标题样式 */
h1 {
    text-align: center;
    color: #fff;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #fff, #e3f2fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    color: #fff;
    text-align: center;
    margin-bottom: 25px;
    font-weight: 300;
    opacity: 0.9;
}

h3 {
    color: #fff;
    margin-bottom: 15px;
    font-weight: 400;
}

/* 输入框组 */
.input-group {
    margin-bottom: 25px;
    position: relative;
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    backdrop-filter: blur(5px);
}

input[type="text"]:focus,
input[type="number"]:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* 按钮样式 */
.btn-primary, .btn-secondary, .btn-download {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    color: #fff;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover, .btn-secondary:hover, .btn-download:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.2));
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn-primary:active, .btn-secondary:active, .btn-download:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.3), rgba(255, 193, 7, 0.1));
}

.btn-download.local {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(76, 175, 80, 0.1));
    animation: pulseGreen 2s infinite;
}

.btn-download.no-injection {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.3), rgba(33, 150, 243, 0.1));
    animation: pulseBlue 2s infinite;
}

/* 错误消息 */
.error-message {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.2), rgba(244, 67, 54, 0.1));
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
    color: #fff;
    text-align: center;
    animation: shake 0.5s ease-in-out;
    backdrop-filter: blur(10px);
}

/* 验证过程样式 */
.verification-process {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(76, 175, 80, 0.05));
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 15px;
    padding: 30px;
    margin: 25px 0;
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
    backdrop-filter: blur(10px);
}

.verification-animation {
    margin-bottom: 25px;
}

.verification-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #4CAF50;
    animation: dotPulse 1.4s ease-in-out infinite both;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

.verification-code {
    font-family: 'Courier New', monospace;
    font-size: 22px;
    font-weight: bold;
    color: #4CAF50;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    animation: codeGlow 2s ease-in-out infinite;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.countdown {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 15px;
    font-weight: 300;
}

/* 数学题样式 */
.math-problem {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#math-question {
    font-size: 18px;
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.math-input-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0;
}

.math-input-group input {
    flex: 1;
    margin-right: 0;
}

.math-input-group .btn-secondary {
    width: auto;
    min-width: 120px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.math-input-group .btn-secondary:hover {
    transform: rotate(5deg);
}

/* 滑块验证容器 - 科技感风格（宽版） */
.slider-verify {
    margin: 25px 0;
    background: rgba(16, 20, 34, 0.7);
    border-radius: 12px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(64, 224, 208, 0.3);
    box-shadow: 0 0 20px rgba(64, 224, 208, 0.1);
}

.slider-container {
    position: relative;
    margin-top: 15px;
}

.slider-track {
    width: 100%;
    height: 22px; /* 增加高度 */
    background: rgba(30, 35, 50, 0.8);
    border-radius: 11px; /* 圆角相应增加 */
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid rgba(64, 224, 208, 0.2);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.slider-track::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(64, 224, 208, 0.3), 
        transparent);
    animation: techGlow 2s infinite;
}

.slider-thumb {
    position: absolute;
    top: -14px; /* 调整位置，因为滑块高度增加了 */
    left: 0;
    width: 50px; /* 增加宽度 */
    height: 50px; /* 增加高度 */
    background: linear-gradient(135deg, #40E0D0, #20B2AA);
    border-radius: 50%;
    cursor: grab;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 15px rgba(64, 224, 208, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.slider-thumb::after {
    content: '';
    width: 16px; /* 相应增大内部圆点 */
    height: 16px; /* 相应增大内部圆点 */
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.slider-thumb.verifying {
    background: linear-gradient(135deg, #00FF7F, #00CC66);
    transform: scale(1.1);
    box-shadow: 
        0 0 20px rgba(0, 255, 127, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    animation: pulse 1s infinite;
}

.slider-thumb.verifying::after {
    content: '✓';
    background: transparent;
    color: white;
    font-size: 12px; /* 相应增大图标 */
    box-shadow: none;
}

.slider-text {
    text-align: center;
    color: #40E0D0;
    margin-top: 15px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-weight: 400;
    text-shadow: 0 0 10px rgba(64, 224, 208, 0.5);
    letter-spacing: 1px;
}

.slider-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(64, 224, 208, 0.4), 
        rgba(0, 255, 127, 0.7));
    border-radius: 11px; /* 圆角相应增加 */
    width: 0;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px rgba(64, 224, 208, 0.5);
}

@keyframes techGlow {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(0, 255, 127, 0.8),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(0, 255, 127, 1),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
}

/* 下载按钮区域 */
.download-buttons {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-download {
    position: relative;
    overflow: hidden;
    padding: 18px 25px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.4s ease;
}

.btn-download::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.btn-download:hover::before {
    left: 100%;
}

.btn-download:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* 帮助链接样式 */
.help-section {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.help-section:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.help-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.help-section:hover::before {
    left: 100%;
}

.help-icon {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #FF9800, #F57C00);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    margin-right: 12px;
    box-shadow: 0 4px 10px rgba(255, 152, 0, 0.3);
    animation: helpPulse 2s infinite;
}

.help-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin: 0;
    text-align: center;
}

.help-link {
    color: #4FC3F7;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 2px 4px;
    border-radius: 4px;
}

.help-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #4FC3F7;
    transition: width 0.3s ease;
}

.help-link:hover {
    color: #29B6F6;
    background: rgba(79, 195, 247, 0.1);
}

.help-link:hover::after {
    width: 100%;
}

/* 动画效果 */
@keyframes helpPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 10px rgba(255, 152, 0, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 15px rgba(255, 152, 0, 0.5);
    }
}

/* 响应式调整 */
@media (max-width: 480px) {
    .help-section {
        flex-direction: column;
        text-align: center;
        padding: 12px;
    }
    
    .help-icon {
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .help-text {
        font-size: 13px;
    }
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
    animation: overlayFadeIn 0.4s ease-out;
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid #3498db;
    border-right: 4px solid #3498db;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    animation: spin 1.2s linear infinite;
    box-shadow: 0 0 30px rgba(52, 152, 219, 0.5);
}

.loading-text {
    color: #fff;
    margin-top: 20px;
    font-size: 18px;
    animation: textPulse 2s ease-in-out infinite;
    font-weight: 300;
    letter-spacing: 1px;
}

/* 按钮加载状态 */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    top: 50%;
    left: 50%;
    margin-left: -12px;
    margin-top: -12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 动画定义 */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
        box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
    }
    40% {
        transform: scale(1.3);
        opacity: 1;
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.8);
    }
}

@keyframes codeGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(76, 175, 80, 0.8);
        transform: scale(1.02);
    }
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(15px);
    }
}

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

@keyframes spin {
    0% { 
        transform: rotate(0deg); 
    }
    100% { 
        transform: rotate(360deg); 
    }
}

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

@keyframes pulseGreen {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(76, 175, 80, 0.6);
    }
}

@keyframes pulseBlue {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(33, 150, 243, 0.6);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 响应式优化 */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .glass-card {
        padding: 30px 20px;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .math-input-group {
        flex-direction: column;
    }
    
    .math-input-group .btn-secondary {
        width: 100%;
        min-width: auto;
    }
    
    .download-buttons {
        gap: 12px;
    }
    
    .btn-download {
        padding: 16px 20px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .glass-card {
        padding: 25px 15px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    h2 {
        font-size: 1.3em;
    }
    
    input[type="text"],
    input[type="number"] {
        padding: 12px 15px;
    }
    
    .btn-primary, .btn-secondary, .btn-download {
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .verification-process {
        padding: 20px 15px;
    }
    
    .verification-code {
        font-size: 18px;
        padding: 12px;
    }
}

/* 滚动条样式优化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}