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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    overflow: hidden;
}

/* ========== 背景系统 ========== */
.background {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #000000 0%, #064e3b 50%, #000000 100%);
    overflow: hidden;
}

/* 超大脉动光晕 */
.glow-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    /* 禁用动画以提高性能 */
    /* animation: glowPulse 4s ease-in-out infinite; */
}

.glow1 {
    top: 25%;
    left: 25%;
    width: 600px;
    height: 600px;
    background: rgba(16, 185, 129, 0.3);
}

.glow2 {
    bottom: 25%;
    right: 25%;
    width: 500px;
    height: 500px;
    background: rgba(20, 184, 166, 0.25);
    animation-delay: 1s;
}

.glow3 {
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    background: rgba(34, 197, 94, 0.2);
    animation-delay: 2s;
    transform: translate(-50%, -50%);
}

/* 网格背景 */
.grid {
    position: absolute;
    inset: 0;
    opacity: 0.2;
    background-image:
        linear-gradient(rgba(16, 185, 129, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.3) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* 扫描线 */
.scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(16, 185, 129, 0.03) 0px,
        rgba(16, 185, 129, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
}

/* Canvas - 禁用以提高性能 */
#starCanvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    display: none; /* 禁用Canvas动画 */
}

/* ========== 页面容器 ========== */
.page {
    position: fixed;
    inset: 0;
    display: none !important;
    z-index: 10;
}

.page.active {
    display: flex !important;
}

/* ========== 主页面 ========== */
.main-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Logo按钮 */
.logo-container {
    margin-bottom: 80px;
}

.logo-btn {
    padding: 12px 32px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    color: #34d399;
    font-size: 14px;
    letter-spacing: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-btn:hover {
    background: rgba(51, 65, 85, 0.5);
    color: #10b981;
    border-color: #10b981;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.skull-icon {
    width: 20px;
    height: 20px;
}

/* 选项卡 */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
}

.tab-btn {
    padding: 12px 64px;
    font-size: 14px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(51, 65, 85, 0.7);
    background: rgba(30, 41, 59, 0.3);
    color: rgba(148, 163, 184, 0.8);
    backdrop-filter: blur(10px);
}

.tab-btn:hover {
    background: rgba(51, 65, 85, 0.4);
    border-color: rgba(16, 185, 129, 0.5);
}

.tab-btn.active {
    background: rgba(5, 150, 105, 0.8);
    color: #d1fae5;
    border-color: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

/* 底部链接 */
.footer-link {
    color: #10b981;
    font-size: 14px;
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
    transition: color 0.3s;
}

.footer-link:hover {
    color: #34d399;
}

/* 角落装饰 */
.corner {
    position: fixed;
    width: 64px;
    height: 64px;
    border-color: rgba(148, 163, 184, 0.3);
    opacity: 0.5;
    z-index: 5;
}

.corner-tl {
    top: 32px;
    left: 32px;
    border-left: 2px solid;
    border-top: 2px solid;
}

.corner-tr {
    top: 32px;
    right: 32px;
    border-right: 2px solid;
    border-top: 2px solid;
}

.corner-bl {
    bottom: 32px;
    left: 32px;
    border-left: 2px solid;
    border-bottom: 2px solid;
}

.corner-br {
    bottom: 32px;
    right: 32px;
    border-right: 2px solid;
    border-bottom: 2px solid;
}

/* ========== 下载页面 - 网盘风格 ========== */
/* 下载频率提示 */
.rate-limit-info {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #10b981;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.rate-limit-info.rate-limit-warning {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.rate-limit-info strong {
    font-weight: 600;
    color: inherit;
}

.download-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 100px 40px 40px;
    overflow-y: auto;
}

.back-btn {
    position: fixed;
    top: 32px;
    left: 32px;
    padding: 8px 24px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 100;
}

.back-btn:hover {
    background: rgba(51, 65, 85, 0.5);
    color: #e2e8f0;
}

.page-header {
    text-align: center;
    margin-bottom: 48px;
}

.page-title {
    font-size: 32px;
    font-weight: bold;
    color: #d1fae5;
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.title-underline {
    width: 128px;
    height: 2px;
    background: linear-gradient(to right, #10b981, transparent);
    margin: 0 auto;
}

/* 游戏文件夹样式 */
.download-explorer-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.folder-item {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(51, 65, 85, 0.6);
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.folder-item:hover {
    border-color: #10b981;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
}

.folder-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.folder-header:hover {
    background: rgba(51, 65, 85, 0.3);
}

.folder-icon {
    width: 40px;
    height: 40px;
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.folder-info {
    flex: 1;
}

.folder-name {
    color: #e2e8f0;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.folder-desc {
    color: rgba(148, 163, 184, 0.7);
    font-size: 14px;
}

.folder-meta {
    color: rgba(148, 163, 184, 0.6);
    font-size: 12px;
}

.folder-content {
    display: none;
    padding: 0 24px 24px;
}

.folder-item.expanded .folder-content {
    display: block;
}

.folder-item.expanded .folder-icon i::before {
    content: "\f07c"; /* folder-open */
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(51, 65, 85, 0.4);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: rgba(51, 65, 85, 0.4);
    border-color: rgba(16, 185, 129, 0.5);
}

.file-icon {
    width: 32px;
    height: 32px;
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}

.file-info {
    flex: 1;
}

.file-name {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.file-desc {
    color: rgba(148, 163, 184, 0.6);
    font-size: 12px;
}

.file-size {
    color: rgba(148, 163, 184, 0.7);
    font-size: 12px;
    margin-right: 16px;
    min-width: 80px;
    text-align: right;
}

.file-download-btn {
    padding: 8px 20px;
    background: rgba(5, 150, 105, 0.6);
    border: 1px solid #10b981;
    border-radius: 6px;
    color: #d1fae5;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-download-btn:hover {
    background: rgba(5, 150, 105, 0.9);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
    transform: scale(1.05);
}

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

.file-download-btn.downloading {
    opacity: 0.7;
    cursor: not-allowed;
}

.file-download-btn.downloading i {
    animation: spin 1s linear infinite;
}

/* ========== 动画 ========== */
@keyframes glowPulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ========== 响应式 ========== */
/* 平板适配 (768px - 1024px) */
@media (max-width: 1024px) {
    .download-view {
        max-width: 100%;
        padding: 0 16px;
    }
    
    .product-list-container {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
        padding: 0 16px;
    }
    
    .platform-tabs-container,
    .platform-content-container {
        padding: 0 16px;
    }
    
    .file-group {
        margin-bottom: 24px;
    }
}

/* 手机和平板适配 (最大768px) */
@media (max-width: 768px) {
    .rate-limit-info {
        top: 70px;
        left: 20px;
        right: 20px;
        transform: none;
        font-size: 12px;
        padding: 10px 16px;
    }
    
    .tab-btn {
        padding: 12px 32px;
        font-size: 13px;
    }

    .corner {
        width: 48px;
        height: 48px;
    }

    .corner-tl, .corner-tr {
        top: 16px;
    }

    .corner-bl, .corner-br {
        bottom: 16px;
    }

    .corner-tl, .corner-bl {
        left: 16px;
    }

    .corner-tr, .corner-br {
        right: 16px;
    }

    .download-container {
        padding: 80px 20px 20px;
    }

    .file-item {
        flex-wrap: wrap;
    }

    .file-size {
        width: 100%;
        text-align: left;
        margin-right: 0;
        margin-top: 8px;
    }
    
    /* 下载页面响应式 */
    .download-view {
        max-width: 100%;
        padding: 0 12px;
    }
    
    .product-list-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
        padding: 0 12px;
    }
    
    .product-card {
        padding: 20px 16px;
    }
    
    .product-card-icon {
        width: 56px;
        height: 56px;
        font-size: 28px;
        margin-bottom: 12px;
    }
    
    .product-card-name {
        font-size: 16px;
    }
    
    .product-card-desc {
        font-size: 13px;
    }
    
    .platform-tabs-container,
    .platform-content-container {
        padding: 0 12px;
    }
    
    .platform-tabs {
        gap: 6px;
    }
    
    .platform-tab {
        padding: 10px 18px;
        font-size: 13px;
    }
    
    .file-group-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .file-item {
        padding: 14px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .file-info {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .file-name {
        font-size: 15px;
        width: 100%;
    }
    
    .file-meta {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        gap: 12px;
    }
    
    .file-size {
        font-size: 13px;
        margin: 0;
    }
    
    .file-date {
        font-size: 12px;
    }
    
    .file-download-btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    .download-loading,
    .download-error {
        padding: 60px 20px;
        min-height: 300px;
    }
    
    .loading-spinner {
        font-size: 40px;
        margin-bottom: 20px;
    }
    
    .loading-text {
        font-size: 14px;
    }
    
    .page-header {
        margin-bottom: 32px;
    }
    
    .page-title {
        font-size: 24px;
        letter-spacing: 2px;
    }
    
    .back-btn {
        top: 16px;
        left: 16px;
        padding: 6px 18px;
        font-size: 13px;
    }
}

/* 小屏手机适配 (最大480px) */
@media (max-width: 480px) {
    .product-list-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .product-card {
        padding: 16px;
    }
    
    .platform-tab {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .file-item {
        padding: 12px;
    }
    
    .file-group-title {
        font-size: 16px;
    }
}

/* ========== OSS 下载中心样式 ========== */
.download-view {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: block;
}

/* 产品列表 */
.product-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 0 20px;
}

.product-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(51, 65, 85, 0.6);
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.product-card:hover {
    border-color: #10b981;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
    transform: translateY(-4px);
}

.product-card-icon {
    width: 64px;
    height: 64px;
    color: #10b981;
    font-size: 32px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-name {
    color: #e2e8f0;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.product-card-desc {
    color: rgba(148, 163, 184, 0.7);
    font-size: 14px;
}

/* 平台 Tab */
.platform-tabs-container {
    margin-bottom: 32px;
    padding: 0 20px;
}

.platform-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.platform-tab {
    padding: 12px 24px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(51, 65, 85, 0.6);
    border-radius: 8px;
    color: rgba(148, 163, 184, 0.8);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.platform-tab:hover {
    background: rgba(51, 65, 85, 0.5);
    border-color: rgba(16, 185, 129, 0.5);
}

.platform-tab.active {
    background: rgba(5, 150, 105, 0.8);
    border-color: #10b981;
    color: #d1fae5;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.platform-content-container {
    padding: 0 20px;
}

/* 文件分组 */
.file-group {
    margin-bottom: 32px;
}

.file-group-title {
    color: #d1fae5;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-group-title i {
    color: #10b981;
}

/* Loading 状态 */
.download-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    min-height: 400px;
}

.loading-spinner {
    font-size: 48px;
    color: #10b981;
    margin-bottom: 24px;
}

.loading-text {
    color: rgba(148, 163, 184, 0.8);
    font-size: 16px;
}

/* Error 状态 */
.download-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    min-height: 400px;
    text-align: center;
}

.error-icon {
    font-size: 64px;
    color: #ef4444;
    margin-bottom: 24px;
}

.error-message {
    color: rgba(148, 163, 184, 0.8);
    font-size: 16px;
    margin-bottom: 24px;
}

.error-retry-btn {
    padding: 12px 32px;
    background: rgba(5, 150, 105, 0.6);
    border: 1px solid #10b981;
    border-radius: 8px;
    color: #d1fae5;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-retry-btn:hover {
    background: rgba(5, 150, 105, 0.9);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.file-upload-time {
    color: rgba(148, 163, 184, 0.6);
    font-size: 12px;
    margin-top: 4px;
}

/* ========== 左下角赞助商 ========== */
.sponsor-container {
    position: fixed;
    bottom: 40px;
    left: 40px;
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    backdrop-filter: none;
    box-shadow: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sponsor-container.hidden {
    display: none;
}

.sponsor-close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(239, 68, 68, 0.9);
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 16;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.sponsor-close-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
}

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

.sponsor-container:hover {
    transform: translateY(-8px) scale(1.02);
}

.sponsor-image-wrapper {
    width: 310px;
    height: 310px;
    border-radius: 10px;
    overflow: visible;
    border: 2px solid #10b981;
    box-shadow: 
        0 0 20px rgba(16, 185, 129, 0.5),
        inset 0 0 15px rgba(16, 185, 129, 0.1);
    background: rgba(30, 41, 59, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.sponsor-image-wrapper::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(45deg, #10b981, #34d399, #10b981);
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    /* 禁用动画以提高性能 */
    /* animation: borderGlow 3s ease infinite; */
    z-index: -1;
}

@keyframes borderGlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.sponsor-container:hover .sponsor-image-wrapper {
    box-shadow: 
        0 0 40px rgba(16, 185, 129, 0.7),
        inset 0 0 30px rgba(16, 185, 129, 0.15);
    border-color: #34d399;
    transform: scale(1.05);
}

.sponsor-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
    border-radius: 8px;
}

.sponsor-container:hover .sponsor-image {
    transform: scale(1.05);
}

.sponsor-text-wrapper {
    width: 100%;
    overflow: hidden;
    background: linear-gradient(90deg, 
        rgba(16, 185, 129, 0.15) 0%, 
        rgba(52, 211, 153, 0.2) 50%, 
        rgba(16, 185, 129, 0.15) 100%);
    border-radius: 8px;
    padding: 8px 0;
    border: 1px solid rgba(16, 185, 129, 0.4);
    position: relative;
    box-shadow: 
        inset 0 0 10px rgba(16, 185, 129, 0.2),
        0 0 10px rgba(16, 185, 129, 0.2);
}

.sponsor-text-scroll {
    display: flex;
    white-space: nowrap;
    animation: sponsorScroll 8s linear infinite;
}

.sponsor-text {
    display: inline-block;
    color: #34d399;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 
        0 0 10px rgba(52, 211, 153, 0.8),
        0 0 20px rgba(52, 211, 153, 0.4);
    padding: 0 12px;
    flex-shrink: 0;
    /* 移除 text-transform: uppercase，避免中文字符显示异常 */
}

@keyframes sponsorScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-33.333%);
    }
}

/* 响应式适配 */
@media (max-width: 768px) {
    .sponsor-container {
        bottom: 20px;
        left: 20px;
        padding: 0;
        gap: 6px;
    }
    
    .sponsor-close-btn {
        top: -8px;
        right: -8px;
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .sponsor-image-wrapper {
        width: 140px;
        height: 140px;
    }
    
    .sponsor-text {
        font-size: 12px;
        letter-spacing: 1.5px;
        padding: 0 10px;
    }
    
    .sponsor-text-wrapper {
        padding: 6px 0;
    }
}

@media (max-width: 480px) {
    .sponsor-container {
        bottom: 15px;
        left: 15px;
        padding: 0;
        gap: 5px;
    }
    
    .sponsor-close-btn {
        top: -6px;
        right: -6px;
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    .sponsor-image-wrapper {
        width: 120px;
        height: 120px;
    }
    
    .sponsor-text {
        font-size: 11px;
        letter-spacing: 1px;
        padding: 0 8px;
    }
    
    .sponsor-text-wrapper {
        padding: 5px 0;
    }
}