/* ============================================================
   玉色江南 | Jade & Jiangnan — 高级电商设计系统
   ============================================================ */

/* --- 字体引入 --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400&family=DM+Sans:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,700&family=Noto+Serif+SC:wght@400;600;700;900&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* --- CSS 变量 --- */
:root {
  --bg-start: #faf7f2;
  --bg-end: #f5f0e8;
  --jade: #1a8a6a;
  --jade-light: #2ab08a;
  --jade-dark: #126e54;
  --jade-glow: rgba(26, 138, 106, 0.12);
  --sandalwood: #8B6914;
  --sandalwood-light: #b8922e;
  --tea: #d4c5a9;
  --tea-light: #e5daca;
  --gold: #e8d5a3;
  --gold-light: #f3e8c8;
  --card: #ffffff;
  --text-primary: #2c2c2c;
  --text-secondary: #5c5c5c;
  --text-muted: #9a9a9a;
  --line: rgba(212, 197, 169, 0.35);
  --danger: #c0392b;
  --danger-bg: #fce8e6;
  --success: #1a8a6a;
  --shadow-sm: 0 2px 8px rgba(44, 44, 44, 0.04);
  --shadow-md: 0 8px 28px rgba(44, 44, 44, 0.07);
  --shadow-lg: 0 16px 48px rgba(44, 44, 44, 0.10);
  --shadow-xl: 0 24px 64px rgba(44, 44, 44, 0.14);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --font-display: 'Playfair Display', serif;
  --font-body: 'DM Sans', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif-cn: 'Noto Serif SC', serif;
  --font-sans-cn: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --nav-height: 72px;
  --max-width: 1200px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset & 基础 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--jade); }

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

/* --- 按钮系统 --- */
button, .btn {
  font-family: var(--font-sans-cn);
  font-size: 14px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-full);
  padding: 10px 22px;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

button::after, .btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.12);
  opacity: 0;
  transition: opacity var(--transition-fast);
}
button:hover::after, .btn:hover::after { opacity: 1; }
button:active::after, .btn:active::after { opacity: 0.2; }

.btn-primary, button:not(.ghost):not(.pill-btn):not(.icon-btn):not(.nav-hamburger) {
  background: linear-gradient(135deg, var(--jade) 0%, var(--jade-light) 100%);
  color: #fff;
  box-shadow: 0 4px 16px var(--jade-glow);
}
.btn-primary:hover, button:not(.ghost):not(.pill-btn):not(.icon-btn):not(.nav-hamburger):hover {
  box-shadow: 0 8px 24px rgba(26, 138, 106, 0.25);
  transform: translateY(-1px);
}
.btn-primary:active, button:not(.ghost):not(.pill-btn):not(.icon-btn):not(.nav-hamburger):active {
  transform: translateY(0);
  box-shadow: 0 2px 8px var(--jade-glow);
}

.ghost {
  background: transparent;
  color: var(--jade);
  border: 1.5px solid var(--tea);
  box-shadow: none;
}
.ghost:hover {
  border-color: var(--jade);
  background: rgba(26, 138, 106, 0.04);
  transform: translateY(-1px);
}
.ghost:active {
  transform: translateY(0);
}

.pill-btn {
  background: var(--card);
  color: var(--text-secondary);
  border: 1px solid var(--tea);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 13px;
  box-shadow: none;
}
.pill-btn:hover {
  border-color: var(--jade);
  color: var(--jade);
  background: rgba(26, 138, 106, 0.04);
}

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--tea);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: none;
}
.icon-btn:hover {
  border-color: var(--jade);
  color: var(--jade);
  background: rgba(26, 138, 106, 0.04);
}

/* --- 输入框 & 选择器 --- */
input, select, textarea {
  font-family: var(--font-sans-cn);
  font-size: 14px;
  border: 1.5px solid var(--tea);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: var(--card);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  outline: none;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 3px var(--jade-glow);
}
input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}
textarea {
  resize: vertical;
  min-height: 60px;
  border-radius: var(--radius-sm);
}

/* --- 徽标（购物车数量） --- */
.pill-badge {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  position: absolute;
  top: -6px;
  right: -10px;
  transition: transform var(--transition-bounce);
}
.pill-badge.pulse {
  animation: badgePulse 0.4s ease;
}

@keyframes badgePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* --- 顶部导航栏 (Sticky + 毛玻璃) --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: var(--nav-height);
  padding: 0 clamp(16px, 4vw, 48px);
  background: rgba(250, 247, 242, 0.78);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid rgba(212, 197, 169, 0.25);
  transition: box-shadow var(--transition-normal);
}
.topbar.scrolled {
  box-shadow: 0 1px 12px rgba(44, 44, 44, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif-cn);
  font-size: 18px;
  font-weight: 700;
  color: var(--jade);
  white-space: nowrap;
  flex-shrink: 0;
}
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}
.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--jade), var(--jade-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
}

/* 桌面导航 */
.desktop-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}
.desktop-nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans-cn);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.desktop-nav a:hover,
.desktop-nav a.active {
  color: var(--jade);
  background: rgba(26, 138, 106, 0.06);
}
.desktop-nav a .cart-link {
  position: relative;
}

/* 用户区 */
.user-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--jade), var(--jade-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* 汉堡菜单按钮（移动端） */
.nav-hamburger {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.nav-hamburger:hover {
  background: rgba(26, 138, 106, 0.06);
}

/* ============================================================
   页面容器 & 视图切换（滑入动画）
   ============================================================ */
main {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 0 auto 60px;
  position: relative;
}
/* 商品列表页需要更宽 */
#viewProducts {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.view {
  padding: 32px 0;
  animation: viewEnter 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes viewEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

/* ============================================================
   首页 (#home)
   ============================================================ */

/* Hero Banner */
.hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: center;
  padding: 24px 0 16px;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26, 138, 106, 0.04) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -40px;
  left: -60px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 213, 163, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--jade);
  margin-bottom: 12px;
  position: relative;
  padding-left: 32px;
}
.hero-eyebrow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 28px;
  height: 2px;
  background: var(--jade);
  transform: translateY(-50%);
}

.hero-title {
  font-family: var(--font-serif-cn);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.hero-title .highlight {
  color: var(--jade);
  font-style: italic;
  font-family: var(--font-display);
}

.hero-subtitle {
  font-family: var(--font-sans-cn);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.hero-actions .btn {
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--jade) 0%, var(--jade-light) 100%);
  color: #fff;
  box-shadow: 0 4px 16px var(--jade-glow);
}
.hero-actions .ghost {
  padding: 14px 28px;
  font-size: 15px;
}

/* Hero 装饰卡片 */
.hero-decor {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(212, 197, 169, 0.2);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 380px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}
.hero-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(26, 138, 106, 0.25);
}
.hero-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(26, 138, 106, 0.04);
}
.hero-card-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sandalwood);
}
.hero-card-title {
  font-family: var(--font-serif-cn);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}
.hero-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}
.hero-card-price {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--jade);
  margin-top: auto;
}

/* 装饰性浮动元素 */
.hero-dot-1, .hero-dot-2 {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero-dot-1 {
  width: 12px;
  height: 12px;
  background: var(--gold);
  top: 10%;
  left: -8%;
  animation: floatSlow 6s ease-in-out infinite;
}
.hero-dot-2 {
  width: 8px;
  height: 8px;
  background: var(--tea);
  bottom: 20%;
  right: -5%;
  animation: floatSlow 8s ease-in-out infinite reverse;
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* --- 分类快捷入口 --- */
.category-strip {
  margin: 8px 0 12px;
  position: relative;
  z-index: 1;
}
.category-strip h3 {
  font-family: var(--font-serif-cn);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.category-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }
.category-chip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 22px;
  background: var(--card);
  border: 1px solid var(--tea-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  min-width: 80px;
}
.category-chip:hover {
  border-color: var(--jade);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.category-chip-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(26, 138, 106, 0.06), rgba(26, 138, 106, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--jade);
}
.category-chip-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* --- 精选好物 --- */
.featured-section {
  margin: 8px 0 4px;
  position: relative;
  z-index: 1;
}
.featured-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
}
.featured-header h2 {
  font-family: var(--font-serif-cn);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  position: relative;
}
.featured-header h2::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 40px;
  height: 3px;
  border-radius: 2px;
  background: var(--jade);
}
.featured-header .view-all-link {
  font-size: 13px;
  color: var(--jade);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.featured-header .view-all-link:hover {
  gap: 8px;
}

/* ============================================================
   商品卡片网格
   ============================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.product-card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(212, 197, 169, 0.15);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(26, 138, 106, 0.12);
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--jade), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}
.product-card:hover::before {
  opacity: 1;
}

.product-cover {
  height: 120px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(26, 138, 106, 0.06), rgba(232, 213, 163, 0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--jade);
  font-family: var(--font-serif-cn);
  font-weight: 900;
  font-size: 28px;
  position: relative;
  overflow: hidden;
}
/* 自有商品角标（仿京东红色标签） */
.self-tag {
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(135deg, #e53e3e, #c53030);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-sans-cn);
  padding: 2px 8px;
  border-radius: 0 0 8px 0;
  line-height: 1.4;
  z-index: 2;
  letter-spacing: 0.05em;
}
.product-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 50%);
}

.product-card-name {
  font-family: var(--font-serif-cn);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-card-price {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--jade);
  margin-top: auto;
}

.product-card-stock {
  font-size: 12px;
  color: var(--text-muted);
}

.product-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.product-card-actions button {
  flex: 1;
  padding: 8px 10px;
  font-size: 12px;
}

/* ============================================================
   页面标题区
   ============================================================ */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--font-serif-cn);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
}

.search-area {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.search-area input,
.search-area select {
  width: auto;
  min-width: 160px;
}
.search-area button {
  padding: 10px 20px;
}

/* ============================================================
   面板 / 卡片通用
   ============================================================ */
.panel {
  background: var(--card);
  border: 1px solid rgba(212, 197, 169, 0.15);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   购物车
   ============================================================ */
.cart-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--tea-light);
  align-items: center;
  transition: background var(--transition-fast);
}
.cart-item:last-child { border-bottom: none; }
.cart-item:hover { background: rgba(26, 138, 106, 0.02); }

.cart-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(26, 138, 106, 0.06), rgba(232, 213, 163, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--jade);
  font-size: 20px;
  flex-shrink: 0;
}

.cart-info strong {
  font-family: var(--font-serif-cn);
  font-size: 15px;
  font-weight: 600;
}
.cart-info .muted {
  font-size: 12px;
  color: var(--text-muted);
}
.cart-info .cart-price {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--jade);
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cart-qty button {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px solid var(--tea);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.cart-qty button:hover {
  border-color: var(--jade);
  color: var(--jade);
  background: rgba(26, 138, 106, 0.04);
}
.cart-qty span {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
}

.cart-qty .qty-animate {
  animation: qtyPop 0.25s ease;
}
@keyframes qtyPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* 购物车底部结算栏 */
.checkout-bar {
  position: sticky;
  bottom: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  align-items: center;
  margin-top: 20px;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 197, 169, 0.2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.checkout-total {
  font-size: 14px;
  color: var(--text-secondary);
}
.checkout-total strong {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--jade);
  margin-left: 4px;
}
.checkout-bar button {
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
}

/* 空购物车 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state-text {
  font-size: 15px;
  margin-bottom: 20px;
}

/* 优惠券区 */
.coupon-section {
  margin-top: 12px;
  padding: 16px;
  background: rgba(232, 213, 163, 0.08);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--gold);
}
.coupon-section strong {
  font-size: 13px;
  color: var(--sandalwood);
}
.coupon-section select {
  margin-top: 8px;
  font-size: 13px;
}

/* ============================================================
   订单
   ============================================================ */
.order-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--tea-light);
  align-items: center;
}
.order-item:last-child { border-bottom: none; }
.order-item:hover { background: rgba(26, 138, 106, 0.02); }

.order-no {
  font-family: var(--font-sans-cn);
  font-size: 14px;
  font-weight: 600;
}
.order-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.order-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: rgba(26, 138, 106, 0.06);
  color: var(--jade);
}
.order-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ============================================================
   弹窗 (Dialog)
   ============================================================ */
dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-xl);
  width: min(560px, calc(100% - 32px));
  max-height: 85vh;
  overflow-y: auto;
  background: var(--card);
  margin: auto;
  inset: 0;
  animation: dialogEnter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
dialog.closing {
  animation: dialogExit 0.2s ease both;
}

@keyframes dialogEnter {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
@keyframes dialogExit {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.95); }
}

dialog::backdrop {
  background: rgba(44, 44, 44, 0.55);
  backdrop-filter: blur(6px);
  animation: backdropEnter 0.3s ease both;
}
@keyframes backdropEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dialog-form, .product-detail {
  padding: 28px;
  display: grid;
  gap: 14px;
}
.dialog-form h3, .product-detail h3 {
  font-family: var(--font-serif-cn);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* 商品详情弹窗 */
.product-detail .subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.sku-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.sku-card {
  padding: 12px;
  border: 1.5px solid var(--tea-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}
.sku-card:hover {
  border-color: var(--jade);
  background: rgba(26, 138, 106, 0.03);
}
.sku-card.selected {
  border-color: var(--jade);
  background: rgba(26, 138, 106, 0.08);
  box-shadow: 0 0 0 2px var(--jade-glow);
}
.sku-card-name {
  font-size: 13px;
  font-weight: 600;
}
.sku-card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--jade);
  margin-top: 4px;
}
.sku-card-stock {
  font-size: 11px;
  color: var(--text-muted);
}

/* 评价区 */
.review-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--tea-light);
}
.review-item:last-child { border-bottom: none; }
.review-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.review-user strong {
  font-size: 13px;
}
.review-stars {
  color: var(--sandalwood);
  font-size: 14px;
  letter-spacing: 2px;
}
.review-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.review-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   个人中心
   ============================================================ */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.profile-card {
  background: var(--card);
  border: 1px solid rgba(212, 197, 169, 0.15);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal);
}
.profile-card:hover {
  box-shadow: var(--shadow-md);
}
.profile-card h3 {
  font-family: var(--font-serif-cn);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-card h3 .icon {
  color: var(--jade);
}

.member-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--jade), var(--jade-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

/* ============================================================
   Toast 通知（顶部居中，优雅淡入淡出）
   ============================================================ */
.toast-zone {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 999;
  pointer-events: none;
}

.toast {
  padding: 12px 24px;
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastEnter 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  max-width: 90vw;
  text-align: center;
  line-height: 1.4;
}
.toast.removing {
  animation: toastExit 0.25s ease both;
}
.toast.ok {
  background: linear-gradient(135deg, var(--jade), var(--jade-light));
}
.toast.bad {
  background: linear-gradient(135deg, #d35400, #e67e22);
}
.toast.info {
  background: linear-gradient(135deg, var(--sandalwood), var(--sandalwood-light));
}

@keyframes toastEnter {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes toastExit {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-12px) scale(0.95); }
}

/* ============================================================
   加载更多
   ============================================================ */
.load-more-wrap {
  text-align: center;
  margin: 32px 0 8px;
}
.load-more-btn {
  padding: 12px 40px;
  font-size: 14px;
  border-radius: var(--radius-full);
  background: var(--card);
  border: 1.5px solid var(--tea);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
  font-weight: 500;
}
.load-more-btn:hover {
  border-color: var(--jade);
  color: var(--jade);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.load-more-btn:active {
  transform: translateY(0);
}

/* ============================================================
   分类浏览区
   ============================================================ */
.category-browse {
  padding: 32px 0 16px;
  max-width: 1200px;
  margin: 0 auto;
}
.category-browse-header {
  text-align: center;
  margin-bottom: 24px;
}
.category-browse-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}
.category-browse-header p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  justify-items: center;
}

/* ============================================================
   精选商品区
   ============================================================ */
.featured-products {
  padding: 32px 0 16px;
  max-width: 1200px;
  margin: 0 auto;
}
.featured-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.featured-header .featured-title-group {
  text-align: left;
  flex: 1;
}
.featured-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}
.featured-header p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}
.featured-header .view-all-link {
  font-size: 14px;
  color: var(--jade);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.featured-header .view-all-link:hover {
  text-decoration: underline;
}
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

/* ============================================================
   品牌信息区（底部）
   ============================================================ */
.brand-footer {
  margin-top: 32px;
  padding: 24px 0 16px;
  border-top: 1px solid var(--tea-light);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.brand-footer .footer-brand {
  font-family: var(--font-serif-cn);
  font-size: 18px;
  font-weight: 700;
  color: var(--jade);
  margin-bottom: 8px;
}
.brand-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.brand-footer .footer-links a {
  color: var(--text-secondary);
  font-size: 13px;
}
.brand-footer .footer-links a:hover {
  color: var(--jade);
}

/* ============================================================
   页面加载渐入效果
   ============================================================ */
.page-load {
  animation: pageLoad 0.6s ease both;
}
@keyframes pageLoad {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================================
   滚动条美化
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--tea);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--jade);
}

/* ============================================================
   响应式设计
   ============================================================ */

/* 平板 (768-1024px) */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .profile-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 平板 & 手机 — 导航折叠 */
@media (max-width: 900px) {
  .desktop-nav {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(250, 247, 242, 0.98);
    backdrop-filter: blur(20px);
    padding: 12px 16px;
    gap: 4px;
    border-bottom: 1px solid var(--tea-light);
    box-shadow: var(--shadow-md);
  }
  .desktop-nav.open {
    display: flex;
  }
  .desktop-nav a {
    padding: 12px 16px;
    width: 100%;
    border-radius: var(--radius-sm);
  }

  .nav-hamburger {
    display: flex;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 28px;
  }
  .hero-subtitle {
    max-width: 100%;
  }
  .hero-decor {
    display: flex;
    justify-content: center;
  }
  .hero-card {
    max-width: 100%;
  }
  .hero-dot-1, .hero-dot-2 { display: none; }
}

/* ============================================================
   登录/注册全屏遮罩 - 左右分栏布局
   ============================================================ */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-container {
  display: grid;
  grid-template-columns: 1fr 420px;
  width: 100%;
  max-width: 900px;
  min-height: 560px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* 左侧广告位 */
.auth-left {
  background: linear-gradient(135deg, var(--jade) 0%, var(--jade-dark) 100%);
  color: #fff;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.auth-brand {
  text-align: center;
}

.auth-brand-logo {
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 16px;
  backdrop-filter: blur(4px);
}

.auth-brand h2 {
  font-family: var(--font-serif-cn);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-brand p {
  font-size: 14px;
  opacity: 0.85;
  letter-spacing: 0.1em;
}

.auth-ad-placeholder {
  text-align: center;
  padding: 40px 20px;
  border: 2px dashed rgba(255,255,255,0.3);
  border-radius: var(--radius-md);
}

.auth-ad-text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.auth-ad-sub {
  font-size: 13px;
  opacity: 0.7;
}

/* 右侧表单区 */
.auth-right {
  padding: 32px 36px;
  position: relative;
  overflow-y: auto;
  max-height: 90vh;
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.auth-close:hover {
  background: var(--glass-mid);
  color: var(--text-primary);
}

.auth-panel h3 {
  font-family: var(--font-serif-cn);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.auth-input-group {
  margin-bottom: 16px;
}

.auth-input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.auth-input-group input,
.auth-input-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--tea-light);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--card);
  color: var(--text-primary);
  font-family: inherit;
  transition: all 0.2s;
}

.auth-input-group input:focus,
.auth-input-group textarea:focus {
  outline: none;
  border-color: var(--jade);
  box-shadow: 0 0 0 3px var(--jade-bg);
}

.auth-code-row {
  display: flex;
  gap: 8px;
}

.auth-code-row input {
  flex: 1;
}

.auth-code-row button {
  padding: 10px 16px;
  background: var(--jade);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.auth-code-row button:hover { opacity: 0.9; }
.auth-code-row button:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
}

.auth-forgot {
  text-align: right;
  margin: -8px 0 16px;
}

.auth-forgot a {
  font-size: 13px;
  color: var(--sandalwood);
  text-decoration: none;
}

.auth-forgot a:hover { text-decoration: underline; }

.auth-submit {
  width: 100%;
  padding: 12px;
  background: var(--jade);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.auth-submit:hover { opacity: 0.9; }

.auth-terms {
  margin: 12px 0 16px;
}

.auth-terms label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-terms input {
  width: auto;
  margin-top: 2px;
}

.auth-terms a {
  color: var(--jade);
  text-decoration: none;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--tea-light);
  font-size: 13px;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--jade);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}

.auth-switch a:hover { text-decoration: underline; }

/* 角色选择卡片 */
.auth-role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-role-card {
  padding: 20px 16px;
  border: 2px solid var(--tea-light);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.auth-role-card:hover {
  border-color: var(--jade-light);
}

.auth-role-card.selected {
  border-color: var(--jade);
  background: var(--jade-bg);
}

.auth-role-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.auth-role-card h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.auth-role-card p {
  font-size: 12px;
  color: var(--text-muted);
}

.auth-role-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: var(--jade);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s;
}

.auth-role-card.selected .auth-role-check {
  opacity: 1;
}

.auth-extra-fields {
  margin-bottom: 16px;
}

.auth-step-actions {
  display: flex;
  gap: 12px;
}

.auth-step-actions .auth-back {
  flex: 1;
  padding: 12px;
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--tea-light);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-step-actions .auth-back:hover {
  border-color: var(--jade);
  color: var(--jade);
}

.auth-step-actions .auth-submit {
  flex: 2;
}

/* 响应式 */
@media (max-width: 768px) {
  .auth-container {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
  .auth-left {
    display: none;
  }
  .auth-right {
    padding: 24px;
  }
}

/* ============================================================
   骨架屏加载占位
   ============================================================ */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.skeleton-card {
  background: var(--card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.skeleton-cover {
  height: 180px;
  background: linear-gradient(90deg, var(--tea-light) 25%, var(--gold-light) 50%, var(--tea-light) 75%);
  background-size: 200% 100%;
  animation: skeletonShine 1.5s ease-in-out infinite;
}
.skeleton-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--tea-light) 25%, var(--gold-light) 50%, var(--tea-light) 75%);
  background-size: 200% 100%;
  animation: skeletonShine 1.5s ease-in-out infinite;
}
.skeleton-line-short {
  width: 60%;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--tea-light) 25%, var(--gold-light) 50%, var(--tea-light) 75%);
  background-size: 200% 100%;
  animation: skeletonShine 1.5s ease-in-out infinite;
}
.skeleton-line-price {
  width: 40%;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--tea-light) 25%, var(--gold-light) 50%, var(--tea-light) 75%);
  background-size: 200% 100%;
  animation: skeletonShine 1.5s ease-in-out infinite;
}

@keyframes skeletonShine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 页面转场 */
.view {
  animation: mallViewFade 0.35s ease;
}
@keyframes mallViewFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 手机 (<768px) */
@media (max-width: 768px) {
  .topbar {
    padding: 0 12px;
    height: 64px;
  }
  .brand {
    font-size: 18px;
  }
  .brand-logo {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .search-area {
    width: 100%;
  }
  .search-area input,
  .search-area select {
    min-width: 0;
    flex: 1;
  }

  .cart-item {
    grid-template-columns: 40px 1fr;
    gap: 10px;
  }
  .cart-item .cart-qty {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
  .cart-thumb {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .order-item {
    grid-template-columns: 1fr;
  }
  .order-actions {
    margin-top: 6px;
  }

  .checkout-bar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    text-align: center;
    padding: 16px;
  }
  .checkout-bar button {
    width: 100%;
  }

  .dialog-form, .product-detail {
    padding: 20px;
  }

  .hero-actions {
    flex-direction: column;
  }
  .hero-actions .btn,
  .hero-actions .ghost {
    width: 100%;
    justify-content: center;
  }

  .sku-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .brand-footer .footer-links {
    gap: 12px;
  }
}