* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header h1 {
    font-size: 2.5em;
    color: #4a5568;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
    font-size: 1.2em;
    color: #718096;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.voice-input-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.voice-button-container {
    margin-bottom: 30px;
}

.voice-button {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
}

.voice-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(255, 107, 107, 0.4);
}

.voice-button:active {
    transform: scale(0.95);
}

.voice-button.recording {
    background: linear-gradient(135deg, #ff4757, #ff3838);
    animation: pulse 1.5s infinite;
}

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

.mic-icon {
    font-size: 2em;
}

.button-text {
    font-size: 0.9em;
    font-weight: bold;
}

.voice-status {
    font-size: 1.1em;
    color: #4a5568;
    margin-top: 15px;
    font-weight: 500;
}

.recognition-result {
    background: rgba(72, 187, 120, 0.1);
    padding: 25px;
    border-radius: 15px;
    border-left: 5px solid #48bb78;
    margin-top: 20px;
}

.recognition-result h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.recognition-result p {
    font-size: 1.1em;
    color: #4a5568;
    margin-bottom: 20px;
    line-height: 1.6;
}

.generate-btn {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(72, 187, 120, 0.4);
}

.test-btn {
    background: linear-gradient(135deg, #9f7aea, #667eea);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(159, 122, 234, 0.3);
}

.test-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(159, 122, 234, 0.4);
}

.story-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.story-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.story-header h2 {
    color: #2d3748;
    font-size: 1.8em;
}

.play-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.play-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.story-content {
    font-size: 1.1em;
    line-height: 1.8;
    color: #2d3748;
    margin-bottom: 25px;
    white-space: pre-wrap;
    background: rgba(247, 250, 252, 0.8);
    padding: 25px;
    border-radius: 15px;
    border-left: 5px solid #667eea;
}

.story-controls {
    text-align: center;
}

.new-story-btn {
    background: linear-gradient(135deg, #feca57, #ff9ff3);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(254, 202, 87, 0.3);
}

.new-story-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(254, 202, 87, 0.4);
}

/* 旧的loading样式已被fun-loading替代 */

.fun-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    text-align: center;
    box-sizing: border-box;
    padding: 20px;
}

.loading-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 50px;
    border-radius: 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    max-width: 400px;
    width: 90%;
    margin: 0 auto;
    transform: translateZ(0);
}

.loading-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
    z-index: 1;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.loading-character {
    font-size: 4em;
    margin-bottom: 20px;
    display: inline-block;
    animation: bounce 2s infinite;
    position: relative;
    z-index: 2;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.loading-character.hop {
    animation: hop 1.5s infinite;
}

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

.loading-character.spin {
    animation: characterSpin 2s infinite;
}

@keyframes characterSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

.loading-character.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(2deg); }
    66% { transform: translateY(-5px) rotate(-2deg); }
}

.loading-character.wiggle {
    animation: wiggle 1s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.loading-animation {
    height: 60px;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

/* 星星动画 */
.loading-animation.stars {
    position: relative;
}

.loading-animation.stars::before,
.loading-animation.stars::after {
    content: '⭐';
    position: absolute;
    font-size: 1.5em;
    animation: twinkle 1.5s infinite;
}

.loading-animation.stars::before {
    left: 20%;
    animation-delay: 0s;
}

.loading-animation.stars::after {
    right: 20%;
    animation-delay: 0.75s;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* 彩虹动画 */
.loading-animation.rainbow {
    background: linear-gradient(45deg, #ff6b6b, #feca57, #48bb78, #667eea, #9f7aea);
    background-size: 300% 300%;
    height: 10px;
    border-radius: 10px;
    animation: rainbowMove 2s ease-in-out infinite;
}

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

/* 泡泡动画 */
.loading-animation.bubbles {
    position: relative;
}

.loading-animation.bubbles::before,
.loading-animation.bubbles::after {
    content: '○';
    position: absolute;
    color: rgba(255, 255, 255, 0.6);
    font-size: 2em;
    animation: bubbleFloat 2s infinite;
}

.loading-animation.bubbles::before {
    left: 30%;
    animation-delay: 0s;
}

.loading-animation.bubbles::after {
    right: 30%;
    animation-delay: 1s;
}

@keyframes bubbleFloat {
    0% { transform: translateY(20px) scale(0.5); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(-20px) scale(1); opacity: 0; }
}

/* 心形动画 */
.loading-animation.hearts {
    position: relative;
}

.loading-animation.hearts::before,
.loading-animation.hearts::after {
    content: '💖';
    position: absolute;
    animation: heartbeat 1.5s infinite;
}

.loading-animation.hearts::before {
    left: 25%;
    animation-delay: 0s;
}

.loading-animation.hearts::after {
    right: 25%;
    animation-delay: 0.75s;
}

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

.loading-text {
    font-size: 1.4em;
    color: white;
    margin-bottom: 20px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: textGlow 2s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

@keyframes textGlow {
    0%, 100% { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); }
    50% { text-shadow: 2px 2px 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.3); }
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes dotBounce {
    0%, 80%, 100% { 
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1.2);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .voice-button {
        width: 120px;
        height: 120px;
    }
    
    .story-header {
        flex-direction: column;
        text-align: center;
    }
    
    .voice-input-section,
    .story-section {
        padding: 25px;
    }
    
    .loading-container {
        padding: 30px;
        max-width: 350px;
    }
    
    .loading-character {
        font-size: 3em;
    }
    
    .loading-text {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .voice-button {
        width: 100px;
        height: 100px;
    }
    
    .mic-icon {
        font-size: 1.5em;
    }
    
    .button-text {
        font-size: 0.8em;
    }
    
    .loading-container {
        padding: 25px;
        max-width: 300px;
    }
    
    .loading-character {
        font-size: 2.5em;
    }
    
    .loading-text {
        font-size: 1.1em;
    }
} 