/* 照野 ZHAOYE — 私人命运地图  |  design tokens + chrome
   暖调暗房显影：深墨底 + 琥珀暖金光。冷调命运星图为可切换变体。 */

/* 设计 token 已抽出至 tokens.css（§2.9 唯一真相源），须在本文件之前加载。 */

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background:
    radial-gradient(140% 120% at 30% 0%, #15171f 0%, #0a0b10 55%, #060709 100%);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 28px; gap: 26px;
}
.stage-caption {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  color: rgba(255,255,255,.28); font-size: 12px; letter-spacing: .12em;
}

/* ── device frame ───────────────────────────────────────────── */
.device {
  width: 402px; height: 872px; border-radius: 50px; position: relative;
  overflow: hidden; background: var(--ink-0);
  box-shadow: 0 50px 120px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.05),
              0 0 0 11px #14161c, 0 0 0 12px rgba(255,255,255,.06);
  isolation: isolate;
}
.island {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 124px; height: 36px; border-radius: 22px; background: #000; z-index: 60;
}
.statusbar {
  position: absolute; top: 0; left: 0; right: 0; height: 56px; z-index: 55;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 30px 0; pointer-events: none;
}
.statusbar .t { font-weight: 600; font-size: 16px; color: #fff; letter-spacing: .2px; }
.statusbar .r { display: flex; gap: 7px; align-items: center; opacity: .96; }
.home-ind {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  width: 138px; height: 5px; border-radius: 100px; background: rgba(255,255,255,.55);
  z-index: 70; pointer-events: none;
}

/* ── map ────────────────────────────────────────────────────── */
.map-root { position: absolute; inset: 0; z-index: 0; background: var(--ink-0); }
#map { position: absolute; inset: 0; }
.maplibregl-control-container { display: none; }
.maplibregl-canvas { outline: none; }

.grade {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  transition: background .8s ease, opacity .8s ease;
}
.grade.wash { background: var(--grade-wash); mix-blend-mode: screen; }
.grade.vignette {
  background: radial-gradient(115% 100% at 50% 42%, rgba(0,0,0,0) 52%, rgba(0,0,0,.55) 100%);
}
.grade.topfade {
  background: linear-gradient(180deg, rgba(4,5,8,.85) 0%, rgba(4,5,8,.35) 9%, rgba(0,0,0,0) 22%);
}

/* ── floating chrome ────────────────────────────────────────── */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border: .5px solid var(--glass-line);
  box-shadow: 0 8px 30px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.07);
}

.chrome-top {
  position: absolute; top: 60px; left: 0; right: 0; z-index: 30;
  display: flex; flex-direction: column; gap: 12px; padding: 0 18px;
}
.breadcrumb { display: flex; align-items: baseline; gap: 10px; padding: 0 4px; }
.breadcrumb .place {
  font-size: 21px; font-weight: 650; color: var(--text); letter-spacing: .5px;
}
.breadcrumb .sub { font-size: 12.5px; color: var(--text-dim); letter-spacing: .04em; }

/* lens rail */
.lens-rail {
  display: flex; gap: 7px; padding: 5px; border-radius: 18px; align-self: flex-start;
  max-width: 100%; overflow: hidden;
}
.lens {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--text-dim); font-family: var(--font-sans); font-size: 13px;
  padding: 7px 12px; border-radius: 13px; white-space: nowrap;
  display: flex; align-items: center; gap: 6px; transition: all .25s ease;
}
.lens svg { opacity: .8; }
.lens.on {
  color: #1a120a; background: var(--accent);
  box-shadow: 0 2px 12px rgba(255,180,92,.4);
}
[data-palette="cool"] .lens.on { color: #08131f; }
.lens.on svg { opacity: 1; }

/* right edge FABs */
.fab-col {
  position: absolute; right: 16px; bottom: 250px; z-index: 30;
  display: flex; flex-direction: column; gap: 12px;
}
.fab {
  width: 48px; height: 48px; border-radius: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--text);
  transition: transform .2s ease;
}
.fab:active { transform: scale(.93); }
.fab.anchor { color: var(--anchor); }

/* ── narrative card (home) ──────────────────────────────────── */
.narr {
  position: absolute; left: 14px; right: 14px; bottom: 40px; z-index: 35;
  border-radius: 26px; padding: 20px 20px 16px; overflow: hidden;
}
.narr .kicker {
  font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 11px; display: flex; align-items: center; gap: 8px;
}
.narr .kicker .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px var(--accent); }
.narr .line {
  font-family: var(--font-serif); color: var(--text);
  font-size: 19px; line-height: 1.75; letter-spacing: .02em; text-wrap: pretty;
}
.narr .line em { font-style: normal; color: var(--glow); }
.narr .acts { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; }
.narr .act {
  appearance: none; cursor: pointer; font-family: var(--font-sans); font-size: 13.5px;
  padding: 9px 15px; border-radius: 13px; border: .5px solid var(--glass-line);
  background: rgba(255,255,255,.05); color: var(--text); transition: all .2s ease;
}
.narr .act.primary { background: var(--accent); color: #1a120a; border-color: transparent;
  box-shadow: 0 4px 16px rgba(255,180,92,.32); }
[data-palette="cool"] .narr .act.primary { color: #08131f; }
.narr .act.ghost { color: var(--text-dim); background: transparent; }
.narr .dots { display: flex; gap: 6px; margin-top: 15px; justify-content: center; }
.narr .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint);
  transition: all .3s ease; cursor: pointer; }
.narr .dots i.on { width: 18px; border-radius: 4px; background: var(--accent); }

.card-fade-enter { opacity: 0; transform: translateY(8px); }
.card-fade-in { opacity: 1; transform: none; transition: opacity .45s ease, transform .45s ease; }

/* ── place memory sheet ─────────────────────────────────────── */
.scrim { position: absolute; inset: 0; z-index: 40; background: rgba(3,4,7,.5);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.scrim.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 45;
  border-radius: 30px 30px 0 0; padding: 12px 20px 40px;
  transform: translateY(102%); transition: transform .42s cubic-bezier(.22,1,.36,1);
  max-height: 78%; overflow: hidden auto;
}
.sheet.show { transform: none; }
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--text-faint);
  margin: 2px auto 16px; }
.sheet .photo {
  height: 188px; border-radius: 18px; position: relative; overflow: hidden;
  background:
    radial-gradient(80% 120% at 20% 10%, rgba(255,180,92,.22), transparent 60%),
    linear-gradient(160deg, #2a2118, #14110d 70%);
  border: .5px solid var(--glass-line);
}
[data-palette="cool"] .sheet .photo {
  background: radial-gradient(80% 120% at 20% 10%, rgba(120,200,255,.2), transparent 60%),
              linear-gradient(160deg, #18222e, #0c1118 70%);
}
.sheet .photo .grain { position: absolute; inset: 0; opacity: .5; mix-blend-mode: overlay;
  background-image: repeating-radial-gradient(circle at 30% 40%, rgba(255,255,255,.04) 0 1px, transparent 1px 3px); }
.sheet .photo .ph-tag {
  position: absolute; left: 14px; bottom: 12px; font-size: 11.5px; color: var(--text-dim);
  letter-spacing: .08em; display: flex; align-items: center; gap: 7px;
}
.sheet h2 { font-family: var(--font-serif); color: var(--text); font-size: 25px;
  margin: 18px 0 4px; letter-spacing: .02em; }
.sheet .meta-loc { font-size: 12.5px; color: var(--text-dim); letter-spacing: .06em; }
.sheet .yeyu {
  font-family: var(--font-serif); font-size: 16px; line-height: 1.85; color: var(--text);
  margin: 16px 0; padding-left: 14px; border-left: 2px solid var(--glow);
}
.sheet .rows { display: flex; flex-direction: column; gap: 1px; border-radius: 16px;
  overflow: hidden; background: rgba(255,255,255,.045); margin-top: 6px; }
.sheet .row { display: flex; align-items: center; gap: 12px; padding: 13px 15px; }
.sheet .row .k { font-size: 13px; color: var(--text-dim); width: 76px; flex-shrink: 0; }
.sheet .row .v { font-size: 14px; color: var(--text); }
.sheet .row .v .src { display: inline-flex; align-items: center; gap: 6px; }
.sheet .sheet-acts { display: flex; gap: 10px; margin-top: 18px; }
.sheet .sheet-acts .act { flex: 1; text-align: center; padding: 13px; border-radius: 14px;
  font-size: 14px; cursor: pointer; border: .5px solid var(--glass-line);
  background: rgba(255,255,255,.05); color: var(--text); }
.sheet .sheet-acts .act.primary { background: var(--accent); color: #1a120a; border-color: transparent; }
[data-palette="cool"] .sheet .sheet-acts .act.primary { color: #08131f; }

/* ── companion overlay ──────────────────────────────────────── */
.comp-top {
  position: absolute; top: 60px; left: 0; right: 0; z-index: 38; padding: 0 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.comp-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; }
.comp-head .ava {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, var(--her), #5b2f57);
  box-shadow: 0 0 16px rgba(217,138,208,.5); display: flex; align-items: center;
  justify-content: center; font-size: 15px; color: #fff; font-weight: 600;
}
.comp-head .who { flex: 1; }
.comp-head .who .n { font-size: 15.5px; color: var(--text); font-weight: 600; }
.comp-head .who .s { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.comp-head .close { color: var(--text-dim); cursor: pointer; padding: 6px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 16px; }
.seg button {
  flex: 1; appearance: none; border: 0; cursor: pointer; background: transparent;
  color: var(--text-dim); font-family: var(--font-sans); font-size: 12.5px;
  padding: 9px 4px; border-radius: 12px; transition: all .25s ease; white-space: nowrap;
}
.seg button.on { background: rgba(255,255,255,.1); color: var(--text);
  box-shadow: inset 0 0 0 .5px var(--glass-line); }
.comp-legend {
  display: flex; gap: 16px; align-self: flex-start;
  padding: 9px 13px; border-radius: 13px; font-size: 11.5px; color: var(--text-dim);
}
.comp-legend .lg { display: flex; align-items: center; gap: 7px; }
.comp-legend .sw { width: 9px; height: 9px; border-radius: 50%; }

/* companion bottom narrative reuse .narr */

/* ── tweaks panel ───────────────────────────────────────────── */
.tweaks-btn {
  position: absolute; top: 62px; right: 16px; z-index: 42; width: 40px; height: 40px;
  border-radius: 13px; display: flex; align-items: center; justify-content: center;
  color: var(--text); cursor: pointer;
}
.tweaks {
  position: absolute; top: 110px; right: 16px; z-index: 42; width: 224px;
  border-radius: 20px; padding: 16px; transform-origin: top right;
  transform: scale(.9); opacity: 0; pointer-events: none;
  transition: transform .25s ease, opacity .25s ease;
}
.tweaks.show { transform: none; opacity: 1; pointer-events: auto; }
.tweaks .grp { margin-bottom: 16px; }
.tweaks .grp:last-child { margin-bottom: 0; }
.tweaks .lbl { font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 9px; }
.tweaks .opts { display: flex; gap: 7px; }
.tweaks .opt {
  flex: 1; text-align: center; padding: 10px 6px; border-radius: 12px; cursor: pointer;
  font-size: 12.5px; color: var(--text-dim); background: rgba(255,255,255,.05);
  border: .5px solid transparent; transition: all .2s ease; line-height: 1.3;
}
.tweaks .opt.on { color: var(--text); border-color: var(--glass-line);
  background: rgba(255,255,255,.1); }
.tweaks .opt .em { display: block; font-size: 10.5px; color: var(--text-faint); margin-top: 3px; }

/* ── 照片显影：导入入口 ───────────────────────────────────────── */
.develop-entry { display: flex; gap: 8px; align-self: flex-start; align-items: center; }
.dev-btn {
  appearance: none; cursor: pointer; font-family: var(--font-sans); font-size: 13px;
  color: var(--text); padding: 8px 14px 8px 12px; border-radius: 15px;
  display: flex; align-items: center; gap: 7px; transition: all .25s ease;
}
.dev-btn svg { color: var(--accent); opacity: .95; }
.dev-btn:not(:disabled):active { transform: scale(.96); }
.dev-btn:not(:disabled):hover { border-color: var(--glass-line); box-shadow: 0 6px 22px rgba(0,0,0,.5), 0 0 0 .5px var(--glass-line); }
.dev-btn:disabled { cursor: default; color: var(--accent); }
.dev-btn:disabled svg { animation: devpulse 1.4s ease-in-out infinite; }
@keyframes devpulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.dev-sample {
  appearance: none; cursor: pointer; font-family: var(--font-sans); font-size: 12px;
  color: var(--text-dim); padding: 8px 11px; border-radius: 13px; transition: all .2s ease;
}
.dev-sample:not(:disabled):hover { color: var(--text); }
.dev-sample:disabled { opacity: .4; cursor: default; }

/* real photo thumbnail inside the memory sheet */
.sheet .photo .ph-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.92) contrast(1.03) brightness(.95);
}
.sheet .photo .ph-tag { text-shadow: 0 1px 8px rgba(0,0,0,.7); z-index: 2; }

/* drag-to-develop overlay */
.dropzone {
  position: absolute; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  background: rgba(4,5,8,.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: fadeY .25s ease both;
}
.dropzone .dz-inner {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 30px 40px; border-radius: 24px; color: var(--accent);
  font-family: var(--font-serif); font-size: 17px; letter-spacing: .04em;
  border-style: dashed !important; border-width: 1px !important;
}

.fade-y { animation: fadeY .5s ease both; }
@keyframes fadeY { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .stage { flex-direction: column; }
}
