/* =========================================
   字體宣告 (Font Declarations)
   ========================================= */

/* 台北黑體 (Taipei Sans TC) - 本地字體 */
@font-face {
    font-family: 'Taipei Sans TC';
    src: url('/assets/fonts/TaipeiSansTCBeta-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Taipei Sans TC';
    src: url('/assets/fonts/TaipeiSansTCBeta-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Taipei Sans TC';
    src: url('/assets/fonts/TaipeiSansTCBeta-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* 辰宇落雁體 (ChenYuluoyan) - 本地字體 */
@font-face {
    font-family: 'ChenYuluoyan';
    src: url('/assets/fonts/ChenYuluoyan-Thin-Monospaced.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    /* =========================================
       新設計系統 (V2) - 2026-01-28
       ========================================= */

    /* =========================================
       字體系統 (Typography System)
       ========================================= */
    --font-body:    'Zen Maru Gothic', 'Taipei Sans TC', 'Noto Sans TC', sans-serif;  /* 主要中文內文/標題 */
    --font-nav:     'Zen Maru Gothic', 'Noto Sans TC', sans-serif;                    /* 導覽列 */
    --font-en:      'Montserrat', sans-serif;                      /* 英文字體 */
    --font-quote:   'ChenYuluoyan', cursive;                       /* 名人見證/手寫風格 */
    --font-number:  'Lato', 'Montserrat', sans-serif;              /* 數字/價格/數據 */

    /* 1. 基礎色票 (Base Palette) */
    --color-brand-hue: 34; /* 色相 (棕色) */
    --color-gray-hue: 30; /* 色相 (暖灰色) */

    /* 2. 語義化顏色 (Semantic Colors) */
    --color-primary: hsl(var(--color-brand-hue), 25%, 55%); /* #AA9177 */
    --color-primary-dark: hsl(var(--color-brand-hue), 25%, 45%); /* #8A725A */
    --color-primary-light: hsl(var(--color-brand-hue), 30%, 95%); /* #F9F8F6 - 燕麥白背景 */

    --color-success: hsl(145, 63%, 32%); /* #28a745 */
    --color-warning: hsl(45, 100%, 51%); /* #ffc107 */
    --color-danger: hsl(354, 70%, 54%); /* #dc3545 */

    /* 3. 文字顏色 (Text Colors) */
    --text-primary: hsl(var(--color-gray-hue), 10%, 20%); /* #3C3A38 */
    --text-secondary: hsl(var(--color-gray-hue), 8%, 45%); /* #7B7874 */
    --text-muted: hsl(var(--color-gray-hue), 10%, 65%); /* #B0ADA9 */
    --text-on-primary: #FFFFFF; /* 在主色背景上的文字 */

    /* 4. 背景與邊框 (Background & Borders) */
    --bg-body: var(--color-primary-light); /* #F9F8F6 */
    --bg-surface: #FFFFFF; /* 卡片、彈出視窗等表面背景 */
    --border-color: hsl(var(--color-gray-hue), 15%, 90%); /* #EAE9E8 */
    --border-color-light: hsl(var(--color-gray-hue), 15%, 95%); /* #F5F4F3 */

    /* 5. 陰影系統 (Shadow System) */
    --shadow-color: 220 3% 15%; /* 陰影的基礎 HSL 顏色 */
    --shadow-strength: 1%;

    --shadow-xs: 0 1px 2px -1px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%));
    --shadow-sm: 0 3px 5px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 10%));
    --shadow-md: 0 7px 14px -4px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 12%));
    --shadow-lg: 0 15px 25px -5px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 15%));
    --shadow-xl: 0 25px 50px -10px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 20%));


    /* --- 舊版變數 (相容用) --- */
    --primary: #AA9177;
    /* 質感咖 */
    --primary-dark: #8A725A;
    --bg-body: #F9F8F6;
    /* 燕麥白 */
    --white: #FFFFFF;
    --text-main: #4A4A4A;
    --text-light: #999999;

    /* --- 元件參數 --- */
    --radius-btn: 50px;
    --radius-card: 16px;
    --radius-xl: 24px;
    --shadow-card: 0 10px 30px rgba(170, 145, 119, 0.08);
    --shadow-float: 0 15px 40px rgba(0, 0, 0, 0.05);
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    padding-top: 90px;
    /* 預留給導覽列高度 (增加以避免遮擋) */
    overflow-x: hidden;
    letter-spacing: 0.03em;

    /* Flexbox 佈局確保 footer 黏在底部 */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.has-category-bar {
    padding-top: 150px;
    /* 90px (nav) + 60px (category-bar approx) */
}

/* 主要內容區域包裝器,自動填充剩餘空間 */
.main-content-wrapper {
    flex: 1 0 auto;
}

/* 字體工具 */
.font-serif {
    font-family: 'Noto Serif TC', serif;
}

.font-en {
    font-family: 'Playfair Display', serif;
}

a {
    text-decoration: none;
    color: var(--text-main);
    transition: 0.3s;
}

a:hover {
    color: var(--primary);
}

/* =========================================
   1. 導覽列系統
   ========================================= */
.navbar-main {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    height: 70px;
    z-index: 1030;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    font-family: var(--font-nav); /* 導覽列使用思源黑體 */
}

.navbar-brand img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.nav-link-item {
    font-family: var(--font-nav); /* 導覽列連結使用思源黑體 */
    font-weight: 500;
    margin: 0 15px;
    color: var(--text-main);
    position: relative;
}

.nav-link-item:hover {
    color: var(--primary);
}

/* 任務中心小紅點（桌面版導覽列） */
.nav-mission-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #e53e3e;
    border-radius: 50%;
    position: absolute;
    top: -2px;
    right: -8px;
}

/* 任務中心小紅點（手機版選單） */
.nav-mission-dot-mobile {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #e53e3e;
    border-radius: 50%;
    flex-shrink: 0;
}

.nav-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    border-radius: 50%;
    transition: 0.3s;
    border: none;
    background: transparent;
    margin-left: 5px;
    position: relative;
    text-decoration: none;
}

.nav-icon-btn:hover {
    background: rgba(170, 145, 119, 0.1);
    color: var(--primary);
}

/* 手機版漢堡選單按鈕 */
.navbar-toggler-custom {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    border-radius: 50%;
    transition: 0.3s;
    border: none;
    background: transparent;
    font-size: 1.2rem;
}

.navbar-toggler-custom:hover {
    background: rgba(170, 145, 119, 0.1);
    color: var(--primary);
}

/* ── Mega Menu（技術師中心多欄展開）── */
.mega-menu-wrap {
    position: static; /* 相對於 navbar container 定位 */
}

.mega-menu {
    position: fixed !important; /* 突破父層 overflow，對齊視窗 */
    left: 0 !important;
    right: 0 !important;
    top: 70px !important;       /* 貼緊 navbar 底部 */
    width: 100vw !important;
    max-width: 100vw;
    border-radius: 0 0 16px 16px !important;
    border: none !important;
    border-top: 1px solid rgba(0,0,0,0.06) !important;
    box-shadow: 0 12px 32px rgba(0,0,0,0.10) !important;
    padding: 28px 0 24px !important;
    background: #fff;
    display: none;
    z-index: 1029;
}

.mega-menu.show {
    display: block;
}

.mega-menu-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0 24px;
}

.mega-col {
    padding: 0 8px;
    border-right: 1px solid rgba(0,0,0,0.05);
}

.mega-col:last-child {
    border-right: none;
}

.mega-col + .mega-col {
    /* 相鄰欄間距由 gap 處理 */
}

.mega-section {
    margin-bottom: 20px;
}

.mega-section:last-child {
    margin-bottom: 0;
}

.mega-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #bbb;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.mega-link {
    display: block;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-main, #333);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    overflow-wrap: break-word;
}

.mega-link:hover {
    background: rgba(170,145,119,0.08);
    color: var(--primary, #AA9177);
}

/* 手機版滑出選單 */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: #fff;
    z-index: 1040;
    transition: right 0.3s ease;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.mobile-menu-header h5 {
    margin: 0;
    font-weight: 700;
    color: var(--text-main);
}

.close-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.3s;
}

.close-btn:hover {
    color: var(--primary);
}

.mobile-menu-content {
    padding: 20px 0;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--text-main);
    text-decoration: none;
    transition: 0.3s;
    border-left: 3px solid transparent;
}

.mobile-menu-item:hover {
    background: rgba(170, 145, 119, 0.05);
    border-left-color: var(--primary);
    color: var(--primary);
}

.mobile-menu-item i {
    width: 24px;
    margin-right: 15px;
    text-align: center;
}

.mobile-menu-divider {
    height: 1px;
    background: #eee;
    margin: 10px 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* L2: 快速分類列 (Scrollable) */
.category-bar {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1020;
    padding: 10px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.02);
    overflow-x: auto;
    white-space: nowrap;
}

.category-bar::-webkit-scrollbar {
    display: none;
}

.cat-pill {
    display: inline-block;
    padding: 6px 20px;
    margin: 0 5px;
    border-radius: var(--radius-btn);
    font-size: 0.9rem;
    color: var(--text-main);
    border: 1px solid transparent;
    background: transparent;
    transition: 0.3s;
    cursor: pointer;
}

.cat-pill:hover {
    color: var(--primary);
    background: rgba(170, 145, 119, 0.1);
}

.cat-pill.active {
    background: var(--text-main);
    color: #fff;
}

/* =========================================
   2. Hero Section
   ========================================= */
.hero-wrapper {
    margin-top: 20px;
    margin-bottom: 40px;
    padding-top: 100px;
    padding-bottom: 100px;
}

.hero-card {
    height: 450px;
    border-radius: var(--radius-xl);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Hero 輪播樣式 */
.hero-carousel {
    height: 450px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
}

.hero-carousel .carousel-inner {
    height: 100%;
}

.hero-carousel .carousel-item {
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero-carousel .carousel-indicators {
    bottom: 20px;
    margin-bottom: 0;
}

.hero-carousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    margin: 0 5px;
}

.hero-carousel .carousel-indicators button.active {
    background-color: var(--primary);
    border-color: var(--primary);
}

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.8;
    transition: opacity 0.3s;
}

.hero-carousel .carousel-control-prev {
    left: 20px;
}

.hero-carousel .carousel-control-next {
    right: 20px;
}

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

.hero-overlay {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    padding: 40px 50px;
    border-radius: var(--radius-card);
    margin-left: 60px;
    max-width: 550px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.btn-hero {
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-btn);
    padding: 10px 30px;
    border: none;
    transition: 0.3s;
    letter-spacing: 1px;
}

.btn-hero:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* =========================================
   3. 內容區塊樣式
   ========================================= */
.section-title {
    font-family: 'Noto Serif TC', serif;
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: end;
}

.link-more {
    font-size: 0.9rem;
    color: var(--text-light);
    font-family: 'Noto Sans TC';
    font-weight: 400;
}

/* 技術師卡片 */
.tech-scroll-wrapper {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 5px 30px 5px;
    scroll-behavior: smooth;
}

.tech-scroll-wrapper::-webkit-scrollbar {
    height: 0px;
}

.tech-card-pro {
    min-width: 160px;
    height: 240px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.tech-card-pro:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(170, 145, 119, 0.25);
}

.tech-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.tech-card-pro:hover .tech-bg-img {
    transform: scale(1.1);
}

.rank-number-art {
    position: absolute;
    top: -5px;
    left: 10px;
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 900;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 2;
    line-height: 1;
    font-style: italic;
}

.rank-1 {
    color: #FFD700;
}

.rank-2 {
    color: #E0E0E0;
}

.rank-3 {
    color: #CD7F32;
}

.rank-normal {
    font-size: 2.5rem;
    top: 0;
    opacity: 0.6;
    color: #fff;
}

.tech-info-glass {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.tech-name-pro {
    font-family: 'Noto Serif TC';
    font-weight: 700;
    font-size: 1rem;
    color: #333;
}

.tech-role-pro {
    font-size: 0.75rem;
    color: #666;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* 服務卡片 */
.ins-card {
    background: #fff;
    border-radius: var(--radius-card);
    border: none;
    transition: 0.3s;
    overflow: hidden;
    cursor: pointer;
    height: 100%;
}

.ins-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card);
}

.card-img-box {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.card-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.ins-card:hover .card-img-box img {
    transform: scale(1.05);
}

.card-body-ins {
    padding: 15px;
}

.card-tag {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.card-title {
    font-family: 'Noto Serif TC';
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.card-price {
    font-weight: 700;
    color: var(--text-main);
}

/* 商城卡片 */
.product-card-simple {
    background: transparent;
    border: none;
    cursor: pointer;
    overflow: visible;
}

.product-card-simple .card-img-box {
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1/1;
    margin-bottom: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card-simple:hover .card-img-box {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(170, 145, 119, 0.2);
}

.product-card-simple img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.product-card-simple:hover img {
    transform: scale(1.08);
}

.product-title {
    font-family: 'Noto Serif TC';
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.4;
}

.product-price {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.05rem;
}

/* 側欄 */
.sidebar-sticky {
    position: sticky;
    top: 110px;
    /* 90px (nav) + 20px (spacing) */
}

/* Sidebar Card Styles */
.sidebar-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    align-items: center;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    color: #4a5568;
    background: #fafafa;
    border: 1px solid transparent;
}

.filter-option:hover {
    background-color: #f0f4f8;
    border-color: #e2e8f0;
    transform: translateX(4px);
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    cursor: pointer;
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.filter-option input[type="checkbox"]:checked,
.filter-option input[type="radio"]:checked {
    accent-color: var(--primary);
}

.filter-option input[type="checkbox"]:checked+span,
.filter-option input[type="radio"]:checked+span {
    color: var(--primary);
    font-weight: 600;
}

.filter-option:has(input:checked) {
    background-color: rgba(170, 145, 119, 0.1);
    border-color: var(--primary);
}

.booking-widget {
    background: #fff;
    border-radius: var(--radius-card);
    padding: 25px;
    box-shadow: var(--shadow-float);
    margin-bottom: 30px;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.widget-title {
    font-family: 'Noto Serif TC';
    font-weight: 600;
    margin-bottom: 20px;
}

.form-ins {
    background: var(--bg-body);
    border: none;
    border-radius: 10px;
    padding: 12px;
    width: 100%;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.btn-block-primary {
    width: 100%;
    background: var(--primary);
    color: #fff;
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-weight: 500;
    transition: 0.3s;
}

.btn-block-primary:hover {
    background: var(--primary-dark);
}

/* 統計數據 */
.stats-section {
    background: #fff;
    padding: 60px 0;
    margin-top: 80px;
    border-top: 1px solid #eee;
}

.stat-num {
    font-family: 'Playfair Display';
    font-size: 2.5rem;
    color: var(--primary);
    font-weight: 700;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    letter-spacing: 1px;
    margin-top: 5px;
}

/* Footer */
footer {
    background: #222;
    color: #999;
    padding: 60px 0 30px;
    font-size: 0.9rem;
    flex-shrink: 0;
    /* 確保 footer 不會被壓縮 */
}

footer h5,
footer h6 {
    color: #fff;
    font-family: 'Playfair Display';
    margin-bottom: 20px;
}

footer a {
    color: #999;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--primary);
}

/* 社群媒體圖示 */
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #999;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-3px);
}

/* Footer 分隔線 */
footer hr {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 30px 0;
}

/* Footer 底部資訊 */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo img {
    height: 50px;
    width: auto;
    opacity: 0.9;
}

.footer-info {
    text-align: right;
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-info p {
    margin-bottom: 5px;
}

/* 行動版 Footer 手風琴 */
.footer-accordion {
    display: none;
    /* 桌面版隐藏 */
}

.footer-accordion-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease;
}

.footer-accordion-header:hover {
    color: var(--primary);
}

.footer-accordion-header h6 {
    margin: 0;
    font-size: 1rem;
}

.footer-accordion-icon {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.footer-accordion-item.active .footer-accordion-icon {
    transform: rotate(180deg);
}

.footer-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.footer-accordion-item.active .footer-accordion-content {
    max-height: 500px;
    padding-bottom: 15px;
}

/* Toast */
.toast-custom {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* RWD 調整 */
@media (max-width: 1199px) {
    body {
        padding-top: 70px;
        /* 手機版只有單層導覽 */
    }

    .hero-overlay {
        margin: 0;
        max-width: 100%;
        padding: 30px;
        text-align: center;
    }

    .hero-card {
        justify-content: center;
    }

    .rank-number-art {
        font-size: 2.5rem;
    }

    .navbar-links {
        display: none !important;
    }

    /* Footer RWD */
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .footer-logo {
        order: 2;
    }

    .footer-info {
        order: 1;
        text-align: center;
    }

    .social-icon {
        margin: 5px;
    }

    /* 行動版顯示手風琴，隱藏原有區塊 */
    footer .row>div:not(:first-child) {
        display: none;
    }

    .footer-accordion {
        display: block !important;
    }
}

@media (min-width: 1200px) {
    .navbar-links {
        display: flex !important;
    }

    .mobile-menu-overlay {
        display: none !important;
    }
}

/* =========================================
   字體工具類別 (Typography Utilities)
   ========================================= */

/* 英文字體 — 用於英文標題、品牌名稱等 */
.font-en,
[lang="en"],
.brand-en {
    font-family: var(--font-en);
}

/* 數字字體 — 用於價格、統計數字、日期等 */
.font-number,
.price,
.stat-number,
.price-amount,
.points-amount,
.counter-number {
    font-family: var(--font-number);
    font-variant-numeric: tabular-nums;
}

/* 手寫風格字體 — 用於名人見證、引言等 */
.font-quote,
.testimonial-text,
.quote-text,
.handwriting {
    font-family: var(--font-quote);
}

/* 導覽列字體 — 思源黑體 */
.font-nav {
    font-family: var(--font-nav);
}

/* 讓價格數字自動套用 Lato */
.price-tag,
.amount,
.discount-price,
.original-price,
.member-price {
    font-family: var(--font-number);
}
/* =========================================
   搜尋 Modal (up-search-*)
   ========================================= */
.up-search-dialog {
    max-width: 560px;
}

.up-search-content {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.14) !important;
    overflow: hidden;
}

.up-search-bar {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border-color, #EAE9E8);
}

.up-search-form {
    flex: 1;
    display: flex !important;
    align-items: center;
    background: var(--color-primary-light, #F9F8F6);
    border: 1.5px solid var(--border-color, #EAE9E8);
    border-radius: 100px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin: 0 !important;
    gap: 0;
}

.up-search-form:focus-within {
    border-color: var(--color-primary, #AA9177);
    box-shadow: 0 0 0 3px rgba(170, 145, 119, 0.12);
    background: #fff;
}

.up-search-icon {
    padding-left: 14px;
    color: var(--text-muted, #B0ADA9);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.up-search-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 10px 10px;
    font-size: 0.9rem;
    outline: none;
    color: var(--text-primary, #3C3A38);
    font-family: var(--font-body, sans-serif);
    min-width: 0;
    border-radius: 0 !important;
}

.up-search-input:focus {
    border: none !important;
    box-shadow: none !important;
}

.up-search-input::placeholder {
    color: var(--text-muted, #B0ADA9);
    transition: opacity 0.25s;
}

.up-search-btn {
    background: var(--color-primary, #AA9177) !important;
    color: #fff !important;
    border: none !important;
    padding: 9px 18px !important;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: var(--font-body, sans-serif);
    border-radius: 0 100px 100px 0 !important;
    line-height: 1.6;
}

.up-search-btn:hover {
    background: var(--color-primary-dark, #8A725A) !important;
}

.up-search-close {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    border-radius: 50%;
    color: var(--text-muted, #B0ADA9);
    font-size: 1rem;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}

.up-search-close:hover {
    background: var(--color-primary-light, #F9F8F6);
    color: var(--text-primary, #3C3A38);
}

.up-search-body {
    padding: 14px 16px 18px;
}

.up-search-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-danger, #dc3545);
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}

.up-search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.up-search-tag {
    display: inline-block;
    padding: 4px 13px;
    border-radius: 100px;
    border: 1px solid var(--border-color, #EAE9E8);
    background: transparent;
    color: var(--text-secondary, #7B7874);
    font-size: 0.82rem;
    text-decoration: none;
    transition: all 0.18s;
    overflow-wrap: break-word;
    line-height: 1.6;
}

.up-search-tag:hover {
    background: var(--color-primary, #AA9177);
    border-color: var(--color-primary, #AA9177);
    color: #fff;
}
