/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8b4513;
    --secondary-color: #d4a574;
    --bg-color: #f9f6f0;
    --card-bg: #fff;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0d5c5;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
}

body {
    font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #a0522d;
}

/* ==================== 头部 ==================== */
.site-header {
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 100%);
    color: #fff;
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.main-nav {
    display: flex;
    gap: 30px;
}

.main-nav a {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    color: #fff;
    border-bottom-color: #fff;
}

.search-form {
    display: flex;
    gap: 0;
}

.search-form input {
    padding: 10px 15px;
    border: none;
    border-radius: 4px 0 0 4px;
    width: 200px;
    font-size: 14px;
    font-family: inherit;
}

.search-form button {
    padding: 10px 20px;
    background: #5d3a1a;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
}

.search-form button:hover {
    background: #4a2e15;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 2px;
    background: #fff;
}

/* ==================== 主要内容 ==================== */
.main-content {
    min-height: calc(100vh - 300px);
    padding-bottom: 40px;
}

/* ==================== 页面头部 ==================== */
.page-header {
    background: linear-gradient(135deg, #f9f6f0 0%, #f0e6d3 100%);
    padding: 40px 0;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.page-header p {
    color: var(--text-light);
}

.breadcrumb {
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--primary-color);
}

.breadcrumb span {
    margin: 0 8px;
}

/* ==================== 首页 Hero ==================== */
.hero {
    background: linear-gradient(135deg, #8b4513 0%, #a0522d 100%);
    color: #fff;
    padding: 80px 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-desc {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.hero-search {
    max-width: 600px;
    margin: 0 auto 30px;
    display: flex;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border-radius: 8px;
    overflow: hidden;
}

.hero-search input {
    flex: 1;
    padding: 18px 25px;
    border: none;
    font-size: 16px;
    font-family: inherit;
}

.hero-search button {
    padding: 18px 35px;
    background: #5d3a1a;
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.hero-search button:hover {
    background: #4a2e15;
}

.hot-searches {
    font-size: 14px;
    opacity: 0.8;
}

.hot-searches span {
    margin-right: 10px;
}

.hot-searches a {
    color: #fff;
    margin: 0 8px;
    text-decoration: underline;
}

.hot-searches a:hover {
    opacity: 0.8;
}

/* ==================== 区块 ==================== */
.section {
    padding: 50px 0;
}

.section-alt {
    background: #f0ebe3;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 28px;
    color: var(--primary-color);
}

.view-all {
    color: var(--primary-color);
    font-size: 14px;
}

.view-all:hover {
    text-decoration: underline;
}

/* ==================== 朝代网格 ==================== */
.dynasty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
}

.dynasty-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px 15px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.dynasty-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.dynasty-card .dynasty-name {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.dynasty-card .dynasty-count {
    display: block;
    font-size: 14px;
    color: var(--text-light);
}

/* ==================== 作者网格 ==================== */
.author-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.author-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.author-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.author-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a0522d 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    flex-shrink: 0;
}

.author-avatar.large {
    width: 80px;
    height: 80px;
    font-size: 32px;
}

.author-avatar.xlarge {
    width: 100px;
    height: 100px;
    font-size: 40px;
}

.author-info h3 {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 5px;
}

.author-dynasty {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 3px;
}

.author-count {
    font-size: 13px;
    color: var(--primary-color);
}

/* ==================== 作品网格 ==================== */
.poem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.poem-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.poem-card:hover {
    box-shadow: var(--shadow-hover);
}

.poem-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.poem-card h3 a {
    color: var(--primary-color);
}

.poem-meta {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.poem-meta a {
    color: var(--text-light);
}

.poem-meta a:hover {
    color: var(--primary-color);
}

.poem-excerpt {
    color: var(--text-color);
    line-height: 1.8;
    margin-bottom: 15px;
}

.read-more {
    font-size: 14px;
    color: var(--primary-color);
}

/* ==================== 作品列表 ==================== */
.poem-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.poem-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.poem-item:hover {
    box-shadow: var(--shadow-hover);
}

.poem-item h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.poem-item h3 a {
    color: var(--primary-color);
}

.poem-item .poem-meta {
    margin-bottom: 12px;
}

.poem-item .poem-meta .separator {
    margin: 0 8px;
    color: var(--border-color);
}

.poem-item .poem-excerpt {
    color: var(--text-color);
}

/* ==================== 作品详情 ==================== */
.poem-section {
    padding: 30px 0;
}

.poem-detail {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 50px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    max-width: 800px;
    margin: 0 auto;
}

.poem-title-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.poem-title-header h1 {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.poem-subtitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.dynasty-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #f0e6d3;
    border-radius: 4px;
    font-size: 14px;
    color: var(--primary-color);
}

.author-name {
    font-size: 18px;
    color: var(--text-color);
}

.poem-detail .poem-content {
    font-size: 20px;
    line-height: 2.2;
    text-align: center;
    margin-bottom: 40px;
}

.poem-detail .poem-content p {
    margin-bottom: 15px;
}

.poem-source {
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.poem-actions {
    max-width: 800px;
    margin: 30px auto 0;
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ==================== 作者详情页 ==================== */
.author-header {
    background: linear-gradient(135deg, #f9f6f0 0%, #f0e6d3 100%);
}

.author-profile {
    display: flex;
    align-items: center;
    gap: 30px;
}

.author-details h1 {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.author-meta {
    display: flex;
    align-items: center;
    gap: 15px;
}

.work-count {
    color: var(--text-light);
}

/* ==================== 作者列表 ==================== */
.author-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.author-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.author-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

/* ==================== 朝代列表 ==================== */
.dynasty-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.dynasty-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.dynasty-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.dynasty-item .dynasty-name {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

.dynasty-item .dynasty-count {
    font-size: 14px;
    color: var(--text-light);
}

/* ==================== 筛选栏 ==================== */
.filter-bar {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-bar a {
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-color);
    background: #f5f5f5;
    transition: all 0.3s;
}

.filter-bar a:hover,
.filter-bar a.active {
    background: var(--primary-color);
    color: #fff;
}

/* ==================== 搜索页 ==================== */
.search-header {
    background: linear-gradient(135deg, #f9f6f0 0%, #f0e6d3 100%);
}

.search-header .search-form {
    max-width: 600px;
    margin-top: 20px;
}

.search-header .search-form input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px 0 0 8px;
    font-size: 16px;
}

.search-header .search-form button {
    padding: 15px 30px;
    background: var(--primary-color);
    border-radius: 0 8px 8px 0;
}

.search-results-header {
    background: #f0f7ff;
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    margin-bottom: 30px;
    border-radius: 0 8px 8px 0;
}

.search-tips {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.search-tips h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 18px;
}

.search-tips ul {
    margin-bottom: 30px;
    padding-left: 20px;
}

.search-tips li {
    margin-bottom: 8px;
    color: var(--text-light);
}

.hot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hot-tags a {
    padding: 8px 16px;
    background: #f0e6d3;
    border-radius: 20px;
    font-size: 14px;
    color: var(--primary-color);
    transition: all 0.3s;
}

.hot-tags a:hover {
    background: var(--primary-color);
    color: #fff;
}

/* ==================== 分页 ==================== */
.pagination {
    margin-top: 50px;
    text-align: center;
}

.page-info {
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: 14px;
}

.page-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-links a,
.page-links span {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    min-width: 40px;
}

.page-links a {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    transition: all 0.3s;
}

.page-links a:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.page-links span.current {
    background: var(--primary-color);
    color: #fff;
}

.page-links span:not(.current) {
    color: var(--text-light);
}

.page-links .prev,
.page-links .next {
    padding: 10px 20px;
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: #a0522d;
    color: #fff;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: #fff;
}

/* ==================== 特色功能 ==================== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.feature-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.empty-state.large {
    padding: 120px 20px;
}

.empty-state .error-code {
    font-size: 120px;
    font-weight: bold;
    color: var(--border-color);
    line-height: 1;
    margin-bottom: 20px;
}

.empty-state h2 {
    font-size: 24px;
    color: var(--text-color);
    margin-bottom: 15px;
}

.empty-state ul {
    list-style: none;
    margin: 20px 0;
}

.empty-state li {
    margin-bottom: 8px;
}

.empty-state .actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.empty-state .hint {
    font-size: 14px;
    margin-top: 10px;
}

/* ==================== 页脚 ==================== */
.site-footer {
    background: #3d2914;
    color: rgba(255,255,255,0.7);
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3,
.footer-section h4 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 16px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

.footer-section a:hover {
    color: #fff;
}

.stats-list strong {
    color: #fff;
    font-size: 18px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
}

.footer-bottom a {
    color: rgba(255,255,255,0.7);
}

/* ==================== Toast 提示 ==================== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(51, 51, 51, 0.95);
    color: #fff;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(4px);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    width: 20px;
    height: 20px;
    background: #52c41a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: #52c41a;
}

.toast.error .toast-icon {
    background: #ff4d4f;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }
    
    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 10px;
        padding-top: 15px;
    }
    
    .main-nav.active {
        display: flex;
    }
    
    .search-form {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .hero {
        padding: 50px 0;
    }
    
    .hero-content h1 {
        font-size: 32px;
    }
    
    .hero-desc {
        font-size: 16px;
    }
    
    .hero-search {
        flex-direction: column;
        margin: 0 20px 20px;
    }
    
    .hero-search input,
    .hero-search button {
        border-radius: 8px;
        width: 100%;
    }
    
    .hero-search button {
        margin-top: 10px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .dynasty-grid,
    .author-grid,
    .poem-grid,
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .poem-detail {
        padding: 30px 20px;
    }
    
    .poem-title-header h1 {
        font-size: 28px;
    }
    
    .poem-detail .poem-content {
        font-size: 18px;
    }
    
    .author-profile {
        flex-direction: column;
        text-align: center;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-links {
        gap: 5px;
    }
    
    .page-links a,
    .page-links span {
        padding: 8px 12px;
        min-width: 35px;
    }
}
