/* Apple App Store 风格的高级UI设计 */

:root {
    /* Apple Design System Colors */
    --system-blue: #007AFF;
    --system-green: #34C759;
    --system-orange: #FF9500;
    --system-red: #FF3B30;
    --system-purple: #AF52DE;
    --system-pink: #FF2D92;
    --system-teal: #30B0C7;
    --system-indigo: #5856D6;
    
    /* Neutral Colors */
    --system-gray: #8E8E93;
    --system-gray2: #AEAEB2;
    --system-gray3: #C7C7CC;
    --system-gray4: #D1D1D6;
    --system-gray5: #E5E5EA;
    --system-gray6: #F2F2F7;
    
    /* Semantic Colors */
    --label-primary: #000000;
    --label-secondary: #3C3C43;
    --label-tertiary: #3C3C4399;
    --label-quaternary: #3C3C434C;
    
    --separator: #3C3C434C;
    --opaque-separator: #C6C6C8;
    
    --system-background: #FFFFFF;
    --secondary-system-background: #F2F2F7;
    --tertiary-system-background: #FFFFFF;
    
    --system-grouped-background: #F2F2F7;
    --secondary-system-grouped-background: #FFFFFF;
    --tertiary-system-grouped-background: #F2F2F7;
    
    /* Typography */
    --sf-pro-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --sf-pro-text: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    
    /* Shadows */
    --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    --button-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    --elevated-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    
    /* Border Radius */
    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 16px;
    --radius-xl: 24px;
}

/* 强制使用明亮模式颜色，确保文字清晰可见 */
:root {
    --label-primary: #000000 !important;
    --label-secondary: #3C3C43 !important;
    --label-tertiary: #3C3C4399 !important;
    --label-quaternary: #3C3C434C !important;
    
    --separator: #3C3C434C !important;
    --opaque-separator: #C6C6C8 !important;
    
    --system-background: #FFFFFF !important;
    --secondary-system-background: #F2F2F7 !important;
    --tertiary-system-background: #FFFFFF !important;
    
    --system-grouped-background: #F2F2F7 !important;
    --secondary-system-grouped-background: #FFFFFF !important;
    --tertiary-system-grouped-background: #F2F2F7 !important;
}

/* Dark Mode Support - 可选择性启用 */
@media (prefers-color-scheme: dark) {
    body.dark-mode {
        --label-primary: #FFFFFF;
        --label-secondary: #EBEBF5;
        --label-tertiary: #EBEBF599;
        --label-quaternary: #EBEBF54C;
        
        --separator: #54545899;
        --opaque-separator: #38383A;
        
        --system-background: #000000;
        --secondary-system-background: #1C1C1E;
        --tertiary-system-background: #2C2C2E;
        
        --system-grouped-background: #000000;
        --secondary-system-grouped-background: #1C1C1E;
        --tertiary-system-grouped-background: #2C2C2E;
    }
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--sf-pro-text);
    background-color: var(--system-grouped-background);
    color: var(--label-primary);
    line-height: 1.47059;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation Bar - Apple Style */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--separator);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.2s ease;
}

.nav-container {
    max-width: 1020px;
    margin: 0 auto;
    padding: 0 20px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--sf-pro-display);
    font-size: 21px;
    font-weight: 700;
    color: #000000 !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.nav-logo i {
    color: var(--system-blue);
    font-size: 24px;
    text-shadow: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
}

.nav-menu a {
    font-size: 17px;
    font-weight: 500;
    color: #000000 !important;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.nav-menu a:hover {
    opacity: 0.7;
    color: var(--system-blue) !important;
}

.search-container {
    position: relative;
    max-width: 300px;
    width: 100%;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box input {
    width: 100%;
    height: 36px;
    padding: 0 36px 0 36px;
    border: 1px solid var(--separator);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #000000 !important;
    font-size: 17px;
    outline: none;
    transition: all 0.2s ease;
}

.search-box input:focus {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 2px var(--system-blue);
    border-color: var(--system-blue);
}

.search-box input::placeholder {
    color: #666666 !important;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666666 !important;
    font-size: 16px;
    pointer-events: none;
}

.advanced-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: var(--system-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.advanced-search-btn:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Hero Section - Apple Style */
.hero {
    background: linear-gradient(135deg, var(--system-blue) 0%, var(--system-purple) 100%);
    padding: 80px 0;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-opacity='0.1'%3E%3Cpolygon fill='%23ffffff' points='50 0 60 40 100 50 60 60 50 100 40 60 0 50 40 40'/%3E%3C/g%3E%3C/svg%3E") center/100px;
    opacity: 0.4;
}

.hero-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-family: var(--sf-pro-display);
    font-size: 56px;
    font-weight: 600;
    line-height: 1.07143;
    margin-bottom: 24px;
    letter-spacing: -0.005em;
}

.hero p {
    font-size: 21px;
    line-height: 1.381;
    margin-bottom: 40px;
    opacity: 0.9;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 60px;
}

.stat {
    text-align: center;
}

.stat h3 {
    font-family: var(--sf-pro-display);
    font-size: 40px;
    font-weight: 600;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat p {
    font-size: 17px;
    opacity: 0.8;
}

/* Platform Cards - Apple Style */
.platforms {
    padding: 80px 0;
    background: var(--system-grouped-background);
}

.platforms .container {
    max-width: 1020px;
    margin: 0 auto;
    padding: 0 20px;
}

.platforms h2 {
    font-family: var(--sf-pro-display);
    font-size: 40px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 60px;
    color: #000000 !important;
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.platform-card {
    background: var(--secondary-system-grouped-background);
    border-radius: var(--radius-large);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--card-shadow);
    border: 0.5px solid var(--separator);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.platform-card::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.6s ease;
}

.platform-card:hover::before {
    left: 100%;
}

.platform-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--elevated-shadow);
}

.platform-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--system-blue), var(--system-purple));
    border-radius: var(--radius-large);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
    box-shadow: var(--button-shadow);
}

.platform-card h3 {
    font-family: var(--sf-pro-display);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #000000 !important;
}

.platform-card p {
    font-size: 17px;
    color: #444444 !important;
    margin-bottom: 24px;
    line-height: 1.47059;
}

.software-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 16px;
    background: var(--system-blue);
    color: white;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 24px;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 24px;
    background: var(--system-blue);
    color: white;
    border: none;
    border-radius: 22px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--button-shadow);
}

.view-btn:hover {
    background: #0056CC;
    transform: scale(1.05);
}

.view-btn:active {
    transform: scale(0.98);
}

/* Software Grid - App Store Style */
.software-showcase {
    padding: 80px 0;
    background: var(--system-background);
}

.software-showcase .container {
    max-width: 1020px;
    margin: 0 auto;
    padding: 0 20px;
}

.software-showcase h2 {
    font-family: var(--sf-pro-display);
    font-size: 40px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
    color: #000000 !important;
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.filter-btn {
    height: 40px;
    padding: 0 20px;
    border: 1px solid var(--separator);
    background: var(--tertiary-system-background);
    color: var(--label-primary);
    border-radius: 20px;
    font-size: 17px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--system-blue);
    color: white;
    border-color: var(--system-blue);
    transform: scale(1.05);
}

.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Software Card - App Store Style */
.software-card {
    background: var(--secondary-system-grouped-background);
    border-radius: var(--radius-large);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 0.5px solid var(--separator);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

.software-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--elevated-shadow);
}

.software-header {
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.software-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-medium);
    background: linear-gradient(135deg, var(--system-blue), var(--system-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
    box-shadow: var(--button-shadow);
}

.software-info {
    flex: 1;
    min-width: 0;
}

.software-info h3 {
    font-family: var(--sf-pro-display);
    font-size: 22px;
    font-weight: 700;
    color: #000000 !important;
    margin-bottom: 6px;
    line-height: 1.2;
    transition: color 0.3s ease;
}

.software-info p {
    font-size: 16px;
    color: #444444 !important;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.software-card:hover .software-info h3 {
    color: var(--system-blue) !important;
}

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

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

.rating-score {
    font-size: 13px;
    font-weight: 600;
    color: var(--label-secondary);
}

.software-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tag {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    background: var(--system-gray6);
    color: var(--label-secondary);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.software-meta {
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--label-tertiary);
    margin-bottom: 16px;
}

.software-actions {
    padding: 0 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.platform-tag {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.platform-tag.windows { background: #0078D4; color: white; }
.platform-tag.macos { background: #007AFF; color: white; }
.platform-tag.linux { background: #FF9500; color: white; }
.platform-tag.mobile { background: #34C759; color: white; }

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 16px;
    background: var(--system-blue);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 6px;
}

.download-btn:hover {
    background: #0056CC;
    transform: scale(1.05);
}

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

/* Statistics Widget */
.stats-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    color: white;
    padding: 16px;
    border-radius: var(--radius-medium);
    font-size: 13px;
    z-index: 1000;
    min-width: 200px;
    box-shadow: var(--elevated-shadow);
}

.stats-widget h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.stats-item:last-child {
    margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 40px;
    }
    
    .hero p {
        font-size: 19px;
    }
    
    .hero-stats {
        gap: 40px;
    }
    
    .platforms h2,
    .software-showcase h2 {
        font-size: 32px;
    }
    
    .software-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        display: none;
    }
    
    .search-container {
        max-width: 200px;
    }
    
    .stats-widget {
        position: relative;
        bottom: auto;
        right: auto;
        margin: 20px;
        width: calc(100% - 40px);
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 32px;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .platform-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-tabs {
        gap: 6px;
    }
    
    .filter-btn {
        height: 36px;
        padding: 0 16px;
        font-size: 15px;
    }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.6s ease;
}

.slide-in-up {
    animation: slideInUp 0.6s ease;
}