/* CSS Reset 和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 - Material Design 风格 */
    --primary-color: #4285f4;
    --primary-dark: #3367d6;
    --primary-light: #669df6;
    
    /* 中性色 */
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-tertiary: #9aa0a6;
    --surface: #ffffff;
    --surface-alt: #f8f9fa;
    --border-color: #dadce0;
    
    /* 功能色 */
    --success: #34a853;
    --warning: #fbbc04;
    --error: #ea4335;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --shadow-md: 0 1px 3px rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    --shadow-lg: 0 2px 6px rgba(60, 64, 67, 0.3), 0 8px 24px 4px rgba(60, 64, 67, 0.15);
    
    /* 间距 */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    
    /* 字体大小 */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: var(--text-primary);
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 30%, #f0f2f5 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* 移动端优先 - 默认样式 */

/* 顶部导航栏 */
.header {
    background: linear-gradient(135deg, var(--surface) 0%, #ffffff 30%, #f8f9fa 100%);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
    position: relative;
}

.logo h1 {
    font-size: var(--text-xl);
    font-weight: 600;
    background: linear-gradient(135deg, #5ebfaf 0%, #764ba2 50%, #30c7bd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 搜索框 */
.search-container {
    flex: 1;
    max-width: 400px;
    margin: 0 var(--spacing-lg);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-size: var(--text-base);
    background: var(--surface-alt);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.search-btn {
    position: absolute;
    right: var(--spacing-sm);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.search-btn:hover {
    color: var(--primary-color);
    background: var(--surface-alt);
}





/* 桌面端导航 - 移动端隐藏 */
.desktop-nav {
    display: none;
}

/* 主要内容区域 */
.main-content {
    padding-bottom: 80px; /* 给移动端底部导航留出空间 */
}

/* 英雄区域 */
.hero-section {
    position: relative;
    color: white;
    padding: var(--spacing-2xl) 0;
    margin-bottom: var(--spacing-2xl);
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('https://wp.upx8.com/api.php') center/cover no-repeat;
    filter: blur(0px);
    border-radius: 16px;
    z-index: -2;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.6) 0%, rgba(118, 75, 162, 0.6) 100%);
    border-radius: 16px;
    z-index: -1;
}

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

.hero-content {
    text-align: center;
}

.hero-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
    background: linear-gradient(135deg, #ffffff 0%, #f093fb 30%, #667eea 70%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: var(--text-lg);
    opacity: 0.9;
    margin-bottom: var(--spacing-xl);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-2xl);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: var(--text-2xl);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: var(--text-sm);
    opacity: 0.8;
}

/* 分类区域 */
.category-section {
    margin-bottom: var(--spacing-2xl);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-size: var(--text-xl);
    font-weight: 600;
    background: linear-gradient(135deg, var(--text-primary) 0%, #5f6368 30%, #9aa0a6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.view-all:hover {
    color: var(--primary-dark);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

.category-item {
    background: linear-gradient(135deg, var(--surface) 0%, #fafbfc 30%, var(--surface-alt) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.category-item:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e6f0ff 30%, #d8e7ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(66, 133, 244, 0.15);
    border-color: var(--primary-color);
}

.category-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto var(--spacing-sm);
    background: var(--surface-alt);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary-color);
}

.category-name {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    font-size: var(--text-sm);
}

.category-count {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* 推荐应用 */
.featured-section {
    margin-bottom: var(--spacing-2xl);
}

.featured-slider {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.featured-app {
    background: linear-gradient(135deg, var(--surface) 0%, #fafbfc 30%, var(--surface-alt) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.featured-app:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e6f0ff 30%, #d8e7ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(66, 133, 244, 0.15);
    border-color: var(--primary-color);
}

.featured-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    flex-shrink: 0;
}

.featured-info {
    flex: 1;
}

.featured-name {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.featured-description {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--spacing-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
    box-orient: vertical;
}

.featured-rating {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--text-sm);
}

.rating-stars {
    color: var(--warning);
}

/* 应用列表 */
.apps-section {
    margin-bottom: var(--spacing-2xl);
}

.filter-options {
    display: none; /* 移动端隐藏筛选 */
}

.apps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

.app-card {
    background: linear-gradient(135deg, var(--surface) 0%, #fafbfc 30%, var(--surface-alt) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-card:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e6f0ff 30%, #d8e7ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(66, 133, 244, 0.15);
    border-color: var(--primary-color);
}

.app-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
}

.app-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

.app-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.app-name {
    font-weight: 600;
    font-size: var(--text-base);
}

.app-description {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
    box-orient: vertical;
}

    .app-footer {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .app-rating {
        display: flex;
        align-items: center;
        gap: var(--spacing-xs);
        font-size: var(--text-sm);
        color: var(--text-tertiary);
    }

.download-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(44, 49, 57, 0.3);
}

.download-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, var(--primary-light) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(57, 58, 59, 0.4);
}

.load-more-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: var(--spacing-xl);
    width: 100%;
}

.load-more-btn {
    background: linear-gradient(135deg, var(--surface-alt) 0%, #f8f9fa 30%, #e8eaed 100%);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    opacity: 1;
    transform: translateY(0);
}

.load-more-btn:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--primary-dark) 100%);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(66, 133, 244, 0.3);
}

/* 加载更多按钮的加载状态样式 */
.load-more-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

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

/* 移动端底部导航 */
.mobile-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--surface) 0%, #ffffff 30%, #f8f9fa 100%);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.footer-nav {
    display: flex;
    justify-content: space-around;
    padding: var(--spacing-sm) 0;
}

.footer-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-tertiary);
    transition: color 0.2s ease;
    flex: 1;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
}

.footer-nav-item:hover,
.footer-nav-item.active {
    color: var(--primary-color);
}

.footer-nav-item span {
    font-size: var(--text-xs);
    margin-top: var(--spacing-xs);
}

.footer-nav-item svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: var(--spacing-md);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: none;
    border: none;
    font-size: var(--text-2xl);
    cursor: pointer;
    color: var(--text-tertiary);
    z-index: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: var(--surface-alt);
}

.modal-body {
    padding: var(--spacing-2xl);
}

/* 平板端适配 */
@media (min-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .featured-slider {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mobile-footer {
        display: none;
    }
    
    .main-content {
        padding-bottom: 0;
    }
    
    .mobile-menu-btn {
        display: none;
    }
    
    .desktop-nav {
        display: flex;
        gap: var(--spacing-lg);
    }
    
    .nav-link {
        text-decoration: none;
        color: var(--text-secondary);
        font-weight: 500;
        padding: var(--spacing-sm) var(--spacing-md);
        border-radius: var(--radius-md);
        transition: all 0.2s ease;
    }
    
    .nav-link:hover,
    .nav-link.active {
        color: var(--primary-color);
        background: var(--surface-alt);
    }
    
    .filter-options {
        display: block;
    }
    
    .filter-select {
        padding: var(--spacing-sm);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        background: var(--surface);
        color: var(--text-secondary);
        font-size: var(--text-sm);
    }
    
    /* PC端隐藏下载按钮 */
    .app-card .app-footer {
        display: none;
    }
    
    .app-card {
        justify-content: flex-start;
    }
}

/* 桌面端适配 */
@media (min-width: 1024px) {
    .category-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .featured-slider {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .apps-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .hero-title {
        font-size: var(--text-4xl);
    }
    
    .search-container {
        max-width: 500px;
    }
    
    .header-content {
        padding: var(--spacing-lg) 0;
    }
}

/* 超大屏幕适配 */
@media (min-width: 1440px) {
    .apps-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 工具类 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

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

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

.app-card {
    animation: fadeIn 0.3s ease;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--surface-alt);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* 加载和错误状态样式 */
.loading-container {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-2xl);
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-container {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-2xl);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.error-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
}

.error-container h3 {
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.error-container p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.retry-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--text-sm);
    transition: background-color var(--transition);
}

.retry-btn:hover {
    background: var(--primary-dark);
}

/* 下载提示动画 */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

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

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

@keyframes slideDown {
    from {
        transform: translateY(0) translateX(-50%);
        opacity: 1;
    }
    to {
        transform: translateY(50px) translateX(-50%);
        opacity: 0;
    }
}

/* 隐藏iframe滚动条 */
.download-iframe::-webkit-scrollbar {
    display: none;
}

/* 过渡效果 */
:root {
    --transition: 0.2s ease;
}