/* ============================================
   二次元下载站 - 前端样式
   ============================================ */

:root {
    --primary: #ff6b9d;
    --primary-light: #ffb3d1;
    --primary-dark: #e85a87;
    --secondary: #a78bfa;
    --bg-gradient: linear-gradient(135deg, #ffe0ec 0%, #e0e7ff 50%, #e0f7ff 100%);
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(255, 255, 255, 0.9);
    --text-main: #4a3a52;
    --text-sub: #8a7a92;
    --shadow-soft: 0 8px 32px rgba(255, 107, 157, 0.15);
    --shadow-hover: 0 16px 48px rgba(255, 107, 157, 0.25);
    --radius: 20px;
    --radius-sm: 12px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'Noto Sans SC', sans-serif;
    color: var(--text-main);
    background: var(--bg-gradient);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

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

/* 背景层 */
.bg-layer {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(135deg, #ffe0ec 0%, #e0e7ff 50%, #e0f7ff 100%);
    background-size: cover;
    background-position: center;
    z-index: -3;
}

.bg-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 224, 236, 0.3) 0%, rgba(224, 231, 255, 0.2) 50%, rgba(224, 247, 255, 0.3) 100%);
    z-index: -2;
    backdrop-filter: blur(2px);
}

/* 樱花飘落 */
.sakura-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.sakura {
    position: absolute;
    top: -30px;
    font-size: 16px;
    opacity: 0.7;
    animation: fall linear infinite;
    user-select: none;
}

@keyframes fall {
    0% {
        transform: translateY(-30px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(100vh) translateX(100px) rotate(720deg);
        opacity: 0;
    }
}

/* 顶部导航 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 20px rgba(255, 107, 157, 0.08);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-dark);
}

.logo-icon {
    font-size: 28px;
    animation: sway 3s ease-in-out infinite;
}

@keyframes sway {
    0%, 100% { transform: rotate(-8deg); }
    50% { transform: rotate(8deg); }
}

.nav-menu {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-link {
    padding: 8px 18px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 14px;
}

.nav-link:hover {
    background: rgba(255, 107, 157, 0.15);
    color: var(--primary-dark);
    transform: translateY(-2px);
}

.nav-link.nav-card {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 4px 14px rgba(255, 107, 157, 0.4);
}

.nav-link.nav-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.5);
}

/* 主视觉区 */
.hero {
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
}

.hero-content {
    animation: fadeInUp 0.8s ease;
}

.hero-title {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: 2px;
    text-shadow: 0 4px 20px rgba(255, 107, 157, 0.2);
}

.hero-subtitle {
    font-size: clamp(16px, 2.5vw, 20px);
    color: var(--text-sub);
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 30px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-soft);
    min-width: 120px;
    transition: transform 0.3s;
}

.stat:hover {
    transform: translateY(-4px);
}

.stat-num {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-dark);
}

.stat-label {
    font-size: 14px;
    color: var(--text-sub);
    margin-top: 4px;
}

/* 区块标题 */
.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 32px;
    color: var(--text-main);
    margin-bottom: 8px;
    font-weight: 700;
}

.section-title p {
    color: var(--text-sub);
    font-size: 15px;
}

/* 软件区 */
.software-section {
    padding: 60px 0;
}

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

.software-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.software-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.05), rgba(167, 139, 250, 0.05));
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
    border-radius: var(--radius);
}

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

.software-card:hover::before {
    opacity: 1;
}

.card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, #ffe0ec, #e0e7ff);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.software-card:hover .card-image img {
    transform: scale(1.08);
}

.card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    background: linear-gradient(135deg, #ffe0ec, #e0e7ff);
}

.status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    backdrop-filter: blur(4px);
}

.status-badge.status-ok {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.status-badge.status-fail {
    background: linear-gradient(135deg, #f87171, #ef4444);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
    display: inline-block;
}

.card-version {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: rgba(167, 139, 250, 0.15);
    color: var(--secondary);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    vertical-align: middle;
}

.card-desc {
    color: var(--text-sub);
    font-size: 13px;
    margin: 10px 0;
    min-height: 40px;
    line-height: 1.5;
}

.card-meta {
    margin: 12px 0;
    font-size: 12px;
    color: var(--text-sub);
}

.download-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-download {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 14px rgba(255, 107, 157, 0.4);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.5);
}

.btn-card {
    background: rgba(167, 139, 250, 0.15);
    color: var(--secondary);
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.btn-card:hover {
    background: var(--secondary);
    color: #fff;
    transform: translateY(-2px);
}

.btn-disabled {
    background: #e5e5e5;
    color: #999;
    cursor: not-allowed;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state p {
    color: var(--text-sub);
    font-size: 16px;
}

/* 关于区 */
.about-section {
    padding: 60px 0;
}

.about-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.about-card h2 {
    font-size: 28px;
    color: var(--primary-dark);
    margin-bottom: 16px;
}

.about-card p {
    color: var(--text-sub);
    margin-bottom: 8px;
}

/* 音乐播放器 */
.music-section {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 200;
    width: 360px;
    max-width: calc(100vw - 40px);
}

.music-player {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 40px rgba(255, 107, 157, 0.2);
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
    transition: all 0.3s;
}

.music-cover {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #ffe0ec, #e0e7ff);
    position: relative;
}

.music-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.music-cover img.loaded {
    display: block;
}

.music-cover-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.music-cover img.loaded ~ .music-cover-placeholder {
    display: none;
}

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

.music-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-artist {
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-progress {
    margin: 6px 0;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 107, 157, 0.15);
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.1s linear;
    border-radius: 2px;
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-sub);
    margin-top: 4px;
}

.music-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ctrl-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 107, 157, 0.1);
    color: var(--primary-dark);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ctrl-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.1);
}

.play-btn {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 14px;
}

.play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
}

.music-list-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 107, 157, 0.15);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.music-list-toggle:hover {
    background: var(--primary);
    color: #fff;
}

.music-playlist {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    left: 0;
    max-height: 240px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 6px;
    display: none;
    z-index: 10;
}

.music-playlist.show {
    display: block;
    animation: fadeInUp 0.2s ease;
}

.playlist-item {
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.playlist-item:hover {
    background: rgba(255, 107, 157, 0.1);
}

.playlist-item.active {
    background: rgba(255, 107, 157, 0.2);
    color: var(--primary-dark);
}

.pl-name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pl-artist {
    font-size: 11px;
    color: var(--text-sub);
    flex-shrink: 0;
}

/* 页脚 */
.site-footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-sub);
    font-size: 14px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    margin-top: 40px;
}

.site-footer p {
    margin-bottom: 4px;
}

.footer-sub {
    font-size: 12px;
    opacity: 0.7;
}

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

/* 响应式 */
@media (max-width: 768px) {
    .hero {
        padding: 40px 0 30px;
    }

    .hero-stats {
        gap: 16px;
    }

    .stat {
        padding: 14px 20px;
        min-width: 90px;
    }

    .stat-num {
        font-size: 24px;
    }

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

    .nav-menu {
        gap: 4px;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 13px;
    }

    .music-section {
        bottom: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .music-player {
        padding: 12px;
    }

    .about-card {
        padding: 24px;
    }

    .section-title h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .software-grid {
        grid-template-columns: 1fr;
    }

    .logo-text {
        font-size: 16px;
    }

    .hero-title {
        letter-spacing: 1px;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* 选中文本 */
::selection {
    background: var(--primary-light);
    color: #fff;
}
