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

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Serif SC", serif;
    background-color: #f7f0e8;
    color: #3d2c1e;
    line-height: 1.9;
    transition: background-color 0.3s, color 0.3s;
}

a {
    color: #b87333;
    text-decoration: none;
}
a:hover {
    color: #8a5a2a;
    text-decoration: underline;
}

/* ===== 暗色模式 ===== */
body.dark {
    background-color: #1a1612;
    color: #d4c8b8;
}
body.dark a {
    color: #c9a87c;
}
body.dark a:hover {
    color: #e8d5b8;
}
body.dark .header {
    background-color: #24201a;
    border-bottom-color: #3d352e;
}
body.dark .header a {
    color: #c9a87c;
}
body.dark .header a:hover {
    color: #e8d5b8;
}
body.dark .meta-info {
    background: #2a2420;
    border-color: #3d352e;
}
body.dark .meta-info .meta-tag {
    color: #b0a090;
}
body.dark .meta-info .meta-tag a {
    color: #c9a87c;
}
body.dark .meta-info .meta-tag a:hover {
    color: #e8d5b8;
}
body.dark .meta-info .meta-divider {
    color: #4a4038;
}
body.dark .footer {
    background-color: #24201a;
    border-top-color: #3d352e;
}
body.dark .footer a {
    color: #c9a87c;
}
body.dark .footer a:hover {
    color: #e8d5b8;
}
body.dark .breadcrumb {
    color: #8a7a6a;
}
body.dark .breadcrumb a {
    color: #c9a87c;
}
body.dark .breadcrumb a:hover {
    color: #e8d5b8;
}
body.dark .breadcrumb .separator {
    color: #6a5a4a;
}
body.dark .page-title {
    color: #e8d5b8;
}
body.dark .language-switcher button {
    color: #b0a090;
}
body.dark .language-switcher button.active {
    color: #e8d5b8;
    border-bottom-color: #c9a87c;
}
body.dark .language-switcher button:hover {
    color: #e8d5b8;
}
body.dark .font-btn {
    color: #b0a090;
}
body.dark .font-btn.active {
    color: #e8d5b8;
}
body.dark .font-btn:hover {
    color: #e8d5b8;
}
body.dark .back-to-top {
    background-color: #3d352e;
    color: #d4c8b8;
}
body.dark .back-to-top:hover {
    background-color: #5a4a3a;
}
body.dark .copyright {
    color: #8a7a6a;
}
body.dark .content-body {
    color: #d4c8b8;
}
body.dark .content-body .poem-line {
    color: #d4c8b8;
}
body.dark .content-body .poem-stanza {
    border-bottom-color: #3d352e;
}
body.dark .notes-section {
    border-top-color: #3d352e;
}
body.dark .notes-section h3 {
    color: #e8d5b8;
}
body.dark .notes-section .note-item {
    color: #b0a090;
    border-bottom-color: #3d352e;
}
body.dark .notes-section .note-item .note-label {
    color: #c9a87c;
}
body.dark .page-nav {
    border-top-color: #3d352e;
}
body.dark .page-nav a {
    color: #b0a090;
    border-color: #3d352e;
}
body.dark .page-nav a:hover {
    background-color: #3d352e;
    color: #e8d5b8;
}
body.dark .poetry-image {
    border-color: #3d352e;
}
body.dark .theme-btn {
    color: #b0a090;
}
body.dark .theme-btn:hover {
    color: #e8d5b8;
}

/* ===== 顶部导航 ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #f7f0e8;
    border-bottom: 1px solid #e8ddd0;
    height: 64px;
    display: flex;
    align-items: center;
    transition: background-color 0.3s, border-color 0.3s;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: #b87333;
}
.logo a:hover {
    color: #8a5a2a;
    text-decoration: none;
}
.logo i {
    font-size: 24px;
    color: #b8860b;
}
.logo span {
    letter-spacing: 2px;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    border-right: 1px solid #ddd6ce;
    padding-right: 14px;
}
.font-btn {
    background: none;
    border: none;
    padding: 4px 10px;
    font-size: 14px;
    cursor: pointer;
    color: #6a5a4a;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s;
}
.font-btn:hover {
    color: #3d2c1e;
}
.font-btn.active {
    color: #b87333;
    background: rgba(184, 115, 51, 0.1);
}
.font-btn[data-size="small"] { font-size: 12px; }
.font-btn[data-size="medium"] { font-size: 15px; }
.font-btn[data-size="large"] { font-size: 18px; }
.theme-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    font-size: 18px;
    cursor: pointer;
    color: #6a5a4a;
    transition: all 0.2s;
    border-radius: 4px;
}
.theme-btn:hover {
    color: #3d2c1e;
}
.language-switcher {
    display: flex;
    gap: 2px;
}
.language-switcher button {
    background: none;
    border: none;
    padding: 4px 12px;
    font-size: 13px;
    cursor: pointer;
    color: #8a7a6a;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.language-switcher button.active {
    color: #b87333;
    border-bottom-color: #b87333;
}
.language-switcher button:hover {
    color: #3d2c1e;
}

/* ===== 主内容 ===== */
.main {
    min-height: calc(100vh - 180px);
    padding: 20px 0 40px;
}
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== 面包屑 ===== */
.breadcrumb {
    font-size: 14px;
    color: #8a7a6a;
    padding: 6px 0 14px;
    border-bottom: 1px solid #eee8e0;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.breadcrumb a {
    color: #b87333;
}
.breadcrumb a:hover {
    color: #8a5a2a;
    text-decoration: underline;
}
.breadcrumb .separator {
    color: #c0b0a0;
    padding: 0 4px;
}

/* ===== 标题 ===== */
.page-title {
    font-size: 30px;
    font-weight: 700;
    color: #3d2c1e;
    margin-bottom: 8px;
    line-height: 1.3;
    letter-spacing: 2px;
    text-align: center;
    transition: color 0.3s;
}

/* ===== 元信息 ===== */
.meta-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px 16px;
    margin-bottom: 22px;
    padding: 10px 16px;
    background: #f5efe8;
    border-radius: 10px;
    border: 1px solid #eee6dc;
    transition: background 0.3s, border-color 0.3s;
}
.meta-info .meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #5a4a3a;
    white-space: nowrap;
}
.meta-info .meta-tag i {
    font-size: 13px;
    color: #b87333;
    opacity: 0.8;
}
.meta-info .meta-tag a {
    color: #b87333;
    font-weight: 500;
}
.meta-info .meta-tag a:hover {
    color: #8a5a2a;
    text-decoration: underline;
}
.meta-info .meta-divider {
    color: #d5c8bc;
    font-size: 14px;
    font-weight: 200;
    flex-shrink: 0;
}

/* ===== 配图 ===== */
.poetry-image {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid #e8ddd0;
    background: #f0e8e0;
    transition: border-color 0.3s;
}
.poetry-image img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 420px;
    object-fit: cover;
}

/* ===== 诗词正文 ===== */
.content-body {
    font-size: 17px;
    line-height: 2.2;
    color: #3d2c1e;
    padding: 4px 0;
    transition: color 0.3s;
}
.content-body .poem-line {
    text-align: center;
    padding: 4px 0;
    letter-spacing: 3px;
    font-family: "Source Han Serif SC", "华文楷体", "KaiTi", serif;
    transition: color 0.3s;
}
.content-body .poem-stanza {
    margin-bottom: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #eee8e0;
    transition: border-color 0.3s;
}
.content-body .poem-stanza:last-child {
    border-bottom: none;
}

/* ===== 注释 ===== */
.notes-section {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #eee8e0;
    transition: border-color 0.3s;
}
.notes-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #3d2c1e;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}
.notes-section h3 i {
    color: #b87333;
}
.notes-section .note-item {
    padding: 6px 0 6px 20px;
    font-size: 15px;
    color: #5a4a3a;
    border-bottom: 1px dashed #eee8e0;
    line-height: 1.8;
    transition: color 0.3s, border-color 0.3s;
}
.notes-section .note-item:last-child {
    border-bottom: none;
}
.notes-section .note-item .note-label {
    font-weight: 600;
    color: #b87333;
    margin-right: 6px;
}

/* ===== 上下页导航 ===== */
.page-nav {
    display: flex;
    justify-content: space-between;
    padding: 20px 0 10px;
    border-top: 1px solid #eee8e0;
    margin-top: 28px;
    gap: 20px;
    transition: border-color 0.3s;
}
.page-nav a {
    padding: 8px 20px;
    border: 1px solid #e0d8d0;
    border-radius: 6px;
    font-size: 14px;
    color: #6a5a4a;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.page-nav a:hover {
    background-color: #f0e8e0;
    color: #3d2c1e;
    border-color: #c0b0a0;
    text-decoration: none;
}
.page-nav .nav-prev { margin-right: auto; }
.page-nav .nav-next { margin-left: auto; }

/* ===== 底部 ===== */
.footer {
    background-color: #f7f0e8;
    border-top: 1px solid #e8ddd0;
    padding: 28px 0 20px;
    transition: background-color 0.3s, border-color 0.3s;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.footer-links a {
    font-size: 14px;
    color: #6a5a4a;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.footer-links a:hover {
    color: #3d2c1e;
    text-decoration: none;
}
.copyright {
    text-align: center;
    font-size: 13px;
    color: #aaa090;
    transition: color 0.3s;
}

/* ===== 返回顶部 ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background-color: #e8e0d8;
    color: #6a5a4a;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    z-index: 999;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background-color: #d0c8c0;
    color: #3d2c1e;
}

/* ===== 移动端 ===== */
@media (max-width: 768px) {
    .header { height: 60px; }
    .header-inner { padding: 0 12px; }
    .logo a { font-size: 16px; gap: 6px; }
    .logo i { font-size: 17px; }
    .logo span { font-size: 14px; letter-spacing: 1px; }
    .header-right { gap: 8px; }
    .toolbar { padding-right: 8px; }
    .font-btn { padding: 4px 8px; font-size: 13px; }
    .font-btn[data-size="small"] { font-size: 11px; }
    .font-btn[data-size="medium"] { font-size: 14px; }
    .font-btn[data-size="large"] { font-size: 17px; }
    .theme-btn { font-size: 16px; padding: 4px 6px; }
    .language-switcher button { font-size: 12px; padding: 4px 8px; }
    .container { padding: 0 14px; }
    .breadcrumb { font-size: 12px; padding: 4px 0 10px; margin-bottom: 14px; }
    .page-title { font-size: 22px; }
    .meta-info { padding: 8px 12px; gap: 4px 10px; }
    .meta-info .meta-tag { font-size: 12px; }
    .meta-info .meta-divider { font-size: 12px; }
    .content-body { font-size: 15px; line-height: 2.0; }
    .content-body .poem-line { letter-spacing: 2px; }
    .poetry-image { border-radius: 8px; margin-bottom: 16px; }
    .poetry-image img { max-height: 260px; }
    .notes-section { margin-top: 20px; padding-top: 14px; }
    .notes-section h3 { font-size: 16px; }
    .notes-section .note-item { font-size: 14px; padding-left: 14px; }
    .page-nav { flex-direction: column; gap: 8px; padding: 14px 0 8px; margin-top: 20px; }
    .page-nav a { font-size: 13px; padding: 6px 14px; justify-content: center; }
    .page-nav .nav-prev { margin-right: 0; }
    .page-nav .nav-next { margin-left: 0; }
    .footer-links { gap: 16px; }
    .footer-links a { font-size: 12px; }
    .copyright { font-size: 11px; }
    .back-to-top { width: 38px; height: 38px; font-size: 15px; bottom: 20px; right: 20px; }
}

@media (max-width: 480px) {
    .header { height: 54px; }
    .header-inner { padding: 0 8px; }
    .logo a { font-size: 13px; gap: 4px; }
    .logo i { font-size: 14px; }
    .logo span { font-size: 12px; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .header-right { gap: 4px; }
    .toolbar { padding-right: 4px; }
    .font-btn { padding: 3px 6px; font-size: 12px; min-width: 24px; text-align: center; }
    .font-btn[data-size="small"] { font-size: 10px; }
    .font-btn[data-size="medium"] { font-size: 13px; }
    .font-btn[data-size="large"] { font-size: 16px; }
    .theme-btn { font-size: 14px; padding: 3px 4px; }
    .language-switcher button { font-size: 10px; padding: 3px 5px; min-width: 24px; }
    .container { padding: 0 10px; }
    .page-title { font-size: 19px; letter-spacing: 1px; }
    .meta-info { padding: 6px 10px; gap: 3px 8px; }
    .meta-info .meta-tag { font-size: 11px; }
    .meta-info .meta-divider { font-size: 10px; }
    .content-body { font-size: 14px; }
    .content-body .poem-line { letter-spacing: 1px; }
    .poetry-image img { max-height: 200px; }
}