/* ==========================================================================
   匠心手作 - 品牌样式
   基于设计稿品牌令牌，保持视觉一致并补充交互组件样式
   ========================================================================== */

:root {
  --cream: #FAF6F1;
  --paper: #FEFAE0;
  --clay: #D4A373;
  --terracotta: #BC6C25;
  --sage: #606C38;
  --sage-light: #8A9A5B;
  --charcoal: #283618;
  --charcoal-light: #3A4D22;
  --warm-gray: #8C8A86;
  --muted-foreground: #5C5A56;
  --white: #FFFFFF;

  --shadow: rgba(40, 54, 24, 0.08);
  --shadow-strong: rgba(40, 54, 24, 0.15);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--cream);
  color: var(--charcoal);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  overflow-x: hidden;
}

a { color: var(--terracotta); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--charcoal); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: var(--font-body); }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.page-main { min-height: 60vh; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.6em;
  color: var(--charcoal);
}
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.4;
}
.btn-primary { background: var(--terracotta); color: var(--white); border-color: var(--terracotta); }
.btn-primary:hover { background: var(--charcoal); border-color: var(--charcoal); color: var(--white); transform: translateY(-2px); box-shadow: 0 8px 24px var(--shadow-strong); }
.btn-secondary { background: var(--sage); color: var(--white); border-color: var(--sage); }
.btn-secondary:hover { background: var(--charcoal); border-color: var(--charcoal); color: var(--white); }
.btn-outline { background: transparent; color: var(--charcoal); border-color: var(--charcoal); }
.btn-outline:hover { background: var(--charcoal); color: var(--white); }
.btn-text { background: transparent; color: var(--charcoal); padding: 8px 12px; border: none; }
.btn-text:hover { color: var(--terracotta); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ========== Header ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 241, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(40, 54, 24, 0.06);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.site-header.scrolled { box-shadow: 0 8px 24px rgba(40, 54, 24, 0.08); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--charcoal);
  white-space: nowrap;
}
.logo-icon { color: var(--terracotta); font-size: 1.3rem; }
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a {
  color: var(--charcoal);
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}
.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--terracotta);
  transition: var(--transition);
}
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.cart-toggle { position: relative; }
.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--terracotta);
  color: var(--white);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 4px;
  transition: transform 0.2s ease;
}
.cart-count.bump { animation: bump 0.35s ease; }
@keyframes bump { 40% { transform: scale(1.35); } }

/* 汉堡菜单 */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(40, 54, 24, 0.12);
  border-radius: 12px;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--charcoal);
  border-radius: 2px;
  transition: var(--transition);
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ========== Hero ========== */
.hero { position: relative; padding: 100px 0 80px; overflow: hidden; }
.hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--paper) 0%, var(--cream) 50%, #F3E9D9 100%);
  z-index: -2;
}
.hero-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  filter: blur(60px);
  z-index: -1;
  animation: floaty 12s ease-in-out infinite;
}
.hero-shape-1 { width: 500px; height: 500px; top: -150px; right: -100px; background: var(--clay); }
.hero-shape-2 { width: 350px; height: 350px; bottom: -100px; left: -80px; background: var(--sage); animation-delay: 3s; }
@keyframes floaty { 50% { transform: translateY(24px); } }
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero-content { max-width: 560px; }
.hero-label {
  display: inline-block;
  padding: 6px 16px;
  background: var(--white);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--terracotta);
  margin-bottom: 20px;
  box-shadow: 0 4px 12px var(--shadow);
}
.hero h1 {
  margin-bottom: 24px;
  animation: riseIn 0.8s var(--ease-out) both;
  animation-delay: 0.15s;
}
.hero h1 em { color: var(--terracotta); font-style: italic; }
.hero p { font-size: 1.15rem; color: var(--warm-gray); margin-bottom: 32px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-image { position: relative; }
.hero-image img {
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px var(--shadow-strong);
  aspect-ratio: 4/5;
  object-fit: cover;
  width: 100%;
}
.hero-image::before {
  content: '';
  position: absolute;
  inset: -20px;
  border: 2px solid var(--clay);
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0.5;
}
.hero-image img::selection { background: transparent; }
.hero-label, .hero-image { animation: riseIn 0.8s var(--ease-out) both; }
.hero p { opacity: 0; animation: riseIn 0.8s var(--ease-out) 0.28s forwards; }
.hero-actions { opacity: 0; animation: riseIn 0.8s var(--ease-out) 0.42s forwards; }
@keyframes riseIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

/* ========== Section ========== */
.section { padding: 80px 0; }
.section-paper { background: var(--paper); }
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 48px;
  flex-wrap: wrap;
  gap: 16px;
}
.section-title { max-width: 600px; }
.section-title span, .brand-kicker {
  display: block;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--terracotta);
  margin-bottom: 8px;
}
.view-all-link, .view-all-btn {
  font-weight: 600;
  color: var(--charcoal);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 0.95rem;
}
.view-all-link:hover, .view-all-btn:hover { color: var(--terracotta); }
.view-all-link::after { content: '→'; transition: var(--transition); }
.view-all-link:hover::after { transform: translateX(4px); }

/* ========== Categories ========== */
.category-section { background: var(--paper); }
.category-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; }
.category-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1/1;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  background: var(--charcoal);
  cursor: pointer;
  transition: var(--transition);
  border: none;
}
.category-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  transition: transform 0.6s ease;
}
.category-card:hover img { transform: scale(1.08); }
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--shadow-strong);
}
.category-card.active { box-shadow: 0 0 0 3px var(--terracotta); }
.filter-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px;
  color: var(--muted-foreground);
  background: var(--cream);
  border-radius: var(--radius-md);
}
/* 分类筛选时隐藏不匹配卡片（带淡出） */
.product-card.is-hidden { display: none; }
.category-card span {
  position: relative;
  z-index: 1;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

/* ========== Product Cards ========== */
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.product-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow);
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px var(--shadow-strong); }
.product-card-image {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: var(--paper);
}
.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.product-card:hover .product-card-image img { transform: scale(1.05); }
.product-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  background: var(--terracotta);
  color: var(--white);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
}
.product-card-badge.sage { background: var(--sage); }
.product-card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.product-card-meta { font-size: 0.85rem; color: var(--sage); font-weight: 600; margin-bottom: 6px; }
.product-card-title { font-size: 1.1rem; margin-bottom: 4px; color: var(--charcoal); font-family: var(--font-display); font-weight: 600; }
.product-card-title a { color: var(--charcoal); }
.product-card-title a:hover { color: var(--terracotta); }
.product-card-artisan { font-size: 0.8rem; color: var(--warm-gray); margin-top: 4px; }
.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 16px;
  gap: 8px;
}
.product-card-price { font-family: var(--font-display); font-size: 1.25rem; color: var(--terracotta); font-weight: 700; }

/* ========== Brand Story ========== */
.brand-story {
  background: var(--charcoal);
  color: var(--cream);
  position: relative;
  overflow: hidden;
}
.brand-story::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.brand-story-header { text-align: center; max-width: 640px; margin: 0 auto 60px; position: relative; z-index: 1; }
.brand-story-header .brand-kicker { color: var(--clay); }
.brand-story-header h2 { color: var(--white); margin-bottom: 16px; }
.brand-story-header p { color: rgba(250, 246, 241, 0.75); font-size: 1.05rem; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  position: relative;
  z-index: 1;
}
.feature-card {
  text-align: center;
  padding: 40px 32px;
  border: 1px solid rgba(250, 246, 241, 0.15);
  border-radius: var(--radius-md);
  background: rgba(250, 246, 241, 0.04);
  transition: var(--transition);
}
.feature-card:hover {
  border-color: var(--clay);
  background: rgba(212, 163, 115, 0.08);
  transform: translateY(-4px);
}
.feature-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  background: rgba(188, 108, 37, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.feature-card h3 { color: var(--white); margin-bottom: 12px; font-size: 1.4rem; }
.feature-card p { color: rgba(250, 246, 241, 0.7); font-size: 0.95rem; margin: 0; }

/* ========== Footer ========== */
.site-footer { background: var(--charcoal); color: var(--cream); padding: 80px 0 30px; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 60px;
}
.footer-brand .logo { color: var(--white); margin-bottom: 16px; }
.footer-brand .logo:hover { color: var(--clay); }
.footer-brand p { color: rgba(250, 246, 241, 0.7); font-size: 0.95rem; }
.footer-social { display: flex; gap: 12px; margin-top: 20px; }
.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(250, 246, 241, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
  font-size: 1rem;
}
.footer-social a:hover { background: var(--terracotta); color: var(--white); transform: translateY(-2px); }
.footer-links h4 {
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.footer-links a {
  display: block;
  color: rgba(250, 246, 241, 0.7);
  margin-bottom: 10px;
  font-size: 0.95rem;
}
.footer-links a:hover { color: var(--clay); }
.social-newsletter { cursor: pointer; background: none; border: none; font-size: 0.95rem; display: block; font-family: var(--font-body); }
.footer-bottom {
  border-top: 1px solid rgba(250, 246, 241, 0.1);
  padding-top: 24px;
  text-align: center;
  color: rgba(250, 246, 241, 0.5);
  font-size: 0.9rem;
}

/* ========== Reveal 滚动动画 ==========
   初始隐藏，进入视口后淡入上移 */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.in-view { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }
.reveal.delay-4 { transition-delay: 0.32s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero h1, .hero p, .hero-actions, .hero-label, .hero-image { animation: none; opacity: 1; }
  html { scroll-behavior: auto; }
}

/* ========== 抽屉 & 遮罩 ========== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 33, 16, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 200;
  backdrop-filter: blur(2px);
}
.drawer-backdrop.show { opacity: 1; visibility: visible; }
body.lock { overflow: hidden; }

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(320px, 84vw);
  background: var(--cream);
  z-index: 210;
  display: flex;
  flex-direction: column;
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease-out);
  box-shadow: -20px 0 60px var(--shadow-strong);
}
.mobile-drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.drawer-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(40, 54, 24, 0.15);
  background: var(--white);
  color: var(--charcoal);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  flex: none;
}
.drawer-close:hover { background: var(--terracotta); color: var(--white); border-color: var(--terracotta); }
.drawer-nav { display: flex; flex-direction: column; gap: 4px; }
.drawer-link {
  display: block;
  padding: 14px 12px;
  border-radius: 12px;
  color: var(--charcoal);
  font-weight: 500;
  font-size: 1.05rem;
}
.drawer-link:hover, .drawer-link.active { background: var(--paper); color: var(--terracotta); }
.drawer-buttons { margin-top: auto; display: flex; gap: 12px; padding-top: 24px; }

/* ========== 购物车抽屉 ========== */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh;
  width: min(420px, 92vw);
  background: var(--cream);
  z-index: 210;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease-out);
  box-shadow: -20px 0 60px var(--shadow-strong);
}
.cart-drawer.open { transform: translateX(0); }
.drawer-title { font-size: 1.4rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.cart-items { flex: 1; overflow-y: auto; padding: 0 24px; }
.cart-empty { text-align: center; padding: 48px 12px; color: var(--warm-gray); }
.cart-empty-icon { font-size: 2.4rem; display: block; margin-bottom: 12px; opacity: 0.8; }
.cart-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(40, 54, 24, 0.08);
  animation: itemIn 0.3s var(--ease-out) both;
}
@keyframes itemIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.cart-item-img {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--paper);
  flex: none;
}
.cart-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cart-item-name { font-weight: 600; font-family: var(--font-display); font-size: 1rem; color: var(--charcoal); }
.cart-item-price { color: var(--terracotta); font-weight: 700; margin: 4px 0 8px; }
.cart-item-controls { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(40, 54, 24, 0.15);
  background: var(--white);
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
}
.qty-btn:hover { background: var(--terracotta); color: var(--white); border-color: var(--terracotta); }
.qty-val { min-width: 20px; text-align: center; font-weight: 600; }
.cart-item-remove {
  background: none;
  border: none;
  color: var(--warm-gray);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
  align-self: flex-start;
}
.cart-item-remove:hover { color: #C0392B; }
.cart-foot { padding: 20px 24px; border-top: 1px solid rgba(40, 54, 24, 0.1); background: var(--white); }
.cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 1.05rem; }
.cart-total strong { font-family: var(--font-display); font-size: 1.5rem; color: var(--terracotta); }

/* ========== 登录/注册弹窗 ========== */
.auth-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.96);
  width: min(440px, 92vw);
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 34px;
  z-index: 220;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out), visibility 0.3s;
  box-shadow: 0 24px 80px var(--shadow-strong);
}
.auth-modal.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.modal-close { position: absolute; top: 16px; right: 16px; }
.auth-tabs { display: flex; gap: 8px; background: var(--paper); border-radius: 100px; padding: 5px; margin-bottom: 22px; }
.auth-tab {
  flex: 1;
  padding: 10px;
  border-radius: 100px;
  border: none;
  background: transparent;
  font-weight: 600;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: var(--transition);
}
.auth-tab.active { background: var(--charcoal); color: var(--white); }
.auth-form { display: none; }
.auth-form.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--charcoal); }
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(40, 54, 24, 0.15);
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--charcoal);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus { outline: none; border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(188, 108, 37, 0.15); background: var(--white); }
.field.has-error input { border-color: #C0392B; }
.field-error { display: none; color: #C0392B; font-size: 0.8rem; margin-top: 5px; }
.field.has-error .field-error { display: block; }
.auth-switch { text-align: center; font-size: 0.9rem; color: var(--muted-foreground); margin: 14px 0 0; }

/* ========== 邮箱订阅弹窗 ========== */
.newsletter-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.96);
  width: min(420px, 90vw);
  background: var(--charcoal);
  color: var(--cream);
  border-radius: var(--radius-lg);
  padding: 40px 34px;
  z-index: 220;
  opacity: 0;
  visibility: hidden;
  text-align: center;
  box-shadow: 0 24px 80px var(--shadow-strong);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out), visibility 0.3s;
}
.newsletter-modal.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.newsletter-modal .modal-close { color: var(--cream); border-color: rgba(250,246,241,0.2); background: transparent; }
.newsletter-icon {
  display: inline-flex;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(188, 108, 37, 0.25);
  color: var(--clay);
  font-size: 1.6rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.newsletter-modal h3 { color: var(--white); }
.newsletter-modal p { color: rgba(250, 246, 241, 0.75); font-size: 0.95rem; }
.newsletter-modal input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(250, 246, 241, 0.2);
  background: rgba(250, 246, 241, 0.08);
  color: var(--cream);
  font-family: var(--font-body);
  margin: 8px 0 14px;
  font-size: 0.95rem;
}
.newsletter-modal input:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.3); }
.newsletter-tip { font-size: 0.78rem; color: rgba(250, 246, 241, 0.5) !important; margin: 12px 0 0; }

/* ========== 回到顶部 ========== */
.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--terracotta);
  color: var(--white);
  border: none;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--shadow-strong);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: var(--transition);
  z-index: 150;
}
.back-top.show { opacity: 1; visibility: visible; transform: none; }
.back-top:hover { background: var(--charcoal); transform: translateY(-4px); }

/* ========== Toast ========== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: var(--charcoal);
  color: var(--cream);
  padding: 13px 22px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 16px 40px var(--shadow-strong);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out), visibility 0.3s;
  z-index: 300;
  max-width: 86vw;
  text-align: center;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ========== 骨架屏加载 ========== */
.loader {
  position: fixed;
  inset: 0;
  background: var(--cream);
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--charcoal);
  transition: opacity 0.5s ease, visibility 0.5s;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader-mark { font-size: 2rem; color: var(--terracotta); animation: spinMark 1.6s ease-in-out infinite; }
@keyframes spinMark { 0%,100% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.15); } }

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .features-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-image { order: -1; max-width: 500px; margin: 0 auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .main-nav { display: none; }
  .menu-toggle { display: flex; }
  .header-actions .cart-toggle { order: 2; }
  .card-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .category-card { padding: 14px; }
  .category-card span { font-size: 1rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .hero { padding: 64px 0 56px; }
  .section-header { margin-bottom: 32px; }
  .toast { width: auto; bottom: 20px; }
  .back-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}
@media (max-width: 420px) {
  .header-actions .btn-text { display: none; }           /* 窄屏隐藏登录/注册文本按钮 */
  .header-actions .cart-toggle { display: inline-flex; }
  .container { padding: 0 18px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .logo { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-shape, .loader-mark, .cart-count.bump, .reveal { animation: none !important; transition: none !important; }
}

@import url('_patch.css');