/**
 * 团委网站首页样式（index.html 专用）
 * 配色参考：网上共青团·智慧团建 https://zhtj.youth.cn/zhtj/
 * - 主色：团委红 #E61919
 * - 页脚：深团委红渐变底 + 浅粉链接字（与通知公告等版块独立，勿随版块改色）
 */

:root {
    --tw-red: #E61919;
    --tw-red-dark: #c41414;
    --tw-red-deep: #951414;
    --tw-gold: #d4af37;
    --tw-gold-muted: #c9a227;
    --tw-text: #333;
    --tw-bg-page: #f0f4f8;
    /* 页脚专用：深红褐渐变（原站设定，与顶栏亮红区分） */
    --tw-footer-top: #721c1c;
    --tw-footer-bottom: #3d1010;
    --tw-footer-link: #f0c4c4;
    --tw-footer-title: #ffffff;
    --tw-footer-border: rgba(255, 255, 255, 0.12);
    --tw-footer-copy: rgba(255, 255, 255, 0.72);
}

/* ========== 基础（不依赖 body 类名，避免 JSP 母版去掉 class 后样式失效） ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    color: var(--tw-text);
    background: var(--tw-bg-page);
}

body img {
    max-width: 100%;
}

/* ========== 顶栏 ========== */
.site-header {
    background: linear-gradient(135deg, var(--tw-red) 0%, var(--tw-red-deep) 100%);
    color: #fff;
    padding: 16px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 20px;
    font-weight: bold;
}

/* 导航：红渐变；CMS 菜单（.menu-content）见 style/menu.css，结构：.main-nav > .container > nav.menu-content */
.main-nav {
    background: linear-gradient(90deg, var(--tw-red) 0%, var(--tw-red-dark) 100%);
    padding: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* 无 CMS 菜单组件时的占位 ul（避免与 .menu-content 重复） */
.main-nav:not(:has(.menu-content)) ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}

.main-nav:not(:has(.menu-content)) a {
    color: #fff;
    text-decoration: none;
    padding: 14px 20px;
    display: block;
    font-weight: 500;
}

.main-nav:not(:has(.menu-content)) a:hover {
    background: rgba(0, 0, 0, 0.12);
    color: #ffeb3b;
}

/* ========== 主内容 ========== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    background: linear-gradient(180deg, #fff9f5 0%, #ffffff 100%);
}

/* ========== 主轮播 ========== */
.hero-carousel-section {
    margin-bottom: 32px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(200, 16, 46, 0.12);
}

.hero-carousel {
    position: relative;
    width: 100%;
    height: 420px;
    overflow: hidden;
}

.hero-carousel-inner {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.hero-carousel-item {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-carousel-item::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    background: linear-gradient(transparent, rgba(200, 16, 46, 0.55));
}

.hero-carousel-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 40px;
    text-align: center;
    color: #fff;
    font-size: 22px;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    z-index: 2;
    padding: 0 20px;
}

.hero-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(200, 16, 46, 0.88);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.3s;
}

.hero-carousel-btn:hover {
    background: var(--tw-red);
    transform: translateY(-50%) scale(1.1);
}

.hero-carousel-btn.prev { left: 16px; }
.hero-carousel-btn.next { right: 16px; }

.hero-carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.hero-carousel-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s;
}

.hero-carousel-dots span.active {
    background: #fff;
    width: 28px;
    border-radius: 5px;
}

/* ========== 第二行 ========== */
.row-two {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 24px;
    margin-bottom: 32px;
}

.tuanxue-section {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border-left: 4px solid var(--tw-red);
}

.tuanxue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(90deg, var(--tw-red) 0%, #f03535 100%);
    color: #fff;
}

.tuanxue-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.tuanxue-header .more-link {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 14px;
}

.tuanxue-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 280px;
}

.tuanxue-carousel-wrap {
    padding: 16px;
    border-right: 1px solid #eee;
}

.tuanxue-mini-carousel {
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.tuanxue-mini-carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tuanxue-mini-imgs {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.tuanxue-mini-imgs img {
    width: 33%;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.tuanxue-list {
    padding: 16px;
    overflow-y: auto;
}

.tuanxue-list a {
    display: block;
    padding: 8px 0;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px dashed #eee;
    white-space: normal;
    word-break: break-all;
}

.tuanxue-list a:hover {
    color: var(--tw-red);
}

.notice-section {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border-left: 4px solid var(--tw-red);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 320px;
}

.notice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(90deg, var(--tw-red) 0%, #f03535 100%);
    color: #fff;
}

.notice-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.notice-header .more-link {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 14px;
}

.notice-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 14px 16px;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
}

.notice-body .scroll-content {
    flex: 1 1 auto;
    min-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.notice-body .scroll-content::-webkit-scrollbar {
    width: 6px;
}

.notice-body .scroll-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 6px;
}

.notice-body .scroll-content::-webkit-scrollbar-thumb {
    background: rgba(230, 25, 25, 0.28);
    border-radius: 6px;
}

.notice-body .scroll-content::-webkit-scrollbar-thumb:hover {
    background: rgba(230, 25, 25, 0.45);
}

/* 通知公告：卡片列表（左日期色块 + 标题省略 + 右箭头）；配合 components/通知公告-list.ftl */
.notice-body .article-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notice-body .article-list > li {
    margin: 0;
}

.notice-body .notice-card-link {
    display: flex;
    align-items: stretch;
    gap: 12px;
    min-height: 64px;
    padding: 10px 12px 10px 10px;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.notice-body .notice-card-link:hover {
    border-color: rgba(230, 25, 25, 0.35);
    box-shadow: 0 6px 18px rgba(230, 25, 25, 0.1);
    transform: translateY(-1px);
}

.notice-body .notice-card-link:hover .notice-card-arrow {
    opacity: 1;
    transform: translateX(2px);
    color: var(--tw-red);
}

.notice-body .notice-date-block {
    flex-shrink: 0;
    width: 58px;
    min-height: 56px;
    padding: 6px 4px;
    border-radius: 8px;
    background: linear-gradient(160deg, var(--tw-red) 0%, var(--tw-red-dark) 55%, var(--tw-red-deep) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.15;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.notice-body .notice-date-main {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.notice-body .notice-date-sub {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.92;
    margin-top: 3px;
}

.notice-body .notice-card-title {
    flex: 1;
    min-width: 0;
    align-self: center;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-body .notice-card-arrow {
    flex-shrink: 0;
    align-self: center;
    width: 22px;
    text-align: center;
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
    color: var(--tw-red);
    opacity: 0.55;
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

/* 旧版仅 <a>标题</a> 时的降级（无日期块） */
.notice-body .article-list > li > a:not(.notice-card-link) {
    display: block;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-body .article-list > li > a:not(.notice-card-link):hover {
    color: var(--tw-red);
    border-color: rgba(230, 25, 25, 0.35);
}

/* ========== 基层动态 ========== */
.grassroots-section {
    margin-bottom: 32px;
}

.section-title-bar {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--tw-red);
}

.section-title-bar h3 {
    margin: 0;
    font-size: 20px;
    color: var(--tw-red);
    font-weight: 600;
}

.section-title-bar .more-link {
    margin-left: auto;
    color: var(--tw-red);
    text-decoration: none;
    font-size: 14px;
}

.grassroots-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.grassroots-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 16px;
}

.grassroots-gallery img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
}

.grassroots-gallery .large-img {
    grid-column: span 2;
    height: 160px;
}

.grassroots-articles {
    padding: 20px;
}

.grassroots-articles .article-item {
    display: block;
    padding: 12px 0;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: color 0.2s;
    white-space: normal;
    word-break: break-all;
}

.grassroots-articles .article-item:hover {
    color: var(--tw-red);
}

.grassroots-articles .article-item .date {
    color: #999;
    font-size: 12px;
    margin-right: 12px;
}

/* ========== 学生活动 ========== */
.activity-section {
    margin-bottom: 32px;
}

.activity-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.activity-gallery {
    padding: 16px;
}

.activity-gallery img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
}

.activity-list {
    padding: 20px;
}

.activity-list .activity-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.activity-list .activity-item:hover {
    color: var(--tw-red);
    padding-left: 8px;
}

.activity-list .activity-item .thumb {
    width: 80px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 16px;
    flex-shrink: 0;
}

.activity-list .activity-item .info {
    flex: 1;
    min-width: 0;
}

.activity-list .activity-item .title {
    font-size: 15px;
    white-space: normal;
    word-break: break-all;
}

.activity-list .activity-item .date {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* ========== 视频 ========== */
.video-section {
    margin-bottom: 40px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.video-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(200, 16, 46, 0.15);
}

.video-card .cover {
    position: relative;
    height: 140px;
    overflow: hidden;
}

.video-card .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-card .cover::after {
    content: '▶';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(200, 16, 46, 0.92);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    padding-left: 4px;
}

.video-card .title {
    padding: 12px;
    font-size: 14px;
    color: #333;
    white-space: normal;
    word-break: break-all;
}

/* ========== 页脚：#f00 底 + var(--tw-red)→var(--tw-footer-bottom) 竖直渐变 ========== */
.site-footer {
    background-color: #ff0000;
    background-image: linear-gradient(180deg, var(--tw-red) 0%, var(--tw-footer-bottom) 100%);
    color: var(--tw-footer-link);
    padding: 32px 0 24px;
}

.site-footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    text-align: center;
}

.footer-links-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--tw-footer-title);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 24px;
    margin-bottom: 24px;
}

.footer-links a {
    color: var(--tw-footer-link);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.site-footer .copyright {
    padding-top: 20px;
    border-top: 1px solid var(--tw-footer-border);
    font-size: 13px;
    color: var(--tw-footer-copy);
    line-height: 1.8;
    text-align: center;
}

.site-footer .copyright p {
    margin: 4px 0;
}

/* ========== CMS 简单检索 / 搜索框（团委红，与全站一致） ========== */
.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.search-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.search-label-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.search-label {
    font-size: 13px;
    white-space: nowrap;
    color: var(--tw-text);
    font-weight: 500;
    margin: 0;
}

.search-input-group {
    display: flex;
    align-items: center;
}

.search-input-container {
    position: relative;
    display: inline-block;
}

.search-input {
    height: 34px;
    padding: 0 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 200px;
    max-width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.search-input:hover {
    border-color: #c8c8c8;
}

.search-input:focus {
    outline: none;
    border-color: var(--tw-red);
    box-shadow: 0 0 0 3px rgba(230, 25, 25, 0.18);
}

.search-button-container {
    display: flex;
    align-items: center;
}

.search-button {
    height: 34px;
    padding: 0 18px;
    background: linear-gradient(180deg, var(--tw-red) 0%, var(--tw-red-dark) 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.search-button:hover {
    background: linear-gradient(180deg, #f03535 0%, var(--tw-red) 100%);
    box-shadow: 0 2px 8px rgba(230, 25, 25, 0.35);
}

.search-button:active {
    background: var(--tw-red-deep);
    transform: translateY(1px);
    box-shadow: none;
}

.search-button-image {
    height: 34px;
    border: none;
    cursor: pointer;
    vertical-align: middle;
    background: none;
    padding: 0;
    border-radius: 6px;
    transition: opacity 0.2s;
}

.search-button-image:hover {
    opacity: 0.9;
}

.search-button-image img {
    height: 100%;
    vertical-align: middle;
    display: block;
    border-radius: 4px;
}

.search-hidden-fields {
    display: none;
}

.search-autocomplete-wrapper {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.search-autocomplete-span {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
}

.search-autocomplete-iframe {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    display: none;
    border: none;
    background: transparent;
}

@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .search-input {
        width: 100%;
        min-width: 0;
    }

    .search-button {
        width: 100%;
    }
}

.search-form.compact {
    gap: 6px;
}

.search-form.compact .search-input {
    height: 30px;
    padding: 0 10px;
    min-width: 160px;
}

.search-form.compact .search-button {
    height: 30px;
    padding: 0 12px;
    font-size: 13px;
}

.search-form.large {
    gap: 12px;
}

.search-form.large .search-input {
    height: 40px;
    padding: 0 16px;
    font-size: 16px;
    min-width: 240px;
}

.search-form.large .search-button {
    height: 40px;
    padding: 0 20px;
    font-size: 16px;
}

/* ========== 响应式 ========== */
@media (max-width: 992px) {
    .row-two { grid-template-columns: 1fr; }
    .grassroots-grid { grid-template-columns: 1fr; }
    .activity-layout { grid-template-columns: 1fr; }
    .video-grid { grid-template-columns: repeat(2, 1fr); }
    .tuanxue-body { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
    .hero-carousel { height: 260px; }
    .video-grid { grid-template-columns: 1fr; }

    .notice-body .notice-date-block {
        width: 52px;
        min-height: 52px;
    }

    .notice-body .notice-date-main {
        font-size: 13px;
    }

    .notice-body .notice-card-title {
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
}