.banner {
    background: url("../img/bg5.jpg") center/cover no-repeat;
}

.news {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: clamp(24px, 5vw, 48px);
    margin-bottom: 48px;
}

.news .item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: clamp(16px, 3vw, 24px);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .06));
    border: 1px solid rgba(19, 19, 52, .12);
    box-shadow: var(--shadow-1);
    backdrop-filter: blur(4px) saturate(120%);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.news .item:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-2), 0 0 30px rgba(163, 207, 235, 0.1);
    border-color: rgba(163, 207, 235, .35);
    background: linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .10));
}

.news .item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--A3CFEB), var(--ADFFF5));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.news .item::after {
    content: "";
    position: absolute;
    top: -80px;
    right: -80px;
    width: 160px;
    height: 160px;
    background: radial-gradient(50% 50% at 50% 50%, var(--A3CFEB), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.news .item:hover::before {
    transform: scaleX(1);
}

.news .item:hover::after {
    opacity: 0.08;
}


.news .thumb {
    width: 100%;
    border-radius: 18px;
    box-shadow: var(--shadow-1);
    outline: 1px solid rgba(19, 19, 52, .08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    aspect-ratio: 16/8;
}

.news .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.news .thumb:hover {
    transform: scale(1.02) rotate(0.5deg);
    box-shadow: var(--shadow-2);
    outline-color: rgba(163, 207, 235, 0.3);
}

.news .thumb:hover img {
    transform: scale(1.05);
}

.news .content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news .meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--131334);
    font-size: 14px;
    letter-spacing: 0.1em;
    font-weight: 600;
    text-transform: uppercase;
    position: relative;
    padding-left: 16px;
    opacity: 0.8;
}

.news .meta::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(100% 100% at 30% 20%, var(--ADFFF5), var(--A3CFEB));
}

.news .title {
    font-size: clamp(20px, 2.8vw, 28px);
    font-weight: 800;
    letter-spacing: 0.02em;
    margin: 0;
    line-height: 1.3;
    color: var(--131334);
}

.news .desc {
    color: var(--AAAAAA);
    line-height: 1.8;
    font-size: 16px;
    text-align: justify;
    margin: 0;
}

.news .cta {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

.news .date {
    color: var(--AAAAAA);
    font-size: 14px;
    font-weight: 600;
}


/* 分類篩選器樣式 */
.filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 48px;
    padding: 0 20px;
}

.filter-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-pill);
    background: linear-gradient(145deg, var(--F5F7FB), var(--FFFFFF));
    font-weight: 600;
    font-size: 14px;
}


.filter-btn.active {
    background: radial-gradient(100% 100% at 30% 20%, var(--ADFFF5), var(--A3CFEB));
    color: var(--0F1830);
    border-color: rgba(255, 255, 255, .6);
}



/* 分類標籤樣式 */
.category-tag {
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, .6);
    color: var(--F5F7FB);
}


.category-tag.tech {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.category-tag.update {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.category-tag.event {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.category-tag.announcement {
    background: linear-gradient(135deg, #3bd16d, #21edc8);
}



/* ------------------
        新聞詳情頁面
   ------------------ */


.news-detail {
    background: linear-gradient(145deg, var(--FFFFFF), var(--F5F7FB));
    border: 1px solid rgba(19, 19, 52, .08);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-1);
    overflow: hidden;
    position: relative;
}

.news-detail::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--A3CFEB), var(--ADFFF5));
}

.news-detail .header {
    padding: 40px 40px 32px;
    border-bottom: 1px solid rgba(19, 19, 52, .08);
    background: linear-gradient(135deg, rgba(163, 207, 235, 0.02), rgba(173, 255, 245, 0.01));
}

.news-detail .title {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 900;
    color: var(--131334);
    line-height: 1.3;
    margin: 0 0 20px 0;
    letter-spacing: 0.02em;
}

.news-detail .subtitle {
    font-size: 18px;
    color: var(--AAAAAA);
    margin: 0 0 24px 0;
    line-height: 1.6;
    font-weight: 500;
}

.news-detail .meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.news-detail .date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--AAAAAA);
    font-size: 15px;
    font-weight: 600;
}

.news-detail .date::before {
    content: "📅";
    font-size: 16px;
}

.news-category {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    background: radial-gradient(100% 100% at 30% 20%, var(--ADFFF5), var(--A3CFEB));
    color: var(--0F1830);
    font-size: 13px;
    font-weight: 800;
    border-radius: var(--radius-pill);
    letter-spacing: 0.05em;
    border: 1px solid rgba(255, 255, 255, .6);
    box-shadow: var(--shadow-soft);
}


.news-detail .body {
    padding: 40px;
}

.news-detail .image {
    margin-bottom: 40px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    position: relative;
}

.news-detail .image img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.news-detail .image:hover img {
    transform: scale(1.02);
}

/* 操作按鈕區域 */
.news-detail .actions {
    padding: 32px 40px 40px;
    border-top: 1px solid rgba(19, 19, 52, .05);
    background: rgba(163, 207, 235, 0.02);
    text-align: center;
}

.news-detail .content h1,
.news-detail .content h2,
.news-detail .content h3 {
    margin-bottom: 20px;
}

.news-detail .content h4,
.news-detail .content h5,
.news-detail .content h6 {
    margin-bottom: 16px;
}

.news-detail .content p {
    margin-bottom: 12px;
}

/* Quill 文字編輯器樣式調整 */

.ql-size-small {
    font-size: 0.75em;
}

.ql-size-large {
    font-size: 1.5em;
}

.ql-size-huge {
    font-size: 2.5em;
}

.ql-direction-rtl {
    direction: rtl;
    text-align: inherit;
}

.ql-align-left {
    text-align: left;
}

.ql-align-right {
    text-align: right;
}

.ql-align-center {
    text-align: center;
}

.ql-align-justify {
    text-align: justify;
}

.ql-indent-1 {
    text-indent: 2em;
}

.ql-indent-2 {
    text-indent: 4em;
}

.ql-indent-3 {
    text-indent: 6em;
}

.ql-indent-4 {
    text-indent: 8em;
}

.ql-indent-5 {
    text-indent: 10em;
}

.ql-indent-6 {
    text-indent: 12em;
}

.ql-indent-7 {
    text-indent: 14em;
}

.ql-indent-8 {
    text-indent: 16em;
}



/* ------------------
        RWD 響應式設計
   ------------------ */

/* 筆記型電腦 (1200px 以下) */
@media (max-width: 1200px) {
    .news {
        gap: 40px;
    }
    
    .news .item {
        padding: 20px;
    }
    
    .news .title {
        font-size: clamp(16px, 3vw, 24px);
    }
    
    .news-detail .title {
        font-size: clamp(20px, 4.5vw, 32px);
    }
}

/* 平板橫向 (1024px 以下) */
@media (max-width: 1024px) {
    .news {
        grid-template-columns: 1fr;
        gap: 32px;
        margin-bottom: 40px;
    }
    
    .news .item {
        padding: 24px;
        margin: 0 auto;
    }
    
    .filter {
        gap: 10px;
        margin-bottom: 40px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .news-detail .header {
        padding: 32px 32px 24px;
    }
    
    .news-detail .body {
        padding: 32px;
    }
    
    .news-detail .actions {
        padding: 24px 32px 32px;
    }
}

/* 平板直向 (768px 以下) */
@media (max-width: 768px) {
    .news {
        gap: 24px;
        margin-bottom: 32px;
    }
    
    .news .item {
        padding: 20px;
    }
    
    .news .thumb {
        aspect-ratio: 16/9;
        margin-bottom: 16px;
    }
    
    .news .content {
        gap: 12px;
    }
    
    .news .meta {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 6px;
    }
    
    .filter {
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 0 20px 8px;
        margin-bottom: 32px;
    }
    
    .filter::-webkit-scrollbar {
        display: none;
    }
    
    .filter-btn {
        flex-shrink: 0;
        padding: 9px 18px;
        font-size: 12px;
    }
    
    .news-detail .header {
        padding: 24px 24px 20px;
    }
    
    .news-detail .body {
        padding: 24px;
    }
    
    .news-detail .actions {
        padding: 20px 24px 24px;
    }
    
    .news-detail .meta {
        gap: 16px;
    }
}

/* 手機橫向 (640px 以下) */
@media (max-width: 640px) {
    .news {
        gap: 20px;
        margin-bottom: 24px;
    }
    
    .news .item {
        padding: 18px;
        max-width: 100%;
    }
    
    .news .item:hover {
        transform: translateY(-6px);
    }
    
    .news .thumb {
        border-radius: 14px;
        margin-bottom: 14px;
    }
    
    .news .title {
        font-size: clamp(16px, 4vw, 20px);
        -webkit-line-clamp: 2;
    }
    
    .news .desc {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }
    
    .news .cta {
        margin-top: 16px;
    }
    
    .filter {
        padding: 0 16px 6px;
        margin-bottom: 24px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 11px;
    }
    
    .category-tag {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .news-detail .header {
        padding: 20px 20px 16px;
    }
    
    .news-detail .body {
        padding: 20px;
    }
    
    .news-detail .actions {
        padding: 16px 20px 20px;
    }
    
    .news-detail .image {
        margin-bottom: 20px;
        border-radius: 14px;
    }
}

/* 手機直向 (480px 以下) */
@media (max-width: 480px) {
    .news {
        gap: 16px;
        margin-bottom: 20px;
    }
    
    .news .item {
        padding: 16px;
    }
    
    .news .item:hover {
        transform: translateY(-4px);
    }
    
    .news .thumb {
        border-radius: 12px;
        margin-bottom: 12px;
        aspect-ratio: 4/3;
    }
    
    .news .content {
        gap: 10px;
    }
    
    .news .meta {
        padding-left: 12px;
        margin-bottom: 4px;
    }
    
    .news .meta::before {
        width: 6px;
        height: 6px;
    }
    
    .news .title {
        font-size: 16px;
        line-height: 1.4;
    }
    
    .news .desc {
        font-size: 13px;
        line-height: 1.6;
        -webkit-line-clamp: 2;
    }
    
    .news .cta {
        margin-top: 12px;
    }
    
    .filter {
        padding: 0 12px 4px;
        margin-bottom: 20px;
    }
    
    .filter-btn {
        padding: 7px 14px;
        font-size: 10px;
    }
    
    .news-detail .header {
        padding: 16px 16px 12px;
    }
    
    .news-detail .body {
        padding: 16px;
    }
    
    .news-detail .actions {
        padding: 12px 16px 16px;
    }
    
    .news-detail .title {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .news-detail .subtitle {
        font-size: 14px;
        margin-bottom: 16px;
    }
}

/* 極小螢幕 (360px 以下) */
@media (max-width: 360px) {
    .news {
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .news .item {
        padding: 12px;
    }
    
    .news .thumb {
        border-radius: 10px;
        margin-bottom: 10px;
    }
    
    .news .meta {
        padding-left: 10px;
        font-size: 11px;
    }
    
    .news .title {
        font-size: 15px;
    }
    
    .news .desc {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    
    .news .date {
        font-size: 11px;
    }
    
    .filter {
        padding: 0 8px 4px;
        margin-bottom: 16px;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 9px;
    }
    
    .category-tag {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    .news-detail .header {
        padding: 12px 12px 8px;
    }
    
    .news-detail .body {
        padding: 12px;
    }
    
    .news-detail .actions {
        padding: 8px 12px 12px;
    }
    
    .news-detail .title {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .news-detail .subtitle {
        font-size: 13px;
        margin-bottom: 12px;
    }
    
    .news-category {
        font-size: 10px;
        padding: 5px 10px;
    }
}