/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif SC', serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    line-height: 1.6;
    transition: background-image 0.8s ease-in-out;
    position: relative;
}

.container {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 加载动画 */
.loading-container {
    text-align: center;
    padding: 40px 20px;
}

.book-animation {
    position: relative;
    width: 60px;
    height: 40px;
    margin: 0 auto 20px;
}

.page {
    position: absolute;
    width: 20px;
    height: 30px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 2px;
    transform-origin: left center;
}

.page1 {
    left: 0;
    animation: flip 2s infinite;
    z-index: 3;
}

.page2 {
    left: 15px;
    animation: flip 2s infinite 0.3s;
    z-index: 2;
}

.page3 {
    left: 30px;
    animation: flip 2s infinite 0.6s;
    z-index: 1;
}

@keyframes flip {
    0%, 20% { transform: rotateY(0deg); }
    50%, 80% { transform: rotateY(-180deg); }
    100% { transform: rotateY(0deg); }
}

.loading-text {
    color: #f0f0f0;
    font-size: 14px;
    animation: pulse 1.5s infinite;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

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

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

/* 内容展示 */
.content-container {
    animation: fadeIn 0.8s ease-out;
}

.controls-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 1000;
    display: none; /* 初始隐藏 */
}

.content-card {
    background: transparent;
    border-radius: 20px;
    padding: 30px 25px;
    position: relative;
    margin-bottom: 20px;
}

.quote-mark {
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 40px;
    color: #d4af37;
    opacity: 0.3;
    font-family: Georgia, serif;
}

.text-content {
    font-size: 18px;
    line-height: 1.8;
    color: #ffffff;
    text-align: center;
    margin: 20px 0;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.5);
}

.interpretation {
    font-size: 14px;
    line-height: 1.6;
    color: #f0f0f0;
    text-align: left;
    margin: 0;
    padding: 15px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 3px solid #ffffff;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.source-info {
    text-align: right;
    margin-top: 25px;
    margin-bottom: 15px;
}

.source {
    font-size: 14px;
    color: #e0e0e0;
    font-style: italic;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.theme-tag {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

/* 音频控制 */
.audio-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.play-button {
    width: 50px;
    height: 50px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: transparent;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3);
}

.play-button:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}

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

.play-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.audio-info {
    color: #f0f0f0;
    font-size: 14px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 提示信息按钮 */
.tip-button {
    width: 50%;
    text-align: center;
    padding: 12px 20px;
    background: transparent;
    border-radius: 25px;
    border: 2px solid #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3);
    margin: 0 auto;
    display: block;
}

.tip-button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}

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

.tip-button p {
    color: #ffffff;
    font-size: 14px;
    margin: 0;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.tip-button:hover p {
    color: #ffffff;
}

/* 错误状态 */
.error-container {
    text-align: center;
    padding: 40px 20px;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.error-text {
    color: #e74c3c;
    font-size: 16px;
    margin-bottom: 20px;
}

.retry-button {
    background: linear-gradient(45deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

/* 响应式设计 */
@media (max-width: 480px) {
    body {
        align-items: flex-start;
        padding-top: 15vh;
        padding-bottom: 15vh;
        min-height: auto;
    }
    
    .container {
        width: 95%;
        padding: 15px;
    }
    
    .content-card {
        padding: 25px 20px;
    }
    
    .text-content {
        font-size: 16px;
    }
    
    .content-info {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .controls-section {
        padding: 15px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        color: #ecf0f1;
    }
    
    .content-card {
        background: transparent;
    }
    
    .text-content {
        color: #ffffff;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.5);
    }
    
    .source {
        color: #e0e0e0;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    }
    
    .tip-button {
        background: rgba(52, 73, 94, 0.85);
        border-color: #555;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        /* 深色模式备用方案 */
        background-image: linear-gradient(135deg, rgba(52, 73, 94, 0.9) 0%, rgba(52, 73, 94, 0.8) 100%);
    }
    
    .tip p {
        color: #bdc3c7;
    }
    
    /* 深色模式下的释义样式 */
    .interpretation {
        color: #f0f0f0;
        border-top: 1px solid rgba(255, 255, 255, 0.3);
        border-left: 3px solid #ffffff;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    }
}