/* ============================================
   古诗词大全 - 主样式表
   设计理念：宣纸墨韵，古典雅致
   ============================================ */

:root {
    /* 色彩体系 */
    --bg-primary: #f4ecd8;       /* 宣纸色 */
    --bg-secondary: #ede4d0;     /* 深宣纸 */
    --bg-card: #faf6ee;          /* 卡片底色 */
    --bg-dark: #2b2520;          /* 深墨色 */
    --ink-primary: #2b2b2b;      /* 墨色 */
    --ink-secondary: #555;       /* 次墨 */
    --ink-muted: #8a8a8a;        /* 淡墨 */
    --ink-light: #b0a898;        /* 极淡墨 */
    --seal-red: #b22222;         /* 朱砂红 */
    --seal-red-dark: #8b1a1a;    /* 深朱砂 */
    --seal-red-light: #d4574e;   /* 浅朱砂 */
    --jade: #4a7c59;             /* 青绿 */
    --jade-light: #6b9b78;       /* 浅青绿 */
    --gold: #b8860b;             /* 古金 */
    --gold-light: #d4a437;       /* 浅金 */
    --border: #d4c5a9;           /* 纸边色 */
    --border-light: #e0d5c0;     /* 浅纸边 */
    --shadow: rgba(139, 26, 26, 0.06);
    --shadow-strong: rgba(0, 0, 0, 0.12);

    /* 字体 */
    --font-serif: "Noto Serif SC", "STSong", "SimSun", "Songti SC", serif;
    --font-kai: "STKaiti", "KaiTi", "Kaiti SC", "Noto Serif SC", serif;

    /* 尺寸 */
    --max-width: 1200px;
    --radius: 4px;
    --radius-lg: 8px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-serif);
    color: var(--ink-primary);
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(178, 34, 34, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(74, 124, 89, 0.03) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    line-height: 1.8;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--seal-red); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--seal-red-dark); }

ul { list-style: none; }

mark { background: rgba(178, 34, 34, 0.15); color: var(--seal-red-dark); padding: 0 2px; border-radius: 2px; }

/* ===== Header ===== */
.site-header {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 20px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 70px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo-seal {
    width: 42px;
    height: 42px;
    background: var(--seal-red);
    color: var(--bg-primary);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-family: var(--font-kai);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(178, 34, 34, 0.25);
    transform: rotate(-2deg);
}

.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-title { font-size: 20px; font-weight: 700; color: var(--ink-primary); letter-spacing: 2px; }
.logo-sub { font-size: 11px; color: var(--ink-muted); letter-spacing: 1px; }

.main-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}

.main-nav a {
    color: var(--ink-secondary);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

.main-nav a:hover { color: var(--seal-red); background: rgba(178, 34, 34, 0.05); }

.main-nav a.active {
    color: var(--seal-red);
    font-weight: 600;
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--seal-red);
    border-radius: 1px;
}

.header-search {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 0 4px 0 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.header-search:focus-within {
    border-color: var(--seal-red-light);
    box-shadow: 0 0 0 3px rgba(178, 34, 34, 0.1);
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    font-family: var(--font-serif);
    font-size: 14px;
    color: var(--ink-primary);
    width: 200px;
    padding: 8px 0;
}

.header-search input::placeholder { color: var(--ink-muted); }

.header-search button {
    background: var(--seal-red);
    color: var(--bg-primary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.header-search button:hover { background: var(--seal-red-dark); }

.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.mobile-nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--ink-primary);
    border-radius: 1px;
    transition: 0.3s;
}

/* ===== Main ===== */
.site-main { min-height: calc(100vh - 70px - 220px); }

/* ===== Hero Section ===== */
.hero {
    position: relative;
    text-align: center;
    padding: 80px 24px 60px;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 120%;
    height: 200%;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(178, 34, 34, 0.04) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 60%, rgba(74, 124, 89, 0.04) 0%, transparent 40%);
    z-index: 0;
}

.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }

.hero h1 {
    font-family: var(--font-kai);
    font-size: 48px;
    font-weight: 700;
    color: var(--ink-primary);
    letter-spacing: 8px;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.hero-subtitle {
    font-size: 16px;
    color: var(--ink-secondary);
    line-height: 2;
    margin-bottom: 40px;
}

.hero-subtitle .divider {
    display: inline-block;
    width: 40px;
    height: 1px;
    background: var(--border);
    vertical-align: middle;
    margin: 0 12px;
}

/* ===== 搜索框 ===== */
.hero-search-box {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 24px var(--shadow);
    transition: border-color 0.3s;
}

.hero-search-box:focus-within { border-color: var(--seal-red); }

.hero-search-box input {
    flex: 1;
    border: none;
    padding: 16px 24px;
    font-family: var(--font-serif);
    font-size: 16px;
    color: var(--ink-primary);
    background: transparent;
    outline: none;
}

.hero-search-box input::placeholder { color: var(--ink-muted); }

.hero-search-box button {
    padding: 0 32px;
    background: var(--seal-red);
    color: var(--bg-primary);
    border: none;
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    letter-spacing: 4px;
}

.hero-search-box button:hover { background: var(--seal-red-dark); }

.hot-searches {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--ink-muted);
}

.hot-searches a {
    color: var(--ink-secondary);
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all 0.2s;
}

.hot-searches a:hover {
    color: var(--seal-red);
    border-color: var(--seal-red-light);
    background: rgba(178, 34, 34, 0.04);
}

/* ===== 统计卡片 ===== */
.stats-bar {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: -20px;
    position: relative;
    z-index: 2;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 12px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-strong);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-family: var(--font-kai);
    font-weight: 700;
}

.stat-card:nth-child(1) .stat-icon { background: rgba(178, 34, 34, 0.1); color: var(--seal-red); }
.stat-card:nth-child(2) .stat-icon { background: rgba(74, 124, 89, 0.1); color: var(--jade); }
.stat-card:nth-child(3) .stat-icon { background: rgba(184, 134, 11, 0.1); color: var(--gold); }
.stat-card:nth-child(4) .stat-icon { background: rgba(107, 155, 120, 0.1); color: var(--jade-light); }

.stat-card .stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--ink-primary);
    font-family: var(--font-serif);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--ink-muted);
    margin-top: 4px;
    letter-spacing: 2px;
}

/* ===== 区块通用 ===== */
.section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 24px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.section-title {
    font-family: var(--font-kai);
    font-size: 28px;
    font-weight: 600;
    color: var(--ink-primary);
    display: flex;
    align-items: center;
    gap: 16px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 28px;
    background: var(--seal-red);
    border-radius: 2px;
}

.section-more {
    font-size: 14px;
    color: var(--ink-muted);
    transition: color 0.2s;
}

.section-more:hover { color: var(--seal-red); }

/* ===== 诗词卡片网格 ===== */
.poem-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.poem-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.poem-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--seal-red), var(--gold), var(--jade));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s;
}

.poem-card:hover {
    border-color: var(--border);
    box-shadow: 0 8px 24px var(--shadow-strong);
    transform: translateY(-2px);
}

.poem-card:hover::before { transform: scaleX(1); }

.poem-card-title {
    font-family: var(--font-kai);
    font-size: 20px;
    font-weight: 600;
    color: var(--ink-primary);
    margin-bottom: 8px;
}

.poem-card-title a { color: inherit; }
.poem-card-title a:hover { color: var(--seal-red); }

.poem-card-meta {
    font-size: 13px;
    color: var(--ink-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.poem-card-meta .dynasty-tag {
    color: var(--seal-red);
    font-weight: 500;
}

.poem-card-meta .author-name { color: var(--ink-secondary); }
.poem-card-meta .type-tag {
    color: var(--jade);
    border: 1px solid var(--border);
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.poem-card-content {
    font-family: var(--font-kai);
    font-size: 15px;
    color: var(--ink-secondary);
    line-height: 2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

/* ===== 名句推荐 ===== */
.featured-lines {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.featured-line-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--seal-red);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.2s;
    cursor: pointer;
}

.featured-line-card:hover {
    border-left-color: var(--gold);
    box-shadow: 0 4px 16px var(--shadow);
    background: var(--bg-card);
}

.featured-line-text {
    font-family: var(--font-kai);
    font-size: 20px;
    color: var(--ink-primary);
    line-height: 1.8;
    margin-bottom: 12px;
}

.featured-line-meta {
    font-size: 13px;
    color: var(--ink-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.featured-line-meta a { color: var(--seal-red); }

/* ===== 朝代导航 ===== */
.dynasty-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.dynasty-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.3s;
    min-width: 100px;
}

.dynasty-chip:hover {
    border-color: var(--seal-red);
    box-shadow: 0 4px 16px var(--shadow);
    transform: translateY(-2px);
}

.dynasty-chip-name {
    font-family: var(--font-kai);
    font-size: 22px;
    font-weight: 600;
    color: var(--ink-primary);
}

.dynasty-chip-count {
    font-size: 12px;
    color: var(--ink-muted);
    margin-top: 4px;
}

.dynasty-chip:hover .dynasty-chip-name { color: var(--seal-red); }

/* ===== 体裁导航 ===== */
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.type-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
}

.type-card:hover {
    border-color: var(--jade);
    box-shadow: 0 4px 16px var(--shadow);
}

.type-card-name {
    font-family: var(--font-kai);
    font-size: 20px;
    font-weight: 600;
    color: var(--ink-primary);
}

.type-card-desc {
    font-size: 12px;
    color: var(--ink-muted);
    margin: 8px 0;
}

.type-card-count {
    font-size: 13px;
    color: var(--jade);
    font-weight: 500;
}

/* ===== 诗词详情页 ===== */
.poem-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
}

.poem-detail-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.poem-detail-title {
    font-family: var(--font-kai);
    font-size: 36px;
    font-weight: 700;
    color: var(--ink-primary);
    margin-bottom: 12px;
}

.poem-detail-meta {
    font-size: 15px;
    color: var(--ink-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.poem-detail-meta .dynasty-tag {
    color: var(--seal-red);
    font-weight: 500;
}

.poem-detail-meta .author-link {
    color: var(--ink-secondary);
    font-weight: 500;
}

.poem-detail-meta .author-link:hover { color: var(--seal-red); }

.poem-detail-content {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 16px var(--shadow);
}

.poem-detail-content::before,
.poem-detail-content::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    border: 2px solid var(--border);
}

.poem-detail-content::before {
    top: 12px;
    left: 12px;
    border-right: none;
    border-bottom: none;
    border-radius: var(--radius-lg) 0 0 0;
}

.poem-detail-content::after {
    bottom: 12px;
    right: 12px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 var(--radius-lg) 0;
}

.poem-line {
    font-family: var(--font-kai);
    font-size: 22px;
    line-height: 2.4;
    color: var(--ink-primary);
    letter-spacing: 2px;
}

/* ===== 搜索结果 ===== */
.search-results { max-width: var(--max-width); margin: 0 auto; padding: 40px 24px; }

.search-info {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--ink-secondary);
}

.search-info strong { color: var(--seal-red); }

.search-result-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.search-result-item:hover {
    border-color: var(--border);
    box-shadow: 0 4px 16px var(--shadow);
}

.search-result-title {
    font-family: var(--font-kai);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.search-result-title a { color: var(--ink-primary); }
.search-result-title a:hover { color: var(--seal-red); }

.search-result-meta {
    font-size: 13px;
    color: var(--ink-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-snippet {
    font-family: var(--font-kai);
    font-size: 15px;
    color: var(--ink-secondary);
    line-height: 1.8;
}

/* ===== 分页 ===== */
.pagination { margin-top: 32px; display: flex; justify-content: center; }

.pagination ul {
    display: flex;
    gap: 4px;
    list-style: none;
}

.pagination li a,
.pagination li span {
    display: block;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--ink-secondary);
    font-size: 14px;
    transition: all 0.2s;
}

.pagination li a:hover {
    border-color: var(--seal-red);
    color: var(--seal-red);
    background: rgba(178, 34, 34, 0.03);
}

.pagination li.active span {
    background: var(--seal-red);
    border-color: var(--seal-red);
    color: var(--bg-primary);
    font-weight: 600;
}

.pagination li.disabled span { color: var(--ink-light); cursor: not-allowed; }
.pagination li.ellipsis span { border: none; }

/* ===== 作者列表 ===== */
.author-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.author-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 16px;
}

.author-card:hover {
    border-color: var(--border);
    box-shadow: 0 4px 16px var(--shadow);
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--seal-red);
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-kai);
    font-size: 22px;
    font-weight: 600;
    flex-shrink: 0;
}

.author-info { flex: 1; min-width: 0; }

.author-name {
    font-family: var(--font-kai);
    font-size: 18px;
    font-weight: 600;
    color: var(--ink-primary);
}

.author-name a { color: inherit; }
.author-name a:hover { color: var(--seal-red); }

.author-dynasty {
    font-size: 12px;
    color: var(--seal-red);
}

.author-count {
    font-size: 12px;
    color: var(--ink-muted);
}

/* ===== 作者详情页 ===== */
.author-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
}

.author-detail-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

.author-detail-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--seal-red);
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-kai);
    font-size: 36px;
    font-weight: 700;
    margin: 0 auto 20px;
    box-shadow: 0 4px 16px rgba(178, 34, 34, 0.2);
}

.author-detail-name {
    font-family: var(--font-kai);
    font-size: 32px;
    font-weight: 700;
    color: var(--ink-primary);
    margin-bottom: 8px;
}

.author-detail-dynasty {
    font-size: 16px;
    color: var(--seal-red);
    margin-bottom: 16px;
}

.author-detail-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 24px;
}

.author-detail-stat {
    text-align: center;
}

.author-detail-stat-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--ink-primary);
}

.author-detail-stat-label {
    font-size: 13px;
    color: var(--ink-muted);
}

/* ===== 统计页面 ===== */
.stats-page { max-width: var(--max-width); margin: 0 auto; padding: 40px 24px; }

.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stats-chart-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
}

.stats-chart-title {
    font-family: var(--font-kai);
    font-size: 22px;
    font-weight: 600;
    color: var(--ink-primary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stats-chart-title::before {
    content: '';
    width: 4px;
    height: 22px;
    background: var(--seal-red);
    border-radius: 2px;
}

/* 柱状图 */
.bar-chart { display: flex; flex-direction: column; gap: 12px; }

.bar-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 12px;
    align-items: center;
}

.bar-label {
    text-align: right;
    font-size: 14px;
    color: var(--ink-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    height: 28px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    min-width: 0;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--seal-red), var(--seal-red-light));
    border-radius: var(--radius);
    transition: width 0.8s ease;
}

.bar-count {
    font-size: 13px;
    color: var(--ink-secondary);
    font-weight: 500;
    white-space: nowrap;
    text-align: right;
    min-width: 70px;
}

.bar-fill.jade { background: linear-gradient(90deg, var(--jade), var(--jade-light)); }
.bar-fill.gold { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--ink-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    font-family: var(--font-kai);
    color: var(--ink-light);
}

.empty-state-text { font-size: 16px; }

/* ===== 面包屑 ===== */
.breadcrumb {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 24px 0;
    font-size: 13px;
    color: var(--ink-muted);
}

.breadcrumb a { color: var(--ink-secondary); }
.breadcrumb a:hover { color: var(--seal-red); }
.breadcrumb .separator { margin: 0 8px; }

/* ===== 筛选条 ===== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}

.filter-label {
    font-size: 14px;
    color: var(--ink-muted);
    margin-right: 8px;
}

.filter-chip {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 13px;
    color: var(--ink-secondary);
    transition: all 0.2s;
    cursor: pointer;
}

.filter-chip:hover { border-color: var(--seal-red-light); color: var(--seal-red); }

.filter-chip.active {
    background: var(--seal-red);
    border-color: var(--seal-red);
    color: var(--bg-primary);
    font-weight: 500;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--bg-dark);
    color: var(--ink-light);
    padding: 48px 24px 24px;
    margin-top: 60px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-brand .footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-kai);
    font-size: 20px;
    font-weight: 600;
    color: var(--bg-primary);
    margin-bottom: 16px;
}

.footer-brand .logo-seal { transform: rotate(-2deg); }

.footer-desc {
    font-size: 13px;
    line-height: 1.8;
    color: var(--ink-light);
}

.footer-col h4 {
    font-family: var(--font-kai);
    font-size: 16px;
    color: var(--bg-primary);
    margin-bottom: 16px;
}

.footer-col ul li { margin-bottom: 8px; }

.footer-col ul li a {
    color: var(--ink-light);
    font-size: 13px;
    transition: color 0.2s;
}

.footer-col ul li a:hover { color: var(--seal-red-light); }

.footer-bottom {
    max-width: var(--max-width);
    margin: 32px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    font-size: 12px;
    color: var(--ink-muted);
}

.footer-bottom p { margin-bottom: 6px; }

.footer-data-source a {
    color: var(--ink-light);
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,0.15);
    text-underline-offset: 2px;
    transition: color 0.2s, text-decoration-color 0.2s;
}

.footer-data-source a:hover {
    color: var(--seal-red-light);
    text-decoration-color: var(--seal-red-light);
}

.footer-powered {
    color: var(--ink-light);
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}

.footer-powered:hover {
    color: var(--seal-red-light);
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .header-search input { width: 140px; }
    .stats-bar { grid-template-columns: repeat(2, 1fr); }
    .stats-overview { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .header-inner { gap: 12px; height: 60px; }
    .logo-sub { display: none; }
    .main-nav { display: none; position: fixed; top: 60px; left: 0; right: 0; background: var(--bg-card); flex-direction: column; padding: 16px; border-bottom: 1px solid var(--border); box-shadow: 0 4px 16px var(--shadow); }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 12px 16px; }
    .header-search { flex: 1; }
    .header-search input { width: 100%; }
    .mobile-nav-toggle { display: flex; }

    .hero { padding: 48px 16px 40px; }
    .hero h1 { font-size: 32px; letter-spacing: 4px; }
    .hero-subtitle { font-size: 14px; }
    .hero-search-box input { padding: 12px 16px; font-size: 14px; }
    .hero-search-box button { padding: 0 20px; font-size: 14px; }

    .stats-bar { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: -12px; }
    .stat-card { padding: 16px; }
    .stat-card .stat-number { font-size: 24px; }
    .stat-card .stat-icon { width: 36px; height: 36px; font-size: 18px; }

    .section { padding: 40px 16px; }
    .section-title { font-size: 22px; }
    .poem-grid { grid-template-columns: 1fr; }
    .featured-lines { grid-template-columns: 1fr; }
    .type-grid { grid-template-columns: repeat(2, 1fr); }

    .poem-detail { padding: 24px 16px; }
    .poem-detail-title { font-size: 26px; }
    .poem-detail-content { padding: 32px 20px; }
    .poem-line { font-size: 18px; }

    .stats-overview { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; gap: 24px; }

    .bar-label { width: 60px; font-size: 12px; }
    .bar-count { font-size: 12px; min-width: 55px; }
    .author-list { grid-template-columns: 1fr; }
}

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

.fade-in { animation: fadeInUp 0.6s ease forwards; }
.fade-in:nth-child(2) { animation-delay: 0.1s; }
.fade-in:nth-child(3) { animation-delay: 0.2s; }
.fade-in:nth-child(4) { animation-delay: 0.3s; }

/* ===== 加载动画 ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(244, 236, 216, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--seal-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 搜索建议下拉 ===== */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px var(--shadow-strong);
    max-height: 320px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.search-suggestions.show { display: block; }

.suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-light);
}

.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: rgba(178, 34, 34, 0.04); }

.suggestion-title {
    font-family: var(--font-kai);
    font-size: 15px;
    color: var(--ink-primary);
}

.suggestion-meta {
    font-size: 12px;
    color: var(--ink-muted);
}

/* ===== 装饰元素 ===== */
.ink-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 40px 0;
}

.ink-divider::before,
.ink-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.ink-divider span {
    padding: 0 20px;
    font-family: var(--font-kai);
    font-size: 14px;
    color: var(--ink-muted);
}
