/* ===== 基础变量 ===== */
:root {
    --primary: #2196F3;
    --primary-light: #64B5F6;
    --primary-dark: #1976D2;
    --secondary: #E3F2FD;
    --bg-gradient-start: #F0F8FF;
    --bg-gradient-end: #E3F2FD;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-primary: #1565C0;
    --text-secondary: #546E7A;
    --text-light: #90A4AE;
    --shadow-light: rgba(33, 150, 243, 0.15);
    --shadow-medium: rgba(33, 150, 243, 0.25);
    --shadow-dark: rgba(25, 118, 210, 0.3);
    --neumorph-light: #FFFFFF;
    --neumorph-dark: #B0BEC5;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 重置样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 50%, #BBDEFB 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== 顶部区域 ===== */
.header {
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(227,242,253,0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.6);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 
        0 4px 20px var(--shadow-light),
        inset 0 1px 0 rgba(255,255,255,0.8);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-section {
    flex-shrink: 0;
}

.logo-wrapper {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: linear-gradient(145deg, var(--neumorph-light), var(--secondary));
    box-shadow: 
        6px 6px 12px var(--shadow-light),
        -6px -6px 12px rgba(255,255,255,0.8),
        inset 0 0 0 2px rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: var(--transition);
}

.logo-wrapper:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 
        8px 8px 16px var(--shadow-medium),
        -8px -8px 16px rgba(255,255,255,0.9);
}

.logo {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.announcement-section {
    flex: 1;
    min-width: 0;
}

.announcement-box {
    background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(227,242,253,0.7));
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 
        4px 4px 8px var(--shadow-light),
        -4px -4px 8px rgba(255,255,255,0.7),
        inset 0 1px 0 rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.5);
}

.announcement-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    box-shadow: 0 2px 8px var(--shadow-medium);
}

.announcement-content {
    flex: 1;
    min-width: 0;
}

.announcement-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* ===== 主体内容区 ===== */
.main-content {
    padding: 24px 0 80px;
    min-height: calc(100vh - 200px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 
        8px 8px 20px var(--shadow-light),
        -8px -8px 20px rgba(255,255,255,0.8),
        inset 0 0 0 1px rgba(255,255,255,0.6);
    margin: 20px 0;
}

.empty-icon {
    font-size: 80px;
    color: var(--primary-light);
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state p {
    font-size: 20px;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-sub {
    font-size: 14px;
    color: var(--text-light);
}

/* 应用网格 */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.app-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 4px;
    box-shadow: 
        6px 6px 16px var(--shadow-light),
        -6px -6px 16px rgba(255,255,255,0.8),
        inset 0 0 0 1px rgba(255,255,255,0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-light), var(--primary), var(--primary-dark));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        12px 12px 24px var(--shadow-medium),
        -8px -8px 20px rgba(255,255,255,0.9);
}

.app-card:active {
    transform: translateY(-2px) scale(0.98);
    transition: transform 0.1s ease;
}

.app-card:hover::before {
    opacity: 1;
}

.card-content {
    background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(240,248,255,0.9));
    border-radius: calc(var(--radius-md) - 4px);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    background: linear-gradient(145deg, var(--neumorph-light), var(--secondary));
    box-shadow: 
        4px 4px 8px var(--shadow-light),
        -4px -4px 8px rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.app-icon {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 10px;
}

.app-info {
    flex: 1;
    min-width: 0;
}

.app-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.download-btn {
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 
        0 4px 12px var(--shadow-medium),
        inset 0 1px 0 rgba(255,255,255,0.3);
    transition: var(--transition);
}

.download-btn:hover {
    transform: scale(1.05);
    box-shadow: 
        0 6px 16px var(--shadow-dark),
        inset 0 1px 0 rgba(255,255,255,0.4);
}

.download-btn:active {
    transform: scale(0.98);
}

/* ===== 底部区域 ===== */
.footer {
    background: linear-gradient(180deg, transparent, rgba(227,242,253,0.5));
    padding: 30px 20px;
    text-align: center;
}

.about-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    padding: 10px 24px;
    border-radius: 30px;
    background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(227,242,253,0.7));
    box-shadow: 
        4px 4px 8px var(--shadow-light),
        -4px -4px 8px rgba(255,255,255,0.7);
    transition: var(--transition);
    display: inline-block;
}

.about-link:hover {
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 
        6px 6px 12px var(--shadow-medium),
        -6px -6px 12px rgba(255,255,255,0.8);
}

/* ===== 教程悬浮按钮 ===== */
.tutorial-float-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 
        0 4px 15px var(--shadow-dark),
        inset 0 1px 0 rgba(255,255,255,0.3);
    transition: var(--transition);
    z-index: 99;
}

.tutorial-float-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 25px var(--shadow-dark),
        inset 0 1px 0 rgba(255,255,255,0.4);
}

.tutorial-float-btn:active {
    transform: translateY(-1px) scale(0.95);
}

.tutorial-float-btn .iconify {
    font-size: 16px;
}

/* ===== 弹窗样式 ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(21, 101, 192, 0);
    transition: background 0.3s ease;
}

.modal.active .modal-overlay {
    background: rgba(21, 101, 192, 0.4);
}

.modal-content {
    position: relative;
    background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(240,248,255,0.95));
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 
        0 25px 50px -12px var(--shadow-dark),
        0 0 0 1px rgba(255,255,255,0.5);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(33, 150, 243, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(255,255,255,0.8), transparent);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(227,242,253,0.7));
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        3px 3px 6px var(--shadow-light),
        -3px -3px 6px rgba(255,255,255,0.8);
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--primary);
    transform: rotate(90deg);
    box-shadow: 
        4px 4px 8px var(--shadow-medium),
        -4px -4px 8px rgba(255,255,255,0.9);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

.app-preview {
    margin-bottom: 24px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 
        4px 4px 12px var(--shadow-light),
        -4px -4px 12px rgba(255,255,255,0.8);
}

.preview-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.download-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.download-option-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.download-option-btn.android {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
    box-shadow: 
        0 4px 12px rgba(76, 175, 80, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.download-option-btn.ios {
    background: linear-gradient(135deg, #607D8B, #455A64);
    color: white;
    box-shadow: 
        0 4px 12px rgba(96, 125, 139, 0.3),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.download-option-btn:hover {
    transform: translateX(4px);
    box-shadow: 
        0 6px 16px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

.download-option-btn .iconify {
    font-size: 32px;
    flex-shrink: 0;
}

.btn-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.btn-label {
    font-size: 16px;
    font-weight: 600;
}

.btn-hint {
    font-size: 12px;
    opacity: 0.85;
}

/* 教程弹窗 */
.tutorial-modal .modal-body {
    padding: 20px;
}

.video-container {
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 
        4px 4px 12px var(--shadow-light),
        -4px -4px 12px rgba(255,255,255,0.8);
}

.video-container video {
    width: 100%;
    display: block;
}

.tutorial-text {
    background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(227,242,253,0.5));
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: 
        inset 2px 2px 4px var(--shadow-light),
        inset -2px -2px 4px rgba(255,255,255,0.8);
}

.tutorial-text pre {
    font-family: inherit;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
        padding: 0 16px;
    }
    
    .logo-wrapper {
        width: 48px;
        height: 48px;
    }
    
    .logo {
        width: 38px;
        height: 38px;
    }
    
    .announcement-box {
        padding: 10px 12px;
    }
    
    .announcement-content p {
        font-size: 12px;
    }
    
    .main-content {
        padding: 16px 0 100px;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .app-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .card-content {
        padding: 14px;
    }
    
    .app-icon-wrapper {
        width: 56px;
        height: 56px;
    }
    
    .app-icon {
        width: 44px;
        height: 44px;
    }
    
    .app-name {
        font-size: 15px;
    }
    
    .app-desc {
        font-size: 12px;
    }
    
    .download-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .tutorial-float-btn {
        bottom: 16px;
        right: 16px;
        padding: 12px 18px;
        font-size: 14px;
    }
    
    .btn-text {
        display: none;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .preview-image {
        height: 160px;
    }
    
    .download-option-btn {
        padding: 14px 16px;
    }
    
    .download-option-btn .iconify {
        font-size: 28px;
    }
    
    .btn-label {
        font-size: 15px;
    }
}

@media (max-width: 380px) {
    .card-content {
        gap: 10px;
    }
    
    .app-icon-wrapper {
        width: 48px;
        height: 48px;
    }
    
    .app-icon {
        width: 38px;
        height: 38px;
    }
}

/* ===== 动画效果 ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-card {
    animation: fadeInUp 0.5s ease-out forwards;
}

.app-card:nth-child(1) { animation-delay: 0.05s; }
.app-card:nth-child(2) { animation-delay: 0.1s; }
.app-card:nth-child(3) { animation-delay: 0.15s; }
.app-card:nth-child(4) { animation-delay: 0.2s; }
.app-card:nth-child(5) { animation-delay: 0.25s; }
.app-card:nth-child(6) { animation-delay: 0.3s; }

/* ===== 新弹窗样式 ===== */
.app-modal {
    background: #fff;
    border-radius: 16px;
    width: 85%;
    max-width: 300px;
    padding: 16px;
    position: relative;
    max-height: 80vh;
    overflow: hidden;
}

.app-modal .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    z-index: 10;
}

.app-modal .close-btn:hover {
    background: #e0e0e0;
    transform: none;
}

.app-modal .modal-body {
    padding: 0;
    text-align: center;
    overflow: hidden;
}

.app-preview-large {
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
}

.preview-image-large {
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

.modal-app-name {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.modal-app-hint {
    font-size: 12px;
    color: #999;
    margin-bottom: 16px;
}

.download-options-large {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.download-btn-large {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-btn-large.ios {
    background: #007AFF;
    color: white;
}

.download-btn-large.ios:hover {
    background: #0056CC;
}

.download-btn-large.android {
    background: #F2F2F7;
    color: #333;
}

.download-btn-large.android:hover {
    background: #E5E5EA;
}

/* 图片防保存 */
img {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.app-icon, .logo, .preview-image-large {
    pointer-events: none;
}

::-webkit-scrollbar {
    display: none;
}
