/*
 * qxzt Theme - CSS Styles
 * 深灰+琥珀色配色，支持黑夜模式
 */

/* ===== 基础样式 ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #111827;
  background-color: #F9FAFB;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.dark body {
  color: #F9FAFB;
  background-color: #111827;
}

/* ===== 容器 ===== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* ===== Main 内容区 - 粘性页脚支持 ===== */
main {
  flex: 1 0 auto;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;
  transition: background-color 0.3s ease;
}

.dark .header {
  background-color: #1F2937;
  border-bottom-color: #374151;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.logo {
  flex-shrink: 0;
}

.logo img {
  height: 36px;
  width: auto;
}

/* Logo 文字样式 (无图片时) */
.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #F59E0B;
}

/* 导航图标 (SVG) */
.nav-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* 切换按钮图标 (SVG) */
.toggle-icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* 汉堡菜单图标 (SVG) */
.menu-icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* 搜索框容器 */
.search-box-inner {
  position: relative;
}

/* 搜索图标 (SVG) */
.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9CA3AF;
  width: 1rem;
  height: 1rem;
  pointer-events: none;
}

/* 搜索框 */
.search-box {
  flex: 1;
  max-width: 480px;
  display: none;
}

@media (min-width: 768px) {
  .search-box {
    display: block;
  }
}

.search-input {
  width: 100%;
  padding: 0.625rem 1rem 0.625rem 2.75rem;
  border: 1px solid #D1D5DB;
  border-radius: 9999px;
  background-color: #F3F4F6;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
  background-color: #FFFFFF;
}

.dark .search-input {
  background-color: #374151;
  border-color: #4B5563;
  color: #F9FAFB;
}

.dark .search-input:focus {
  background-color: #1F2937;
}

/* 桌面端导航 */
.desktop-nav {
  display: none;
}

@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
}

/* 移动端导航 */
.mobile-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 768px) {
  .mobile-nav {
    display: none;
  }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4B5563;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: #F59E0B;
  background-color: #FEF3C7;
}

.dark .nav-link {
  color: #D1D5DB;
}

.dark .nav-link:hover {
  color: #FBBF24;
  background-color: rgba(251, 191, 36, 0.1);
}

.nav-link-primary {
  background-color: #EA580C;
  color: #FFFFFF;
}

.nav-link-primary:hover {
  background-color: #C2410C;
  color: #FFFFFF;
}

.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #4B5563;
  cursor: pointer;
}

.dark .mobile-menu-btn {
  color: #D1D5DB;
}

.dark-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #4B5563;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.25rem;
}

.dark-mode-toggle:hover {
  background-color: #F3F4F6;
}

.dark .dark-mode-toggle {
  color: #FBBF24;
}

.dark .dark-mode-toggle:hover {
  background-color: #374151;
}

/* ===== Hero 英雄区 ===== */
.hero {
  background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
  padding: 1.25rem 0;
  text-align: center;
  color: #FFFFFF;
}

@media (min-width: 768px) {
  .hero {
    padding: 4rem 0;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding: 5rem 0;
  }
}

.hero-title {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 2.25rem;
    margin: 0 0 1rem;
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: 2.75rem;
  }
}

.hero-title .highlight {
  color: #FBBF24;
}

.hero-subtitle {
  font-size: 0.8125rem;
  color: #D1D5DB;
  max-width: 640px;
  margin: 0 auto 0.75rem;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 1.125rem;
    margin: 0 auto 1.5rem;
  }
}

.hero-features {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0.375rem;
}

@media (min-width: 768px) {
  .hero-features {
    gap: 0.75rem;
  }
}

.hero-feature {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  font-size: 0.6875rem;
  color: #FFFFFF;
}

@media (min-width: 768px) {
  .hero-feature {
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

.hero-icon {
  width: 0.75rem;
  height: 0.75rem;
  flex-shrink: 0;
  color: #FBBF24;
}

@media (min-width: 768px) {
  .hero-icon {
    width: 1rem;
    height: 1rem;
  }
}

/* ===== Homepage Announcement 首页公告 ===== */
.homepage-announcement {
  padding: 0.75rem 0;
}

@media (min-width: 768px) {
  .homepage-announcement {
    padding: 1.5rem 0;
  }
}

.announcement-card {
  background-color: #FFFFFF;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid #E5E7EB;
}

.dark .announcement-card {
  background-color: #1F2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border-color: #374151;
}

.announcement-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.75rem;
}

.dark .announcement-title {
  color: #F9FAFB;
}

.announcement-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  color: #F59E0B;
}

.announcement-content {
  font-size: 0.875rem;
  color: #4B5563;
  line-height: 1.6;
}

.announcement-content p {
  margin: 0 0 0.5rem;
}

.announcement-content p:last-child {
  margin-bottom: 0;
}

.dark .announcement-content {
  color: #D1D5DB;
}

/* Desktop: Position announcement in sidebar area */
@media (min-width: 1024px) {
  .homepage-announcement {
    display: none;
  }

  /* Show announcement in sidebar on desktop instead */
  .homepage-announcement-desktop {
    display: block;
  }
}

/* Mobile: Full width card below hero */
@media (max-width: 1023px) {
  .homepage-announcement .container {
    padding: 0 1rem;
  }
}

/* ===== 主内容区 ===== */
.main-content {
  padding: 0.75rem 0;
}

@media (min-width: 768px) {
  .main-content {
    padding: 2rem 0;
  }
}

@media (min-width: 1024px) {
  .main-content {
    padding: 3rem 0;
  }
}

.content-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr 280px;
  }
}

/* ===== 产品区 ===== */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 1.25rem;
  padding-left: 0.75rem;
  border-left: 4px solid #F59E0B;
}

.dark .section-title {
  color: #F9FAFB;
}

.products-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 商品卡片 - 整个卡片可点击 */
.product-card {
  position: relative;
  display: block;
  text-decoration: none;
  background-color: #FFFFFF;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid #E5E7EB;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  border-color: #F59E0B;
}

.dark .product-card {
  background-color: #1F2937;
  border-color: #374151;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.dark .product-card:hover {
  border-color: #FBBF24;
}

.card-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.375rem;
  z-index: 10;
}

.badge-hot {
  background-color: #EF4444;
  color: #FFFFFF;
}

.badge-rare {
  background-color: #8B5CF6;
  color: #FFFFFF;
}

.badge-wholesale {
  background-color: #3B82F6;
  color: #FFFFFF;
}

.badge-tool {
  background-color: #10B981;
  color: #FFFFFF;
}

/* 卡片图片区 - 图片填满容器 */
.card-image {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #F3F4F6;
  overflow: hidden;
}

.dark .card-image {
  background-color: #374151;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-placeholder {
  font-size: 3rem;
  color: #D1D5DB;
}

.card-content {
  padding: 1rem;
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.75rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 标题链接 - SEO友好的全卡片可点击方案 */
.card-title a {
  color: inherit;
  text-decoration: none;
}

.card-title a::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
}

.card-title a:hover {
  color: #F59E0B;
}

.dark .card-title {
  color: #F9FAFB;
}

.dark .card-title a:hover {
  color: #FBBF24;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: #EF4444;
}

.card-stock {
  font-size: 0.75rem;
  color: #6B7280;
}

.dark .card-stock {
  color: #9CA3AF;
}

/* ===== 侧栏 ===== */
.sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .sidebar {
    display: block;
  }
}

.sidebar-card {
  background-color: #FFFFFF;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.25rem;
}

.dark .sidebar-card {
  background-color: #1F2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 1rem;
}

.dark .sidebar-title {
  color: #F9FAFB;
}

.sidebar-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  color: #F59E0B;
}

.announcement-text {
  font-size: 0.875rem;
  color: #4B5563;
  line-height: 1.6;
}

.announcement-text p {
  margin: 0 0 0.5rem;
}

.announcement-text p:last-child {
  margin-bottom: 0;
}

.dark .announcement-text {
  color: #D1D5DB;
}

.contact-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  background-color: #F3F4F6;
  color: #4B5563;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.contact-btn:hover {
  background-color: #E5E7EB;
}

.dark .contact-btn {
  background-color: #374151;
  color: #D1D5DB;
}

.dark .contact-btn:hover {
  background-color: #4B5563;
}

/* ===== 教程区 ===== */
.tutorials-section {
  padding: 2rem 0;
  background-color: #F3F4F6;
}

.dark .tutorials-section {
  background-color: #1F2937;
}

.tutorials-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.tutorials-more {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: #F59E0B;
  text-decoration: none;
}

.tutorials-more:hover {
  text-decoration: underline;
}

.arrow-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.tutorials-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .tutorials-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .tutorials-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tutorial-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: #FFFFFF;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease;
  height: 100%;
}

.tutorial-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark .tutorial-card {
  background-color: #111827;
}

.tutorial-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  min-height: calc(0.9375rem * 1.5 * 2);
  max-height: calc(0.9375rem * 1.5 * 2);
  /* 固定标题高度: 2行 × 1.5行高 × 0.9375rem = 2.8125rem */
}

.dark .tutorial-title {
  color: #F9FAFB;
}

/* 文章卡片标题链接 - stretched-link */
.tutorial-title a {
  color: inherit;
  text-decoration: none;
}

.tutorial-title a::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
}

.tutorial-title a:hover {
  color: #F59E0B;
}

.dark .tutorial-title a:hover {
  color: #FBBF24;
}

.tutorial-excerpt {
  font-size: 0.8125rem;
  color: #6B7280;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.dark .tutorial-excerpt {
  color: #9CA3AF;
}

/* 文章卡片时间标签 */
.tutorial-time {
  display: block;
  font-size: 0.75rem;
  color: #9CA3AF;
  margin-top: 0.625rem;
  padding-top: 0.5rem;
  border-top: 1px solid #E5E7EB;
}

.dark .tutorial-time {
  color: #6B7280;
  border-top-color: #374151;
}

/* ===== Footer 页脚 - 左右布局 ===== */
.footer {
  background-color: #111827;
  color: #D1D5DB;
  padding: 1.25rem 0;
}

.footer-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-grid {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-left {
  flex: 1;
}

.footer-brand {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  color: #9CA3AF;
}

.footer-brand strong {
  color: #D1D5DB;
}

.footer-seo {
  margin: 0;
  font-size: 0.75rem;
  color: #6B7280;
}

.footer-right {
  display: flex;
  gap: 1.5rem;
}

.footer-link {
  font-size: 0.8125rem;
  color: #9CA3AF;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #FBBF24;
}

/* ===== 懒加载 ===== */
.lazy-image {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-image.loaded {
  opacity: 1;
}

/* ===== 移动端折叠侧栏 ===== */
.mobile-sidebar {
  display: block;
  margin-top: 2rem;
}

@media (min-width: 1024px) {
  .mobile-sidebar {
    display: none;
  }
}

/* ===== 移动端菜单 ===== */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 100%;
  background-color: #FFFFFF;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.mobile-menu.active .mobile-menu-content {
  transform: translateX(0);
}

.dark .mobile-menu-content {
  background-color: #1F2937;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #E5E7EB;
}

.dark .mobile-menu-header {
  border-bottom-color: #374151;
}

/* 移动端菜单标题 */
.mobile-menu-title {
  font-weight: 600;
}

.mobile-menu-close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #4B5563;
  cursor: pointer;
}

.dark .mobile-menu-close {
  color: #D1D5DB;
}

/* 关闭图标 (SVG) */
.close-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.mobile-menu-nav {
  padding: 1rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: #111827;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

.mobile-nav-link .nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.mobile-nav-link:hover {
  background-color: #F3F4F6;
}

.dark .mobile-nav-link {
  color: #F9FAFB;
}

.dark .mobile-nav-link:hover {
  background-color: #374151;
}

/* 移动端菜单标题 */
.mobile-menu-header span {
  color: #111827;
}

.dark .mobile-menu-header span {
  color: #F9FAFB;
}

/* 移动端搜索框 */
.mobile-search-box {
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
}

.mobile-search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #D1D5DB;
  border-radius: 0.5rem;
  background-color: #F9FAFB;
  font-size: 0.875rem;
  color: #111827;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mobile-search-input:focus {
  outline: none;
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.mobile-search-input::placeholder {
  color: #9CA3AF;
}

.dark .mobile-search-input {
  background-color: #374151;
  border-color: #4B5563;
  color: #F9FAFB;
}

.dark .mobile-search-input::placeholder {
  color: #6B7280;
}

.product-main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-placeholder {
  font-size: 4rem;
  color: #D1D5DB;
}

/* 商品信息区 */
.product-info-section {
  display: flex;
  flex-direction: column;
}

.product-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1rem;
  line-height: 1.4;
}

@media (min-width: 768px) {
  .product-title {
    font-size: 1.75rem;
  }
}

/* 价格/库存/已售行 - 统一对齐 */
.product-meta-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: #F9FAFB;
  border-radius: 0.5rem;
  border: 1px solid #E5E7EB;
}

.dark .product-meta-row {
  background: #111827;
  border-color: #374151;
}

.product-meta-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 60px;
}

.meta-label {
  font-size: 0.75rem;
  color: #6B7280;
  margin-bottom: 0.25rem;
}

.dark .meta-label {
  color: #9CA3AF;
}

.meta-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}

.dark .meta-value {
  color: #F9FAFB;
}

.meta-value.price-value {
  color: #EF4444;
  font-size: 1.5rem;
}

.meta-value.stock-in {
  color: #10B981;
}

.meta-value.stock-out {
  color: #EF4444;
}

/* 库存变更时间 */
.stock-update-time {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  background: #F0FDF4;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #166534;
  margin-bottom: 1.25rem;
}

.dark .stock-update-time {
  background: rgba(16, 185, 129, 0.1);
  color: #6EE7B7;
}

.update-time {
  font-weight: 600;
}

/* 购买表单 */
.purchase-form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.form-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin-bottom: 1rem;
}

@media (min-width: 480px) {
  .form-row {
    grid-template-columns: 1fr auto;
  }
}

.form-group {
  margin-bottom: 1rem;
}

.form-group-qty {
  width: 100px;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.required {
  color: #EF4444;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #D1D5DB;
  border-radius: 0.5rem;
  background-color: #FFFFFF;
  font-size: 0.9375rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.dark .form-input {
  background-color: #374151;
  border-color: #4B5563;
  color: #F9FAFB;
}

/* 支付方式 */
.payment-methods {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid #E5E7EB;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.payment-option:hover {
  border-color: #F59E0B;
}

.dark .payment-option {
  border-color: #4B5563;
}

.payment-name {
  font-size: 0.875rem;
}

/* 购买按钮 */
.buy-button {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF;
  font-size: 1.125rem;
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: auto;
}

.buy-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
}

.buy-button:disabled {
  background: #9CA3AF;
  cursor: not-allowed;
}

/* 商品描述卡片 */
.product-description-card,
.product-notice-card {
  background-color: #FFFFFF;
  border-radius: 0.75rem;
  border: 1px solid #E5E7EB;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.dark .product-description-card,
.dark .product-notice-card {
  background-color: #1F2937;
  border-color: #374151;
}

.card-heading {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #E5E7EB;
}

.dark .card-heading {
  border-bottom-color: #374151;
}

.description-content {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: #4B5563;
}

.dark .description-content {
  color: #D1D5DB;
}

.description-content img {
  max-width: 100%;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

.notice-content {
  background: #FEF3C7;
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.8;
  color: #92400E;
}

.dark .notice-content {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
}

/* 相关推荐 */
.related-products-section {
  margin-bottom: 2rem;
}

.related-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .related-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.related-card {
  display: block;
  position: relative;
  background-color: #FFFFFF;
  border-radius: 0.75rem;
  border: 1px solid #E5E7EB;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-color: #F59E0B;
}

.dark .related-card {
  background-color: #1F2937;
  border-color: #374151;
}

.dark .related-card:hover {
  border-color: #FBBF24;
}

.related-image {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F3F4F6;
  overflow: hidden;
}

.dark .related-image {
  background: #374151;
}

.related-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-placeholder {
  font-size: 2rem;
  color: #D1D5DB;
}

.related-info {
  padding: 0.75rem;
}

.related-title {
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: #111827;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.related-title a {
  color: inherit;
  text-decoration: none;
}

.related-title a:hover {
  color: #F59E0B;
}

.dark .related-title {
  color: #F9FAFB;
}

.related-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.related-price {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #EF4444;
}

.related-stock {
  font-size: 0.6875rem;
  color: #6B7280;
}

.dark .related-stock {
  color: #9CA3AF;
}

/* 联系客服区块 */
.contact-section {
  text-align: center;
  margin-bottom: 2rem;
}

/* ===== 方案B：商品详情页新布局 ===== */

/* 商品信息卡片 */
.product-info-card {
  background: #FFFFFF;
  border-radius: 1rem;
  border: 1px solid #E5E7EB;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 1rem;
  overflow: hidden;
}

.dark .product-info-card {
  background: #1F2937;
  border-color: #374151;
}

.product-info-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.25rem;
}

@media (min-width: 640px) {
  .product-info-layout {
    flex-direction: row;
    align-items: flex-start;
    padding: 1.5rem;
  }
}

/* 商品图片盒子 */
.product-image-box {
  flex-shrink: 0;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
  border-radius: 0.75rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .product-image-box {
    width: 160px;
    margin: 0;
  }
}

.dark .product-image-box {
  background: linear-gradient(135deg, #374151 0%, #1F2937 100%);
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-img-placeholder {
  font-size: 3rem;
  color: #D1D5DB;
}

/* 商品详情文字 */
.product-details {
  flex: 1;
  min-width: 0;
}

.product-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1rem;
  line-height: 1.4;
  color: #111827;
}

.dark .product-name {
  color: #F9FAFB;
}

@media (min-width: 640px) {
  .product-name {
    font-size: 1.375rem;
  }
}

/* 商品统计数据 */
.product-stats {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.6875rem;
  color: #6B7280;
  margin-bottom: 0.125rem;
  text-transform: uppercase;
}

.dark .stat-label {
  color: #9CA3AF;
}

.stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.dark .stat-value {
  color: #F9FAFB;
}

.stat-price .stat-value {
  font-size: 1.5rem;
  color: #EF4444;
}

.text-success {
  color: #10B981;
}

.text-danger {
  color: #EF4444;
}

/* 库存更新徽章 */
.stock-update-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  background: #F0FDF4;
  border-radius: 9999px;
  font-size: 0.6875rem;
  color: #166534;
}

.stock-update-badge strong {
  font-weight: 600;
}

.dark .stock-update-badge {
  background: rgba(16, 185, 129, 0.1);
  color: #6EE7B7;
}

/* 购买卡片 */
.purchase-card {
  background: #FFFFFF;
  border-radius: 1rem;
  border: 1px solid #E5E7EB;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.dark .purchase-card {
  background: #1F2937;
  border-color: #374151;
}

/* 购买表单网格 */
.purchase-form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .purchase-form-grid {
    grid-template-columns: 1fr 80px auto;
    align-items: end;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field-sm {
  max-width: 100px;
}

.form-field-pay {
  grid-column: 1 / -1;
}

@media (min-width: 640px) {
  .form-field-pay {
    grid-column: auto;
  }
}

.field-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.375rem;
}

.dark .field-label {
  color: #D1D5DB;
}

.field-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #D1D5DB;
  border-radius: 0.5rem;
  background: #FFFFFF;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-input:focus {
  outline: none;
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.dark .field-input {
  background: #374151;
  border-color: #4B5563;
  color: #F9FAFB;
}

/* 支付选项 */
.pay-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pay-option {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #E5E7EB;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.8125rem;
  transition: all 0.2s;
  background: #FFFFFF;
}

.pay-option:hover {
  border-color: #F59E0B;
}

.pay-option.active,
.pay-option:has(input:checked) {
  border-color: #F59E0B;
  background: #FEF3C7;
}

.dark .pay-option {
  background: #374151;
  border-color: #4B5563;
  color: #F9FAFB;
}

.dark .pay-option.active,
.dark .pay-option:has(input:checked) {
  background: rgba(245, 158, 11, 0.15);
  border-color: #F59E0B;
}

.pay-option input[type="radio"] {
  accent-color: #F59E0B;
}

/* 优惠码行 */
.coupon-row {
  margin-bottom: 1rem;
}

.coupon-row .field-input {
  max-width: 280px;
}

/* 购买按钮 */
.btn-purchase {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-purchase:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
}

.btn-purchase:active:not(:disabled) {
  transform: translateY(0);
}

.btn-purchase:disabled {
  background: #9CA3AF;
  cursor: not-allowed;
}

/* 查询订单提示 */
.order-query-hint {
  text-align: center;
  margin-top: 0.875rem;
  font-size: 0.8125rem;
  color: #6B7280;
}

.order-query-hint a {
  color: #F59E0B;
  text-decoration: none;
  font-weight: 500;
}

.order-query-hint a:hover {
  text-decoration: underline;
}

.dark .order-query-hint {
  color: #9CA3AF;
}

.dark .order-query-hint a {
  color: #FBBF24;
}

/* ===== 三栏式商品详情页布局 ===== */

.product-three-col-card {
  background: #FFFFFF;
  border-radius: 1rem;
  border: 1px solid #E5E7EB;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.dark .product-three-col-card {
  background: #1F2937;
  border-color: #374151;
}

.three-col-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.25rem;
}

@media (min-width: 768px) {
  .three-col-layout {
    grid-template-columns: 220px 1fr 280px;
    gap: 1.5rem;
    padding: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .three-col-layout {
    grid-template-columns: 220px 1fr 280px;
    gap: 1.75rem;
  }
}

/* 左栏：图片 */
.col-image {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.col-image .product-img,
.col-image .product-img-placeholder {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
}

.dark .col-image .product-img-placeholder {
  background: linear-gradient(135deg, #374151 0%, #1F2937 100%);
}

.col-image .product-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #D1D5DB;
}

@media (min-width: 768px) {

  .col-image .product-img,
  .col-image .product-img-placeholder {
    max-width: 100%;
  }
}

/* 中栏：商品信息 */
.col-info {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  min-width: 0;
}

.col-info .product-name {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
  color: #111827;
}

.dark .col-info .product-name {
  color: #F9FAFB;
}

@media (min-width: 768px) {
  .col-info .product-name {
    font-size: 1.5rem;
  }
}

.col-info .product-stats {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.col-info .stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.col-info .stat-label {
  font-size: 0.6875rem;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.dark .col-info .stat-label {
  color: #9CA3AF;
}

.col-info .stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
}

.dark .col-info .stat-value {
  color: #F9FAFB;
}

.col-info .stat-price .stat-value {
  font-size: 1.75rem;
  color: #EF4444;
}

.col-info .stock-update-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  background: #F0FDF4;
  border-radius: 9999px;
  font-size: 0.6875rem;
  color: #166534;
  width: fit-content;
}

.col-info .stock-update-badge strong {
  font-weight: 600;
}

.dark .col-info .stock-update-badge {
  background: rgba(16, 185, 129, 0.1);
  color: #6EE7B7;
}

/* 右栏：购买表单 */
.col-purchase {
  display: flex;
  flex-direction: column;
}

.compact-form {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.compact-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.compact-form .field-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151;
}

.dark .compact-form .field-label {
  color: #D1D5DB;
}

.compact-form .field-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #D1D5DB;
  border-radius: 0.5rem;
  background: #FFFFFF;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.compact-form .field-input:focus {
  outline: none;
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.dark .compact-form .field-input {
  background: #374151;
  border-color: #4B5563;
  color: #F9FAFB;
}

/* 紧凑支付选项 */
.pay-options-compact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pay-option-compact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #E5E7EB;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.8125rem;
  transition: all 0.2s;
  background: #FFFFFF;
}

.pay-option-compact:hover {
  border-color: #F59E0B;
}

.pay-option-compact:has(input:checked) {
  border-color: #F59E0B;
  background: #FEF3C7;
}

.dark .pay-option-compact {
  background: #374151;
  border-color: #4B5563;
  color: #F9FAFB;
}

.dark .pay-option-compact:has(input:checked) {
  background: rgba(245, 158, 11, 0.15);
  border-color: #F59E0B;
}

.pay-option-compact input[type="radio"] {
  accent-color: #F59E0B;
}

.compact-form .btn-purchase {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  margin-top: 0.5rem;
}

.compact-form .btn-purchase:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
}

.compact-form .btn-purchase:active:not(:disabled) {
  transform: translateY(0);
}

.compact-form .btn-purchase:disabled {
  background: #9CA3AF;
  cursor: not-allowed;
}

.compact-form .order-query-hint {
  text-align: center;
  font-size: 0.75rem;
  color: #6B7280;
  margin-top: 0.5rem;
}

.compact-form .order-query-hint a {
  color: #F59E0B;
  text-decoration: none;
  font-weight: 500;
}

.compact-form .order-query-hint a:hover {
  text-decoration: underline;
}

.dark .compact-form .order-query-hint {
  color: #9CA3AF;
}

.dark .compact-form .order-query-hint a {
  color: #FBBF24;
}

/* 移动端优化 */
@media (max-width: 767px) {
  .three-col-layout {
    grid-template-columns: 1fr;
  }

  .col-image {
    order: 1;
  }

  .col-info {
    order: 2;
  }

  .col-purchase {
    order: 3;
  }
}

/* ===== 优化后的紧凑表单布局 ===== */

/* 邮箱+数量同行布局 */
.form-row-inline {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.form-field-grow {
  flex: 1;
  min-width: 0;
}

.form-field-qty {
  width: 70px;
  flex-shrink: 0;
}

/* 支付方式横排 */
.pay-options-inline {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pay-option-inline {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.625rem;
  border: 1px solid #E5E7EB;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.15s;
  background: #FFFFFF;
}

.pay-option-inline:hover {
  border-color: #F59E0B;
}

.pay-option-inline:has(input:checked) {
  border-color: #F59E0B;
  background: #FEF3C7;
}

.dark .pay-option-inline {
  background: #374151;
  border-color: #4B5563;
  color: #F9FAFB;
}

.dark .pay-option-inline:has(input:checked) {
  background: rgba(245, 158, 11, 0.15);
  border-color: #F59E0B;
}

.pay-option-inline input[type="radio"] {
  width: 14px;
  height: 14px;
  accent-color: #F59E0B;
  margin: 0;
  vertical-align: middle;
  flex-shrink: 0;
}

/* 进一步紧凑的表单字段 */
.compact-form .form-field {
  margin-bottom: 0.5rem;
}

.compact-form .field-label {
  font-size: 0.6875rem;
  margin-bottom: 0.25rem;
}

.compact-form .field-input {
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
}

.compact-form .btn-purchase {
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
  margin-top: 0.375rem;
}

.compact-form .order-query-hint {
  margin-top: 0.375rem;
  font-size: 0.6875rem;
}

/* ===== 美观性调整 ===== */

/* 价格/库存/已售水平对齐 */
.col-info .product-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
}

.col-info .stat-item {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.25rem;
}

.col-info .stat-price .stat-value {
  font-size: 1.5rem;
}

.col-info .stat-value {
  font-size: 1rem;
}

/* 标题允许2行 */
.col-info .product-name {
  font-size: 1.125rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 支付按钮等宽 */
.pay-options-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.pay-option-inline {
  justify-content: center;
  padding: 0.5rem 0.5rem;
}

/* 图片更大 */
.col-image .product-img,
.col-image .product-img-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
}

/* 图片尺寸限制 */
.col-image .product-img,
.col-image .product-img-placeholder {
  max-width: 220px;
  max-height: 220px;
}

/* ===== 语义化HTML支持 ===== */

/* 信任条p标签margin重置 */
p.trust-item {
  margin: 0;
}

/* 产品卡片标题链接 */
.card-title a {
  color: inherit;
  text-decoration: none;
}

.card-title a:hover {
  color: #F59E0B;
}

.dark .card-title a:hover {
  color: #FBBF24;
}

/* 图片区figure重置 */
figure.card-image {
  margin: 0;
}

/* ===== 侧栏对齐优化 ===== */

/* 侧栏第一个卡片添加上边距，与左侧商品标题对齐 */
.sidebar .sidebar-card:first-child {
  margin-top: 2.75rem;
}

/* ===== 移动端布局优化 ===== */

/* 移动端订单查询按钮 - 显示在header中间 */
.mobile-order-btn {
  display: none;
}

@media (max-width: 767px) {
  .mobile-order-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background-color: #EA580C;
    color: #FFFFFF;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease;
  }

  .mobile-order-btn:hover {
    background-color: #C2410C;
  }
}

/* 移动端产品网格 - 每行2个卡片 */
@media (max-width: 639px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }

  /* 移动端卡片优化 */
  .product-card {
    border-radius: 0.5rem;
  }

  .card-image {
    height: 120px;
  }

  .card-content {
    padding: 0.625rem;
  }

  .card-title {
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
    -webkit-line-clamp: 2;
  }

  .card-price {
    font-size: 0.9375rem;
  }

  .card-stock {
    font-size: 0.6875rem;
  }

  .card-badge {
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.125rem 0.375rem;
    font-size: 0.625rem;
  }

  /* 教程网格也设置为2列 */
  .tutorials-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }

  .tutorial-card {
    padding: 0.75rem;
  }

  .tutorial-title {
    font-size: 0.8125rem;
    line-height: 1.5;
    min-height: calc(0.8125rem * 1.5 * 2);
    max-height: calc(0.8125rem * 1.5 * 2);
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tutorial-excerpt {
    font-size: 0.75rem;
    -webkit-line-clamp: 2;
  }
}

/* 移动端搜索框 - 汉堡菜单内 */
.mobile-search-box {
  padding: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.mobile-search-input {
  width: 100%;
  padding: 0.625rem 1rem;
  border: 1px solid #D1D5DB;
  border-radius: 0.5rem;
  background-color: #F3F4F6;
  font-size: 0.875rem;
}

.mobile-search-input:focus {
  outline: none;
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.dark .mobile-search-input {
  background-color: #374151;
  border-color: #4B5563;
  color: #F9FAFB;
}

/* 移动端菜单链接图标 */
.mobile-nav-link span:first-child {
  margin-right: 0.5rem;
}

/* 移动端header布局优化 */
@media (max-width: 767px) {
  .header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .logo img {
    height: 32px;
  }
}

/* ===== 产品卡片全区域点击 ===== */

/* 卡片链接覆盖整个卡片区域 */
.card-link {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
}

/* 确保卡片有定位上下文 */
.product-card {
  position: relative;
}

/* 保持卡片原有hover效果 */
.product-card:hover {
  cursor: pointer;
}

/* ===== 侧栏响应式布局优化（去重HTML，用CSS控制位置） ===== */

/* 移动端：侧栏显示在产品区域下方 */
@media (max-width: 1023px) {
  .sidebar {
    display: block;
    order: 2;
    margin-top: 0;
  }

  .content-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .products-area {
    order: 1;
  }

  /* 移动端隐藏侧栏公告，因为已有 .homepage-announcement 显示 */
  .sidebar-announcement {
    display: none;
  }

  /* 移动端侧栏第一个卡片不需要额外上边距 */
}

.mobile-search-input {
  width: 100%;
  padding: 0.625rem 1rem;
  border: 1px solid #D1D5DB;
  border-radius: 0.5rem;
  background-color: #F3F4F6;
  font-size: 0.875rem;
}

.mobile-search-input:focus {
  outline: none;
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.dark .mobile-search-input {
  background-color: #374151;
  border-color: #4B5563;
  color: #F9FAFB;
}

/* 移动端菜单链接图标 */
.mobile-nav-link span:first-child {
  margin-right: 0.5rem;
}

/* 移动端header布局优化 */
@media (max-width: 767px) {
  .header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .logo img {
    height: 32px;
  }
}

/* ===== 产品卡片全区域点击 ===== */

/* 卡片链接覆盖整个卡片区域 */
.card-link {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
}

/* 确保卡片有定位上下文 */
.product-card {
  position: relative;
}

/* 保持卡片原有hover效果 */
.product-card:hover {
  cursor: pointer;
}



/* 桌面端：侧栏保持右侧固定位置 */
@media (min-width: 1024px) {
  .content-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
  }

  .sidebar {
    display: block;
  }
}

/* ===== 对比度修复 (WCAG AA) ===== */

/* 更新日志日期 - 提高对比度 */
.update-date {
  color: #4B5563 !important;
  /* 从 #9CA3AF 改为更深色，对比度 7.1:1 */
}

.dark .update-date {
  color: #D1D5DB !important;
  /* 从 #9CA3AF 改为更亮色，对比度 7.5:1 */
}

/* 卡片库存文字 - 暗色模式对比度修复 */
.dark .card-stock {
  color: #D1D5DB !important;
  /* 从 #9CA3AF 改为更亮色，对比度 7.5:1 */
}

/* ===== 面包屑导航 - 语义化结构 ===== */
.breadcrumbs {
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #F9FAFB 0%, #F3F4F6 100%);
  border-radius: 0.5rem;
  border: 1px solid #E5E7EB;
}

.dark .breadcrumbs {
  background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
  border-color: #374151;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
  content: '/';
  margin-left: 0.5rem;
  color: #9CA3AF;
}

.dark .breadcrumbs li:not(:last-child)::after {
  color: #6B7280;
}

.breadcrumbs li a {
  color: #F59E0B;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.breadcrumbs li a:hover {
  color: #D97706;
  text-decoration: underline;
}

.dark .breadcrumbs li a {
  color: #FBBF24;
}

.dark .breadcrumbs li a:hover {
  color: #F59E0B;
}

.breadcrumbs li[aria-current="page"] {
  color: #6B7280;
  font-weight: 400;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dark .breadcrumbs li[aria-current="page"] {
  color: #9CA3AF;
}

/* ===== 商品简要说明框 ===== */
.product-brief-box {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 0.375rem;
}

.dark .product-brief-box {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: #374151;
}

.product-brief-box p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #4B5563;
}

.dark .product-brief-box p {
  color: #D1D5DB;
}

/* ===== 自定义数量选择器样式 ===== */

/* 数量字段宽度 */
.form-field-qty {
  width: 110px !important;
}

/* 数量控制容器 */
.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid #D1D5DB;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #FFFFFF;
}

.dark .qty-control {
  background: #374151;
  border-color: #4B5563;
}

/* 数量按钮样式 */
.qty-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F3F4F6;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  transition: all 0.15s ease;
  user-select: none;
}

.qty-btn:hover {
  background: #F59E0B;
  color: #FFFFFF;
}

.qty-btn:active {
  transform: scale(0.95);
}

.dark .qty-btn {
  background: #4B5563;
  color: #D1D5DB;
}

.dark .qty-btn:hover {
  background: #F59E0B;
  color: #FFFFFF;
}

/* 减少按钮 */
.qty-minus {
  border-right: 1px solid #D1D5DB;
}

.dark .qty-minus {
  border-right-color: #4B5563;
}

/* 增加按钮 */
.qty-plus {
  border-left: 1px solid #D1D5DB;
}

.dark .qty-plus {
  border-left-color: #4B5563;
}

/* 数量输入框 */
.qty-input {
  flex: 1;
  width: 40px;
  height: 32px;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-input:focus {
  outline: none;
}

.dark .qty-input {
  color: #F9FAFB;
}

/* ===== 移动端图片/视频响应式修复 ===== */

/* 商品详情图片 - 修复移动端扭曲问题 */
.description-content img {
  max-width: 100%;
  height: auto !important;
  border-radius: 0.5rem;
  margin: 1rem 0;
  display: block;
}

/* 视频响应式优化 */
.description-content video {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1rem 0;
  display: block;
}

/* iframe 嵌入视频（如 YouTube、Bilibili）响应式 */
.description-content iframe {
  max-width: 100%;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

/* 视频容器 - 保持 16:9 比例 */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  /* 16:9 宽高比 */
  margin: 1rem 0;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #000;
}

.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0.5rem;
}

/* ===== 侧边栏公告卡片 Sidebar Announcement ===== */
.sidebar-announcement .announcement-icon {
  margin-right: 0.25rem;
}

.sidebar-announcement .announcement-text {
  font-size: 0.875rem;
  line-height: 1.6;
}

/* 覆盖后台编辑器可能添加的强制颜色 */
.sidebar-announcement .announcement-text,
.sidebar-announcement .announcement-text * {
  color: #4B5563 !important;
}

.sidebar-announcement .announcement-text p {
  margin: 0 0 0.5rem;
}

.sidebar-announcement .announcement-text p:last-child {
  margin-bottom: 0;
}

.sidebar-announcement .announcement-text a {
  color: #F59E0B !important;
  text-decoration: underline;
}

.sidebar-announcement .announcement-text a:hover {
  color: #D97706 !important;
}

/* 夜间模式 - 使用 !important 覆盖内联样式 */
.dark .sidebar-announcement .announcement-text,
.dark .sidebar-announcement .announcement-text * {
  color: #D1D5DB !important;
}

.dark .sidebar-announcement .announcement-text a {
  color: #FBBF24 !important;
}

.dark .sidebar-announcement .announcement-text a:hover {
  color: #FDE68A !important;
}

/* ===== 文章正文链接样式 - 提高对比度符合WCAG AA ===== */
article a,
.announcement-content a,
.product-description a {
  color: #B45309;
  text-decoration: underline;
  transition: color 0.2s ease;
}

article a:hover,
.announcement-content a:hover,
.product-description a:hover {
  color: #92400E;
}

.dark article a,
.dark .announcement-content a,
.dark .product-description a {
  color: #FBBF24;
}

.dark article a:hover,
.dark .announcement-content a:hover,
.dark .product-description a:hover {
  color: #FDE68A;
}

/* ===== 全站 SVG 图标通用样式 ===== */

/* SVG 图标通用基础样式 - 使用 currentColor 继承父元素颜色 */
svg {
  stroke: currentColor;
}

/* 公告图标 */
.announcement-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  color: #F59E0B;
}

/* 联系客服按钮图标 */
.contact-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Trust Bar 图标 */
.trust-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: #F59E0B;
}

/* 购买按钮图标 */
.btn-purchase-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* 商品占位符 SVG */
.product-img-placeholder svg,
.related-placeholder svg,
.card-placeholder svg {
  width: 3rem;
  height: 3rem;
  color: #D1D5DB;
}

.dark .product-img-placeholder svg,
.dark .related-placeholder svg,
.dark .card-placeholder svg {
  color: #4B5563;
}

/* 区块标题图标 */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: #F59E0B;
}

/* 文章元信息图标 */
.article-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.meta-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* 目录图标 */
.toc-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.toc-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 日期图标 */
.date-icon {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}

/* 订单状态图标 */
.order-status-icon {
  margin-bottom: 0.5rem;
}

.order-status-icon svg {
  width: 3rem;
  height: 3rem;
  color: #10B981;
}

/* 注意事项图标 */
.notice-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.notice-icon {
  width: 1.125rem;
  height: 1.125rem;
  color: #92400E;
  flex-shrink: 0;
}

/* 错误页面图标 */
.error-icon {
  margin-bottom: 1rem;
}

.error-icon svg {
  width: 4rem;
  height: 4rem;
  color: #F59E0B;
}

.error-icon-large svg {
  width: 6rem;
  height: 6rem;
}

/* ===== 库存状态徽章 - 四阶段显示 ===== */
.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* 库存充足 (> 50 件) - 绿色 */
.stock-plenty {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  color: #155724;
}

.dark .stock-plenty {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.2), rgba(40, 167, 69, 0.15));
  color: #7dcea0;
}

/* 正常库存 (10-50 件) - 黑色/深灰 */
.stock-normal {
  background: #f1f3f4;
  color: #5f6368;
}

.dark .stock-normal {
  background: rgba(255, 255, 255, 0.1);
  color: #9aa0a6;
}

/* 库存紧张 (< 10 件) - 红色/橙色 + 动画 */
.stock-low {
  background: linear-gradient(135deg, #ffe0b2, #ffcc80);
  color: #e65100;
  animation: pulse-stock 2s ease-in-out infinite;
}

.dark .stock-low {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.25), rgba(255, 87, 34, 0.2));
  color: #ffab40;
}

@keyframes pulse-stock {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }
}

/* 缺货 (0 件) - 灰色 */
.stock-out {
  background: #e0e0e0;
  color: #9e9e9e;
}

.dark .stock-out {
  background: rgba(255, 255, 255, 0.05);
  color: #757575;
}

/* 限购提示样式 */
.stat-limit .limit-value {
  color: #1a73e8;
  font-weight: 600;
}

.dark .stat-limit .limit-value {
  color: #8ab4f8;
}

/* ===== product-sub-info 行样式 ===== */
.product-sub-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

/* 子信息徽章样式 - 绿色圆角药丸 */
.sub-info-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  background: #F0FDF4;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #166534;
}

.dark .sub-info-badge {
  background: rgba(16, 185, 129, 0.1);
  color: #6EE7B7;
}

.sub-info-badge strong {
  font-weight: 600;
}

/* 缺货文字样式 */
.stat-out {
  color: #9CA3AF !important;
}

/* ===== 移动端产品统计信息布局 ===== */
@media (max-width: 767px) {

  /* 移动端统计信息换行显示 */
  .col-info .product-stats {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  /* 调整统计项间距 */
  .col-info .stat-label {
    font-size: 0.75rem;
    color: #6B7280;
  }

  .dark .col-info .stat-label {
    color: #9CA3AF;
  }
}

/* ===== Stretched Link 工具类 ===== */
/* 使用 ::after 伪元素将链接延伸覆盖整个父容器 */
.stretched-link::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  content: "";
}