/* ============================================================
   丰稷智能 - 公共样式 common.css
   科技蓝主题 · PC 优先响应式
   ============================================================ */

/* ---------- 重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    background: #fff;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; transition: color .25s; }
a:hover { color: #1466c0; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ---------- 主题变量 ---------- */
:root {
    --primary: #1466c0;       /* 主科技蓝 */
    --primary-deep: #081c44;  /* 深蓝 */
    --primary-light: #3b8dee; /* 亮蓝 */
    --accent: #00c6ff;        /* 青色高光 */
    --text-main: #1a2b4a;
    --text-sub: #6b7a92;
    --bg-soft: #f5f8fc;
    --border: #e6edf5;
}

/* ---------- 布局容器 ---------- */
.container { width: 1200px; max-width: 92%; margin: 0 auto; }

/* ---------- 通用区块 ---------- */
.section { padding: 90px 0; }
.section.products,
.section.solutions,
.section.cases,
.section.news,
.section.about { background: var(--bg-soft); }
.section.cases,
.section.news { background: #fff; }

.section-head { text-align: center; max-width: 720px; margin: 0 auto 60px; }
.section-sub {
    display: inline-block;
    font-size: 13px;
    letter-spacing: 3px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 10px;
}
.section-sub-left { display: block; text-align: left; }
.section-head h2 {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    position: relative;
}
.section-head h2::after {
    content: "";
    display: block;
    width: 50px; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    margin: 18px auto 0;
    border-radius: 2px;
}
.section-head p { color: var(--text-sub); font-size: 16px; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block;
    padding: 13px 34px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all .28s;
    border: none;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 20px rgba(20,102,192,.32);
}
.btn-primary:hover {
    background: var(--primary-deep);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(20,102,192,.42);
}
.btn-ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,.6);
}
.btn-ghost:hover {
    background: #fff;
    color: var(--primary-deep);
    border-color: #fff;
}

/* ---------- 顶部导航 ---------- */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    height: 76px;
    background: rgba(255,255,255,0);
    transition: all .3s;
}
.site-header.scrolled {
    background: rgba(255,255,255,.96);
    box-shadow: 0 2px 16px rgba(8,28,68,.08);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
    font-size: 30px;
    color: var(--accent);
    line-height: 1;
}
.logo-text strong {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    line-height: 1.1;
}
.logo-text em {
    display: block;
    font-size: 10px;
    letter-spacing: 2px;
    color: rgba(255,255,255,.7);
    font-style: normal;
}
.scrolled .logo-text strong { color: var(--text-main); }
.scrolled .logo-text em { color: var(--text-sub); }

/* Logo 图片 */
.logo-img {
    height: 50px;
    width: auto;
    /* logo 含白色，在白底头部用深色阴影描边保证可见 */
    filter: drop-shadow(0 0 1px rgba(8,28,68,.5)) drop-shadow(0 1px 2px rgba(8,28,68,.35));
    transition: height .3s;
}
/* footer 深色背景：无需描边（深底白字本就清晰） */
.logo-light .logo-img {
    height: 56px;
    filter: none;
}
/* 首页头部透明态：深色 Banner 上白字清晰，无需描边 */
body.page-home .site-header:not(.scrolled) .logo-img,
body.page-home:not(.scrolled-patch) .logo-img {
    filter: none;
}

/* 主导航 */
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
    position: relative;
    padding: 8px 16px;
    font-size: 15px;
    color: rgba(255,255,255,.9);
    font-weight: 500;
}
.main-nav a::after {
    content: "";
    position: absolute;
    left: 16px; right: 16px; bottom: 2px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform .25s;
}
.main-nav a:hover::after,
.main-nav a.active::after { transform: scaleX(1); }
.main-nav a:hover { color: #fff; }
.scrolled .main-nav a { color: var(--text-main); }
.scrolled .main-nav a:hover,
.scrolled .main-nav a.active { color: var(--primary); }

.nav-cta {
    background: var(--primary);
    color: #fff !important;
    border-radius: 4px;
    padding: 10px 24px !important;
}
.nav-cta::after { display: none !important; }
.nav-cta:hover { background: var(--primary-deep); }

/* ---------- 底部 ---------- */
.site-footer {
    background: linear-gradient(180deg, #0a1f48, #061226);
    color: rgba(255,255,255,.7);
    padding-top: 64px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr 1.6fr;
    gap: 40px;
    padding-bottom: 48px;
}
.logo-light .logo-text strong { color: #fff; }
.logo-light .logo-text em { color: rgba(255,255,255,.6); }
.footer-about p {
    margin-top: 18px;
    font-size: 14px;
    line-height: 1.9;
    color: rgba(255,255,255,.6);
}
.footer-col h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 22px;
    position: relative;
    padding-bottom: 12px;
}
.footer-col h4::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 30px; height: 2px;
    background: var(--accent);
}
.footer-col ul li { margin-bottom: 12px; font-size: 14px; }
.footer-col ul li a:hover { color: var(--accent); }
.contact-list li .ci {
    display: inline-block;
    width: 1em;
    color: rgba(255,255,255,.7);
    font-weight: 600;
}
.qrcode-box { text-align: center; }
.qrcode {
    width: 120px; height: 120px;
    background: #fff;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 6px;
}
.qrcode-box p { margin-top: 10px; font-size: 13px; color: rgba(255,255,255,.6); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 20px 0;
}
.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: rgba(255,255,255,.45);
}

/* ---------- 悬浮咨询 ---------- */
.float-contact {
    position: fixed;
    right: 24px; bottom: 80px;
    z-index: 900;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 8px 22px rgba(20,102,192,.4);
    animation: pulse 2.4s infinite;
}
.float-contact:hover { background: var(--primary-deep); color: #fff; transform: scale(1.06); }
@keyframes pulse {
    0%,100% { box-shadow: 0 8px 22px rgba(20,102,192,.4); }
    50% { box-shadow: 0 8px 22px rgba(20,102,192,.4), 0 0 0 12px rgba(20,102,192,.12); }
}

/* ---------- 进入动画 ---------- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============================================================
   汉堡菜单按钮（移动端）
   ============================================================ */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px; height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}
.nav-toggle span {
    display: block;
    width: 26px; height: 3px;
    background: var(--text-main);
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
}
.scrolled-patch .nav-toggle span,
.site-header-solid .nav-toggle span { background: var(--text-main); }
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* 移动端遮罩 */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 998;
    opacity: 0;
    transition: opacity .3s;
}
.nav-overlay.show { display: block; opacity: 1; }

/* ============================================================
   响应式 - 平板 (≤1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .container { width: 100%; max-width: 100%; padding: 0 24px; }

    /* 头部 */
    .header-inner { height: 64px; }
    .site-header { height: 64px; }
    .logo-text strong { font-size: 19px; }
    .logo-img { height: 42px; }

    /* 导航改为抽屉式 */
    .nav-toggle { display: flex; }
    .main-nav {
        position: fixed;
        top: 0; right: -300px;
        width: 280px;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 80px 0 30px;
        box-shadow: -4px 0 24px rgba(0,0,0,.12);
        transition: right .32s ease;
        z-index: 999;
        overflow-y: auto;
    }
    .main-nav.open { right: 0; }
    .main-nav a {
        color: var(--text-main) !important;
        padding: 15px 28px !important;
        font-size: 16px;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }
    .main-nav a::after { display: none !important; }
    .main-nav a.active { color: var(--primary) !important; background: var(--bg-soft); }
    .main-nav a:hover { background: var(--bg-soft); }
    .nav-cta {
        margin: 16px 28px 0 !important;
        text-align: center;
        border-radius: 4px !important;
    }
}

/* ============================================================
   响应式 - 手机 (≤768px)
   ============================================================ */
@media (max-width: 768px) {
    html { font-size: 14px; }
    body { font-size: 14px; }
    .container { padding: 0 16px; }

    /* 通用区块间距缩小 */
    .section { padding: 50px 0; }
    .section-head { margin-bottom: 36px; }
    .section-head h2 { font-size: 26px; }
    .section-head p { font-size: 14px; }

    /* 按钮 */
    .btn { padding: 11px 26px; font-size: 14px; }

    /* Logo */
    .logo-text strong { font-size: 17px; }
    .logo-text em { font-size: 9px; }
    .logo-icon { font-size: 24px; }
    .logo-img { height: 36px; }
    .logo-light .logo-img { height: 46px; }

    /* 底部 */
    .site-footer { padding-top: 44px; }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-bottom: 30px;
        text-align: left;
    }
    .footer-col h4 { margin-bottom: 16px; }
    .footer-bottom .container {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    /* 悬浮咨询按钮缩小，避免遮挡 */
    .float-contact { width: 48px; height: 48px; right: 14px; bottom: 70px; font-size: 11px; }

    /* reveal 动画在移动端减弱，避免卡顿 */
    .reveal { transform: translateY(24px); transition-duration: .5s; }
}

/* ============================================================
   响应式 - 小手机 (≤480px)
   ============================================================ */
@media (max-width: 480px) {
    .section-head h2 { font-size: 22px; }
    .btn { padding: 10px 22px; font-size: 13px; }
    .container { padding: 0 14px; }
}

/* ============================================================
   在线咨询留言弹窗
   ============================================================ */
/* 悬浮按钮改为 flex 列布局容纳图标 */
.float-contact {
    flex-direction: column;
    gap: 3px;
}
.float-contact svg { display: block; }

/* 遮罩 */
.msg-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1100;
    opacity: 0;
    transition: opacity .25s;
}
.msg-overlay.show { display: block; opacity: 1; }

/* 弹窗 */
.msg-modal {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.92);
    width: 440px;
    max-width: 92%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    z-index: 1101;
    opacity: 0;
    transition: opacity .25s, transform .25s;
    overflow: hidden;
}
.msg-modal.show { display: block; opacity: 1; transform: translate(-50%, -50%) scale(1); }

.msg-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-deep));
    color: #fff;
}
.msg-title { font-size: 17px; font-weight: 600; }
.msg-close {
    background: transparent; border: none; color: #fff;
    font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.msg-close:hover { opacity: .8; }

.msg-form { padding: 24px; }
.msg-row { margin-bottom: 16px; }
.msg-row label {
    display: block;
    font-size: 13px;
    color: var(--text-main);
    margin-bottom: 6px;
    font-weight: 500;
}
.msg-row label .req { color: var(--admin-danger, #e74c3c); }
.msg-row input, .msg-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e4e9f1;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
    box-sizing: border-box;
}
.msg-row input:focus, .msg-row textarea:focus { border-color: var(--primary); }
.msg-row textarea { min-height: 80px; resize: vertical; }

.msg-tip {
    min-height: 18px;
    font-size: 13px;
    text-align: center;
    margin-bottom: 10px;
}
.msg-tip.err { color: #e74c3c; }
.msg-tip.ok { color: #28a745; }

.msg-submit { width: 100%; padding: 12px; font-size: 15px; }
.msg-submit.loading { opacity: .7; pointer-events: none; }

/* 弹窗移动端 */
@media (max-width: 480px) {
    .msg-modal { width: 94%; border-radius: 10px; }
    .msg-form { padding: 18px; }
    .float-contact svg { width: 18px; height: 18px; }
}

