/* 基础设置 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: #0a0a0f;
    min-height: 100vh;
    overflow-x: hidden;
    color: #e2e8f0;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

.animated-bg {
    position: fixed;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, #0a0a0f, #1a0a2e, #0a1a2e, #0a0a0f);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    z-index: -1;
}

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

/* 玻璃拟态 */
.glass-card {
    background: rgba(20, 20, 35, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    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.05), transparent);
    transition: left 0.7s;
}

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

/* 霓虹边框 */
.neon-border { position: relative; }

.neon-border::after {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(45deg, #ff00ff, #00ffff, #ff00ff, #00ffff);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: neonGlow 3s ease infinite;
    opacity: 0;
    transition: opacity 0.3s;
}

.neon-border:hover::after { opacity: 1; }

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

/* ====== 新增：闪烁标题样式 ====== */
.shining-title {
    background: linear-gradient(90deg, #fff, #a78bfa, #ec4899, #fff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shining-text-anim 3s linear infinite;
    text-shadow: 0 0 20px rgba(167, 139, 250, 0.3);
}

@keyframes shining-text-anim {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* 副标题风格 */
.styled-subtitle {
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

/* 浮动动画 */
.emoji-float {
    display: inline-block;
    animation: emojiFloat 3s ease-in-out infinite;
}

@keyframes emojiFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(5deg); }
    75% { transform: translateY(5px) rotate(-5deg); }
}

/* 选项卡片 */
.option-item {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.option-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.option-item:hover::before { transform: translateX(100%); }

.option-item:hover {
    transform: translateX(10px) scale(1.02);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.option-item.selected {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
    border-color: #a78bfa;
    transform: scale(1.02);
}

/* 进度条 */
.progress-bar {
    background: linear-gradient(90deg, #8b5cf6, #ec4899, #8b5cf6);
    background-size: 200% 100%;
    animation: progressGradient 2s linear infinite;
    transition: width 0.5s ease-out;
}

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

/* 浮动装饰 */
.floating-decoration {
    position: absolute;
    pointer-events: none;
    font-size: 2rem;
    opacity: 0.3;
    animation: floatAround 10s ease-in-out infinite;
}

@keyframes floatAround {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, -30px) rotate(90deg); }
    50% { transform: translate(-10px, -60px) rotate(180deg); }
    75% { transform: translate(-30px, -30px) rotate(270deg); }
}

/* 结果卡片动画 */
.result-card {
    opacity: 0;
    transform: translateY(30px);
    animation: slideInUp 0.6s forwards;
}

@keyframes slideInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* 脉冲效果 */
.pulse-effect { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 弹跳效果 */
.bounce-effect { animation: bounce 1s infinite; }

@keyframes bounce {
    0%, 100% { transform: translateY(-5%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
    50% { transform: translateY(0); animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}

/* 渐变文字 */
.gradient-text {
    background: linear-gradient(135deg, #fff 0%, #a78bfa 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 星星评分 */
.star-rating { color: #fbbf24; text-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #8b5cf6, #ec4899); border-radius: 4px; }

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(139, 92, 246, 0.3);
    border-top: 4px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    color: #e2e8f0;
    font-size: 18px;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* 页面切换动画 */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.page-transition-exit {
    opacity: 1;
}

.page-transition-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 题目切换动画 */
.question-enter {
    opacity: 0;
    transform: translateX(30px);
}

.question-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.question-exit {
    opacity: 1;
    transform: translateX(0);
}

.question-exit-active {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .text-4xl { font-size: 2rem; }
    .text-5xl { font-size: 2.5rem; }
    .text-6xl { font-size: 3rem; }
    
    .grid-cols-3 { grid-template-columns: 1fr; }
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    
    .github-corner {
        display: none;
    }
    
    /* 触控优化 */
    button {
        min-height: 48px;
        touch-action: manipulation;
    }
    
    .option-item {
        min-height: 56px;
    }
}

@media (max-width: 640px) {
    .glass-card { padding: 1rem; }
    .text-4xl { font-size: 1.75rem; }
    .text-5xl { font-size: 2rem; }
    .text-6xl { font-size: 2.5rem; }
    
    .grid-cols-2 { grid-template-columns: 1fr; }
    
    #question-container {
        padding: 1rem;
    }
    
    .floating-decoration {
        font-size: 1.5rem;
    }
    
    .test-mode-card {
        padding: 1.5rem;
    }
    
    /* 底部导航优化 */
    #test-page .flex.justify-between {
        gap: 1rem;
    }
    
    #test-page button {
        flex: 1;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .text-4xl { font-size: 1.5rem; }
    .text-5xl { font-size: 1.75rem; }
    .text-6xl { font-size: 2rem; }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .option-item {
        padding: 1rem;
        min-height: 64px;
    }
    
    .option-item .flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .option-item .w-10 {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    /* 进度条优化 */
    .progress-bar {
        height: 3px;
    }
    
    /* 保存按钮优化 */
    #test-page .glass-card.px-4 {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
}

/* 横竖屏切换处理 */
@media (orientation: landscape) {
    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    #question-container {
        max-height: 60vh;
        overflow-y: auto;
    }
}

@media (orientation: portrait) {
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 触控反馈 */
@media (hover: none) and (pointer: coarse) {
    button:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    .option-item:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .test-mode-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* ====== 新增：右下角点赞提示样式 ====== */
.github-corner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.github-corner:hover {
    opacity: 1;
    transform: translateY(-5px) scale(1.05);
}

.github-link {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(30, 30, 40, 0.9);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.github-link i {
    font-size: 24px;
    color: #fff;
}

.github-text {
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.4;
    text-align: left;
}

.github-text b {
    color: #fbbf24;
    font-weight: bold;
}

/* 响应式隐藏点赞提示 */
@media (max-width: 768px) {
    .github-corner {
        display: none;
    }
}
