/* =========================================
   1. 基礎設定
   ========================================= */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Noto Sans TC', system-ui, -apple-system, "Microsoft JhengHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    /* [修改] 改用更深一點的冷灰色，讓白色卡片對比更明顯 */
    background-color: #eff2f5;
    /* [RWD 關鍵修正] Body 上方留白動態調整 */
    /* 手機版：預設較小，避免上方空太白 */
    padding-top: 65px;
}

/* =========================================
   2. 全新 Hero 區塊 (Style 4: 實景沉浸式修正版)
   ========================================= */
.hero-section {
    width: 100%;
    margin-top: 0;
    padding: 8rem 0 10rem 0; /* 上下留白 */
    background-color: #0061f2; /* 主要品牌色 */
    /*background-image: url('https://static.vecteezy.com/system/resources/previews/002/057/422/large_2x/taipei-101-tower-and-view-of-taipei-taiwan-free-photo.jpg');*/
    background-image: url('../img/taipei-photo.jpg');
    background-size: cover;
    background-position: center;
    /*background-attachment: fixed;*/ /* 視差滾動 */
    background-attachment: initial; /* 視差滾動 */
    color: white;
    position: relative;
    /* 底部圓弧 */
    border-radius: 0 0 50% 10%/100px;
    box-shadow: 0 4px 20px rgba(0, 97, 242, 0.2);
}

/* =========================================
   3. 功能卡片 (Feature Cards)
   ========================================= */
.feature-card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    background: #fff;
    overflow: hidden;
    position: relative;
    z-index: 10;
}

    .feature-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 15px 35px rgba(0,0,0,0.1) !important;
    }

    .feature-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 5px;
        transition: height 0.3s ease;
        z-index: -1;
    }

    .feature-card:hover::before {
        height: 100%;
    }

    .feature-card:hover h3, .feature-card:hover p, .feature-card:hover i {
        color: white !important;
        transition: color 0.3s ease;
    }

/* 顏色定義 */
.card-map::before {
    background: linear-gradient(135deg, #0d6efd, #0099ff);
}

.card-zone::before {
    background: linear-gradient(135deg, #198754, #20c997);
}

.card-apply::before {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.card-help::before {
    background: linear-gradient(135deg, #0dcaf0, #39add1);
}

.card-receipt::before {
    background: linear-gradient(135deg, #6c757d, #adb5bd);
}

.card-history::before {
    background: linear-gradient(135deg, #dc3545, #ff6b6b);
}

/* =========================================
   4. 圖示圓圈 (Icon Circle)
   ========================================= */
.icon-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    transition: all 0.3s ease;
    font-size: 3rem;
}

    .icon-circle i {
        line-height: 1;
        transition: all 0.3s ease;
    }

/* 強制設定顏色 */
.card-map .icon-circle {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.card-zone .icon-circle {
    background-color: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.card-apply .icon-circle {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.card-help .icon-circle {
    background-color: rgba(13, 202, 240, 0.1);
    color: #0dcaf0;
}

.card-receipt .icon-circle {
    background-color: rgba(108, 117, 125, 0.1); /* 淺灰底 */
    color: #6c757d; /* 深灰字 */
}

.card-history .icon-circle {
    background-color: rgba(220, 53, 69, 0.1); /* 淺紅底 */
    color: #dc3545; /* 深紅字 */
}

/* 懸停效果 */
.feature-card:hover .icon-circle {
    transform: scale(1.1);
}

.feature-card:hover .card-map .icon-circle {
    background-color: #0d6efd;
    color: white;
}

.feature-card:hover .card-zone .icon-circle {
    background-color: #198754;
    color: white;
}

.feature-card:hover .card-apply .icon-circle {
    background-color: #ffc107;
    color: white;
}

.feature-card:hover .card-help .icon-circle {
    background-color: #0dcaf0;
    color: white;
}

.feature-card:hover .card-receipt .icon-circle {
    background-color: #6c757d;
    color: white;
}

.feature-card:hover .card-history .icon-circle {
    background-color: #dc3545;
    color: white;
}

/* =========================================
   5. 導覽列 (Navbar) - RWD 高度優化
   ========================================= */
.navbar-custom {
    background-color: #fff !important;
    padding: 1.2rem 0; /* 初始狀態：較高 */
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    /* [RWD 關鍵修正] 手機版 Padding 縮小 */
    padding: 0.8rem 0;
}

.navbar-scrolled {
    padding: 0.5rem 0; /* 捲動後：變矮 */
    box-shadow: 0 5px 20px rgba(0,0,0,0.15) !important;
    background-color: rgba(255, 255, 255, 0.98) !important;
}

/* Logo 縮放 */
.navbar-brand img {
    transition: all 0.3s ease;
}

.navbar-scrolled .navbar-brand img {
    transform: scale(0.9);
}

.nav-link {
    color: #555 !important;
    font-weight: 600;
    margin: 0 0.5rem;
    position: relative;
}

    .nav-link:hover, .nav-link.active {
        color: #0061f2 !important;
    }

    .nav-link::after {
        content: '';
        position: absolute;
        width: 0;
        height: 2px;
        bottom: 0;
        left: 50%;
        background-color: #0061f2;
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }

    .nav-link:hover::after {
        width: 80%;
    }

/* =========================================
   6. Footer (深色)
   ========================================= */
.footer-dark {
    background-color: #1a1f24;
    color: #adb5bd;
}

    .footer-dark h5 {
        color: #fff;
        margin-bottom: 1.2rem;
    }

    .footer-dark a {
        color: #adb5bd;
        text-decoration: none;
    }

        .footer-dark a:hover {
            color: #fff;
        }

.visit-counter {
    background: #000;
    color: #0f0;
    font-family: 'Courier New', monospace;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #333;
    letter-spacing: 2px;
}

.bg-white.rounded-circle.shadow-sm {
    box-shadow: 0 4px 10px rgba(0,0,0,0.08) !important;
}

/* =========================================
   7. 公告區塊
   ========================================= */
.news-section {
    position: relative;
    padding: 2rem 0;
}

.news-list-group {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
}

.list-group-item-action {
    border: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 1.25rem 1.5rem;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

    .list-group-item-action:last-child {
        border-bottom: none;
    }

    .list-group-item-action:hover {
        background-color: #f8f9fa;
        border-left-color: #0061f2;
        padding-left: 2rem;
        color: #0061f2;
    }

.news-date {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #999;
    min-width: 100px;
}

.list-group-item-action:hover .news-date {
    color: #555;
}

.badge-news {
    font-weight: 500;
    padding: 0.5em 0.8em;
    border-radius: 6px;
}

.badge-sys {
    background-color: #e0f2fe;
    color: #0061f2;
}

.badge-reg {
    background-color: #dcfce7;
    color: #166534;
}

.badge-hot {
    background-color: #fee2e2;
    color: #991b1b;
}

/* =========================================
   8. 內頁優化 (Inner Page Enhancements)
   ========================================= */

/* 優化內頁標題區塊 */
.page-header {
    /* [修改] 改為純白背景，與下方灰底形成強烈對比 */
    background-color: #ffffff;
    border-bottom: 1px solid #e2e5e8; /* 邊框顏色稍微加深一點點 */
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* 增加一點點陰影 */
}

    /* 左側裝飾藍條 */
    .page-header::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 6px;
        background: linear-gradient(to bottom, #0061f2, #00c6f7);
    }

/* 卡片質感升級 */
.card-modern {
    border: none;
    border-radius: 1rem; /* 更圓潤 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); /* 更柔和擴散的陰影 */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .card-modern:hover {
        transform: translateY(-2px); /* 微微上浮 */
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    }

.card-header-modern {
    background-color: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1.5rem;
}

/* 表格優化 */
.table-hover tbody tr:hover {
    background-color: rgba(0, 97, 242, 0.03); /* 懸停時淡淡的品牌藍 */
    transform: scale(1.0001); /* 極微小的放大，增加互動感 */
    transition: all 0.2s ease;
}

.table thead th {
    font-weight: 600;
    color: #495057;
    border-top: 2px solid #e9ecef;
    border-bottom: 2px solid #e9ecef;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

/* 按鈕微調 */
.btn-rounded-pill {
    border-radius: 50px;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* =========================================
   9. RWD 輔助工具 (Custom Utilities)
   ========================================= */

/* 手機版預設會吃到 HTML 的 border-top，不需要寫 CSS */

/* 電腦版 (lg 以上)：強制移除邊框 */
@media (min-width: 992px) {
    .border-lg-0 {
        border: none !important;
    }
}