/* ========================================
   壳屿手工 · 全局样式
   色调：暖灰 #F5F2EB / 淡粉 #EDD5D0 / 深灰 #2D2D2D / 金色 #B8966E
   ======================================== */

/* ========== 基础重置 ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background-color: #F5F2EB;
  color: #2D2D2D;
  line-height: 1.7;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color-scheme: light;
}

a {
  color: #B8966E;
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: #9a7a58;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========== 顶部导航栏 ========== */
.site-header {
  background: #F0EDE4;
  border-bottom: 1px solid #D8D3C8;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 3px;
  color: #3A3A3A;
  font-family: "STKaiti", "KaiTi", "楷体", serif;
}

.logo:hover {
  color: #C4A882;
}

#mainNav a {
  margin-left: 22px;
  font-size: 14px;
  color: #6B6B6B;
}

#mainNav a:hover {
  color: #C4A882;
}

.badge {
  background: #d4786e;
  color: #fff;
  font-size: 11px;
  border-radius: 50%;
  padding: 1px 6px;
  position: relative;
  top: -10px;
  left: -6px;
}

/* ========== 首屏主视觉 ========== */
.hero {
  background: linear-gradient(135deg, #EDD5D0 0%, #F0E4E0 30%, #F5F2EB 100%);
  padding: 100px 24px 80px;
  text-align: center;
}

.hero h1 {
  font-size: 40px;
  font-weight: 400;
  letter-spacing: 8px;
  color: #3A3A3A;
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  margin-bottom: 16px;
}

.hero-slogan {
  font-size: 16px;
  color: #8A8A8A;
  letter-spacing: 2px;
}

/* ========== 分类入口卡片 ========== */
.category-entry {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.category-card {
  background: #F0EDE4;
  border-radius: 10px;
  padding: 50px 20px;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid #D8D3C8;
  display: block;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.category-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}

.category-card h2 {
  font-size: 20px;
  font-weight: 500;
  color: #3A3A3A;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.category-card p {
  font-size: 13px;
  color: #A0A0A0;
}

/* ========== 品牌文案 ========== */
.brand-intro {
  padding: 50px 24px 70px;
  text-align: center;
}

.intro-inner {
  max-width: 500px;
  margin: 0 auto;
}

.intro-text {
  font-size: 15px;
  color: #6B6B6B;
  line-height: 2.2;
  letter-spacing: 1px;
}

/* ========== 页脚 ========== */
.site-footer {
  background: #F0EDE4;
  border-top: 1px solid #D8D3C8;
  padding: 30px 24px;
  text-align: center;
  margin-top: auto;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
}

.footer-contact span {
  margin: 0 16px;
  font-size: 13px;
  color: #6B6B6B;
}

.footer-icp {
  margin-top: 8px;
}

.footer-icp a {
  font-size: 13px;
  color: #6B6B6B;
}

.footer-copyright {
  margin-top: 12px;
  font-size: 12px;
  color: #A0A0A0;
}

/* ========== 公安备案图标 ========== */
.police-badge-img {
  display: inline;
  width: auto;
  height: 1.1em;
  vertical-align: -2px;
  border: none;
}

/* ========== 隐藏管理员入口 ========== */
.admin-hidden-entry {
  margin-top: 10px;
}

.admin-link {
  color: #FAFAF6;
  font-size: 11px;
  transition: color 0.4s;
}

.admin-link:hover {
  color: #C4A882;
  text-decoration: underline;
}

/* ========== 通用按钮 ========== */
.btn {
  display: inline-block;
  padding: 10px 28px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 1px;
  transition: all 0.3s;
}

.btn-primary {
  background: #B8966E;
  color: #fff;
}

.btn-primary:hover {
  background: #9a7a58;
}

.btn-outline {
  background: transparent;
  border: 1px solid #B8966E;
  color: #B8966E;
}

.btn-outline:hover {
  background: #B8966E;
  color: #fff;
}

.btn-danger {
  background: #d4786e;
  color: #fff;
}

.btn-sm {
  padding: 6px 16px;
  font-size: 12px;
}

/* ========== 弹窗 ========== */
.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.35);
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.popup-box {
  background: #F0EDE4;
  border-radius: 10px;
  padding: 30px;
  max-width: 420px;
  width: 90%;
  text-align: center;
}

.popup-box h3 {
  margin-bottom: 16px;
  font-weight: 500;
}

/* ========== 表单通用 ========== */
.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: #6B6B6B;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e0e0d8;
  border-radius: 6px;
  font-size: 14px;
  background: #fdfdfb;
  color: #3A3A3A;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #B8966E;
}

/* ========== 页面通用容器 ========== */
.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  flex: 1;
}

.page-title {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 3px;
  text-align: center;
  margin-bottom: 32px;
  font-family: "STKaiti", "KaiTi", "楷体", serif;
}

/* ========== 商品网格 ========== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 28px;
}

.product-card {
  background: #F0EDE4;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #D8D3C8;
  transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.product-card img {
  width: 100%;
  height: 280px;
  object-fit: contain;
  background: #EBE8DF;
}

.product-info {
  padding: 16px;
}

.product-name {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}

.product-code {
  font-size: 12px;
  color: #A0A0A0;
  margin-bottom: 6px;
}

.product-desc {
  font-size: 13px;
  color: #6B6B6B;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ========== 购物车侧栏 ========== */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -380px;
  width: 360px;
  height: 100%;
  background: #F0EDE4;
  box-shadow: -2px 0 20px rgba(0,0,0,0.15);
  z-index: 200;
  transition: right 0.3s;
  display: flex;
  flex-direction: column;
}

.cart-sidebar.open {
  right: 0;
}

.cart-header {
  padding: 18px 20px;
  border-bottom: 1px solid #e8e8e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h3 {
  font-weight: 500;
  font-size: 16px;
}

.cart-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #A0A0A0;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0ea;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 500;
}

.cart-item-code {
  font-size: 11px;
  color: #A0A0A0;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item-qty button {
  width: 28px;
  height: 28px;
  border: 1px solid #e0e0d8;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.cart-footer {
  padding: 16px 20px;
  border-top: 1px solid #e8e8e0;
}

.cart-total {
  margin-bottom: 12px;
  font-size: 14px;
}

.cart-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.25);
  z-index: 199;
  display: none;
}

.cart-overlay.show {
  display: block;
}

/* 购物车浮动按钮 */
.cart-float-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #C4A882;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 22px;
  z-index: 150;
  box-shadow: 0 4px 16px rgba(196,168,130,0.4);
  transition: transform 0.3s;
}

.cart-float-btn:hover {
  transform: scale(1.08);
}

.cart-float-btn .cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #d4786e;
  color: #fff;
  font-size: 11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== 分类筛选标签 ========== */
.filter-tabs {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 22px;
  border: 1px solid #e0e0d8;
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #6B6B6B;
  transition: all 0.3s;
}

.filter-tab:hover,
.filter-tab.active {
  background: #C4A882;
  color: #fff;
  border-color: #C4A882;
}

/* ========== 通知列表 ========== */
#notification-list {
  text-align: left;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.notif-item {
  padding: 10px 0;
  border-bottom: 1px solid #f0f0ea;
  font-size: 14px;
  color: #3A3A3A;
}

.notif-item.unread {
  font-weight: 500;
}

/* ========== AI 对话悬浮窗 ========== */
.ai-float-btn {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #F2DCD8;
  color: #3A3A3A;
  border: none;
  cursor: pointer;
  font-size: 20px;
  z-index: 150;
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  transition: transform 0.3s;
}

.ai-float-btn:hover {
  transform: scale(1.08);
}

.ai-chat-window {
  position: fixed;
  bottom: 160px;
  right: 30px;
  width: 320px;
  height: 400px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  z-index: 151;
  display: none;
  flex-direction: column;
}

.ai-chat-window.open {
  display: flex;
}

.ai-chat-header {
  padding: 14px 18px;
  border-bottom: 1px solid #e8e8e0;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}

.ai-chat-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #A0A0A0;
}

.ai-chat-messages {
  flex: 1;
  padding: 14px 18px;
  overflow-y: auto;
  font-size: 13px;
  color: #6B6B6B;
}

.ai-chat-input-area {
  padding: 12px 18px;
  border-top: 1px solid #e8e8e0;
  display: flex;
  gap: 8px;
}

.ai-chat-input-area input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #e0e0d8;
  border-radius: 20px;
  font-size: 13px;
  outline: none;
}

.ai-chat-input-area button {
  background: #C4A882;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 30px;
    letter-spacing: 4px;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

  .cart-sidebar {
    width: 100%;
    right: -100%;
  }

  .ai-chat-window {
    width: 90%;
    right: 5%;
    bottom: 150px;
  }
}

/* ========== 深色模式 ========== */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #F5F2EB !important;
    color: #2D2D2D !important;
  }

  .site-header {
    background: #F0EDE4 !important;
    border-bottom: 1px solid #D8D3C8 !important;
  }

  .hero {
    background: linear-gradient(135deg, #EDD5D0 0%, #F0E4E0 30%, #F5F2EB 100%) !important;
  }

  .category-card {
    background: #F0EDE4 !important;
    border: 1px solid #D8D3C8 !important;
  }

  .site-footer {
    background: #F0EDE4 !important;
    border-top: 1px solid #D8D3C8 !important;
  }

  .popup-box {
    background: #F0EDE4 !important;
  }

  .product-card {
    background: #F0EDE4 !important;
    border: 1px solid #D8D3C8 !important;
  }

  .product-card img {
    background: #EBE8DF !important;
  }

  .cart-sidebar {
    background: #F0EDE4 !important;
  }

  input, textarea, select {
    background: #fdfdfb !important;
    color: #3A3A3A !important;
    border-color: #e0e0d8 !important;
  }

  .intro-text {
    color: #6B6B6B !important;
  }

  .footer-contact span {
    color: #6B6B6B !important;
  }

  .footer-copyright {
    color: #A0A0A0 !important;
  }
}