/* 臺中市政府地方稅務局（友善稅務智慧個人雲平台）- Bootstrap 主題顏色覆蓋 */
:root {
    /* 臺中稅務局主色系（OSS2026 橘磚紅） */
    --bs-primary: #C75214;
    --bs-primary-rgb: 199, 82, 20;

    /* 額外 token：給自訂 CSS/內頁共用 */
    --taichungtax-primary: var(--bs-primary);
    --taichungtax-primary-rgb: var(--bs-primary-rgb);
    --taichungtax-primary-dark: #B84000;
    --taichungtax-primary-soft: #F8E8DF;

    /* 相容舊版 token（保留變數名稱供 all.css 引用）*/
    --miaoli-primary: var(--bs-primary);
    --miaoli-primary-rgb: var(--bs-primary-rgb);
    --miaoli-primary-dark: var(--taichungtax-primary-dark);
    --miaoli-primary-soft: var(--taichungtax-primary-soft);

    /* 內頁 token */
    --primary-orange: var(--taichungtax-primary) !important;
    --primary-dark: var(--taichungtax-primary-dark) !important;
    --shadow: 0 2px 8px rgba(var(--taichungtax-primary-rgb), 0.15) !important;
    --shadow-hover: 0 4px 16px rgba(var(--taichungtax-primary-rgb), 0.25) !important;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* =====================================================
   OSS2026 套版：all.css 衝突修正（最高優先）
   ===================================================== */

/* 讓 body 成為唯一的捲動容器，html 設為 overflow:hidden
   → 滾動範圍完全在 body 內，不存在 html 層可以滾過頭的空間 */
html {
    overflow: hidden !important;
    height: 100% !important;
}
body {
    height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior-y: none !important;
    /* all.css body { margin-bottom: 237px } 全部清零 */
    margin-bottom: 0 !important;
    background-image: none !important;
    background-color: #F6F7EF !important;
}
@media (max-width: 1199.98px) { body { margin-bottom: 0 !important; } }
@media (max-width: 991.98px)  { body { margin-bottom: 0 !important; } }
@media (max-width: 767.98px)  { body { margin-bottom: 0 !important; } }
@media (max-width: 575.98px)  { body { margin-bottom: 0 !important; } }

/* bg.png 掛在 #wrapper 而非 body：背景不會超過 footer */
#wrapper.index-body {
    background-color: #F6F7EF;
    background-image: url('/frontref/img/bg.png');
    background-repeat: no-repeat;
    background-position: center -65px;
}

/* all.css 的 footer { position:absolute } 會讓 footer 覆蓋內容，強制改 relative */
/* 同時覆蓋 HomeLayout (.index-body) 與 MainLayout (無 .index-body) */
#wrapper footer.footer {
    position: relative !important;
    bottom: auto !important;
    width: 100% !important;
}

/* MainLayout：讓 #wrapper 使用 flexbox 把 footer 推到頁底 */
#wrapper:not(.index-body) {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
#wrapper:not(.index-body) > .main-content {
    flex: 1 0 auto;
}

/* all.css 的 main { padding-top:56px } 在首頁不需要（header 不是 sticky on desktop） */
#wrapper.index-body > main#content {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* 讓首頁 wrapper 使用 flexbox，footer 永遠置底 */
#wrapper.index-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
#wrapper.index-body > main#content {
    flex: 1 0 auto;
}

/* all.css 的 nav-link font-size:1.5em 覆蓋回 1rem */
#header_apply .navbar-collapse .navbar-nav .nav-link {
    font-size: 1rem !important;
    padding: 18px 14px !important;
}

/* all.css 的 header sticky 只在 <1200px，桌機版確保 header 在正常流 */
@media (min-width: 1200px) {
    #header_apply {
        position: static !important;
    }
}

/* topic1 補上 padding-top（all.css 只設 padding-bottom: 56px） */
#topic1 {
    padding-top: 56px;
}

a, .btn-link {
    color: var(--bs-primary);
}

.btn-primary {
    color: #fff;
    background-color: var(--bs-primary);
    border-color: #B84000;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.5);
}

.text-primary {
    color: var(--bs-primary) !important;
}

.spinner-border.text-primary {
    border-color: var(--bs-primary);
    border-right-color: transparent;
}

.content {
    padding-top: 1.1rem;
}

/* 讓頁面內容撐滿高度，避免 footer 瞬間上跳 */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Import photo upload styles */
@import url('css/photo-upload.css');

/* 減少 Blazor Server 連線時的閃爍 */
html {
    visibility: visible;
}

/* 平滑過渡效果 */
.auth-buttons > * {
    transition: opacity 0.15s ease-in-out;
}

/* 避免內容載入時的佈局偏移 */
.service-categories-wrapper,
.popular-grid,
.news-grid {
    min-height: 200px; /* 預留空間，避免載入時佈局跳動 */
}

/* ===== 業務單位卡片（縣府圖示風格）===== */
.unit-card-grid { margin-top: 1.5rem; }

.unit-card-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem 0.75rem 1rem;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e4eaf2;
    text-decoration: none !important;
    color: #333 !important;
    height: 100%;
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
}
.unit-card-btn:hover,
.unit-card-btn:focus {
    box-shadow: 0 6px 20px rgba(42, 109, 181, 0.15);
    transform: translateY(-3px);
    border-color: #a8c8f0;
    color: #1a5aa8 !important;
}

/* 無圖時：圓形彩色背景 + BI 圖示 */
.unit-card-icon-wrap {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dceeff 0%, #b8d9ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    overflow: hidden;
    flex-shrink: 0;
}
.unit-card-icon-wrap i {
    font-size: 2rem;
    color: #2a6db5;
    line-height: 1;
}

/* 有圖時：完整顯示插圖，不裁切 */
.unit-card-icon-wrap.has-img {
    width: 100%;
    height: 110px;
    border-radius: 0;
    background: transparent;
    overflow: visible;
    padding: 0 0.25rem;
}
.unit-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
}
.unit-card-name {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.4rem;
    word-break: break-word;
}
.unit-card-badge {
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

@media (max-width: 575.98px) {
    .unit-card-icon-wrap { width: 60px; height: 60px; }
    .unit-card-icon-wrap i { font-size: 1.6rem; }
    .unit-card-name { font-size: 0.82rem; }
}

/* 首頁 main 不設白底，讓 body 的 bg.png 暖米色背景透出 */

/* ===== 熱門申辦（簡潔文字列表）===== */
.popular-simple-list {
    max-width: 860px;
    margin: 1rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.popular-simple-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    text-decoration: none !important;
    color: #333 !important;
    transition: background-color 0.2s, padding-left 0.2s, box-shadow 0.2s;
    position: relative;
}
.popular-simple-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 3px 0 0 3px;
    background: var(--bs-primary, #C0392B);
    transform: scaleY(0);
    transition: transform 0.2s;
}
.popular-simple-item:hover,
.popular-simple-item:focus {
    background-color: #f8fbff;
    padding-left: 1.5rem;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}
.popular-simple-item:hover::before,
.popular-simple-item:focus::before {
    transform: scaleY(1);
}
.popular-simple-name {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.5;
}
.popular-simple-add {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ef6c35;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    margin-left: 1rem;
    transition: background-color 0.2s, transform 0.2s;
}
.popular-simple-item:hover .popular-simple-add {
    background: #d95a28;
    transform: scale(1.15);
}

/* ===== 最新消息區塊 ===== */
.index-body #latestNews {
    background-color: #fff !important;
    padding-top: 2rem;
    padding-bottom: 2.5rem;
}


/* =====================================================
   內頁共用樣式
   所有非首頁的內頁（MainLayout）共用色彩、排版
   ===================================================== */

/* --- 內頁 page-header 標題區 --- */
.page-header {
    background: #fff;
    border-bottom: 4px solid var(--bs-primary, #C0392B);
    padding: 2.5rem 0;
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.08);
}
.page-header .container { max-width: 1200px; }

.page-header .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1rem;
}
.page-header .breadcrumb-item a {
    color: #6b6b6b;
    text-decoration: none;
    transition: color 0.3s;
}
.page-header .breadcrumb-item a:hover {
    color: var(--bs-primary, #C0392B);
}
.page-header .breadcrumb-item.active {
    color: #3e3e3e;
}
.page-header .breadcrumb-item + .breadcrumb-item::before {
    color: #6b6b6b;
}

.page-header h1 {
    color: #0b0b0b;
    font-weight: 700;
    font-size: 2rem;
    padding-left: 1rem;
    border-left: 5px solid var(--bs-primary, #C0392B);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.page-header h1 i {
    color: var(--bs-primary, #C0392B);
}

.page-header .page-description {
    color: #3e3e3e;
    font-size: 1rem;
    padding-left: 1.75rem;
    margin-bottom: 0;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .page-header { padding: 2rem 0; }
    .page-header h1 { font-size: 1.5rem; }
}

/* --- 內頁通用卡片 --- */
.main-content .card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s, transform 0.3s;
}
.main-content .card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.10);
}

/* --- 內頁分頁 --- */
.main-content .pagination .page-link {
    color: var(--bs-primary, #C0392B);
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin: 0 0.25rem;
    padding: 0.6rem 1rem;
    font-weight: 500;
    transition: all 0.3s;
}
.main-content .pagination .page-link:hover {
    background: rgba(192, 57, 43, 0.1);
    border-color: var(--bs-primary, #C0392B);
    color: var(--bs-primary, #C0392B);
}
.main-content .pagination .page-item.active .page-link {
    background: var(--bs-primary, #C0392B);
    border-color: var(--bs-primary, #C0392B);
    color: #fff;
    font-weight: 600;
}
.main-content .pagination .page-item.disabled .page-link {
    background: #f8f9fa;
    border-color: #e0e0e0;
    color: #cbd5e0;
}

/* --- 內頁按鈕融合 --- */
.main-content .btn-primary {
    background: var(--bs-primary, #C0392B);
    border-color: var(--bs-primary-dark, #A93226);
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s;
}
.main-content .btn-primary:hover {
    background: var(--bs-primary-dark, #A93226);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.3);
}
.main-content .btn-outline-primary {
    border: 2px solid var(--bs-primary, #C0392B);
    color: var(--bs-primary, #C0392B);
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s;
}
.main-content .btn-outline-primary:hover {
    background: var(--bs-primary, #C0392B);
    color: #fff;
}

/* --- 內頁 alert 融合 --- */
.main-content .alert-info {
    background: #e8f6f7;
    border-left: 4px solid var(--bs-primary, #C0392B);
    color: #3e3e3e;
    border-radius: 8px;
}
.main-content .alert-info i {
    color: var(--bs-primary, #C0392B);
}

/* --- 內頁 text-primary 融合 --- */
.main-content .text-primary {
    color: var(--bs-primary, #C0392B) !important;
}

/* --- 內頁內容容器 --- */
.main-content .container {
    max-width: 1200px;
}

/* --- 確保內頁 section 有適當間距 --- */
.main-content section + section,
.main-content .container.py-4,
.main-content .container.py-5 {
    background: #f5f5f5;
}

/* =====================================================
   臺中市政府地方稅務局 品牌識別（OSS2026 白底橘框版型）
   ===================================================== */

/* Header 背景：白底 + 頂部橘色邊框 */
header#header_apply {
    background: #fff !important;
    border-top: 3px solid #C75214 !important;
    background-image: none !important;
    box-shadow: 0 2px 8px rgba(199, 82, 20, 0.08);
}

/* Header navbar 字色統一深色 */
header#header_apply .navbar {
    color: #333;
}

/* ── 臺中稅務局 Brand Logo ── */
.taichungtax-brand {
    display: flex !important;
    align-items: center;
    text-decoration: none !important;
    gap: 0;
    padding: 0.25rem 0.5rem 0.25rem 0 !important;
}

.taichungtax-brand-symbol {
    height: 52px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    filter: none;
}

@media (max-width: 1199.98px) {
    .taichungtax-brand-symbol { height: 42px; }
}
@media (max-width: 767.98px) {
    .taichungtax-brand-symbol { height: 34px; }
}

.taichungtax-brand-divider {
    display: inline-block;
    width: 1.5px;
    height: 40px;
    background-color: rgba(199, 82, 20, 0.3);
    margin: 0 0.75rem;
    flex-shrink: 0;
}
@media (max-width: 767.98px) {
    .taichungtax-brand-divider { height: 28px; margin: 0 0.4rem; }
}

.taichungtax-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.taichungtax-brand-agency {
    display: block;
    color: #333;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.taichungtax-brand-platform {
    display: block;
    color: #C75214;
    font-size: 0.76rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

@media (max-width: 1199.98px) {
    .taichungtax-brand-agency { font-size: 1.0rem; }
}
@media (max-width: 767.98px) {
    .taichungtax-brand-agency { font-size: 0.88rem; }
    .taichungtax-brand-platform { display: none; }
}

/* header 內所有按鈕與連結不換行 */
header#header_apply .btn,
header#header_apply .navbar-brand {
    white-space: nowrap;
}

/* nav-link 顏色：深色 + hover 橘色；white-space:nowrap 防止圖示與文字換行 */
header#header_apply .navbar .nav-link,
.tt-home-nav .nav-link {
    color: #333 !important;
    font-weight: 600;
    padding: 20px 14px !important;
    font-size: 1rem;
    white-space: nowrap;
    transition: color 0.2s, background-color 0.2s;
}
header#header_apply .navbar .nav-link:hover,
header#header_apply .navbar .nav-link:focus,
.tt-home-nav .nav-link:hover,
.tt-home-nav .nav-link:focus {
    color: #C75214 !important;
    background-color: rgba(199, 82, 20, 0.06);
}

/* font-size 按鈕由 all.css 的 btn-outline-primary 處理 */

/* 登入按鈕 */
header#header_apply .btn-primary {
    background-color: #C75214;
    border-color: #B84000;
}

/* =====================================================
   首頁 OSS2026 套版樣式（2026-05）
   ===================================================== */

/* === 全域 === */
/* .tt-home 必須保持透明，讓 body 的 bg.png 暖米色背景透出 */
.tt-home {
    background: transparent;
    padding-bottom: 0;
}

.tt-home h2, .tt-home .h2 {
    color: #B84000;
}

/* === 補正提醒 === */
.tt-home-section {
    padding: 2rem 0;
}

.tt-home-alert-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: #fff7df;
    border: 1px solid #f3dc9a;
}

.tt-home-alert-links {
    margin-top: 0.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.8rem;
}

.tt-home-alert-links a {
    color: #6e4f00;
    text-decoration: none;
    font-size: 0.95rem;
}

/* === Topic 1：Hero + Search（左MyData / 右搜尋）=== */
.tt-home-hero {
    padding: 56px 0;
    background-repeat: no-repeat;
    background-position: right bottom;
    background-image: url('/frontref/img/index_img01.png');
}

@media (max-width: 575.98px) {
    .tt-home-hero { background-image: none; padding: 32px 0; }
}

.tt-home-hero .d-flex {
    align-items: center;
}

/* MyData 影片卡片 */
.tt-home-mydata-card {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(199,82,20,0.12);
}

/* ── YouTube 縮圖 facade ── */
.yt-facade {
    background: #111;
    cursor: pointer;
}
.yt-facade img {
    transition: opacity 0.2s;
}
.yt-facade:hover img,
.yt-facade:focus img {
    opacity: 0.82;
}
.yt-play-btn {
    pointer-events: none;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.55));
    transition: transform 0.15s;
}
.yt-facade:hover .yt-play-btn,
.yt-facade:focus .yt-play-btn {
    transform: translate(-50%, -50%) scale(1.14) !important;
}

/* ── YouTube 播放 Modal（參考 giveorward）── */
.yt-video-modal .modal-content {
    position: relative;
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.4);
}
.yt-video-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.92);
    opacity: 1;
    transition: background-color 0.2s, transform 0.2s;
}
.yt-video-close:hover {
    background-color: #fff;
    transform: scale(1.1);
}
.yt-video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;
    background: #000;
}
.yt-video-intro,
.yt-video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.yt-video-intro {
    z-index: 2;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.yt-video-intro.is-hidden {
    visibility: hidden;
    opacity: 0;
}
.yt-video-intro img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.yt-video-intro::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,23,42,.55), rgba(15,23,42,.1) 45%, rgba(15,23,42,.2));
}
.yt-video-intro h2 {
    position: absolute;
    top: clamp(1rem, 5vw, 2.5rem);
    left: 50%;
    z-index: 1;
    transform: translateX(-50%);
    width: 90%;
    color: #fff;
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: 700;
    text-align: center;
    text-shadow: 0 3px 16px rgba(0,0,0,.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.yt-video-frame iframe {
    border: 0;
}
.yt-video-blocked {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: #111;
    color: #fff;
    z-index: 3;
}
.yt-video-blocked p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.8;
}

.tt-home-mydata-card .card-body {
    background: #fff;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 600;
    color: #B84000;
}

/* 搜尋標題：對齊 OSS2026 的 .display-3 */
.tt-home-hero-title {
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: #333;
    line-height: 1.2;
}

@media (max-width: 575.98px) {
    .tt-home-hero-title { font-size: 2.5rem; margin-bottom: 1rem; }
}

/* 搜尋 input-group */
#track .input-group .form-control {
    border-radius: 8px 0 0 8px;
    min-height: 54px;
    font-size: 1rem;
    border-color: #ddd;
}

#track .input-group .btn {
    min-width: 60px;
    border-radius: 0 8px 8px 0;
    font-size: 1.1rem;
}

/* text-deepTheme：橘棕色文字（對齊 all.css 的 custom color） */
.text-deepTheme {
    color: #B84000 !important;
}

.tt-home-hot-keywords {
    margin-top: 0.7rem;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.9rem;
}

.tt-home-hot-keywords a {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(199,82,20,0.08);
    color: #B84000;
    text-decoration: none;
    transition: background-color 0.2s;
}

.tt-home-hot-keywords a:hover {
    background: rgba(199,82,20,0.18);
}

/* === 首頁搜尋 Autocomplete === */
.home-search-wrapper {
    position: relative;
    flex-wrap: nowrap !important;
    overflow: visible !important;
}

/* 輸入框聚焦時搭配下拉呈現直角底部 */
.home-search-wrapper .form-control:focus {
    border-radius: 8px 0 0 0 !important;
}

/* 建議下拉清單（首頁） */
.home-autocomplete-dropdown {
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #C75214;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    max-height: 300px;
    overflow-y: auto;
}

.home-autocomplete-dropdown .autocomplete-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.95rem;
    color: #333;
    transition: background 0.12s;
}
.home-autocomplete-dropdown .autocomplete-item:last-child {
    border-bottom: none;
    border-radius: 0 0 6px 6px;
}
.home-autocomplete-dropdown .autocomplete-item i {
    color: #ccc;
    font-size: 0.82rem;
    flex-shrink: 0;
}
.home-autocomplete-dropdown .autocomplete-item:hover,
.home-autocomplete-dropdown .autocomplete-item.highlighted {
    background: #fff3ef;
}
.home-autocomplete-dropdown .autocomplete-item:hover i,
.home-autocomplete-dropdown .autocomplete-item.highlighted i {
    color: #C75214;
}
.autocomplete-highlight {
    color: #C75214;
    font-weight: 700;
}

/* === Topic 2：熱門申辦 + 教學（橘底）=== */
.tt-home-popular-section {
    padding: 56px 0;
    background-color: rgba(199, 82, 20, 0.08);
}

/* 標題列 */
.tt-home-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.tt-home-section-head h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: #B84000;
}

.tt-home-btn-more {
    color: #B84000;
    text-decoration: none;
    font-weight: 600;
}

.tt-home-btn-more:hover {
    text-decoration: underline;
    color: #B84000;
}

/* 熱門申辦列表 */
.tt-home-popular-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.tt-home-popular-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 16px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s;
}

.tt-home-popular-item:last-child {
    border-bottom: none;
}

.tt-home-popular-item:hover {
    background-color: #fdf4ef;
}

.tt-home-popular-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.tt-home-popular-btns {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: 1rem;
}

@media (max-width: 767.98px) {
    .tt-home-popular-item { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .tt-home-popular-btns { align-self: flex-end; }
    .tt-home-popular-name {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        max-width: 18em;
    }
}

@media (min-width: 992px) {
    .tt-home-popular-name {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        max-width: 22em;
    }
}

/* 教學快速連結 */
.tt-home-teaching-list {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.tt-home-teaching-btn {
    display: flex;
    align-items: center;
    padding: 20px 16px;
    background-color: rgba(199, 82, 20, 0);
    text-decoration: none;
    transition: background-color 0.3s;
    border-bottom: 1px solid #fff;
}

.tt-home-teaching-btn:last-child {
    border-bottom: none;
}

.tt-home-teaching-btn:hover,
.tt-home-teaching-btn:focus {
    background-color: rgba(199, 82, 20, 0.1);
}

.tt-home-teaching-btn img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-right: 12px;
    flex-shrink: 0;
}

.tt-home-teaching-btn span {
    font-size: 1rem;
    font-weight: 600;
    color: #B84000;
}

/* === Topic 3：線上申辦（分類格）=== */
.tt-home-sort-section {
    padding: 80px 0;
    background-repeat: no-repeat;
    background-position: right bottom;
    background-image: url('/frontref/img/index_img02.png');
    background-size: 45%;
}

@media (max-width: 575.98px) {
    .tt-home-sort-section { background-image: none; padding: 48px 0; }
}

.tt-home-sort-section .tt-home-section-head h2 {
    text-align: center;
    width: 100%;
    justify-content: center;
    margin-bottom: 2.5rem;
}

/* 分類按鈕卡片 */
.tt-home-sort-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    border-radius: 16px;
    border: 1px solid #dedede;
    text-decoration: none;
    overflow: hidden;
    transition: box-shadow 0.25s, transform 0.25s;
}

.tt-home-sort-card:hover,
.tt-home-sort-card:focus {
    box-shadow: 0 6px 20px rgba(199,82,20,0.18);
    transform: translateY(-3px);
}

.tt-home-sort-img {
    width: 100%;
    padding: 28px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(30deg, #F8B62D, #FB925B);
    transition: background 0.3s;
}

.tt-home-sort-card:hover .tt-home-sort-img,
.tt-home-sort-card:focus .tt-home-sort-img {
    background: linear-gradient(120deg, #F8B62D, #FB925B);
}

.tt-home-sort-img img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.tt-home-sort-title {
    width: 100%;
    background-color: #fff;
    min-height: 90px;
    padding: 12px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.tt-home-sort-title span {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    line-height: 1.4;
}

/* === 最新消息 === */
.tt-home-news-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-bottom: 2px solid rgba(199,82,20,0.3);
}

.tt-home-news-item {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s;
}

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

.tt-home-news-item:hover { color: #B84000; }

.tt-home-news-date {
    font-size: 0.85rem;
    color: #888;
    width: 96px;
    flex-shrink: 0;
}

.tt-home-news-title {
    font-size: 1rem;
    line-height: 1.5;
}

.tt-home-empty {
    padding: 1.15rem;
    border-radius: 10px;
    background: #fff;
    border: 1px dashed #e0c8bc;
    color: #888;
}

/* === 服務類別卡片（ServiceCategory）=== */
.tt-home-category-card {
    height: 100%;
    background: #fff;
    border: 1px solid #e6ecf3;
    border-radius: 12px;
    padding: 1rem;
}

.tt-home-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.65rem;
}

.tt-home-category-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #B84000;
}

.tt-home-category-card ul {
    margin: 0 0 0.9rem 1.2rem;
    padding: 0;
}

.tt-home-category-card li {
    margin-bottom: 0.35rem;
}

.tt-home-category-card a {
    color: #555;
    text-decoration: none;
}

.tt-home-category-card a:hover { color: #C75214; }

.tt-home-category-more {
    display: inline-block;
    font-size: 0.92rem;
    font-weight: 600;
    color: #C75214 !important;
}

/* === 業務單位 chip === */
.tt-home-unit-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.7rem;
}

.tt-home-unit-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.8rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e8edf3;
    text-decoration: none;
    color: #555;
    transition: border-color 0.2s, color 0.2s;
}

.tt-home-unit-chip:hover {
    border-color: #C75214;
    color: #C75214;
}

.tt-home-unit-chip i { color: #C75214; }

.tt-home-unit-chip span { flex: 1; font-size: 0.92rem; }

.tt-home-unit-chip em {
    font-style: normal;
    font-size: 0.82rem;
    color: #aaa;
}

/* === Header nav === */
.tt-home-nav {
    background: #fff;
}

/* .font-size 由 all.css 的 header .navbar-collapse .font-size 處理 */

/* === Footer（OSS2026 橘底）=== */
footer.footer {
    background-color: #B84000 !important;
    color: #fff;
}

/* all.css footer .container { align-items:center } 會讓子元素縮到內容寬度，補 width:100% */
footer .container .footer-link,
footer .container .footer-flex {
    width: 100%;
}

/* footer-link 兩端對齊（連結左 / badge 右） */
footer .container .footer-link {
    justify-content: space-between !important;
}

.tt-home-footer-link-row {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 0.5rem 0;
}

@media (max-width: 575.98px) {
    .tt-home-footer-link-row { flex-direction: column; }
}

.tt-home-footer-link-row .list-inline { margin-bottom: 0; }

.tt-home-footer-link-row .list-inline-item { margin-right: 0; }

.tt-home-footer-link-row .list-inline-item + .list-inline-item::before {
    content: "｜";
    margin: 0 6px;
}

.tt-home-footer-link-row .list-inline-item a,
.tt-home-footer-link-row .list-inline-item a:visited {
    color: rgba(255,255,255,0.92);
    text-decoration: none;
}

.tt-home-footer-link-row .list-inline-item a:hover {
    text-decoration: underline;
}

.tt-home-footer-badge-row {
    display: flex;
    margin-left: 16px;
    gap: 12px;
    align-items: center;
}

@media (max-width: 575.98px) {
    .tt-home-footer-badge-row { margin-left: 0; margin-top: 8px; }
}

.tt-home-footer-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 575.98px) {
    .tt-home-footer-flex { flex-direction: column; align-items: flex-start; }
}

.tt-home-footer-logo {
    height: 48px;
    width: auto;
    margin-right: 20px;
    flex-shrink: 0;
}

@media (max-width: 575.98px) {
    .tt-home-footer-logo { margin-right: 0; margin-bottom: 8px; }
}

.tt-home-footer-info {
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.92);
}

.tt-home-footer-info a {
    color: #fff;
}

.tt-home-footer-info a:hover {
    text-decoration: underline;
}

/* === 回頁首按鈕 === */
.btn-top {
    position: fixed;
    z-index: 1050;
    right: 16px;
    bottom: 16px;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    color: #C75214;
    border: 1px solid #C75214 !important;
    box-shadow: 0 2px 8px rgba(199,82,20,0.18);
    display: none;
}

/* === 行動裝置底部導覽 === */
.mobile-bottom {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 6px 0 env(safe-area-inset-bottom);
    flex-direction: row;
    justify-content: space-around;
}

@media (max-width: 991.98px) {
    .mobile-bottom { display: flex; }
    .tt-home { padding-bottom: 60px; }
}

.mobile-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 0;
    color: #555;
    text-decoration: none;
    font-size: 0.72rem;
}

.mobile-btn i { font-size: 1.15rem; color: #C75214; }

.mobile-btn:hover { color: #C75214; }

@media (max-width: 991.98px) {
    .tt-home-unit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
    .tt-home-search-row { flex-direction: column; }
    .tt-home-search-row .btn { width: 100%; }
    .tt-home-unit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}