/**
 * NEWS Page Styles
 * 深色主题，蓝色强调，列表式布局
 * 
 * @package Milestrong
 * @since 2.0.0
 */

/* ========================================
   Latest News 轮播区
   ======================================== */

.latest-news-section {
    background: #1a1d29;
    padding: 80px 0;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.latest-news-container {
    max-width: 1440px;
    margin: 0 auto;
}

/* 标题 */
.latest-news-header {
    text-align: center;
    margin-bottom: 60px;
}

.latest-news-title {
    font-size: 48px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 2px;
    line-height: 1.2;
}

.latest-news-title .title-highlight {
    color: #017fff;
}

.latest-news-title .title-normal {
    color: #ffffff;
}

/* 轮播容器 */
.latest-news-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: #0f1419;
    margin-bottom: 0;
}

.carousel-wrapper {
    overflow: hidden;
    border-radius: 20px;
    position: relative;
    width: 100%;
    isolation: isolate; /* 创建新的层叠上下文 */
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.carousel-item {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
}

.carousel-content {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 0;
    background: #16161e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    height: 380px;
    padding: 40px;
    align-items: center;
}

/* 轮播图片 */
.carousel-image {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.carousel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.carousel-item:hover .carousel-image img {
    transform: scale(1.05);
}

/* 轮播文本内容 */
.carousel-text {
    padding: 0 0 0 50px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    gap: 16px;
}

.carousel-text-top {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.carousel-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #a0aec0;
    margin: 0;
    font-weight: 400;
}

.carousel-date svg {
    color: #ffffff;
    width: 18px;
    height: 18px;
}

.carousel-title {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.5px;
}

.carousel-excerpt {
    font-size: 16px;
    line-height: 1.6;
    color: #a0aec0;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.carousel-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(45deg, #017fff, #0066cc);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
    align-self: flex-end;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(1, 127, 255, 0.3);
}

.carousel-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.carousel-button:hover::before {
    left: 100%;
}

.carousel-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(1, 127, 255, 0.4);
}

.carousel-button svg {
    transition: transform 0.3s ease;
}

.carousel-button:hover svg {
    transform: translateX(4px);
}

/* 轮播控制按钮 - 隐藏 */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none; /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 15;
    color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.carousel-prev:active,
.carousel-next:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

/* 确保按钮不会被其他元素遮挡 */
.carousel-prev svg,
.carousel-next svg {
    pointer-events: none;
    width: 20px;
    height: 20px;
}

/* 轮播指示器 - 移到卡片外部底部 */
.carousel-indicators {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    display: flex;
    gap: 12px;
    z-index: 5;
    justify-content: center;
    margin-top: 30px;
    padding: 0 20px;
}

.indicator-dot {
    width: 50px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.indicator-dot.active {
    background: #017fff;
    width: 50px;
    height: 4px;
    box-shadow: 0 0 10px rgba(1, 127, 255, 0.6);
}

.indicator-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* ========================================
   NEWS 列表区
   ======================================== */

.news-list-section {
    background: #0f1419;
    padding: 80px 0 100px;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.news-list-container {
    max-width: 1440px;
    margin: 0 auto;
}

/* 标题和筛选器 */
.news-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    gap: 30px;
}

.news-list-title {
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.news-list-filters {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* 下拉选择器统一样式 */
.filter-select {
    padding: 14px 40px 14px 20px;
    background: #1a2332;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
    min-width: 140px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.filter-select:hover {
    border-color: rgba(1, 127, 255, 0.5);
    background-color: #1f2937;
}

.filter-select:focus {
    border-color: #017fff;
    box-shadow: 0 0 0 3px rgba(1, 127, 255, 0.1);
}

/* 搜索输入框容器 */
.search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 14px 50px 14px 20px;
    background: #1a2332;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: #6b7280;
}

.search-input:hover {
    border-color: rgba(1, 127, 255, 0.5);
    background-color: #1f2937;
}

.search-input:focus {
    border-color: #017fff;
    box-shadow: 0 0 0 3px rgba(1, 127, 255, 0.1);
}

/* 搜索按钮 */
.search-button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.search-button:hover {
    color: #017fff;
}

.search-button svg {
    width: 20px;
    height: 20px;
}

/* NEWS 列表项容器 */
.news-list-items {
    display: flex;
    flex-direction: column;
}

/* NEWS 列表项 - 列表式布局，无边框 */
.news-item {
    background: transparent;
    border-bottom: none;
    padding: var(--divider-spacing) 0;
    border-radius: 0;
    position: relative;
}

/* 用伪元素画底部白线，不受 border-radius 影响 */
.news-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--divider-width);
    background-color: var(--divider-color);
}

.news-item:last-child::after {
    display: none;
}

.news-item:hover {
    background-color: var(--hover-bg);
    border-radius: 12px;
}

.news-item-link {
    display: grid;
    grid-template-columns: 280px 1fr auto;
    gap: 40px;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 0 20px;
}

/* 列表项图片 */
.news-item-image {
    width: 280px;
    height: 180px;
    overflow: hidden;
    border-radius: 8px;
    background: #1a2332;
    flex-shrink: 0;
}

.news-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 列表项内容 */
.news-item-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.news-item-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #a0aec0;
    margin: 0;
}

.news-item-date svg {
    color: #017fff;
    width: 18px;
    height: 18px;
}

.news-item-title {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    transition: color 0.3s ease;
}

.news-item:hover .news-item-title {
    color: #017fff;
}

.news-item-excerpt {
    font-size: 16px;
    line-height: 1.6;
    color: #a0aec0;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 圆形箭头按钮 */
.news-item-arrow {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(45deg, #017fff, #0066cc);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
}

.news-item:hover .news-item-arrow {
    background: var(--hover-button-bg);
}

/* 分页导航 */
.news-list-pagination {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-top: 60px;
}

.news-list-pagination::-webkit-scrollbar {
    display: none;
}

.news-list-pagination ul {
    display: flex;
    align-items: center;
    gap: 50px;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    width: max-content;
    min-width: 100%;
    justify-content: center;
}

.news-list-pagination li {
    margin: 0;
    flex-shrink: 0;
}

.news-list-pagination a,
.news-list-pagination span.current {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: #ffffff;
    color: #1a1a2e;
    border: none;
    border-radius: 50%;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    line-height: 1;
}

.news-list-pagination a:hover {
    background: #017fff;
    color: #ffffff;
    transform: none;
}

.news-list-pagination span.current {
    background: #017fff;
    color: #ffffff;
}

/* 省略号永不显示 */
.news-list-pagination .dots {
    display: none !important;
}

.news-list-pagination .prev span,
.news-list-pagination .next span,
.news-list-pagination span.disabled {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #ffffff;
    color: #1a1a2e;
    border-radius: 50%;
    opacity: 0.4;
    cursor: not-allowed;
}

/* 无新闻提示 */
.no-news-found {
    text-align: center;
    padding: 80px 20px;
    color: #718096;
    font-size: 18px;
}

/* ========================================
   响应式设计 - 大屏幕（1200px+）
   ======================================== */

@media (min-width: 1200px) {
    .carousel-prev,
    .carousel-next {
        width: 56px;
        height: 56px;
    }
    
    .carousel-prev {
        left: 25px;
    }
    
    .carousel-next {
        right: 25px;
    }
}

/* ========================================
   响应式设计 - 平板端（768px-1199px）
   ======================================== */

@media (max-width: 1199px) {
    /* Latest News 区 */
    .latest-news-container {
        padding: 0 30px;
    }
    
    .latest-news-title {
        font-size: 36px;
    }
    
    .carousel-content {
        grid-template-columns: 35% 65%;
        height: 450px;
    }
    
    .carousel-text {
        padding: 40px;
        gap: 16px;
        margin: 15px;
    }
    
    .carousel-title {
        font-size: 26px;
    }
    
    .carousel-excerpt {
        font-size: 15px;
    }
    
    .carousel-button {
        padding: 10px 28px;
        font-size: 15px;
    }
    
    .carousel-prev,
    .carousel-next {
        display: flex; /* 在平板端显示 */
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .carousel-prev {
        left: 15px;
    }
    
    .carousel-next {
        right: 15px;
    }
    
    .carousel-prev:hover,
    .carousel-next:hover {
        background: rgba(255, 255, 255, 1);
        transform: translateY(-50%) scale(1.05);
    }
    
    /* NEWS 列表区 */
    .news-list-container {
        padding: 0 30px;
    }
    
    .news-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .news-list-title {
        font-size: 40px;
    }
    
    .news-list-filters {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .filter-select {
        flex: 1;
        min-width: 120px;
    }
    
    .search-input-wrapper {
        flex: 1;
        min-width: 200px;
        max-width: none;
    }
    
    .news-item-link {
        grid-template-columns: 200px 1fr auto;
        gap: 30px;
        padding: 0 15px;
    }
    
    .news-item-image {
        width: 200px;
        height: 130px;
    }
    
    .news-item-title {
        font-size: 20px;
    }
    
    .news-item-excerpt {
        font-size: 15px;
    }
    
    .news-item-arrow {
        width: 44px;
        height: 44px;
    }
}

/* ========================================
   响应式设计 - 中等平板（900px-1199px）
   ======================================== */

@media (max-width: 1199px) and (min-width: 900px) {
    .carousel-prev,
    .carousel-next {
        width: 48px;
        height: 48px;
    }
    
    .carousel-prev {
        left: 20px;
    }
    
    .carousel-next {
        right: 20px;
    }
}

/* ========================================
   响应式设计 - 移动端（<768px）
   ======================================== */

@media (max-width: 767px) {
    /* Latest News 区 */
    .latest-news-section {
        padding: 60px 0;
    }
    
    .latest-news-container {
        padding: 0 20px;
    }
    
    .latest-news-header {
        margin-bottom: 40px;
    }
    
    .latest-news-title {
        font-size: 28px;
        letter-spacing: 1px;
    }
    
    .carousel-content {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .carousel-image {
        height: 250px;
    }
    
    .carousel-text {
        padding: 30px 20px;
        gap: 14px;
        margin: 0;
        border-radius: 0 0 16px 16px;
    }
    
    .carousel-date {
        font-size: 13px;
    }
    
    .carousel-title {
        font-size: 20px;
    }
    
    .carousel-excerpt {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }
    
    .carousel-button {
        padding: 10px 24px;
        font-size: 14px;
        width: 100%;
        justify-content: center;
    }
    
    /* 隐藏左右切换按钮 */
    .carousel-prev,
    .carousel-next {
        display: none;
    }
    
    .carousel-indicators {
        margin-top: 20px;
        gap: 8px;
        padding: 0 10px;
    }
    
    .indicator-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
    }
    
    .indicator-dot.active {
        width: 24px;
        height: 10px;
        border-radius: 5px;
    }
    
    /* NEWS 列表区 */
    .news-list-section {
        padding: 60px 0 80px;
    }
    
    .news-list-container {
        padding: 0 20px;
    }
    
    .news-list-header {
        margin-bottom: 40px;
    }
    
    .news-list-title {
        font-size: 32px;
        letter-spacing: 1px;
    }
    
    .news-list-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-select,
    .search-input-wrapper {
        width: 100%;
        min-width: auto;
        max-width: none;
    }
    
    .news-item {
        padding: calc(var(--divider-spacing) * 0.8) 0;
    }
    
    .news-item-link {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 10px;
    }
    
    .news-item-image {
        width: 100%;
        height: 200px;
    }
    
    .news-item-content {
        gap: 10px;
    }
    
    .news-item-date {
        font-size: 13px;
    }
    
    .news-item-title {
        font-size: 17px;
    }
    
    .news-item-excerpt {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }
    
    .news-item-arrow {
        width: 44px;
        height: 44px;
        align-self: flex-end;
    }
    
    /* 分页 */
    .news-list-pagination {
        margin-top: 40px;
    }
    
    .news-list-pagination ul {
        gap: 20px;
    }
    
    .news-list-pagination a,
    .news-list-pagination span.current {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
}

/* ========================================
   动画效果
   ======================================== */

/* 轮播切换动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.carousel-item.active {
    animation: slideIn 0.5s ease-out;
}

/* 列表项进入动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}



.loading {
    opacity: 0.6;
    pointer-events: none;
}
