/* =====================================================================
   绿源柏穗化工官网 — 蓝绿设计系统（手机优先响应式）
   色板与间距统一由 :root 变量管理，模板不硬编码颜色
   ===================================================================== */
:root {
  /* 品牌色（匹配 logo：蓝 S + 绿 G） */
  --c-blue: #1A6FB5;
  --c-blue-dark: #12548F;
  --c-blue-deep: #0E2C52;
  --c-green: #00B058;
  --c-green-dark: #008A45;
  --c-teal: #0E9C9C;
  --c-gradient: linear-gradient(135deg, #1A6FB5 0%, #0E9C9C 50%, #00B058 100%);
  --c-gradient-soft: linear-gradient(135deg, rgba(26,111,181,.08), rgba(0,176,88,.08));

  /* 中性色 */
  --c-ink: #0F2238;
  --c-ink-2: #4A5A6E;
  --c-muted: #8896A8;
  --c-line: #E4EAF1;
  --c-bg: #F4F8FB;
  --c-card: #ffffff;
  --c-white: #ffffff;

  /* 尺寸 */
  --maxw: 1200px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 6px 20px rgba(15, 34, 56, .08);
  --shadow-hover: 0 12px 30px rgba(15, 34, 56, .14);
  --header-h: 68px;
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-blue); text-decoration: none; transition: color .2s; }
a:hover { color: var(--c-green-dark); }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.35; color: var(--c-ink); font-weight: 700; }
p { margin: 0 0 1em; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--c-blue); color: #fff; padding: 8px 16px; z-index: 999; }
.skip-link:focus { left: 0; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.section { padding: 48px 0; }
.section-title { text-align: center; margin-bottom: 32px; }
.section-title h2 { font-size: 26px; position: relative; display: inline-block; padding-bottom: 12px; }
.section-title h2::after {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 48px; height: 3px; border-radius: 2px; background: var(--c-gradient);
}
.section-title p { color: var(--c-muted); margin: 8px 0 0; font-size: 14px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  transition: all .2s; line-height: 1.4;
}
.btn-primary { background: var(--c-gradient); color: #fff; }
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-outline { background: #fff; color: var(--c-blue); border-color: var(--c-blue); }
.btn-outline:hover { background: var(--c-blue); color: #fff; }
.btn-ghost { background: transparent; color: var(--c-ink-2); border-color: var(--c-line); }
.btn-ghost:hover { border-color: var(--c-blue); color: var(--c-blue); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .25s, border-color .25s;
}
.site-header.scrolled { box-shadow: 0 2px 12px rgba(15,34,56,.08); border-bottom-color: var(--c-line); }
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--c-ink); }
.brand:hover { color: var(--c-ink); }
.logo-img { width: 42px; height: 42px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 17px; color: var(--c-blue-deep); letter-spacing: .5px; }
.brand-text small { font-size: 10px; color: var(--c-muted); letter-spacing: 1px; text-transform: uppercase; }

.main-nav { display: none; }
.main-nav.open {
  display: flex; flex-direction: column;
  position: absolute; top: var(--header-h); left: 0; right: 0;
  background: #fff; border-bottom: 1px solid var(--c-line);
  padding: 8px 16px 16px; box-shadow: var(--shadow);
}
.main-nav .nav-link {
  padding: 12px 8px; color: var(--c-ink-2); font-weight: 500;
  border-bottom: 1px solid var(--c-line); position: relative;
}
.main-nav .nav-link:last-child { border-bottom: none; }
.main-nav .nav-link.active { color: var(--c-blue); font-weight: 600; }
.main-nav .nav-link.active::before {
  content: ""; display: inline-block; width: 4px; height: 16px; border-radius: 2px;
  background: var(--c-gradient); margin-right: 8px; vertical-align: middle;
}

.nav-toggle {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; background: transparent; border: none; cursor: pointer; padding: 8px;
}
.nav-toggle span { display: block; height: 2px; width: 24px; background: var(--c-blue-deep); border-radius: 2px; transition: .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--c-gradient);
  color: #fff; padding: 56px 0 64px;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.18), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(255,255,255,.12), transparent 45%);
}
.hero .container { position: relative; }
.hero h1 { color: #fff; font-size: 30px; margin-bottom: 16px; }
.hero p { font-size: 16px; opacity: .92; max-width: 640px; margin-bottom: 24px; }
.hero .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn-outline { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.7); }
.hero .btn-outline:hover { background: #fff; color: var(--c-blue-dark); }

/* page banner (内页顶部) */
.page-banner {
  background: var(--c-gradient); color: #fff; padding: 40px 0;
  position: relative; overflow: hidden;
}
.page-banner::after {
  content:""; position:absolute; inset:0;
  background: radial-gradient(circle at 80% 30%, rgba(255,255,255,.15), transparent 50%);
}
.page-banner .container { position: relative; }
.page-banner h1 { color: #fff; font-size: 26px; margin: 0; }
.page-banner .crumbs { margin-top: 10px; font-size: 13px; opacity: .9; }
.page-banner .crumbs a { color: #fff; }
.page-banner .crumbs span { margin: 0 6px; opacity: .7; }

/* ---------- product grid ---------- */
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.product-card {
  background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius);
  overflow: hidden; transition: all .25s; display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: transparent; }
.product-card .pic { aspect-ratio: 4/3; background: var(--c-bg); overflow: hidden; }
.product-card .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.product-card:hover .pic img { transform: scale(1.06); }
.product-card .body { padding: 12px 14px 16px; }
.product-card h3 { font-size: 15px; margin: 0 0 6px; font-weight: 600; line-height: 1.4; }
.product-card h3 a { color: var(--c-ink); }
.product-card:hover h3 a { color: var(--c-blue); }
.product-card .desc { font-size: 12px; color: var(--c-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- article list ---------- */
.article-list { display: flex; flex-direction: column; gap: 14px; }
.article-item {
  display: flex; gap: 16px; background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--radius); padding: 16px; transition: all .2s;
}
.article-item:hover { box-shadow: var(--shadow); border-color: var(--c-blue); transform: translateX(2px); }
.article-item .thumb { flex: 0 0 120px; aspect-ratio: 4/3; background: var(--c-bg); border-radius: var(--radius-sm); overflow: hidden; }
.article-item .thumb img { width:100%; height:100%; object-fit: cover; }
.article-item .info { flex: 1; min-width: 0; }
.article-item h3 { font-size: 16px; margin: 0 0 8px; }
.article-item h3 a { color: var(--c-ink); }
.article-item:hover h3 a { color: var(--c-blue); }
.article-item .meta { font-size: 12px; color: var(--c-muted); margin-bottom: 8px; }
.article-item .meta .dot { margin: 0 8px; }
.article-item .excerpt { font-size: 13px; color: var(--c-ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: #fff; color: var(--c-ink-2); font-size: 13px;
}
.pagination a:hover { border-color: var(--c-blue); color: var(--c-blue); }
.pagination .current { background: var(--c-gradient); color: #fff; border-color: transparent; font-weight: 600; }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ---------- layout helpers ---------- */
.layout { display: flex; flex-direction: column; gap: 24px; }
.sidebar { order: 2; }
.content-main { order: 1; }

/* category sidebar */
.cat-panel { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 8px; }
.cat-panel h4 { padding: 12px 12px 8px; font-size: 16px; color: var(--c-blue-deep); }
.cat-list .cat-item > a {
  display: block; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--c-ink-2); font-size: 14px;
}
.cat-list .cat-item > a:hover { background: var(--c-gradient-soft); color: var(--c-blue); }
.cat-list .cat-item.active > a { background: var(--c-gradient); color: #fff; font-weight: 600; }
.cat-list .sub { padding-left: 14px; }
.cat-list .sub a { font-size: 13px; padding: 7px 12px; color: var(--c-muted); }
.cat-list .sub a:hover { color: var(--c-blue); }

/* ---------- detail page ---------- */
.detail-wrap { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 24px; }
.detail-head { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--c-line); }
.detail-head h1 { font-size: 22px; margin: 0 0 10px; }
.detail-meta { font-size: 13px; color: var(--c-muted); }
.detail-meta span { margin-right: 18px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.gallery img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: var(--radius-sm); cursor: pointer; }
.prose { color: var(--c-ink); font-size: 15px; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 12px 0; }
.prose p { margin-bottom: 1em; }
.prose h1, .prose h2, .prose h3 { margin: 1.2em 0 .5em; }
.prose ul, .prose ol { padding-left: 1.5em; margin-bottom: 1em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.prose th, .prose td { border: 1px solid var(--c-line); padding: 8px 10px; font-size: 13px; }
.prose th { background: var(--c-bg); }
.article-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--c-line); flex-wrap: wrap; }
.article-nav a { font-size: 13px; color: var(--c-ink-2); max-width: 48%; }
.article-nav a:hover { color: var(--c-blue); }
.article-nav .label { color: var(--c-muted); font-size: 12px; display: block; }

/* ---------- home sections ---------- */
.intro-strip { background: var(--c-white); border-top: 3px solid; border-image: var(--c-gradient) 1; }
.intro-strip .container { display: grid; gap: 20px; padding: 40px 16px; }
.intro-strip h2 { font-size: 24px; color: var(--c-blue-deep); }
.intro-strip .lead { color: var(--c-ink-2); }
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.feature-card {
  background: var(--c-gradient-soft); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 22px 18px; text-align: center; transition: .25s;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-card .ic { font-size: 28px; font-weight: 800; background: var(--c-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.feature-card h4 { margin: 8px 0 4px; font-size: 15px; }
.feature-card p { font-size: 12px; color: var(--c-muted); margin: 0; }

.news-mini { display: grid; gap: 12px; }
.news-mini .row { display: flex; gap: 12px; padding: 12px; background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius-sm); align-items: center; }
.news-mini .row:hover { border-color: var(--c-blue); }
.news-mini .date { flex: 0 0 64px; text-align: center; background: var(--c-gradient-soft); border-radius: var(--radius-sm); padding: 8px 4px; }
.news-mini .date b { display: block; font-size: 18px; color: var(--c-blue); line-height: 1; }
.news-mini .date small { font-size: 11px; color: var(--c-muted); }
.news-mini .txt { flex: 1; min-width: 0; }
.news-mini .txt a { color: var(--c-ink); font-weight: 500; font-size: 14px; }
.news-mini .txt a:hover { color: var(--c-blue); }
.news-mini .txt p { font-size: 12px; color: var(--c-muted); margin: 2px 0 0; }

/* ---------- contact ---------- */
.contact-grid { display: grid; gap: 20px; }
.contact-info-card { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 28px; }
.contact-info-card .item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--c-line); }
.contact-info-card .item:last-child { border-bottom: none; }
.contact-info-card .ic { flex: 0 0 40px; height: 40px; border-radius: 50%; background: var(--c-gradient); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.contact-info-card .label { font-size: 12px; color: var(--c-muted); }
.contact-info-card .val { font-size: 16px; font-weight: 600; color: var(--c-ink); }
.map-placeholder { height: 260px; border-radius: var(--radius); background: var(--c-gradient-soft); border: 1px solid var(--c-line); display: flex; align-items: center; justify-content: center; color: var(--c-muted); }

/* ---------- jobs ---------- */
.job-list { display: grid; gap: 14px; }
.job-card { background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 20px; transition: .2s; }
.job-card:hover { box-shadow: var(--shadow); border-color: var(--c-blue); }
.job-card h3 { font-size: 18px; margin: 0 0 8px; }
.job-card h3 a { color: var(--c-ink); }
.job-card:hover h3 a { color: var(--c-blue); }
.job-card .tags { display: flex; gap: 10px; font-size: 12px; color: var(--c-muted); }

/* ---------- footer ---------- */
.site-footer { background: var(--c-blue-deep); color: rgba(255,255,255,.78); margin-top: 48px; }
.footer-grid { display: grid; gap: 30px; padding: 44px 16px 28px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 16px; position: relative; padding-bottom: 8px; }
.footer-col h4::after { content:""; position:absolute; left:0; bottom:0; width:28px; height:2px; background: var(--c-green); }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-brand img { filter: brightness(0) invert(1); opacity: .95; }
.footer-brand strong { color: #fff; font-size: 16px; }
.footer-tagline { color: var(--c-green); font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.footer-desc { font-size: 13px; line-height: 1.8; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,.75); font-size: 13px; }
.footer-links a:hover { color: #fff; }
.contact-list li { display: flex; gap: 8px; font-size: 13px; margin-bottom: 10px; line-height: 1.6; }
.contact-list .ci-label { flex: 0 0 44px; color: var(--c-green); font-weight: 600; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 16px 0; font-size: 12px; color: rgba(255,255,255,.5); text-align: center; }

/* ---------- empty / 404 ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--c-muted); }
.empty h2 { color: var(--c-ink-2); }
.page-404 { text-align: center; padding: 80px 20px; }
.page-404 .code { font-size: 72px; font-weight: 800; background: var(--c-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* =====================================================================
   响应式：平板 >= 768px
   ===================================================================== */
@media (min-width: 768px) {
  body { font-size: 16px; }
  .section { padding: 64px 0; }
  .section-title h2 { font-size: 30px; }
  .hero { padding: 72px 0 84px; }
  .hero h1 { font-size: 40px; }
  .hero p { font-size: 18px; }
  .page-banner { padding: 52px 0; }
  .page-banner h1 { font-size: 32px; }
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .product-card .body { padding: 14px 18px 18px; }
  .product-card h3 { font-size: 16px; }
  .feature-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .intro-strip .container { grid-template-columns: 1.2fr 1fr; align-items: center; }
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 2fr 1fr 1.4fr; }
  .layout { flex-direction: row; }
  .sidebar { order: 1; flex: 0 0 240px; }
  .content-main { order: 2; flex: 1; min-width: 0; }
}

/* =====================================================================
   响应式：桌面 >= 1024px — 显示水平导航
   ===================================================================== */
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .main-nav { display: flex !important; flex-direction: row; align-items: center; gap: 4px; position: static; box-shadow: none; border: none; padding: 0; background: transparent; }
  .main-nav .nav-link { border: none; padding: 8px 14px; font-size: 15px; border-radius: var(--radius-sm); }
  .main-nav .nav-link:hover { background: var(--c-gradient-soft); color: var(--c-blue); }
  .main-nav .nav-link.active { background: var(--c-gradient); color: #fff; }
  .main-nav .nav-link.active::before { display: none; }
  .product-grid { grid-template-columns: repeat(4, 1fr); }
  .gallery { grid-template-columns: repeat(4, 1fr); }
  .news-mini { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1200px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto; }
}

/* 卡片补充 */
.product-card .pic a { display: block; width: 100%; height: 100%; }
.pic-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: var(--c-gradient-soft); color: var(--c-blue); font-size: 32px; font-weight: 800; }
.article-item .info { min-width: 0; }
.news-mini .row { color: inherit; text-decoration: none; }
.news-mini .news-title { color: var(--c-ink); font-weight: 600; font-size: 14px; display: block; }
.news-mini .row:hover .news-title { color: var(--c-blue); }
.news-mini .txt { min-width: 0; flex: 1; }
