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

body {
    font-family: 'Noto Serif SC', serif;
    background-color: #f5f0e6;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 标题样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #d4b886;
}

.title {
    font-size: 2.5rem;
    color: #8b4513;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    color: #6b4226;
    font-style: italic;
}

/* 主要内容区 */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

/* 句子展示区 */
.sentence-display {
    width: 100%;
    max-width: 800px;
    margin-bottom: 30px;
}

.sentence-container {
    background-color: #fff;
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0d0b8;
}

.sentence {
    font-size: 1.8rem;
    text-align: center;
    color: #333;
    line-height: 1.8;
    transition: all 0.5s ease;
}

/* 句子生成动画 */
.sentence-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(228, 204, 171, 0.3), transparent);
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sentence-animation.active {
    opacity: 1;
    animation: shimmer 1.5s infinite;
}

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

.sentence-container.generating .sentence {
    opacity: 0.5;
}

/* 历史记录 */
.sentence-history {
    margin-top: 20px;
    padding: 20px;
    background-color: #f9f5f0;
    border-radius: 8px;
    border: 1px solid #e0d0b8;
}

.history-title {
    font-size: 1.2rem;
    color: #8b4513;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px dashed #d4b886;
}

.history-list {
    list-style: none;
}

.history-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.history-list li:hover {
    color: #8b4513;
    text-decoration: underline;
}

/* 操作按钮区 */
.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.btn {
    padding: 12px 24px;
    background-color: #8b4513;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Noto Serif SC', serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background-color: #6b4226;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background-color: #a0866c;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.generate-btn {
    background-color: #8b4513;
}

.save-btn {
    background-color: #4a7c59;
}

.copy-btn {
    background-color: #5c8aaf;
}

.collection-btn {
    background-color: #a0522d;
}

.vocabulary-btn {
    background-color: #6b8e23;
}

/* 游戏说明区 */
.game-instructions, .vocabulary-preview {
    background-color: #fff;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0d0b8;
}

.section-title {
    font-size: 1.5rem;
    color: #8b4513;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #d4b886;
}

.instructions-content p {
    margin-bottom: 15px;
    color: #555;
}

/* 词汇库预览 */
.vocabulary-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.category {
    background-color: #f9f5f0;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0d0b8;
}

.category h3 {
    font-size: 1.1rem;
    color: #8b4513;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px dashed #d4b886;
}

.category p {
    color: #666;
    font-size: 0.95rem;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid #e0d0b8;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0d0b8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    color: #8b4513;
}

.close-btn {
    font-size: 1.8rem;
    background: none;
    border: none;
    color: #8b4513;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #6b4226;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0d0b8;
    display: flex;
    justify-content: flex-end;
}

/* 收藏列表 */
.collection-list {
    list-style: none;
}

.collection-list li {
    padding: 15px;
    border-bottom: 1px dashed #e0d0b8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.collection-list li:hover {
    background-color: #f9f5f0;
}

.collection-list li:last-child {
    border-bottom: none;
}

.delete-btn {
    background: none;
    border: none;
    color: #a0522d;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 5px;
}

.delete-btn:hover {
    color: #8b4513;
}

.empty-collection {
    text-align: center;
    padding: 30px;
    color: #888;
}

.clear-all-btn {
    background-color: #a0522d;
}

/* 词汇库标签页 */
.vocabulary-tabs {
    display: flex;
    border-bottom: 1px solid #e0d0b8;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    font-family: 'Noto Serif SC', serif;
    font-size: 1rem;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: #8b4513;
    border-bottom-color: #8b4513;
}

.tab-btn:hover:not(.active) {
    color: #8b4513;
    border-bottom-color: #d4b886;
}

.tab-content {
    padding: 10px 0;
}

.vocabulary-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.vocabulary-list li {
    padding: 8px 12px;
    background-color: #f9f5f0;
    border-radius: 5px;
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    border: 1px solid #e0d0b8;
    transition: all 0.3s ease;
}

.vocabulary-list li:hover {
    background-color: #f0e6d6;
    color: #8b4513;
    transform: translateY(-2px);
}

/* 提示消息 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 5px;
    font-size: 1rem;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .sentence-container {
        padding: 30px 20px;
    }
    
    .sentence {
        font-size: 1.5rem;
    }
    
    .controls {
        gap: 10px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .vocabulary-categories {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .vocabulary-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .sentence {
        font-size: 1.3rem;
    }
    
    .controls {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .vocabulary-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 50px;
        padding: 10px 5px;
        font-size: 0.9rem;
        text-align: center;
    }
}
