/* ==========================================================================
   风格 C 杂志画报式 — 暖米白 × 灰绿 × 浅咖（生活日用色调）
   gaisu.asia — 日用百货商城
   ========================================================================== */

:root {
  /* Morandhi palette — soft, low-saturation */
  --morandhi-rose: #C4A4A7;
  --morandhi-sage: #A8B5A0;
  --morandhi-blue: #9BAEC8;
  --morandhi-cream: #E8DCC4;
  --warm-cream: #F1E8DA;
  --leaf-grey: #A8B098;
  --morandhi-stone: #B8AFA1;
  --morandhi-clay: #C9B5A0;
  --morandhi-mauve: #B5A2A8;
  --morandhi-eucalyptus: #95A695;

  /* Functional */
  --text: #3A3A3A;
  --text-light: #6B6B6B;
  --text-soft: #999999;
  --bg: #F5F1EA;          /* cream morandhi bg */
  --bg-soft: #EDE7DC;
  --bg-card: #FBF8F2;     /* slightly brighter card */
  --line: #DDD5C5;
  --line-light: #E8E2D5;

  /* Accents — keep low-key for style C */
  --accent: #8C9079;       /* 灰绿 · 家居感 */
  --accent-soft: #D0D2C4;
  --shadow-soft: 0 2px 12px rgba(60, 50, 40, 0.06);
  --shadow-card: 0 4px 18px rgba(60, 50, 40, 0.08);
  --shadow-lift: 0 6px 24px rgba(60, 50, 40, 0.12);

  /* Radius — 大圆角 */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  /* Layout */
  --max-w: 480px;
  --gutter: 16px;
}

/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; overflow-x: hidden; }
body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: transparent; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ==========================================================================
   Topbar — 极细窄条导航(风格 C 核心)
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(245, 241, 234, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-light);
}
.topbar .logo {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text);
}
.topbar .logo .dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--morandhi-rose);
  border-radius: 50%;
  margin: 0 4px 2px 0;
  vertical-align: middle;
}
.topnav {
  display: flex;
  gap: 22px;
  align-items: center;
}
.topnav a {
  font-size: 13px;
  color: var(--text-light);
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.topnav a.active, .topnav a:hover { color: var(--text); }

/* ==========================================================================
   Hero Poster — 静态大图海报(不轮播)
   ========================================================================== */
.hero-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--bg-soft);
}
.hero-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px 22px;
  background: linear-gradient(to top, rgba(58,58,58,0.32) 0%, transparent 50%);
}
.hero-overlay .eyebrow {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.85);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.hero-overlay .title {
  font-size: 26px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin-bottom: 4px;
}
.hero-overlay .subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.78);
  letter-spacing: 0.08em;
}

/* ==========================================================================
   Magazine Block — 图文介绍区块
   ========================================================================== */
.magazine-block {
  padding: 36px 20px 28px;
  text-align: center;
}
.magazine-block .eyebrow {
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--text-soft);
  margin-bottom: 12px;
  text-transform: uppercase;
}
.magazine-block h2 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.4;
}
.magazine-block p {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.85;
  letter-spacing: 0.04em;
  max-width: 320px;
  margin: 0 auto;
}
.magazine-divider {
  width: 32px;
  height: 1px;
  background: var(--line);
  margin: 18px auto 0;
}

/* ==========================================================================
   Theme Row — 横向滑动卡片组(风格 C 核心)
   ========================================================================== */
.theme-row {
  padding: 28px 0 24px;
}
.theme-row .theme-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 20px 14px;
}
.theme-row h2 {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
}
.theme-row .theme-head .theme-en {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-soft);
  text-transform: uppercase;
}
.theme-row .theme-tagline {
  padding: 0 20px 12px;
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 0.06em;
}
.scroll-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 16px 12px 16px;
}
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-card {
  flex: 0 0 70%;
  scroll-snap-align: start;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.scroll-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-card);
}
.scroll-card .card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  overflow: hidden;
}
.scroll-card .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.scroll-card .card-info {
  padding: 12px 14px 14px;
}
.scroll-card .card-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  min-height: 36px;
}
.scroll-card .card-price {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Essay — 短篇文案(杂志画报分隔)
   ========================================================================== */
.essay {
  margin: 20px 20px 8px;
  padding: 28px 22px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.essay .quote-mark {
  font-size: 32px;
  color: var(--morandhi-rose);
  line-height: 0.5;
  margin-bottom: 8px;
  font-family: Georgia, serif;
}
.essay p {
  font-size: 14px;
  line-height: 1.95;
  color: var(--text);
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.essay .signoff {
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--text-soft);
  text-transform: uppercase;
}

/* ==========================================================================
   About Magazine — 关于我们画报区块(首页)
   ========================================================================== */
.about-magazine {
  margin: 28px 20px;
  padding: 28px 24px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.about-magazine .eyebrow {
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--text-soft);
  margin-bottom: 12px;
  text-transform: uppercase;
}
.about-magazine h3 {
  font-size: 19px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: 0.04em;
}
.about-magazine p {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.85;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}
.about-magazine .about-link {
  display: inline-block;
  padding: 10px 28px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.2em;
  border-radius: 999px;
  transition: all 0.2s;
}
.about-magazine .about-link:hover {
  background: var(--accent);
  color: #fff;
}

/* ==========================================================================
   Floating Customer Service — 浮动客服(不重叠顶部)
   ========================================================================== */
.fab-support {
  position: fixed;
  right: 16px;
  top: 80px;  /* 顶部 52px + 28px 间距 */
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--morandhi-rose);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(196, 164, 167, 0.4);
  z-index: 40;
  transition: transform 0.2s;
}
.fab-support:active { transform: scale(0.92); }

/* ==========================================================================
   Toast — 顶部 iOS 风格
   ========================================================================== */
.toast {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(58, 58, 58, 0.92);
  color: #fff;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast::before {
  content: '✓';
  display: inline-block;
  width: 16px; height: 16px;
  background: #6FBF6F;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  line-height: 16px;
  margin-right: 2px;
}
.toast.err::before { content: '!'; background: #D97070; }

/* ==========================================================================
   Footer — 通用页脚(ICP / 经营内容 / 客服)
   ========================================================================== */
.site-footer {
  margin-top: 40px;
  padding: 32px 20px 24px;
  background: var(--bg-soft);
  color: var(--text-light);
  font-size: 11px;
  line-height: 1.85;
  text-align: center;
  letter-spacing: 0.04em;
}
.site-footer .footer-row { margin-bottom: 8px; }
.site-footer a { color: var(--text-light); margin: 0 6px; }
.site-footer a:hover { color: var(--text); }
.site-footer .icp {
  margin: 12px 0 6px;
}
.site-footer .icp a { color: var(--text-light); }
.site-footer .copyright {
  color: var(--text-soft);
  font-size: 10px;
  margin-top: 12px;
}
.site-footer .biz {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line-light);
  color: var(--text-soft);
}

/* ==========================================================================
   Cart FAB (top bar small badge)
   ========================================================================== */
.cart-fab {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
}
.cart-fab .badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--morandhi-rose);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  text-align: center;
  display: none;
}
.cart-fab .badge.show { display: inline-block; }

/* ==========================================================================
   Modal — 通用弹窗
   ========================================================================== */
.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(58, 58, 58, 0.42);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-mask.show {
  display: flex;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 28px 22px;
  width: calc(100% - 40px);
  max-width: 360px;
  text-align: center;
  box-shadow: var(--shadow-lift);
}
.modal-box h3 {
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--text);
}
.modal-box p {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 18px;
}
.modal-box .modal-actions {
  display: flex;
  gap: 12px;
}
.modal-box .modal-actions button {
  flex: 1;
  padding: 11px 0;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.1em;
  transition: all 0.2s;
}
.modal-box .btn-primary {
  background: var(--accent);
  color: #fff;
}
.modal-box .btn-primary:hover { background: #857560; }
.modal-box .btn-secondary {
  background: var(--bg-soft);
  color: var(--text);
}

/* ==========================================================================
   Detail Modal — 商品详情
   ========================================================================== */
.modal-mask.detail-mask {
  align-items: flex-end;
}
.detail-sheet {
  background: var(--bg-card);
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 0 0 28px;
  max-height: 88vh;
  overflow-y: auto;
  animation: slideUp 0.25s;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.detail-head {
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 5;
  padding: 12px 0 0;
  text-align: center;
}
.detail-head::before {
  content: '';
  display: block;
  width: 38px;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  margin: 0 auto 12px;
}
.detail-head .sheet-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--text-light);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-images {
  display: flex;
  gap: 8px;
  padding: 0 20px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.detail-images::-webkit-scrollbar { display: none; }
.detail-images img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 2px solid transparent;
  flex-shrink: 0;
  cursor: pointer;
  background: var(--bg-soft);
}
.detail-images img.active {
  border-color: var(--accent);
}
.detail-main {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg-soft);
  overflow: hidden;
  margin-bottom: 14px;
}
.detail-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-block {
  padding: 16px 20px;
}
.detail-block .detail-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 6px;
}
.detail-block .detail-price {
  font-size: 22px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}
.detail-block .detail-cat {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--text-soft);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.size-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.size-row .size-chip {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 12px;
  color: var(--text);
  border: 1px solid transparent;
  transition: all 0.2s;
}
.size-row .size-chip.active {
  background: var(--accent);
  color: #fff;
}
.qty-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.qty-row label {
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 0.05em;
}
.qty-row .qty-ctrl {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 4px 12px;
}
.qty-row .qty-ctrl button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  font-size: 16px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-row .qty-ctrl span {
  min-width: 24px;
  text-align: center;
  font-size: 14px;
}
.sheet-actions {
  display: flex;
  gap: 10px;
  padding: 0 20px;
  margin-top: 8px;
}
.sheet-actions button {
  flex: 1;
  padding: 13px 0;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.1em;
  font-weight: 500;
  transition: all 0.2s;
}
.btn-add-cart {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-buy {
  background: var(--accent);
  color: #fff;
}
.btn-buy:hover { background: #857560; }

/* ==========================================================================
   Cart Modal — 购物车
   ========================================================================== */
.modal-mask.cart-mask {
  align-items: flex-end;
}
.cart-sheet {
  background: var(--bg-card);
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 0 0 100px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.25s;
}
.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-light);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 5;
}
.cart-head h3 {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.05em;
}
.cart-head .clear {
  font-size: 12px;
  color: var(--text-light);
}
.cart-list {
  padding: 8px 20px;
}
.cart-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-soft);
  font-size: 13px;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-light);
}
.cart-item img {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
  background: var(--bg-soft);
}
.cart-item .ci-info {
  flex: 1;
  min-width: 0;
  padding-right: 8px;
}
.cart-item .ci-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.cart-item .ci-meta {
  font-size: 11px;
  color: var(--text-soft);
  margin-bottom: 8px;
}
.cart-item .ci-price {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
}
.cart-item .ci-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-item .ci-qty button {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-soft);
  font-size: 14px;
  color: var(--text);
}
.cart-item .ci-qty span {
  min-width: 22px;
  text-align: center;
  font-size: 13px;
}
.cart-item .ci-del {
  font-size: 12px;
  color: var(--text-soft);
  padding: 4px 8px;
}
.cart-foot {
  position: sticky;
  bottom: 0;
  background: var(--bg-card);
  padding: 14px 20px;
  border-top: 1px solid var(--line-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
}
.cart-foot .cart-total {
  font-size: 13px;
  color: var(--text-light);
}
.cart-foot .cart-total .price {
  font-size: 18px;
  color: var(--accent);
  font-weight: 500;
  margin-left: 4px;
}
.cart-foot .btn-checkout {
  padding: 10px 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   Responsive helpers
   ========================================================================== */
@media (max-width: 360px) {
  .topbar { padding: 0 16px; }
  .scroll-card { flex-basis: 78%; }
  .magazine-block, .theme-row .theme-head, .theme-row .theme-tagline { padding-left: 16px; padding-right: 16px; }
  .scroll-row { padding-left: 16px; padding-right: 16px; }
}
/* 右滑提示 — 渐变阴影 + 箭头指示（v3 新增）*/
.scroll-row {
  position: relative;
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 32px), transparent 100%);
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 32px), transparent 100%);
}
.scroll-row::after {
  content: '›';
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 22px;
  font-weight: 300;
  pointer-events: none;
  animation: scrollHintFade 2.4s ease-in-out infinite;
  z-index: 5;
}
.theme-row:not(:last-child) .scroll-row::after { display: block; }
/* 滚动后隐藏提示：通过 JS 加 .scrolled 类，CSS 隐藏 */
.scroll-row.scrolled::after {
  opacity: 0;
  transition: opacity 0.4s;
}
@keyframes scrollHintFade {
  0%, 100% { opacity: 0.85; transform: translateY(-50%) translateX(0); }
  50% { opacity: 0.45; transform: translateY(-50%) translateX(-3px); }
}
