/* finesse · register=brand · A=photo-led dark + periwinkle city mark · B=serif display / grotesk labels
 * C=radial label arc + right text column · D=GSAP state tweens · E=dial · SOUL=7 SPECTACLE=4 DENSITY=3 */

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--light);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.stage {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: clip;
  font-family: var(--sans);
  touch-action: pinch-zoom; /* 触屏左右滑交给翻图，不让浏览器接管 */
}

/* 背景图：未加载或加载失败时露出参考页的暖棕底色 */
.backdrop {
  position: absolute;
  inset: 0;
  z-index: var(--z-backdrop);
  background:
    radial-gradient(ellipse 70% 60% at 62% 108%, #74391f 0%, transparent 70%),
    radial-gradient(ellipse 90% 80% at 40% 20%, #3b1c11 0%, transparent 75%),
    #1b0e09;
}

.backdrop-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.scrim {
  position: absolute;
  inset: 0;
  z-index: var(--z-scrim);
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 80% at 8% 50%, rgba(14, 10, 8, .55) 0%, transparent 75%),
    linear-gradient(90deg, rgba(14, 10, 8, .6) 0%, rgba(14, 10, 8, .5) 28%, rgba(14, 10, 8, .22) 47%, rgba(14, 10, 8, .36) 62%, rgba(14, 10, 8, .5) 100%),
    radial-gradient(ellipse 110% 95% at 55% 50%, transparent 48%, rgba(10, 7, 6, .6) 100%),
    rgba(14, 10, 8, .12);
}

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 转盘 ---------- */

.wheel {
  position: absolute;
  inset: 0;
  z-index: var(--z-wheel);
}

.ring {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pinch-zoom;
  -webkit-mask-image: var(--band-mask, none);
          mask-image: var(--band-mask, none);
}

.ring:focus { outline: none; }

.spot {
  position: absolute;
  left: var(--cx);
  top: var(--cy);
  display: flex;
  align-items: center;
  padding: var(--hit, .3em) .7em var(--hit, .3em) 0;
  font-size: var(--label);
  line-height: 1.2;
  letter-spacing: .005em;
  white-space: nowrap;
  transform-origin: 0 0;
  cursor: pointer;
}

.spot-label {
  display: block;
  color: var(--light);
  opacity: .66;
  text-shadow: 0 0 14px rgba(10, 7, 6, .55);
  transform-origin: 0 50%;
  transition: opacity .35s var(--ease-out), transform .45s var(--ease-out);
}

.spot.in-city .spot-label { opacity: .86; }

.spot.is-city {
  font-size: var(--city);
  letter-spacing: 0;
}

.spot.is-city .spot-label {
  color: var(--blue);
  opacity: .9;
}

.spot-mark {
  position: relative;
  flex: none;
  width: .86em;
  height: .86em;
  margin-right: .42em;
  border-radius: .12em;
  background: var(--blue);
}

.spot-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: .24em;
  height: .24em;
  border-radius: 50%;
  background: rgba(16, 12, 10, .85);
  transform: translate(-50%, -50%);
}

/* 酒店入口：城市名右边，转盘停在这座城市或它的景点时才出现 */
.spot-hotel {
  display: grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  margin-left: .35em;
  border-radius: 50%;
  background: var(--glass);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  color: var(--light);
  font-size: calc(var(--label) * 1.1);
  visibility: hidden;
  opacity: 0;
  transition: opacity .3s var(--ease-out), background .2s, visibility 0s .3s;
}

.spot.in-city .spot-hotel {
  visibility: visible;
  opacity: 1;
  transition: opacity .3s var(--ease-out), background .2s;
}

.spot-hotel:hover { background: var(--glass-edge); }

.spot-hotel svg {
  width: .9em;
  height: .9em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 酒店栏：沿用行程栏的玻璃面板（site.css 的 .trip），从左边铺到屏幕约 63% 处；上面是地图，下面一行横排的酒店卡片 */
.trip.hotels {
  z-index: var(--z-search); /* 盖住底部居中的搜索框（酒店栏在 DOM 里靠后） */
  left: calc(16px + env(safe-area-inset-left));
  right: 37%;
  width: auto;
}

.hotel-map {
  flex: 1;
  min-height: 0;
  margin: 12px 20px 0;
  border-radius: 8px;
  overflow: hidden;
}

.hotel-body {
  flex: none;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
  padding: 12px 20px 16px;
  touch-action: pan-x;
}

.hotel-list {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hotel {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 240px;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
}

.hotel .hotel-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 地图用不了时：地图收起，酒店改成竖排占满 */
.hotels.no-map .hotel-map { display: none; }
.hotels.no-map .hotel-body { flex: 1; overflow-x: hidden; overflow-y: auto; touch-action: pan-y; }
.hotels.no-map .hotel-list { flex-direction: column; }
.hotels.no-map .hotel { width: auto; }
.hotels.no-map .hotel .hotel-name { white-space: normal; }

.hotel-info {
  flex: 1;
  min-width: 0;
}

.hotel-name {
  margin: 0 0 4px;
  font: 500 13px/1.35 var(--sans);
  color: var(--light);
}

.hotel-meta {
  margin: 0 0 2px;
  font: 400 12px/1.4 var(--sans);
  color: var(--light-dim);
}

.hotel-link {
  display: inline-block;
  margin-top: 4px;
  font: 500 12px/1.4 var(--sans);
  color: var(--blue);
  text-decoration: none;
}

.hotel-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hotel-add {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--glass-edge);
  border-radius: 50%;
  background: var(--glass);
  color: var(--light);
  cursor: pointer;
  transition: background .2s, color .2s;
}

.hotel-add:hover { background: var(--glass-edge); }

.hotel-add[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--button-ink);
}

.hotel-add svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hotel-note {
  flex: none;
  margin: 0 20px 14px;
  font: 400 11px/1.4 var(--sans);
  color: var(--light-dim);
}

.spot.is-current .spot-label {
  opacity: 1;
  transform: scale(1.1);
}

.spot.is-city.is-current .spot-label { transform: none; }

.ring:focus-visible .spot.is-current .spot-label {
  outline: 1px solid var(--light-mute);
  outline-offset: .3em;
  border-radius: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .spot:hover .spot-label { opacity: 1; }
}

/* 焦点位的指针：转盘把选中项转到这里 */
.needle {
  position: absolute;
  left: calc(var(--cx) + var(--r) - 1.9 * var(--label));
  top: var(--cy);
  width: calc(.95 * var(--label));
  height: 1px;
  background: var(--light-mute);
  pointer-events: none;
}

/* ---------- 右侧文案 ---------- */

.intro {
  position: absolute;
  z-index: var(--z-intro);
  left: 54.3%;
  top: 50%;
  width: min(27rem, 40vw);
  transform: translateY(-50%);
  text-shadow: 0 1px 24px rgba(10, 7, 6, .35);
}

.intro-title {
  margin: 0 0 .56em;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.9rem, 5.3vh, 3.5rem);
  line-height: 1.03;
  letter-spacing: -.012em;
  overflow-wrap: anywhere;
  min-width: 0;
}

.intro-title span { display: block; }

html[lang="zh-CN"] .intro-title {
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: .02em;
}

.intro-desc {
  margin: 0 0 1.7em;
  max-width: 27em;
  font-size: clamp(.84rem, 2.05vh, 1.05rem);
  line-height: 1.55;
  min-height: 6.2em; /* 固定四行高度（三行介绍加一行“看攻略”），切换地点时按钮不跳动 */
}

.intro-place {
  margin-right: .35em;
  font-weight: 500;
}

/* 看攻略：介绍文字下面单独一行的链接 */
.intro-guide {
  display: block;
  width: fit-content;
  color: var(--light);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: var(--light-mute);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color .2s;
}

.intro-guide:hover { text-decoration-color: var(--light); }

.intro-cta {
  display: inline-flex;
  align-items: center;
  min-height: 2.5em;
  padding: 0 1.35em;
  border: 0;
  border-radius: 999px;
  background: var(--light);
  color: var(--button-ink);
  font: 500 clamp(.78rem, 1.9vh, .95rem)/1 var(--sans);
  white-space: nowrap;
  cursor: pointer;
  transition: transform .2s var(--ease-out), background-color .2s;
}

.intro-cta:hover { background: #fffaf4; }
.intro-cta:active { transform: scale(.97); }

.intro-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 加入行程：心形按钮，已加入时心形填满 */
.intro-like {
  display: grid;
  place-items: center;
  width: 2.5em;
  height: 2.5em;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: rgba(16, 12, 10, .3);
  color: var(--light-dim);
  font: 500 clamp(.78rem, 1.9vh, .95rem)/1 var(--sans);
  cursor: pointer;
  transition: transform .2s var(--ease-out), background-color .2s, color .2s;
}

.intro-like:hover {
  background: rgba(16, 12, 10, .5);
  color: var(--light);
}

.intro-like:active { transform: scale(.94); }

.intro-like svg {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  transition: fill .2s;
}

.intro-like[aria-pressed="true"] { color: var(--light); }
.intro-like[aria-pressed="true"] svg { fill: currentColor; }

/* 放大镜：和心形同样的圆按钮，只在竖屏出现 */
.search-open { display: none; }
.search-open svg { stroke-linecap: round; }

/* ---------- 搜索：桌面在底部居中的玻璃胶囊，结果列表弹在上方 ---------- */

.search {
  position: absolute;
  z-index: var(--z-search);
  left: 0;
  right: 0;
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: clamp(280px, 26vw, 400px);
  margin: 0 auto;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px 0 14px;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-edge);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
          backdrop-filter: blur(16px) saturate(1.2);
  color: var(--light-dim);
  cursor: text;
  transition: border-color .2s, background-color .2s;
}

.search-field:focus-within {
  border-color: var(--light);
  background: rgba(16, 12, 10, .3);
}

.search-field svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.search-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none; /* 焦点由外框的亮边表示 */
  background: none;
  color: var(--light);
  font: 400 14px/1 var(--sans);
}

.search-field input::placeholder { color: var(--light-mute); }

.search-pop {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  max-height: min(320px, 45vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 6px;
  border: 1px solid var(--glass-edge);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--glass) 0%, rgba(16, 12, 10, .7) 100%);
  box-shadow: inset 0 1px 0 var(--glass-edge), 0 24px 60px rgba(10, 7, 6, .4);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
          backdrop-filter: blur(20px) saturate(1.2);
}

.search-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-hit {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font: 400 14px/1.3 var(--sans);
  color: var(--light);
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .search-hit:hover { background: var(--glass); }
}

.search-hit[aria-selected="true"] { background: var(--hairline); }

/* 景点后面的小字：所属城市 */
.search-city {
  font-size: 11px;
  color: var(--light-mute);
}

.search-none {
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--light-dim);
}

/* ---------- 翻图与署名 ---------- */

.flip {
  position: absolute;
  z-index: var(--z-chrome);
  right: calc(20px + env(safe-area-inset-right));
  bottom: calc(44px + env(safe-area-inset-bottom));
  display: flex;
  gap: 8px;
}

.flip button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: rgba(16, 12, 10, .3);
  color: var(--light-dim);
  cursor: pointer;
  transition: background-color .2s, color .2s;
}

.flip button:hover {
  background: rgba(16, 12, 10, .5);
  color: var(--light);
}

.flip svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.credit {
  position: absolute;
  z-index: var(--z-chrome);
  right: calc(24px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
  color: var(--light-mute);
}

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

.credit a:hover { color: var(--light); }

.intro-cta:focus-visible,
.intro-like:focus-visible,
.intro-guide:focus-visible,
.flip button:focus-visible,
.credit a:focus-visible {
  outline: 2px solid var(--light);
  outline-offset: 3px;
}

/* ---------- 竖屏 / 手机：转盘在上，文案在下（断点和 site.css、site.js 里的一致） ---------- */

@media (max-width: 859px), (max-aspect-ratio: 11/10) {
  .scrim {
    background:
      linear-gradient(0deg, rgba(14, 10, 8, .9) 0%, rgba(14, 10, 8, .62) 30%, transparent 58%),
      linear-gradient(180deg, rgba(14, 10, 8, .55) 0%, transparent 22%),
      radial-gradient(ellipse 95% 50% at 0% 34%, rgba(14, 10, 8, .72) 0%, transparent 85%),
      rgba(14, 10, 8, .24);
  }

  .intro {
    left: calc(20px + env(safe-area-inset-left));
    right: calc(20px + env(safe-area-inset-right));
    top: auto;
    bottom: calc(68px + env(safe-area-inset-bottom));
    width: auto;
    transform: none;
  }

  .intro-title { font-size: clamp(1.7rem, 7.4vw, 2.6rem); }
  .intro-desc { font-size: .9rem; margin-bottom: 1.4em; }

  /* “下一站”那一行放不下 ‹ ›，移到下方和署名同一行：署名靠左，‹ › 靠右 */
  .flip { bottom: calc(12px + env(safe-area-inset-bottom)); }

  /* 行程栏从导航栏下方延伸到标题下沿（--title-bottom 由 home.js 量出），不挡下面的介绍、心形和翻图 */
  .trip {
    bottom: auto;
    height: calc(var(--title-bottom, 60vh) - var(--bar-bottom, 60px) - 12px);
  }

  /* 手机上酒店栏占满宽度，从导航栏下方铺到底部，不开行程栏 */
  .trip.hotels {
    left: clamp(16px, 4vw, 48px);
    right: clamp(16px, 4vw, 48px);
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: auto;
    height: auto;
  }
  .hotel-map { margin: 8px 12px 0; }
  .hotel-body { padding: 8px 12px 12px; }
  .hotel-note { margin: 0 12px 10px; }
  .hotel { width: min(240px, 72vw); }
  .hotel-add { width: 40px; height: 40px; }
  .hotels .trip-title { position: static; width: auto; height: auto; clip-path: none; } /* 酒店栏够宽，不像行程栏那样把标题藏起来 */

  /* 搜索：点心形右边的放大镜才出现，盖住“下一站”那一行。
     320 宽的英文“下一站”放不下三个按钮时，按钮文字折成两行，两个圆按钮不被挤扁 */
  .search-open { display: grid; }
  .intro-like { flex: none; }
  .intro-cta { white-space: normal; }

  .search {
    display: none;
    left: calc(20px + env(safe-area-inset-left));
    right: calc(20px + env(safe-area-inset-right));
    bottom: calc(68px + env(safe-area-inset-bottom)); /* 和 .intro 的 bottom 一致 */
    width: auto;
  }

  .is-searching .search { display: block; }
  .is-searching .intro-actions { visibility: hidden; }

  .credit {
    right: calc(132px + env(safe-area-inset-right));
    left: calc(20px + env(safe-area-inset-left));
    bottom: calc(27px + env(safe-area-inset-bottom));
  }
}

@media (pointer: coarse) {
  .intro-cta { min-height: 44px; font-size: .9rem; }
  .intro-like { width: 44px; height: 44px; font-size: .9rem; }
  .flip button { width: 44px; height: 44px; }
  .search-field { height: 44px; }
  .search-field input { font-size: 16px; } /* 小于 16px 时 iOS 聚焦会放大页面 */
  .search-hit { min-height: 44px; align-content: center; }
}

/* 系统要求降低透明度时，玻璃改成实底 */
@media (prefers-reduced-transparency: reduce) {
  .search-field,
  .search-pop {
    background: var(--ink);
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
  }
}
