/* ============================================================
   食商宝 V5.0 视觉升级 — 简约高尚质感
   叠加在 style.css 之上，不修改原文件
   核心理念：更精致的阴影层次、更优雅的配色过渡、更细腻的交互反馈
   ============================================================ */

/* ========== 0. 引入 Inter + 思源黑体 ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ========== 1. 全局质感提升 ========== */
:root {
  /* 主色：更深邃的墨绿替代亮绿，更显专业 */
  --primary: #1a7a4c;
  --primary-light: #edf7f1;
  --primary-hover: #15713f;
  --primary-dark: #125e34;
  /* 强调色：琥珀金保持，更柔和 */
  --accent: #e8a838;
  --accent-light: #fef6e4;
  --accent-hover: #d4962a;
  --accent-dark: #c2851e;
  /* 背景：更柔和的暖灰 */
  --bg: #f7f8fa;
  --bg-alt: #f0f2f6;
  /* 文字：更深邃 */
  --text: #1a2332;
  --text-secondary: #5a6a7e;
  --text-muted: #8a96a5;
  /* 阴影：多层叠加，更有质感 */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.04), 0 16px 48px rgba(0,0,0,0.08);
  /* 圆角：更统一柔和 */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  /* 过渡：更丝滑 */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 全局字体 */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  letter-spacing: 0.01em;
}

/* ========== 2. Header 精致化 ========== */
.header {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  box-shadow: none;
  height: 64px;
}

.logo {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--primary);
  /* 去掉emoji，换用纯文字 */
}

.logo::before {
  display: none;
}

/* 导航链接：取消背景hover，改用下划线指示 */
.nav a {
  padding: 8px 18px;
  font-weight: 500;
  font-size: 14px;
  border-radius: 0;
  position: relative;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav a:hover {
  background: transparent;
  color: var(--primary);
}

.nav a:hover::after {
  width: 60%;
}

.nav a.active {
  background: transparent;
  color: var(--primary);
  box-shadow: none;
  font-weight: 700;
}

.nav a.active::after {
  width: 60%;
}

/* ========== 3. 按钮：更精致 ========== */
.btn {
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: var(--primary);
  box-shadow: 0 2px 8px rgba(26,122,76,0.2);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,122,76,0.3);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(26,122,76,0.15);
}

.btn-outline {
  border: 1.5px solid rgba(26,122,76,0.3);
  color: var(--primary);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ========== 4. 卡片：层次分明 ========== */
.card {
  border: none;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
}

.sidebar-card {
  border: none;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
}

/* 产品卡片悬停 */
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.product-card .product-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

/* ========== 5. 搜索栏 ========== */
.search-bar input {
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  transition: all 0.3s ease;
  background: var(--card);
}

.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(26,122,76,0.08);
}

.search-bar .btn-primary {
  border-radius: var(--radius-md);
}

/* ========== 6. AI Banner：更优雅 ========== */
.ai-banner {
  background: linear-gradient(135deg, #4a5fe0 0%, #7c4dcc 100%);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 20px rgba(74,95,224,0.15);
}

/* ========== 7. 表单卡片 ========== */
.form-card {
  border: none;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.form-card h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 32px;
}

.form-group input,
.form-group select,
.form-group textarea {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(26,122,76,0.08);
}

/* ========== 8. 列表项 ========== */
.list-item {
  transition: all 0.25s ease;
  border-radius: var(--radius-sm);
}

.list-item:hover {
  background: var(--primary-light);
  transform: translateX(2px);
}

/* ========== 9. 会员升级卡片 ========== */
.membership-highlight {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.membership-highlight:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ========== 10. 侧边栏标题 ========== */
.sidebar-card h3 {
  font-size: 15px;
  font-weight: 700;
}

.sidebar-card h3::before {
  width: 3px;
  height: 16px;
  border-radius: 2px;
}

/* ========== 11. 标签：更精致 ========== */
.tag {
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ========== 12. 页面顶部 ========== */
.page-header {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  box-shadow: none;
}

/* ========== 13. 聊天界面 ========== */
.chat-container {
  border: none;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
}

.chat-msg:not(.self) .bubble {
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border-top-left-radius: 6px;
}

.chat-msg.self .bubble {
  border-top-right-radius: 6px;
  background: var(--primary);
}

/* ========== 14. 统计卡片 ========== */
.stat-card {
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-card .stat-num {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
}

/* ========== 15. 管理后台 ========== */
.admin-sidebar {
  background: linear-gradient(180deg, #1a2332 0%, #243447 100%);
  border-radius: var(--radius-md);
  border: none;
  box-shadow: var(--shadow-md);
}

.admin-sidebar h3 {
  color: rgba(255,255,255,0.35);
}

.admin-nav a {
  color: rgba(255,255,255,0.5);
}

.admin-nav a:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
}

.admin-nav a.active {
  background: rgba(39,174,96,0.2);
  color: #4cd68c;
}

/* ========== 16. 套餐卡片 ========== */
.plans-grid .plan-card {
  border: none;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.plans-grid .plan-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.plans-grid .plan-card.plan-hot {
  box-shadow: var(--shadow-sm), 0 0 0 2px var(--primary);
}

/* ========== 17. 模态框 ========== */
.modal-overlay {
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-box {
  border: none;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
  padding: 36px;
}

/* ========== 18. Toast 通知 ========== */
.toast {
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-lg);
}

/* ========== 19. 空状态 ========== */
.empty-state {
  padding: 64px 28px;
}

.spinner {
  border-width: 2.5px;
  border-top-color: var(--primary);
}

/* ========== 20. 滚动条 ========== */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.2);
}

/* ========== 21. 渐入动画（页面加载） ========== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.section {
  animation: fadeUp 0.5s ease both;
}

.section:nth-child(2) { animation-delay: 0.05s; }
.section:nth-child(3) { animation-delay: 0.1s; }
.section:nth-child(4) { animation-delay: 0.15s; }
.section:nth-child(5) { animation-delay: 0.2s; }

.sidebar-card {
  animation: fadeUp 0.5s ease both;
}

/* ========== 22. 高价值专区金色优化 ========== */
.section.section-gold .card {
  border: none;
  box-shadow: var(--shadow-sm), 0 0 0 1.5px var(--accent);
  border-radius: var(--radius-md);
}

/* ========== 23. 品类导航树 ========== */
.category-tree li {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
}

/* ========== 24. Footer 区域（新增） ========== */
.site-footer {
  margin-top: 48px;
  padding: 28px 24px 36px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  background: var(--card);
}

.site-footer a {
  color: var(--primary);
  font-weight: 500;
  transition: var(--transition);
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ========== 25. 响应式微调 ========== */
@media (max-width: 768px) {
  .header {
    height: 56px;
  }

  .form-card {
    padding: 28px;
    margin: 16px;
    border-radius: var(--radius-md);
  }

  .product-card:hover {
    transform: translateY(-2px);
  }

  .stat-card:hover {
    transform: translateY(-2px);
  }
}

/* ========== 26. C1 视觉打磨：交互质感统一 ========== */
/* 全局过渡，让所有可交互元素更顺滑 */
.btn, .card, .product-card, .demand-item, .stat-card, .chip, .gm-card, a {
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}
/* 卡片悬浮上浮 + 柔和投影 */
.product-card:hover, .demand-item:hover, .stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(26,122,76,.14);
}
/* 按钮悬浮微抬 */
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
/* 输入框焦点环 */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,122,76,.15);
}
/* 列表页搜索栏质感 */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid #e3e8e6; border-radius: 12px;
  padding: 8px 8px 8px 16px; box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,.05));
}
.search-bar input {
  flex: 1; border: none; outline: none; font-size: 14px; background: transparent; padding: 8px 2px;
}
.search-bar .btn { border-radius: 9px; }
/* 更精致的滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cdd5d0; border-radius: 6px; border: 2px solid #f7f8fa; }
::-webkit-scrollbar-thumb:hover { background: #b3bdb6; }
/* 标题层级更清晰 */
h1, h2, h3 { letter-spacing: .3px; }
.section-header h2 { font-weight: 700; }
/* 卡片圆角统一更柔和 */
.card, .form-card, .sidebar-card { border-radius: var(--radius-lg, 16px); }
