﻿/* ============================================
   近D玩 - 前台主樣式表
   PHP 8.2 / 白色為主 / 綠色系強調
   ============================================ */

/* ============================================
   CSS 變數
   ============================================ */
:root {
    /* 主色 */
    --white: #ffffff;
    --bg: #f5f6f8;
    --bg-warm: #fafafa;

    /* 品牌色 */
    --green: #63b949;
    --green-hover: #55a83d;
    --green-light: rgba(99, 185, 73, 0.1);
    --red: #f2643e;
    --red-light: #fef0ed;
    --orange: #f29f50;
    --orange-light: #fff8ee;

    /* 副色 / 裝飾色 */
    --yellow: #e8f4c3;
    --dark-green: #12a64e;

    /* 文字 */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-light: #bbbbbb;

    /* 邊框 / 陰影 */
    --border: #e8e8e8;
    --border-light: #f0f0f0;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.04);
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);

    /* 圓角 */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* 尺寸 */
    --header-height: 64px;
    --container-width: 1200px;
    --container-narrow: 800px;

    /* 過渡 */
    --transition: 0.2s ease;
    --transition-slow: 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--green);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--dark-green);
}

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

ul, ol {
    list-style: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

/* ============================================
   容器
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   頂部導航
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.site-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--green);
    color: var(--white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.site-logo .logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

/* 導航選單 */
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.main-nav .nav-link:hover {
    background: var(--bg);
    color: var(--text-primary);
}

.main-nav .nav-link.active {
    color: var(--green);
    background: var(--green-light);
}

.main-nav .nav-link .material-icons-round {
    font-size: 18px;
}

/* 右側操作區 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-search-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition);
}

.header-search-btn:hover {
    background: var(--bg);
    color: var(--green);
}

/* 用戶資訊 */
.header-user {
    position: relative;
}

.header-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border: 1.5px solid var(--border);
    background: var(--white);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
}

.header-user-btn:hover {
    border-color: var(--green);
}

.header-user-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: 13px;
    font-weight: 700;
}

.header-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 用戶下拉選單 */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: none;
    z-index: 1001;
    overflow: hidden;
}

.user-dropdown.show {
    display: block;
    animation: dropdownIn 0.15s ease;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all var(--transition);
}

.user-dropdown a:hover {
    background: var(--bg);
    color: var(--text-primary);
}

.user-dropdown a .material-icons-round {
    font-size: 18px;
}

.user-dropdown .dropdown-divider {
    height: 1px;
    background: var(--border-light);
}

.user-dropdown .dropdown-logout {
    color: var(--red);
}

.user-dropdown .dropdown-logout:hover {
    background: var(--red-light);
}

/* 手機版漢堡選單 */
.menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border-radius: var(--radius-sm);
}

.menu-toggle:hover {
    background: var(--bg);
}

/* 手機版導航 */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1100;
    display: none;
}

.mobile-nav-overlay.show {
    display: block;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background: var(--white);
    z-index: 1101;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
    overflow-y: auto;
}

.mobile-nav.show {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.mobile-nav-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 24px;
}

.mobile-nav-body {
    padding: 12px;
}

.mobile-nav-body .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 15px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.mobile-nav-body .nav-link:hover,
.mobile-nav-body .nav-link.active {
    background: var(--green-light);
    color: var(--green);
}

.mobile-nav-body .nav-link .material-icons-round {
    font-size: 20px;
}

.mobile-nav-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* ============================================
   Hero 橫幅
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--green) 0%, var(--dark-green) 100%);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.hero p {
    font-size: 17px;
    opacity: 0.9;
    margin-bottom: 28px;
}

/* Hero 搜尋列 */
.hero-search {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 0;
    background: var(--white);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.hero-search input {
    flex: 1;
    padding: 14px 24px;
    border: none;
    font-size: 15px;
    color: var(--text-primary);
    background: transparent;
}

.hero-search input::placeholder {
    color: var(--text-light);
}

.hero-search button {
    padding: 14px 28px;
    background: var(--green);
    color: var(--white);
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background var(--transition);
}

.hero-search button:hover {
    background: var(--dark-green);
}

/* ============================================
   Section 通用
   ============================================ */
.section {
    padding: 48px 0;
}

.section-bg {
    background: var(--bg);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-more {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--green);
    font-weight: 500;
}

.section-more:hover {
    color: var(--dark-green);
}

.section-more .material-icons-round {
    font-size: 18px;
}

/* ============================================
   活動種類區
   ============================================ */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    background: var(--white);
    border-radius: var(--radius);
    border: 1.5px solid var(--border-light);
    text-decoration: none;
    color: var(--text-secondary);
    transition: all var(--transition);
    text-align: center;
}

.category-card:hover {
    border-color: var(--green);
    color: var(--dark-green);
    background: var(--yellow);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.category-card .cat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--green);
    transition: all var(--transition);
}

.category-card:hover .cat-icon {
    background: var(--green);
    color: var(--white);
}

.category-card .cat-name {
    font-size: 13px;
    font-weight: 500;
}

.category-card .cat-count {
    font-size: 11px;
    color: var(--text-light);
}

/* ============================================
   活動卡片
   ============================================ */
.activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.activity-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

.activity-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
    border-color: var(--border);
}

.activity-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* 圖片 */
.activity-card-img {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: var(--bg);
    overflow: hidden;
}

.activity-card-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.activity-card-img .card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    color: var(--white);
    z-index: 1;
}

.card-badge.badge-free {
    background: var(--green);
}

.card-badge.badge-hot {
    background: var(--red);
}

.card-badge.badge-new {
    background: var(--orange);
}

.card-badge.badge-full {
    background: var(--text-muted);
}

.activity-card-img .no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 40px;
}

/* 卡片內容 */
.activity-card-body {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.activity-card-cat {
    font-size: 12px;
    color: var(--green);
    font-weight: 500;
    margin-bottom: 4px;
}

.activity-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.activity-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
    flex: 1;
}

.activity-card-info .info-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.activity-card-info .info-row .material-icons-round {
    font-size: 16px;
    color: var(--text-light);
    flex-shrink: 0;
}

/* 卡片底部 */
.activity-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid var(--border-light);
}

.activity-card-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--red);
}

.activity-card-price .price-free {
    color: var(--green);
}

.activity-card-price .price-unit {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.activity-card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
}

.activity-card-rating .star {
    color: var(--orange);
}

/* ============================================
   活動列表頁
   ============================================ */
.page-banner {
    background: var(--bg);
    padding: 28px 0;
    border-bottom: 1px solid var(--border);
}

.page-banner h1 {
    font-size: 26px;
    font-weight: 700;
}

.page-banner .breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

.page-banner .breadcrumb a {
    color: var(--text-muted);
}

.page-banner .breadcrumb a:hover {
    color: var(--green);
}

/* 篩選列 */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 24px;
}

.filter-bar .filter-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 5px 14px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border);
    background: var(--white);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}

.filter-chip:hover {
    border-color: var(--green);
    color: var(--green);
}

.filter-chip.active {
    background: var(--green);
    border-color: var(--green);
    color: var(--white);
}

/* 排序 */
.sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.sort-bar .result-count {
    font-size: 14px;
    color: var(--text-muted);
}

.sort-options {
    display: flex;
    gap: 4px;
}

.sort-option {
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.sort-option:hover {
    background: var(--bg);
    color: var(--text-primary);
}

.sort-option.active {
    background: var(--green-light);
    color: var(--green);
    font-weight: 500;
}

/* ============================================
   活動詳情頁
   ============================================ */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    padding: 24px 0;
}

.detail-main {
    min-width: 0;
}

.detail-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    align-self: start;
}

/* 詳情圖片 */
.detail-image {
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    background: var(--bg);
}

.detail-image img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
}

/* 詳情標題 */
.detail-header {
    margin-bottom: 20px;
}

.detail-header .detail-cat {
    display: inline-block;
    padding: 3px 12px;
    background: var(--green-light);
    color: var(--green);
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-full);
    margin-bottom: 10px;
}

.detail-header h1 {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

.detail-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-meta .meta-item .material-icons-round {
    font-size: 18px;
}

/* 詳情資訊列 */
.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.detail-info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.detail-info-item .info-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-info-item .info-icon .material-icons-round {
    font-size: 20px;
    color: var(--green);
}

.detail-info-item .info-label {
    font-size: 12px;
    color: var(--text-muted);
}

.detail-info-item .info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 2px;
}

/* 詳情描述 */
.detail-description {
    margin-bottom: 32px;
    line-height: 1.8;
    font-size: 15px;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.detail-description h2,
.detail-description h3 {
    color: var(--text-primary);
    margin: 20px 0 10px;
}

/* 側邊欄卡片 */
.sidebar-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 16px;
}

.sidebar-card-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-card-body {
    padding: 16px;
}

/* 價格顯示 */
.price-display {
    text-align: center;
    padding: 8px 0 16px;
}

.price-display .price-amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--red);
}

.price-display .price-free {
    font-size: 32px;
    font-weight: 700;
    color: var(--green);
}

.price-display .price-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* 報名人數 */
.participants-bar {
    margin-bottom: 16px;
}

.participants-track {
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0 6px;
}

.participants-fill {
    height: 100%;
    background: var(--green);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.participants-fill.almost-full {
    background: var(--orange);
}

.participants-fill.full {
    background: var(--red);
}

.participants-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

/* 商戶資訊 */
.merchant-info-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.merchant-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--yellow);
    color: var(--dark-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.merchant-info-card .merchant-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.merchant-info-card .merchant-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   評分區
   ============================================ */
.rating-section {
    margin-top: 32px;
}

.rating-overview-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.rating-big-num {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.rating-stars-display {
    color: var(--orange);
    font-size: 18px;
    letter-spacing: 2px;
    margin: 6px 0 4px;
}

.rating-total-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* 星星選擇器 */
.star-selector {
    display: flex;
    gap: 4px;
    direction: rtl;
}

.star-selector input {
    display: none;
}

.star-selector label {
    font-size: 28px;
    color: var(--border);
    cursor: pointer;
    transition: color var(--transition);
}

.star-selector input:checked ~ label,
.star-selector label:hover,
.star-selector label:hover ~ label {
    color: var(--orange);
}

/* 評分列表 */
.rating-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

.rating-item:last-child {
    border-bottom: none;
}

.rating-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.rating-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.rating-item-name {
    font-size: 14px;
    font-weight: 500;
}

.rating-item-stars {
    color: var(--orange);
    font-size: 13px;
    letter-spacing: 1px;
}

.rating-item-time {
    font-size: 12px;
    color: var(--text-light);
    margin-left: auto;
}

.rating-item-comment {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   按鈕
   ============================================ */
.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 var(--transition);
    font-family: inherit;
    line-height: 1.4;
    text-decoration: none;
}

.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(--green-light);
}

.btn-white {
    background: var(--white);
    color: var(--text-primary);
    border: 1.5px solid var(--border);
}

.btn-white:hover {
    border-color: var(--green);
    color: var(--green);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn .material-icons-round {
    font-size: 18px;
}

/* ============================================
   表單
   ============================================ */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.form-label .required {
    color: var(--red);
    margin-left: 2px;
}

.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 var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(99, 185, 73, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-input::placeholder {
    color: var(--text-light);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 12px;
    color: var(--red);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* ============================================
   Alert / Toast
   ============================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: var(--yellow);
    color: var(--dark-green);
    border-left: 4px solid var(--green);
}

.alert-error {
    background: var(--red-light);
    color: var(--red);
    border-left: 4px solid var(--red);
}

.alert-warning {
    background: var(--orange-light);
    color: #b87a00;
    border-left: 4px solid var(--orange);
}

.alert .material-icons-round {
    font-size: 20px;
    flex-shrink: 0;
}

/* Toast */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toastIn 0.3s ease;
    max-width: 360px;
}

.toast-success {
    border-left: 4px solid var(--green);
}

.toast-error {
    border-left: 4px solid var(--red);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ============================================
   Badge / Tag
   ============================================ */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: var(--yellow);
    color: var(--dark-green);
}

.badge-warning {
    background: var(--orange-light);
    color: #e68900;
}

.badge-danger {
    background: var(--red-light);
    color: var(--red);
}

.tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--bg);
    color: var(--text-secondary);
    border-radius: var(--radius-xs);
    font-size: 12px;
}

/* ============================================
   分頁
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 32px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--white);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all var(--transition);
}

a.page-link:hover {
    border-color: var(--green);
    color: var(--green);
}

.page-link.active {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
    font-weight: 700;
}

/* ============================================
   登入 / 註冊頁面
   ============================================ */
.auth-page {
    min-height: calc(100vh - var(--header-height) - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 40px;
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
}

.auth-card .auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    font-size: 13px;
    color: var(--text-light);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

/* 角色切換 */
.role-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.role-switch label {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.role-switch input {
    display: none;
}

.role-switch input:checked + label {
    background: var(--white);
    color: var(--green);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--text-primary);
    color: rgba(255,255,255,0.7);
    padding: 48px 0 0;
    margin-top: 48px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 32px;
}

.footer-brand .footer-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 10px;
}

.footer-brand p {
    font-size: 14px;
    line-height: 1.6;
}

.footer-col h4 {
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
}

.footer-col a {
    display: block;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    padding: 4px 0;
    transition: color var(--transition);
}

.footer-col a:hover {
    color: var(--green);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 16px 0;
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

/* ============================================
   空狀態
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .material-icons-round {
    font-size: 56px;
    color: var(--border);
    margin-bottom: 12px;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

/* ============================================
   Loading
   ============================================ */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg) 25%, #e8e8e8 50%, var(--bg) 75%);
    background-size: 400% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0%   { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ============================================
   Utilities
   ============================================ */
.text-green   { color: var(--green) !important; }
.text-red     { color: var(--red) !important; }
.text-orange  { color: var(--orange) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.fw-bold      { font-weight: 700; }
.fw-medium    { font-weight: 500; }
.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; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {

    /* Header */
    .main-nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .header-user-name {
        display: none;
    }

    /* Hero */
    .hero {
        padding: 40px 0;
    }

    .hero h1 {
        font-size: 26px;
    }

    .hero p {
        font-size: 15px;
    }

    .hero-search {
        flex-direction: column;
        border-radius: var(--radius);
    }

    .hero-search input {
        border-bottom: 1px solid var(--border-light);
    }

    .hero-search button {
        justify-content: center;
        border-radius: 0 0 var(--radius) var(--radius);
    }

    /* Section */
    .section {
        padding: 32px 0;
    }

    .section-title {
        font-size: 20px;
    }

    /* Category */
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Activity Grid */
    .activity-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Detail */
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-sidebar {
        position: static;
    }

    .detail-header h1 {
        font-size: 22px;
    }

    .detail-info-grid {
        grid-template-columns: 1fr;
    }

    /* Auth */
    .auth-card {
        padding: 28px 20px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    /* Filter */
    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .sort-bar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .rating-overview-bar {
        flex-direction: column;
        text-align: center;
    }
}
