﻿/* CSS变量定义 */
:root {
    --primary-color: #9AFF00;
    --text-dark: #333333;
    --text-gray: #666666;
    --text-light: #999999;
    --background-light: #F9F9F9;
    --background-white: #ffffff;
    --border-color: #333;
    --max-width: 1200px;
    --container-padding: 20px;
    --section-spacing: 80px;
    --border-radius: 8px;
    --font-size-large: 28px;
    --font-size-medium: 18px;
    --font-size-small: 16px;
    --font-size-tiny: 12px;
    --line-height-base: 1.6;
    --transition: all 0.3s ease;
}

/* 全局样式重置 */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: var(--line-height-base);
    color: var(--text-dark);
    word-wrap: break-word;
    overflow-wrap: break-word;
}


button {
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

/* 通用容器样式 */
.container-box {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
}

/* 通用标题样式 */
.section-title {
    font-size: var(--font-size-large);
    font-weight: bold;
    color: var(--text-dark);
    word-wrap: break-word;
    hyphens: auto;
    margin-bottom: 20px;
}

/* 按钮样式 */
.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-dark);
    font-weight: bold;
    font-size: var(--font-size-medium);
    padding: 15px 30px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    white-space: nowrap;
    display: inline-block;
    text-align: center;
    min-width: fit-content;
}

.btn-primary:hover {
    background-color: #8AEF00;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--primary-color);
    color: var(--text-dark);
    font-weight: bold;
    font-size: var(--font-size-tiny);
    padding: 12px 25px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    white-space: nowrap;
    display: inline-block;
    text-align: center;
    min-width: fit-content;
}

.btn-secondary:hover {
    background-color: #8AEF00;
    transform: translateY(-2px);
}

/* 头部横幅区域 */
.hero-banner {
    width: 100%;
    height: 60vh;
    min-height: 400px;
    max-height: 600px;
    background-image: url(../images/saishizixun/saishizixun_1_1.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 新闻中心区域 */
.news-center {
    padding: var(--section-spacing) 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 20px;
}

.news-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    min-width: 0;
}

.tab-btn {
    background-color: transparent;
    color: var(--text-gray);
    font-size: var(--font-size-medium);
    padding: 8px 20px;
    border: none;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn.news-tabs-active {
    background-color: var(--primary-color);
    color: var(--text-dark);
    font-weight: bold;
}

.tab-btn:hover:not(.news-tabs-active) {
    background-color: #f0f0f0;
}

.tab-arrow {
    margin-left: 15px;
    flex-shrink: 0;
}

.tab-arrow img {
    width: 28px;
    height: 33px;
}

.news-content {
    display: none;
}

.news-content-selected {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 8vw, 100px);
    margin-top: 60px;
}

/* 主要新闻卡片 */
.featured-news {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.news-image {
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.news-image img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.news-image:hover img {
    transform: scale(1.05);
}

.news-details {
    display: flex;
    gap: 20px;
    min-width: 0;
}

.news-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    text-align: center;
    flex-shrink: 0;
}

.news-date .day {
    font-size: var(--font-size-large);
    font-weight: bold;
    color: var(--text-dark);
    line-height: 1;
}

.news-date .month {
    font-size: var(--font-size-small);
    color: var(--text-gray);
    line-height: 1;
    margin-top: 5px;
}

.news-info {
    padding: 0 20px;
    flex: 1;
    min-width: 0;
    text-align: center;
}

.news-title {
    font-size: clamp(20px, 4vw, var(--font-size-large));
    font-weight: normal;
    margin: 0 0 15px 0;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.news-excerpt {
    color: var(--text-gray);
    font-size: var(--font-size-medium);
    margin: 0 0 25px 0;
    line-height: var(--line-height-base);
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 新闻列表 */
.news-list {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.news-item {
    display: flex;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    transition: var(--transition);
    min-width: 0;
}

.news-item:last-child {
    border-bottom: 1px solid var(--border-color);
}

.news-item:hover {
    background-color: #f9f9f9;
    padding-left: 15px;
    padding-right: 15px;
    margin-left: -15px;
    margin-right: -15px;
    border-radius: var(--border-radius);
}

.news-date-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 12px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    cursor: pointer;
    flex-shrink: 0;
}

.news-date-sidebar:hover {
    background-color: var(--primary-color);
}

.news-date-sidebar .year {
    font-size: var(--font-size-small);
    color: var(--text-gray);
    line-height: 1;
}

.news-date-sidebar .date {
    font-size: 18px;
    color: var(--text-dark);
    font-weight: normal;
    line-height: 1;
    margin-top: 5px;
}

.news-content-sidebar {
    flex: 1;
    padding-left: 20px;
    min-width: 0;
}

.news-title-small {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: normal;
    margin: 0 0 10px 0;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.news-excerpt-small {
    color: var(--text-gray);
    font-size: var(--font-size-small);
    margin: 0;
    line-height: var(--line-height-base);
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 最新公告区域 */
.announcements {
    background-color: var(--background-light);
    padding: var(--section-spacing) 0;
}

.announcement-card {
    background-color: var(--background-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: minmax(280px, 340px) 1fr;
    gap: clamp(20px, 5vw, 40px);
    padding: clamp(30px, 5vw, 56px) clamp(30px, 5vw, 64px);
    transition: var(--transition);
}

.announcement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.announcement-image {
    overflow: hidden;
    border-radius: var(--border-radius);
}

.announcement-image img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.announcement-image:hover img {
    transform: scale(1.05);
}

.announcement-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.announcement-title {
    font-size: clamp(20px, 4vw, 26px);
    font-weight: bold;
    margin: 0 0 15px 0;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.announcement-time {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
}

.announcement-text {
    color: var(--text-gray);
    font-size: var(--font-size-small);
    margin: 0 0 25px 0;
    line-height: var(--line-height-base);
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 注册和推荐区域 */
.registration-section {
    padding: var(--section-spacing) 0;
}

.registration-content {
    display: grid;
    grid-template-columns: 1fr minmax(300px, 518px);
    gap: clamp(40px, 8vw, 80px);
    align-items: center;
    margin-bottom: var(--section-spacing);
}

.registration-info {
    min-width: 0;
}

.registration-text {
    color: var(--text-gray);
    font-size: var(--font-size-small);
    margin: 0 0 30px 0;
    line-height: var(--line-height-base);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.registration-image {
    /* border: 10px solid var(--primary-color); */
    /* border-radius: 10px; */
    /* aspect-ratio: 3/2; */
}


.registration-image {
    position: relative;
    background: #f8f9fa;
  }
.registration-image::before {
    content: "";
    position: absolute;
    top: -10px;
    right: -10px;
    width: 50%;
    height: 50%;
    background: var(--primary-color);
    z-index: -1;
  }
.registration-image::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: -10px;
    width: 50%;
    height: 50%;
    background: var(--primary-color);
    z-index: -1;
  }
  

.registration-image img {
    width: 100%;
    height: auto;
}

.recommendations-banner {
    width: 100%;
}

/* 移动端特殊样式 */
body.mobile {
    font-size: 14px;
}

body.mobile .container {
    padding: 0 10px;
}

body.mobile .section-title {
    font-size: 20px;
    text-align: center;
}

body.mobile .news-content {
    margin-top: 30px;
}

body.mobile .news-item {
    padding: 20px 0;
}

body.mobile .announcement-card {
    padding: 20px 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body.mobile .btn-primary,
body.mobile .btn-secondary {
    width: 100%;
    margin: 10px 0;
}

/* 长文本处理增强 */
.text-content {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

/* 图片响应式增强 */
.responsive-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: var(--transition);
}

/* 容器最大宽度限制 */
.content-wrapper {
    max-width: 100%;
    overflow-x: hidden;
}

/* 文本溢出处理 */
.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-multiline-ellipsis {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 弹性容器增强 */
.flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.flex-item {
    flex: 1;
    min-width: 0;
}

/* 表格响应式 */
.responsive-table {
    width: 100%;
    overflow-x: auto;
}

.responsive-table table {
    min-width: 600px;
}

/* 视频响应式 */
.responsive-video {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.responsive-video iframe,
.responsive-video video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ======================================
   新闻标签页切换动画效果
   ====================================== */

/* 标签按钮切换动画 */
.tab-btn {
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(154, 255, 0, 0.3), transparent);
    transition: left 0.6s ease;
}

.tab-btn:hover::before {
    left: 100%;
}

.tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tab-btn.news-tabs-active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(154, 255, 0, 0.3);
    animation: tabActivate 0.3s ease;
}

@keyframes tabActivate {
    0% {
        transform: scale(1);
        background-color: var(--primary-color);
    }
    50% {
        transform: scale(1.05);
        background-color: #BEFF20;
    }
    100% {
        transform: scale(1);
        background-color: var(--primary-color);
    }
}

/* 新闻内容区域切换动画 */
.news-content {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
}

.news-content-selected {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    position: relative;
    z-index: 2;
    animation: contentSlideIn 0.5s ease;
}

@keyframes contentSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 新闻内容容器包装 */
.news-content-wrapper {
    position: relative;
    min-height: 400px;
}

/* 淡入淡出效果增强 */
.news-content.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.news-content.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease 0.1s;
}

/* 新闻卡片入场动画 */
.featured-news,
.news-item {
    opacity: 0;
    transform: translateY(20px);
    animation: itemFadeIn 0.6s ease forwards;
}

.news-content-selected .featured-news {
    animation-delay: 0.1s;
}

.news-content-selected .news-item:nth-child(1) {
    animation-delay: 0.2s;
}

.news-content-selected .news-item:nth-child(2) {
    animation-delay: 0.3s;
}

.news-content-selected .news-item:nth-child(3) {
    animation-delay: 0.4s;
}

.news-content-selected .news-item:nth-child(4) {
    animation-delay: 0.5s;
}

@keyframes itemFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 标签箭头动画 */
.tab-arrow {
    transition: transform 0.3s ease;
}

.news-tabs:hover .tab-arrow {
    transform: translateX(5px);
}

.tab-arrow img {
    transition: all 0.3s ease;
    filter: brightness(1);
}

.tab-arrow:hover img {
    filter: brightness(1.2) saturate(1.1);
    transform: scale(1.1);
}

/* 加载动画 */
.news-content.loading {
    position: relative;
}

.news-content.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 响应式动画优化 */
@media (max-width: 768px) {
    .news-content-selected {
        margin-top: 0;
    }
    
    .tab-btn::before {
        display: none;
    }
    
    .tab-btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .news-content {
        transform: translateY(10px);
    }
    
    @keyframes contentSlideIn {
        0% {
            opacity: 0;
            transform: translateY(15px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    @keyframes itemFadeIn {
        0% {
            opacity: 0;
            transform: translateY(10px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* 禁用动画的情况（用户偏好设置或性能考虑） */
@media (prefers-reduced-motion: reduce) {
    .tab-btn,
    .news-content,
    .featured-news,
    .news-item,
    .tab-arrow,
    .tab-arrow img {
        transition: none !important;
        animation: none !important;
    }
    
    .news-content {
        transform: none;
    }
    
    .news-content-selected {
        transform: none;
    }
}

/* 打印样式 */
@media print {
    .hero-banner {
        background: #f0f0f0;
        height: 200px;
    }
    
    .btn-primary,
    .btn-secondary {
        background: #ccc !important;
        color: #000 !important;
    }
    
    .news-image,
    .announcement-image,
    .registration-image {
        page-break-inside: avoid;
    }
    
    /* 打印时禁用所有动画 */
    .tab-btn,
    .news-content,
    .featured-news,
    .news-item {
        transition: none !important;
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

/* 点击反馈效果 */
.tab-btn.clicked {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

@keyframes tabActivate {
    0% {
        transform: scale(1);
        background-color: var(--primary-color);
    }
    50% {
        transform: scale(1.05);
        background-color: #BEFF20;
    }
    100% {
        transform: scale(1);
        background-color: var(--primary-color);
    }
}

/* 新闻内容区域切换动画 */
.news-content {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
}

.news-content-selected {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    position: relative;
    z-index: 2;
    animation: contentSlideIn 0.5s ease;
}


/* 响应式设计 */
@media (max-width: 1200px) {
    :root {
        --max-width: 90%;
    }
    
    .news-content {
        gap: 60px;
    }
}

@media (max-width: 1024px) {
    :root {
        --section-spacing: 60px;
    }
    
    .news-content {
        grid-template-columns: 1fr;
        gap: 50px;
        margin-top: 0;
    }
    
    .announcement-card {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .registration-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    
    .news-tabs {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    :root {
        --container-padding: 15px;
        --section-spacing: 50px;
        --font-size-large: 24px;
        --font-size-medium: 16px;
        --font-size-small: 14px;
    }


    
    .hero-banner {
        height: 50vh;
        min-height: 300px;
    }
    
    .section-header {
        margin-bottom: 30px;
        gap: 20px;
        flex-direction: column;
    }
    
    .news-tabs {
        gap: 5px;
    }
    
    .tab-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .news-details {
        flex-direction: column;
        gap: 15px;
    }
    
    .news-date {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        min-width: auto;
        display: none;
    }
    
    .news-item {
        flex-direction: column;
        gap: 15px;
        padding: 25px 0;
    }
    
    .news-date-sidebar {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
        min-width: auto;
        padding: 8px 12px;
        width: fit-content;
    }
    
    .news-content-sidebar {
        padding-left: 0;
    }
    
    .announcement-card {
        padding: 25px 20px;
    }
    
    .registration-image {
        min-height: 250px;
    }
}

@media (max-width: 640px) {
    .news-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .tab-arrow {
        margin-left: 0;
        margin-right: 10px;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    :root {
        --container-padding: 12px;
        --section-spacing: 40px;
        --font-size-large: 22px;
        --font-size-medium: 15px;
        --font-size-small: 13px;
    }
    
    .hero-banner {
        height: 40vh;
        min-height: 250px;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .news-tabs {
        align-items: stretch;
        gap: 10px;
    }
    
    .tab-btn {
        text-align: center;
        justify-self: stretch;
    }
    
    .tab-arrow {
        align-self: center;
        order: 0;
        margin: 0;
    }
    
    .announcement-card {
        padding: 20px 15px;
    }
    
    .registration-image {
        min-height: 200px;
    }
    
    .recommendations-banner {
        height: 200px;
    }
}

/* 高分辨率屏幕优化 */
@media (min-width: 1400px) {
    :root {
        --max-width: 1200px;
    }
}

/* 超宽屏幕优化 */
@media (min-width: 1920px) {
    .hero-banner {
        max-height: 800px;
    }
}
