/* ========================================
   憶家 (Family Story) 共用樣式系統
   暖色調設計 - 與 App Icon 配色協調
   ======================================== */

/* ===== 色彩系統 ===== */
:root {
    /* 主色調 - 從 Icon 提取的橘黃色系 */
    --primary-orange: #F5A862;
    --primary-coral: #E88B5D;
    --secondary-orange: #FF8563;
    --accent-yellow: #FFD166;

    /* 輔助色 */
    --neutral-light: #FFF8F0;
    --neutral-bg: #FFFBF5;
    --neutral-dark: #5D4E37;
    --card-bg: #FFFFFF;

    /* 互補色（用於平衡） */
    --complementary-blue: #6B9BAB;

    /* 文字顏色 */
    --text-primary: #4A4A4A;
    --text-secondary: #666666;
    --text-light: #999999;
}

/* ===== 基礎重置與全局樣式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--neutral-light);
}

/* ===== 語言切換器 ===== */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: white;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 8px 16px;
}

.language-switcher button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    font-size: 16px;
    color: #666;
    transition: all 0.3s ease;
    border-radius: 20px;
}

.language-switcher button.active {
    background: var(--primary-orange);
    color: white;
    font-weight: bold;
}

.language-switcher button:hover:not(.active) {
    color: var(--primary-orange);
    background: var(--neutral-bg);
}

/* ===== Hero Section ===== */
.hero {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-coral) 100%);
    color: white;
    text-align: center;
    padding: 100px 20px 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path fill="%23ffffff" fill-opacity="0.1" d="M0,50 Q300,100 600,50 T1200,50 L1200,120 L0,120 Z"></path></svg>') repeat-x bottom;
    background-size: 1200px 120px;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.app-icon {
    width: 120px;
    height: 120px;
    border-radius: 27px;
    margin: 0 auto 30px;
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    object-fit: cover;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero .tagline {
    font-size: 24px;
    margin-bottom: 30px;
    opacity: 0.95;
    font-weight: 300;
}

.hero .description {
    font-size: 18px;
    margin-bottom: 40px;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== 按鈕樣式 ===== */
.download-btn,
.primary-btn {
    display: inline-block;
    background: white;
    color: var(--primary-coral);
    padding: 16px 48px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 20px;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(245, 168, 98, 0.3);
    transition: all 0.3s ease;
    cursor: not-allowed;
    opacity: 0.7;
}

.download-btn:hover,
.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 168, 98, 0.4);
}

.download-btn.active,
.primary-btn.active {
    cursor: pointer;
    opacity: 1;
}

.coming-soon {
    display: inline-block;
    margin-top: 10px;
    font-size: 14px;
    opacity: 0.8;
}

/* ===== Section 標題樣式 ===== */
.section-title {
    text-align: center;
    font-size: 36px;
    margin-bottom: 20px;
    color: var(--neutral-dark);
    font-weight: 700;
}

.section-subtitle {
    text-align: center;
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 60px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Content Sections ===== */
.content-section {
    padding: 80px 20px;
    background: var(--card-bg);
    max-width: 1200px;
    margin: 0 auto;
}

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

/* Features Section */
.features {
    padding: 80px 20px;
    background: var(--card-bg);
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== Feature Cards ===== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.feature-card {
    text-align: center;
    padding: 30px;
    background: var(--neutral-bg);
    border-radius: 20px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(245, 168, 98, 0.15);
    border-color: var(--primary-orange);
}

.feature-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.feature-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--neutral-dark);
}

.feature-desc {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== Screenshots Section ===== */
.screenshots {
    padding: 80px 20px;
    background: var(--neutral-bg);
}

.screenshot-grid {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 20px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    max-width: 1400px;
    margin: 0 auto;
}

.screenshot-grid::-webkit-scrollbar {
    height: 8px;
}

.screenshot-grid::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 4px;
}

.screenshot-grid::-webkit-scrollbar-thumb {
    background: var(--primary-orange);
    border-radius: 4px;
}

.screenshot-item {
    flex: 0 0 280px;
    scroll-snap-align: center;
}

.screenshot-item img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.screenshot-caption {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===== How It Works Section ===== */
.how-it-works {
    padding: 80px 20px;
    background: var(--card-bg);
    max-width: 1200px;
    margin: 0 auto;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-top: 40px;
}

.step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-coral) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    margin: 0 auto 20px;
    box-shadow: 0 4px 15px rgba(245, 168, 98, 0.3);
}

.step-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--neutral-dark);
}

.step-desc {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== Why Choose Section ===== */
.why-choose {
    padding: 80px 20px;
    background: var(--neutral-bg);
    max-width: 1200px;
    margin: 0 auto;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.benefit-item {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    border-left: 4px solid var(--primary-orange);
    transition: all 0.3s ease;
}

.benefit-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(245, 168, 98, 0.15);
}

.benefit-icon {
    font-size: 36px;
    margin-bottom: 15px;
}

.benefit-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--neutral-dark);
}

.benefit-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== CTA Section ===== */
.cta {
    padding: 80px 20px;
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-coral) 100%);
    color: white;
    text-align: center;
}

.cta h2 {
    font-size: 36px;
    margin-bottom: 20px;
    font-weight: 700;
}

.cta p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* ===== Footer ===== */
footer {
    background: var(--neutral-dark);
    color: white;
    padding: 60px 20px 30px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* ===== 語言內容切換 ===== */
/* 當英文啟用時，隱藏中文 */
body.lang-en [lang="zh-TW"] {
    display: none !important;
}

/* 當中文啟用時（預設），隱藏英文 */
body.lang-zh-TW [lang="en"],
body:not(.lang-en) [lang="en"] {
    display: none !important;
}

/* ===== 內容頁面專用樣式 (用於 privacy, terms, support 等頁面) ===== */
.page-header {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--primary-coral) 100%);
    color: white;
    text-align: center;
    padding: 100px 20px 60px;
}

.page-header h1 {
    font-size: 42px;
    margin-bottom: 15px;
    font-weight: 700;
}

.page-header p {
    font-size: 18px;
    opacity: 0.95;
}

.page-content {
    max-width: 900px;
    margin: 60px auto;
    padding: 0 20px;
}

.content-block {
    background: var(--card-bg);
    padding: 40px;
    margin-bottom: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(245, 168, 98, 0.08);
    border: 1px solid var(--neutral-bg);
}

.content-block h2 {
    font-size: 28px;
    color: var(--neutral-dark);
    margin-bottom: 20px;
    font-weight: 600;
}

.content-block h3 {
    font-size: 22px;
    color: var(--primary-orange);
    margin-top: 25px;
    margin-bottom: 15px;
    font-weight: 600;
}

.content-block h4 {
    font-size: 18px;
    color: var(--neutral-dark);
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.content-block p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 15px;
}

.content-block ul,
.content-block ol {
    margin-left: 25px;
    margin-bottom: 15px;
}

.content-block li {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 8px;
}

.content-block a {
    color: var(--primary-orange);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
}

.content-block a:hover {
    color: var(--primary-coral);
    text-decoration: underline;
}

.content-block strong {
    color: var(--neutral-dark);
    font-weight: 600;
}

/* ===== 響應式設計 ===== */
@media (max-width: 768px) {
    /* Hero Section */
    .hero h1 {
        font-size: 36px;
    }

    .hero .tagline {
        font-size: 20px;
    }

    /* Section Titles */
    .section-title {
        font-size: 28px;
    }

    /* Feature Grid */
    .feature-grid {
        grid-template-columns: 1fr;
    }

    /* Screenshots */
    .screenshot-item {
        flex: 0 0 220px;
    }

    /* Steps */
    .steps {
        grid-template-columns: 1fr;
    }

    /* Language Switcher */
    .language-switcher {
        top: 10px;
        right: 10px;
    }

    /* Page Header */
    .page-header h1 {
        font-size: 32px;
    }

    /* Content Blocks */
    .content-block {
        padding: 25px;
    }

    .content-block h2 {
        font-size: 24px;
    }

    .content-block h3 {
        font-size: 20px;
    }
}
