/* 应用商店样式文件 */
/* 支持深色模式和响应式设计 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS变量定义 - 便于主题切换 */
:root {
    --primary-bg: #f5f5f5;
    --secondary-bg: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-primary: #1f1f1f;
    --text-secondary: #666666;
    --accent-color: #0078d4;
    --border-color: rgba(0, 0, 0, 0.1);
    --sidebar-bg: #2d2d30;
    --sidebar-text: #ffffff;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --blur-bg: rgba(255, 255, 255, 0.25);
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

/* 深色模式变量 */
[data-theme="dark"] {
    --primary-bg: #1a1a1a;
    --secondary-bg: #2d2d30;
    --card-bg: rgba(45, 45, 48, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: rgba(255, 255, 255, 0.1);
    --sidebar-bg: #252526;
    --blur-bg: rgba(45, 45, 48, 0.25);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
    overflow-x: hidden;
}

/* 毛玻璃效果类 */
.glass {
    background: var(--blur-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
}

/* 容器布局 */
.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.sidebar.mobile-hidden {
    transform: translateX(-100%);
}

.logo {
    padding: 0 20px 30px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.logo h1 {
    color: var(--sidebar-text);
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    z-index: 1001;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1001;
    font-size: 18px;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    transform: scale(1.1);
}

/* 侧边栏菜单 */
.sidebar-menu {
    list-style: none;
    padding: 0 20px;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.sidebar-menu a {
    color: var(--sidebar-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: var(--accent-color);
    opacity: 1;
    transform: translateX(5px);
}

.sidebar-menu i {
    font-size: 18px;
    width: 20px;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
    transition: margin-left 0.3s ease;
}

/* 横幅区域 */
.hero-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 60px 40px;
    margin-bottom: 40px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('https://images.unsplash.com/photo-1611224923853-80b023f02d71?w=1200&h=400&fit=crop') center/cover;
    opacity: 0.2;
    z-index: -1;
}

.hero-banner h2 {
    font-size: 48px;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-banner p {
    font-size: 20px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* 区域标题 */
.section-title {
    font-size: 32px;
    margin-bottom: 30px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 应用网格布局 */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
    min-height: 200px;
}

/* 应用卡片样式 */
.app-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* 不同尺寸的卡片 */
.app-card.large {
    grid-column: span 2;
    grid-row: span 2;
    padding: 40px;
}

.app-card.medium {
    grid-row: span 1;
}

/* 卡片悬停效果 */
.app-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow);
    background: var(--card-bg);
}

/* 光影效果动画 */
.app-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.5s;
    opacity: 0;
}

.app-card:hover::before {
    animation: shimmer 0.5s ease-in-out;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); opacity: 0; }
}

/* 应用图标样式 - 重要：自适应图片大小 */
.app-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    background: var(--accent-color);
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.app-icon i {
    font-size: 32px;
    color: white;
}

.app-card.large .app-icon {
    width: 96px;
    height: 96px;
}

.app-card.large .app-icon i {
    font-size: 48px;
}

/* 应用信息 */
.app-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.app-card.large .app-name {
    font-size: 28px;
}

.app-category {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.app-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.app-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.stars {
    color: #ffa500;
}

/* 下载按钮 */
.download-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #106ebe;
    transform: scale(1.05);
}

/* 模态窗口样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.app-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--secondary-bg);
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 2001;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.modal-overlay.active .app-modal {
    transform: translate(-50%, -50%) scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.modal-icon {
    width: 96px;
    height: 96px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--accent-color);
}

.modal-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.modal-info h3 {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.modal-info .category {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.modal-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* 下载区域 */
.download-section {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.download-btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 10px 22px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.download-btn-primary:hover {
    background: #106ebe;
    transform: translateY(-2px);
}

.download-btn-secondary:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

/* 平台标签 */
.platform-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.platform-tag {
    background: var(--accent-color);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

/* 特色功能网格 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-item {
    padding: 20px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    text-align: center;
}

.feature-item i {
    font-size: 32px;
    color: var(--accent-color);
    margin-bottom: 15px;
}

/* 加载和空状态 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading i {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    text-align: center;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 80px 15px 20px;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .theme-toggle {
        right: 15px;
        top: 80px;
    }

    .hero-banner {
        padding: 40px 20px;
    }

    .hero-banner h2 {
        font-size: 32px;
    }

    .app-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .app-card.large {
        grid-column: span 1;
        grid-row: span 1;
        padding: 20px;
    }

    .app-modal {
        padding: 30px 20px;
        width: 95%;
    }

    .modal-header {
        flex-direction: column;
        text-align: center;
    }

    .download-section {
        justify-content: center;
    }

    .section-title {
        font-size: 24px;
    }
}