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

:root {
    --primary-red: #8B0000;
    --deep-red: #A52A2A;
    --gold: #B8860B;
    --cream: #FFF8F0;
    --dark-text: #2C1810;
}

body {
    font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
    background: var(--cream);
    color: var(--dark-text);
    line-height: 1.8;
    min-height: 100vh;
}

.hero {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--deep-red) 50%, var(--primary-red) 100%);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
}

.hero::before,
.hero::after {
    content: "✦ ✦ ✦";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2rem;
    color: rgba(255,215,0,0.6);
    letter-spacing: 1rem;
}

.hero::before { top: 1rem; }
.hero::after { bottom: 1rem; }

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 0.3rem;
    padding-top: 1rem;
}

.hero .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 900px;
    margin: 0 auto;
}

.nav-menu {
    background: linear-gradient(180deg, var(--primary-red) 0%, #6B0000 100%);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(139,0,0,0.3);
    display: flex;
    justify-content: center;
}

.nav-list {
    max-width: 1200px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 auto;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-item a:hover {
    background: rgba(255,255,255,0.1);
    border-bottom-color: #FFD700;
}

.nav-icon {
    width: 18px;
    height: 18px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.toc {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(139,0,0,0.1);
}

.toc-title {
    font-size: 1.2rem;
    color: var(--primary-red);
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 700;
}

.toc-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.5rem;
}

.toc-item {
    display: block;
    padding: 0.8rem 1rem;
    background: #fef9f3;
    border-radius: 8px;
    color: var(--dark-text);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.toc-item:hover {
    background: #fdf0e0;
    border-left-color: var(--deep-red);
    transform: translateX(5px);
}

.toc-item span {
    display: block;
    font-size: 0.85rem;
    color: #8B4513;
    margin-top: 0.2rem;
}

.dynasty-section {
    background: white;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(139,0,0,0.08);
    overflow: hidden;
}

.dynasty-header {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--deep-red) 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dynasty-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.dynasty-period {
    font-size: 0.9rem;
    opacity: 0.85;
}

.dynasty-intro {
    padding: 1.2rem 2rem;
    background: #fff9f0;
    border-bottom: 1px dashed #e0d0c0;
    font-size: 0.95rem;
    color: #5d4037;
    text-align: justify;
}

.content-category {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f0e6d3;
}

.content-category:last-child {
    border-bottom: none;
}

.category-title {
    font-size: 1.1rem;
    color: var(--primary-red);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gold);
    display: inline-block;
    font-weight: 600;
}

.sub-category-title {
    font-size: 1rem;
    color: var(--deep-red);
    margin: 1.5rem 0 1rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--gold);
    font-weight: 600;
}

.evidence-block {
    background: #f9f9f9;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.evidence-title {
    font-weight: 600;
    color: var(--primary-red);
    margin-bottom: 0.5rem;
}

.evidence-text {
    color: #444;
    line-height: 1.8;
}

.citation {
    background: #fafafa;
    border-radius: 8px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid #eee;
    transition: all 0.3s;
}

.citation:hover {
    box-shadow: 0 4px 15px rgba(139,0,0,0.1);
    transform: translateY(-2px);
}

.citation:last-child {
    margin-bottom: 0;
}

.citation-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.citation-label {
    background: var(--primary-red);
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-weight: 500;
}

.citation-source {
    color: var(--deep-red);
    font-weight: 600;
}

.citation-text {
    background: #fff;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.8rem;
    border-left: 3px solid var(--gold);
    font-style: italic;
    color: #333;
    position: relative;
}

.citation-text::before {
    content: """;
    position: absolute;
    top: -0.3rem;
    left: 0.5rem;
    font-size: 2rem;
    color: var(--deep-red);
    opacity: 0.2;
    font-family: serif;
}

.citation-explanation {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.8;
}

.summary-section {
    background: linear-gradient(135deg, #fff5f5 0%, #fff9f0 100%);
    padding: 1.5rem 2rem;
    border-top: 2px solid var(--gold);
}

.summary-title {
    font-size: 1.1rem;
    color: var(--primary-red);
    margin-bottom: 1rem;
    font-weight: 600;
}

.summary-content {
    font-size: 0.95rem;
    line-height: 2;
    color: #555;
}

.summary-content p {
    margin-bottom: 0.8rem;
}

.summary-content p:last-child {
    margin-bottom: 0;
}

.analysis-section {
    background: linear-gradient(135deg, #fff 0%, #fff8f0 100%);
}

.analysis-item {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #eee;
}

.analysis-item:last-child {
    border-bottom: none;
}

.analysis-item h4 {
    color: var(--primary-red);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0e0d0;
}

.analysis-item p {
    margin-bottom: 0.8rem;
    text-align: justify;
}

.analysis-item p:last-child {
    margin-bottom: 0;
}

.conclusion {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--deep-red) 100%);
    color: white;
    padding: 2.5rem 2rem;
    margin-top: 2rem;
    border-radius: 12px;
    text-align: center;
}

.conclusion h3 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.2rem;
}

.conclusion p {
    font-size: 1rem;
    line-height: 2;
    opacity: 0.95;
    max-width: 900px;
    margin: 0 auto 1rem;
}

.conclusion p:last-child {
    margin-bottom: 0;
}

.site-footer {
    background: linear-gradient(180deg, #3d0000 0%, #2d0000 100%);
    color: white;
    padding: 3rem 2rem 0;
    margin-top: 3rem;
}

.footer-main {
    max-width: 1000px;
    margin: 0 auto 2rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    width: 50px;
    height: 50px;
    background: var(--gold);
    color: var(--primary-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
}

.footer-brand-text h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.footer-brand-text p {
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-link-group h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #FFD700;
}

.footer-link-group a {
    display: block;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.25rem 0;
    transition: all 0.3s;
}

.footer-link-group a:hover {
    color: #FFD700;
    transform: translateX(5px);
}

.footer-bottom {
    background: rgba(0,0,0,0.2);
    padding: 0.8rem 2rem;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.9;
}

.footer-bottom a {
    color: #FFD700;
    text-decoration: none;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

.back-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--deep-red);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(139,0,0,0.3);
    transition: all 0.3s;
    text-decoration: none;
    z-index: 50;
}

.back-top:hover {
    background: var(--primary-red);
    transform: translateY(-3px);
}

/* 移动端响应式样式 */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem;
        letter-spacing: 0.1rem;
    }

    .hero .subtitle {
        font-size: 0.95rem;
        padding: 0 0.5rem;
    }

    .container {
        padding: 1rem;
    }

    /* 移动端导航菜单 - 移除sticky，让它正常流动 */
    .nav-menu {
        position: relative !important;
        display: flex;
        justify-content: center;
    }

    .nav-list {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-item a {
        padding: 0.5rem 0.4rem;
        font-size: 0.7rem;
        border-bottom: none;
        border-left: none;
    }

    .nav-item a:hover {
        background: rgba(255,255,255,0.1);
        border-bottom-color: #FFD700;
        border-left-color: transparent;
    }

    .nav-icon {
        width: 16px;
        height: 16px;
    }

    .dynasty-header {
        flex-direction: column;
        text-align: center;
    }

    .dynasty-header, .dynasty-intro, .content-category, .citation {
        padding: 1rem 1.2rem;
    }

    .footer-main {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .footer-brand {
        flex-direction: column;
    }
}

/* 图片画廊样式 - 适合阅读的展示方式 */
.image-gallery {
    margin: 2.5rem 0;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #f9f5f0 100%);
    border-radius: 12px;
    border: 1px solid rgba(139, 0, 0, 0.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.gallery-title {
    font-size: 1.3rem;
    color: var(--primary-red);
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--gold);
    letter-spacing: 0.15rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.gallery-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(139, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}

.gallery-caption {
    padding: 1rem;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
    text-align: center;
    background: #fafafa;
    border-top: 1px solid #eee;
}

/* 移动端响应式 - 图片画廊 */
@media (max-width: 768px) {
    .image-gallery {
        margin: 1.5rem 0;
        padding: 1rem;
    }

    .gallery-title {
        font-size: 1.1rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .gallery-item img {
        height: 200px;
    }

    .gallery-caption {
        font-size: 0.85rem;
        padding: 0.8rem;
    }
}

/* 平板设备 */
@media (min-width: 769px) and (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 留言系统样式 */
.comments-section {
    background: linear-gradient(135deg, #fff 0%, #f9f5f0 100%);
    padding: 3rem 2rem;
    margin-top: 2rem;
}

.comments-container {
    max-width: 800px;
    margin: 0 auto;
}

.comments-title {
    font-size: 1.6rem;
    color: var(--primary-red);
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: 0.15rem;
}

.comments-subtitle {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* 留言表单 */
.comment-form {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row input {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-row input:focus {
    outline: none;
    border-color: var(--primary-red);
}

.comment-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    min-height: 120px;
    resize: vertical;
    transition: border-color 0.3s;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-red);
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.char-count {
    color: #999;
    font-size: 0.85rem;
}

.submit-btn {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--deep-red) 100%);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.3);
}

/* 留言列表 */
.comments-list {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.no-comments {
    text-align: center;
    color: #999;
    padding: 2rem;
}

.comment-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--deep-red) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-name {
    font-weight: 600;
    color: var(--dark-text);
}

.comment-date {
    color: #999;
    font-size: 0.85rem;
}

.comment-content {
    color: #555;
    line-height: 1.6;
    word-break: break-word;
}

/* 留言系统移动端响应式 */
@media (max-width: 768px) {
    .comments-section {
        padding: 2rem 1rem;
    }

    .comments-title {
        font-size: 1.3rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-row input {
        width: 100%;
    }

    .comment-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .comment-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* 后台管理入口 */
.admin入口 {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99;
}

.admin入口 a {
    background: var(--primary-red);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.admin入口 a:hover {
    background: var(--deep-red);
}

/* 后台管理面板 */
.admin-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.admin-panel-content {
    background: white;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--deep-red) 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.admin-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.admin-login {
    padding: 2rem;
    text-align: center;
}

.admin-login h4 {
    margin-bottom: 1rem;
    color: var(--dark-text);
}

.admin-login input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.admin-login button {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

.admin-login button:hover {
    background: var(--deep-red);
}

.admin-hint {
    margin-top: 1rem;
    color: #999;
    font-size: 0.85rem;
}

.admin-main {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.admin-stats {
    background: #f5f5f5;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.admin-list {
    max-height: 400px;
    overflow-y: auto;
}

.admin-comment-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    gap: 1rem;
}

.admin-comment-info {
    flex: 1;
}

.admin-comment-info strong {
    color: var(--dark-text);
}

.admin-comment-date {
    color: #999;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.admin-comment-content {
    margin: 0.5rem 0 0;
    color: #555;
    font-size: 0.95rem;
}

.admin-delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    flex-shrink: 0;
}

.admin-delete-btn:hover {
    background: #c82333;
}

/* 后台管理移动端 */
@media (max-width: 768px) {
    .admin-panel-content {
        width: 95%;
        max-height: 90vh;
    }

    .admin-comment-item {
        flex-direction: column;
    }

    .admin-delete-btn {
        width: 100%;
        margin-top: 0.5rem;
    }
}
