/**
 * CFN-TW 奇楠沉香網站樣式
 * 設計理念：自然禪意 × 高端奢華
 */

/* =====================================================
   變數設定
   ===================================================== */
:root {
    /* 主色調 */
    --primary: #3D2B1F;
    --primary-light: #5D4B3F;
    --primary-dark: #2D1B0F;
    
    /* 次要色 */
    --secondary: #2D5016;
    --secondary-light: #4D7026;
    --secondary-dark: #1D3016;
    
    /* 強調色 */
    --accent: #C9A962;
    --accent-light: #D9C982;
    --accent-dark: #8B6914;
    
    /* 背景色 */
    --light: #F5F0E8;
    --light-gray: #E8E4DE;
    --white: #FFFFFF;
    
    /* 文字色 */
    --dark: #000000;
    --gray: #6C757D;
    --light-text: #999999;
    
    /* 功能色 */
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    
    /* 陰影 */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow: 0 4px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.15);
    
    /* 圓角 */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    
    /* 過渡 */
    --transition: all 0.3s ease;
}

/* =====================================================
   基礎設定
   ===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
}

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

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

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

/* =====================================================
   通用容器
   ===================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 800px;
}

.container-lg {
    max-width: 1400px;
}

/* =====================================================
   Header 導航列 - 與 Footer 統一配色
   ===================================================== */
.header {
    background: rgba(45, 27, 15, 0.9);
    box-shadow: 0 2px 20px rgba(0,0,0,0.15);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-img {
    height: 50px;
    width: auto;
    max-height: 50px;
}

.logo img {
    height: 50px;
    width: auto;
    max-height: 50px;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
}

.logo-text span {
    display: block;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    font-weight: 400;
}

.nav {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-link {
    font-weight: 500;
    color: rgba(255,255,255,0.9);
    padding: 8px 0;
    position: relative;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

/* Header 登入/註冊按鈕 */
.header .nav-buttons .btn-outline {
    border-color: rgba(255,255,255,0.5);
    color: rgba(255,255,255,0.9);
}

.header .nav-buttons .btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--white);
    color: var(--white);
}

.header .nav-buttons .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--primary-dark);
}

.header .nav-buttons .btn-primary:hover {
    background: #e6ad00;
    border-color: #e6ad00;
}

.mobile-menu-btn {
    display: none;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--white);
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* ===== Header 右側區塊（用戶名+登出+漢堡）===== */
.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.member-name {
    color: #ffffff;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.member-name:hover {
    color: rgb(201, 169, 98);
}

/* 桌面版：登出按鈕白色 */
.header-right .btn-outline {
    border-color: rgba(255, 255, 255, 0.7);
    color: #ffffff;
    background: transparent;
}

.header-right .btn-outline:hover {
    background: rgb(201, 169, 98);
    border-color: rgb(201, 169, 98);
    color: var(--primary-dark);
}

/* 漢堡按鈕 - 桌面版隱藏 */
.mobile-menu-btn {
    display: none;
}

/* ===== 平板/手機版：Nav 收納區 ===== */
@media (max-width: 992px) {
    /* 桌面 Nav 保持水平顯示 */
    .nav {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 25px;
    }
    
    /* 桌面 Nav 連結樣式 */
    .nav .nav-link {
        padding: 8px 0;
        border: none;
        color: rgba(255,255,255,0.9);
        font-size: 1rem;
        font-weight: 500;
        text-decoration: none;
        position: relative;
    }
    
    .nav .nav-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background: rgb(201, 169, 98);
        transition: width 0.3s ease;
    }
    
    .nav .nav-link:hover {
        color: rgb(201, 169, 98);
        background: transparent;
        text-decoration: none;
    }
    
    .nav .nav-link:hover::after,
    .nav .nav-link.active::after {
        width: 100%;
    }
    
    .nav .nav-link.active {
        color: rgb(201, 169, 98);
        background: transparent;
    }
    
    /* 平板/手機版隱藏桌面 Nav */
    @media (max-width: 991px) {
        .nav {
            display: none;
        }
    }
    
    /* 手機版 Nav 收納區 - 預設隱藏 */
    .nav-mobile {
        display: none;
        position: fixed;
        top: 74px;
        left: 0;
        right: 0;
        background: #3D2B1F;
        flex-direction: column;
        padding: 0;
        gap: 0;
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        z-index: 999;
    }
    
    .nav-mobile.active {
        display: flex;
    }
    
    /* 用戶資訊區塊（在手機選單頂部） */
    .nav-mobile-user {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 15px 20px;
        color: #ffffff;
        font-size: 1rem;
        font-weight: 500;
        border-bottom: 1px solid rgba(255,255,255,0.15);
    }
    
    .nav-mobile-user:hover {
        color: rgb(201, 169, 98);
    }
    
    /* 導航連結 */
    .nav-mobile .nav-link {
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        font-size: 1rem;
        font-weight: 500;
        color: #ffffff;
        text-align: left;
        text-decoration: none;
        background: #3D2B1F;
    }
    
    .nav-mobile .nav-link:hover {
        color: rgb(201, 169, 98);
        background: rgba(255,255,255,0.05);
        text-decoration: none;
    }
    
    .nav-mobile .nav-link.active {
        color: rgb(201, 169, 98);
        background: rgba(255,255,255,0.05);
    }
    
    /* 登出按鈕區塊（在選單底部） */
    .nav-mobile-logout {
        padding: 15px 20px;
        margin-top: auto;
        border-top: 1px solid rgba(255,255,255,0.15);
    }
    
    .nav-mobile-logout .btn-outline {
        width: 100%;
        justify-content: center;
        border-color: rgba(255, 255, 255, 0.7);
        color: #ffffff;
        background: transparent;
    }
    
    .nav-mobile-logout .btn-outline:hover {
        background: rgb(201, 169, 98);
        border-color: rgb(201, 169, 98);
        color: var(--primary-dark);
    }
    
    /* 漢堡按鈕 - 平板/手機版顯示 */
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: #ffffff;
        padding: 8px;
        cursor: pointer;
    }
    
    .mobile-menu-btn:hover {
        color: rgb(201, 169, 98);
    }
}

/* ===== 桌面版：992px 以上 ===== */
@media (min-width: 992px) {
    .nav-mobile {
        display: none !important;
    }
}

/* =====================================================
   會員導覽列
   ===================================================== */
.member-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #3D2B1F 0%, #2D1B0F 100%);
    box-shadow: 0 2px 20px rgba(0,0,0,0.2);
    z-index: 1000;
}

.member-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 20px;
}

/* Logo */
.member-logo {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #ffffff;
}

.member-logo-main {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.member-logo-sub {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
    font-weight: 400;
}

/* 桌面版 Nav */
.member-nav-desktop {
    display: flex;
    align-items: center;
    gap: 30px;
}

.member-nav-link {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s ease;
}

.member-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #C9A962;
    transition: width 0.3s ease;
}

.member-nav-link:hover,
.member-nav-link.active {
    color: #C9A962;
}

.member-nav-link:hover::after,
.member-nav-link.active::after {
    width: 100%;
}

/* 右側區塊 */
.member-header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.member-user {
    display: flex;
    align-items: center;
    color: #C9A962;
    font-size: 1.2rem;
}

.member-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.member-btn-logout {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    color: #ffffff;
}

.member-btn-logout:hover {
    background: #C9A962;
    border-color: #C9A962;
    color: #2D1B0F;
}

/* 漢堡按鈕 */
.member-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.member-hamburger-line {
    width: 24px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.member-hamburger.active .member-hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.member-hamburger.active .member-hamburger-line:nth-child(2) {
    opacity: 0;
}

.member-hamburger.active .member-hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* 手機版 Nav */
.member-nav-mobile {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #3D2B1F;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.member-nav-mobile.active {
    display: flex;
    max-height: 400px;
    opacity: 1;
}

.member-nav-mobile-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    color: #C9A962;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.member-nav-mobile-link {
    display: block;
    padding: 15px 20px;
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.member-nav-mobile-link:hover,
.member-nav-mobile-link.active {
    color: #C9A962;
    background: rgba(255,255,255,0.05);
    padding-left: 25px;
}

.member-nav-mobile-logout {
    background: rgba(201, 169, 98, 0.1);
    color: #C9A962;
    font-weight: 600;
    text-align: center;
    border: none;
    margin: 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.member-nav-mobile-logout:hover {
    background: #C9A962;
    color: #2D1B0F;
}

/* 響應式：平板/手機 */
@media (max-width: 991px) {
    .member-nav-desktop {
        display: none;
    }
    
    .member-hamburger {
        display: flex;
    }
    
    .member-user {
        display: none;
    }
}

@media (max-width: 576px) {
    .member-logo-main {
        font-size: 1rem;
    }
    
    .member-btn-logout {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* =====================================================
   Hero 區塊
   ===================================================== */
.hero {
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/assets/images/wood-texture.png') repeat;
    opacity: 0.1;
}

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

.hero h1 {
    font-size: 3.5rem;
    color: var(--white);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* =====================================================
   按鈕
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--primary-dark);
}

.btn-primary:hover {
    background: var(--accent-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background: var(--white);
    color: var(--primary);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
}

/* =====================================================
   卡片
   ===================================================== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-body .btn,
.card-body a.btn {
    margin-top: auto;
}

/* 熱門推薦佔位區塊 - 與熱門推薦標籤高度一致 */
.popular-placeholder {
    height: 32px;
    margin-bottom: 15px;
    display: block;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.card-text {
    color: var(--gray);
    margin-bottom: 15px;
}

/* =====================================================
   區塊標題
   ===================================================== */
.section {
    padding: 80px 0;
}

.section-dark {
    background: var(--primary);
    color: var(--white);
}

.section-dark h2,
.section-dark h3 {
    color: var(--white);
}

/* CTA 全螢幕樣式 */
.cta-fullscreen {
    min-height: 100vh;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cta-fullscreen .container {
    width: 100%;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    margin-bottom: 15px;
}

.section-header p {
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto;
}

.section-dark .section-header p {
    color: rgba(255,255,255,0.8);
}

/* =====================================================
   格狀佈局
   ===================================================== */
.grid {
    display: grid;
    gap: 30px;
}

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

/* =====================================================
   特色卡片
   ===================================================== */
.feature-card {
    text-align: center;
    padding: 40px 30px;
    background: var(--white);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

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

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.feature-card h3 {
    margin-bottom: 15px;
}

.feature-card p {
    color: var(--gray);
}

/* =====================================================
   樹木卡片
   ===================================================== */
.tree-card {
    position: relative;
    overflow: hidden;
}

.tree-card .card-img {
    height: 250px;
}

.tree-status {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tree-status.available {
    background: var(--success);
    color: var(--white);
}

.tree-status.adopted {
    background: var(--info);
    color: var(--white);
}

.tree-meta {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    font-size: 0.875rem;
    color: var(--gray);
}

.tree-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius);
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.2);
}

.form-control.error {
    border-color: var(--danger);
}

.form-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 5px;
}

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

/* =====================================================
   提示訊息
   ===================================================== */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* =====================================================
   管理員後台
   ===================================================== */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--light);
}

.admin-sidebar {
    width: 260px;
    background: var(--primary);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.admin-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar-header h3 {
    color: var(--white);
    font-size: 1.1rem;
}

.admin-nav {
    padding: 20px 0;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    transition: var(--transition);
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.admin-nav a i {
    width: 20px;
    text-align: center;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--light-gray);
}

.admin-header h1 {
    font-size: 1.75rem;
}

.admin-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.stat-card h4 {
    color: var(--gray);
    font-size: 0.875rem;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card.accent .value {
    color: var(--accent);
}

/* =====================================================
   會員專區
   ===================================================== */
.member-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    margin-bottom: 30px;
}

.member-header h2 {
    color: var(--white);
    margin-bottom: 10px;
}

.member-stats {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.member-stat {
    text-align: center;
}

.member-stat .number {
    font-size: 2rem;
    font-weight: 700;
}

.member-stat .label {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* =====================================================
   表格
   ===================================================== */
.table-wrapper {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

.table th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
}

.table tr:hover {
    background: rgba(0,0,0,0.02);
}

.table-actions {
    display: flex;
    gap: 5px;
}

/* =====================================================
   分頁
   ===================================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--dark);
    border: 1px solid var(--light-gray);
}

.pagination a:hover {
    background: var(--accent);
    color: var(--white);
    border-color: var(--accent);
}

.pagination .active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* =====================================================

/* =====================================================
   載入動畫
   ===================================================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s linear infinite;
}

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

/* =====================================================
   響應式設計
   ===================================================== */
@media (max-width: 1200px) {
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
}

@media (max-width: 992px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    /* Logo 平板尺寸 */
    .logo-img,
    .logo img {
        height: 40px;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .section {
        padding: 50px 0;
    }
}

@media (max-width: 576px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    
    .container {
        padding: 0 15px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .hero {
        min-height: 500px;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    /* Logo 手機尺寸 */
    .logo-img,
    .logo img {
        height: 35px;
    }
    
    .table-wrapper {
        overflow-x: auto;
    }
    
    .table {
        min-width: 600px;
    }
}

/* =====================================================
   工具類別
   ===================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--gray); }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }

.hidden { display: none; }
.visible { visibility: visible; }

/* 圖示字體 */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');


/* 數據統計區塊 */
.stats-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 50px 0;
    position: relative;
}

.stats-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.stats-card {
    text-align: center;
    padding: 25px 15px;
    position: relative;
}

.stats-card:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background: rgba(201, 169, 98, 0.3);
}

.stats-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
}

.stats-value {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 5px;
    font-family: 'Noto Serif TC', serif;
    letter-spacing: 2px;
}

.stats-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .stats-section {
        padding: 40px 20px;
    }
    
    .stats-value {
        font-size: 2.2rem;
    }
    
    .stats-card:not(:last-child)::after {
        display: none;
    }
    
    .stats-card {
        border-bottom: 1px solid rgba(201, 169, 98, 0.2);
        padding-bottom: 30px;
    }
    
    .stats-card:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
}

/* 產品圖片懸停效果 */
.product-img-hover {
    transition: transform 0.3s ease;
}
.product-img-hover:hover {
    transform: translateY(-10px);
}
