/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #9F1F24;
    /* 头部深红 */
    --header-bg: #A82428;
    --secondary-orange: #E56A25;
    /* 按钮橙色 */
    --bg-beige: #FEF6E9;
    /* 简介背景米色 */
    --text-dark: #333333;
    --text-gray: #666666;
    --text-light: #888888;
    --footer-bg: #9A2023;
}

body {
    font-family: "Microsoft YaHei", "SimHei", sans-serif;
    background-color: #fff;
    color: var(--text-dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* 顶部 Top Bar */
.top-bar {
    background-color: #f5f5f5;
    font-size: 16px;
    color: #666;
    padding: 5px 0;
    border-bottom: 1px solid #ddd;
}

.top-bar .container {
    display: flex;
    justify-content: flex-end;
    /* 靠右对齐 */
    align-items: center;
    gap: 20px;
}

.top-links {
    margin-right: 20px;
}

.logo-small {
    font-weight: bold;
    color: var(--primary-red);
}

/* 主头部 Header */
.main-header {
    background-color: var(--header-bg);
    color: white;
    padding: 20px 0;
    background-image: linear-gradient(to right, #9F1F24, #B52A2E);
    /* 轻微渐变增加质感 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.site-title h1 {
    font-family: "SimSun", "Songti SC", serif;
    /* 宋体，更有历史感 */
    font-size: 36px;
    font-weight: normal;
    letter-spacing: 2px;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 5px 10px;
    border-radius: 15px;
    border: none;
    outline: none;
    width: 200px;
    background: rgba(255, 255, 255, 0.9);
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-red);
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.main-nav a {
    font-size: 18px;
    color: white;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s;
}

.main-nav a:hover {
    border-bottom-color: rgba(255, 255, 255, 0.8);
}

/* 轮播图 Hero Banner */
.hero-banner {
    width: 100%;
    height: 450px;
    overflow: hidden;
    position: relative;
    animation: fadeIn 1.5s ease-out;
}

.hero-image {
    width: 100%;
    height: 100%;
    position: relative;
    /* For overlay positioning */
    overflow: hidden;
    /* Contain the zoom effect */
}

/* Red Overlay */
.hero-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-red);
    opacity: 0.5;
    /* Adjusted: Higher value = less transparent (more red) */
    pointer-events: none;
    /* Allow clicks to pass through */
    z-index: 1;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
    /* Smooth zoom transition */
}

/* Zoom Effect on Hover */
.hero-banner:hover .hero-image img {
    transform: scale(1.05);
}

.hero-banner-stylized {
    width: 100%;
    height: 100%;
    background-color: #DE2910;
    background-image:
        radial-gradient(circle at 50% 100%, rgba(255, 222, 0, 0.4) 0%, transparent 60%),
        repeating-conic-gradient(from 0deg at 50% 80%, #DE2910 0deg 10deg, #FFDE00 10deg 20deg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2;
    /* Ensure dots are above the overlay */
}

.dot {
    width: 40px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.dot.active {
    background-color: #fff;
}

/* 简介区域 Intro */
.intro-section {
    background-color: var(--bg-beige);
    padding: 50px 0;
    position: relative;
    overflow: hidden;
}

.intro-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.intro-content h2 {
    font-family: "SimSun", serif;
    color: #943636;
    /* 这里的标题颜色有点偏棕红 */
    margin-bottom: 20px;
    font-size: 24px;
}

.intro-content p {
    margin-bottom: 15px;
    font-size: 15px;
    line-height: 1.8;
    color: #555;
}

/* 模拟背景大字水印 */
.watermark-text {
    position: absolute;
    right: 0;
    bottom: -20px;
    font-size: 150px;
    font-family: cursive;
    color: rgba(0, 0, 0, 0.03);
    z-index: 1;
    pointer-events: none;
    user-select: none;
}

/* 通用 Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0 20px 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.section-header h3 {
    font-size: 22px;
    font-weight: bold;
    color: var(--text-dark);
    display: flex;
    align-items: center;
}

.section-header .icon {
    color: var(--primary-red);
    /* 图标用红色 */
    margin-right: 10px;
    font-size: 24px;
}

.view-all {
    font-size: 14px;
    color: #999;
}

/* 最新资讯 News */
.news-list {
    margin-bottom: 40px;
}

.news-item {
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.news-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.news-date {
    color: var(--secondary-orange);
    font-size: 14px;
    margin-bottom: 5px;
}

.news-content h4 {
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: bold;
}

.news-content h4 a:hover {
    color: var(--secondary-orange);
}

.news-content p {
    font-size: 14px;
    color: var(--text-gray);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 本所资料 Resources Grid */
.resources-section {
    margin-bottom: 60px;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.card {
    display: flex;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 200px;
    /* 固定高度 */
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.card-img {
    width: 45%;
    position: relative;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    width: 55%;
    display: flex;
    flex-direction: column;
}

.card-title {
    background-color: var(--secondary-orange);
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
}

.card-desc {
    padding: 15px;
    font-size: 13px;
    color: var(--text-gray);
    line-height: 1.6;
    background-color: #F9F9F9;
    flex-grow: 1;
    overflow: hidden;
}

/* 页脚 Footer */
footer {
    background-color: var(--footer-bg);
    color: rgba(255, 255, 255, 0.6);
    padding-top: 0;
}

/* 顶部装饰线 */
.footer-decoration {
    height: 10px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="10" preserveAspectRatio="none"><rect width="100%" height="10" fill="%23C6A575"/></svg>');
    background-size: cover;
    margin-bottom: 30px;
    border-top: 3px solid #E1D4B9;
}

.footer-content {
    padding-bottom: 40px;
    text-align: center;
}

.footer-links {
    font-size: 18px;
    color: #fff;
    margin-bottom: 20px;
}

.footer-links a {
    margin: 0 10px;
}

.footer-info {
    font-size: 12px;
    display: flex;
    justify-content: center;
    gap: 30px;
}

/* 动画定义 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 滚动动画类 */
.scroll-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.scroll-hidden.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 针对不同元素的延迟，如果需要的话，可以在JS中动态添加delay，或者这里写死 */
.card.scroll-hidden:nth-child(1) {
    transition-delay: 0.1s;
}

.card.scroll-hidden:nth-child(2) {
    transition-delay: 0.2s;
}

.card.scroll-hidden:nth-child(3) {
    transition-delay: 0.3s;
}

.card.scroll-hidden:nth-child(4) {
    transition-delay: 0.4s;
}

/* =========================================
   History Page Styles
   ========================================= */

/* Sub Banner */
.sub-banner {
    width: 100%;
    height: 250px;
    background: url('images/hero_banner_gov.jpg') no-repeat center center;
    background-size: cover;
    position: relative;
    display: flex;
    align-items: center;
}

.sub-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(159, 31, 36, 0.8);
    /* Strong red overlay */
}

.sub-banner-text {
    position: relative;
    z-index: 1;
    color: white;
    max-width: 800px;
}

.sub-banner-text h2 {
    font-size: 36px;
    margin-bottom: 15px;
    font-family: "SimSun", serif;
}

.sub-banner-text p {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.9;
}

/* Breadcrumb */
.breadcrumb {
    padding: 15px 0;
    font-size: 12px;
    color: #999;
}

/* Page Layout */
.page-layout {
    display: flex;
    gap: 40px;
    margin-bottom: 60px;
    min-height: 600px;
}

/* Sidebar */
.sidebar {
    width: 260px;
    flex-shrink: 0;
}

.sidebar-menu {
    border-top: 2px solid var(--secondary-orange);
}

.sidebar-item {
    border-bottom: 1px solid #eee;
}

.sidebar-header {
    background-color: #f9f9f9;
    padding: 15px 20px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header .arrow {
    transition: transform 0.3s ease;
    display: inline-block;
}

.sidebar-item.active .sidebar-header .arrow {
    transform: rotate(180deg);
}

.sidebar-item.active .sidebar-header {
    background-color: var(--secondary-orange);
    color: white;
}

.sidebar-content {
    max-height: 0;
    overflow: hidden;
    background-color: #fff;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    /* Smoother, more natural easing */
}

.sidebar-item.active .sidebar-content {
    max-height: 500px;
    /* Arbitrary large height for animation */
    /* display: block; Removed to allow transition */
}

.sidebar-subitem {
    display: block;
    padding: 12px 20px 12px 40px;
    color: #666;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.3s;
}

.sidebar-subitem:hover,
.sidebar-subitem.active {
    color: var(--primary-red);
    background-color: #fff5f5;
    font-weight: bold;
}

.sidebar-subitem.active::before {
    content: '▶ ';
    font-size: 10px;
    margin-right: 5px;
}

/* Main Content */
.main-content {
    flex-grow: 1;
}

.content-header {
    background-color: var(--secondary-orange);
    padding: 15px 20px;
    color: white;
    margin-bottom: 30px;
}

.content-header h3 {
    font-size: 18px;
    font-weight: normal;
    margin: 0;
}

.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.article-content p {
    margin-bottom: 20px;
    text-align: justify;
}

.section-divider {
    border-left: 4px solid var(--primary-red);
    padding-left: 10px;
    margin: 40px 0 20px;
    font-weight: bold;
    color: #333;
    font-size: 16px;
}

.historical-image {
    margin-bottom: 40px;
    text-align: center;
    background: #f9f9f9;
    padding: 10px;
    border: 1px solid #eee;
}

.historical-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 10px;
}

.caption {
    font-size: 13px;
    color: #666;
    text-align: left;
    padding: 0 10px;
}

/* Link Grid (Research Page) */
.link-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.link-item {
    display: block;
    padding: 15px 10px;
    border-bottom: 1px solid #eee;
    color: var(--secondary-orange);
    font-size: 16px;
    transition: all 0.3s;
    position: relative;
}

.link-item::after {
    content: '▶';
    font-size: 10px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #ddd;
    transition: color 0.3s;
}

.link-item:hover {
    color: var(--primary-red);
    background-color: #fff9f9;
    padding-left: 20px;
    /* Slight shift on hover */
}

.link-item:hover::after {
    color: var(--primary-red);
}

/* =========================================
   Mobile Responsiveness
   ========================================= */
@media (max-width: 768px) {

    /* Global Container */
    .container {
        width: 100%;
        padding: 0 20px;
    }

    /* Top Bar */
    .top-bar .container {
        justify-content: center;
        flex-wrap: wrap;
    }

    .top-links {
        margin-right: 0;
        margin-bottom: 5px;
        text-align: center;
    }

    /* Main Header */
    .header-content {
        flex-direction: column;
        align-items: center;
        padding-bottom: 20px;
    }

    .site-title h1 {
        font-size: 28px;
        text-align: center;
        margin-bottom: 15px;
    }

    .header-right {
        align-items: center;
        width: 100%;
    }

    .search-box input {
        width: 100%;
        max-width: 300px;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        margin-top: 15px;
    }

    .main-nav a {
        font-size: 16px;
    }

    /* Hero Banner */
    .hero-banner {
        height: 250px;
        /* Smaller banner on mobile */
    }

    .watermark-text {
        font-size: 80px;
        /* Smaller watermark */
        bottom: 0;
    }

    /* Page Layout (Sidebar + Content) */
    .page-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        margin-bottom: 30px;
    }

    /* Grids */
    .resource-grid {
        grid-template-columns: 1fr;
    }

    .link-grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-content {
        padding: 0 20px 40px;
    }

    .footer-info {
        flex-direction: column;
        gap: 10px;
    }

    .footer-links {
        font-size: 14px;
    }

    /* Mobile Floating Sidebar */
    #mobile-menu-btn {
        display: block;
        position: fixed;
        top: 80px;
        /* Below header */
        left: 10px;
        z-index: 1001;
        background-color: var(--primary-red);
        color: white;
        padding: 8px 12px;
        border-radius: 4px;
        cursor: pointer;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        font-size: 14px;
    }

    #sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    #sidebar-overlay.active {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        /* Hidden by default */
        width: 260px;
        height: 100vh;
        background: white;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
        overflow-y: auto;
        padding-top: 20px;
        /* Space for top content */
    }

    .sidebar.active {
        left: 0;
        /* Slide in */
    }
}

/* Hide mobile elements on desktop */
#mobile-menu-btn,
#sidebar-overlay {
    display: none;
}