/* ============================================================
   非遗传承 · 全站样式
   风格：大众点评卡片化 + 中国传统色（朱砂红 / 米白 / 墨黑）
   ============================================================ */

:root {
  /* 主色 - 中国传统 */
  --color-primary: #C8252C;        /* 朱砂红 */
  --color-primary-dark: #9F1D24;
  --color-primary-light: #E84A4F;
  --color-accent: #B8860B;         /* 赭金 */
  --color-accent-light: #D4A437;

  /* 中性色 */
  --color-bg: #FAF7F2;             /* 米白背景 */
  --color-surface: #FFFFFF;
  --color-surface-alt: #F4EFE6;    /* 浅米 */
  --color-foreground: #1A1A1A;     /* 墨黑 */
  --color-foreground-muted: #6B6357;
  --color-foreground-light: #A09689;
  --color-border: #E8DFD0;
  --color-border-light: #F0E9DD;

  /* 功能色 */
  --color-success: #16A34A;
  --color-warning: #D97706;
  --color-destructive: #DC2626;

  /* 排版 */
  --font-serif: 'Noto Serif SC', 'Noto Serif TC', 'Songti SC', 'STSong', serif;
  --font-sans: 'Noto Sans SC', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', sans-serif;

  /* 间距 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(26,26,26,.04);
  --shadow-md: 0 2px 8px rgba(26,26,26,.06);
  --shadow-lg: 0 8px 24px rgba(26,26,26,.08);

  /* 底部 Tab 高度 */
  --tabbar-h: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-foreground);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  /* 移动端视口：最大宽度 480px，居中显示模拟小程序 */
  max-width: 480px;
  margin: 0 auto;
  background: var(--color-bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

@media (min-width: 768px) {
  body { box-shadow: 0 0 24px rgba(0,0,0,.08); }
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ============== 顶部导航 ============== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
  min-height: 48px;
}
.topbar__title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-foreground);
  flex: 1;
}
.topbar__title--center { text-align: center; }
.topbar__btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-foreground);
  border-radius: var(--radius-full);
  transition: background .15s ease;
}
.topbar__btn:active { background: var(--color-surface-alt); }

/* ============== 搜索框 ============== */
.search-box {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 9px 14px;
  background: var(--color-surface-alt);
  border-radius: var(--radius-full);
  color: var(--color-foreground-light);
  font-size: 13px;
  flex: 1;
}
.search-box svg { width: 16px; height: 16px; }

/* ============== Banner 轮播 ============== */
.banner {
  position: relative;
  margin: var(--space-3) var(--space-4) var(--space-4);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 7;
  background: var(--color-surface-alt);
}
.banner__track {
  display: flex;
  height: 100%;
  transition: transform .35s ease;
}
.banner__slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: var(--space-4);
  color: #fff;
  overflow: hidden;
}
.banner__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
}
.banner__slide::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 60%);
}
.banner__content { position: relative; z-index: 1; }
.banner__title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.banner__subtitle {
  font-size: 12px;
  opacity: .92;
}
.banner__dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}
.banner__dot {
  width: 6px; height: 6px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,.5);
  transition: all .25s ease;
}
.banner__dot--active { width: 18px; background: #fff; }

/* ============== 区块标题 ============== */
.section {
  padding: 0 var(--space-4);
  margin-bottom: var(--space-5);
}
.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.section__title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-foreground);
  position: relative;
  padding-left: 10px;
}
.section__title::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 14px;
  background: var(--color-primary);
  border-radius: 2px;
}
.section__more {
  font-size: 12px;
  color: var(--color-foreground-muted);
  display: flex;
  align-items: center;
  gap: 2px;
}
.section__more svg { width: 12px; height: 12px; }

/* ============== 卡片：非遗瀑布 ============== */
.fei-yi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
  cursor: pointer;
}
.card:active { transform: scale(.98); box-shadow: var(--shadow-md); }
.card__cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--color-surface-alt);
  background-size: cover;
  background-position: center;
  position: relative;
}
.card__cover-tag {
  position: absolute;
  top: 6px; left: 6px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.card__body { padding: var(--space-2) var(--space-3) var(--space-3); }
.card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-foreground);
  margin-bottom: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta {
  font-size: 11px;
  color: var(--color-foreground-light);
  display: flex;
  align-items: center;
  gap: 4px;
}
.card__rating {
  color: var(--color-accent);
  font-weight: 600;
}
.card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}
.card__price {
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 600;
}
.card__price--small { font-size: 11px; font-weight: 400; color: var(--color-foreground-light); }
.card__distance {
  font-size: 11px;
  color: var(--color-foreground-light);
}

/* ============== 横向滑动列表 ============== */
.scroll-row {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 var(--space-4) var(--space-2);
  margin: 0 calc(-1 * var(--space-4));
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  scrollbar-width: none;
}
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row .card { flex: 0 0 140px; scroll-snap-align: start; }

/* ============== 分类入口 ============== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
  padding: 0 var(--space-4);
  margin-bottom: var(--space-5);
}
.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-2) 0;
  cursor: pointer;
  transition: opacity .15s ease;
}
.category-item:active { opacity: .7; }
.category-item__icon {
  width: 44px; height: 44px;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.category-item__icon svg { width: 22px; height: 22px; }
.category-item__label {
  font-size: 11px;
  color: var(--color-foreground);
}

/* ============== 底部 Tab Bar ============== */
.tabbar {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  z-index: 100;
}
.tabbar__item {
  min-width: 0;
  flex: 1 1 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-foreground-muted);
  font-size: 10px;
  transition: color .2s ease;
  min-height: 44px;
}
.tabbar__item svg { width: 20px; height: 20px; }
.tabbar__item span { font-size: 10px; white-space: nowrap; }
.tabbar__item--active {
  color: var(--color-primary);
}
.tabbar__item--active svg path { stroke-width: 2.2; }

/* tabbar 居中凸起按钮（小红书式） */
.tabbar--center {
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar--center .tabbar__item--center {
  position: relative;
  margin-top: -22px;
}
.tabbar__center-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C8252C, #8C181D);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(200, 37, 44, 0.4);
  transition: transform .15s;
}
.tabbar__center-btn:active { transform: scale(0.94); }
.tabbar__center-btn svg { width: 26px; height: 26px; color: #fff; }
.tabbar__item--center {
  color: var(--color-foreground-muted);
}
.tabbar__item--center span {
  margin-top: 22px;
  font-size: 11px;
}
.tabbar__item--center-active { color: var(--color-primary); }

/* 页面内容预留底部 Tab 空间 */
.page {
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--space-4));
  min-height: 100vh;
}

/* ============== 详情页大图 ============== */
.detail-hero {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--color-surface-alt);
  background-size: cover;
  background-position: center;
}
.detail-content {
  padding: var(--space-4);
}
.detail-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-foreground);
  margin-bottom: var(--space-2);
  line-height: 1.3;
}
.detail-subtitle {
  font-size: 13px;
  color: var(--color-foreground-muted);
  margin-bottom: var(--space-4);
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-4); }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--color-surface-alt);
  color: var(--color-foreground-muted);
}
.tag--primary { background: rgba(200,37,44,.08); color: var(--color-primary); }
.tag--accent { background: rgba(184,134,11,.1); color: var(--color-accent); }

/* ============== 介绍段落 ============== */
.intro-block { margin-bottom: var(--space-5); }
.intro-block__title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-foreground);
  margin-bottom: var(--space-3);
  position: relative;
  padding-left: 10px;
}
.intro-block__title::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 14px;
  background: var(--color-primary);
  border-radius: 2px;
}
.intro-block__text {
  font-size: 14px;
  line-height: 1.75;
  color: var(--color-foreground);
  margin-bottom: var(--space-3);
}
.intro-block__img {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: var(--color-surface-alt);
}

/* ============== 课程卡 ============== */
.course-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 0 var(--space-4) var(--space-3);
  box-shadow: var(--shadow-sm);
  display: flex;
  cursor: pointer;
  transition: transform .2s ease;
}
.course-card:active { transform: scale(.99); }
.course-card__cover {
  flex: 0 0 100px;
  height: 100px;
  background: var(--color-surface-alt);
  background-size: cover;
  background-position: center;
}
.course-card__body {
  flex: 1;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}
.course-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-foreground);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-card__meta {
  font-size: 11px;
  color: var(--color-foreground-light);
  margin-top: 4px;
}
.course-card__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}
.course-card__date {
  font-size: 11px;
  color: var(--color-primary);
  font-weight: 500;
}
.course-card__price {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
}
.course-card__price small {
  font-size: 10px;
  color: var(--color-foreground-light);
  text-decoration: line-through;
  margin-left: 4px;
  font-weight: 400;
}

/* ============== 日期选择器 ============== */
.date-strip {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-3) var(--space-4);
  margin: 0 calc(-1 * var(--space-4));
  padding-left: var(--space-4);
  padding-right: var(--space-4);
  scrollbar-width: none;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
}
.date-strip::-webkit-scrollbar { display: none; }
.date-pill {
  flex: 0 0 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  border-radius: var(--radius-md);
  background: var(--color-surface-alt);
  color: var(--color-foreground-muted);
  transition: all .2s ease;
  min-height: 60px;
  justify-content: center;
}
.date-pill--active {
  background: var(--color-primary);
  color: #fff;
}
.date-pill__day {
  font-size: 11px;
  margin-bottom: 2px;
}
.date-pill__num {
  font-size: 16px;
  font-weight: 600;
}

/* ============== 按钮 ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s ease;
  min-height: 40px;
  white-space: nowrap;
}
.btn--primary {
  background: var(--color-primary);
  color: #fff;
}
.btn--primary:active { background: var(--color-primary-dark); }
.btn--ghost {
  background: transparent;
  color: var(--color-foreground);
  border: 1px solid var(--color-border);
}
.btn--block { width: 100%; }
.btn--sm { padding: 6px 12px; font-size: 12px; min-height: 32px; }
/* 按钮里的图标 SVG 大小（icon-only / icon+text 都生效）*/
.btn > svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn--icon { padding: 10px; min-width: 40px; }

/* ============== 浮动按钮 ============== */
.fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 50;
}
.fab svg { width: 22px; height: 22px; }

/* ============== 会员卡 ============== */
.member-card {
  margin: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #C8252C 0%, #9F1D24 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.member-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.member-card::after {
  content: '';
  position: absolute;
  bottom: -50px; left: -50px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.member-card__row {
  display: flex; justify-content: space-between; align-items: center;
  position: relative; z-index: 1;
}
.member-card__level {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
}
.member-card__name { font-size: 13px; opacity: .92; margin-top: 2px; }
.member-card__points { text-align: right; }
.member-card__points strong { font-size: 28px; font-weight: 700; }
.member-card__points small { font-size: 12px; opacity: .8; display: block; margin-top: 2px; }
.member-card__progress {
  position: relative; z-index: 1;
  margin-top: var(--space-4);
  font-size: 12px;
  opacity: .9;
}
.member-card__bar {
  height: 6px;
  background: rgba(255,255,255,.2);
  border-radius: var(--radius-full);
  margin-top: 6px;
  overflow: hidden;
}
.member-card__bar-fill {
  height: 100%;
  background: #fff;
  border-radius: var(--radius-full);
}

/* ============== 列表项 ============== */
.list {
  background: var(--color-surface);
  margin: 0 var(--space-4);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* 订单/预约卡（用于会员中心"我的预约"等） */
.order-card {
  display: block;
  background: var(--color-surface);
  margin: 0 var(--space-4) var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform .2s ease, box-shadow .2s ease;
}
.order-card:active { transform: scale(.99); box-shadow: var(--shadow-md); }
.order-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.order-card__date {
  font-size: 12px;
  color: var(--color-foreground-muted);
}
.order-card__status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(22,163,74,.1);
  color: var(--color-success);
  white-space: nowrap;
}
.order-card__title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-foreground);
  line-height: 1.4;
  margin-bottom: 4px;
  /* 防止长标题溢出 */
  word-break: break-word;
}
.order-card__meta {
  font-size: 11px;
  color: var(--color-foreground-light);
}
.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
  transition: background .15s ease;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--color-surface-alt); }
.list-item__icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--color-surface-alt);
  color: var(--color-primary);
}
.list-item__icon svg { width: 18px; height: 18px; }
.list-item__body { flex: 1; min-width: 0; }
.list-item__title { font-size: 14px; color: var(--color-foreground); font-weight: 500; }
.list-item__sub { font-size: 11px; color: var(--color-foreground-light); margin-top: 2px; }
.list-item__arrow { color: var(--color-foreground-light); }
.list-item__badge {
  background: var(--color-primary);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* ============== 表单 ============== */
.form-group { margin-bottom: var(--space-4); }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--color-foreground);
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  background: var(--color-surface);
  color: var(--color-foreground);
  min-height: 44px;
  transition: border-color .2s ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* ============== 空状态 ============== */
.empty {
  padding: var(--space-10) var(--space-4);
  text-align: center;
  color: var(--color-foreground-light);
}
.empty svg { width: 64px; height: 64px; margin: 0 auto var(--space-3); opacity: .4; }
.empty__title { font-size: 14px; font-weight: 500; margin-bottom: 4px; color: var(--color-foreground-muted); }
.empty__desc { font-size: 12px; }

/* ============== 通用工具 ============== */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--color-foreground-muted); }
.text-primary { color: var(--color-primary); }
.font-serif { font-family: var(--font-serif); }