@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@300;400;500&display=swap');

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

:root {
  --primary: #6B4C8A;
  --primary-light: #9B7DB8;
  --primary-dark: #4A2D6B;
  --accent: #D4A574;
  --bg: #FAF6F1;
  --bg-card: #FFFFFF;
  --text: #3D2C2C;
  --text-light: #8B7676;
  --text-muted: #B5A3A3;
  --border: #E8DDD4;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ===== Header ===== */
.header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  padding: 20px 24px 16px;
  position: relative;
  overflow: hidden;
}
.header::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 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.05'%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");
  opacity: 0.3;
}
.brand { position: relative; z-index: 1; }
.brand-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 3px;
}
.brand-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
  letter-spacing: 1px;
}
.header-nav {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 12px;
  z-index: 1;
}
.header-nav a {
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 20px;
  transition: all 0.2s;
}
.header-nav a:hover, .header-nav a.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.fabric-id {
  position: absolute;
  right: 24px;
  top: 24px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  z-index: 1;
}

/* ===== Gallery / Image Carousel ===== */
.gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}
.gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.35s ease;
}
.gallery-slide {
  min-width: 100%;
  height: 100%;
}
.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}
.gallery-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: all 0.3s;
  cursor: pointer;
}
.gallery-dots span.active {
  background: #fff;
  width: 18px;
  border-radius: 3px;
}
.img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
}
.img-placeholder .weave-pattern {
  font-size: 48px;
  margin-bottom: 8px;
  opacity: 0.4;
  line-height: 1.2;
}

/* ===== Content ===== */
.content { padding: 24px; }

.fabric-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.fabric-origin {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 20px;
}
.fabric-origin span { color: var(--primary); }

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.tag {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.tag-material {
  background: rgba(107, 76, 138, 0.1);
  color: var(--primary);
}
.tag-pattern {
  background: rgba(212, 165, 116, 0.2);
  color: #8B6914;
}
.tag-status {
  background: rgba(76, 138, 87, 0.1);
  color: #4C8A57;
}
.tag-status.low {
  background: rgba(200, 140, 50, 0.1);
  color: #b08030;
}

/* Info Card */
.info-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.info-card-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-card-title::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--primary);
  border-radius: 2px;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.info-item.full { grid-column: 1 / -1; }
.info-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.info-value {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}

/* Story */
.story {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.story p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}

/* Suitable Tags */
.suitable-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.suitable-tag {
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(107,76,138,0.06), rgba(212,165,116,0.1));
  border: 1px solid rgba(107,76,138,0.1);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text);
}

/* Care Icons */
.care-icons {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}
.care-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(107,76,138,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* Contact */
.contact-section {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
  color: #fff;
  text-align: center;
}
.contact-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 16px;
  margin-bottom: 4px;
}
.contact-sub {
  font-size: 12px;
  opacity: 0.7;
  margin-bottom: 20px;
}
.contact-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.contact-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.2s;
  cursor: pointer;
}
.contact-btn:active { transform: scale(0.96); }
.btn-wechat {
  background: rgba(255,255,255,0.95);
  color: var(--primary-dark);
}
.btn-xhs {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}

/* Footer */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 11px;
  color: var(--text-muted);
}
.footer .brand-footer {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  color: var(--primary-light);
  margin-bottom: 4px;
}

/* ===== Index Page ===== */

/* Filter Bar */
.filter-bar {
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}
.filter-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-group {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.filter-group + .filter-group {
  padding-left: 8px;
  border-left: 1px solid var(--border);
}
.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: 'Noto Sans SC', sans-serif;
}
.filter-btn:active { transform: scale(0.96); }
.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Fabric Grid */
.fabric-grid {
  padding: 0 16px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.fabric-card {
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.25s;
  animation: fadeInUp 0.4s ease both;
}
.fabric-card:active { transform: scale(0.97); }
.fabric-card.hidden {
  display: none;
}
.card-image {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 32px;
  line-height: 1.1;
}
.card-info {
  padding: 12px;
}
.card-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 6px;
  line-height: 1.4;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.card-tag {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  background: rgba(107,76,138,0.08);
  color: var(--text-light);
}
.card-origin {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}
.empty-state p {
  font-size: 14px;
}

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

/* ===== About Page ===== */
.about-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 48px 24px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.about-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 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.05'%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");
  opacity: 0.3;
}
.about-hero-content {
  position: relative;
  z-index: 1;
}
.about-hero .brand-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 4px;
  margin-bottom: 8px;
}
.about-hero .brand-sub {
  font-size: 14px;
  opacity: 0.7;
}

.about-content {
  padding: 24px;
}
.about-section {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.about-section h2 {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.about-section h2::before {
  content: '';
  width: 3px;
  height: 18px;
  background: var(--primary);
  border-radius: 2px;
}
.about-section p {
  font-size: 14px;
  line-height: 2;
  color: var(--text);
  margin-bottom: 12px;
}
.about-section p:last-child { margin-bottom: 0; }

.about-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.value-item {
  text-align: center;
  padding: 16px 8px;
  background: linear-gradient(135deg, rgba(107,76,138,0.04), rgba(212,165,116,0.08));
  border-radius: 12px;
}
.value-icon {
  font-size: 28px;
  margin-bottom: 8px;
}
.value-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.value-desc {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.5;
}

/* Back button */
.back-btn {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  color: rgba(255,255,255,0.8);
  font-size: 20px;
  padding: 4px;
  cursor: pointer;
}
.header-relative { position: relative; }
