@charset "UTF-8";

/* ============ Theme Variables ============ */
:root {
    --news-primary: #D7000F;
    --news-primary-dark: #b1000c;
    --news-primary-rgb: 215, 0, 15;
    --news-accent: #502c6c;
    --news-accent-dark: #3c2151;
    --news-bg: #f7f8fa;
    --news-card-bg: #ffffff;
    --news-text: #0C1B26;
    --news-text-light: #6c757d;
    --news-border: #e9ecef;
    --news-shadow: 0 2px 12px rgba(12, 27, 38, 0.06);
    --news-shadow-hover: 0 8px 24px rgba(215, 0, 15, 0.12);
    --news-radius: 12px;
}

/* ============ Section Styles ============ */
.news-list-section {
    padding: 30px 0 60px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.news-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 0 15px;
}

.news-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--news-text);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.news-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--news-accent), var(--news-primary));
    border-radius: 2px;
}

.news-subtitle {
    font-size: 15px;
    color: var(--news-text-light);
    margin: 0;
    line-height: 1.6;
}

/* ============ Tabs ============ */
.news-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    padding: 0 15px;
    flex-wrap: wrap;
}

.news-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: #fff;
    border: 2px solid var(--news-border);
    border-radius: 30px;
    color: var(--news-text-light);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--news-shadow);
}

.news-tab-btn:hover {
    border-color: var(--news-primary);
    color: var(--news-primary);
    transform: translateY(-2px);
}

.news-tab-btn.active {
    background: linear-gradient(135deg, var(--news-primary), var(--news-primary-dark));
    border-color: var(--news-primary);
    color: #fff;
    box-shadow: 0 6px 18px rgba(var(--news-primary-rgb), 0.3);
}

.news-tab-btn .tab-icon {
    font-size: 18px;
    line-height: 1;
}

.news-tab-btn .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: rgba(var(--news-primary-rgb), 0.1);
    color: var(--news-primary);
    border-radius: 11px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 4px;
}

.news-tab-btn.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ============ Search Box ============ */
.news-search-box {
    max-width: 500px;
    margin: 0 auto 30px;
    padding: 0 15px;
}

.news-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--news-border);
    border-radius: 30px;
    padding: 4px 16px 4px 44px;
    box-shadow: var(--news-shadow);
    transition: all 0.3s ease;
}

.news-search-input-wrap:focus-within {
    border-color: var(--news-primary);
    box-shadow: 0 4px 16px rgba(var(--news-primary-rgb), 0.12);
}

.news-search-icon {
    position: absolute;
    left: 16px;
    width: 18px;
    height: 18px;
    color: var(--news-text-light);
    pointer-events: none;
}

.news-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 0;
    font-size: 14px;
    color: var(--news-text);
}

.news-search-input::placeholder {
    color: #adb5bd;
}

.news-search-clear {
    border: none;
    background: transparent;
    color: var(--news-text-light);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    display: none;
}

.news-search-clear.visible {
    display: inline-block;
}

.news-search-clear:hover {
    color: var(--news-primary);
}

/* ============ Panels ============ */
.news-panel {
    display: none;
    animation: newsFadeIn 0.4s ease;
}

.news-panel.active {
    display: block;
}

@keyframes newsFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ News Grid ============ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 0 15px;
}

/* ============ News Card ============ */
.news-card {
    background: var(--news-card-bg);
    border-radius: var(--news-radius);
    overflow: hidden;
    box-shadow: var(--news-shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--news-border);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--news-shadow-hover);
    border-color: rgba(var(--news-primary-rgb), 0.3);
}

.news-card-header {
    position: relative;
    padding: 18px 20px 14px;
    background: linear-gradient(135deg, rgba(var(--news-primary-rgb), 0.04), rgba(var(--news-primary-rgb), 0.01));
    border-bottom: 1px solid var(--news-border);
}

.news-card-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(var(--news-primary-rgb), 0.08);
    color: var(--news-primary);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
}

.news-card-tag.air { background: rgba(215, 0, 15, 0.08); color: #D7000F; }
.news-card-tag.shipping { background: rgba(80, 44, 108, 0.08); color: #502c6c; }
.news-card-tag.ecommerce { background: rgba(13, 148, 136, 0.08); color: #0d9488; }

.news-card-index {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 32px;
    font-weight: 700;
    color: rgba(var(--news-primary-rgb), 0.08);
    line-height: 1;
    font-family: 'Arial', sans-serif;
}

.news-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--news-text);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 40px;
}

.news-card-body {
    padding: 14px 20px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-card-summary {
    font-size: 13px;
    color: var(--news-text-light);
    line-height: 1.6;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--news-text-light);
}

.news-card-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.news-card-date svg {
    width: 13px;
    height: 13px;
}

.news-card-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--news-primary);
    font-weight: 500;
    transition: gap 0.3s ease;
}

.news-card:hover .news-card-action {
    gap: 8px;
}

/* ============ Empty State ============ */
.news-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--news-text-light);
}

.news-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.news-empty-text {
    font-size: 15px;
}

/* ============ Modal (iframe viewer) ============ */
.news-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999 !important; /* !important 防 cssnano 压缩时篡改 z-index（曾被改成 2 导致被 fixed-top 导航栏遮挡） */
    background: rgba(12, 27, 38, 0.85);
    -webkit-overflow-scrolling: touch;
    overflow: hidden;
    overscroll-behavior: contain; /* 防止滚动链式传递 */
}

/* 移动端用半透明背景替代 backdrop-filter（iOS 性能优化） */
@media (min-width: 769px) {
    .news-modal {
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
}

.news-modal.open {
    display: block;
    animation: modalFadeIn 0.3s ease;
}

.news-modal.open .news-modal-container {
    touch-action: pan-y;
    overscroll-behavior: contain;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.news-modal-container {
    position: absolute;
    top: 90px;            /* 避开顶部 fixed-top 导航栏（实测约 85.8px 高） */
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 1100px;
    bottom: 20px;         /* 底部留白 */
    height: auto;         /* 由 top + bottom 撑高，避免被导航栏遮挡 */
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.35s ease;
    -webkit-overflow-scrolling: touch;
    opacity: 1;
    transition: opacity 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: translateX(-50%) translateY(-10px) scale(0.96); opacity: 0; }
    to { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}

.news-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--news-primary), var(--news-primary-dark));
    color: #fff;
    flex-shrink: 0;
}

.news-modal-title {
    font-size: 15px;
    font-weight: 500;
    margin: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 16px;
}

.news-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.news-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
}

.news-modal-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

.news-modal-btn.copied {
    background: #2e7d32;
}

.news-modal-btn.copied svg {
    color: #fff;
}

.news-modal-btn svg {
    width: 16px;
    height: 16px;
}

.news-modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #fff;
}

.news-modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    overflow-y: scroll;
}

.news-modal-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.news-modal-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.news-modal-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--news-border);
    border-top-color: var(--news-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.news-modal-loading-text {
    font-size: 14px;
    color: var(--news-text-light);
}

/* ============ Pagination ============ */
.news-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 40px;
    padding: 0 15px;
    flex-wrap: wrap;
}

.news-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--news-border);
    background: #fff;
    color: var(--news-text-light);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.news-page-btn:hover:not(:disabled):not(.active) {
    border-color: var(--news-primary);
    color: var(--news-primary);
}

.news-page-btn.active {
    background: var(--news-primary);
    border-color: var(--news-primary);
    color: #fff;
}

.news-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .news-title { font-size: 26px; }
    .news-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .news-tab-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    .news-modal-container {
        width: 100%;
        max-width: 100%;
        top: 60px;        /* 移动端导航栏折叠后较矮 */
        bottom: 10px;
        height: auto;
        border-radius: 0;
    }
    .news-card-index { font-size: 26px; }
    .news-card-title { font-size: 15px; }
}

@media (max-width: 480px) {
    .news-tabs { gap: 8px; }
    .news-tab-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    .news-card-header { padding: 14px 16px 12px; }
    .news-card-body { padding: 12px 16px 14px; }
}
