/* =========================================
   1. 全局色彩与基础变量
========================================= */
:root {
    --primary-green: #2B4A2C; 
    --primary-green-hover: #1E3520;
    --honor-red: #A3262A;
    --honor-gold: #CFA972;
    --text-dark: #333333;
    --text-gray: #666666;
    --bg-body: #F4F6F4;
    --bg-white: #FFFFFF;
}

/* =========================================
   2. 基础页面重置
========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background-color: var(--bg-body); color: var(--text-dark); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; }

/* =========================================
   3. 顶部导航栏
========================================= */
.main-header { background-color: var(--primary-green); color: var(--bg-white); box-shadow: 0 2px 10px rgba(0,0,0,0.15); position: sticky; top: 0; z-index: 1000; }
.main-header .container { display: flex; justify-content: space-between; align-items: center; height: 70px; }
.header-logo-img { height: 45px; width: auto; display: block; }
.nav-links { display: flex; gap: 30px; }
.nav-links a { font-size: 16px; font-weight: 500; transition: color 0.3s ease; padding: 5px 0; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--honor-gold); }
.nav-links a::after { content: ''; position: absolute; bottom: -5px; left: 0; width: 0%; height: 3px; background-color: var(--honor-gold); transition: width 0.3s ease; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.mobile-menu-btn { display: none; font-size: 28px; cursor: pointer; user-select: none; background: none; border: none; color: inherit; }

/* =========================================
   4. 首屏轮播图 (严格对齐 1200px 版芯，纯净淡入淡出版)
========================================= */
.hero-carousel {
    position: relative;
    width: 100%; 
    height: 440px; /* 恢复为精致的盒子高度 */
    background-color: var(--bg-body); /* 核心：背景色与网页底色融为一体 */
    overflow: hidden; 
    padding-top: 20px; /* 顶部留出呼吸空间 */
    margin-bottom: 30px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
}

.carousel-container {
    width: 90%; 
    max-width: 1200px; /* 核心：严格限制宽度为 1200px，与下方新闻卡片完美对齐 */
    height: 100%; 
    margin: 0 auto; 
    position: relative; 
    z-index: 1;
}

.carousel-track {
    position: absolute; width: 100%; height: 100%; top: 0; left: 0; 
}

.carousel-item {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 8px; /* 核心：恢复精致的圆角 */
    overflow: hidden; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.08); /* 增加微弱的弥散阴影，让它浮在背景上 */
    transition: opacity 0.8s ease; /* 保持高级的淡入淡出动画 */
}
.carousel-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.carousel-item::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    z-index: 2; pointer-events: none;
}

/* === 状态控制 (纯透明度切换，无侧边干扰) === */
.item-main { opacity: 1; z-index: 3; visibility: visible; transform: none; }
.item-prev, .item-next { opacity: 0 !important; visibility: hidden !important; z-index: 1; transform: none; pointer-events: none; }

.carousel-track > * { position: absolute; transform: none; }
.carousel-track .item-main { opacity: 1; z-index: 3; visibility: visible; }
.carousel-track .item-prev, .carousel-track .item-next { opacity: 0 !important; visibility: hidden !important; z-index: 1; }

/* 标题文字居中悬浮 */
.carousel-item-content {
    position: absolute; bottom: 35px; 
    left: 0; 
    width: 100%; 
    text-align: center; color: var(--bg-white); z-index: 4; padding: 0 20px;
    transition: all 0.6s ease;
}
.item-prev .carousel-item-content, .item-next .carousel-item-content { opacity: 0; }
.carousel-item-content h2 { font-size: 1.8rem; font-weight: 700; letter-spacing: 2px; margin-bottom: 0; }
.carousel-item-content h2 a { color: var(--bg-white); transition: color 0.3s; }
.carousel-item-content h2 a:hover { color: var(--honor-gold); }

/* 精准长条指示器 */
.carousel-indicators {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    z-index: 10; display: flex; gap: 6px; align-items: center;
}
.carousel-indicators .dot {
    width: 15px; height: 4px; background-color: rgba(255, 255, 255, 0.4); 
    border-radius: 4px; cursor: pointer; border: none; padding: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
}
.carousel-indicators .dot.active {
    width: 30px; background-color: #ffffff; box-shadow: 0 0 5px rgba(255,255,255,0.4); 
}

/* =========================================
   5. 公共区块样式 
========================================= */
.section-padding { padding: 30px 0; background-color: var(--bg-body); }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid var(--primary-green); padding-bottom: 10px; margin-bottom: 20px; }
.section-title { font-size: 22px; color: var(--primary-green); position: relative; }
.section-title::before { content: ''; position: absolute; left: -15px; top: 5px; bottom: 5px; width: 5px; background-color: var(--honor-red); }
.more-link { font-size: 14px; color: var(--text-gray); transition: color 0.3s; }
.more-link:hover { color: var(--honor-gold); }

/* =========================================
   6. 左右分栏与全宽布局
========================================= */
.main-layout { display: flex; justify-content: space-between; align-items: stretch; gap: 40px; }
.content-left { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content-right { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }

/* =========================================
   7. 军训动态新闻列表
========================================= */
.news-list { display: flex; flex-direction: column; gap: 15px; }
.news-item { display: flex; background-color: var(--bg-white); border-radius: 6px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.05); transition: transform 0.3s, box-shadow 0.3s; }
.news-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.news-img-box { width: 220px; flex-shrink: 0; overflow: hidden; }
.news-img-box img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.news-item:hover .news-img-box img { transform: scale(1.05); }
.news-content { padding: 15px 20px; display: flex; flex-direction: column; justify-content: center; }
.news-content h3 { font-size: 1.15rem; margin-bottom: 8px; line-height: 1.4; }
.news-content h3 a { transition: color 0.3s; }
.news-content h3 a:hover { color: var(--primary-green); }
.news-meta { font-size: 0.8rem; color: #999; margin-bottom: 8px; display: flex; gap: 12px; }
.news-desc { color: var(--text-gray); font-size: 0.9rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* =========================================
   8. 侧边栏模块 (Widget) 完美截断版
========================================= */
.widget { background-color: var(--bg-white); border-radius: 6px; padding: 15px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); border-top: 3px solid var(--primary-green); }
.widget-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px dashed #ddd; }
.widget-title { font-size: 1.1rem; color: var(--primary-green); margin: 0; padding: 0; border: none; }
.widget-more-link { font-size: 0.85rem; color: var(--text-gray); transition: color 0.3s ease; }
.widget-more-link:hover { color: var(--primary-green); }
.notice-list li { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed #eee; }
.notice-list li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.notice-list a { font-size: 0.95rem; color: var(--text-dark); transition: color 0.3s; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; text-overflow: ellipsis; position: relative; padding-left: 14px; text-align: left; }
.notice-list a::before { content: ''; position: absolute; left: 0; top: 8px; width: 4px; height: 4px; background-color: var(--primary-green); border-radius: 50%; }
.notice-list a:hover { color: var(--primary-green); }

/* =========================================
   9. 军训掠影 (单行横向滑动相册)
========================================= */
.gallery-section { background-color: var(--bg-body); }
.waterfall-grid { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 20px; padding-bottom: 15px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--primary-green) #e0e0e0; }
.waterfall-grid::-webkit-scrollbar { height: 6px; }
.waterfall-grid::-webkit-scrollbar-track { background: #e0e0e0; border-radius: 3px; }
.waterfall-grid::-webkit-scrollbar-thumb { background-color: var(--primary-green); border-radius: 3px; }
.gallery-item { flex: 0 0 calc((100% - 60px) / 4); background-color: var(--bg-white); border-radius: 6px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; scroll-snap-align: start; }
.gallery-item:hover { transform: translateY(-5px); box-shadow: 0 8px 18px rgba(0,0,0,0.12); }
.gallery-img-box { width: 100%; overflow: hidden; }
.gallery-img-box img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; transition: transform 0.5s ease; }
.gallery-item:hover .gallery-img-box img { transform: scale(1.05); }
.gallery-info { padding: 12px; text-align: center; background-color: var(--bg-white); }
.item-title { font-size: 0.95rem; font-weight: bold; color: var(--text-dark); transition: color 0.3s ease; display: block; }
.item-title:hover { color: var(--primary-green); }

/* =========================================
   10. 国防教育 & 军歌嘹亮
========================================= */
.symmetrical-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.half-column { display: flex; flex-direction: column; }
.text-news-list { display: flex; flex-direction: column; gap: 15px; }
.text-news-list li { display: flex; justify-content: space-between; align-items: center; padding-bottom: 15px; border-bottom: 1px dashed #eee; }
.text-news-list li:last-child { border-bottom: none; }
.text-news-list li a { flex: 1; font-size: 1rem; color: var(--text-dark); transition: color 0.3s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 20px; position: relative; padding-left: 15px; }
.text-news-list li a::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 5px; height: 5px; background-color: var(--primary-green); border-radius: 50%; }
.text-news-list li a:hover { color: var(--primary-green); }
.text-news-list li .date { font-size: 0.9rem; color: #999; white-space: nowrap; }

/* =========================================
   11. 网页页脚 (无缝衔接)
========================================= */
.main-footer { background-color: var(--primary-green-hover); color: #d1d6d2; border-top: 4px solid var(--honor-gold); margin-top: 0; }
.footer-bottom { padding: 25px 0; text-align: center; font-size: 0.9rem; line-height: 1.8; }
.footer-bottom p { margin-bottom: 5px; }
.footer-bottom p:last-child { margin-bottom: 0; }
.footer-bottom a { color: #d1d6d2; transition: color 0.3s; margin: 0 5px; }
.footer-bottom a:hover { color: var(--honor-gold); }

/* =========================================
   12. 移动端自适应
========================================= */
@media (max-width: 992px) {
    .main-layout { flex-direction: column; gap: 20px; }
    .content-right { width: 100%; }
    .gallery-item { flex: 0 0 calc((100% - 20px) / 2.2); }
}

@media (max-width: 768px) {
    .header-logo-img { height: 35px; }
    .nav-links { display: none; position: absolute; top: 70px; left: 0; width: 100%; background-color: var(--primary-green-hover); flex-direction: column; gap: 0; text-align: center; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
    .nav-links.show { display: flex; }
    .nav-links a { display: block; padding: 15px 0; border-top: 1px solid rgba(255,255,255,0.05); }
    .nav-links a::after { display: none; }
    .mobile-menu-btn { display: block; }

    /* 手机端精简版轮播修正 */
    .hero-carousel { height: 240px; padding: 0; margin-bottom: 20px; }
    .carousel-item-content { bottom: 20px; padding: 0 15px; }
    .carousel-item-content h2 { font-size: 1.1rem; margin-bottom: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .carousel-indicators { bottom: 8px; }

    .news-item { flex-direction: row; align-items: stretch; }
    .news-img-box { width: 110px; height: 85px; margin: 12px 0 12px 12px; border-radius: 4px; }
    .news-content { padding: 12px; justify-content: space-between; }
    .news-content h3 { font-size: 0.95rem; line-height: 1.4; margin-bottom: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .news-desc { display: none; }
    .news-meta { margin-bottom: 0; font-size: 0.75rem; }
    .waterfall-grid { gap: 15px; padding-bottom: 10px; }
    .gallery-item { flex: 0 0 85%; }
    .symmetrical-layout { grid-template-columns: 1fr; gap: 40px; }
    .footer-bottom { padding: 20px 10px; font-size: 0.85rem; line-height: 1.6; }
}