:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #0066cc;
    --accent-red: #dc3545;
    --text-color: #333;
    --light-bg: #f5f5f5;
    --border-color: #e0e0e0;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Microsoft JhengHei', 'Noto Sans TC', 'PingFang TC', sans-serif;
    color: var(--text-color);
    background-color: var(--light-bg);
    font-size: 16px;
    line-height: 1.6;
}

.header-top {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.main-logo {
    height: 120px;
    max-width: 500px;
}

.header-search {
    max-width: 300px;
}

.header-search .form-control {
    border-radius: 20px 0 0 20px;
    border-right: none;
    padding-left: 20px;
}

.header-search .btn {
    border-radius: 0 20px 20px 0;
    background: var(--accent-color);
    border-color: var(--accent-color);
    padding: 0 20px;
}

.navbar {
    background: linear-gradient(180deg, var(--primary-color) 0%, #0d1321 100%) !important;
    padding: 0;
}

.navbar .container {
    padding: 0;
}

.navbar-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.navbar .nav-link {
    color: #fff !important;
    padding: 14px 16px !important;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.navbar .nav-link:hover {
    background: rgba(255,255,255,0.1);
    border-bottom-color: var(--accent-color);
}

.category-bar {
    background: #fff;
    border-bottom: 2px solid var(--border-color);
    padding: 10px 0;
    overflow-x: auto;
}

.category-pills {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    padding: 0 4px;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.category-pill:hover {
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.category-pill i {
    margin-right: 6px;
}

.breaking-news-bar {
    background: linear-gradient(90deg, #c41e3a 0%, #dc3545 50%, #c41e3a 100%);
    padding: 12px 16px;
    border-radius: 0;
    margin: 0 -12px 20px;
    color: white;
}

.breaking-badge {
    background: #fff;
    color: #dc3545;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    margin-right: 16px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.breaking-news-scroll {
    overflow: hidden;
    flex-grow: 1;
}

.breaking-news-content {
    white-space: nowrap;
    animation: scroll-left 25s linear infinite;
}

.breaking-news-item {
    color: white;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
}

.breaking-news-item:hover {
    color: #ffd700;
    text-decoration: underline;
}

@keyframes scroll-left {
    0% { transform: translateX(50%); }
    100% { transform: translateX(-100%); }
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--accent-color);
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 10px;
}

.section-more {
    margin-left: auto;
    color: var(--accent-color);
    text-decoration: none;
    font-size: 14px;
}

.featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.featured-main {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.featured-main .featured-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    opacity: 0.85;
    transition: opacity 0.3s;
}

.featured-main:hover .featured-img {
    opacity: 1;
}

.featured-main .featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: #fff;
}

.featured-main .featured-category {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}

.featured-main .featured-title {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

.featured-main .featured-title a {
    color: #fff;
    text-decoration: none;
}

.featured-main .featured-title a:hover {
    color: #ffd700;
}

.featured-main .featured-meta {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    margin-top: 10px;
}

.featured-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.featured-side-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.featured-side-item:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.featured-side-item .side-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.featured-side-item .side-content {
    padding: 12px;
}

.featured-side-item .side-category {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.featured-side-item .side-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-side-item .side-title a {
    color: var(--text-color);
    text-decoration: none;
}

.featured-side-item .side-title a:hover {
    color: var(--accent-color);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.news-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: none;
}

.news-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: translateY(-4px);
}

.news-card .card-img-wrapper {
    position: relative;
    overflow: hidden;
}

.news-card .card-img-top {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s;
}

.news-card:hover .card-img-top {
    transform: scale(1.05);
}

.news-card .card-category {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.news-card .card-body {
    padding: 16px;
}

.news-card .card-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card .card-title a {
    color: var(--text-color);
    text-decoration: none;
}

.news-card .card-title a:hover {
    color: var(--accent-color);
}

.news-card .card-meta {
    font-size: 13px;
    color: #888;
    display: flex;
    justify-content: space-between;
}

.placeholder-img {
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-img i {
    color: #ccc;
}

.sidebar-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.sidebar-header {
    background: var(--primary-color);
    color: #fff;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.sidebar-header i {
    margin-right: 10px;
}

.sidebar-header.hot {
    background: linear-gradient(135deg, #ff6b6b 0%, #dc3545 100%);
}

.category-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-list-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    background: var(--light-bg);
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.category-list-item:hover {
    background: #e8f4ff;
    color: var(--accent-color);
    border-left-color: var(--accent-color);
}

.category-list-item i {
    width: 20px;
    margin-right: 10px;
}

.category-list-item .count {
    margin-left: auto;
    background: var(--border-color);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: #666;
}

.hot-news-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.hot-news-item {
    display: flex;
    align-items: flex-start;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.hot-news-item:hover {
    background: #fafafa;
}

.hot-news-item:last-child {
    border-bottom: none;
}

.hot-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-red);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    margin-right: 12px;
}

.hot-rank.rank-2 { background: #fd7e14; }
.hot-rank.rank-3 { background: #ffc107; color: #333; }
.hot-rank.rank-4, .hot-rank.rank-5 { background: #6c757d; }

.hot-news-title {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hot-news-title:hover {
    color: var(--accent-color);
}

.news-list-item {
    display: flex;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.news-list-item:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.news-list-item .list-img {
    width: 280px;
    height: 180px;
    object-fit: cover;
    flex-shrink: 0;
}

.news-list-item .list-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.news-list-item .list-category {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
    align-self: flex-start;
}

.news-list-item .list-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 10px;
}

.news-list-item .list-title a {
    color: var(--text-color);
    text-decoration: none;
}

.news-list-item .list-title a:hover {
    color: var(--accent-color);
}

.news-list-item .list-summary {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: auto;
}

.news-list-item .list-meta {
    font-size: 13px;
    color: #888;
    margin-top: 12px;
}

footer {
    background: var(--primary-color);
    color: #ccc;
    padding: 50px 0 30px;
    margin-top: 40px;
}

footer h5 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

footer a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #fff;
}

footer .footer-logo {
    height: 50px;
    margin-bottom: 15px;
}

footer .footer-desc {
    font-size: 14px;
    line-height: 1.7;
}

footer .footer-links li {
    margin-bottom: 8px;
}

footer .copyright {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    margin-top: 30px;
    text-align: center;
    font-size: 13px;
    color: #888;
}

.article-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 20px;
}

.article-content {
    font-size: 18px;
    line-height: 1.8;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content p:empty {
    display: none;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.article-content figure {
    margin: 1.5rem 0;
    text-align: center;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.article-content figure img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 0;
}

.article-content figcaption {
    margin-top: 8px;
    font-size: 13px;
    color: #888;
    line-height: 1.6;
    padding: 5px 10px 0;
    text-align: center;
    font-style: italic;
}

.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-primary:hover {
    background-color: #0055aa;
    border-color: #0055aa;
}

.pagination .page-link {
    color: var(--accent-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

@media (max-width: 991px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-sidebar {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-top {
        padding: 25px 15px;
        text-align: center;
    }
    
    .logo-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-logo {
        height: 65px;
        max-width: 200px;
        margin: 0 auto;
        display: block;
    }
    
    .header-search {
        display: none;
    }
    
    .navbar {
        padding: 0;
    }
    
    .navbar .nav-link {
        padding: 12px 14px !important;
        font-size: 14px;
    }
    
    .category-bar {
        display: none;
    }
    
    .breaking-news-bar {
        margin: 0 0 16px;
        padding: 10px 14px;
        border-radius: 8px;
    }
    
    .breaking-badge {
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .featured-main .featured-img {
        height: 250px;
    }
    
    .featured-main .featured-title {
        font-size: 20px;
    }
    
    .featured-main .featured-overlay {
        padding: 20px;
    }
    
    .featured-sidebar {
        grid-template-columns: 1fr;
    }
    
    .featured-side-item {
        display: flex;
    }
    
    .featured-side-item .side-img {
        width: 120px;
        height: 90px;
        flex-shrink: 0;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .news-card .card-img-top {
        height: 200px;
    }
    
    .news-card .card-title {
        font-size: 18px;
    }
    
    .news-list-item {
        flex-direction: column;
    }
    
    .news-list-item .list-img {
        width: 100%;
        height: 200px;
    }
    
    .news-list-item .list-title {
        font-size: 18px;
    }
    
    .article-title {
        font-size: 24px;
    }
    
    .article-content {
        font-size: 16px;
    }
    
    footer {
        padding: 30px 0 20px;
    }
    
    footer h5 {
        font-size: 15px;
    }
}

@media (max-width: 576px) {
    .header-top {
        padding: 20px 10px;
    }
    
    .main-logo {
        height: 160px;
        max-width: 450px;
    }
    
    .featured-main .featured-img {
        height: 220px;
    }
    
    .featured-main .featured-title {
        font-size: 18px;
    }
    
    .featured-side-item .side-img {
        width: 100px;
        height: 75px;
    }
    
    .featured-side-item .side-title {
        font-size: 14px;
    }
    
    .news-card .card-img-top {
        height: 180px;
    }
    
    .news-card .card-title {
        font-size: 16px;
    }
    
    .hot-news-item {
        padding: 12px 14px;
    }
}

.today-carousel-section {
    margin-top: 20px;
}

#todayNewsCarousel {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.carousel-img-wrapper {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

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

.carousel-news-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 60px 30px 30px;
    color: #fff;
}

.carousel-category {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

.carousel-news-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.carousel-news-meta {
    font-size: 14px;
    opacity: 0.9;
}

.carousel-news-link {
    display: block;
    text-decoration: none;
    color: #fff;
}

.carousel-news-link:hover {
    color: #fff;
}

.carousel-news-link:hover .carousel-news-title {
    text-decoration: underline;
}

#todayNewsCarousel .carousel-control-prev,
#todayNewsCarousel .carousel-control-next {
    width: 50px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

#todayNewsCarousel .carousel-control-prev:hover,
#todayNewsCarousel .carousel-control-next:hover {
    opacity: 1;
}

#todayNewsCarousel .carousel-control-prev-icon,
#todayNewsCarousel .carousel-control-next-icon {
    width: 35px;
    height: 35px;
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    background-size: 50%;
}

#todayNewsCarousel .carousel-indicators {
    margin-bottom: 15px;
}

#todayNewsCarousel .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin: 0 5px;
    opacity: 0.6;
}

#todayNewsCarousel .carousel-indicators button.active {
    opacity: 1;
}

@media (max-width: 768px) {
    .carousel-img-wrapper {
        height: 280px;
    }
    
    .carousel-news-overlay {
        padding: 40px 20px 20px;
    }
    
    .carousel-news-title {
        font-size: 18px;
    }
    
    .carousel-category {
        font-size: 12px;
        padding: 4px 10px;
    }
    
    .carousel-news-meta {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .carousel-img-wrapper {
        height: 220px;
    }
    
    .carousel-news-title {
        font-size: 16px;
    }
}
