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

:root {
    --bg-primary: #f5f7fa;
    --bg-secondary: #fff;
    --bg-hero: linear-gradient(180deg, #e8f3ff 0%, #f5f7fa 100%);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-tertiary: #909399;
    --border-color: #ebeef5;
    --border-light: #f2f6fc;
    --primary: #409eff;
    --primary-light: #ecf5ff;
    --secondary: #36cfc9;
    --gradient-primary: linear-gradient(135deg, #409eff, #36cfc9);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-primary: 0 10px 30px rgba(64, 158, 255, 0.3);
    --grid-color: rgba(59, 130, 246, 0.05);
}

[data-theme="dark"] {
    --bg-primary: #0a0e1a;
    --bg-secondary: rgba(20, 25, 40, 0.9);
    --bg-hero: linear-gradient(180deg, rgba(20, 30, 60, 0.8) 0%, #0a0e1a 100%);
    --text-primary: #e8ecf5;
    --text-secondary: #b8c5e8;
    --text-tertiary: rgba(200, 210, 240, 0.5);
    --border-color: rgba(100, 150, 255, 0.12);
    --border-light: rgba(100, 150, 255, 0.06);
    --primary-light: rgba(64, 158, 255, 0.15);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    --grid-color: rgba(59, 130, 246, 0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== 导航栏 ===== */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 17px;
}

.nav-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-image: url('../avatar.jpg');
    background-size: cover;
    background-position: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-logo:hover .nav-logo-icon {
    transform: rotate(5deg) scale(1.05);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s;
    color: var(--text-secondary);
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: rotate(15deg);
}

/* ===== Hero 区域 ===== */
.hero {
    padding: 70px 24px 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: var(--bg-hero);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.6;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-logo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background-image: url('../avatar.jpg');
    background-size: cover;
    background-position: center;
    margin: 0 auto 24px;
    box-shadow: 0 12px 40px rgba(64, 158, 255, 0.25);
    border: 4px solid var(--bg-secondary);
    position: relative;
}

.hero-logo::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--primary);
    animation: spin 8s linear infinite;
}

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

.hero h1 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    letter-spacing: 0.5px;
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

.hero h1 span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.8;
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.35s forwards;
}

.search-box {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    gap: 0;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards;
}

.search-box:focus-within {
    box-shadow: 0 8px 30px rgba(64, 158, 255, 0.2);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.search-box input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
    color: var(--text-primary);
}

.search-box input::placeholder {
    color: #a8abb2;
}

.search-btn {
    padding: 0 28px;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.search-btn:hover::before {
    left: 100%;
}

.search-btn:hover {
    filter: brightness(1.08);
    transform: scale(1.02);
}

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

/* ===== 统计数据 ===== */
.stats {
    max-width: 800px;
    margin: 40px auto 0;
    display: flex;
    justify-content: center;
    gap: 70px;
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.65s forwards;
}

.stat-item {
    text-align: center;
    position: relative;
}

.stat-item::after {
    content: '';
    position: absolute;
    right: -35px;
    top: 50%;
    width: 1px;
    height: 30px;
    background: var(--border-color);
    transform: translateY(-50%);
}

.stat-item:last-child::after {
    display: none;
}

.stat-num {
    font-size: 30px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

/* ===== 主要内容 ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 24px 70px;
    position: relative;
    z-index: 1;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: var(--gradient-primary);
}

.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-select {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    cursor: pointer;
    outline: none;
    transition: all 0.25s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23909399' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.filter-select:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ===== 脚本卡片网格 ===== */
.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.script-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 22px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
}

.script-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.script-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.script-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.script-card:hover::before {
    transform: scaleX(1);
}

.card-top {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.script-card:hover .card-icon {
    transform: scale(1.08) rotate(-3deg);
}

.card-icon.blue {
    background: linear-gradient(135deg, #ecf5ff, #d9ecff);
    color: #409eff;
}

.card-icon.orange {
    background: linear-gradient(135deg, #fef6ec, #faecd8);
    color: #e6a23c;
}

.card-icon.green {
    background: linear-gradient(135deg, #f0f9eb, #e1f3d8);
    color: #67c23a;
}

.card-icon.purple {
    background: linear-gradient(135deg, #f3eaff, #e9d8ff);
    color: #9254de;
}

.card-icon.red {
    background: linear-gradient(135deg, #fef0f0, #fde2e2);
    color: #f56c6c;
}

[data-theme="dark"] .card-icon.blue {
    background: linear-gradient(135deg, rgba(64, 158, 255, 0.2), rgba(54, 207, 201, 0.15));
    color: #6fa8ff;
}
[data-theme="dark"] .card-icon.orange {
    background: linear-gradient(135deg, rgba(230, 162, 60, 0.2), rgba(255, 183, 77, 0.15));
    color: #ffb86b;
}
[data-theme="dark"] .card-icon.green {
    background: linear-gradient(135deg, rgba(103, 194, 58, 0.2), rgba(82, 196, 26, 0.15));
    color: #85ce61;
}
[data-theme="dark"] .card-icon.purple {
    background: linear-gradient(135deg, rgba(146, 84, 222, 0.2), rgba(114, 46, 209, 0.15));
    color: #b37feb;
}
[data-theme="dark"] .card-icon.red {
    background: linear-gradient(135deg, rgba(245, 108, 108, 0.2), rgba(247, 86, 86, 0.15));
    color: #f89898;
}

.card-title-wrap {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.card-platform {
    display: inline-block;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

.card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
    min-height: 44px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.tag {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-tertiary);
    transition: all 0.2s;
}

.script-card:hover .tag {
    background: var(--primary-light);
    color: var(--primary);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

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

.install-btn {
    padding: 7px 18px;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.install-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.6s;
}

.install-btn:hover::before {
    left: 100%;
}

.install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(64, 158, 255, 0.35);
}

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

.install-btn.secondary {
    background: var(--bg-primary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

.install-btn.secondary:hover {
    transform: none;
    box-shadow: none;
}

.install-btn.secondary::before {
    display: none;
}

/* 待开发标签 */
.coming-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-tertiary);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ===== 底部 ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 36px 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-tertiary);
    position: relative;
    z-index: 1;
}

.footer p {
    margin-bottom: 8px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer a:hover {
    opacity: 0.8;
}

.footer-links {
    margin-bottom: 14px;
}

.footer-links a {
    margin: 0 12px;
    color: var(--text-secondary);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero { padding: 50px 16px 40px; }
    .hero h1 { font-size: 26px; }
    .hero-logo { width: 90px; height: 90px; }
    .stats { gap: 30px; }
    .stat-item::after { display: none; }
    .stat-num { font-size: 22px; }
    .scripts-grid { grid-template-columns: 1fr; }
    .main-content { padding: 35px 16px 50px; }
    .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
