/* ========== 全局设计系统：统一墨绿基准色 ========== */
:root {
  /* 基准色 — 来自 Logo-icon 的墨绿 (#5f8966) */
  --primary: #5f8966;
  --primary-hover: #6f9e78; /* 悬停/高亮版本 */
  --primary-dark: #3e6b4c;
  --primary-light: #88b391;
  --primary-soft: rgba(95, 137, 102, 0.12);
  --primary-glass: rgba(95, 137, 102, 0.5);
  --primary-glass-strong: rgba(95, 137, 102, 0.75);

  /* 中性色系统 (优雅灰阶) */
  --gray-50: #f8faf7;
  --gray-100: #f0f3ef;
  --gray-200: #e2e8e0;
  --gray-600: #5f6c63;
  --gray-800: #2d3a2f;
  --white: #ffffff;
  --black-alpha-3: rgba(0, 0, 0, 0.03);
  --black-alpha-8: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 12px 28px -8px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 25px 35px -12px rgba(0, 0, 0, 0.2);
  --shadow-focus: 0 6px 16px rgba(95, 137, 102, 0.2);

  /* 导航变量基于主色 */
  --nav-bg: var(--white);
  --nav-text: var(--primary);
  --nav-text-hover: var(--primary-hover);
  --nav-icon: #bdd3c2;
  --nav-border: #eaf0e6;

  /* 旧遗留变量统一迁移 (保证全站无杂乱绿) */
  --green-accent: var(--primary);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f4f7f2;
  font-family: system-ui, "Segoe UI", "SF Pro Text", "Noto Sans SC", sans-serif;
  min-height: 100vh;
  padding-top: 64px;
}

/* 柔和氛围光晕 (基于主色的通透感) */
body::before {
  content: "";
  position: fixed;
  top: -40%;
  left: -20%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(
    circle,
    rgba(95, 137, 102, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  bottom: -30%;
  right: -15%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(
    circle,
    rgba(95, 137, 102, 0.045) 0%,
    transparent 65%
  );
  pointer-events: none;
  z-index: 0;
}

/* ========== 导航栏 (白底 · 主色文字) ========== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 64px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  transition: box-shadow 0.3s ease;
}

nav.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.nav-inner {
  max-width: 1100px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: white;
  transition: background 0.25s ease;
}

.logo:hover .logo-icon {
  background: var(--primary-hover);
}

.logo-text {
  font-weight: 800;
  font-size: 18px;
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  color: var(--nav-text);
  border-radius: 6px;
  transition:
    color 0.25s ease,
    background 0.25s ease;
  overflow: hidden;
}

.nav-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 6px;
  color: var(--nav-icon);
  transition: color 0.25s ease;
}

.nav-links a:hover .nav-icon,
.nav-links a.active .nav-icon {
  color: var(--primary-hover);
}

.nav-links a::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: radial-gradient(circle, var(--black-alpha-3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.nav-links a:hover {
  color: var(--nav-text-hover);
  background: rgba(95, 137, 102, 0.15);
}

.nav-links a:hover::before {
  opacity: 1;
}

.nav-links a.active {
  color: var(--nav-text-hover);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transform: translateX(-50%);
  transition: width 0.25s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 50%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-ghost,
.btn-primary {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-ghost {
  color: var(--primary);
  background: transparent;
  border: 1px solid #cddfcd;
}

.btn-ghost:hover {
  color: var(--primary-hover);
  border-color: var(--primary);
  background: #f9fbf8;
}

.btn-primary {
  color: white;
  background: var(--primary);
  border: none;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }
  .logo-text {
    display: none;
  }
  .btn-ghost {
    display: none;
  }
}

/* ========== 主内容容器 ========== */
.background-container {
  position: relative;
  width: 100%;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 24px 64px 24px;
}

.background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: radial-gradient(
    circle at 10% 20%,
    rgba(235, 245, 230, 0.5),
    rgba(255, 255, 255, 0.92)
  );
  pointer-events: none;
}

.content-area {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

/* 统一墨绿调背景卡片 (原背景图+绿色系滤镜) */
.unified-background-card {
  width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 16px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  background-image: url("../assets/Bam.png");
  background-size: auto;
  /* cover为等比缩放auto */
  background-position: center center;
  background-repeat: repeat;
  /* no-repeat或者repeat,或者repeat-x */
}

.unified-background-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: brightness(0.92);
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
}

.card-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.avatar-container {
  position: relative;
  margin-bottom: 8px;
  padding: 30px 0px 0px 0px;
}

.avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: #f8f9fc;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 12px 28px -8px rgba(0, 0, 0, 0.2),
    0 0 0 4px rgba(255, 255, 255, 0.9),
    0 0 0 6px rgba(255, 255, 255, 0.4);
  transition: transform 0.2s ease;
}

.avatar:hover {
  transform: scale(1.02);
}

.avatar img {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* 搜索区 (墨绿半透明玻璃效果) */
.search-container {
  width: 100%;
  max-width: 100%;
}

.search-box {
  background: var(--primary-glass);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  padding: 12px;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.search-box:hover {
  background: var(--primary-glass-strong);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  justify-content: center;
}

.search-box .tag {
  padding: 5px 14px;
  background: rgba(255, 255, 255, 0.411);
  backdrop-filter: blur(2px);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-dark);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  border: 0.5px solid rgba(95, 137, 102, 0.3);

  /* 新增：使用 flex 布局让图标和文字完美居中对齐 */
  display: inline-flex;
  align-items: center;
  gap: 5px; /* 新增：控制图标和文字之间的间距，取代以前的字间距 */
}

.search-box .tag:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -8px var(--primary-soft);
  border-color: var(--primary);
}

/* 新增：针对图标的专属样式 */
.search-box .tag .tag-icon {
  width: 20px; /* 控制图标宽度，建议和 font-size: 0.8rem 差不多大，通常 14px-16px 比较合适 */
  height: 20px; /* 控制图标高度，保持宽高一致防止变形 */
  object-fit: contain; /* 保证图标按比例缩放，不变形 */
  /* 因为父级已经用了 flex 和 align-items: center，这里不需要再写 vertical-align 了 */
}

.input {
  width: 100%;
  height: 32px;
  padding: 0 18px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1.5px solid rgba(95, 137, 102, 0.2);
  outline: none;
  background: white;
  transition: all 0.25s ease;
  color: #1e2a1f;
}

.input::placeholder {
  color: #8aa38e;
  font-weight: 400;
}

.input:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(95, 137, 102, 0.15);
}

.input:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
  transform: scale(1.01);
}

/* ========== 工坊卡片网格 ========== */
.showcase-section {
  width: 100%;
  margin: 16px 0 20px;
}

.workshop-container {
  max-width: 1400px;
  margin: 0 auto;
}

.showcase-section h1 {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  margin-bottom: 48px;
  position: relative;
}

.showcase-section h1::after {
  content: "";
  display: block;
  width: 70px;
  height: 4px;
  background: var(--primary);
  border-radius: 4px;
  margin: 12px auto 0;
  opacity: 0.7;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: stretch;
}

.product-card {
  position: relative;
  aspect-ratio: 12 / 8;
  background-color: #f0f3ee;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition:
    transform 0.28s cubic-bezier(0.2, 0.9, 0.4, 1.1),
    box-shadow 0.3s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 28px 34px -12px rgba(0, 0, 0, 0.25);
}

.card-media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.product-card:hover .card-media img {
  transform: scale(1.03);
}

/* 卡片右上角标签组 — 全系墨绿变体设计 */
.card-tags {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 12;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.card-tags .tag {
  display: inline-block;
  padding: 5px 12px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-radius: 8px;
  backdrop-filter: blur(3px);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  pointer-events: auto;
  cursor: default;
  text-transform: uppercase;
  border: none;
  transform: none;
  line-height: 1.3;
}

.card-tags .tag:hover {
  transform: scale(1.02);
}

.external-icons {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 15;
  display: flex;
  gap: 6px;
}
.icon-link {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 5px;
  overflow: hidden;
  background-color: #ffffff00;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}
.icon-link:hover {
  transform: scale(1.3);
}
.icon-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-color: #ffffff00; /* 占位色 */
}

/* 全新统一墨绿主题标签风格 (保留差异化视觉但全部源自基准色系) */
.tag-new {
  background: linear-gradient(105deg, #4c8b5e, var(--primary-dark));
  box-shadow: 0 2px 8px rgba(72, 130, 85, 0.3);
}
.tag-off {
  background: linear-gradient(105deg, #5f7a5a, #3e6045);
  box-shadow: 0 2px 8px rgba(67, 110, 75, 0.3);
}
.tag-free {
  background: linear-gradient(105deg, #6f9e78, #478a58);
  box-shadow: 0 2px 8px rgba(95, 137, 102, 0.4);
}
.tag-hot {
  background: linear-gradient(105deg, #7dab6e, #5e8e52);
  box-shadow: 0 2px 8px rgba(100, 140, 85, 0.35);
}
.tag-exclusive {
  background: linear-gradient(105deg, #466d54, #2d543f);
  box-shadow: 0 2px 8px rgba(56, 94, 67, 0.4);
}
.tag-limited {
  background: linear-gradient(105deg, #609769, #3d6e49);
  box-shadow: 0 2px 8px rgba(72, 119, 77, 0.3);
}

.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.97);
  padding: 12px 16px 16px;
  border-radius: 0 0 8px 8px;
  z-index: 10;
  border-top: 1px solid rgba(0, 0, 0, 0.02);
  backdrop-filter: blur(2px);
}

.product-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: -0.3px;
  line-height: 1.3;
}

/* 底部绿色装饰条 — 纯正墨绿渐变 */
.bottom-green-area {
  width: 100%;
  height: 64px;
  background: linear-gradient(
    33deg,
    var(--primary-glass) 0%,
    var(--primary) 100%
  );
  border-radius: 8px;
  box-shadow: 0 12px 18px -8px rgba(62, 107, 76, 0.25);
  transition: all 0.25s ease;
  cursor: default;
  margin-top: 8px;
}

.bottom-green-area:hover {
  background: linear-gradient(99deg, var(--primary-dark), #2b553b);
}

.footer-info {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 12px;
  margin-top: 4px;
}
.footer-info p {
  margin: 0;
  letter-spacing: 0.3px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .card-grid {
    gap: 20px;
  }
  .product-title {
    font-size: 1rem;
  }
  .card-info {
    padding: 12px 14px;
  }
}

@media (max-width: 780px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .showcase-section h1 {
    font-size: 2rem;
    margin-bottom: 32px;
  }
}

@media (max-width: 640px) {
  .background-container {
    padding: 0 16px 48px;
  }
  .unified-background-card {
    padding: 28px 20px 36px;
  }
  .avatar {
    width: 100px;
    height: 100px;
  }
  .avatar img {
    width: 100px;
    height: 100px;
  }
  .search-box .tag {
    padding: 4px 12px;
    font-size: 0.75rem;
  }
  .input {
    height: 48px;
  }
  .bottom-green-area {
    height: 54px;
  }
}

@media (max-width: 540px) {
  .card-grid {
    grid-template-columns: 1fr;
    max-width: 380px;
    margin: 0 auto;
    gap: 24px;
  }
  .product-card {
    aspect-ratio: 3/4;
  }
}

.search-container {
  animation: fadeSlideUp 0.5s ease-out;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ========== 详情页专用样式 ========== */
.detail-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.detail-header {
  position: relative;
  height: 400px;
  background-size: cover;
  background-position: center;
  background-color: #cfdfce;
}

.detail-header .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: brightness(0.85);
}

.detail-content {
  padding: 32px 40px;
}

.detail-title {
  font-size: 2rem;
  color: var(--primary-dark);
  margin-bottom: 16px;
}

.detail-tags {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.detail-description {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gray-800);
  margin-bottom: 32px;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  cursor: pointer;
}
.modal-container {
  position: relative;
  max-width: 700px;
  width: 90%;
  background: var(--white);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: fadeScale 0.25s ease;
}
@keyframes fadeScale {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.modal-header {
  height: 220px;
  background-size: cover;
  background-position: center;
  background-color: #cfdfce;
}
.modal-body {
  padding: 24px 32px 32px;
}
.modal-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 12px;
}
.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.modal-tags .tag {
  /* 直接复用.card-tags .tag + 各类.tag-* 的样式，无需额外定义 */
  display: inline-block;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  text-transform: uppercase;
}
.modal-description {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--gray-800);
  margin-bottom: 28px;
}
/* 下载按钮组 */
.modal-downloads {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--gray-200);
  padding-top: 24px;
}
.download-btn {
  flex: 1;
  min-width: 100px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 40px;
  background: var(--primary);
  color: white;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}
.download-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -8px var(--primary-soft);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 40px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  color: var(--primary-dark);
  transition: all 0.2s;
}
.modal-close:hover {
  background: white;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 悬浮卡片 */

.float-card {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  width: 160px;
  background: #5f8966; /* 卡片背景色 */
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  text-decoration: none; /* 去除a标签下划线 */
}

/* 鼠标悬停时稍微放大 */
.float-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* 卡片里的图片 */
.float-card-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}

/* 文字区域 */
.float-card-content {
  padding: 8px 8px;
}

/* 大标题 */
.float-card-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px 0;
  letter-spacing: -0.02em;
}

/* 小标题/描述 */
.float-card-desc {
  color: #cccccc;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 16px 0;
}

/* 底部按钮 */
.float-card-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

/* 关闭按钮 (可选) */
.float-card-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #000000c0;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 14px;
  line-height: 24px;
  text-align: center;
  display: none; /* 默认隐藏，鼠标移入卡片时显示 */
}
.float-card:hover .float-card-close {
  display: block;
}
