/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 颜色系统 */
    --primary: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #7c8efc;
    --secondary: #764ba2;
    --accent: #f093fb;

    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-card: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);

    /* 中性色 */
    --bg-primary: #0f0f1e;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-hover: #1f2b4a;

    /* 文字颜色 */
    --text-primary: #ffffff;
    --text-secondary: #b8c1ec;
    --text-muted: #6c7a9b;

    /* 边框 */
    --border-color: #2a3554;
    --border-radius: 12px;
    --border-radius-lg: 16px;

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(102, 126, 234, 0.3);

    /* 动画 */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* ==================== 背景装饰 ==================== */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-decoration::before,
.bg-decoration::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.bg-decoration::before {
    width: 600px;
    height: 600px;
    background: var(--gradient-primary);
    top: -300px;
    right: -200px;
    animation: float 20s ease-in-out infinite;
}

.bg-decoration::after {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    bottom: -250px;
    left: -150px;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(30px, -30px) rotate(5deg);
    }

    50% {
        transform: translate(0, -50px) rotate(0deg);
    }

    75% {
        transform: translate(-30px, -30px) rotate(-5deg);
    }
}

/* ==================== 头部 ==================== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 15, 30, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.nav {
    display: flex;
    gap: 24px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--primary-light);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* ==================== Hero 区域 ==================== */
.hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 80px 0 60px;
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 48px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ==================== 搜索框 ==================== */
.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 18px 56px 18px 56px;
    font-size: 16px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    color: var(--text-primary);
    transition: var(--transition);
    font-family: inherit;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), var(--shadow-glow);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-clear {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ==================== 分类筛选 ==================== */
.filter-section {
    position: relative;
    z-index: 1;
    padding: 24px 0;
}

.filter-chips {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.chip {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.chip:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.chip.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-glow);
}

/* ==================== 卡片列表 ==================== */
.cards-section {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 24px 0 80px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out backwards;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.card-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.card-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--gradient-card);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-version {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.code-container {
    margin-bottom: 20px;
}

.code-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.code-box {
    display: flex;
    gap: 8px;
    align-items: center;
}

.code-value {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    color: var(--accent);
    word-break: break-all;
}

.copy-btn {
    padding: 12px 20px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

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

.card-note {
    margin-top: 16px;
    padding: 12px;
    background: rgba(102, 126, 234, 0.1);
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 24px;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* ==================== 统计信息区域 ==================== */
.stats-section {
    position: relative;
    z-index: 1;
    padding: 40px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    text-align: center;
    transition: var(--transition);
    cursor: default;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* ==================== 使用教程区域 ==================== */
.tutorial-section {
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
    padding: 60px 0;
    border-top: 1px solid var(--border-color);
}

.section-title {
    font-size: 36px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 48px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.tutorial-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.tutorial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

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

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

.tutorial-step {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin: 0 auto 20px;
    box-shadow: var(--shadow-glow);
}

.tutorial-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.tutorial-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.tips-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    max-width: 600px;
    margin: 0 auto;
}

.tips-box h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}

.shortcuts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.shortcut-item kbd {
    background: var(--bg-primary);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: var(--primary-light);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.shortcut-item span {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== FAQ 区域 ==================== */
.faq-section {
    position: relative;
    z-index: 1;
    background: var(--bg-primary);
    padding: 60px 0;
    border-top: 1px solid var(--border-color);
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-item summary {
    padding: 20px 24px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
    list-style: none;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 24px;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item summary:hover {
    color: var(--primary-light);
    background: var(--bg-hover);
}

.faq-answer {
    padding: 0 24px 24px;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-answer p {
    margin-bottom: 12px;
}

.faq-answer ul,
.faq-answer ol {
    margin: 12px 0;
    padding-left: 24px;
}

.faq-answer li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.faq-answer strong {
    color: var(--primary-light);
    font-weight: 600;
}

/* ==================== 关于区域 ==================== */
.about-section {
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 60px 0;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content h2 {
    font-size: 32px;
    margin-bottom: 24px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 16px;
}

.disclaimer {
    margin-top: 32px;
    padding: 24px;
    background: rgba(245, 87, 108, 0.1);
    border-left: 4px solid #f5576c;
    border-radius: 8px;
}

.disclaimer strong {
    display: block;
    margin-bottom: 12px;
    color: #f5576c;
}

.disclaimer ul {
    list-style: none;
    padding-left: 0;
}

.disclaimer li {
    padding: 6px 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 24px;
}

.disclaimer li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: #f5576c;
}

/* ==================== 页脚 ==================== */
.footer {
    position: relative;
    z-index: 1;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 32px 0;
    text-align: center;
    color: var(--text-muted);
}

/* ==================== Toast 提示 ==================== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--primary);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast svg {
    color: #10b981;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero {
        padding: 48px 0 40px;
    }

    .cards-section {
        grid-template-columns: 1fr;
    }

    .nav {
        gap: 12px;
    }

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

    .logo {
        font-size: 18px;
    }

    .filter-chips {
        gap: 8px;
    }

    .chip {
        padding: 8px 16px;
        font-size: 13px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tutorial-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .card {
        padding: 20px;
    }

    .code-box {
        flex-direction: column;
    }

    .copy-btn {
        width: 100%;
        justify-content: center;
    }
}