/* ============================================================
   Fenxing Flock — 全局样式表
   配色：工业蓝灰（深蓝 #1a3655 / 钢蓝 #4a6d8c / 金色点缀 #c4953d）
   适用：B2B 外贸官网，稳重专业风格
   修改指南：改颜色改最上面的 CSS 变量即可全局生效
   ============================================================ */

/* ============================================================
   📌 一、CSS 变量（配色/圆角等全局设置）
   改颜色只需改这里，整个网站自动生效
   ============================================================ */
:root {
  --navy: #1a3655;           /* 主色-深蓝，用于 header/footer/标题 */
  --navy-light: #234b73;     /* 浅蓝，hover 状态 */
  --steel: #4a6d8c;          /* 钢蓝，次要元素 */
  --steel-light: #7d9bb8;    /* 浅钢蓝 */
  --gray-dark: #333333;      /* 正文深灰 */
  --gray: #666666;           /* 正文中灰 */
  --gray-light: #f5f6f8;     /* 背景浅灰，用于卡片/区域底色 */
  --white: #ffffff;
  --accent: #c4953d;         /* 金色点缀，用于 logo 高亮/CTA 按钮 */
  --border: #e0e4e8;         /* 边框色 */
  --radius: 6px;             /* 全局圆角 */
}

/* ============================================================
   📌 二、基础重置（不用改）
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;   /* 锚点平滑滚动 */
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--gray-dark);
  line-height: 1.7;
  background: var(--white);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}

a {
  color: var(--navy-light);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent);
}

/* ============================================================
   📌 三、通用工具类
   .container  → 页面内容居中容器（最大宽度 1100px）
   .section    → 标准区块上下间距
   .btn        → 按钮基础样式
   ============================================================ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 80px 0;           /* 每个区块的上下间距 */
}

/* 区块标题（居中大标题） */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  margin-bottom: 16px;
}

/* 区块副标题（标题下方灰色说明文字） */
.section-subtitle {
  font-size: 1.05rem;
  color: var(--gray);
  text-align: center;
  margin-bottom: 50px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- 按钮 ---- */
.btn {
  display: inline-block;
  padding: 12px 32px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: all 0.25s;
  border: 2px solid transparent;
}

/* 实心按钮（主 CTA） */
.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--navy-light);
  color: var(--white);
}

/* 空心按钮（次要 CTA） */
.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
}

/* ============================================================
   📌 四、Header（顶部导航栏）
   固定在页面顶部，移动端自动折叠
   ============================================================ */
header {
  background: var(--navy);
  padding: 16px 0;
  position: sticky;          /* 滚动时吸顶 */
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;  /* logo 左，导航右 */
}

/* Logo */
.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
}
.logo span {
  color: var(--accent);      /* "Flock" 用金色突出 */
}

/* 导航菜单 */
nav ul {
  display: flex;
  list-style: none;
  gap: 28px;                 /* 菜单项间距 */
}

nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  font-weight: 500;
}
nav a:hover {
  color: var(--accent);
}

/* ---- 移动端汉堡菜单按钮 ---- */
.nav-toggle {
  display: none;             /* 桌面端隐藏 */
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  margin: 5px 0;
}

/* 移动端：显示汉堡菜单，导航变为下拉式 */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  nav ul {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
  }
  nav ul.active {
    display: flex;           /* JS 切换此类来展开/收起 */
  }
}

/* ============================================================
   📌 五、首页 Hero 区域
   大标题 + 副标题 + 两个 CTA 按钮
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  padding: 100px 0 80px;
  text-align: center;
}

.hero h1 {
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.3;
}
.hero h1 span {
  color: var(--accent);      /* 关键词用金色突出 */
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 650px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero .btn-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}
.hero .btn-primary:hover {
  background: #d4a24a;
  border-color: #d4a24a;
}

.hero .btn-outline {
  color: var(--white);
  border-color: rgba(255,255,255,0.6);
}
.hero .btn-outline:hover {
  background: rgba(255,255,255,0.1);
}

/* ============================================================
   📌 六、首页产品卡片（What We Supply）
   4 列网格，emoji 图标 + 标题 + 描述
   ============================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.product-card {
  background: var(--gray-light);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  transition: transform 0.25s, box-shadow 0.25s;
}
.product-card:hover {
  transform: translateY(-4px);   /* 悬浮时微微上浮 */
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.product-card .icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.product-card h3 {
  font-size: 1.2rem;
  color: var(--navy);
  margin-bottom: 10px;
}

.product-card p {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.6;
}

/* ============================================================
   📌 七、首页 Why Work With Us
   4 列优势展示
   ============================================================ */
.why-us {
  background: var(--gray-light);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 28px;
}

.why-item {
  text-align: center;
  padding: 28px 20px;
}

.why-item .why-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.why-item h4 {
  font-size: 1.05rem;
  color: var(--navy);
  margin-bottom: 8px;
}

.why-item p {
  font-size: 0.9rem;
  color: var(--gray);
}

/* ============================================================
   📌 八、内页顶部横幅（Products / About / Resources / Contact）
   ============================================================ */
.page-banner {
  background: var(--gray-light);
  padding: 60px 0;
  text-align: center;
}

.page-banner h1 {
  font-size: 2.2rem;
  color: var(--navy);
}

/* ============================================================
   📌 九、About Us 页面
   左图右文布局，移动端上下堆叠
   ============================================================ */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.about-content img {
  border-radius: var(--radius);
}

.about-text h2 {
  font-size: 1.6rem;
  color: var(--navy);
  margin-bottom: 16px;
}

.about-text p {
  color: var(--gray);
  margin-bottom: 14px;
  font-size: 0.98rem;
}

@media (max-width: 768px) {
  .about-content {
    grid-template-columns: 1fr;   /* 手机端单列 */
  }
}

/* ============================================================
   📌 十、Products 页面
   每个产品一行：左图右文（交替），含规格表格
   ============================================================ */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: start;
  margin-bottom: 60px;
  padding-bottom: 60px;
  border-bottom: 1px solid var(--border);
}

.product-detail:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.product-detail img {
  border-radius: var(--radius);
}

.product-info h2 {
  font-size: 1.55rem;
  color: var(--navy);
  margin-bottom: 14px;
}

.product-info p {
  color: var(--gray);
  margin-bottom: 14px;
  font-size: 0.95rem;
}

/* 产品规格列表 */
.product-info .specs {
  list-style: none;
  margin-bottom: 20px;
}

.product-info .specs li {
  padding: 6px 0;
  font-size: 0.93rem;
  color: var(--gray-dark);
  border-bottom: 1px solid var(--border);
}

.product-info .specs li strong {
  color: var(--navy);
  margin-right: 8px;
}

@media (max-width: 768px) {
  .product-detail {
    grid-template-columns: 1fr;   /* 手机端单列 */
  }
}

/* ---- 规格对比表格（产品页 & 文章页共用） ---- */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.93rem;
}

.spec-table th {
  background: var(--navy);
  color: var(--white);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}

.spec-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.spec-table tr:nth-child(even) {
  background: var(--gray-light);   /* 斑马条纹 */
}

/* ============================================================
   📌 十一、Resources 页面（文章列表）
   ============================================================ */
.article-list {
  display: grid;
  gap: 32px;
}

/* 每篇文章卡片：左缩略图 + 右信息 */
.article-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.25s;
}
.article-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.article-card img {
  width: 100%;
}

.article-info h3 {
  font-size: 1.2rem;
  color: var(--navy);
  margin-bottom: 8px;
}

.article-info .date {
  font-size: 0.85rem;
  color: var(--steel-light);
  margin-bottom: 10px;
}

.article-info p {
  font-size: 0.93rem;
  color: var(--gray);
  margin-bottom: 12px;
}

.article-info .read-more {
  font-weight: 600;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .article-card {
    grid-template-columns: 1fr;    /* 手机端单列 */
  }
}

/* ---- 文章正文样式（articles/ 下的文章页面共用） ---- */
.article-full {
  max-width: 750px;
  margin: 0 auto;
}

.article-full h2 {
  font-size: 1.5rem;
  color: var(--navy);
  margin: 30px 0 14px;
}
.article-full h2:first-of-type {
  margin-top: 0;
}

.article-full p {
  margin-bottom: 16px;
  color: var(--gray);
  line-height: 1.8;
}

.article-full ul, .article-full ol {
  margin: 0 0 20px 20px;
  color: var(--gray);
  line-height: 1.8;
}

.article-full table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.article-full th {
  background: var(--navy);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
}

.article-full td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

/* ---- FAQ 区块（文章页 & 联系页共用） ---- */
.faq-section {
  background: var(--gray-light);
  padding: 28px;
  border-radius: var(--radius);
  margin: 30px 0;
}

.faq-section h3 {
  color: var(--navy);
  margin-bottom: 16px;
}

.faq-section dt {
  font-weight: 600;
  color: var(--navy);
  margin-top: 14px;
  margin-bottom: 4px;
}

.faq-section dd {
  color: var(--gray);
  margin-left: 0;
  margin-bottom: 10px;
}

/* ============================================================
   📌 十二、Contact 页面
   左联系信息 + 右询盘表单
   ============================================================ */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
}

.contact-info h2 {
  font-size: 1.55rem;
  color: var(--navy);
  margin-bottom: 20px;
}

/* 联系方式条目（图标+文字） */
.contact-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.contact-item .icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.contact-item h4 {
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: 2px;
}

.contact-item p {
  font-size: 0.93rem;
  color: var(--gray);
}

/* ---- 询盘表单 ---- */
.contact-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--navy);
  font-size: 0.9rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  margin-bottom: 18px;
  font-family: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--steel);
  box-shadow: 0 0 0 3px rgba(74,109,140,0.15);
}

@media (max-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr;    /* 手机端单列 */
  }
}

/* ============================================================
   📌 十三、Footer（页脚）
   4 列：品牌 / 产品 / 链接 / 联系
   ============================================================ */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.75);
  padding: 50px 0 30px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 36px;
  margin-bottom: 36px;
}

.footer-col h4 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 14px;
}

.footer-col p, .footer-col a {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  display: block;
  margin-bottom: 6px;
}

.footer-col a:hover {
  color: var(--accent);
}

/* 底部版权条 */
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
}

/* ============================================================
   📌 十四、色卡画廊（Tab 切换 + 网格缩略图）
   用于产品页展示绒毛色卡，按材质分类
   ============================================================ */

/* ---- Tab 标签栏 ---- */
.swatch-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 2px solid var(--border);
}

/* 🔧 每个 Tab 按钮 */
.swatch-tab {
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;       /* 覆盖父级 border-bottom */
  cursor: pointer;
  transition: all 0.2s;
}
.swatch-tab:hover {
  color: var(--navy);
}
/* 当前选中的 Tab */
.swatch-tab.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

/* ---- 色卡网格（每个 Tab 对应一个面板） ---- */
.swatch-panel {
  display: none;             /* 默认隐藏 */
  padding: 20px 0;
}
.swatch-panel.active {
  display: block;            /* JS 切换显示 */
}

/* 网格容器：每行 4 张 */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* 🔧 每张色卡缩略图 */
.swatch-item {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--white);
}
.swatch-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.swatch-item img {
  width: 100%;
  aspect-ratio: 4 / 3;       /* 保持统一比例 */
  object-fit: cover;
  display: block;
}
/* 色卡下方的标签 */
.swatch-label {
  padding: 8px 10px;
  font-size: 0.82rem;
  color: var(--navy);
  text-align: center;
  font-weight: 500;
  background: var(--gray-light);
}

/* 移动端：每行 2 张 */
@media (max-width: 768px) {
  .swatch-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .swatch-tab {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
}

/* ============================================================
   📌 十五、灯箱（Lightbox）—— 点击色卡弹出大图
   ============================================================ */

/* 灯箱遮罩层 */
.lightbox {
  display: none;             /* 默认隐藏 */
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.lightbox.open {
  display: flex;             /* JS 打开时添加 .open */
}

/* 灯箱中的大图 */
.lightbox img {
  max-width: 90vw;
  max-height: 75vh;
  border-radius: 4px;
  object-fit: contain;
}

/* 灯箱中的标题 */
.lightbox-caption {
  color: var(--white);
  margin-top: 16px;
  font-size: 0.95rem;
  text-align: center;
  max-width: 600px;
}

/* 关闭按钮（右上角 ✕） */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  transition: opacity 0.2s;
  z-index: 1;
}
.lightbox-close:hover {
  opacity: 0.7;
}

/* 左右切换按钮 */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--white);
  font-size: 2.5rem;
  cursor: pointer;
  background: rgba(255,255,255,0.1);
  border: none;
  padding: 16px 12px;
  border-radius: 4px;
  transition: background 0.2s;
}
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.25);
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

@media (max-width: 768px) {
  .lightbox-prev, .lightbox-next {
    font-size: 1.8rem;
    padding: 10px 8px;
  }
}

/* ============================================================
   📌 十六、移动端适配
   ============================================================ */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }
  .section {
    padding: 50px 0;
  }
  .section-title {
    font-size: 1.5rem;
  }
}
