/* 全局自定义样式（所有主题共享） */

/*
* 字体引入
* 阿里巴巴普惠体 3.0（55 Regular）：按 woff2 → woff → ttf 顺序加载
*/
@font-face {
    font-family: "Alibaba PuHuiTi 3.0"; /* 字体族名称，供全局变量引用 */
    src: url("../fonts/AlibabaPuHuiTi-3-55-Regular.woff2") format("woff2"), /* 优先加载体积最小的 woff2 */
        url("../fonts/AlibabaPuHuiTi-3-55-Regular.woff") format("woff"), /* 不支持 woff2 时回退 woff */
        url("../fonts/AlibabaPuHuiTi-3-55-Regular.ttf") format("truetype"); /* 最后回退 ttf */
    font-weight: 400; /* 当前仅提供常规字重 */
    font-style: normal; /* 常规字形 */
    font-display: swap; /* 字体加载期间先用回退字体显示，避免文字空白 */
}

/* 全局 CSS 变量 */
:root {
    --site-font: "Alibaba PuHuiTi 3.0", sans-serif; /* 全站字体，未加载成功时回退无衬线字体 */
    --site-color-bg: #ffffff; /* 页面背景色 */
    --site-color-text: #1f2937; /* 主文字颜色 */
    --site-color-muted: #6b7280; /* 次要文字颜色 */
    --site-color-primary: #2563eb; /* 主题强调色（链接等） */
    --site-color-border: #e5e7eb; /* 边框颜色 */
    --site-radius: 6px; /* 通用圆角 */
    --site-space: 1rem; /* 通用间距基准 */
    --site-font-size: 14px; /* 全站基础字号 */
}

/*
* 基础重置
* 统一盒模型，避免内边距影响元素宽度计算
*/
*, *::before, *::after { box-sizing: border-box; }

/* 段落：全局去除浏览器默认外边距，间距统一由快捷类控制 */
p { margin: 0; padding: 0 }

/* 页面主体：撑满视口高度，并让页脚始终贴底 */
body {
    margin: 0; /* 清除浏览器默认外边距 */
    min-height: 100vh; /* 最小高度占满整个视口 */
    display: flex; /* 使用弹性布局组织头部、主体、页脚 */
    flex-direction: column; /* 纵向排列 */
    font-family: var(--site-font); /* 使用全局字体 */
    font-size: var(--site-font-size); /* 使用全局基础字号 */
    color: var(--site-color-text); /* 使用全局主文字色 */
    background-color: var(--site-color-bg); /* 使用全局背景色 */
    line-height: 1.6; /* 设置舒适的行高 */
}

/* 链接：使用主题强调色并去除下划线 */
a {
    color: var(--site-color-primary); /* 链接文字使用强调色 */
    text-decoration: none; /* 去除默认下划线 */
}

/* 头部与页脚：统一内边距和边框颜色 */
.site-header,
.site-footer {
    padding: var(--site-space); /* 使用全局间距基准作为内边距 */
    border-color: var(--site-color-border); /* 使用全局边框颜色 */
}

/* 头部：底部分隔线 */
.site-header {
    border-bottom: 1px solid var(--site-color-border); /* 底部 1px 分隔线 */
}

/* 头部内层：品牌在左，导航在右 */
.site-header-inner {
    display: flex;
    flex-wrap: wrap; /* 窄屏时换行，避免溢出 */
    align-items: center;
    justify-content: space-between;
    gap: var(--site-space);
}

/* 主导航 */
.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: calc(var(--site-space) * 1.5);
}

/* 导航项：作为二级菜单定位参照 */
.site-nav-item {
    position: relative;
}

.site-nav-link {
    color: var(--site-color-text);
}

.site-nav-link:hover {
    color: var(--site-color-primary);
}

/* 二级菜单：默认不可见，但保留尺寸供 JS 测量是否溢出 */
.site-nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10;
    display: block;
    visibility: hidden; /* 元素还占位置，只是看不见 */
    opacity: 0;
    pointer-events: none; /* 让元素忽略鼠标 / 触摸事件，点击穿透到下层元素 */
    min-width: 160px;
    padding: 0.5rem 0.5rem;
    background: var(--site-color-bg);
    border: 1px solid var(--site-color-border);
    border-radius: var(--site-radius);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

/* 悬停时显示 */
.site-nav-item:hover .site-nav-dropdown {
    visibility: visible; /* 正常显示、可见 */
    opacity: 1;
    pointer-events: auto; /* 元素正常接收鼠标、hover、点击、触摸等事件，**不穿透** */
}

/* JS 检测到下拉层会超出视口右侧时添加，改为贴右对齐 */
.site-nav-dropdown.is-right {
    right: 0;
    left: auto;
}

.site-nav-dropdown-link {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--site-color-text);
    white-space: nowrap;
}

.site-nav-dropdown-link:hover {
    color: var(--site-color-primary);
    background: #f3f4f6;
}

/* 页脚：顶部分隔线，并通过 margin-top:auto 贴底 */
.site-footer {
    margin-top: auto; /* 将页脚推到页面底部 */
    border-top: 1px solid var(--site-color-border); /* 顶部 1px 分隔线 */
    color: var(--site-color-muted); /* 页脚使用次要文字色 */
}

/* 页脚第一部分：左侧简版简介 */
.site-footer-main {
    text-align: left;
}

/* 页脚第二部分：版本说明 */
.site-footer-bottom {
    border-top: 1px solid var(--site-color-border); /* 上下两部分分隔线 */
    text-align: center; /* 版本说明居中 */
}

/* 站点品牌 / Logo 文字 */
.site-brand {
    font-weight: 600; /* 加粗突出品牌名称 */
    color: var(--site-color-text); /* 使用主文字色 */
}

/* 主内容区：限宽居中，并设置上下、左右内边距 */
.site-main {
    width: 100%; /* 占满父容器宽度 */
    max-width: 1080px; /* 限制最大宽度，避免内容过宽 */
    margin: 0 auto; /* 水平居中 */
    padding: calc(var(--site-space) * 2) var(--site-space); /* 上下为间距基准 2 倍，左右为 1 倍 */
}

/* 首页标题：去除默认上外边距 */
.page-home h1 {
    margin-top: 0; /* 去掉标题顶部留白 */
}

/* 首页首屏文案（间距由 utilities.css 快捷类控制） */
.home-hero {
    text-align: center; /* 文案居中 */
}

.home-hero-slogan {
    color: var(--site-color-muted); /* 使用次要文字色 */
    letter-spacing: 1px; /* 轻微字间距，突出标语 */
}

.home-hero-core {
    color: var(--site-color-primary); /* 核心词使用强调色 */
}

.home-hero-title {
    line-height: 1.3;
}

.home-hero-subtitle {
    color: var(--site-color-muted);
}

/* 首页第二屏：公司简介 */
.home-intro-text {
    color: var(--site-color-muted);
    line-height: 1.8; /* 长段落阅读更舒适 */
}

/*
* 图片骨架
* 用于图片未加载或缺失时的占位，浅灰底 + 流光动画
*/
.img-skeleton {
    display: block; /* 块级元素，便于直接设置宽高 */
    background-color: #eef1f5; /* 骨架基础底色 */
    background-image: linear-gradient(90deg, #eef1f5 25%, #f7f9fc 37%, #eef1f5 63%); /* 高光渐变，形成流光效果 */
    background-size: 400% 100%; /* 放大背景，为平移动画留出空间 */
    animation: img-skeleton-shimmer 1.4s ease infinite; /* 循环播放流光动画 */
    border-radius: var(--site-radius); /* 使用全局圆角 */
}

@keyframes img-skeleton-shimmer {
    0% { background-position: 100% 50%; } /* 从右侧开始 */
    100% { background-position: 0 50%; } /* 平移到左侧，形成扫光效果 */
}

/* 系统/浏览器的无障碍偏好减少动效时关闭流光 */
@media (prefers-reduced-motion: reduce) {
    .img-skeleton { animation: none; } /* 关闭动画，仅保留静态骨架 */
}

/* 站点品牌：Logo 与骨架占位统一尺寸 */
.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px; /* Logo 与品牌名之间的间距 */
}

/* 品牌名称：显示在 Logo 右侧 */
.site-brand-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--site-color-text);
    white-space: nowrap; /* 避免品牌名换行 */
}

.site-brand-logo {
    height: 50px;
    width: auto;
    max-width: 150px;
    object-fit: contain; /* 完整填充 */
}

/* 无 Logo 时的骨架宽度 */
.site-brand-logo.img-skeleton {
    width: 50px;
}
