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

:root {
    --primary-color: #8B4513;
    --secondary-color: #B22222;
    --background-color: #F7F2E7;
    --card-color: #F0E6D6;
    --text-color: #3E2723;
    --accent-color: #D4A76A;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Noto Serif SC', 'SimSun', serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="none" stroke="%23D4A76A" stroke-width="0.5" stroke-dasharray="4,4"/></svg>');
    background-size: 40px 40px;
}

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

/* 头部样式 */
header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: var(--accent-color);
}

.logo h1 {
    font-size: 2.2rem;
    letter-spacing: 3px;
    font-weight: 400;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

nav a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    position: relative;
    padding: 5px 0;
    transition: all 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* 搜索框样式 - 新增部分 */
.search-container {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
    position: relative;
    display: flex;
}

.search-form {
    display: flex;
    width: 100%;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-form input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0 20px;
    font-size: 1rem;
    color: white;
    outline: none;
}

.search-form input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-form button {
    width: 50px;
    background: var(--accent-color);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-form button:hover {
    background: #e09d4c;
}

.mobile-search-toggle {
    display: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 10px;
}

.mobile-search-container {
    display: none;
    padding: 10px;
    background: var(--primary-color);
}

/* 英雄区域 */
.hero {
    text-align: center;
    padding: 5rem 2rem;
    background: linear-gradient(rgba(139, 69, 19, 0.8), rgba(139, 69, 19, 0.8)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="none" stroke="%23D4A76A" stroke-width="0.5" stroke-dasharray="4,4"/></svg>');
    background-size: cover;
    color: white;
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.hero b {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.hero p {
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

/* 分类导航 */
.categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 2rem 0;
}
.breadcrumb a {color: #000;}
.category-btn {
    background: var(--card-color);
    border: 1px solid var(--accent-color);
    padding: 10px 25px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-color);
}

.category-btn:hover, .category-btn.active {
    background: var(--primary-color);
    color: white;
}

/* 诗词卡片 */
.poems-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 2rem 0;
}

.poem-card {
    background: var(--card-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border: 1px solid var(--accent-color);
}

.poem-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.poem-header {
    background: var(--primary-color);
    color: white;
    padding: 1.2rem;
    text-align: center;
}

.poem-title {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.poem-author {
    font-size: 1rem;
    opacity: 0.9;
}

.poem-content {
    padding: 1.5rem;
    font-size: 1.1rem;
    line-height: 2;
    text-align: center;
    position: relative;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.poem-content::before {
    content: """;
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 3rem;
    color: var(--accent-color);
    opacity: 0.3;
}

.poem-content::after {
    content: """;
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 3rem;
    color: var(--accent-color);
    opacity: 0.3;
    transform: rotate(180deg);
}

.poem-dynasty {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--secondary-color);
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
}

/* 页脚 */
footer {
    background: var(--primary-color);
    color: white;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--accent-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    opacity: 0.8;
}
.copyright a {color: #fff; line-height:45px; text-decoration:none;}

/* 响应式设计 */
@media (max-width: 992px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .search-container {
        order: 3;
        max-width: 100%;
        margin: 15px 0 0;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: row;
        flex-wrap: nowrap;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    nav ul {
        display: none;
    }
    
    .search-container {
        display: none;
    }
    
    .mobile-search-toggle {
        display: block;
        margin-left: auto;
    }
    
    .mobile-search-container.active {
        display: block;
    }
    
    .hero {
        padding: 4rem 1rem;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .poems-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .category-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate {
    animation: fadeIn 0.6s ease forwards;
}