/* 开场故事样式 - 进一步减小字体，确保完全适屏 */
#story-intro {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    padding: 20px 10px; /* 减少内边距 */
}

#story-intro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="white" opacity="0.3"/><circle cx="80" cy="40" r="0.5" fill="white" opacity="0.4"/><circle cx="40" cy="80" r="0.8" fill="white" opacity="0.2"/><circle cx="90" cy="90" r="0.3" fill="white" opacity="0.5"/><circle cx="10" cy="60" r="0.6" fill="white" opacity="0.3"/><circle cx="70" cy="10" r="0.4" fill="white" opacity="0.5"/></svg>') repeat;
    animation: starField 30s linear infinite;
    opacity: 0.6;
}

@keyframes starField {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-100px) translateX(-50px); }
}

.story-container {
    position: relative;
    z-index: 1;
    max-width: 650px; /* 进一步减小容器 */
    width: 100%;
    padding: 25px 20px; /* 减少内边距 */
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.ghost-particle {
    position: relative;
    width: 80px; /* 进一步减小 */
    height: 80px;
    margin: 0 auto 20px; /* 减少下边距 */
}

.particle-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(173, 216, 230, 0.6), rgba(135, 206, 250, 0.3), transparent);
    border-radius: 50%;
    animation: ghostGlow 4s ease-in-out infinite;
    filter: blur(2px);
}

.particle-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem; /* 减小粒子图标 */
    animation: ghostFloat 5s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(173, 216, 230, 0.8));
}

@keyframes ghostGlow {
    0%, 100% { 
        transform: scale(1); 
        opacity: 0.4; 
    }
    50% { 
        transform: scale(1.3); 
        opacity: 0.8; 
    }
}

@keyframes ghostFloat {
    0%, 100% { 
        transform: translate(-50%, -50%) translateY(0) rotate(0deg); 
    }
    25% { 
        transform: translate(-50%, -50%) translateY(-10px) rotate(2deg); 
    }
    75% { 
        transform: translate(-50%, -50%) translateY(-5px) rotate(-2deg); 
    }
}

.story-text {
    line-height: 1.5; /* 减小行高 */
}

.story-text h1 {
    font-size: 1.8rem; /* 进一步减小标题 */
    font-weight: 700;
    margin-bottom: 20px; /* 减少边距 */
    color: #FFD700; /* 使用纯金黄色替代渐变 */
    text-shadow: 3px 3px 8px rgba(0,0,0,0.7), 0 0 15px rgba(255, 215, 0, 0.5);
    /* 移除渐变背景文字效果，增强文字阴影效果 */
    position: relative;
}

.story-text h1::after {
    content: '';
    position: absolute;
    bottom: -10px; /* 减小距离 */
    left: 50%;
    transform: translateX(-50%);
    width: 80px; /* 减小宽度 */
    height: 2px; /* 减小高度 */
    background: linear-gradient(90deg, transparent, #ffd700, transparent);
    border-radius: 2px;
}

.story-paragraph {
    font-size: 0.95rem; /* 进一步减小正文字体 */
    line-height: 1.4; /* 减小行高 */
    margin-bottom: 12px; /* 减少下边距 */
    color: rgba(255, 255, 255, 0.95);
    animation: fadeInUp 1s ease-out forwards;
    opacity: 0;
    padding: 0 8px; /* 减少内边距 */
    position: relative;
}

.story-paragraph::before {
    content: '✨';
    position: absolute;
    left: -5px; /* 调整位置 */
    top: 0;
    opacity: 0.6;
    animation: sparkle 3s ease-in-out infinite;
    font-size: 0.9rem; /* 减小装饰图标 */
}

.story-paragraph:nth-child(2) { animation-delay: 0.2s; }
.story-paragraph:nth-child(2)::before { animation-delay: 0.3s; }

.story-paragraph:nth-child(3) { animation-delay: 0.4s; }
.story-paragraph:nth-child(3)::before { animation-delay: 0.6s; }

.story-paragraph:nth-child(4) { animation-delay: 0.6s; }
.story-paragraph:nth-child(4)::before { animation-delay: 0.9s; }

.story-paragraph:nth-child(5) { animation-delay: 0.8s; }
.story-paragraph:nth-child(5)::before { animation-delay: 1.2s; }

.story-paragraph:nth-child(6) { animation-delay: 1.0s; }
.story-paragraph:nth-child(6)::before { animation-delay: 1.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sparkle {
    0%, 100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 0.6; 
    }
    50% { 
        transform: scale(1.1) rotate(180deg); /* 减小缩放 */
        opacity: 1; 
    }
}

.start-journey-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24, #ff9ff3);
    color: white;
    border: none;
    padding: 12px 30px; /* 减小按钮 */
    border-radius: 25px;
    font-size: 1.1rem; /* 减小字体 */
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px; /* 减少上边距 */
    transition: all 0.4s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1s ease-out 1.0s both;
}

.start-journey-btn::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 ease;
}

.start-journey-btn:hover {
    transform: translateY(-3px) scale(1.03); /* 减小悬停效果 */
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.6);
}

.start-journey-btn:hover::before {
    left: 100%;
}

.start-journey-btn:active {
    transform: translateY(-1px) scale(1.01);
}

/* 粒子状态显示 */
.particle-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.particle-icon {
    font-size: 1.5rem;
    position: relative;
    transform: translateY(6px);
    animation: ghostBob 3s ease-in-out infinite;
}

.collected-papers {
    font-size: 1rem;
}

/* 纸条指示器 */
.paper-indicator {
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 2rem;
    opacity: 0;
    transform: scale(0);
    transition: all 0.4s ease;
    z-index: 10;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.paper-indicator.collected {
    opacity: 1;
    transform: scale(1);
    animation: paperFloat 3s ease-in-out infinite;
}

@keyframes paperFloat {
    0%, 100% { 
        transform: scale(1) translateY(0) rotate(0deg); 
    }
    50% { 
        transform: scale(1.15) translateY(-8px) rotate(5deg); 
    }
}

/* 游戏操作按钮 */
.game-actions {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin: 40px 0;
    flex-wrap: wrap;
}

.puzzle-btn, .papers-btn {
    background: linear-gradient(135deg, #4ecdc4, #44a08d, #2c3e50);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.3);
    position: relative;
    overflow: hidden;
}

.puzzle-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
    transform: none !important;
}

.puzzle-btn:not(:disabled):hover, .papers-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(78, 205, 196, 0.5);
}

.puzzle-btn::before, .papers-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.puzzle-btn:hover::before, .papers-btn:hover::before {
    left: 100%;
}

/* 响应式设计 - 进一步优化 */
@media (max-width: 768px) {
    .story-text h1 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .story-paragraph {
        font-size: 0.9rem;
        line-height: 1.3;
        margin-bottom: 10px;
    }
    
    .ghost-particle {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
    }
    
    .particle-core {
        font-size: 3rem;
    }
    
    .start-journey-btn {
        padding: 12px 28px;
        font-size: 1.1rem;
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    #story-intro {
        padding: 15px 5px;
    }
    
    .story-text h1 {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }
    
    .story-paragraph {
        font-size: 0.85rem;
        line-height: 1.25;
        margin-bottom: 8px;
    }
    
    .ghost-particle {
        width: 70px;
        height: 70px;
        margin-bottom: 15px;
    }
    
    .particle-core {
        font-size: 2.5rem;
    }
    
    .start-journey-btn {
        padding: 10px 25px;
        font-size: 1rem;
        margin-top: 15px;
    }
    
    .particle-status {
        padding: 12px 20px;
        gap: 15px;
    }
    
    .particle-icon {
        font-size: 1.5rem;
        position: relative;
        transform: translateY(6px);
        animation: ghostBob 3s ease-in-out infinite;
    }
    
    .collected-papers {
        font-size: 1rem;
    }
}

/* 其余样式保持不变... */
/* 纸条查看页面等其他样式继续保持原来的设计 */

/* 解谜系统样式 - 智能提示版本 */

.puzzle-interface {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 15px;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.puzzle-header {
    text-align: center;
    margin-bottom: 30px;
}

.puzzle-header h2 {
    font-size: 2rem;
    color: #ffd700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.puzzle-description {
    font-size: 1.1rem;
    color: #e0e0e0;
    margin-bottom: 0;
}

.papers-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.paper-item {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    border: 2px solid rgba(255,215,0,0.3);
    transition: all 0.3s ease;
}

.paper-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255,215,0,0.6);
    box-shadow: 0 5px 15px rgba(255,215,0,0.2);
}

.paper-item h3 {
    color: #ffd700;
    margin-bottom: 10px;
    font-size: 1rem;
}

.paper-content {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    color: #ffffff;
    background: rgba(0,0,0,0.3);
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    letter-spacing: 2px;
}

.puzzle-input-section {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.attempts-counter {
    text-align: center;
    font-size: 1rem;
    color: #e0e0e0;
    margin-bottom: 15px;
    padding: 8px;
    border-radius: 20px;
    background: rgba(0,0,0,0.2);
}

.attempts-counter.warning {
    color: #ff6b6b;
    background: rgba(255,107,107,0.1);
    border: 1px solid rgba(255,107,107,0.3);
}

/* 提示样式 */
.hint-section {
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
    animation: fadeIn 0.5s ease-in;
}

.subtle-hint {
    background: rgba(100,149,237,0.1);
    border-color: #6495ed;
    color: #87ceeb;
}

.mild-hint {
    background: rgba(255,165,0,0.1);
    border-color: #ffa500;
    color: #ffd700;
}

.direct-hint {
    background: rgba(50,205,50,0.1);
    border-color: #32cd32;
    color: #90ee90;
}

.hint-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.hint-section p {
    margin: 5px 0;
    line-height: 1.4;
}

.hint-section strong {
    color: #ffd700;
}

.input-group {
    text-align: center;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #ffd700;
}

#spell-input {
    width: 70%;
    max-width: 400px;
    padding: 12px 15px;
    font-size: 1.1rem;
    border: 2px solid rgba(255,215,0,0.3);
    border-radius: 25px;
    background: rgba(255,255,255,0.1);
    color: white;
    text-align: center;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

#spell-input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255,215,0,0.3);
    background: rgba(255,255,255,0.15);
}

#spell-input::placeholder {
    color: rgba(255,255,255,0.5);
}

.submit-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,107,107,0.4);
}

/* 胜利界面样式 */
.victory-screen {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    position: relative;
    overflow: hidden;
}

.victory-title {
    font-size: 3rem;
    color: #ffd700;
    margin-bottom: 30px;
    animation: bounceIn 1s ease-out;
}

.spell-revelation {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    border: 2px solid #ffd700;
}

.spell-text {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    color: #ffd700;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.spell-meaning {
    font-size: 1.2rem;
    color: #e0e0e0;
    font-style: italic;
}

/* 醒来界面样式 */
.awakening-screen {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    padding: 40px 20px;
    border-radius: 15px;
    color: white;
    text-align: center;
}

.reveal-title {
    font-size: 2.5rem;
    color: #ffd700;
    margin-bottom: 30px;
}

.fade-in-text {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
    margin: 15px 0;
    font-size: 1.1rem;
}

.teacher-voice {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 20px 0;
    padding: 10px;
    background: rgba(231,76,60,0.1);
    border-radius: 5px;
}

.realization {
    color: #f39c12;
    font-weight: bold;
    font-size: 1.3rem;
    margin: 25px 0;
}

.final-message {
    margin: 40px 0;
    padding: 30px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
}

.knowledge-summary {
    text-align: left;
    max-width: 400px;
    margin: 20px auto;
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 10px;
}

.knowledge-summary li {
    margin: 8px 0;
    font-size: 1.1rem;
}

.encouragement {
    color: #2ecc71;
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: 20px;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes ghostBob {
    0%, 100% { 
        transform: translateY(6px); 
    }
    50% { 
        transform: translateY(-1px); 
    }
}

/* 按钮样式 */
.continue-btn, .restart-btn, .main-menu-btn, .back-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.continue-btn:hover, .restart-btn:hover, .main-menu-btn:hover, .back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

.final-buttons {
    margin-top: 30px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .puzzle-interface {
        padding: 15px;
        margin: 10px;
    }
    
    .papers-display {
        grid-template-columns: 1fr;
    }
    
    .victory-title {
        font-size: 2rem;
    }
    
    .spell-text {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
    
    #spell-input {
        width: 90%;
        margin-bottom: 10px;
    }
    
    .submit-btn {
        margin-left: 0;
        margin-top: 10px;
    }
} 