:root {
  --primary: #B43A5C;
  --primary-light: #D4607E;
  --primary-dark: #8C2A46;
  --bg: #FAF6F3;
  --bg-card: #FFFFFF;
  --text: #2C2C2C;
  --text-light: #888;
  --border: #E8E0DA;
  --accent-green: #A8D8B9;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --header-height: 56px;
  --max-width: 480px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 64px;
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* === Header === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
}
.header-logo span { font-weight: 300; color: var(--text-light); font-size: 0.75rem; margin-left: 4px; }
.header-nav { display: flex; gap: 20px; }
.header-nav a {
  font-size: 0.85rem;
  color: var(--text);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: 0.2s;
}
.header-nav a:hover, .header-nav a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* === Hero === */
.hero {
  padding: 40px 0 32px;
  text-align: center;
}
.hero h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.hero h1 small {
  display: block;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-light);
  margin-top: 4px;
}
.hero p {
  color: var(--text-light);
  font-size: 0.9rem;
  max-width: 320px;
  margin: 0 auto;
}

/* === Categories === */
.categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.categories::-webkit-scrollbar { display: none; }
.category-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}
.category-btn:hover, .category-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* === Product Grid === */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px 0 20px;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: 0.25s;
  cursor: pointer;
}
.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.product-card-image {
  aspect-ratio: 1;
  background: #f0ebe5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-card-body {
  padding: 10px 12px 14px;
}
.product-card-body .name {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card-body .name-jp {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-bottom: 6px;
}
.product-card-body .price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}
.product-card-body .price small {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-light);
}
.product-card-body .card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 0.7rem;
}
.card-sales {
  color: var(--text-light);
}
.card-rating {
  color: #F5A623;
  letter-spacing: -1px;
}

/* === Sales Badge === */
.sales-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 500;
}
.price-sales-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

/* === Back Button === */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  padding: 8px 0;
  color: var(--text-light);
  cursor: pointer;
  background: none;
  border: none;
}

/* === Product Detail === */
.detail {
  padding: 16px 0;
}
.detail-image {
  aspect-ratio: 1;
  background: #f0ebe5;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-header { margin-bottom: 20px; }
.detail-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.detail-header .name-jp {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 8px;
}
.detail-header .price-row {
  display: flex;
  align-items: baseline;
}
.detail-header .price-display {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.detail-section {
  margin-bottom: 20px;
}
.detail-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.detail-section p {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.8;
}

.specs-table {
  width: 100%;
  font-size: 0.85rem;
}
.specs-table td {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.specs-table td:first-child {
  color: var(--text-light);
  width: 90px;
}
.specs-table td:last-child {
  color: var(--text);
}

/* === Suitable For (适合人群) === */
.suitable-section {
  margin-bottom: 20px;
}
.suitable-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.suitable-tag {
  display: inline-block;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid var(--primary-light);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--primary);
}

/* === Guide Cards (购物导览) === */
.guide-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.guide-scroll::-webkit-scrollbar { display: none; }
.guide-card {
  flex-shrink: 0;
  width: 180px;
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.guide-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.guide-icon {
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f0eb;
  border-radius: 50%;
}
.guide-label {
  font-size: 0.85rem;
  font-weight: 700;
}
.guide-desc {
  font-size: 0.65rem;
  color: var(--text-light);
  margin-top: 1px;
}
.guide-products {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.guide-product-tag {
  display: block;
  font-size: 0.75rem;
  padding: 5px 8px;
  background: #faf6f3;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guide-product-tag:hover {
  background: var(--primary-light);
  color: #fff;
}

/* === Footer === */
.footer {
  text-align: center;
  padding: 32px 0;
  color: var(--text-light);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

/* === Page Title === */
.page-title {
  padding: 20px 0 4px;
  font-size: 1.2rem;
  font-weight: 700;
}

/* === Reviews === */
.review-section {
  margin-bottom: 20px;
}
.review-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.review-summary-score {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 60px;
  text-align: center;
}
.review-summary-score small {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-light);
}
.review-summary-stars {
  color: #F5A623;
  font-size: 1.1rem;
  letter-spacing: 2px;
}
.review-summary-count {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 2px;
}
.review-item {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.review-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}
.review-user {
  font-size: 0.8rem;
  font-weight: 600;
}
.review-date {
  font-size: 0.65rem;
  color: var(--text-light);
}
.review-stars {
  margin-left: auto;
  color: #F5A623;
  font-size: 0.8rem;
  letter-spacing: 1px;
}
.review-content {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.6;
}

/* === Daily Blog (发货日志) === */
.blog-section {
  margin-bottom: 20px;
}
.blog-timeline {
  position: relative;
  padding-left: 20px;
}
.blog-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}
.blog-entry {
  position: relative;
  padding: 0 0 16px 16px;
}
.blog-entry:last-child {
  padding-bottom: 0;
}
.blog-entry::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--primary);
}
.blog-entry-date {
  font-size: 0.7rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
}
.blog-entry-content {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.7;
  background: #fff;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

/* === Floating Contact Bar (微信二维码) === */
.contact-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.contact-bar-info {
  flex: 1;
}
.contact-bar-info .label {
  font-size: 0.75rem;
  color: var(--text-light);
}
.contact-bar-info .wechat-id {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
}
.contact-bar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  flex-shrink: 0;
}
.contact-bar-btn:hover {
  background: var(--primary-dark);
}

/* === QR Code Modal === */
.qr-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.qr-overlay.show {
  display: flex;
}
.qr-modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 30px 24px 20px;
  text-align: center;
  max-width: 280px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}
.qr-modal img {
  width: 200px;
  height: 200px;
  margin: 0 auto 12px;
  border-radius: var(--radius-sm);
  background: #f0ebe5;
  display: flex;
  align-items: center;
  justify-content: center;
  object-fit: contain;
}
.qr-modal .title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.qr-modal .subtitle {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 12px;
}
.qr-modal .wechat-id-display {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  background: #f5f0eb;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: inline-block;
}
.qr-close-btn {
  margin-top: 14px;
  padding: 6px 24px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-light);
}

/* === Inline QR (detail page) === */
.qr-inline {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.qr-inline .qr-image {
  width: 160px;
  height: 160px;
  margin: 0 auto 12px;
  border-radius: var(--radius-sm);
}
.qr-inline p {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 4px;
}
.qr-inline .wechat-hint {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

/* === Loading & States === */
.loading {
  text-align: center;
  padding: 40px 0;
  color: var(--text-light);
}
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

/* === Image Gallery === */
.gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}
.gallery img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
}
.gallery img.active {
  border-color: var(--primary);
}

/* === Responsive === */
@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: 1fr 1fr 1fr;
    max-width: 720px;
    margin: 0 auto;
  }
  .container { max-width: 720px; }
  .header-inner { max-width: 720px; }
}
