/* 基础样式 */
body {
    font-family: 'SimSun', '宋体', serif;
    margin: 0;
    padding: 0;
    color: #333;
    line-height: 1.6;
}

.container {
            width: 85%;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 15px;
        }

h1, h2, h3 {
    font-weight: normal;
}

a {
    text-decoration: none;
    color: inherit;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #8B0000;
    color: white;
    border-radius: 4px;
    transition: background 0.3s;
}

.btn:hover {
    background: #A52A2A;
}

/* 导航栏样式 */
        .navbar {
            background-color: #8B0000;
            color: white;
            padding: 15px 0;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
        }
        
        .navbar .container {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .logo {
            font-size: 1.8rem;
            font-weight: bold;
            letter-spacing: 2px;
            font-family: 'Ma Shan Zheng', cursive;
            display: flex;
            align-items: center;
        }
        
        .logo i {
            margin-right: 10px;
            font-size: 1.5rem;
        }
        
        .nav-links {
            display: flex;
            list-style: none;
        }
        
        .nav-links li {
            margin-left: 30px;
        }
        
        .nav-links a {
            position: relative;
            padding: 5px 0;
            font-size: 1.1rem;
        }
        
        .nav-links a::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 0;
            height: 2px;
            background: white;
            transition: width 0.3s;
        }
        
        .nav-links a:hover::after {
            width: 100%;
        }
        
        .nav-links .active {
            font-weight: bold;
            border-bottom: 2px solid white;
        }
        
/* 主横幅样式 */
.hero {
    position: relative; /* 确保绝对定位的子元素相对于此元素定位 */
    height: 80vh;
    overflow: hidden;
    display: flex; /* 使用flex布局便于居中 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1; /* 确保视频在底层 */
}

/* 半透明覆盖层 */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */
    z-index: 0; /* 在视频上方，内容下方 */
}

.hero-content {
    position: relative; /* 相对于hero定位 */
    z-index: 1; /* 确保内容在最上层 */
    text-align: center; /* 文本居中 */
    color: white; /* 文字颜色 */
    padding: 20px;
    max-width: 800px; /* 可选，限制内容最大宽度 */
    margin: 0 auto; /* 水平居中 */
}


.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    letter-spacing: 5px;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

/* 内容区域样式 */
.section {
    padding: 60px 0;
    border-bottom: 1px solid #eee;
}

.section h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 50px;
    color: #8B0000;
}

/* 时间线样式 */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: relative;
    padding-left: 50px;
}

/* 时间线轴线 */
.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #8B0000;
}

/* 时间线项目 */
.timeline-item {
    position: relative;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* 时间线节点标记 */
.timeline-item::before {
    content: '';
    position: absolute;
    left: -40px;
    top: 30px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #8B0000;
    border: 3px solid white;
}

.timeline-item h3 {
    color: #8B0000;
    margin-top: 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.timeline-img {
    margin-top: 15px;
}

.timeline-img img {
    width: 100%;
    max-width: 300px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* 书法体例网格 */
.styles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.style-card {
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.style-card:hover {
    transform: translateY(-5px);
}

.style-card h3 {
    color: #8B0000;
    margin-top: 0;
}

/* 名家展示容器 */
.masters-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 20px 0;
}

.masters-carousel {
    display: flex;
    width: max-content; /* 关键：让内容宽度由子元素决定 */
    gap: 20px;
    will-change: transform; /* 提升动画性能 */
}
/* 添加这个类通过JS控制 */
.scrolling {
    animation: scroll 30s linear infinite;
}

.masters-carousel:hover {
    animation-play-state: paused;
}

.masters-carousel::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%); /* 向左移动50% */
    }
}

/* 名家卡片 */
.master {
    min-width: 180px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s;
    flex: 0 0 auto;
}

.master:hover {
    transform: translateY(-5px);
}

.master-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 15px;
    border: 3px solid #8B0000;
}

.master-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.master h3 {
    color: #8B0000;
    margin: 0 0 5px;
    text-align: center;
}

.master p {
    margin: 0;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}


/* 导航箭头 */
.carousel-prev, .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(139, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 2;
}

.carousel-prev {
    left: 0;
}

.carousel-next {
    right: 0;
}

/* 名家详情区 */
.master-detail {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.8);
            justify-content: center;
            align-items: center;
            z-index: 100;
        }
        .detail-content {
             position: relative;
            background: white;
            padding: 20px;
            border-radius: 8px;
            width: 80%;
            max-width: 600px;
        }

.close-detail {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #8B0000;
    transition: color 0.3s;
}

.close-detail:hover {
    color: #A52A2A;
}

.detail-img {
    width: 250px;
    margin-right: 20px;
    flex-shrink: 0;
}

.detail-img img {
    width: 100%;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.detail-text {
    flex: 1;
}

.detail-text h3 {
    color: #8B0000;
    margin-top: 0;
}

.famous-works h4 {
    margin-bottom: 5px;
    color: #8B0000;
}

.famous-works ul {
    padding-left: 20px;
}

/* 画廊网格布局 */
/* 画廊网格布局 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* 作品容器 */
.artwork {
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    background: white;
    transition: all 0.3s ease;
}

/* 图片部分 */
.artwork-image {
    cursor: pointer;
}
.artwork-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s;
}
.artwork-image:hover img {
    transform: scale(1.05);
}
.artwork-image p {
    text-align: center;
    padding: 10px;
    margin: 0;
    background: #f5f5f5;
}

/* 作品内容部分 - 初始隐藏 */
.artwork-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 15px;
    transition: max-height 0.5s ease, padding 0.5s ease;
}

/* 展开状态 */
.artwork.active .artwork-content {
    max-height: 1000px; /* 足够大的值容纳内容 */
    padding: 15px;
    border-top: 1px solid #eee;
}

/* 作品标题 */
.artwork-content h3 {
    color: #8B0000;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ddd;
}

/* 作品正文 */
.work-text {
    line-height: 1.8;
    text-align: justify;
}
.work-text p {
    margin-bottom: 15px;
    text-indent: 2em;
}


/* 全文显示区域样式 */
.fulltext-display {
    display: none; /* 默认隐藏 */
    margin-top: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    max-height: 0;
    opacity: 0;
    transition: all 0.5s ease;
    max-height: 70vh; /* 限制最大高度为视窗的70% */
    overflow-y: auto; /* 启用垂直滚动条 */
    padding: 20px;
    scroll-behavior: smooth; /* 平滑滚动 */
}

.fulltext-display.active {
    display: block; /* 显示时设为block */
    max-height: 1000px; /* 足够大的值 */
    opacity: 1;
    padding: 20px;
}

.fulltext-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.fulltext-header h3 {
    color: #8B0000;
    margin: 0;
}

.close-fulltext {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0 10px;
}

.close-fulltext:hover {
    color: #8B0000;
}

.fulltext-content {
    font-family: "楷体", "STKaiti", serif;
    font-size: 1.2rem;
    line-height: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.fulltext-content p {
    text-indent: 2em;
    margin-bottom: 15px;
}

/* 自定义滚动条样式 */
.fulltext-display::-webkit-scrollbar {
    width: 8px;
}
.fulltext-display::-webkit-scrollbar-thumb {
    background: #8B0000;
    border-radius: 4px;
}

/* 长文特别样式 */
.section-nav {
    padding: 10px;
    background: #f5f5f5;
    margin-bottom: 20px;
    border-radius: 4px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-link {
    color: #8B0000;
    margin: 0 5px;
    text-decoration: none;
    font-size: 0.9em;
}

.nav-link:hover {
    text-decoration: underline;
}

/* 段落增强可读性 */
.fulltext-content p {
    margin-bottom: 1.2em;
    line-height: 1.8;
    text-align: justify;
}

/* 页脚样式 */
        .footer {
            background: #2c1d14;
            color: #d9c7b4;
            padding: 60px 0 20px;
        }
        
        .footer-content {
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            margin-bottom: 30px;
        }
        
        .footer-section {
            width: 32%;
            min-width: 250px;
            margin-bottom: 30px;
        }
        
        .footer-section h3 {
            font-size: 1.4rem;
            margin-bottom: 25px;
            color: #e8d8c9;
            position: relative;
            padding-bottom: 15px;
        }
        
        .footer-section h3::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 50px;
            height: 2px;
            background: #8B0000;
        }
        
        .footer-links {
            list-style: none;
            padding-left: 0;
        }
        
        .footer-links li {
            margin-bottom: 12px;
        }
        
        .footer-links a {
            color: #d9c7b4;
            transition: color 0.3s;
            display: flex;
            align-items: center;
        }
        
        .footer-links a i {
            margin-right: 10px;
            font-size: 0.9rem;
        }
        
        .footer-links a:hover {
            color: white;
        }
        
        .social-links {
            display: flex;
            gap: 15px;
            margin-top: 20px;
        }
        
        .social-links a {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            background: rgba(139, 0, 0, 0.2);
            color: #d9c7b4;
            border-radius: 50%;
            font-size: 1.2rem;
            transition: all 0.3s;
        }
        
        .social-links a:hover {
            background: #8B0000;
            color: white;
            transform: translateY(-3px);
        }
        
        .copyright {
            text-align: center;
            padding-top: 30px;
            border-top: 1px solid #44362c;
            color: #a9927d;
            font-size: 0.95rem;
        }
        
        /* 响应式设计 */
        @media (max-width: 992px) {
            .modal-body {
                flex-direction: column;
            }
            
            .modal-image {
                height: 400px;
            }
        }
        
        @media (max-width: 768px) {
            .navbar .container {
                flex-direction: column;
            }
            
            .nav-links {
                margin-top: 20px;
                width: 100%;
                justify-content: center;
                flex-wrap: wrap;
            }
            
            .nav-links li {
                margin: 5px 15px;
            }
            
            .page-header h1 {
                font-size: 2.4rem;
            }
            
            .gallery-grid {
                grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            }
            
            .filter-row {
                flex-direction: column;
            }
            
            .footer-section {
                width: 100%;
            }
            
            .gallery-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 15px;
            }
        }
        
        @media (max-width: 480px) {
            .gallery-grid {
                grid-template-columns: 1fr;
            }
            
            .modal-stats {
                flex-wrap: wrap;
                justify-content: center;
            }
            
            .stat-count {
                font-size: 1.5rem;
            }
            
            .page-header h1 {
                font-size: 2rem;
            }
        }
        