/* ========================================
   FreeTu 首页样式 - 游戏风暗色主题
   ======================================== */

/* ===== 首页主内容区覆盖 ===== */
.home-page {
    padding: 0 !important;
}

/* ===== Hero Banner ===== */
.home-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    min-height: 570px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0 0 20px 20px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.35) saturate(1.2);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(10, 10, 10, 0.3) 0%,
        rgba(10, 10, 10, 0.5) 50%,
        rgba(10, 10, 10, 0.95) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 60px 24px 50px;
    max-width: 760px;
    width: 100%;
}

.hero-title {
    font-family: var(--font-cn);
    font-size: 36px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 20px rgba(59, 130, 246, 0.3);
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}

/* ===== Styleframe 风格 3D 卡片墙 ===== */
.coverflow-section {
    padding: 80px 0 100px;
    overflow: hidden;
    position: relative;
    background: transparent;
}
.coverflow-section .section-title {
    text-align: center;
    margin-bottom: 24px;
    font-size: 18px;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.coverflow-stage {
    width: 100%;
    height: 480px;
    position: relative;
    cursor: grab;
    user-select: none;
    display: flex;
    align-items: center;
    perspective: 1600px;
    perspective-origin: center center;
}
.coverflow-stage:active { cursor: grabbing; }

/* 卡片轨道（横向滚动容器 + 3D 透视） */
.coverflow-track {
    display: flex;
    gap: 0;
    white-space: nowrap;
    will-change: transform;
    transition: transform 0.05s linear;
    transform-style: preserve-3d;
    position: relative;
    left: 50%;
    transform: translateX(0);
}
.coverflow-card {
    flex-shrink: 0;
    width: 280px;
    height: 380px;
    margin-right: -60px;  /* 更紧密的叠压 */
    border-radius: 12px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: #111;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                margin-right 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                z-index 0s linear 0.45s;
    z-index: 1;
    transform: rotateY(-35deg) translateZ(50px);
    filter: brightness(0.45);
    border: 1px solid rgba(255,255,255,0.04);
}
.coverflow-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.coverflow-card:hover img {
    transform: scale(1.05);
}
.coverflow-card:hover {
    z-index: 10 !important;
    transform: rotateY(0deg) translateZ(160px) scale(1.08) !important;
    filter: brightness(1.1) !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 4px 20px rgba(99,102,241,0.2);
    border-color: rgba(99,102,241,0.3);
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                z-index 0s linear 0s;
}

/* 悬停遮罩 */
.coverflow-card .cf-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}
.coverflow-card:hover .cf-overlay { opacity: 1; }

.coverflow-card .cf-label {
    position: absolute;
    bottom: 16px;
    left: 20px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.35s;
}
.coverflow-card:hover .cf-label { opacity: 1; }

/* 左右箭头 */
.coverflow-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    font-size: 18px;
    cursor: pointer;
    z-index: 20;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
}
.coverflow-arrow:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.coverflow-arrow.left { left: 12px; }
.coverflow-arrow.right { right: 12px; }

@media (max-width: 768px) {
    .coverflow-stage { height: 340px; }
    .coverflow-card { width: 200px; height: 280px; margin-right: -20px; }
    .coverflow-card:hover { margin-right: 10px !important; }
}

.hero-search {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 8px 16px;
    max-width: 720px;
    margin: 0 auto 20px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.hero-search:focus-within {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero-search svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.hero-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-size: 15px;
    font-family: var(--font-cn);
}

.hero-search input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.hero-search-btn {
    flex-shrink: 0;
    padding: 8px 24px;
    background: var(--accent);
    border: none;
    border-radius: 999px;
    color: white;
    font-family: var(--font-cn);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hero-search-btn:hover {
    background: var(--accent-hover);
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.hero-tag {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    font-family: var(--font-cn);
    transition: all 0.3s;
}

.hero-tag:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

/* ===== 通用 Section ===== */
.home-section {
    padding: 40px 32px 0;
}
.home-section + .home-section {
    padding-top: 120px;
}
.home-features + .home-section {
    padding-top: 120px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.section-title {
    font-size: 24px;
    font-weight: 400;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.3px;
}

.section-title svg {
    color: var(--accent);
}

.section-badge {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    font-family: var(--font-en);
}

.section-more {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-family: var(--font-cn);
}

.section-more:hover {
    color: var(--accent);
}

/* ===== 图片网格 ===== */
.home-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.home-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s, border-color 0.4s;
    aspect-ratio: 1 / 1;
    group: true;
}

.home-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    border-color: var(--border-light);
    z-index: 2;
}

.home-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.home-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.home-card:hover .home-card-overlay {
    opacity: 1;
}

.home-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.home-card-tag {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 12px;
    padding: 4px 13px;
    border-radius: 24px;
    white-space: nowrap;
    backdrop-filter: blur(6px);
}

/* 顶部标签 - 左上角 */
.home-card-labels {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    z-index: 2;
}

/* ===== 精选图片特殊布局（8张图，5列2行） ===== */
.home-grid-featured {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

/* 第一行第一张大图：跨2列 */
.home-grid-featured .home-card:nth-child(1) {
    grid-column: span 2;
    aspect-ratio: 2 / 1;
}

/* 第二行最后一张大图：跨2列 */
.home-grid-featured .home-card:nth-child(8) {
    grid-column: span 2;
    aspect-ratio: 2 / 1;
}

/* 精选网格中其余卡片保持 1:1 */
.home-grid-featured .home-card:nth-child(n+2):nth-child(-n+7) {
    grid-column: span 1;
    aspect-ratio: 1 / 1;
}

/* ===== 浏览器插件 ===== */
.home-plugin-section {
    margin-top: 12px;
    padding-bottom: 80px;
}

.browse-more-btn {
    display: inline-block;
    padding: 10px 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.browse-more-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.plugin-promo {
    display: flex;
    gap: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    position: relative;
    overflow: hidden;
}

.plugin-promo::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

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

.plugin-promo-info h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.plugin-promo-info p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.plugin-promo-browsers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.browser-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.browser-badge img {
    width: 16px;
    height: 16px;
}

.plugin-promo-actions {
    display: flex;
    gap: 12px;
}

.plugin-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-cn);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.plugin-btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.plugin-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 22px;
    font-size: 14px;
    font-family: var(--font-cn);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.plugin-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.plugin-promo-visual {
    flex-shrink: 0;
    width: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plugin-promo-visual svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.3));
}

/* ===== 页脚（使用全局 .site-footer 样式） ===== */

/* ===== 功能介绍模块 ===== */
.home-features {
    padding: 40px 32px 0;
    animation: fadeSlideIn 0.6s ease-out 0.15s both;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 8px;
}

/* 单个功能卡片 */
.feature-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 36px 28px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-color 0.35s ease,
                box-shadow 0.35s ease,
                background 0.35s ease;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.feature-card:nth-child(1)::before {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
}
.feature-card:nth-child(2)::before {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
}
.feature-card:nth-child(3)::before {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, transparent 70%);
}
.feature-card:nth-child(4)::before {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
}

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

.feature-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.06);
    background: var(--bg-card-hover);
}

/* 图标容器 */
.feature-icon {
    position: relative;
    z-index: 1;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.feature-card:hover .feature-icon {
    transform: scale(1.08);
}

.feature-icon-explore {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}
.feature-icon-gallery {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}
.feature-icon-create {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}
.feature-icon-image {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

/* 标题 */
.feature-title {
    position: relative;
    z-index: 1;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-family: var(--font-cn);
    letter-spacing: -0.2px;
}

/* 描述 */
.feature-desc {
    position: relative;
    z-index: 1;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 0;
    font-family: var(--font-cn);
}

/* 箭头 */
.feature-arrow {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 48px;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-arrow {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateX(3px);
}

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
    .home-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .home-grid-featured {
        grid-template-columns: repeat(4, 1fr);
    }
    .home-grid-featured .home-card:nth-child(1) {
        grid-column: span 2;
    }
    .home-grid-featured .home-card:nth-child(8) {
        grid-column: span 2;
    }
}

@media (max-width: 900px) {
    .home-hero {
        min-height: 360px;
    }
    .hero-title {
        font-size: 28px;
    }
    .plugin-promo {
        flex-direction: column;
        padding: 24px;
    }
    .plugin-promo-visual {
        width: 100%;
        max-width: 260px;
        margin: 0 auto;
    }
    .home-section {
        padding: 32px 20px 0;
    }
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .feature-card {
        padding: 28px 22px 24px;
    }
    .home-features {
        padding: 56px 20px 0;
    }
}

@media (max-width: 640px) {
    .home-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .home-grid-featured {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .home-grid-featured .home-card:nth-child(1),
    .home-grid-featured .home-card:nth-child(8) {
        grid-column: span 2;
    }
    .hero-title {
        font-size: 24px;
    }
    .hero-subtitle {
        font-size: 13px;
    }
    .hero-content {
        padding: 40px 16px 36px;
    }
    .home-section {
        padding: 28px 14px 0;
    }
    .plugin-promo {
        padding: 18px;
        gap: 20px;
    }
    .plugin-promo-browsers {
        gap: 6px;
    }
    .browser-badge {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* ===== 加载动画 ===== */
.home-card-loading {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
}

.home-card-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    animation: shimmer 1.5s infinite;
}

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

/* ===== 淡入动画 ===== */
.home-card {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.home-card:nth-child(1) { animation-delay: 0.05s; }
.home-card:nth-child(2) { animation-delay: 0.1s; }
.home-card:nth-child(3) { animation-delay: 0.15s; }
.home-card:nth-child(4) { animation-delay: 0.2s; }
.home-card:nth-child(5) { animation-delay: 0.25s; }
.home-card:nth-child(6) { animation-delay: 0.3s; }
.home-card:nth-child(7) { animation-delay: 0.35s; }
.home-card:nth-child(8) { animation-delay: 0.4s; }

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