*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

::selection { background: rgba(192,200,208,0.3); color: #C0C8D0; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #2B3138; }
::-webkit-scrollbar-thumb { background: #555B63; border-radius: 2px; }

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400&display=swap');

/* 拼木·榫卯咬合翻页风格 */
.fw-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, #E8DCC8 0%, #D4C4A8 50%, #C4B49C 100%);
    background-attachment: fixed;
    color: #5C3D2E;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 木纹年轮纹理 */
.fw-body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        repeating-radial-gradient(circle at 20% 30%, transparent, transparent 10px, rgba(92,61,46,0.03) 10px, rgba(92,61,46,0.03) 11px),
        repeating-radial-gradient(circle at 80% 70%, transparent, transparent 15px, rgba(92,61,46,0.02) 15px, rgba(92,61,46,0.02) 16px),
        repeating-linear-gradient(90deg, transparent, transparent 100px, rgba(92,61,46,0.02) 100px, rgba(92,61,46,0.02) 101px);
    pointer-events: none;
    z-index: 0;
}

/* ===== Hero 2×2榫卯拼图 ===== */
.fw-hero-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 0;
    max-height: 221px;
    overflow: hidden;
    position: relative;
}

.fw-hero-stack {
    position: relative;
    width: 100%;
    max-width: 440px;
    height: 200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0;
    padding: 2px;
}

/* 榫卯构件块 */
.fw-stack-card {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
    /* 木制效果 */
    background: linear-gradient(135deg, #D4C4A8 0%, #C4B49C 50%, #B0A088 100%);
    border: 2px solid #8B7355;
    box-shadow:
        inset 0 0 20px rgba(92,61,46,0.1),
        inset 0 0 0 1px rgba(92,61,46,0.05),
        0 4px 8px rgba(92,61,46,0.2);
    overflow: hidden;
    /* 边缘倒角 */
    clip-path: polygon(
        4px 0%, calc(100% - 4px) 0%, 100% 4px,
        100% calc(100% - 4px), calc(100% - 4px) 100%,
        4px 100%, 0% calc(100% - 4px), 0% 4px
    );
}

/* 木纹纹理 */
.fw-stack-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        repeating-linear-gradient(90deg,
            transparent, transparent 3px,
            rgba(92,61,46,0.05) 3px,
            rgba(92,61,46,0.05) 4px);
    pointer-events: none;
    z-index: 2;
}

/* 榫头和卯眼标记 */
.fw-stack-card::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 6px;
    background: linear-gradient(180deg, #8B7355, #5C3D2E);
    border: 1px solid #3D2914;
    z-index: 3;
    pointer-events: none;
}

/* 不同位置的榫卯标记 */
.fw-stack-card:nth-child(1)::after {
    top: 0; left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.fw-stack-card:nth-child(2)::after {
    bottom: 0; left: 50%;
    transform: translate(-50%, 50%);
    border-radius: 2px;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
}

.fw-stack-card:nth-child(3)::after {
    top: 50%; right: 0;
    transform: translate(50%, -50%);
    border-radius: 2px;
    box-shadow: -2px 0 4px rgba(0,0,0,0.3);
}

.fw-stack-card:nth-child(4)::after {
    top: 50%; left: 0;
    transform: translate(-50%, -50%);
    border-radius: 2px;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

/* 木块激活状态 */
.fw-stack-card.active {
    z-index: 10 !important;
    background: linear-gradient(135deg, #C4B49C 0%, #B0A088 50%, #9A8A70 100%);
    border-color: #5C3D2E;
    box-shadow:
        inset 0 0 30px rgba(92,61,46,0.15),
        0 8px 16px rgba(92,61,46,0.3),
        0 0 0 2px rgba(92,61,46,0.1);
    transform: scale(1.02);
}

/* 榫卯抽出动画 */
@keyframes woodSlide {
    0% { transform: translate(0, 0); }
    50% { transform: translate(var(--slide-x, 10px), var(--slide-y, 10px)); }
    100% { transform: translate(0, 0); }
}

.fw-stack-card.slide-animation {
    animation: woodSlide 0.5s ease-in-out;
}

/* 咔嗒咬合动画 */
@keyframes woodClick {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.98); }
}

.fw-stack-card.click-animation {
    animation: woodClick 0.15s ease-in-out;
}

.fw-stack-card-link {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    text-decoration: none;
}

/* 游戏图标显示 */
.fw-stack-card-thumb {
    position: absolute;
    top: 8px; left: 8px; right: 8px; bottom: 36px;
    overflow: hidden;
    z-index: 1;
    border-radius: 0;
    opacity: 0.85;
}

.fw-stack-card-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: brightness(0.95) saturate(0.85) sepia(0.1);
    transition: filter 0.3s;
}

.fw-stack-card.active .fw-stack-card-thumb img {
    filter: brightness(1.0) saturate(0.9) sepia(0.05);
}

/* 闪烁光斑效果 */
.fw-stack-card .bubble-highlight {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 30% 30%,
        rgba(232,220,200,0.15),
        transparent 50%);
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.3s;
}

.fw-stack-card:hover .bubble-highlight {
    opacity: 1;
}

.fw-stack-card-info {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    text-align: center;
    padding: 4px 8px;
    z-index: 5;
    background: linear-gradient(transparent, rgba(92,61,46,0.1));
}

/* 标题 - 粗体仿木刻字体 */
.fw-stack-card-title {
    font-family: 'Inter', 'ZCOOL XiaoWei', sans-serif;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    color: #5C3D2E;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 0 rgba(232,220,200,0.8);
    letter-spacing: 0.5px;
}

.fw-stack-card.active .fw-stack-card-title {
    font-size: 12px;
    letter-spacing: 0.8px;
}

.fw-stack-card-type {
    display: none;
}

.fw-stack-card-color-bar {
    display: none;
}

.fw-stack-card-tentacle {
    display: none;
}

.fw-hero-silk {
    display: none;
}

/* 木屑粒子 */
.fw-hero-particle {
    display: none;
}

/* ===== Categories (长方形榫卯标记) ===== */
.fw-categories-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px 0;
}

.fw-categories-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.fw-categories-scroll::-webkit-scrollbar { height: 2px; }
.fw-categories-scroll::-webkit-scrollbar-thumb { background: rgba(92,61,46,0.3); border-radius: 1px; }
.fw-categories-scroll::-webkit-scrollbar-track { background: rgba(92,61,46,0.1); }

.fw-category-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 36px;
    background: linear-gradient(180deg, #D4C4A8, #C4B49C);
    border: 2px solid #8B7355;
    border-radius: 0;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
    position: relative;
    flex-shrink: 0;
    /* 榫卯标记效果 */
    box-shadow:
        inset 0 -3px 0 rgba(92,61,46,0.2),
        0 2px 4px rgba(92,61,46,0.15);
    padding: 0 16px;
}

/* 凸起的小矩形标记 */
.fw-category-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 8px;
    width: 8px;
    height: 4px;
    background: linear-gradient(180deg, #8B7355, #5C3D2E);
    transform: translateY(-50%);
    border-radius: 1px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.fw-cat-line {
    display: none;
}

.fw-cat-label {
    font-size: 11px;
    color: #5C3D2E;
    letter-spacing: 0.5px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

.fw-category-item:hover {
    background: linear-gradient(180deg, #C4B49C, #B0A088);
    border-color: #5C3D2E;
    transform: translateY(-2px);
    box-shadow:
        inset 0 -3px 0 rgba(92,61,46,0.3),
        0 4px 8px rgba(92,61,46,0.25);
}

.fw-category-item:hover .fw-cat-label {
    color: #3D2914;
}

/* ===== Main ===== */
.fw-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ===== Section ===== */
.fw-sector {
    margin-top: 28px;
}

.fw-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    background: linear-gradient(180deg, #D4C4A8, #C4B49C);
    border: 2px solid #8B7355;
    border-radius: 0;
    transition: all 0.3s;
}

.fw-section-header:hover {
    background: linear-gradient(180deg, #C4B49C, #B0A088);
    border-color: #5C3D2E;
}

.fw-section-line {
    width: 8px;
    height: 8px;
    background: #5C3D2E;
    border-radius: 0;
    transition: all 0.4s;
    flex-shrink: 0;
}

.fw-sector.open .fw-section-line {
    width: 12px;
    height: 12px;
    background: #3D2914;
    box-shadow: 0 0 8px rgba(92,61,46,0.4);
}

/* 标题 - 粗体仿木刻字体 */
.fw-section-title {
    font-family: 'Inter', 'ZCOOL XiaoWei', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #5C3D2E;
    letter-spacing: 2px;
    text-shadow: 0 1px 0 rgba(232,220,200,0.8);
    position: relative;
    display: inline-block;
}

.fw-section-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.fw-section-more {
    font-size: 12px;
    color: rgba(92,61,46,0.7);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 600;
}

.fw-section-more:hover { color: #3D2914; }

.fw-section-arrow {
    font-size: 10px;
    color: rgba(92,61,46,0.7);
    transition: transform 0.3s;
}

.fw-sector.open .fw-section-arrow { transform: rotate(180deg); }

.fw-section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fw-sector.open .fw-section-content {
    max-height: 20000px;
}

/* ===== Game Grid ===== */
.fw-games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px 0;
}

.fw-game-card {
    background: linear-gradient(180deg, #E8DCC8, #D4C4A8);
    border: 2px solid #B0956A;
    border-radius: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.fw-game-card:hover {
    background: linear-gradient(180deg, #D4C4A8, #C4B49C);
    border-color: #8B7355;
    box-shadow: 0 4px 12px rgba(92,61,46,0.2);
    transform: translateY(-2px);
}

.fw-game-card:active {
    transform: translateY(0);
}

.fw-card-link {
    display: block;
    text-decoration: none;
    color: #5C3D2E;
}

.fw-card-image {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
    border-radius: 0;
    position: relative;
}

.fw-card-image::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(45deg,
        transparent 0%,
        rgba(232,220,200,0.1) 30%,
        transparent 50%);
    pointer-events: none;
}

.fw-card-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: brightness(0.95) saturate(0.85) sepia(0.1);
    transition: filter 0.3s, transform 0.3s;
}

.fw-game-card:hover .fw-card-image img {
    filter: brightness(1.0) saturate(0.9) sepia(0.05);
    transform: scale(1.02);
}

.fw-card-info {
    padding: 10px 12px;
}

.fw-card-title {
    font-family: 'Inter', 'ZCOOL XiaoWei', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #5C3D2E;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
}

/* ===== Footer (三个木工凿子) ===== */
.fw-footer {
    background: linear-gradient(180deg, #C4B49C 0%, #B0A088 100%);
    border-top: 3px solid #8B7355;
    padding: 48px 20px 24px;
    margin-top: 48px;
    position: relative;
    z-index: 1;
}

.fw-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    position: relative;
    z-index: 1;
}

.fw-footer-heading {
    font-family: 'Inter', 'ZCOOL XiaoWei', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #5C3D2E;
    margin-bottom: 14px;
    letter-spacing: 2px;
    text-shadow: 0 1px 0 rgba(232,220,200,0.8);
}

.fw-footer-desc {
    color: rgba(92,61,46,0.8);
    font-size: 13px;
    line-height: 1.7;
    font-weight: 400;
}

.fw-footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fw-footer-links a {
    color: rgba(92,61,46,0.7);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s;
    cursor: pointer;
    font-weight: 400;
}

.fw-footer-links a:hover {
    color: #3D2914;
}

/* 三个木工凿子 */
.fw-footer-jellyfish {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 32px;
    padding-top: 8px;
}

/* 凿子样式 */
.fw-jellyfish {
    position: relative;
    width: 8px;
    height: 50px;
    cursor: pointer;
    animation: chiselGlow 2s ease-in-out infinite;
}

/* 凿子柄(木质) */
.fw-jellyfish::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 30px;
    background: linear-gradient(180deg,
        #B0956A 0%,
        #8B7355 50%,
        #5C3D2E 100%);
    border-radius: 2px;
    box-shadow:
        inset 2px 0 0 rgba(232,220,200,0.3),
        inset -2px 0 0 rgba(0,0,0,0.2);
}

/* 凿子尖端(金属) */
.fw-jellyfish::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 20px;
    background: linear-gradient(180deg,
        #D4C4A8 0%,
        #A89070 50%,
        #8B7355 100%);
    clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
}

/* 木屑光影 */
.fw-jellyfish-dome {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 4px;
    background: radial-gradient(ellipse,
        rgba(176,149,106,0.4),
        transparent);
    border-radius: 50%;
}

/* 闪烁光点 */
.fw-jellyfish-glow {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: rgba(232,220,200,0.8);
    border-radius: 50%;
    animation: chiselSparkle 1.5s ease-in-out infinite;
}

/* 木屑粒子 */
.fw-jellyfish-tentacles {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
}

.fw-jellyfish-tentacle {
    width: 1px;
    height: 8px;
    background: linear-gradient(to bottom,
        rgba(176,149,106,0.6),
        transparent);
    animation: woodShavings 2s ease-in-out infinite;
}

.fw-jellyfish-tentacle:nth-child(1) { animation-delay: 0s; height: 6px; transform: rotate(-15deg); }
.fw-jellyfish-tentacle:nth-child(2) { animation-delay: 0.2s; height: 10px; transform: rotate(0deg); }
.fw-jellyfish-tentacle:nth-child(3) { animation-delay: 0.1s; height: 7px; transform: rotate(15deg); }
.fw-jellyfish-tentacle:nth-child(4) { animation-delay: 0.3s; height: 9px; transform: rotate(-8deg); }
.fw-jellyfish-tentacle:nth-child(5) { animation-delay: 0.15s; height: 11px; transform: rotate(8deg); }

@keyframes chiselGlow {
    0%, 100% {
        filter: brightness(1);
        transform: rotate(0deg);
    }
    50% {
        filter: brightness(1.1);
        transform: rotate(1deg);
    }
}

@keyframes chiselSparkle {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
    50% { opacity: 1; transform: translateX(-50%) scale(1.3); }
}

@keyframes woodShavings {
    0%, 100% { opacity: 0.4; transform: translateY(0) rotate(inherit); }
    50% { opacity: 0.8; transform: translateY(-2px) rotate(inherit); }
}

/* 顺序闪烁 - 不同凿子 */
.fw-jellyfish:nth-child(1) { animation-delay: 0s; }
.fw-jellyfish:nth-child(2) { animation-delay: 0.5s; }
.fw-jellyfish:nth-child(3) { animation-delay: 1s; }

.fw-footer-current {
    display: none;
}

.fw-footer-bottom {
    max-width: 1200px;
    margin: 28px auto 0;
    padding-top: 20px;
    border-top: 2px solid rgba(139,115,85,0.3);
    text-align: center;
    position: relative;
    z-index: 1;
}

.fw-footer-bottom p {
    color: rgba(92,61,46,0.7);
    font-size: 13px;
    font-weight: 400;
}

/* ===== Mobile Bottom Nav ===== */
.fw-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, #C4B49C 0%, #B0A088 100%);
    backdrop-filter: blur(12px);
    border-top: 2px solid #8B7355;
    z-index: 100;
    padding: 8px 0;
}

.fw-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: rgba(92,61,46,0.7);
    font-size: 10px;
    font-weight: 600;
    transition: color 0.3s;
}

.fw-bottom-nav a:hover { color: #3D2914; }
.fw-bottom-nav-icon { font-size: 16px; }
.fw-bottom-nav-active {
    color: #3D2914 !important;
    text-shadow: 0 0 6px rgba(92,61,46,0.4);
}

/* ===== Detail Page ===== */
.fw-detail-header {
    background: linear-gradient(180deg, #C4B49C, #B0A088);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid #8B7355;
    padding: 16px 20px;
}

.fw-back-btn {
    font-size: 13px;
    font-weight: 600;
    color: rgba(92,61,46,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.fw-back-btn:hover { color: #3D2914; }

.fw-detail-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px;
    position: relative;
    z-index: 1;
}

.fw-detail-image {
    width: 100%;
    max-width: 350px;
    margin: 24px auto;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    border: 3px solid #8B7355;
    box-shadow: 0 4px 20px rgba(92,61,46,0.2);
}

.fw-detail-image::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(45deg,
        transparent 0%,
        rgba(232,220,200,0.1) 30%,
        transparent 50%);
    pointer-events: none;
}

.fw-detail-info {
    text-align: center;
    padding: 0 16px;
}

.fw-detail-title {
    font-family: 'Inter', 'ZCOOL XiaoWei', sans-serif;
    font-size: 28px;
    font-weight: 600;
    color: #5C3D2E;
    letter-spacing: 2px;
    margin-bottom: 16px;
    text-shadow: 0 1px 0 rgba(232,220,200,0.8);
    position: relative;
    display: inline-block;
}

.fw-detail-desc {
    font-family: 'Inter', 'ZCOOL XiaoWei', sans-serif;
    font-size: 15px;
    color: rgba(92,61,46,0.8);
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

.fw-detail-play {
    text-align: center;
    margin: 24px 0;
}

.fw-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, #D4C4A8, #C4B49C);
    border: 3px solid #8B7355;
    color: #5C3D2E;
    font-family: 'Inter', 'ZCOOL XiaoWei', sans-serif;
    font-size: 18px;
    font-weight: 600;
    padding: 14px 32px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 1px 0 rgba(232,220,200,0.8);
    box-shadow: 0 4px 16px rgba(92,61,46,0.2);
}

.fw-play-btn:hover {
    background: linear-gradient(180deg, #C4B49C, #B0A088);
    border-color: #5C3D2E;
    transform: scale(1.02);
}

.fw-play-btn:active {
    transform: scale(0.98);
}

.fw-game-container {
    max-width: 900px;
    margin: 24px auto;
    aspect-ratio: 4/3;
    border-radius: 0;
    border: 2px solid #8B7355;
    background: rgba(92,61,46,0.05);
    box-shadow: 0 8px 40px rgba(92,61,46,0.15);
    overflow: hidden;
}

/* ===== Detail Page - Related Games ===== */
.fw-detail-related {
    max-width: 900px;
    margin: 32px auto 0;
    padding: 0 20px;
}

.fw-detail-related .fw-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #5C3D2E;
    letter-spacing: 2px;
    margin-bottom: 16px;
    text-align: center;
}

.fw-related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.fw-related-card {
    opacity: 1;
    transform: none;
}