/* 修复版样式 - 保留古典风格但确保兼容性 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', '微软雅黑', 'SimSun', 'STKaiti', serif;
    line-height: 1.6;
    color: #444;
    background-color: #faf8f3;
    /* 简化背景图案 */
    background-image: linear-gradient(45deg, #faf8f3 25%, transparent 25%), 
                     linear-gradient(-45deg, #faf8f3 25%, transparent 25%), 
                     linear-gradient(45deg, transparent 75%, #faf8f3 75%), 
                     linear-gradient(-45deg, transparent 75%, #faf8f3 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

header {
    background: linear-gradient(135deg, #a05252, #c06c6c);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border-bottom: 2px solid #e6d3d3;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    color: #f5e6e6;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: bold;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: rgba(255,255,255,0.15);
    color: #f5e6e6;
}

.search-container {
    display: flex;
    gap: 0.5rem;
}

.search-container input {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 20px;
    width: 200px;
    font-size: 0.9rem;
}

.search-container button {
    padding: 0.5rem 1rem;
    background-color: #e6d3d3;
    color: #a05252;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.search-container button:hover {
    background-color: #f5e6e6;
    transform: translateY(-2px);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

.page {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page.active {
    display: block;
    opacity: 1;
}

/* 确保页面内容区域最小高度 */
.random-poems {
    min-height: 300px;
}

/* 加载状态样式 */
.loading {
    text-align: center;
    padding: 2rem;
    color: #a05252;
    font-size: 1.1rem;
}

.error {
    text-align: center;
    padding: 2rem;
    color: #c06c6c;
    font-size: 1rem;
}

.hero {
    text-align: center;
    padding: 1.5rem 0;
    background: linear-gradient(135deg, #faf8f3, #f0e6e6);
    border-radius: 15px;
    margin-bottom: 2rem;
    border: 1px solid #e6d3d3;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.hero h2 {
    font-size: 1.8rem;
    color: #a05252;
    margin-bottom: 0.8rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.hero p {
    font-size: 1rem;
    color: #c06c6c;
}

.random-poems h3,
.page h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #a05252;
    font-size: 1.8rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.poems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.poem-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid #e6d3d3;
    position: relative;
}

.poem-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}

.poem-card h4 {
    color: #a05252;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.poem-card .author {
    color: #c06c6c;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.poem-card .content {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.6;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.poem-card .content::after {
    content: '...';
    position: absolute;
    bottom: 0;
    right: 0;
    background: white;
    padding-left: 10px;
}

.authors-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.author-section {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border-left: 3px solid #e6d3d3;
}

.author-section h3 {
    color: #a05252;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid #e6d3d3;
    padding-bottom: 0.5rem;
}

.author-poems {
    list-style: none;
}

.author-poems li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f5e6e6;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #555;
}

.author-poems li:hover {
    color: #a05252;
    background: #faf8f8;
    padding-left: 0.5rem;
}

.author-poems li:last-child {
    border-bottom: none;
}

.poem-detail {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #e6d3d3;
}

.poem-detail h2 {
    color: #6b4423;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.poem-detail .author {
    color: #c06c6c;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.poem-detail .content {
    font-size: 1rem;
    line-height: 1.6;
    text-align: center;
    color: #444;
    margin-bottom: 1.5rem;
}

.poem-detail .paragraph {
    margin-bottom: 0.5rem;
    padding: 0.3rem 0;
}

.poem-detail .tags {
    text-align: center;
    margin-top: 2rem;
}

.poem-detail .tag {
    display: inline-block;
    background-color: #c06c6c;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.back-btn {
    background-color: #a05252;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: background-color 0.3s ease;
}
    font-weight: bold;
}

.back-btn:hover {
    background-color: #c06c6c;
}
    transform: translateY(-2px);
}

footer {
    background-color: #a05252;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 2px solid #e6d3d3;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .search-container {
        width: 100%;
        justify-content: center;
    }
    
    .search-container input {
        width: 150px;
    }
    
    main {
        padding: 1rem;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .poems-grid {
        grid-template-columns: 1fr;
    }
    
    .poem-detail {
        padding: 1.5rem;
    }
}

/* 状态提示 */
.loading {
    text-align: center;
    padding: 2rem;
    color: #a05252;
    font-size: 1.1rem;
}

.error {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
    font-size: 1rem;
}