@font-face {
    font-family: 'bootstrap-icons';
    font-display: swap;
    src: url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/fonts/bootstrap-icons.woff2') format('woff2');
}

:root {
    --warm: #1a365d;
    --cream: #ebf4ff;
    --coral: #3182ce;
    --dark: #0d2137;
    --light-bg: #f5f8fc;
    --text: #0d2137;
    --text-light: #6c757d;
    --gradient: linear-gradient(135deg, #ebf4ff, #1a365d);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Noto Sans TC', sans-serif;
    color: var(--text);
    background: #fff;
    line-height: 1.75;
    overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: 'Noto Serif TC', serif; }

.section-eyebrow {
    display: block;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--coral);
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
    padding-left: 1rem;
    letter-spacing: 0.5px;
}
.section-title::after {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    top: 0.15em;
    width: 3px;
    height: 1.2em;
    background: var(--coral);
    border-radius: 2px;
}
.section-title.text-center {
    padding-left: 0;
}
.section-title.text-center::after {
    display: none;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* ===== Navbar ===== */
.navbar {
    padding: 0;
    transition: box-shadow 0.3s;
    background: var(--dark);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: 64px;
    display: flex;
    align-items: center;
}
.navbar > .container,
.navbar > .container-fluid {
    min-height: 64px;
    display: flex;
    align-items: center;
}
.navbar.scrolled {
    box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    padding: 0.5rem 0;
}
.brand-logo {
    height: 38px;
    width: auto;
    transition: filter 0.3s;
}
.navbar.scrolled .brand-logo { filter: none; }
.navbar-brand .brand-text {
    font-family: 'Noto Serif TC', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    transition: color 0.3s;
}
.navbar.scrolled .brand-text { color: #fff; }
.nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0.3rem;
    transition: color 0.3s;
}
.navbar.scrolled .nav-link { color: rgba(255,255,255,0.85) !important; }
.nav-link:hover { color: var(--coral) !important; }
.navbar-toggler { border: none; }
.navbar-toggler-icon { filter: brightness(0) invert(1); }
.navbar.scrolled .navbar-toggler-icon { filter: brightness(0) invert(1); }

@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(13,33,55,0.97);
        backdrop-filter: blur(10px);
        border-radius: 8px;
        padding: 1rem;
        margin-top: 0.5rem;
        box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    }
    .navbar-collapse .nav-link { color: rgba(255,255,255,0.9) !important; padding: 0.6rem 1rem; border-radius: 6px; }
    .navbar-collapse .nav-link:hover { background: rgba(255,255,255,0.08); }
    .navbar-toggler-icon { filter: brightness(0) invert(1); }
}

/* ===== Mobile Bottom Nav ===== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(13,33,55,0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 1050;
    padding: 0.4rem 0;
    padding-bottom: calc(0.4rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 20px rgba(0,0,0,0.15);
}
.mobile-bottom-nav .nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
}
.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: rgba(255,255,255,0.6);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
    gap: 0.15rem;
    position: relative;
}
.mobile-bottom-nav .nav-item i {
    font-size: 1.25rem;
    transition: all 0.2s;
}
.mobile-bottom-nav .nav-item.active,
.mobile-bottom-nav .nav-item:hover {
    color: #fff;
}
.mobile-bottom-nav .nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--coral);
    border-radius: 1px;
}
.mobile-bottom-nav .nav-item.active i {
    color: var(--coral);
}
.mobile-bottom-nav .nav-item.nav-cta {
    position: relative;
}
.mobile-bottom-nav .nav-item.nav-cta i {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--warm), var(--coral));
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-top: -1rem;
    box-shadow: 0 4px 12px rgba(26,54,93,0.4);
}
.mobile-bottom-nav .nav-item.nav-cta span {
    margin-top: 0.1rem;
}

@media (max-width: 991.98px) {
    .mobile-bottom-nav { display: block; }
    .site-footer { padding-bottom: calc(3rem + 60px + env(safe-area-inset-bottom, 0px)); }
}

/* ===== Footer ===== */
.site-footer {
    background: #0a1628;
    color: rgba(255,255,255,0.75);
    padding: 4rem 0 3rem;
    position: relative;
}
.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--coral), var(--warm), var(--coral));
}
.footer-logo {
    height: 32px;
    width: auto;
    display: block;
    margin: 0 auto 0.5rem;
}
@media (min-width: 768px) {
    .footer-logo { margin: 0 0 0.5rem; }
}
.footer-brand {
    font-family: 'Noto Serif TC', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}
.footer-tagline { font-size: 0.9rem; color: rgba(255,255,255,0.55); margin: 0.3rem 0 0; }
.social-links a {
    display: inline-flex;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.25);
    background: transparent;
    color: rgba(255,255,255,0.7);
    align-items: center;
    justify-content: center;
    margin: 0 0.3rem;
    transition: all 0.3s;
    text-decoration: none;
    font-size: 1.1rem;
}
.social-links a:hover { border-color: var(--coral); color: var(--coral); background: rgba(49,130,206,0.1); transform: translateY(-2px); }
.footer-community { color: var(--coral); font-weight: 500; }

/* ===== Buttons ===== */
.btn-cta {
    display: inline-block;
    padding: 0.9rem 2.5rem;
    background: var(--coral);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(49,130,206,0.25);
}
.btn-cta:hover { background: #2b6cb0; transform: translateY(-3px); box-shadow: 0 8px 24px rgba(49,130,206,0.35); color: #fff; }

.btn-outline-warm {
    display: inline-block;
    padding: 0.7rem 2rem;
    border: 2px solid var(--warm);
    color: var(--warm);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(26,54,93,0.1);
}
.btn-outline-warm:hover { background: var(--warm); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(26,54,93,0.25); }

/* ===== Back to Top ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--warm);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(26,54,93,0.3);
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--coral);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(49,130,206,0.35);
}
@media (max-width: 991.98px) {
    .back-to-top { bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); z-index: 1060; }
}
@media (max-width: 575.98px) {
    .back-to-top { right: 1.2rem; width: 36px; height: 36px; font-size: 0.95rem; }
}

/* ===== Article Card (Shared) ===== */
.article-card {
    display: block;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    height: 100%;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.article-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.1); color: inherit; }

.article-card-img {
    position: relative;
    height: 220px;
    overflow: hidden;
}
.article-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.article-card:hover .article-card-img img { transform: scale(1.05); }

.article-card-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    font-size: 3rem;
    color: var(--warm);
}


.article-card-body {
    padding: 1.5rem;
}
.article-card-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card-body p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card-body time {
    font-size: 0.85rem;
    color: var(--warm);
}
