/* ========================================
   SKINWTR 水初语 - 公共样式 common.css
   包含：CSS Reset、变量、排版、头部、导航、页脚、通用组件、响应式
   ======================================== */

/* ===== CSS 变量 ===== */
:root {
    --color-primary: #1a3a7a;
    --color-primary-light: #2d5aa0;
    --color-primary-lighter: #4a7bc0;
    --color-accent: #5b8def;
    --color-gradient: linear-gradient(135deg, #1a3a7a 0%, #3a6fd8 100%);
    --color-gradient-light: linear-gradient(135deg, #e8f0ff 0%, #f4f8ff 100%);
    --color-bg: #f4f6f9;
    --color-white: #ffffff;
    --color-text: #333333;
    --color-text-secondary: #666666;
    --color-text-light: #999999;
    --color-border: #eef0f3;
    --color-price: #e53935;
    --color-success: #52c41a;
    --color-warning: #faad14;
    --container-width: 1200px;
    --topbar-height: 36px;
    --header-height: 3rem;
    --nav-height: 56px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-pill: 999px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,.1);
    --shadow-lg: 0 8px 40px rgba(0,0,0,.12);
    --transition: all .3s ease;
    --font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* ===== CSS Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-family);
    color: var(--color-text);
    /*background: var(--color-bg);*/
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
}
a { color: inherit; text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-primary); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
input, button, textarea, select { font-family: inherit; font-size: inherit; outline: none; border: none; background: none; }
button { cursor: pointer; }

/* ===== 布局工具 ===== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 16px;
}
.section { padding: 60px 0; }
.section-header {
    text-align: center;
    margin-bottom: 40px;
}
.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
}
.section-header p {
    font-size: 14px;
    color: var(--color-text-light);
    letter-spacing: 2px;
}
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ===== 通用按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 28px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-primary {
    background: var(--color-primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--color-primary-light);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26,58,122,.3);
}
.btn-outline {
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    background: transparent;
}
.btn-outline:hover {
    background: var(--color-primary);
    color: #fff;
}
.btn-light {
    background: #fff;
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    font-weight: 500;
}
.btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.btn-lg { padding: 14px 40px; font-size: 16px; }
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-pill { border-radius: var(--radius-pill); }

/* ===== 公共头部 ===== */
.site-header { position: relative; z-index: 1000; background: #fff; }

/* 顶部信息条 */
.header-topbar {
    height: auto;
    background: #fff;
    color: var(--color-text);
    font-size: 12px;
}
.header-topbar-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.topbar-welcome { opacity: .9; }
.topbar-tools {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10%;
}
/* 顶部条双图横幅：左 60% / 中 10% 间隔 / 右 30% */
.topbar-banner {
    display: block;
    overflow: hidden;
    line-height: 0;
    min-width: 0; /* 允许收缩，避免图片 intrinsic 宽度撑破 60/30 比例导致溢出 */
}
.topbar-banner img {
    display: block;
    width: 100%;
    height: auto;          /* 自适应高度，完整显示 */
    max-height: 90px;      /* 超过则等比缩放并完整显示，避免顶栏过高 */
    object-fit: contain;
}
.topbar-banner--left  { flex: 0 0 60%; max-width: 60%; }
.topbar-banner--right { flex: 0 0 30%; max-width: 30%; }
.topbar-banner--right:hover img { opacity: .9; }
.topbar-hotline { opacity: .9; }
.topbar-hotline i { margin-right: 4px; }
.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: rgba(255,255,255,.85);
    position: relative;
}
.topbar-link:hover { color: #fff; }
.topbar-link i { font-size: 14px; }
.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--color-price);
    color: #fff;
    font-size: 10px;
    font-style: normal;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 主导航条 */
.header-main {
    height: var(--header-height);
    background: #002FA7;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.15);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-main-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}
.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    flex-shrink: 0;
}
.header-logo:hover { color: #fff; opacity: .9; }
.header-logo .logo-mark {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5b8def 0%, #1a3a7a 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 16px;
    border: 2px solid rgba(255,255,255,.3);
}
.header-logo .logo-text {
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 20px;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.header-logo .logo-text small {
    font-weight: 400;
    font-size: 11px;
    opacity: .85;
    letter-spacing: 2px;
}

/* 导航菜单 */
.main-nav { flex: 1; }
.nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    /*gap: 3%;*/
}
.nav-menu li { position: relative; padding: 0 1.5%;}
.nav-menu li:not(:last-child)::after {
    content: '|';
    position: absolute;
    right: -1px;
    top: 50%;
    transform: translateY(-50%);
    color: #ddd;
    font-size: 12px;
}
.nav-menu a {
    display: block;
    padding: 0 28px;
    font-size: 15px;
    color: #fff;
    font-weight: 500;
    transition: var(--transition);
    line-height: var(--header-height);
    position: relative;
}
.nav-menu a:hover { color: #fff; }
.nav-menu a.active { color: #fff; font-weight: 600; }
.nav-menu a.active::after,
.nav-menu a:hover::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 28px;
    right: 28px;
    height: 2px;
    background: #fff;
}

/* 搜索框 */
.header-search { flex-shrink: 0; }
.search-form {
    display: flex;
    align-items: center;
    width: 220px;
    height: 38px;
    border: 1px solid #e0e0e0;
    border-radius: var(--radius-pill);
    padding: 0 4px 0 14px;
    transition: var(--transition);
    background: #fafafa;
}
.search-form:focus-within {
    border-color: var(--color-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,58,122,.08);
}
.search-input {
    flex: 1;
    color: var(--color-text);
    font-size: 13px;
    background: transparent;
}
.search-input::placeholder { color: #aaa; }
.search-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.search-btn:hover { background: var(--color-primary-light); }

/* 移动端菜单按钮 */
.mobile-toggle {
    display: none;
    width: 36px;
    height: 36px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: var(--color-primary);
    border-radius: var(--radius-sm);
}
.mobile-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: var(--transition);
}
.mobile-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端导航 */
.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
}
.mobile-nav.show { display: block; }
.mobile-nav-list { padding: 10px 0; }
.mobile-nav-list li a {
    display: block;
    padding: 12px 16px;
    color: var(--color-text);
    font-size: 14px;
    border-bottom: 1px solid var(--color-border);
}
.mobile-nav-list li a:hover,
.mobile-nav-list li a.active {
    color: var(--color-primary);
    background: var(--color-bg);
}

/* ===== 页脚 ===== */
.site-footer {
    background: var(--color-primary);
    color: rgba(255,255,255,.85);
    padding: 50px 0 20px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
    gap: 40px;
    align-items: flex-start;
}
/* 页脚左右结构（取自 header_footer 表）：左 45% / 中 15% 间隔 / 右 40% */
.footer-main {
    display: flex;
    gap: 25%;
    align-items: flex-start;
}
.footer-left {
    flex: 0 0 45%;
    max-width: 45%;
    min-width: 0;
}
.footer-right {
    /*flex: 1;*/
    min-width: 0;
    display: flex;
    flex-direction: row; /* 图片2 与社交图标左右并排 */
    align-items: flex-start;
    gap: 16px;
}
.footer-banner-img {
    display: block;
    width: 100%;
    height: auto;          /* 自适应高度，完整显示图片 */
    max-height: 130px;     /* 超过则等比缩放并完整显示，避免过高 */
    object-fit: contain;
    border-radius: 8px;
}
/* 右侧图片随剩余空间自适应（与社交图标并排） */
.footer-right .footer-banner-img {
    flex: 1;
    width: auto;
    min-width: 0;
}
/* 社交图标：在页脚右侧作为图片旁的窄列，图标上下排列 */
.footer-social--col {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
}
.footer-brand .footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: #fff;
}
.footer-brand .footer-logo .logo-mark {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5b8def 0%, #1a3a7a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    border: 2px solid rgba(255,255,255,.3);
}
.footer-brand .footer-logo .logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.footer-brand .footer-logo .logo-text small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    opacity: .7;
    letter-spacing: 2px;
}
.footer-brand .footer-desc {
    font-size: 13px;
    color: rgba(255,255,255,.6);
    line-height: 1.8;
    margin-bottom: 16px;
}
.footer-social {
    display: flex;
    gap: 12px;
}
.footer-social .social-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.footer-social .social-icon:hover { background: rgba(255,255,255,.2); }
.footer-col h4 {
    color: #fff;
    font-size: 15px;
    margin-bottom: 16px;
    font-weight: 600;
}
.footer-links li { margin-bottom: 10px; }
.footer-links li a,
.footer-links li {
    font-size: 13px;
    color: rgba(255,255,255,.6);
}
.footer-links li a:hover { color: #fff; }
.footer-links li i { margin-right: 6px; }
.footer-qr .qr-box { text-align: center; }
.footer-qr .qr-img-placeholder {
    width: 100px;
    height: 100px;
    background: #fff;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 12px;
}
.footer-qr p { font-size: 12px; color: rgba(255,255,255,.6); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    margin-top: 40px;
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,.5);
}
.footer-bottom a { color: rgba(255,255,255,.5); }
.footer-bottom a:hover { color: #fff; }
.footer-bottom p { margin-bottom: 4px; }

/* ===== 悬浮按钮 ===== */
.float-buttons {
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.float-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
}
.float-btn:hover {
    background: var(--color-primary-light);
    transform: scale(1.05);
}
/* 回到顶部按钮默认隐藏，滚动后才显示 */
.float-backtop { display: none; }
.float-backtop.show { display: flex; }

/* ===== 响应式：移动端 < 992px ===== */
@media (max-width: 991px) {
    :root {
        --topbar-height: 32px;
        --header-height: 60px;
        --nav-height: 52px;
    }
    .container { padding: 0 12px; }
    .section { padding: 40px 0; }
    .section-header { margin-bottom: 24px; }
    .section-header h2 { font-size: 22px; }
    .section-header p { font-size: 12px; }
    .btn-lg { padding: 12px 28px; font-size: 14px; }

    /* 顶部条 */
    .topbar-welcome { display: none; }
    .topbar-hotline { display: none; }
    .topbar-tools { width: 100%; justify-content: flex-start; gap: 10%; }
    .topbar-banner img { height: 40px; }

    /* 主导航 */
    .main-nav,
    .header-search { display: none; }
    .mobile-toggle { display: flex; }
    .header-logo .logo-text { font-size: 16px; }
    .header-logo .logo-text small { font-size: 10px; }
    .header-logo .logo-mark { width: 34px; height: 34px; font-size: 14px; }

    /* 页脚 */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
    .footer-brand { grid-column: 1 / -1; }
    .footer-brand .footer-desc { max-width: 100%; }
    .footer-qr { grid-column: 1 / -1; }
    .footer-qr .qr-box { display: inline-block; }
    .footer-main { flex-direction: column; gap: 24px; }
    .footer-left { flex: 0 0 100%; max-width: 100%; }
    .footer-right { flex-direction: column; gap: 16px; }
    .footer-right .footer-banner-img { width: 100%; flex: 1 1 auto; }
    .footer-banner-img { height: auto; max-height: 180px; object-fit: contain; }

    /* 悬浮按钮 */
    .float-buttons { right: 12px; bottom: 60px; }
    .float-btn { width: 44px; height: 44px; font-size: 18px; }
}
