/* 现代简洁风格，尽量贴近参考站点的卡片网格与配色，同时保证文件体积小 */
:root {
  --bg: #ffffff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --accent: #38bdf8;
  --accent-2: #f472b6;
  --border: #e5e7eb;
  --success: #10b981;
  --danger: #ef4444;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

/* 顶部条 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  color: #ffffff;
}
.topbar-inner { 
  display: flex; 
  align-items: center; 
  gap: 16px; 
  padding: 12px 0;
  flex-wrap: wrap;
}
.brand { 
  font-size: 20px; 
  margin: 0; 
  white-space: nowrap;
}

/* 主导航 */
.main-nav {
  flex: 1;
  min-width: 0;
}
.main-nav ul {
  display: flex;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.main-nav a {
  color: #ffffff;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background-color 0.2s;
}
.main-nav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.main-nav a.active {
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

/* 搜索图标和弹出搜索框 */
/* 公告按钮 - 在实用技术分享右侧 */
.announcement-btn {
  background-color: #4a6fa5;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  margin-left: 10px;
  margin-bottom: 2px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: pulse 2s infinite;
  vertical-align: middle;
}

.announcement-btn:hover {
  background-color: #3d5a8c;
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(74, 111, 165, 0.3);
}

.announcement-btn:active {
  transform: scale(0.98);
}

/* 商店按钮样式 - 美观且与公告按钮风格协调但有所区分 */
.shop-btn {
  background: linear-gradient(135deg, #ff6b6b, #ffa502);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  margin-left: 10px;
  margin-bottom: 2px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
  vertical-align: middle;
  text-decoration: none;
}

.shop-btn:hover {
  background: linear-gradient(135deg, #ee5a5a, #ff9800);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.5);
}

.shop-btn:active {
  transform: translateY(0) scale(0.98);
}

.shop-btn:hover .shop-icon {
  animation: bounce 0.6s ease infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-4px);
  }
  60% {
    transform: translateY(-2px);
  }
}

/* 脉冲动画效果，吸引用户注意 */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 111, 165, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(74, 111, 165, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 111, 165, 0);
  }
}

.search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #ffffff;
  font-size: 18px;
  transition: all 0.3s ease;
  position: relative;
}

.search-icon:hover {
  background: rgba(255, 255, 255, 0.1);
}

.search-icon::before {
  content: "🔍";
}

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-popup {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: saturate(180%) blur(8px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: none;
  z-index: 100;
  min-width: 250px;
}

.search-popup.active {
  display: block;
}

.search-popup input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
}

.search-popup input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #ffffff;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }
  
  .search-icon {
    order: 1;
    margin-right: 12px;
  }
  
  .menu-toggle {
    order: 2;
  }
  
  .topbar-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: saturate(180%) blur(8px);
    border-top: 1px solid var(--border);
    display: none;
    z-index: 100;
  }
  
  .main-nav.active {
    display: block;
  }
  
  .main-nav ul {
    flex-direction: column;
    padding: 10px 0;
    gap: 0;
  }
  
  .main-nav li {
    width: 100%;
  }
  
  .main-nav a {
    display: block;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .main-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  .search-popup {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 400px;
    margin-top: 0;
  }
}
#searchInput::placeholder { color: var(--muted); }

/* 博客头部 */
.blog-header {
  padding: 20px 0;
}
.breadcrumb {
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--muted);
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}

.blog-intro {
  background-color: #f8fafc;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid var(--border);
}
.author-info {
  margin-bottom: 10px;
  font-weight: 500;
}
.important-note {
  margin: 8px 0;
  font-weight: bold;
}

/* 文章列表 */
.article-list {
  margin: 30px 0;
}
.section-title {
  font-size: 24px;
  margin-bottom: 20px;
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
}

/* 文章网格布局 - 一行只显示一篇文章 */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 30px 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* 文章卡片 */
.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.article-card.featured {
  background-color: #f0f9ff;
  border-color: var(--accent);
}

/* 置顶文章样式 */
.pinned-article {
  border: 2px solid var(--accent);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
  position: relative;
  background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
}

.pinned-article::before {
  content: "置顶";
  position: absolute;
  top: -10px;
  right: 16px;
  background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.pinned-article .badge {
  background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.article-meta {
  margin-bottom: 10px;
}
.article-title {
  margin: 0 0 12px 0;
  font-size: 18px;
}
.article-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}
.article-title a:hover {
  color: var(--accent);
}
.article-title .deleted {
  color: var(--muted);
  text-decoration: line-through;
}

.article-excerpt {
  margin-bottom: 16px;
  color: var(--muted);
  line-height: 1.6;
}
.article-excerpt p {
  margin: 8px 0;
}

.read-more {
  display: inline-block;
  padding: 8px 16px;
  background-color: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: background-color 0.2s;
}
.read-more:hover {
  background-color: #2563eb;
}

/* 分页 */
.pagination {
  text-align: center;
  padding: 20px 0;
  color: var(--muted);
}
.page-item {
  color: var(--accent);
  cursor: pointer;
}
.page-item:hover {
  text-decoration: underline;
}
.page-note {
  margin-left: 10px;
  font-size: 14px;
  color: var(--muted);
}
.product-card .thumb { 
  aspect-ratio: 4 / 3; 
  background: #f8fafc; 
  display: grid; 
  place-items: center; 
  overflow: hidden;
  flex-shrink: 0;  /* 图片区域不收缩 */
}
.product-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  transition: transform 0.2s ease;
}
.product-card .title { 
  margin: 10px 12px 6px; 
  font-size: 16px; 
  flex-grow: 0;  /* 标题不扩展 */
}
.product-card .price, .product-card .price-range { 
  margin: 0 12px 10px; 
  color: var(--muted); 
  flex-grow: 0;  /* 价格区域不扩展 */
}
.product-card .current { color: var(--text); font-weight: 600; }
.product-card .original { margin-left: 6px; text-decoration: line-through; color: #64748b; }
.product-card .variant-btn {
  margin: auto 12px 12px 12px;  /* 修改边距，auto让按钮位于底部 */
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  margin-top: auto;  /* 关键：让按钮位于底部 */
}
.product-card .variant-btn:hover { border-color: #334155; }

.badge {
  position: absolute;
  top: 10px; left: 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

/* 页脚 */
.footer { 
  border-top: 1px solid var(--border); 
  padding: 40px 0 20px; 
  color: var(--muted); 
  background-color: #f8fafc;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-section h4 {
  margin-bottom: 15px;
  color: var(--text);
  font-size: 18px;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section ul li a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
}

.footer-bottom a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 10px;
}

.footer-bottom a:hover {
  color: var(--accent);
}

/* 博客介绍特色 */
.intro-features {
  display: flex;
  gap: 20px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--accent);
}

.feature-icon {
  font-size: 16px;
}

/* 文章日期 */
.article-date {
  color: var(--muted);
  font-size: 12px;
}

/* 箭头图标 */
.arrow {
  transition: transform 0.3s ease;
}

.read-more:hover .arrow {
  transform: translateX(4px);
}

/* 优化链接样式 */
.article-content a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
  position: relative;
}

.article-content a:hover {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
  transform: translateY(-1px);
}

/* 表格中的链接样式 */
.article-content table a {
  display: inline-block;
  padding: 6px 12px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border-radius: 6px;
  font-weight: 600;
  border: none;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
  transition: all 0.2s ease;
}

.article-content table a:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
  border-bottom: none;
}

/* 外部链接标识 */
.article-content a[target="_blank"]::after {
  content: "↗";
  margin-left: 4px;
  font-size: 0.9em;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.article-content a[target="_blank"]:hover::after {
  opacity: 1;
}

/* 模态框 */
.modal { position: fixed; inset: 0; display: none; }
.modal[aria-hidden="false"] { display: grid; place-items: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, 0.7); backdrop-filter: blur(4px); }
.modal-content {
  position: relative;
  width: min(680px, 92vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}
.modal-sub { margin: 8px 0 12px; color: var(--muted); }
.variants { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.variant-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px; cursor: pointer; background: #ffffff; }
.variant-item.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) inset; }

.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.btn { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: #ffffff; color: var(--text); cursor: pointer; }
.btn.ghost { background: transparent; }
.btn:hover { border-color: #334155; }

/* 网页弹窗功能 */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.popup-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  position: relative;
}

.popup-overlay.active .popup-container {
  transform: scale(1);
}

.popup-header {
  text-align: center;
  margin-bottom: 20px;
}

.popup-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.popup-content {
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 24px;
}

.popup-content p {
  margin-bottom: 12px;
}

.popup-content p:last-child {
  margin-bottom: 0;
}

.popup-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto 20px;
  border-radius: 8px;
}

.popup-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popup-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.popup-btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
}

.popup-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.popup-btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.popup-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.05);
}

.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  font-size: 20px;
  transition: all 0.3s ease;
}

.popup-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .popup-container {
    width: 95%;
    padding: 20px;
    margin: 20px;
  }
  
  .popup-title {
    font-size: 20px;
  }
  
  .popup-btn {
    padding: 10px 20px;
    font-size: 15px;
  }
}

/* 浮动购物车按钮 */
.cart-fab {
  position: fixed; right: 18px; bottom: 18px;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
}
.cart-count {
  display: inline-grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--success); color: #062a21; font-weight: 700; font-size: 12px;
}
.brand-logo {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 6px;
  vertical-align: -4px;
  margin-right: 8px;
}
.content-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 200px;  /* 将侧边栏宽度从260px缩小到200px */
  gap: 20px;
}
@media (max-width: 960px) {
  /* 移除两列布局与侧边栏（已删除HTML侧栏） */
  .content-with-sidebar { display: block; grid-template-columns: none; gap: 0; }
  .sidebar { display: none; }
}

.sidebar {
  align-self: start;
  background: #f8fafc;  /* 修改侧边栏背景色为浅灰色 */
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;  /* 将内边距从12px缩小到8px */
}
.sidebar h3 { 
  margin: 0 0 6px;  /* 将下边距从8px缩小到6px */
  font-size: 14px;  /* 将字体大小从16px缩小到14px */
  color: #1e293b;  /* 修改标题文字颜色为深蓝色 */
}
.categories { list-style: none; padding: 0; margin: 0; }
.category-item {
  padding: 6px 8px;  /* 将内边距从8px 10px缩小到6px 8px */
  border-radius: 8px;  /* 将圆角从10px缩小到8px */
  cursor: pointer;
  color: #475569;  /* 修改分类项文字颜色为中灰色 */
  background: #ffffff;  /* 添加分类项背景色为白色 */
  border: 1px solid #e2e8f0;  /* 添加分类项边框 */
  margin-bottom: 3px;  /* 将下边距从4px缩小到3px */
  transition: all 0.2s ease;  /* 添加过渡效果 */
  font-size: 13px;  /* 添加字体大小设置，适当缩小 */
}
.category-item:hover { 
  background: #f1f5f9;  /* 修改悬停背景色为浅蓝色 */
  border-color: #cbd5e1;  /* 修改悬停边框色 */
  color: #334155;  /* 修改悬停文字颜色为深灰色 */
}
.category-item.active { 
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 4px rgba(56, 189, 248, 0.3);
}