/* ===== 稚梦科技 全站公共样式（common.js 配套） ===== */
:root {
    --nav-bg: rgba(247,93,29,0.5);
    --nav-font-family: "";
    --nav-font-size: 16px;
    --nav-font-color: #AEAEB2;
    --nav-hover-color: #6A6A6F;
    --nav-active-color: #1D1D1F;
    --nav-line-color: #FFC53D;
    --primary-color: #0071E3;
    --page-bg: linear-gradient(180deg, #FFFFFF 0%, #F5F5F7 100%);
    --footer-bottom-font-size: 11px;
    --footer-bottom-font-color: #AEAEB2;
    --carousel-title-font-size: 15px;
    --carousel-title-font-color: #1D1D1F;
    --carousel-sub-font-size: 12px;
    --carousel-sub-font-color: #86868B;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
/* 思源黑体（Noto Sans SC）自托管——公共元素管理可选 */
@font-face {
    font-family: 'Noto Sans SC';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url(fonts/noto-sans-sc-400.woff2) format('woff2');
}
@font-face {
    font-family: 'Noto Sans SC';
    font-style: normal;
    font-display: swap;
    font-weight: 700;
    src: url(fonts/noto-sans-sc-700.woff2) format('woff2');
}
body {
    font-family: var(--font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif);
    color: #1D1D1F;
    /* 全站浅色像素网格背景（网格前端固定；底色/渐变后台 page_bg 可配，JS分流颜色/渐变） */
    background-color: var(--page-bg-color, #F5F6F8);
    background-image:
        linear-gradient(rgba(30, 32, 48, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 32, 48, 0.035) 1px, transparent 1px),
        var(--page-bg-img, transparent);
    background-size: 32px 32px, 32px 32px, auto;
    background-attachment: fixed, fixed, fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== 顶部固定导航 ===== */
.topnav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    height: 62px;
}
.nav-inner {
    width: 60%;
    margin: 0 auto;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
.nav-brand img {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: block;
}
.nav-brand .text { display: flex; flex-direction: column; justify-content: center; }
.nav-brand .name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #1D1D1F;
    line-height: 1.2;
}
.nav-brand .slogan {
    font-size: 10px;
    color: #86868B;
    letter-spacing: 1.5px;
    line-height: 1.3;
}
.nav-menu {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 24px;
}
/* 一级菜单（文字 tab 样式，与首页标签一致：灰/选中黑+黄下划线动画/悬停加深） */
.menu-item {
    position: relative;
    display: inline-block;
    padding: 6px 4px;
    font-family: var(--nav-font-family);
    font-size: var(--nav-font-size, 16px);
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--nav-font-color, #AEAEB2);
    cursor: pointer;
    transition: color 0.25s;
    user-select: none;
    white-space: nowrap;
    text-decoration: none;
}
.menu-item .ico { display: none; }
.menu-item:hover { color: var(--nav-hover-color, #6A6A6F); }
.menu-item.active { color: var(--nav-active-color, #1D1D1F); }
/* 黄色下划线：选中时左→右增长（宽=文字+左右各3px） */
.menu-item::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 0;
    height: 3px;
    background: var(--nav-line-color, #FFC53D);
    transform: translateX(-50%);
    transition: width 0.35s ease-out;
}
.menu-item.active::after { width: calc(100% + 6px); animation: nav-line-grow 0.35s ease-out; }
/* 页面加载时下划线生长动画（仅播放一次，无持续开销） */
@keyframes nav-line-grow {
    from { width: 0; }
    to { width: calc(100% + 6px); }
}

/* ===== 内容区（左右各 20% 留白） ===== */
.main {
    flex: 1;
    padding: 96px 0 40px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
}
.main-inner {
    width: 60%;
    margin: 0 auto;
    animation: fadeIn 0.35s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 空态占位 ===== */
.empty {
    text-align: center;
    padding: 120px 20px;
    color: #AEAEB2;
}
.empty .e-ico { font-size: 44px; margin-bottom: 14px; opacity: 0.5; }
.empty .e-text { font-size: 14px; letter-spacing: 1px; }

/* ===== 页面简介位 v2：3D 旋转木马橱窗（所有一级页面共有，后台可配置） ===== */
.hero {
    padding-top: 0;
    display: flex;
    flex-direction: column;
}

/* 木马展示区（高度保持 40vh≈460px，卡片在区内占高 92%） */
.carousel-wrap {
    position: relative;
    height: 40vh;
    min-height: 260px;
    overflow: hidden;
    margin-bottom: 25px;
}
.carousel-track {
    position: absolute;
    inset: 0;
}
.carousel-card {
    position: absolute;
    left: 50%;
    top: 4%;
    width: 360px;
    margin-left: -180px;
    height: 90%;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border: 1px solid rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.35, 1), opacity 0.6s ease, box-shadow 0.3s;
    will-change: transform;
}
.carousel-card:hover { box-shadow: 0 10px 26px rgba(0,0,0,0.2); }
.carousel-card.no-link { cursor: default; }
.cc-img {
    height: 70%;
    background: linear-gradient(160deg, #F0F0F2, #E3E3E8);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.cc-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cc-img .ph {
    color: #C7C7CC;
    font-size: 13px;
    letter-spacing: 2px;
    text-align: center;
}
.cc-body {
    height: 30%;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}
.cc-title {
    font-size: var(--carousel-title-font-size);
    font-weight: 700;
    color: var(--carousel-title-font-color);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cc-sub {
    font-size: var(--carousel-sub-font-size);
    color: var(--carousel-sub-font-color);
    line-height: 1.5;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 分隔线（木马区下方 25px 空位处） */
.hero .h-divider {
    width: 100%;
    border-top: 1px solid rgba(0,0,0,0.08);
    margin: 0 0 18px;
}

/* 标签栏（分隔线下方，左对齐；只筛选下方内容区；下方留 24px 与内容区分隔） */
.hero .h-tags {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.hero .h-tag {
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 13px;
    color: #4A4A4F;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.hero .h-tag:hover { border-color: var(--primary-color); color: var(--primary-color); }
.hero .h-tag.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 木马无卡片时的空态 */
.carousel-empty {
    height: 40vh;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #C7C7CC;
    font-size: 14px;
    letter-spacing: 2px;
}

/* ===== 底部页脚（内容限制在中间 60%，与导航一致） ===== */
.footer {
    position: static;
    margin-top: 40px;
    /* 与页面背景融合：不设独立背景（透明透出网格），细分隔线分隔 */
    background: transparent;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.footer-inner {
    width: 60%;
    margin: 0 auto;
}
.footer-bottom {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 0 18px;
    font-size: var(--footer-bottom-font-size);
    color: var(--footer-bottom-font-color);
    white-space: nowrap;
    flex-wrap: nowrap;
}
.footer-bottom a {
    color: var(--footer-bottom-font-color);
    text-decoration: none;
}
.footer-bottom a:hover { color: #86868B; }
.footer-bottom img {
    width: 12px;
    height: auto;
    vertical-align: middle;
    margin-right: 3px;
}
.icp { display: none; }

/* ===== 手机适配 ===== */
@media (max-width: 768px) {
    .topnav {
        height: auto;
        min-height: 62px;
    }
    .nav-inner {
        width: 100%;
        padding: 8px 14px 0;
        flex-wrap: wrap;
        height: auto;
        gap: 4px;
    }
    .nav-brand img { width: 30px; height: 30px; border-radius: 8px; }
    .nav-brand .name { font-size: 15px; }
    .nav-brand .slogan { display: none; }
    .nav-menu {
        position: static;
        transform: none;
        width: 100%;
        justify-content: center;
        gap: 16px;
        padding-bottom: 10px;
    }
    .menu-item {
        flex-direction: row;
        gap: 0;
        padding: 4px 2px;
        font-size: 14px;
        letter-spacing: 1px;
        flex: none;
        justify-content: center;
    }
    .menu-item::after { bottom: -3px; height: 2px; }
    .main { padding: 130px 14px 60px; }
    .main-inner { width: 100%; }
    .hero-body { flex-direction: column; gap: 16px; }
    .h-left { width: 100%; }
    .h-right { width: 100%; }
    .hero .h-tags { margin-top: 0; padding-top: 0; }
    /* 手机端木马：高度压缩、卡片缩小 */
    .carousel-wrap { height: 38vh; min-height: 260px; margin-bottom: 20px; }
    .carousel-card { width: 200px; margin-left: -100px; height: 82%; }
    .carousel-empty { height: 38vh; min-height: 260px; }
    .footer-inner { width: 100%; padding: 0 14px; }
    .footer-bottom { flex-wrap: wrap; white-space: normal; gap: 8px 14px; padding: 12px 0 20px; }
}
