/* ============================================================
   实验器材官网 前端样式
   主题色由后台 site_config 动态注入 CSS 变量
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #0a6ebd;
    --secondary: #0a3d62;
    --accent: #fbc531;
    --font: "Microsoft YaHei", "PingFang SC", sans-serif;
    --text: #333;
    --text-light: #666;
    --bg-gray: #f5f7fa;
    --border: #e8e8e8;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0, 0, 0, .08);
    --shadow-hover: 0 8px 24px rgba(10, 110, 189, .15);
}
body { font-family: var(--font); color: var(--text); line-height: 1.7; background: #fff; }
a { text-decoration: none; color: inherit; transition: color .2s; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 按钮 */
.btn-primary, .btn-outline, .btn-outline-light {
    display: inline-block; padding: 12px 32px; border-radius: 50px; font-size: 15px;
    cursor: pointer; transition: all .3s; border: 2px solid transparent;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--secondary); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(10, 110, 189, .3); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-outline-light { border-color: rgba(255, 255, 255, .6); color: #fff; background: transparent; }
.btn-outline-light:hover { background: #fff; color: var(--primary); }

/* 顶部信息栏 */
.topbar { background: var(--secondary); color: rgba(255, 255, 255, .85); font-size: 13px; padding: 8px 0; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; }
.topbar-welcome { color: var(--accent); }

/* 头部导航 */
.header { background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .06); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.logo img { height: 50px; }
.logo-text { font-size: 22px; font-weight: 300; color: var(--text); }
.logo-text b { color: var(--primary); font-weight: 700; margin-right: 2px; }
.nav { display: flex; gap: 6px; }
.nav a { padding: 8px 18px; font-size: 16px; color: var(--text); border-radius: 4px; position: relative; }
.nav a:hover, .nav a.active { color: var(--primary); }
.nav a.active::after, .nav a:hover::after {
    content: ''; position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
    width: 24px; height: 3px; background: var(--primary); border-radius: 2px;
}
.menu-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--primary); }

/* 轮播图 */
.banner { position: relative; width: 100%; aspect-ratio: 1920/1100; height: auto; max-height: 1100px; overflow: hidden; }
.banner-slides { position: relative; width: 100%; height: 100%; }
.banner-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center center; opacity: 0; transition: opacity 1s; display: flex; align-items: center; }
.banner-slide.active { opacity: 1; }
.banner-content { position: relative; z-index: 2; color: #fff; max-width: 600px; }
.banner-title { font-size: 40px; font-weight: 700; margin-bottom: 16px; text-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.banner-subtitle { font-size: 18px; margin-bottom: 28px; opacity: .95; }
.banner-dots { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 3; }
.banner-dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, .5); cursor: pointer; transition: all .3s; }
.banner-dot.active { background: var(--accent); width: 32px; border-radius: 6px; }

/* 通用区块 */
.section { padding: 64px 0; }
.section-gray { background: var(--bg-gray); }
.section-head { text-align: center; margin-bottom: 40px; }
.section-tag { display: inline-block; color: var(--accent); font-size: 14px; letter-spacing: 3px; font-weight: 700; margin-bottom: 8px; }
.section-title { font-size: 30px; color: var(--text); font-weight: 700; position: relative; }
.section-head .section-title::after { content: ''; display: block; width: 50px; height: 3px; background: var(--primary); margin: 14px auto 0; border-radius: 2px; }
.section-more { text-align: center; margin-top: 36px; }

/* 关于我们 */
.about-grid { max-width: 900px; margin: 0 auto; }
.about-intro { font-size: 16px; color: var(--text-light); line-height: 2; margin-bottom: 32px; text-indent: 2em; }
.about-btns { display: flex; gap: 16px; }

/* 统计数据 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 32px 0; }
.stats-center { max-width: 800px; margin: 40px auto; }
.stat-item { text-align: center; padding: 20px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-num { display: block; font-size: 38px; font-weight: 700; color: var(--primary); line-height: 1.2; }
.stat-label { display: block; font-size: 14px; color: var(--text-light); margin-top: 6px; }

/* 产品网格 */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.product-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: all .3s; }
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.product-img { height: 200px; overflow: hidden; background: var(--bg-gray); }
.product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.product-card:hover .product-img img { transform: scale(1.08); }
.product-info { padding: 16px; }
.product-model { display: inline-block; font-size: 12px; color: #fff; background: var(--accent); padding: 2px 10px; border-radius: 10px; margin-bottom: 8px; }
.product-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.product-card:hover .product-name { color: var(--primary); }
.product-summary { font-size: 13px; color: var(--text-light); line-height: 1.6; }

/* 新闻列表 */
.news-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.news-item { display: flex; gap: 20px; padding: 24px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); transition: all .3s; border-left: 4px solid var(--primary); }
.news-item:hover { transform: translateX(4px); box-shadow: var(--shadow-hover); }
.news-date { text-align: center; min-width: 70px; padding: 10px 0; background: var(--bg-gray); border-radius: var(--radius); }
.news-month { display: block; font-size: 13px; color: var(--text-light); }
.news-day { display: block; font-size: 28px; font-weight: 700; color: var(--primary); line-height: 1.2; }
.news-year { display: block; font-size: 12px; color: var(--text-light); }
.news-body { flex: 1; }
.news-cat { display: inline-block; font-size: 12px; color: var(--primary); border: 1px solid var(--primary); padding: 1px 8px; border-radius: 10px; margin-bottom: 6px; }
.news-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.news-item:hover .news-title { color: var(--primary); }
.news-summary { font-size: 13px; color: var(--text-light); line-height: 1.6; }

/* CTA 区块 */
.cta-section { background: linear-gradient(135deg, var(--secondary), var(--primary)); padding: 56px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.cta-text h2 { color: #fff; font-size: 26px; margin-bottom: 8px; }
.cta-text p { color: rgba(255, 255, 255, .85); font-size: 15px; }
.cta-btns { display: flex; gap: 14px; flex-shrink: 0; }

/* 页面 banner */
.page-banner { padding: 56px 0; color: #fff; text-align: center; }
.page-banner h1 { font-size: 34px; margin-bottom: 10px; }
.page-banner p { font-size: 15px; opacity: .9; }
.page-banner-sm { padding: 36px 0; }
.page-banner-sm h1 { font-size: 26px; }
.page-banner a { color: rgba(255, 255, 255, .85); }
.page-banner a:hover { color: var(--accent); }

/* 锚点导航 */
.anchor-nav { display: flex; gap: 8px; justify-content: center; padding: 20px 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.anchor-nav a { padding: 8px 22px; border-radius: 50px; font-size: 14px; color: var(--text-light); border: 1px solid var(--border); }
.anchor-nav a.active, .anchor-nav a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 富文本内容 */
.rich-content { font-size: 16px; line-height: 2; color: var(--text); }
.rich-content p { margin-bottom: 16px; text-indent: 2em; }
.rich-content h2, .rich-content h3 { margin: 24px 0 12px; color: var(--secondary); }
.rich-content ul, .rich-content ol { margin: 12px 0 16px 2em; }
.rich-content img { max-width: 100%; border-radius: var(--radius); margin: 16px 0; }

/* 分类筛选 */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; justify-content: center; }
.filter-bar a { padding: 8px 24px; border-radius: 50px; font-size: 14px; color: var(--text-light); background: #fff; border: 1px solid var(--border); transition: all .2s; }
.filter-bar a.active, .filter-bar a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 空状态 */
.empty { text-align: center; padding: 60px 0; color: var(--text-light); font-size: 15px; }

/* 分页 */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; }
.pagination a { padding: 8px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; color: var(--text); background: #fff; }
.pagination a:hover, .pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 产品详情 */
.detail-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.detail-img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.detail-img img { width: 100%; height: 400px; object-fit: cover; }
.detail-gallery { position:relative; background:#f0f0f0; }
.detail-gallery-slides { position:relative; width:100%; }
.detail-gallery-slide { position:absolute; top:0; left:0; width:100%; opacity:0; transition:opacity .5s; }
.detail-gallery-slide.active { position:relative; opacity:1; }
.detail-gallery .detail-gallery-slide img { width:100%; height:auto; object-fit:contain; display:block; }
.detail-gallery-dots { position:absolute; bottom:12px; left:50%; transform:translateX(-50%); display:flex; gap:8px; z-index:3; }
.detail-gallery-dot { width:8px; height:8px; border-radius:50%; background:rgba(255,255,255,.5); cursor:pointer; transition:all .3s; }
.detail-gallery-dot.active { background:var(--accent); width:24px; border-radius:4px; }
.detail-gallery-arrow { position:absolute; top:50%; transform:translateY(-50%); width:36px; height:36px; border-radius:50%; background:rgba(0,0,0,.3); color:#fff; border:none; font-size:24px; line-height:1; cursor:pointer; z-index:3; display:flex; align-items:center; justify-content:center; }
.detail-gallery-arrow:hover { background:rgba(0,0,0,.5); }
.detail-gallery-arrow.prev { left:12px; }
.detail-gallery-arrow.next { right:12px; }
.detail-info { display: flex; flex-direction: column; justify-content: center; }
.detail-title { font-size: 28px; margin: 12px 0; }
.detail-summary { font-size: 15px; color: var(--text-light); line-height: 1.8; margin-bottom: 20px; }
.detail-meta { border-top: 1px solid var(--border); padding-top: 16px; margin-bottom: 24px; color: var(--text-light); font-size: 14px; }
.detail-meta p { margin-bottom: 6px; }
.detail-contact { display: flex; gap: 14px; flex-wrap: wrap; }
.detail-content { margin-bottom: 48px; }
.detail-content-title { font-size: 22px; color: var(--secondary); border-left: 4px solid var(--primary); padding-left: 14px; margin-bottom: 24px; }
.related-section .section-title { font-size: 22px; margin-bottom: 24px; }

/* 文章详情 */
.content-narrow { max-width: 860px; }
.article-title { font-size: 28px; text-align: center; margin-bottom: 16px; }
.article-meta { text-align: center; color: var(--text-light); font-size: 14px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.article-meta span { margin: 0 12px; }
.article-cover { margin-bottom: 28px; border-radius: var(--radius); overflow: hidden; }
.article-nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.article-nav-item { font-size: 14px; color: var(--text-light); max-width: 48%; }
.article-nav-item:hover { color: var(--primary); }
.article-nav-next { text-align: right; }

/* 联系我们 */
.contact-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; }
.contact-item { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.contact-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--bg-gray); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.contact-item h4 { font-size: 15px; color: var(--text-light); margin-bottom: 4px; }
.contact-item p { font-size: 17px; color: var(--text); font-weight: 600; }
.contact-form { background: var(--bg-gray); padding: 32px; border-radius: var(--radius); }
.contact-form .section-title { font-size: 22px; margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--text); }
.form-group .req { color: #e74c3c; }
.form-group input, .form-group textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-family: inherit; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }
.alert-success, .alert-error { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d; }
.alert-error { background: #fff4f4; border: 1px solid #ffccc7; color: #cf1322; }

/* 底部 */
.footer { background: var(--secondary); color: rgba(255, 255, 255, .75); padding-top: 48px; }
.footer-inner { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 30px; padding-bottom: 32px; }
.footer-title { color: #fff; font-size: 17px; margin-bottom: 16px; }
.footer-desc { font-size: 14px; line-height: 1.8; }
.footer-col p { font-size: 14px; margin-bottom: 8px; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .15); padding: 16px 0; font-size: 13px; }
.footer-bottom .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* 响应式 */
@media (max-width: 992px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .news-list { grid-template-columns: 1fr; }
    .contact-layout { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav { display: none; position: absolute; top: 76px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 12px; box-shadow: var(--shadow); }
    .nav.open { display: flex; }
    .nav a::after { display: none; }
    .menu-toggle { display: block; }
    .topbar-welcome { display: none; }
    .banner { height: 250px; aspect-ratio: auto; }
    .banner-slide { background-size: 100% 100%; }
    .banner-title { font-size: 26px; }
    .banner-subtitle { font-size: 15px; }
    .section { padding: 40px 0; }
    .section-title { font-size: 24px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .detail-layout { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .cta-inner { flex-direction: column; text-align: center; }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-desc { display: none; }
    .footer-col-links { display: flex; flex-wrap: wrap; align-items: center; column-gap: 18px; row-gap: 6px; }
    .footer-col-links .footer-title { width: 100%; margin-bottom: 8px; }
    .footer-col-links p { margin-bottom: 0; }
    .article-nav { flex-direction: column; }
    .article-nav-next { text-align: left; }
}
@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: 1fr; }
}
