/* 近D玩 - 全站共用樣式（原本 inline 喺 includes/header.php，抽出嚟等瀏覽器可以快取） */
    /* ============================================
       CSS 變數
       ============================================ */
    :root {
        --white: #ffffff;
        --bg: #f8f9fa;
        --green: #63b949;
        --red: #f2643e;
        --orange: #f29f50;
        --yellow: #e8f4c3;
        --dark-green: #12a64e;
        --text-primary: #333333;
        --text-secondary: #777777;
        --text-light: #aaaaaa;
        --border: #e8e8e8;
        --shadow: 0 2px 8px rgba(0,0,0,0.06);
        --shadow-lg: 0 4px 16px rgba(0,0,0,0.1);
        --radius: 12px;
        --radius-sm: 8px;
        --bottom-nav-height: 60px;
        --header-height: 56px;
        --header-height-desktop: 76px;
    }

    /* ============================================
       Reset & 基礎
       ============================================ */
    *, *::before, *::after {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    body {
        font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
        font-size: 15px;
        line-height: 1.6;
        color: var(--text-primary);
        background: var(--bg);
        padding-top: var(--header-height);
        padding-bottom: calc(var(--bottom-nav-height) + 16px);
        -webkit-font-smoothing: antialiased;
    }

    a {
        color: var(--green);
        text-decoration: none;
        transition: color 0.2s;
    }
    a:hover {
        color: var(--dark-green);
    }

    img {
        max-width: 100%;
        height: auto;
    }

    /* ============================================
       頂部導航列
       ============================================ */
    .top-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--header-height);
        background: var(--white);
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        z-index: 1000;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    }

    .top-header .logo {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 20px;
        font-weight: 700;
        color: var(--green);
    }
    .top-header .logo .logo-img {
        height: 36px;
        width: auto;
        object-fit: contain;
        border-radius: 6px;
    }

    .top-header .header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .top-header .header-btn {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: none;
        background: var(--bg);
        color: var(--text-secondary);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s;
        font-size: 20px;
    }
    .top-header .header-btn:hover {
        background: var(--yellow);
        color: var(--dark-green);
    }

    /* 用戶頭像 */
    .header-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--yellow);
        color: var(--dark-green);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 700;
        overflow: hidden;
    }
    .header-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* ============================================
       ☰ 手機漢堡選單 + 側邊抽屜（電腦版於下方 media query 隱藏）
       ============================================ */
    .menu-toggle-btn {
        width: 38px; height: 38px; border-radius: 10px; border: none;
        background: var(--bg); color: var(--text-secondary);
        display: flex; align-items: center; justify-content: center;
        cursor: pointer; flex-shrink: 0;
    }
    .menu-toggle-btn:hover { background: var(--yellow); color: var(--dark-green); }
    /* 手機：Logo 置中（絕對定位於固定 header 內） */
    .top-header .logo {
        position: absolute; left: 50%; transform: translateX(-50%);
    }
    .nav-drawer-overlay {
        position: fixed; inset: 0; background: rgba(0,0,0,.4);
        opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; z-index: 1100;
    }
    .nav-drawer-overlay.show { opacity: 1; visibility: visible; }
    .nav-drawer {
        position: fixed; top: 0; left: 0; bottom: 0; width: 270px; max-width: 80vw;
        background: #fff; z-index: 1101; transform: translateX(-100%);
        transition: transform .25s ease; box-shadow: 2px 0 16px rgba(0,0,0,.12);
        display: flex; flex-direction: column;
    }
    .nav-drawer.show { transform: translateX(0); }
    .nav-drawer-head {
        display: flex; align-items: center; justify-content: space-between;
        padding: 14px 16px; border-bottom: 1px solid var(--border);
    }
    .nav-drawer-head img { height: 34px; width: auto; }
    .nav-drawer-head .x { background: none; border: none; cursor: pointer; color: #999; display: flex; }
    .nav-drawer .drawer-link {
        display: flex; align-items: center; gap: 12px; padding: 15px 18px;
        color: var(--text-primary); text-decoration: none; font-size: 15px; font-weight: 500;
        border-bottom: 1px solid #f3f3f3;
    }
    .nav-drawer .drawer-link:hover { background: var(--bg); color: var(--dark-green); }
    .nav-drawer .drawer-link .material-icons-round { color: var(--green); }

    /* ============================================
       主內容區
       ============================================ */
    .main-content {
        max-width: 768px;
        margin: 0 auto;
        padding: 16px;
        min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height) - 32px);
    }

    /* 電腦版：內容區擴展至全寬，由各 section 的 .container 控制寬度 */
    @media (min-width: 769px) {
        body {
            padding-top: var(--header-height-desktop);
            padding-bottom: 0;
            background: #f5f6f8;
        }
        .top-header {
            height: var(--header-height-desktop);
            padding: 0 24px;
        }
        .menu-toggle-btn { display: none; }
        .top-header .logo {
            gap: 10px;
            font-size: 24px;
            letter-spacing: 0.2px;
            position: static;
            transform: none;
        }
        .top-header .logo .logo-img {
            height: 48px;
            border-radius: 8px;
        }
        .top-header .header-actions .btn {
            padding: 10px 16px;
            font-size: 15px;
        }
        .header-avatar {
            width: 42px;
            height: 42px;
            font-size: 16px;
        }
        .main-content {
            max-width: min(1560px, calc(100vw - 48px));
            padding: 24px 24px 32px;
            min-height: calc(100vh - var(--header-height-desktop) - 24px);
        }
    }

    /* ============================================
       Alert 提示訊息
       ============================================ */
    .alert {
        padding: 12px 16px;
        border-radius: var(--radius-sm);
        margin-bottom: 16px;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        animation: alertIn 0.3s ease;
    }
    @keyframes alertIn {
        from { opacity: 0; transform: translateY(-8px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .alert-success {
        background: var(--yellow);
        color: var(--dark-green);
        border-left: 4px solid var(--green);
    }
    .alert-danger {
        background: #fef0ed;
        color: var(--red);
        border-left: 4px solid var(--red);
    }
    .alert-warning {
        background: #fff8ee;
        color: #b87a00;
        border-left: 4px solid var(--orange);
    }
    .alert-info {
        background: #eef6ff;
        color: #2a7de1;
        border-left: 4px solid #2a7de1;
    }
    .alert-close {
        background: none;
        border: none;
        font-size: 18px;
        cursor: pointer;
        color: inherit;
        opacity: 0.6;
        padding: 0 0 0 12px;
    }
    .alert-close:hover {
        opacity: 1;
    }

    /* ============================================
       按鈕
       ============================================ */
    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 10px 20px;
        border-radius: var(--radius-sm);
        border: none;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s;
        font-family: inherit;
        line-height: 1.4;
    }
    .btn-green {
        background: var(--green);
        color: var(--white);
    }
    .btn-green:hover {
        background: var(--dark-green);
        color: var(--white);
    }
    .btn-red {
        background: var(--red);
        color: var(--white);
    }
    .btn-red:hover {
        background: #d94f2d;
        color: var(--white);
    }
    .btn-orange {
        background: var(--orange);
        color: var(--white);
    }
    .btn-orange:hover {
        background: #e08a3a;
        color: var(--white);
    }
    .btn-outline {
        background: var(--white);
        color: var(--green);
        border: 1.5px solid var(--green);
    }
    .btn-outline:hover {
        background: var(--yellow);
    }
    .btn-white {
        background: var(--white);
        color: var(--text-primary);
        border: 1px solid var(--border);
    }
    .btn-white:hover {
        border-color: var(--green);
        color: var(--green);
    }
    .btn-sm {
        padding: 6px 14px;
        font-size: 13px;
    }
    .btn-lg {
        padding: 14px 28px;
        font-size: 16px;
        border-radius: var(--radius);
    }
    .btn-block {
        width: 100%;
    }
    .btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    /* ============================================
       卡片
       ============================================ */
    .card {
        background: var(--white);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        overflow: hidden;
        transition: box-shadow 0.2s;
    }
    .card:hover {
        box-shadow: var(--shadow-lg);
    }
    .card-body {
        padding: 16px;
    }
    .card-img {
        width: 100%;
        height: 180px;
        object-fit: cover;
    }

    /* 活動卡片 */
    .activity-card {
        display: block;
        color: var(--text-primary);
        margin-bottom: 16px;
    }
    .activity-card:hover {
        color: var(--text-primary);
    }
    .activity-card .card-title {
        font-size: 16px;
        font-weight: 700;
        margin-bottom: 8px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .activity-card .card-meta {
        font-size: 13px;
        color: var(--text-secondary);
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    .activity-card .card-meta .meta-item {
        display: flex;
        align-items: center;
        gap: 4px;
    }
    .activity-card .card-meta .material-icons-round {
        font-size: 16px;
        color: var(--green);
    }
    .activity-card .card-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-top: 10px;
        margin-top: 10px;
        border-top: 1px solid var(--border);
    }
    .activity-card .card-price {
        font-size: 16px;
        font-weight: 700;
        color: var(--red);
    }
    .activity-card .card-price.free {
        color: var(--green);
    }

    /* ============================================
       評分星星
       ============================================ */
    .rating-stars {
        display: inline-flex;
        align-items: center;
        gap: 1px;
    }
    .rating-stars .star {
        font-style: normal;
        font-size: 14px;
    }
    .star.full, .star.half { color: var(--orange); }
    .star.empty { color: var(--border); }

    /* ============================================
       標籤
       ============================================ */
    .tag {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 4px 10px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 500;
        background: var(--yellow);
        color: var(--dark-green);
    }
    .tag-red { background: #fef0ed; color: var(--red); }
    .tag-orange { background: #fff8ee; color: #b87a00; }

    /* ============================================
       底部導航列
       ============================================ */
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--bottom-nav-height);
        background: var(--white);
        border-top: 1px solid var(--border);
        display: flex;
        align-items: center;
        justify-content: space-around;
        z-index: 1000;
        box-shadow: 0 -1px 4px rgba(0,0,0,0.04);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        font-size: 11px;
        color: var(--text-light);
        transition: color 0.2s;
        position: relative;
        padding: 4px 12px;
    }
    .bottom-nav .nav-item:hover,
    .bottom-nav .nav-item.active {
        color: var(--green);
    }
    .bottom-nav .nav-item .material-icons-round {
        font-size: 24px;
    }
    .bottom-nav .nav-item .nav-badge {
        position: absolute;
        top: 0;
        right: 4px;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        background: var(--red);
        color: var(--white);
        font-size: 10px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
    }

    /* ============================================
       表單元素
       ============================================ */
    .form-group {
        margin-bottom: 16px;
    }
    .form-label {
        display: block;
        font-size: 14px;
        font-weight: 500;
        margin-bottom: 6px;
        color: var(--text-primary);
    }
    .form-input,
    .form-select,
    .form-textarea {
        width: 100%;
        padding: 10px 14px;
        border: 1.5px solid var(--border);
        border-radius: var(--radius-sm);
        font-size: 15px;
        font-family: inherit;
        color: var(--text-primary);
        background: var(--white);
        transition: border-color 0.2s;
        -webkit-appearance: none;
    }
    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        outline: none;
        border-color: var(--green);
        box-shadow: 0 0 0 3px rgba(99,185,73,0.1);
    }
    .form-textarea {
        resize: vertical;
        min-height: 100px;
    }
    .form-hint {
        font-size: 12px;
        color: var(--text-light);
        margin-top: 4px;
    }
    .form-error {
        font-size: 12px;
        color: var(--red);
        margin-top: 4px;
    }

    /* ============================================
       Utility
       ============================================ */
    .text-center { text-align: center; }
    .text-right { text-align: right; }
    .text-green { color: var(--green); }
    .text-red { color: var(--red); }
    .text-orange { color: var(--orange); }
    .text-muted { color: var(--text-secondary); }
    .text-light { color: var(--text-light); }
    .text-sm { font-size: 13px; }
    .text-xs { font-size: 12px; }
    .text-bold { font-weight: 700; }
    .mt-8 { margin-top: 8px; }
    .mt-16 { margin-top: 16px; }
    .mt-24 { margin-top: 24px; }
    .mb-8 { margin-bottom: 8px; }
    .mb-16 { margin-bottom: 16px; }
    .mb-24 { margin-bottom: 24px; }
    .p-16 { padding: 16px; }
    .gap-8 { gap: 8px; }
    .gap-16 { gap: 16px; }
    .flex { display: flex; }
    .flex-col { flex-direction: column; }
    .flex-wrap { flex-wrap: wrap; }
    .items-center { align-items: center; }
    .justify-between { justify-content: space-between; }
    .justify-center { justify-content: center; }
    .hidden { display: none !important; }

    /* ============================================
       Empty State
       ============================================ */
    .empty-state {
        text-align: center;
        padding: 48px 24px;
        color: var(--text-light);
    }
    .empty-state .material-icons-round {
        font-size: 64px;
        margin-bottom: 12px;
        opacity: 0.4;
    }
    .empty-state p {
        font-size: 15px;
        margin-bottom: 16px;
    }

    /* ============================================
       Loading
       ============================================ */
    .loading-spinner {
        display: inline-block;
        width: 24px;
        height: 24px;
        border: 3px solid var(--border);
        border-top-color: var(--green);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }
    @keyframes spin {
        to { transform: rotate(360deg); }
    }

    /* ============================================
       Responsive
       ============================================ */
    @media (min-width: 769px) {
        .main-content {
            padding: 24px;
        }
        .card-img {
            height: 220px;
        }
    }

/* 標題入面嘅圖示：用 data-icon + ::before（CSS 產生內容）畫出嚟，
   圖示名（例如 local_activity）唔會變成標題文字畀搜尋引擎 / AI 讀到。 */
.material-icons-round[data-icon]::before { content: attr(data-icon); }

/* 只畀螢幕閱讀器 / 搜尋引擎讀嘅文字（例如全螢幕地圖頁嘅 H1），唔影響版面 */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* 列表頁可見麵包屑（seo_breadcrumb_html()） */
.nd-crumb { font-size: 13px; color: #999; margin: 0 0 12px; line-height: 1.6; }
.nd-crumb a { color: #999; }
.nd-crumb a:hover { color: #63b949; }
.nd-crumb .sep { color: #ccc; margin: 0 6px; }
