/* oinai-liff/css/liff.css */

/* --- Base & Variables --- */
:root {
    /* iOS风格色彩系统 */
    --primary-color: #007AFF;
    --primary-text: #FFFFFF;
    --background-color: linear-gradient(to bottom right, #f2f2f7 0%, #e5e5ea 100%);
    --surface-color: rgba(255, 255, 255, 0.95);
    --text-color: #1d1d1f;
    --text-light: #8e8e93;
    --border-color: rgba(174, 174, 178, 0.3);
    --premium-gold: #FF9500;
    --premium-text: #8B4513;
    --accent-purple: #5856d6;
    --accent-pink: #ff2d92;
    --accent-blue: #007AFF;
    --accent-green: #34c759;
    --accent-red: #ff3b30;
    
    /* iOS风格设计tokens */
    --font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --border-radius: 12px;
    --border-radius-large: 16px;
    --border-radius-small: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.15);
    --shadow-active: 0 1px 4px rgba(0, 0, 0, 0.2);
    
    /* iOS风格动画 */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.4s ease;
    --spring-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

body {
    margin: 0;
    font-family: var(--font-family);
    background: var(--background-color);
    color: var(--text-color);
    overscroll-behavior-y: contain;
    min-height: 100vh;
}

/* --- Layouts --- */
.loading-screen, .error-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}

.loading-screen p {
    margin: 0;
    color: var(--text-light);
    font-size: 16px;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-sizing: border-box;
}

.app-header {
    background-color: var(--surface-color);
    padding: 12px 20px;
    border-bottom: 1px solid #3a3a3c;
    margin-bottom: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-main {
    flex: 1;
    padding: 10px 10px 150px 10px; /* 增加底部 padding，避免被導航欄遮擋 */
    overflow-y: auto;
    background: var(--background-color); /* 使用全局背景變數 */
    /* 隱藏滾動條但保持滾動功能 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.app-main::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.view-container {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 10px;
}

/* --- Components --- */
.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 16px;
    text-align: center;
}

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

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 16px auto;
}

/* 新增：載入動畫效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Instagram風格純淨卡片 */
.gallery-card {
    animation: fadeInScale 0.6s var(--spring-bounce);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px;
    background: transparent;
    backdrop-filter: none;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative; /* 確保定位上下文正確 */
    aspect-ratio: 1;
    transform: scale(0.98); /* 稍微縮小以預留刪除模式空間 */
}

.gallery-card:hover {
    transform: scale(1.0); /* 從 0.98 縮放到 1.0 */
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.gallery-card:active {
    transform: translateY(-1px) scale(0.99); /* 與基準 0.98 保持一致的層次 */
    transition: transform 0.1s ease;
}

.gallery-card img {
    transition: opacity 0.5s ease, transform 0.3s ease;
}

.gallery-card img.loading {
    opacity: 0;
    transform: scale(0.95);
}

.gallery-card img.loaded {
    opacity: 1;
    transform: scale(1);
}

/* 删除模式样式 - 合併到上面的.gallery-card規則中，此處移除重複定義 */

/* 刪除模式下的卡片邊框高亮效果，無遮罩 */
.delete-mode .gallery-card {
    border: 2px solid #007aff;
    border-radius: var(--border-radius);
    transform: scale(0.96); /* 從基準 0.98 再縮小一點到 0.96 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
    position: relative; /* 確保定位上下文正確 */
    z-index: 1; /* 降低卡片層級，避免覆蓋刪除按鈕 */
    overflow: visible; /* 【關鍵修復】允許刪除按鈕溢出邊界顯示 */
}

/* 隱藏不再需要的 delete-overlay */
.gallery-card .delete-overlay {
    display: none;
}

/* 刪除按鈕樣式 - 右上角小圓點 */
.gallery-card .delete-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 26px;
    height: 26px;
    background: #ff3b30;
    color: white;
    border: 3px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999; /* 大幅提高 z-index 確保按鈕在最上層 */
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.6);
}

/* 刪除模式下顯示刪除按鈕 */
.delete-mode .gallery-card .delete-badge {
    opacity: 1;
    visibility: visible;
}

.delete-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.6);
}

.delete-badge:active {
    transform: scale(0.95);
}

.delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.delete-btn:hover {
    transform: scale(1.1);
    background: #dc2626;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.6);
}

.delete-btn:active {
    transform: scale(0.95);
}

/* 删除确认弹窗 */
.delete-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.delete-confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.delete-confirm-dialog {
    background: white;
    border-radius: 20px;
    padding: 24px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.delete-confirm-overlay.show .delete-confirm-dialog {
    transform: scale(1);
}

.delete-confirm-dialog h3 {
    margin: 0 0 12px 0;
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
}

.delete-confirm-dialog p {
    margin: 0 0 24px 0;
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.5;
}

.delete-confirm-actions {
    display: flex;
    gap: 12px;
}

.delete-confirm-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-confirm-btn.cancel {
    background: #f3f4f6;
    color: var(--text-color);
}

.delete-confirm-btn.cancel:hover {
    background: #e5e7eb;
}

.delete-confirm-btn.confirm {
    background: #ef4444;
    color: white;
}

.delete-confirm-btn.confirm:hover {
    background: #dc2626;
}

.delete-confirm-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.delete-confirm-btn.confirm:active {
    background: #b91c1c;
    transform: scale(0.95);
}

/* 載入更多動畫 - iOS風格 */
.loading-more {
    animation: fadeInUp 0.4s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    font-size: 15px;
    color: var(--text-light);
    font-weight: 500;
}

.loading-more::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 122, 255, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 卡片進入動畫 */
.gallery-card:nth-child(1) { animation-delay: 0.1s; }
.gallery-card:nth-child(2) { animation-delay: 0.15s; }
.gallery-card:nth-child(3) { animation-delay: 0.2s; }
.gallery-card:nth-child(4) { animation-delay: 0.25s; }
.gallery-card:nth-child(5) { animation-delay: 0.3s; }
.gallery-card:nth-child(6) { animation-delay: 0.35s; }

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-weight: 600;
}

.usage-info {
    background-color: #EAF2FC;
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.function-nav {
    display: flex;
    justify-content: space-around;
    background-color: var(--surface-color);
    padding: 10px 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: fixed;
    bottom: 15px;
    left: 15px;
    right: 15px;
    z-index: 10;
}

/* === iOS风格3D导航按钮 === */
.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 16px;
    transition: all var(--transition-fast);
    position: relative;
    min-height: 56px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-btn .nav-icon {
    font-size: 22px;
    transition: all var(--transition-fast);
}

.nav-btn .nav-text {
    font-family: var(--font-family);
    letter-spacing: -0.2px;
    transition: all var(--transition-fast);
}

/* iOS风格激活状态 */
.nav-btn.active {
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(0, 122, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 122, 255, 0.2);
    box-shadow: 
        0 4px 12px rgba(0, 122, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.nav-btn.active .nav-icon {
    transform: scale(1.1);
    text-shadow: 0 1px 2px rgba(0, 122, 255, 0.3);
}

.nav-btn.active .nav-text {
    text-shadow: 0 1px 2px rgba(0, 122, 255, 0.2);
}

/* 按压效果 */
.nav-btn:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

.nav-btn.active:active {
    transform: translateY(-0.5px);
    box-shadow: 
        0 2px 8px rgba(0, 122, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 悬停效果（桌面端） */
@media (hover: hover) {
    .nav-btn:hover {
        background: rgba(142, 142, 147, 0.1);
        transform: translateY(-0.5px);
    }
    
    .nav-btn.active:hover {
        background: rgba(0, 122, 255, 0.15);
        box-shadow: 
            0 6px 16px rgba(0, 122, 255, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.25);
        transform: translateY(-1.5px);
    }
}

.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.gallery-header h2 {
    margin: 0;
}
#gallery-count {
    color: var(--text-light);
}

/* Toolbar and Search Bar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px 8px; /* 減少底部padding：16px → 8px */
    gap: 12px;
}

/* 旧版搜索框样式保留 */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 现代化搜索框样式 - 对齐照片墙设计 */
.search-container {
    margin-bottom: 5px; /* 再縮短一半：10px → 5px */
    position: relative;
    z-index: 20; /* 確保搜索欄在圖片之上 */
}

.search-bar-modern {
    display: flex;
    gap: 6px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: 16px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 5px; /* 同步與search-container：10px → 5px */
    /* 固定寬度，不隨內容變化 */
    width: 100%;
    max-width: 400px;
}

.search-bar-modern:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.08);
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 0; /* 允許收縮 */
}

.search-input-modern {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 1px solid rgb(209, 213, 219);
    border-radius: 12px;
    font-size: 16px;
    background: #ffffff;
    color: #374151;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.search-input-modern:focus {
    background: #ffffff;
    color: #374151;
    border-color: transparent;
    box-shadow: 0 0 0 2px rgb(124, 58, 237);
}

.search-input-modern::placeholder {
    color: #9ca3af;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
    pointer-events: none;
}

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

.search-clear-btn, .delete-mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
    flex-shrink: 0; /* 防止按鈕被壓縮 */
}

.search-clear-btn {
    opacity: 0.3; /* 默認半透明 */
    pointer-events: none; /* 無文本時不可點擊 */
}

.search-clear-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.search-clear-btn:hover {
    background: rgba(255, 69, 58, 0.15);
    color: #ff453a;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 69, 58, 0.25);
    backdrop-filter: blur(10px);
}

.delete-mode-btn {
    position: relative;
}

.delete-mode-btn:hover {
    background: #f9fafb;
    color: #374151;
    border-color: #d1d5db;
}

.delete-mode-btn.active {
    background: #7c3aed;
    color: white;
    border-color: #7c3aed;
}

.delete-mode-btn.active::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background-color: #fff;
    color: #333;
}

.search-input:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.clear-search-btn {
    padding: 8px 12px;
    background-color: #f2f2f7;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background-color: #e5e5ea;
    color: #333;
}




/* Settings & Upgrade Page Styles */
.settings-container, .upgrade-container, .my-container {
    padding: 12px; /* 減小邊距讓卡片更寬：20px → 12px */
    color: var(--text-color);
    background: var(--background-color); /* 使用全局背景變數 */
}

/* 升級頁面樣式 */
.upgrade-container {
    padding: 0 12px 0 12px !important; /* 只保留左右padding，頂部和底部由#upgrade-page控制 */
}

/* 升級頁面專用佈局：覆蓋父容器的padding影響 */
#upgrade-page {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background-color);
    overflow-y: auto;
    padding: 20px 12px 250px 12px; /* 增加底部空間，避免被導航欄遮住 */
    box-sizing: border-box;
    /* 隱藏滾動條但保持滾動功能 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

#upgrade-page::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* 升級頁面隱藏底部導航 */
#upgrade-page ~ .app-footer {
    display: none;
}

/* 當升級頁面顯示時隱藏底部導航 */
body.upgrade-page-active .app-footer {
    display: none;
}

.upgrade-intro {
    position: relative;
    margin-bottom: 20px;
    padding-top: 20px;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 0;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--primary-color);
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upgrade-title-content {
    text-align: center;
    margin-top: 20px;
}

.upgrade-title-content h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.2;
}

.upgrade-title-content p {
    margin: 0;
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.4;
}

.back-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--primary-color);
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover {
    background-color: rgba(0, 122, 255, 0.1);
}

.upgrade-header h2 {
    flex: 1;
    text-align: center;
    margin: 0;
    margin-left: -36px; /* 補償返回按鈕的寬度，使標題居中 */
}

.plan-card {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(24px);
    border-radius: 24px;
    padding: 36px 32px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: slideInUp 0.8s ease-out forwards;
    overflow: hidden;
}

.plan-card:nth-child(1) {
    animation-delay: 0.1s;
}

.plan-card:nth-child(2) {
    animation-delay: 0.2s;
}

.plan-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

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

.premium-plan {
    border: 2px solid var(--primary-color);
    position: relative;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.08) 0%, rgba(88, 86, 214, 0.12) 50%, rgba(255, 107, 107, 0.06) 100%);
    backdrop-filter: blur(24px);
    box-shadow: 
        0 24px 48px rgba(0, 122, 255, 0.12),
        0 8px 20px rgba(0, 122, 255, 0.08),
        0 2px 4px rgba(0, 122, 255, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.premium-plan::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.02) 0%, rgba(88, 86, 214, 0.03) 50%, rgba(255, 107, 107, 0.02) 100%);
    border-radius: 24px;
    pointer-events: none;
}

.premium-plan::before {
    content: "推薦";
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 700;
    z-index: 30;
    box-shadow: 
        0 4px 12px rgba(255, 107, 107, 0.4),
        0 2px 4px rgba(255, 107, 107, 0.2);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.plan-header {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 122, 255, 0.1);
}

.plan-name {
    margin: 0 0 12px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.plan-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.price-toggle {
    display: flex;
    background: #f0f0f0;
    border-radius: 25px;
    padding: 4px;
    gap: 2px;
}

.toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.toggle-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.price-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.price-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.price-row .price,
.price-row .period {
    position: relative;
}

.discount-badge {
    position: absolute;
    right: -90px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
    white-space: nowrap;
}

.price {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -1px;
}

.period {
    font-size: 16px;
    color: var(--text-light);
    font-weight: 500;
}

.plan-features {
    margin-bottom: 32px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px 0;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding-left: 8px;
    padding-right: 8px;
    /* 直接應用懸停效果作為默認樣式 */
    background: rgba(0, 122, 255, 0.05);
    transform: translateX(4px);
}

.feature-item:hover {
    background: rgba(0, 122, 255, 0.05);
    transform: translateX(4px);
}

.feature-icon {
    color: #4CAF50;
    font-size: 16px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(76, 175, 80, 0.3) 100%);
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    transform: scale(1.1);
}

.feature-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(76, 175, 80, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.feature-item:hover .feature-icon::before {
    width: 100%;
    height: 100%;
}

.feature-item:hover .feature-icon {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(76, 175, 80, 0.3) 100%);
}

.plan-btn {
    width: 100%;
    padding: 22px 32px;
    border: none;
    border-radius: 20px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.8px;
    position: relative;
    overflow: hidden;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.plan-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.plan-btn:hover::before {
    left: 100%;
}

.plan-btn.current-plan {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    cursor: not-allowed;
    border: 2px solid #6c757d;
    box-shadow: 
        0 8px 24px rgba(108, 117, 125, 0.3),
        0 2px 8px rgba(108, 117, 125, 0.2);
    font-weight: 700;
}

.current-plan-card {
    border: 3px solid #28a745 !important;
    box-shadow: 
        0 20px 40px rgba(40, 167, 69, 0.15),
        0 8px 16px rgba(40, 167, 69, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    transform: scale(1.02);
}


.upgrade-to-premium {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 50%, #004085 100%);
    color: white;
    box-shadow: 
        0 12px 32px rgba(0, 122, 255, 0.5),
        0 4px 12px rgba(0, 122, 255, 0.3),
        0 2px 4px rgba(0, 122, 255, 0.1);
    position: relative;
    font-weight: 700;
    transform: translateY(0);
}

.upgrade-to-premium:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 16px 40px rgba(0, 122, 255, 0.6),
        0 6px 16px rgba(0, 122, 255, 0.4),
        0 2px 6px rgba(0, 122, 255, 0.2);
}

.upgrade-to-premium::after {
    content: '✨';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    animation: sparkle 2s infinite;
}

.upgrade-to-premium:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 122, 255, 0.4);
    background: linear-gradient(135deg, #0056b3 0%, var(--primary-color) 100%);
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.7; transform: translateY(-50%) scale(1.1); }
}

/* 響應式設計優化 */
@media (max-width: 480px) {
    .upgrade-intro {
        padding: 0 16px;
        margin-bottom: 24px;
    }
    
    .upgrade-intro h3 {
        font-size: 18px;
    }
    
    .upgrade-intro p {
        font-size: 13px;
    }
    
    .plan-card {
        padding: 24px 20px;
        margin-bottom: 20px;
    }
    
    .plan-name {
        font-size: 20px;
    }
    
    .price {
        font-size: 28px;
    }
    
    .plan-btn {
        padding: 16px 20px;
        font-size: 15px;
    }
    
    .feature-item {
        padding: 10px 6px;
    }
    
    .feature-icon {
        width: 20px;
        height: 20px;
        font-size: 14px;
    }
}

/* 觸控設備優化 */
@media (hover: none) and (pointer: coarse) {
    .plan-card:hover {
        transform: none;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }
    
    .feature-item:hover {
        background: none;
        transform: none;
    }
    
    .feature-item:hover .feature-icon {
        transform: none;
    }
    
    .upgrade-to-premium:hover {
        transform: none;
        box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3);
    }
}

.settings-container h2, .upgrade-container h2, .my-container h2 {
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-color); /* 使用全局文字顏色 */
    font-weight: 600;
}

.upgrade-intro {
    text-align: center;
    margin-bottom: 32px;
    padding: 0 20px;
}

.upgrade-intro h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 8px 0;
    letter-spacing: -0.3px;
}

.upgrade-intro p {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
    line-height: 1.5;
}

.upgrade-container .subtitle {
    text-align: center;
    color: #333;
    margin-top: 0;
    margin-bottom: 24px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #000;
    font-weight: 600;
}

.form-group select {
    width: 100%;
    padding: 12px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #000;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group select:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

/* Checkbox Styles */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    color: #000;
    font-weight: 600;
    margin-bottom: 8px;
    gap: 12px;
    flex-wrap: nowrap;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    flex-basis: 20px !important;
    margin-top: 2px;
    display: inline-block !important;
    box-sizing: border-box !important;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #007aff;
    border-color: #007aff;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}

.form-help {
    font-size: 14px;
    color: #333;
    margin-top: 4px;
    margin-bottom: 0;
}

#settings-form .btn {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    margin-top: 10px;
}

.feedback-message {
    text-align: center;
    margin-top: 16px;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
}

.feedback-message.success {
    background-color: rgba(48, 209, 88, 0.1);
    color: #30d158;
    border: 1px solid rgba(48, 209, 88, 0.3);
}

.feedback-message.error {
    background-color: rgba(255, 69, 58, 0.1);
    color: #ff453a;
    border: 1px solid rgba(255, 69, 58, 0.3);
}

/* Upgrade Plan Styles */
.plans-container {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.plan-card {
    background-color: #2c2c2e;
    border: 1px solid #444;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.plan-card.featured {
    border-color: #007aff;
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.5);
}

.plan-card h3 {
    text-align: center;
    margin-top: 0;
    font-size: 1.5rem;
}

.plan-card .price {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    margin: 8px 0 24px;
}

.plan-card .price span {
    font-size: 1rem;
    font-weight: normal;
    color: #8e8e93;
}

.plan-card ul {
    list-style: none;
    padding: 0;
    margin-bottom: 32px;
    flex-grow: 1;
}

.plan-card ul li {
    margin-bottom: 12px;
    color: #e5e5e7;
}

.plan-card .btn {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
}


/* Instagram風格緊密網格 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px; /* 減小間距：10px → 8px */
    padding: 0 4px; /* 左右添加小邊距，為刪除按鈕預留空間 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}







.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background-color: #f5f5f7;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}



/* 宽幅图片优化 */
.gallery-card.wide-ratio img {
    object-fit: contain;
    object-position: center;
}

/* 直幅图片优化 */
.gallery-card.tall-ratio img {
    object-fit: contain;
    object-position: center;
}

/* 正方形图片保持原有样式 */
.gallery-card.square-ratio img {
    object-fit: cover;
}

/* Delete Button Styles */
.delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background-color: rgba(255, 59, 48, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex !important;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    opacity: 1 !important;
    transition: all 0.2s ease;
    z-index: 5;
}

.delete-btn:hover {
    background-color: rgba(255, 59, 48, 1);
    transform: scale(1.1);
}

.prompt-overlay {
    position: absolute;
    bottom: 0;
    left: 10px;
    right: 10px;
    color: white;
    font-size: 14px;
    opacity: 1; /* 常態顯示 */
    line-height: 1.4;
    word-wrap: break-word;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8); /* 添加文字陰影提高可讀性 */
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
}

.hidden {
    display: none !important;
}

/* Custom Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 24px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.9);
        opacity: 0;
}

.modal-content h2 {
    margin: 0 0 12px 0;
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
}

.modal-content p {
    margin: 0 0 24px 0;
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

.modal-buttons .btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-buttons .btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.btn.btn-primary {
    background: #ef4444;
    color: white;
}

.btn.btn-primary:hover {
    background: #dc2626;
}

.btn.btn-secondary {
    background: #f3f4f6;
    color: var(--text-color);
}

.btn.btn-secondary:hover {
    background: #e5e7eb;
}

/* Version Info */
.version-info {
    text-align: center;
    margin-top: 32px;
    padding: 16px;
    border-top: 1px solid #ddd;
}

.version-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

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

/* Gallery Overlay - 提示词显示 */
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    font-size: 12px;
    padding: 12px 8px 8px 8px;
    line-height: 1.3;
    word-wrap: break-word;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    font-weight: 500;
    opacity: 1 !important;
    transition: opacity 0.2s ease;
    z-index: 3;
}

.gallery-card:hover .gallery-overlay {
    opacity: 1 !important;
}

.gallery-overlay p {
    margin: 0;
    font-size: 11px;
    line-height: 1.2;
    color: white !important;
}

/* --- 照片提示词样式 (统一化，参照照片墙) --- */
.gallery-caption, .photo-caption, .work-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 8px 12px;
    font-size: 12px;
        opacity: 1;
        transform: translateY(0);
    transition: all 0.3s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    z-index: 2;
}

/* --- 骨架屏樣式 --- */
.gallery-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f3f4f6;
    border-radius: 12px;
    overflow: hidden;
}

.skeleton-image {
    width: 100%;
    height: 70%;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-caption {
    width: 100%;
    height: 30%;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    margin-top: 8px;
}

@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* --- 邀請碼已使用狀態樣式 --- */
.invite-used-info {
    padding: 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 1px solid #bae6fd;
}

.invite-used-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.invite-used-title {
    font-weight: 600;
    color: #0369a1;
    font-size: 16px;
}

.invite-used-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.invite-code-display {
    margin: 0;
}

.invite-used-date {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
.invite-used-info {
        background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
        border-color: #3b82f6;
    }
    
    .invite-used-title {
        color: #93c5fd;
    }
    
    .invite-used-date {
        color: #94a3b8;
    }
}

/* --- 畫質說明按鈕樣式 --- */
.ios-label-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-btn {
    background: none;
    border: none;
    color: #007aff;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    position: relative;
}

.help-btn:hover {
    background-color: rgba(0, 122, 255, 0.1);
    transform: scale(1.1);
}

.help-btn:active {
    transform: scale(0.95);
}

.icon-options {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    min-width: 120px;
    margin-top: 4px;
}

.icon-options-inline {
    display: flex;
    gap: 4px;
    margin-left: 8px;
    align-items: center;
}

.icon-option {
    padding: 8px;
    text-align: center;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    font-size: 18px;
}

.icon-options-inline .icon-option {
    padding: 4px;
    font-size: 16px;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-option:hover {
    background-color: var(--hover-color);
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    .help-btn {
        color: #5ac8fa;
    }
    
    .help-btn:hover {
        background-color: rgba(90, 200, 250, 0.1);
    }
}

/* === iOS风格设置页面样式 === */

/* iOS Header */
.ios-header {
    text-align: center;
    margin-bottom: 24px;
    padding: 0 20px;
}

.ios-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.ios-subtitle {
    font-size: 16px;
    color: var(--text-light);
    margin: 0;
    font-weight: 400;
}

/* iOS Form */
.ios-form {
    padding: 0 8px 20px 8px; /* 減小左右邊距：16px → 8px，減少底部空白：100px → 20px */
}

.ios-section {
    margin-bottom: 32px;
}

.ios-section-header {
    margin-bottom: 12px;
    padding: 0 4px;
}

.ios-section-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    letter-spacing: -0.3px;
}

/* iOS Cards */
.ios-card {
    background: rgba(255, 255, 255, 1); /* 完全不透明的白色，增強與背景的對比 */
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.ios-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    min-height: 44px; /* iOS触摸目标最小尺寸 */
}

.ios-form-separator {
    border-top: 1px solid var(--border-color);
}

.ios-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

/* iOS Select */
.ios-select {
    font-size: 16px;
    color: var(--text-light);
    background: transparent;
    border: none;
    outline: none;
    text-align: right;
    min-width: 120px;
    font-family: var(--font-family);
    cursor: pointer;
}

.ios-select:focus {
    color: var(--primary-color);
}

/* iOS Toggle Row */
.ios-toggle-row {
    align-items: flex-start;
    padding: 16px 20px;
}

.ios-toggle-content {
    flex: 1;
    margin-right: 16px;
}

.ios-toggle-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    margin: 0 0 4px 0;
    display: block;
}

.ios-toggle-help {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
    line-height: 1.4;
}

/* iOS Toggle Switch */
.ios-toggle-wrapper {
    position: relative;
    flex-shrink: 0;
}

.ios-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ios-toggle {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
    background-color: #e5e5ea;
    border-radius: 31px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.ios-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    background-color: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ios-toggle-input:checked + .ios-toggle {
    background-color: var(--accent-green);
}

.ios-toggle-input:checked + .ios-toggle::before {
    transform: translateX(20px);
}

.ios-toggle-input:focus + .ios-toggle {
    box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.2);
}

/* iOS Form Footer */
.ios-form-footer {
    padding: 12px 0;
    text-align: center;
}

.ios-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    font-size: 17px;
    font-weight: 600;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
    min-height: 50px;
    position: relative;
    overflow: hidden;
}

.ios-btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #5856d6 100%);
    color: white;
    box-shadow: var(--shadow);
}

.ios-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.ios-btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-active);
}

.ios-feedback {
    margin-top: 12px;
    font-size: 14px;
    color: var(--accent-green);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.ios-feedback:not(.hidden) {
    opacity: 1;
}

/* === 圓角膠囊導航欄樣式 === */
/* TEST MARKER v20250829190000 - CSS已更新：刪除按鈕z-index:999, 導航欄padding:80px */

/* 底部導航區域 */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 0 8px 0; /* 進一步減少底部間距：20px → 8px */
    z-index: 1000;
    pointer-events: none;
}

/* 膠囊導航容器 */
.capsule-nav {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 8px;
    margin: 0 20px;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    pointer-events: auto; /* 讓膠囊導航可以點擊 */
}

/* 重新定義導航按鈕 */
.capsule-nav .nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 8px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 22px;
    transition: all var(--transition-fast);
    position: relative;
    min-height: 60px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.capsule-nav .nav-btn .nav-icon {
    font-size: 20px;
    transition: all var(--transition-fast);
}

.capsule-nav .nav-btn .nav-text {
    font-family: var(--font-family);
    letter-spacing: -0.2px;
    transition: all var(--transition-fast);
}

/* 膠囊內的立體選中效果 */
.capsule-nav .nav-btn.active {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: 
        0 4px 12px rgba(0, 122, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
    border: 1px solid rgba(0, 122, 255, 0.1);
}

.capsule-nav .nav-btn.active .nav-icon {
    transform: scale(1.1);
    text-shadow: 0 1px 2px rgba(0, 122, 255, 0.3);
}

.capsule-nav .nav-btn.active .nav-text {
    text-shadow: 0 1px 2px rgba(0, 122, 255, 0.2);
}

/* 按壓效果 */
.capsule-nav .nav-btn:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

.capsule-nav .nav-btn.active:active {
    transform: translateY(-1px);
    box-shadow: 
        0 2px 8px rgba(0, 122, 255, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

/* 懸停效果（桌面端） */
@media (hover: hover) {
    .capsule-nav .nav-btn:hover:not(.active) {
        background: rgba(0, 122, 255, 0.05);
    color: var(--primary-color);
        transform: translateY(-1px);
    }
    
    .capsule-nav .nav-btn.active:hover {
        transform: translateY(-3px);
        box-shadow: 
            0 6px 16px rgba(0, 122, 255, 0.25),
            inset 0 1px 0 rgba(255, 255, 255, 0.95),
            inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    }
}

/* === 我的頁面樣式 === */

.my-content {
    padding: 0 8px 100px 8px; /* 減小左右邊距：16px → 8px */
}

/* 訂閱方案樣式區分 */
.subscription-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.plan-text {
    font-weight: 600;
    font-size: 16px;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.plan-text.free {
    color: #8e8e93;
    background: rgba(142, 142, 147, 0.1);
    border: 1px solid rgba(142, 142, 147, 0.2);
}

.plan-text.premium {
    color: #ff9500;
    background: rgba(255, 149, 0, 0.1);
    border: 1px solid rgba(255, 149, 0, 0.3);
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.15);
}

.plan-text.pro {
    color: #5856d6;
    background: rgba(88, 86, 214, 0.1);
    border: 1px solid rgba(88, 86, 214, 0.3);
    box-shadow: 0 2px 8px rgba(88, 86, 214, 0.15);
}

.upgrade-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-purple) 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

.upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.upgrade-btn:active {
    transform: translateY(0);
}

/* 用戶資訊卡 */
.my-profile-card {
    padding: 20px !important;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #5856d6 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: none; /* 默認隱藏，頭像載入後顯示 */
}

.user-avatar-img.loaded {
    display: block;
}

.profile-avatar i {
    display: block; /* 默認顯示圖標 */
}

.profile-avatar.has-image i {
    display: none; /* 有頭像時隱藏圖標 */
}

.profile-info {
        flex: 1;
    }
    
.profile-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 4px 0;
}

.profile-subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin: 0 0 2px 0;
}

.user-id-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}

.copy-btn {
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: 8px;
    color: #007aff;
    padding: 6px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: rgba(0, 122, 255, 0.15);
    border-color: rgba(0, 122, 255, 0.3);
    transform: scale(1.05);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn.copied {
    background: rgba(52, 199, 89, 0.1);
    border-color: rgba(52, 199, 89, 0.2);
    color: #34c759;
}

.daily-usage-info {
    margin-top: 8px;
}

.usage-text {
    font-size: 13px;
    color: var(--primary-color);
    background: rgba(0, 122, 255, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.profile-date {
    font-size: 12px;
    color: var(--text-light);
    margin: 0;
}

/* 統計值樣式 */
.stat-value {
    font-size: 17px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, #5856d6 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--primary-color); /* fallback */
}

/* 儲存空間進度條 */
.storage-info {
        width: 100%;
    }

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

.storage-text {
        font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.storage-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
        flex: 1;
    height: 10px;
    background: rgba(229, 229, 234, 0.3);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #30d158 0%, #32d74b 100%);
    border-radius: 8px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 8px rgba(48, 209, 88, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.progress-fill.warning {
    background: linear-gradient(135deg, #ff3b30 0%, #ff453a 100%);
    box-shadow: 
        0 2px 8px rgba(255, 69, 58, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.progress-percent {
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

/* 訂閱資訊 */
.subscription-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.plan-text {
    font-size: 14px;
    color: var(--text-light);
}

.upgrade-btn {
    padding: 6px 12px;
    background: var(--premium-gold);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upgrade-btn:hover {
    background: #e5890a;
    transform: translateY(-1px);
}

/* 邀請碼資訊 */
.invite-code-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.invite-code {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(0, 122, 255, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 1px;
}

.copy-btn {
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

/* 邀請碼輸入 */
.invite-input-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px 20px;
}

.invite-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    font-family: 'SF Mono', Consolas, monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
    background: white;
    color: var(--text-color);
    outline: none;
    transition: all var(--transition-fast);
}

.invite-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* 兌換碼結果 */
.redemption-result {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    transition: all var(--transition-fast);
}

.redemption-result.success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.redemption-result.error {
    background: rgba(255, 59, 48, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.redemption-result.hidden {
    display: none;
}

/* 其他元素 */
.version-text {
    font-size: 14px;
    color: var(--text-light);
    font-family: 'SF Mono', Consolas, monospace;
}

.chevron-icon {
    color: var(--text-light);
    font-size: 14px;
}
