/* ========================================
   前台公共样式 - frontend.css
   适用于所有前台页面（layout, home, contact, news等）
   ======================================== */

/* 重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 全站设计令牌（与 home.css 共用） */
:root {
    --primary: #4f46e5;
    --primary-2: #7c3aed;
    --accent: #06b6d4;
    --ink: #0f172a;
    --muted: #64748b;
    --bg: #ffffff;
    --bg-soft: #f8fafc;
    --line: #e2e8f0;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(15, 23, 42, .08);
    --shadow-lg: 0 20px 50px rgba(79, 70, 229, .18);
    --gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --gradient-soft: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
}

/* 基础 */
html {
    /* 平滑滚动 + 为固定导航预留偏移：否则锚点跳转（首页「了解服务」→ #services）
       的目标标题会被 position:fixed 的导航栏盖住 */
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    /* 现代中文优先字体栈：Mac/iOS 取苹方、Windows 取雅黑，
       原 'Microsoft YaHei', Arial 在 Mac/移动端会退化，中文笔画发虚 */
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC",
                 "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    /* slate-700，与 --muted(#64748b) 同色阶，比原 #333 更通透且与标题 --ink 拉开层次 */
    color: #334155;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 后台上传的大图默认不撑破容器 */
img {
    max-width: 100%;
    height: auto;
}

/* 导航栏（基础兜底；实际前台页面由 home.css 覆盖为深色毛玻璃，此处保持同色系避免不一致） */
.navbar {
    background: rgba(15, 23, 42, .92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: .75rem 0;
    box-shadow: 0 2px 20px rgba(15, 23, 42, .12);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.nav-menu a:hover {
    opacity: 0.8;
}

/* 页面头部横幅（统一品牌渐变：原为旧版紫渐变 #667eea→#764ba2，
   与「关于我们」(.about-hero)、「联系我们」(.page-header) 的现代渐变不一致） */
.page-header {
    background: var(--gradient);
    color: #fff;
    padding: 3rem 0;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
}

/* 通用容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 页脚（统一为品牌深色 --ink，与导航同色相；原 #2c3e50 偏蓝灰，与 --ink 不搭） */
.footer {
    background: var(--ink);
    color: #fff;
    padding: 2.5rem 0;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    text-align: left;
}

.footer-section h3 {
    margin-bottom: 1rem;
    /* 靛蓝浅色，与品牌主色同色系（原 #667eea 为旧版紫蓝，与 --primary #4f46e5 冲突） */
    color: #c7d2fe;
    font-size: 1rem;
    letter-spacing: .5px;
}

/* 半透明分隔线比原 #34495e 更干净，且不依赖固定底色 */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .12);
    padding-top: 1.2rem;
}
/*
 * 备案行：图标 + 文字用 inline-flex 做视觉居中对齐，
 * 不再让 36x40 的徽标按原始尺寸撑高 13px 的文字行盒。
 * 两条备案链接各自成为独立 flex 项，窄屏整条换行而不是把备案号拦腰折断；
 * 间隔用 gap 控制（8 的倍数），不再用 &nbsp;&nbsp; 硬编码空格。
 */
.icp-beian {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0 16px;
    min-height: 44px;
    margin: 8px 0 0;
    font-size: .82rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .6);
}
.icp-beian a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    /* 点击区域不低于 44px 高，视觉上仍是一行紧凑文字 */
    min-height: 44px;
    padding: 0 4px;
    white-space: nowrap;
    color: rgba(255, 255, 255, .75);
    text-decoration: none;
    transition: color .25s;
}
.icp-beian a:hover,
.icp-beian a:focus-visible {
    /* 改用品牌青色：原绿色 #22c55e 跳出整体配色 */
    color: var(--accent);
    text-decoration: underline;
}
.icp-beian a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
/*
 * 徽标源文件 36x40（透明 PNG），按 2 倍图缩到 18x20 保持原始比例；
 * 项目全局有 img{height:auto}，此处必须显式给高，且选择器带 .icp-beian 前缀才能覆盖。
 */
.icp-beian .beian-icon {
    display: block;
    width: 18px;
    height: 20px;
    flex: 0 0 auto;
    object-fit: contain;
}

/* 响应式 */
@media (max-width: 768px) {
    .nav-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }

    /*
     * 窄屏 logo 防溢出：公司全名（15 字）按桌面字号 1.35rem 计算约 345px，
     * 加上图标与汉堡按钮后超出 390px 视口，会把 .nav-container 撑宽、
     * 进而让整页出现横向滚动（首页 hero 文案、服务卡片右侧被裁）。
     * 这里缩小字号并允许省略号截断，给汉堡按钮留出固定位置。
     * 必须带 .navbar 前缀：home.css 的 `.logo{font-size:1.35rem}` 在其后加载，
     * 同特异性会覆盖本规则（踩过一次坑）。
     */
    .navbar .logo {
        font-size: 1rem;
        gap: 0.4rem;
        min-width: 0;
        flex: 1 1 auto;
    }
    .navbar .logo-icon {
        width: 22px;
        height: 22px;
        flex: 0 0 auto;
    }
    .navbar .logo span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .navbar .nav-toggle {
        flex: 0 0 auto;
    }
}
