:root {
    --bg-tools: #ffffff;
    --overlay: rgba(0,0,0,0.4);
    --body-bg: #f8f9fa;

    --item-width: 120px;
    --item-width-medium: 220px;

    --text: #1a1a1a;
    --text-secondary: #6b6b6b;
    --text-muted: #999999;
    --text-black: #1a1a1a;
    --text-dark: #2d2d2d;
    --text-medium: #4a4a4a;
    --border: #e8e6e1;
    --border-light: #f0eeea;
    --accent: #c45c48;
    --accent-light: #fdf6f3;
    --blue: #2c5f7c;

    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-half: 50%;

    --jade: #2d6a4f;
    --jade-light: #40916c;

    --indigo: #2c3e50;
    --indigo-light: #34495e;

    --gold: #b8860b;
    --gold-light: #d4a843;

    --paper-white: #faf8f5;
    --paper-cream: #f5f0e8;
    --paper-warm: #ede6d8;
    --paper-beige: #e8dcc8;
    --paper-light: #FAF9F5;

    --cinnabar: #c23a30;
    --cinnabar-light: #d4554a;
    --cinnabar-pale: #f5e0de;

    --shadow: 0 2px 12px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;

    --font-size: 18px;
}

/* 夜间模式 */
[data-theme="night"] {
    --body-bg: #1a1a1a;
    --text: #c8c8c8;
    --bg-tools: #252525;
    --border: #333333;
    --border-light: #2a2a2a;
    --overlay: rgba(0,0,0,0.7);
}

/* 护眼模式 */
[data-theme="eye"] {
    --body-bg: #c7edcc;
    --text: #1a1a1a;
    --border: #a8d5ac;
    --border-light: #b8e0bc;
    --bg-tools: #d4f0d8;
    --overlay: rgba(0,0,0,0.35);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Microsoft JhengHei", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    color: var(--text);
    background-color: var(--body-bg);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.position-relative {
    position: relative!important;
}
.position-absolute {
    position: absolute!important;
}
.tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--paper-white);
    border: 1px solid var(--paper-beige);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.tag:hover {
    background: var(--cinnabar-pale);
    border-color: var(--cinnabar);
    color: var(--cinnabar);
}
.d-block {
    display: block !important;
}
.border-0 {
    border: none!important;
}
.mb-0 {
    margin-bottom: 0px !important;
}
.mb-3 {
    margin-bottom: 1.5rem!important;
}
.mr-3 {
    margin-right: 1.5rem!important;
}
.mt-3 {
    margin-top: 1.5rem!important;
}
.mt-2 {
    margin-top: 1rem!important;
}
.fs-2 {
    font-size: 2rem;
}
.text-center {
    text-align: center!important;
}
.text-red,
.text-danger {
    color: var(--cinnabar)!important;
}

.flex-grow-1 {
    -ms-flex-positive: 1 !important;
    flex-grow: 1 !important;
}

/* ===== 导航栏 ===== */
header {
    width: 100%;
    top: 0;
    z-index: 100;
}
header.site-index {
    position: absolute!important;
}
nav {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.logo img {
    border-radius: var(--radius-sm);
    object-fit: cover;
}
.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--text);
}
.logo-text span { color: var(--accent); }

.nav-menu { display: flex; gap: 4px; align-items: center; }
.nav-menu a {
    font-size: 15px;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-menu a:hover { color: var(--text); background: var(--border-light); }
.nav-menu a.active { color: var(--accent); background: var(--accent-light); font-weight: 600; }
header.site-index .nav-menu a {
    color: rgba(255, 255, 255, .8);
}
header.site-index .nav-menu a:hover,
header.site-index .nav-menu a.active {
    color: #FFF;
    background: rgba(255,255,255,.15);
}

.menu-toggle {
    display: none;
    width: 40px; height: 40px;
    border: none; background: transparent;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}
.menu-toggle span {
    display: block;
    width: 22px; height: 2px;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 64px; left: 0; right: 0;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px 24px;
        gap: 4px;
        display: none;
        box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    }
    .nav-menu.open { display: flex; }
    .nav-menu a { width: 100%; padding: 12px 16px; font-size: 16px; }
    .menu-toggle { display: flex; }
}

/* ===== Banner ===== */
.banner {
    width: 100%;
    height: 500px;
    background: linear-gradient(135deg, #2c3e50 0%, #4a6741 50%, #8b6914 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}
.banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url(../images/search.jpg);
    background-size: cover;
    background-position: center center;
    opacity: 0.6;
}
.bg-opus-info {
    position: absolute;
    bottom: 10px;
    right: 8px;
    font-size: .875rem;
    color: rgba(255, 255, 255, .8);
}
.banner-content {
    position: relative;
    z-index: 1;
    padding: 0 24px;
}
.banner h1 {
    font-size: 42px;
    font-weight: 300;
    letter-spacing: 6px;
    margin-bottom: 12px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}
.banner .slogan {
    font-size: 18px;
    opacity: 0.85;
    letter-spacing: 2px;
    margin-bottom: 36px;
    font-weight: 300;
}
.banner-stats {
    display: flex;
    gap: 48px;
    justify-content: center;
    flex-wrap: wrap;
}
.stat-item {
    text-align: center;
}
.stat-item .num {
    font-size: 32px;
    font-weight: 300;
    line-height: 1.2;
}
.stat-item .label {
    font-size: 14px;
    opacity: 0.7;
    margin-top: 4px;
}

@media (max-width: 640px) {
    .banner { height: 320px; }
    .banner h1 { font-size: 28px; letter-spacing: 3px; }
    .banner .slogan { font-size: 15px; }
    .banner-stats { gap: 28px; }
    .stat-item .num { font-size: 24px; }
    .stat-item .label { font-size: 13px; }
}

/* ===== 搜索区 ===== */
.search-section {
    width: 100%;
    padding: 40px 24px;
    border-bottom: 1px solid var(--border);
}
.search-wrap {
    max-width: 720px;
    margin: 0 auto;
}
.search-box {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 30px;
    overflow: hidden;
    background: #ffffff;
    transition: box-shadow 0.25s;
}
.search-box:focus-within {
    box-shadow: 0 0 0 4px var(--accent-light);
    border-color: var(--accent);
}
.search-box input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    font-size: 16px;
    outline: none;
    background: transparent;
}
.search-box input::placeholder { color: #bbb; }
.search-box .divider {
    width: 1px;
    background: var(--border);
    margin: 10px 0;
}
.search-box select {
    padding: 0 36px 0 16px;
    border: none;
    font-size: 15px;
    color: var(--text-secondary);
    outline: none;
    cursor: pointer;
    appearance: none;
    background: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.search-box button {
    padding: 0 28px;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
    font-weight: 500;
}
.search-box button:hover { opacity: 0.9; }

@media (max-width: 640px) {
    .search-section { padding: 28px 16px; }
    .search-box { flex-wrap: wrap; }
    .search-box input { width: 100%; padding: 14px 16px; }
    .search-box .divider { display: none; }
    .search-box select {
        width: 25%;
        padding: 12px 36px 12px 16px;
        border-top: 1px solid var(--border);
    }
    .search-box button {
        width: 20%;
        padding: 12px;
        border-top: 1px solid var(--accent);
    }
}

/* ============================================
   朝代
   ============================================ */
.site-content {
    max-width: 1440px;
    padding: 0 1.5rem;
    margin: 3rem auto;
}
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-black);
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-bottom: var(--space-sm);
    position: relative;
}
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-lg);
}


.category-card {
    background: var(--paper-cream);
    border-radius: var(--radius-lg);
    border: 1px solid var(--paper-beige);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--cinnabar);
}

.category-card a {
    text-align: center;
    display: block;
    padding: var(--space-md);
    color: var(--text-dark);
    text-decoration: none;
}

.category-card a:hover {
    color: var(--text-dark);
    text-decoration: none;
}

.category-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.category-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-sm);
}

.cat-count {
    font-size: 0.8125rem;
    color: var(--cinnabar);
    font-weight: 500;
}

/* ============================================
   诗词日历
   ============================================ */
.poem-calendar,
.popular-poets,
.other-sections {
    margin-top: var(--space-2xl);
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-lg);
}

.calendar-item {
    display: flex;
    gap: var(--space-md);
    background: var(--paper-cream);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid var(--paper-beige);
    transition: all var(--transition-normal);
}

.calendar-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--paper-warm);
}

.cal-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: var(--space-sm);
    background: linear-gradient(135deg, var(--cinnabar), var(--cinnabar-light));
    color: white;
    border-radius: var(--radius-md);
    text-align: center;
}

.cal-month {
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.cal-day {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.cal-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.cal-content h4 a {
    color: var(--text-dark);
}

.cal-content h4 a:hover {
    color: var(--cinnabar);
}

.cal-author {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.cal-excerpt {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   热门诗人
   ============================================ */
.poet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-lg);
}

.poet-card {
    text-align: center;
    background: var(--paper-cream);
    border-radius: var(--radius-lg);
    padding: var(--space-xl) var(--space-lg);
    border: 1px solid var(--paper-beige);
    transition: all var(--transition-normal);
}

.poet-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--cinnabar);
}

.poet-card a {
    display: block;
    color: var(--text-dark);
    text-decoration: none;
}

.poet-card a:hover {
    color: var(--text-dark);
    text-decoration: none;
}

.poet-avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--paper-beige), var(--paper-warm));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cinnabar);
    margin: 0 auto var(--space-md);
    border: 2px solid var(--paper-beige);
}

.poet-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.poet-dynasty {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.poet-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--space-sm);
}

.poet-count {
    font-size: 0.75rem;
    color: var(--cinnabar);
    font-weight: 500;
}

/* ============================================
   其他栏目
   ============================================ */
.other-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-lg);
}

.other-card {
    background: var(--paper-cream);
    border-radius: var(--radius-lg);
    border: 1px solid var(--paper-beige);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.other-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.other-card a {
    display: block;
    padding: var(--space-xl);
    color: var(--text-dark);
    text-decoration: none;
}

.other-card a:hover {
    color: var(--text-dark);
    text-decoration: none;
}

.other-card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.other-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.site-footer {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid var(--border);
}


/* ============================================
   面包屑导航
   ============================================ */
.breadcrumb {
    margin: 0 auto;
    padding: var(--space-sm) 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb ol {
    display: flex;
    list-style: none;
    gap: var(--space-sm);
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: var(--space-sm);
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb a:hover {
    color: var(--cinnabar);
}

/* ============================================
   朝代筛选
   ============================================ */
.filter-bar {
    background: var(--paper-cream);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-xl);
    margin-bottom: var(--space-xl);
    border: 1px solid var(--paper-beige);
}

.filter-group {
    margin-bottom: var(--space-md);
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: var(--space-sm);
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.filter-tag {
    display: inline-block;
    padding: 5px 14px;
    background: var(--paper-white);
    border: 1px solid var(--paper-beige);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-medium);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.filter-tag:hover {
    background: var(--cinnabar-pale);
    border-color: var(--cinnabar);
    color: var(--cinnabar);
    text-decoration: none;
}

.filter-tag.active {
    background: var(--cinnabar);
    border-color: var(--cinnabar);
    color: white;
}

/* ============================================
   诗词列表
   ============================================ */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.list-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.total-options {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.poem-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

.poem-list-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-lg);
    border-radius: var(--radius-lg);
    background: var(--paper-light);
    padding: var(--space-lg) var(--space-xl);
    border: 1px solid var(--paper-beige);
    transition: all var(--transition-normal);
}

.poem-list-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--cinnabar);
}

.item-main {
    flex: 1;
    min-width: 0;
}

.item-main h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.item-main h3 a {
    color: var(--text-black);
    text-decoration: none;
}

.item-main h3 a:hover {
    color: var(--cinnabar);
}

.item-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.item-meta a {
    color: var(--cinnabar);
    font-weight: 700;
}

.item-meta .dynasty,
.item-meta .genre {
    margin-left: var(--space-sm);
    padding: 1px 5px;
    background: var(--paper-white);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    border: 1px solid var(--paper-beige);
}

.item-excerpt {
    font-size: 0.9375rem;
    color: var(--text-medium);
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 100px;
}

.item-tags .tag {
    font-size: 0.75rem;
    padding: 2px 8px;
}

/* ============================================
   分页
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    list-style: none;
    margin-top: var(--space-2xl);
    flex-wrap: wrap;
}

.page-link,
.page-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: var(--paper-cream);
    border: 1px solid var(--paper-beige);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-medium);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.page-link:hover,
.page-next:hover {
    background: var(--cinnabar-pale);
    border-color: var(--cinnabar);
    color: var(--cinnabar);
    text-decoration: none;
}

.page-item.active .page-link {
    background: var(--cinnabar);
    border-color: var(--cinnabar);
    color: white;
    font-weight: 600;
}

.page-ellipsis {
    color: var(--text-muted);
    padding: 0 var(--space-sm);
}
.d-flex {
    display: -ms-flexbox !important;
    display: flex !important;
}
.justify-content-center {
    -ms-flex-pack: center !important;
    justify-content: center !important;
}

/* ============================================
   诗词详情
   ============================================ */
.poem-detail {
    margin: 0 auto;
}

.detail-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border);
}

.detail-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-black);
    margin-bottom: var(--space-md);
}

.detail-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    font-size: 0.9375rem;
}

.detail-meta .author a {
    color: var(--cinnabar);
    font-weight: 600;
    font-size: 1rem;
}

.detail-meta .author a:hover {
    color: var(--cinnabar-light);
}

.detail-meta .dynasty,
.detail-meta .genre {
    margin-left: var(--space-sm);
    padding: 3px 10px;
    background: var(--paper-cream);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    border: 1px solid transparent;
}
.detail-meta .dynasty:hover {
    border-color: var(--paper-beige);
}



.detail-tags {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.detail-tags .tag {
    background: var(--cinnabar-pale);
    border-color: var(--cinnabar-pale);
    color: var(--cinnabar);
}

.detail-tags .tag:hover {
    border-color: var(--cinnabar-light);
}

.detail-content {
    margin-bottom: var(--space-2xl);
}

.poem-text {
    text-align: center;
    font-size: 1.5rem;
    line-height: 2.4;
    color: var(--text-black);
    padding: var(--space-2xl);
}

.detail-pinyin {
    margin-bottom: var(--space-2xl);
}

.detail-pinyin h2,
.detail-annotation h2,
.detail-translation h2,
.detail-appreciation h2,
.detail-author h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-black);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.pinyin-text {
    font-size: 1.125rem;
    line-height: 2.2;
    color: var(--text-secondary);
    padding: var(--space-lg);
    background: var(--paper-cream);
    border-radius: var(--radius-md);
}

.traditional-zh-text,
.radical-text {
    display: inline-block;
    width: 100px;
    height: 100px;
    text-align: center;
    line-height: 100px;
    font-size: 4rem;
    font-weight: 300;
    font-family: "楷体";
    background: url(../images/tian.png);
    background-size: cover;
}

.detail-annotation {
    margin-bottom: var(--space-2xl);
}

.annotation-list {
    display: grid;
    gap: var(--space-md);
}

.annotation-list dt {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--cinnabar);
    display: inline;
}

.annotation-list dd {
    display: inline;
    margin-left: var(--space-sm);
    color: var(--text-medium);
    line-height: 1.8;
}

.annotation-list dd::after {
    content: '';
    display: block;
    margin-bottom: var(--space-sm);
}

.detail-translation {
    margin-bottom: var(--space-2xl);
}

.translation-text {
    font-size: 1rem;
    line-height: 2;
    color: var(--text-medium);
    padding: var(--space-lg);
    background: var(--paper-cream);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--jade);
}

.translation-text p {
    margin-bottom: var(--space-sm);
}

.translation-text p:last-child {
    margin-bottom: 0;
}

.detail-appreciation {
    margin-bottom: var(--space-2xl);
}

.appreciation-text {
    font-size: 1rem;
    line-height: 2;
    color: var(--text-medium);
}

.appreciation-text p {
    margin-bottom: var(--space-md);
    text-indent: 2em;
}

.detail-author {
    margin-bottom: var(--space-2xl);
}

.author-card {
    display: flex;
    gap: var(--space-xl);
    align-items: flex-start;
    background: var(--paper-cream);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--paper-beige);
}

.author-list-item {
    display: flex;
    gap: var(--space-xl);
    align-items: flex-start;
    background: var(--paper-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    border: 1px solid var(--paper-beige);
}

.author-avatar-large {
    width: 80px;
    height: 80px;
    min-width: 80px;
    background: linear-gradient(135deg, var(--paper-beige), var(--paper-warm));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--cinnabar);
    border: 2px solid var(--paper-beige);
}

.author-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.author-dynasty {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.author-bio {
    font-size: 0.9375rem;
    color: var(--text-medium);
    line-height: 1.8;
    margin-bottom: var(--space-md);
}

.btn-more {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: 1px solid var(--cinnabar);
    color: var(--cinnabar);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-more:hover {
    background: var(--cinnabar);
    color: white;
    text-decoration: none;
}

.detail-related {
    margin-bottom: var(--space-2xl);
}

.detail-related h2 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--item-width-medium), 1fr));
    gap: var(--space-md);
}

.related-item {
    background: var(--paper-light);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    border: 1px solid var(--paper-beige);
    transition: all var(--transition-fast);
}

.related-item:hover {
    border-color: var(--cinnabar);
    box-shadow: var(--shadow-sm);
}

.related-item a {
    display: block;
    color: var(--text-dark);
    text-decoration: none;
}

.related-item a:hover {
    color: var(--cinnabar);
    text-decoration: none;
}

.related-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.related-item p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ============================================
   汉字等
   ============================================ */
.other-items {
    --other-fs: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--item-width), 1fr));
    gap: var(--space-md);
}

.other-list-item {
    background: var(--paper-light);
    font-size: var(--other-fs);
    border-radius: var(--radius-lg);
    border: 1px solid var(--paper-beige);
    transition: all var(--transition-normal);
}

.other-list-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--cinnabar);
}

.other-list-item a {
    display: block;
    text-align: center;
    padding: var(--space-lg) var(--space-xl);
}

.other-list-item a span {
    color: var(--cinnabar);
}

.hanzi {
    display: inline-block;
    width: 100px;
    height: 100px;
    text-align: center;
    line-height: 100px;
    font-size: 4rem;
    font-weight: 300;
    font-family: "楷体";
    background: url("../images/tian.png");
    background-size: cover;
}


/* ============================================
   书籍列表
   ============================================ */
.book-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.book-card {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: var(--paper-light);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: all 0.25s;
}
.book-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
    border-color: var(--accent);
}

.book-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.book-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.book-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.5px;
}
.book-dynasty {
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--paper-white);
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 500;
    flex-shrink: 0;
}

.book-author {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.book-author span {
    color: var(--text-muted);
    margin: 0 6px;
}

.book-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.book-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.book-tag {
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
    transition: all 0.2s;
}
.book-count {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}


/* ============================================
   书籍详情
   ============================================ */
.book-hero {
    display: flex;
    gap: 36px;
    padding: 32px 0 40px;
}
.book-cover-wrap {
    flex-shrink: 0;
    width: 220px;
}
.book-cover {
    --book-width: 220px;
    --book-name: '';
    --book-author: '';
    max-width: var(--book-width);
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    background: linear-gradient(135deg, #BEC2BC 0%, #9AA7B1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.book-cover::before {
    padding: 15px 0px;
    content: var(--book-name);
    font-size: 18px;
    font-weight: 300;
    color: rgba(255,255,255,0.9);
    letter-spacing: 6px;
    writing-mode: vertical-rl;
    text-orientation: upright;
}
.book-cover::after {
    content: var(--book-author);
    position: absolute;
    bottom: 20px;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    letter-spacing: 2px;
}

.book-meta { flex: 1; min-width: 0; }
.book-meta h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 1px;
}
.book-meta .author-line {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.book-meta .author-line .dynasty {
    display: inline-block;
    padding: 2px 10px;
    background: var(--paper-white);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-right: 10px;
}
.book-meta .desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 20px;
}
.book-meta .tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.book-meta .tags a {
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}
.book-meta .tags a:hover {
    border-color: var(--blue);
    color: var(--blue);
}
.book-meta .stats-row {
    display: flex;
    gap: 32px;
    padding: 16px 0;
    border-top: 1px solid var(--border-light);
}
.book-meta .stats-row .stat {
    text-align: center;
}
.book-meta .stats-row .stat .num {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
}
.book-meta .stats-row .stat .label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}
.book-meta .actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}
.book-meta .actions a {
    padding: 10px 28px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}
.book-meta .actions .btn-primary {
    background: var(--accent);
    color: white;
}
.book-meta .actions .btn-primary:hover { opacity: 0.9; }
.book-meta .actions .btn-secondary {
    background: var(--paper-light);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.book-meta .actions .btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 720px) {
    .book-hero { flex-direction: column; align-items: center; gap: 24px; }
    .book-cover-wrap { width: 160px; }
    .book-cover::before { font-size: 24px; }
    .book-meta { text-align: center; }
    .book-meta h1 { font-size: 26px; }
    .book-meta .tags { justify-content: center; }
    .book-meta .stats-row { justify-content: center; }
    .book-meta .actions { justify-content: center; }
}

.chapter-section { padding-bottom: 60px; }
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title::before {
    content: "";
    width: 4px;
    height: 22px;
    background: var(--accent);
    border-radius: 2px;
}
.section-title .count {
    margin-left: auto;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

.chapter-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.chapter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--paper-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    font-size: 15px;
}
.chapter-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.chapter-item .num {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-half);
    background: var(--border-light);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.chapter-item:hover .num {
    background: var(--accent);
    color: white;
}
.chapter-item .name {
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {
    .chapter-list { grid-template-columns: 1fr; }
    .chapter-item { padding: 12px 14px; }
}


/* ============================================
   书籍阅读
   ============================================ */
/* ===== 顶部工具栏 ===== */
.reader-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--body-bg);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s, border-color 0.3s;
}
.reader-header .header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.reader-header .btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.reader-header .btn-icon:hover {
    background: var(--border-light);
    color: var(--text);
}
.reader-header .book-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
}
.reader-header .header-right {
    display: flex;
    gap: 4px;
}

/* ===== 设置面板 ===== */
.settings-panel {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    background: var(--bg-tools);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    z-index: 40;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}
.settings-panel.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.settings-panel .settings-inner {
    max-width: 720px;
    margin: 0 auto;
}
.setting-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.setting-row:last-child { margin-bottom: 0; }
.setting-label {
    font-size: 14px;
    color: var(--text-secondary);
    width: 60px;
    flex-shrink: 0;
}

/* 主题切换 */
.theme-options {
    display: flex;
    gap: 12px;
}
.theme-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}
.theme-btn:hover { transform: scale(1.1); }
.theme-btn.active { border-color: var(--accent); }
.theme-btn.day { background: #faf9f6; border: 1px solid #e8e6e1; }
.theme-btn.night { background: #1a1a1a; border: 1px solid #333; }
.theme-btn.eye { background: #c7edcc; border: 1px solid #a8d5ac; }
.theme-btn .check {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.2s;
}
.theme-btn.active .check { opacity: 1; }
.theme-btn.day .check { color: var(--accent); }
.theme-btn.night .check { color: #fff; }
.theme-btn.eye .check { color: #2d5a32; }

/* 字体大小 */
.font-size-control {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}
.font-size-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--body-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.font-size-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.font-size-display {
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 48px;
    text-align: center;
}

/* ===== 正文区域 ===== */
.reader-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}
.chapter-title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 1px;
}
.chapter-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 48px;
}
.chapter-body {
    font-size: var(--font-size);
    line-height: 1.9;
    transition: font-size 0.2s;
}
.chapter-body pre.prettyprint,.chapter-body pre.prettyprint {
    padding: 10px;
    border: 1px solid #eee;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chapter-body ol.linenums,.chapter-bodyol.linenums {
    color: #999;
    padding-left: 2.5em;
}

.chapter-body ol.linenums li,.chapter-body ol.linenums li {
    list-style-type: decimal;
}
.chapter-body .tag {
    color: #008;
    border: 0;
    background: transparent;
    font-size: inherit;
    padding: 0px;
    display: inherit;
}
.chapter-body .pln {
    color: #000;
}
.chapter-body .str {
    color: #080;
}

.chapter-body .kwd {
    color: #008;
}

.chapter-body .com {
    color: #800;
}

.chapter-body .typ {
    color: #606;
}

.chapter-body .lit {
    color: #066;
}

.chapter-body .pun,.chapter-body .opn,.chapter-body .clo {
    color: #660;
}

.chapter-body .atn {
    color: #606;
}

.chapter-body .atv {
    color: #080;
}

.chapter-body .dec,.chapter-body .var {
    color: #606;
}

.chapter-body .fun {
    color: red;
}

li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 {
    list-style-type: none;
}

li.L1,li.L3,li.L5,li.L7,li.L9 {
    background: #eee;
}
.chapter-body ol.linenums li code,.chapter-body ol.linenums li code {
    border: none;
    background: none;
    padding: 0;
}
.chapter-body pre,
.chapter-body code,
.chapter-body kbd {
    font-family: "YaHei Consolas Hybrid", Consolas, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
    margin-top: 0;
    margin-bottom: 24px;
}
.chapter-body pre.prettyprint, .chapter-body pre.prettyprint {
    padding: 10px;
    border: 1px solid #eee;
    background-color: var(--paper-light);
    white-space: pre-wrap;
    word-wrap: break-word;
}
.chapter-body p {
    text-indent: 2em;
    margin-bottom: var(--space-lg);
}
.chapter-body p:has(img) {
    text-indent: 0;
}
.chapter-body p img {
    max-width: 100%;
}
.chapter-body .poem {
    text-align: center;
    margin: 2em 0;
}
.chapter-body blockquote {
    background: var(--paper-light);
    padding: 2rem;
    border: 1px solid var(--border);
    margin-bottom: var(--space-lg);
}
.chapter-body blockquote p {
    text-indent: 0px;
}
.chapter-body blockquote p:last-child,
.chapter-body blockquote h3:last-child,
.chapter-body blockquote h4:last-child {
    margin-bottom: 0;
}
.chapter-body h1,
.chapter-body h2,
.chapter-body h3,
.chapter-body h4,
.chapter-body h5,
.chapter-body h6,
.chapter-body ul {
    text-indent: 2em;
    margin-bottom: var(--space-lg);
}
.chapter-body ul {
    list-style: none;
    padding-left: 0;
}
.chapter-body .poem p { text-indent: 0; margin-bottom: 0.3em; }
.chapter-body table {
    width: 100%;
    margin-bottom: var(--space-lg);
    border-collapse: collapse;
    border: 1px solid var(--border);
}

.chapter-body table th {
    background-color: rgba(0,0,0,0.1);
    white-space: nowrap;
}
.chapter-body table td:first-child {
    white-space: nowrap;
}
.chapter-body table td,
.chapter-body table th {
    border: 1px solid var(--border);
    vertical-align: bottom;
    padding: 10px;
    line-height: 1.72;
}
.chapter-body tbody tr:hover {
    background-color: rgba(0,0,0,0.06);
}
.chapter-body tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.04);
}
.chapter-body code {
    border: 1px solid #eee;
    background: #f6f6f6;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 100%;
    color: var(--cinnabar);
}
.chapter-body a {
    color: var(--jade);
}
.chapter-body a:hover {
    text-decoration: underline;
}

/* ===== 底部导航 ===== */
.reader-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--body-bg);
    border-top: 1px solid var(--border);
    z-index: 50;
    transition: background 0.3s, border-color 0.3s;
}
.reader-footer .footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.reader-footer .nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: transparent;
}
.reader-footer .nav-btn:hover { color: var(--accent); background: var(--border-light); }
.reader-footer .nav-btn:disabled { opacity: 0.3; cursor: default; }
.reader-footer .nav-btn:disabled:hover { color: var(--text-secondary); background: transparent; }
.reader-footer .nav-btn svg {
    width: 18px; height: 18px;
}
.reader-footer .center-btn {
    padding: 8px 20px;
    font-weight: 500;
}

/* ===== 目录侧边栏 ===== */
.toc-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.toc-overlay.open { opacity: 1; pointer-events: auto; }

.toc-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 320px;
    max-width: 85vw;
    background: var(--bg-tools);
    z-index: 70;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}
.toc-sidebar.open { transform: translateX(0); }

.toc-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.toc-header h3 {
    font-size: 16px;
    font-weight: 600;
}
.toc-header .close-btn {
    width: 32px; height: 32px;
    border: none; background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}
.toc-header .close-btn:hover { background: var(--border-light); }

.toc-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.toc-list::-webkit-scrollbar { width: 4px; }
.toc-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}
.toc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 10px 10px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.toc-item:hover {
    background: var(--border-light);
    color: var(--text);
}
.toc-item.active {
    background: var(--accent-light);
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 500;
}
.toc-item .num {
    width: 28px;
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.toc-item.active .num { color: var(--accent); }
.toc-item .name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {
    .reader-content { padding: 24px 20px 80px; }
    .chapter-title { font-size: 20px; }
    .chapter-subtitle { font-size: 14px; margin-bottom: 32px; }
    .reader-footer .nav-btn span { display: none; }
    .reader-footer .center-btn span { display: inline; }
}