/* ============================================================================
   main.css —— 各区块布局
   依赖 tokens.css 与 base.css。移动优先，断点：900（导航）/ 768 / 480 / 380
   ========================================================================== */

/* ============================================================================
   1. 导航
   ========================================================================== */

/* 用于监听滚动起点的哨兵，自身不可见不占位 */
.nav-sentinel {
  position: absolute;
  top: 0; left: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: transparent;
  transition: background-color var(--dur-base) var(--ease),
              box-shadow var(--dur-base) var(--ease),
              border-color var(--dur-base) var(--ease);
  border-bottom: 1px solid transparent;
}

/* 滚动后由 nav.js 加上 */
.site-header.is-scrolled {
  background: rgb(250 248 244 / .86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--color-border-soft);
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--header-h-mobile);
}
@media (min-width: 900px) {
  .nav { min-height: var(--header-h); }
}

/* --- 品牌字标 --- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: .04em;
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand__mark {
  width: 2rem; height: 2rem;
  color: var(--color-primary);
}
.brand__mark .icon { width: 100%; height: 100%; stroke-width: 1.4; }
.brand__sub {
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--color-muted);
  letter-spacing: .06em;
}

/* --- 汉堡按钮：仅在小屏且 JS 可用时出现 --- */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  margin-right: -.5rem;
  border-radius: var(--radius-sm);
  color: var(--color-ink);
}
.nav-toggle:hover { background: var(--color-primary-050); }
.nav-toggle .icon { width: 1.5rem; height: 1.5rem; }
.nav-toggle__close { display: none; }

html.js .nav-toggle { display: inline-flex; }

/* 桌面端收起汉堡：横向导航已经占位，再留一个汉堡按钮是多余的，
   而且两个导航入口同时出现会让用户不知道该点哪个。 */
@media (min-width: 900px) {
  html.js .nav-toggle { display: none; }
}

/* --- 导航面板 ---
   无 JS 时（<html> 没有 .js 类）表现为常规堆叠、始终可见 —— 降级可用。 */

.nav-panel {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding-bottom: var(--space-sm);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  list-style: none;
  padding: 0;
}

.nav-list a {
  display: block;
  padding: .625rem .5rem;
  color: var(--color-ink);
  text-decoration: none;
  font-size: var(--fs-body);
  border-radius: var(--radius-sm);
}
.nav-list a:hover { background: var(--color-primary-050); color: var(--color-primary); }

/* scrollspy 命中的锚点 */
.nav-list a[aria-current] {
  color: var(--color-primary);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .5rem;
}

.nav-phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .5rem;
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

/* --- JS 可用时：小屏折叠 --- */
@media (max-width: 899px) {
  html.js .nav-panel {
    position: absolute;
    inset: 100% 0 auto 0;
    max-height: calc(100dvh - var(--header-h-mobile));
    overflow-y: auto;
    padding: var(--space-sm) var(--gutter) var(--space-md);
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    display: none;
  }
  html.js .nav-panel.is-open { display: flex; }
}

/* --- JS 可用时：大屏横向 --- */
@media (min-width: 900px) {
  html.js .nav-panel {
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
    padding-bottom: 0;
  }
  html.js .nav-list { flex-direction: row; gap: .125rem; }
  html.js .nav-list a { padding: .5rem .75rem; font-size: var(--fs-sm); }
  html.js .nav-actions { flex-direction: row; align-items: center; margin-top: 0; }
  html.js .nav-phone { padding: .5rem .625rem; font-size: var(--fs-sm); }
  html.js .nav-actions .btn { padding: .625rem 1.25rem; font-size: var(--fs-sm); }
}

/* 面板展开时锁住页面滚动，由 nav.js 添加 */
html.nav-open, html.nav-open body { overflow: hidden; }
@media (min-width: 900px) {
  html.nav-open, html.nav-open body { overflow: auto; }
}

/* ============================================================================
   2. Hero
   ========================================================================== */

.hero {
  position: relative;
  padding-block: clamp(3rem, 7vw, 5.5rem) var(--space-section);
  overflow: hidden;
}

/* 墨绿极淡的径向渐变，代替外部大图撑起氛围 */
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto auto;
  width: min(58rem, 92vw);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgb(47 93 80 / .07), transparent 62%);
  pointer-events: none;
  z-index: -1;
}

.hero__grid {
  display: grid;
  gap: var(--space-lg);
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4rem); }
}

.hero__title { margin-bottom: var(--space-sm); }

.hero__lead {
  max-width: 34rem;
  font-size: var(--fs-lead);
  color: var(--color-muted);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: var(--space-md);
}

/* 信任条 */
.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);   /* 金色留给下面的短线段 */
  position: relative;
}
/* 金色发丝线：纯装饰的典型用法 */
.hero__trust::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 4.5rem; height: 2px;
  background: var(--color-accent);
}

.trust-item { min-width: 6rem; }
.trust-item__num {
  display: block;
  font-size: clamp(1.5rem, 2vw + 1rem, 2rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}
.trust-item__label {
  font-size: var(--fs-sm);
  color: var(--color-muted);
}

/* Hero 配图 */
.hero__media { position: relative; }
.hero__media img {
  width: 100%;
  aspect-ratio: 16 / 10;         /* 移动端 */
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
@media (min-width: 900px) {
  .hero__media img { aspect-ratio: 4 / 5; }
}
/* 金色描边框，轻微错位制造层次 */
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  translate: .75rem .75rem;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  z-index: -1;
  pointer-events: none;
}
@media (max-width: 899px) { .hero__media::after { display: none; } }

/* ============================================================================
   3. 服务项目
   ========================================================================== */

.services { background: var(--color-surface); }

.services__grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;                 /* <380 与默认小屏 */
}

@media (min-width: 480px) { .services__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .services__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .services__grid { grid-template-columns: repeat(3, 1fr); } }

.service-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem; height: 3rem;
  margin-bottom: var(--space-sm);
  border-radius: 12px;
  background: var(--color-primary-050);
  color: var(--color-primary);
}
.service-card__icon .icon { width: 1.5rem; height: 1.5rem; }

.service-card h3 { margin-bottom: .5rem; }

.service-card p {
  color: var(--color-muted);
  font-size: var(--fs-sm);
}

/* margin-top:auto 让各卡的价格行底对齐，即使描述长度不同 */
.service-card__price {
  margin-top: auto;
  padding-top: var(--space-sm);
  font-weight: 700;
  color: var(--color-ink);       /* ⚠️ 不用金色，对比度不足 */
  font-variant-numeric: tabular-nums;
}
.service-card__price small {
  font-weight: 400;
  font-size: var(--fs-xs);
  color: var(--color-muted);
}

/* ============================================================================
   4. 门店环境
   ========================================================================== */

.environment { background: var(--color-surface); }

/* 移动端：横向 scroll-snap 轮播 —— 比把拼贴压成单列体验好得多 */
.env__gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 82%;
  gap: var(--space-sm);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* 让轮播能出血到屏幕边缘，视觉上更像原生 */
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
}
.env__gallery::-webkit-scrollbar { display: none; }

.env__gallery figure {
  scroll-snap-align: center;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}
.env__gallery img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* 桌面端：拼贴网格，两张特征格制造节奏 */
@media (min-width: 1024px) {
  .env__gallery {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 180px;
    grid-auto-columns: auto;
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
  .env__gallery figure { height: 100%; }
  .env__gallery img { aspect-ratio: auto; height: 100%; }

  /* 拼贴排布：第 1 张做 2×2 的特征格，第 4、5、6 张各占 2 列。
     这样 3 行 × 4 列 恰好铺满，右下角不会留下一个空洞
     （只让第 4 张跨列的话，第 3 行会空出两格）。 */
  .env__gallery figure:nth-child(1) { grid-column: span 2; grid-row: span 2; }
  .env__gallery figure:nth-child(4),
  .env__gallery figure:nth-child(5),
  .env__gallery figure:nth-child(6) { grid-column: span 2; }
}

/* 图片上的文字遮罩。
   用多段渐变把过渡拉平：两段式（实色→透明）会形成一条明显的暗带，
   在亮色照片上看着很脏。再配一点文字阴影，这样即使照片底部本来就很亮，
   白字也依然清晰 —— 不用把遮罩加到更黑。 */
.env__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.75rem 1rem .875rem;
  font-size: var(--fs-sm);
  color: #fff;
  text-shadow: 0 1px 2px rgb(20 30 26 / .45);
  background: linear-gradient(to top,
    rgb(20 30 26 / .60) 0%,
    rgb(20 30 26 / .42) 40%,
    rgb(20 30 26 / .16) 72%,
    transparent 100%);
}

/* ============================================================================
   5. 客户评价
   ========================================================================== */

.reviews__grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .reviews__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .reviews__grid { grid-template-columns: repeat(3, 1fr); } }

.review {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.review__stars {
  display: flex;
  gap: .125rem;
  color: var(--color-accent);       /* 装饰性图形，不受文字对比度约束 */
}
.review__stars .icon {
  width: 1rem; height: 1rem;
  fill: currentColor;
  stroke: none;
}

.review blockquote {
  margin: 0;
  flex: 1;
  color: var(--color-ink);
  font-size: var(--fs-sm);
  line-height: 1.8;
}

.review__author {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border-soft);
  font-style: normal;
}
.review__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  background: var(--color-primary-050);
  color: var(--color-primary);
  font-weight: 700;
  font-size: var(--fs-sm);
  flex: none;
}
.review__meta { display: flex; flex-direction: column; line-height: 1.4; }
.review__meta strong { font-size: var(--fs-sm); }
.review__meta span { font-size: var(--fs-xs); color: var(--color-muted); }

/* ============================================================================
   6. 预约
   ========================================================================== */

.booking { background: var(--color-surface); }

.booking__grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 900px) {
  .booking__grid { grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 4vw, 3.5rem); }
}

.booking__form {
  display: grid;
  gap: var(--space-sm);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}
@media (min-width: 768px) {
  .booking__form { grid-template-columns: 1fr 1fr; }
  .booking__form .field--full,
  .booking__form .booking__submit,
  .booking__form .form-alert { grid-column: 1 / -1; }
}

.booking__submit {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: stretch;
  margin-top: .5rem;
}

.form-alert {
  padding: .875rem 1rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  border: 1px solid transparent;
}
.form-alert[data-tone="error"] {
  background: var(--color-danger-bg);
  border-color: #E8C9C5;
  color: var(--color-danger);
}
.form-alert[data-tone="success"] {
  background: var(--color-success-bg);
  border-color: #C6DED0;
  color: var(--color-success);
}
.form-alert:empty { display: none; }
.form-alert ul { margin: .5rem 0 0; padding-left: 1.25rem; }

/* 提交成功后的面板 */
.booking__success {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: flex-start;
  padding: var(--space-lg);
  border: 1px solid #C6DED0;
  border-radius: var(--radius);
  background: var(--color-success-bg);
}
.booking__success .icon { width: 2.5rem; height: 2.5rem; color: var(--color-success); stroke-width: 1.4; }
.booking__success-id {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: var(--fs-sm);
  background: rgb(255 255 255 / .7);
  padding: .375rem .625rem;
  border-radius: var(--radius-sm);
  word-break: break-all;
}

/* --- 门店信息侧栏 --- */
.store-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.store-info__list {
  display: flex;
  flex-direction: column;
  gap: .875rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
.store-info__list li {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  font-size: var(--fs-sm);
}
.store-info__list .icon {
  margin-top: .2rem;
  color: var(--color-primary);
}
.store-info__list strong {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--color-muted);
  margin-bottom: .125rem;
}
.store-info__list a { color: var(--color-ink); text-decoration: none; }
.store-info__list a:hover { color: var(--color-primary); text-decoration: underline; }

/* 营业时间表 */
.hours {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.hours th, .hours td {
  padding: .375rem 0;
  text-align: left;
  font-weight: 400;
  border-bottom: 1px solid var(--color-border-soft);
}
.hours td:last-child { text-align: right; color: var(--color-muted); }
.hours tr:last-child th, .hours tr:last-child td { border-bottom: none; }

/* 地图卡：静态示意图 + 高德深链，不嵌 iframe */
.map-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
}
.map-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.map-card__overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  justify-content: space-between;
  padding: .75rem .875rem;
  background: rgb(255 255 255 / .94);
  border-top: 1px solid var(--color-border-soft);
  font-size: var(--fs-sm);
}
.map-card__overlay .btn { padding: .5rem 1rem; font-size: var(--fs-sm); }

/* ============================================================================
   7. 页脚
   ========================================================================== */

.site-footer {
  padding-block: var(--space-lg) var(--space-md);
  background: #1F2421;                 /* 近黑底 */
  color: #C9CFCB;
  font-size: var(--fs-sm);
}
.site-footer a { color: #E8EBE9; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.footer__grid {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .footer__grid { grid-template-columns: 1.6fr 1fr 1.2fr 1.2fr; } }

.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: var(--space-sm);
  color: #fff;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: .04em;
}
.footer__brand .icon { width: 1.75rem; height: 1.75rem; stroke-width: 1.4; }

.footer__about { max-width: 26rem; color: #9AA39D; line-height: 1.8; }

.footer__title {
  margin-bottom: var(--space-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: .08em;
  color: #fff;
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
.footer__list a { color: #C9CFCB; }
.footer__list a:hover { color: #fff; }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem var(--space-md);
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid rgb(255 255 255 / .12);
  font-size: var(--fs-xs);
  color: #8B938D;
}
.footer__legal { display: flex; flex-wrap: wrap; gap: .5rem var(--space-sm); }
