/* Font definitions */
@font-face {
    font-family: 'Horizon';
    src: url('/assets/fonts/Horizon.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Inter', 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    position: relative;
    display: flex;
    flex-direction: column;
    /* Safe area insets for top notch */
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top);
}

/* Fix for mobile Safari viewport height */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
}

/* Loading styles removed - no longer needed */

/* Main content container */

.page-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 50px;
    flex: 1;
}

/* Floating download button */
.floating-download-btn {
    position: fixed;
    bottom: 84px; /* 上移以避开底部导航与系统手势区域 */
    right: 20px;
    width: 60px; /* 稍大可点区域 */
    height: 60px;
    background-color: #fff;
    color: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 1000;
    will-change: transform;
    /* Avoid home indicator overlap */
    bottom: calc(84px + constant(safe-area-inset-bottom));
    bottom: calc(84px + env(safe-area-inset-bottom));
}

.floating-download-btn:hover {
    transform: translateY(-2px) scale3d(1.04, 1.04, 1);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
}

.floating-download-btn svg {
    display: block;
    margin: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Brand styles */
.brand-title {
    font-family: 'Horizon', 'Inter', sans-serif;
    font-size: 72px;
    font-weight: 800;
    text-align: center;
    margin: 0 0 10px 0;
    color: #1a1a1a; /* Soft off-black */
    letter-spacing: 2px;
    line-height: 1.2;
}

/* Tips section */
.tips-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0 30px 0;
    min-height: 40px;
}

.tips-prefix {
    color: #555; /* Softer grey */
    font-size: 24px;
    margin-right: 12px;
    font-weight: 400;
}

.tips-rotating {
    color: #222; /* Soft black */
    font-size: 24px;
    font-weight: 600;
    min-width: 120px;
    text-align: left;
    opacity: 0;
}

/* Welcome text */
.welcome-text {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    line-height: 1.8;
    text-align: center;
    margin: 20px auto;
    max-width: 700px;
    color: #555;
    font-weight: 300;
}

/* Bonus page styles */
.bonus-page {
    background-color: #fdf5ec;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: var(--app-height, 100vh);
}

.bonus-slogan {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 2px;
    text-align: center;
    padding: 20px 30px;
    margin: 30px 0;
    text-transform: uppercase;
    position: relative;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.bonus-slogan::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    margin-top: -10px;
}

.bonus-slogan::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    margin-bottom: -10px;
}

@media (max-width: 768px) {
    .bonus-slogan {
        font-size: 22px;
        letter-spacing: 1.5px;
        padding: 15px 20px;
    }
}

.bonus-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.bonus-tips {
    color: #666;
    font-size: 14px;
    font-weight: 200;
    letter-spacing: 1px;
    text-align: center;
    padding: 0 50px;
    margin: 50px 0;
}

.bonus-tip {
    margin: 10px 0;
}

.download-button {
    width: 230px;
    height: 70px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: background-color 0.3s ease, transform 0.3s ease;
    will-change: transform;
}

.download-button:hover {
    background-color: #45a049;
    transform: scale3d(1.05, 1.05, 1);
}

/* New Home Page Styles */

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #f5f5f5 0%, #ffffff 70%);
    animation: float 20s infinite alternate;
    opacity: 0.6;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, #eaeaea 0%, #ffffff 70%);
    animation: float 25s infinite alternate-reverse;
    opacity: 0.6;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(50px, 50px) rotate(10deg); }
}

/* Hero Section */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    min-height: 60vh;
    animation: fadeIn 1s ease-out;
}

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

/* Main CTA Button */
.main-cta-btn {
    margin-top: 40px;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    background-color: #222; /* Soft black */
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.main-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    background-color: #333;
}

.main-cta-btn svg {
    width: 20px;
    height: 20px;
}

/* Responsive design */
@media (max-width: 768px) {
    .page-container {
        padding: 20px;
    }
    
    .hero-section {
        min-height: 50vh;
        padding-top: 40px;
    }

    .brand-title {
        font-size: 42px; /* Smaller for mobile */
        margin-bottom: 5px;
    }
    
    .tips-container {
        margin: 5px 0 20px 0;
        flex-direction: column; /* Stack on mobile */
        min-height: auto;
    }

    .tips-prefix {
        font-size: 16px;
        margin-right: 0;
        margin-bottom: 5px;
    }

    .tips-rotating {
        font-size: 20px;
        text-align: center;
        min-width: auto;
    }

    .welcome-text {
        font-size: 16px;
        padding: 0 10px;
        margin: 15px auto 30px;
    }

    .main-cta-btn {
        margin-top: 20px;
        padding: 14px 32px;
        font-size: 16px;
        width: 80%; /* Wider button on mobile */
        justify-content: center;
    }
    
    .blob {
        filter: blur(60px); /* Reduce blur radius for performance */
        opacity: 0.5; /* Slightly more visible on small screens */
    }

    .blob-1 {
        width: 80vw;
        height: 80vw;
        top: -20%;
        left: -20%;
    }

    .blob-2 {
        width: 90vw;
        height: 90vw;
        bottom: -20%;
        right: -20%;
    }
    
    .bonus-slogan {
        font-size: 20px;
        letter-spacing: 1.5px;
        padding: 15px 20px;
    }
    
    .bonus-tips {
        padding: 0 20px;
    }
    
    .download-button {
        width: 200px;
        height: 60px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .brand-title {
        font-size: 36px;
    }
    
    .welcome-text {
        font-size: 15px;
        line-height: 1.6;
    }
}

/* Home page layout for sticky footer */
.home-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: var(--app-height, 100vh);
}

.home-page .page-container {
    flex: 1;
    padding-bottom: 20px;
}

/* Fix for mobile Safari viewport height */
@supports (-webkit-touch-callout: none) {
    .home-page {
        min-height: -webkit-fill-available;
    }
}

/* Home page footer styles */
.home-footer {
    position: relative;
    margin-top: auto;
    padding: 20px 0;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    color: #6c757d;
    /* Ensure footer is at bottom */
    flex-shrink: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-language {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

/* Dropdown Language Switcher Styles */
.language-dropdown {
    position: relative;
    display: inline-block;
}

.language-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    background-color: transparent;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-dropdown-toggle:hover,
.language-dropdown.is-open .language-dropdown-toggle {
    background-color: #f1f3f5;
    color: #495057;
}

.language-dropdown-toggle .globe-icon {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

.language-dropdown-toggle .chevron-icon {
    width: 14px;
    height: 14px;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.language-dropdown.is-open .language-dropdown-toggle .chevron-icon {
    transform: rotate(180deg);
}

.language-dropdown-menu {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    margin-bottom: 8px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 6px;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    border: 1px solid rgba(0,0,0,0.05);
}

.language-dropdown.is-open .language-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #495057;
    font-size: 14px;
    text-align: left;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.language-option:hover {
    background-color: #f8f9fa;
    color: #212529;
}

.language-option.is-active {
    background-color: #f1f3f5;
    color: #212529;
    font-weight: 600;
}

/* Mobile adjustments for dropdown */
@media (max-width: 768px) {
    .language-dropdown-menu {
        min-width: 160px;
        padding: 8px;
    }
    
    .language-option {
        padding: 10px 16px;
        font-size: 15px;
    }
}

/* Dark mode support for dropdown */
@media (prefers-color-scheme: dark) {
    .language-dropdown-toggle {
        color: #adb5bd;
    }
    
    .language-dropdown-toggle:hover,
    .language-dropdown.is-open .language-dropdown-toggle {
        background-color: #2c2c2c;
        color: #e9ecef;
    }
    
    .language-dropdown-menu {
        background-color: #2c2c2c;
        border-color: rgba(255,255,255,0.1);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    }
    
    .language-option {
        color: #adb5bd;
    }
    
    .language-option:hover {
        background-color: #383838;
        color: #fff;
    }
    
    .language-option.is-active {
        background-color: #495057;
        color: #fff;
    }
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #495057;
    text-decoration: underline;
}

.footer-link svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.footer-separator {
    color: #adb5bd;
    font-size: 14px;
    opacity: 0.7;
}

/* 删除 .home-footer .back-to-top 及其 hover 样式 */
.home-footer .back-to-top {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background-color 0.2s ease, color 0.2s ease;
    opacity: 0.8;
    z-index: 1000;
}

.home-footer .back-to-top:hover {
    background-color: #e9ecef;
    color: #495057;
    opacity: 1;
}

@media (max-width: 768px) {
    .home-page {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    .home-footer {
        margin-top: 40px;
        padding: 15px 0 20px 0;
        position: relative;
        /* Add bottom safe area padding */
        padding-bottom: calc(20px + constant(safe-area-inset-bottom));
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .footer-nav {
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-separator {
        display: none;
    }
    
    .footer-link {
        font-size: 16px;
        padding: 8px 0;
    }

    .footer-language {
        margin-top: 16px;
    }
}
