/* 祖影 Echo — marketing site. Brand: navy night sky + golden tree (app icon),
   section surfaces echo the app's 雅纸 paper tones. */

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --navy: #0b1427;
  --navy-2: #131f3a;
  --gold: #d9a441;
  --gold-soft: #f0c878;
  --paper: #f8f2e9;
  --card: #fffdf8;
  --ink: #2c231b;
  --dim: #6e675c;
  --line: #e3dbcb;
  --cinnabar: #b0433a;
  --jade: #5f8468;
  --radius: 16px;
  --maxw: 1080px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "PingFang TC",
    "Hiragino Sans GB", "Noto Sans SC", "Noto Sans Devanagari",
    "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { line-height: 1.25; font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); text-align: center; }
.section-sub {
  text-align: center; color: var(--dim); max-width: 620px;
  margin: 12px auto 0; font-size: 1.02rem;
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 20, 39, 0.92);
  backdrop-filter: blur(10px);
  color: #f2ecdf;
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand img { border-radius: 8px; }
.brand-name { font-size: 1.05rem; letter-spacing: .02em; }
.nav-links { display: flex; gap: 18px; margin-left: auto; font-size: .95rem; }
.nav-links a { opacity: .85; }
.nav-links a:hover { opacity: 1; color: var(--gold-soft); }
.lang-wrap {
  display: flex; align-items: center; gap: 6px;
  color: var(--gold-soft);
}
.lang-wrap select {
  appearance: none; -webkit-appearance: none;
  background: transparent; color: #f2ecdf;
  border: 1px solid rgba(240, 200, 120, .45); border-radius: 10px;
  padding: 4px 10px; font-size: .9rem; cursor: pointer;
}
.lang-wrap select:focus { outline: 2px solid var(--gold); }
.lang-wrap option { color: #222; }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .lang-wrap { margin-left: auto; }
}

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 70% -10%, #22345c 0%, transparent 60%),
    var(--navy);
  color: #f2ecdf;
  overflow: hidden;
}
.hero-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 72px 20px 80px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px;
  align-items: center;
}
.hero-copy h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  background: linear-gradient(120deg, #f7e7bd, var(--gold) 70%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  margin-top: 18px; font-size: 1.08rem; opacity: .88; max-width: 520px;
}
.hero-note { margin-top: 14px; font-size: .9rem; opacity: .6; }
.hero-art { display: flex; justify-content: center; }
.hero-img {
  width: min(340px, 80%);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; padding: 48px 20px 56px; }
  .hero-art { order: -1; }
  .hero-img { width: min(240px, 62%); }
}

/* hero CTA */
.hero-cta { margin-top: 24px; }
.cta-btn {
  display: inline-block;
  background: linear-gradient(120deg, var(--gold-soft), var(--gold));
  color: #221607; font-weight: 700; font-size: 1.02rem;
  border-radius: 14px; padding: 12px 26px;
  box-shadow: 0 8px 24px rgba(217, 164, 65, .35);
  transition: transform .15s ease;
}
.cta-btn:hover { transform: translateY(-2px); }

/* store badges */
.badges { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.badges-center { justify-content: center; }
.store-badge {
  display: flex; align-items: center; gap: 10px;
  background: #000; color: #fff;
  border: 1px solid #3a3a3a; border-radius: 12px;
  padding: 9px 18px 9px 14px; min-width: 172px;
  transition: transform .15s ease, border-color .15s ease;
}
.store-badge:hover { transform: translateY(-2px); border-color: var(--gold); }
.store-badge small { display: block; font-size: .68rem; opacity: .75; line-height: 1.2; }
.store-badge strong { font-size: 1.02rem; line-height: 1.25; }

/* ---------- features ---------- */
.features { max-width: var(--maxw); margin: 0 auto; padding: 72px 20px 24px; }
.feat-grid {
  margin-top: 40px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.feat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 24px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.feat:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(44, 35, 27, .08); }
.feat-icon { font-size: 1.7rem; }
.feat h3 { margin: 20px 0 8px; font-size: 1.08rem; }
.feat p { color: var(--dim); font-size: .95rem; }
@media (max-width: 900px) { .feat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feat-grid { grid-template-columns: 1fr; } }

/* ---------- real screenshots ---------- */
/* wider than --maxw so all five 218px shots fit in one centered row */
.shots { padding: 72px 0 24px; max-width: 1240px; margin: 0 auto; }
.shots-strip {
  display: flex; gap: 22px; margin-top: 36px;
  overflow-x: auto; padding: 8px 20px 18px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* still swipeable/scrollable, just no bar */
}
.shots-strip::-webkit-scrollbar { display: none; }
.shot {
  flex: none; width: 218px; scroll-snap-align: center;
  text-align: center;
}
/* center the strip when it fits; auto margins collapse safely when it overflows */
.shot:first-child { margin-left: auto; }
.shot:last-child { margin-right: auto; }
.shot img {
  width: 100%; border-radius: 26px;
  border: 6px solid #10131c;
  box-shadow: 0 14px 34px rgba(16, 19, 28, .22);
}
.shot figcaption { margin-top: 10px; color: var(--dim); font-size: .88rem; }

/* ---------- demo / simulator ---------- */
.demo { padding: 72px 20px 24px; max-width: var(--maxw); margin: 0 auto; }
.demo-stage { display: flex; flex-direction: column; align-items: center; margin-top: 36px; }
.demo-note { margin-top: 18px; color: var(--dim); font-size: .9rem; text-align: center; padding: 0 12px; max-width: 560px; }

.phone {
  position: relative;
  width: min(540px, 96vw); aspect-ratio: 390 / 660;
  border-radius: 40px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(44, 35, 27, .14);
  overflow: hidden;
  background: var(--ph-bg);
  transition: background .3s ease;
  /* per-style palette (set by data-style) */
  --ph-bg: #f5f6f8; --ph-card: #ffffff; --ph-ink: #191b20;
  --ph-dim: #5a5f6a; --ph-line: #d8dbe3; --ph-accent: #5b5fef;
  --ph-chip: #f0f1f5;
}
.phone[data-style="glass"] {
  --ph-bg: #0d1120; --ph-card: #1b2136; --ph-ink: #f2f4ff;
  --ph-dim: #a9b0c6; --ph-line: #3a415c; --ph-accent: #ff6e61;
  --ph-chip: #262d47;
}
.phone[data-style="candy"] {
  --ph-bg: #fff4ec; --ph-card: #ffffff; --ph-ink: #33231c;
  --ph-dim: #7a6257; --ph-line: #f0d5bd; --ph-accent: #ff6b4a;
  --ph-chip: #fbeadd;
}
.phone[data-style="paper"] {
  --ph-bg: #f4f0e6; --ph-card: #fcfaf3; --ph-ink: #2b2620;
  --ph-dim: #6e675c; --ph-line: #d5cdb9; --ph-accent: #c3392b;
  --ph-chip: #ebe5d5;
}

.phone-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 6px; color: var(--ph-ink);
}
.phone-title { font-weight: 700; font-size: 1rem; letter-spacing: .06em; }
.style-dots { display: flex; gap: 8px; }
.dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer; padding: 0;
}
.dot.is-on { border-color: var(--ph-ink); }
.dot-soft  { background: linear-gradient(135deg, #f5f6f8 50%, #5b5fef 50%); }
.dot-glass { background: linear-gradient(135deg, #0d1120 50%, #ff6e61 50%); }
.dot-candy { background: linear-gradient(135deg, #fff4ec 50%, #ff6b4a 50%); }
.dot-paper { background: linear-gradient(135deg, #f4f0e6 50%, #c3392b 50%); }

#tree {
  width: 100%; height: calc(100% - 46px); display: block;
  touch-action: none; cursor: grab; user-select: none;
}
#tree:active { cursor: grabbing; }

/* edges — stroke widths/colors mirror _TreeEdgePainter */
#tree .edge { stroke: var(--ph-line); stroke-width: 1.4; fill: none; }
#tree .edge.blood {
  stroke: var(--ph-accent); stroke-width: 2.4; stroke-linecap: round;
  stroke-dasharray: 5 7;
  animation: flow 1.1s linear infinite;
}
#tree .edge.partner { stroke: var(--ph-dim); stroke-width: 2.2; }
@keyframes flow { to { stroke-dashoffset: -12; } }
@media (prefers-reduced-motion: reduce) {
  #tree .edge.blood { animation: none; }
}

/* 连理结 heart chip */
#tree .heart-ring { fill: var(--ph-bg); stroke: var(--ph-line); stroke-width: 1.5; }
#tree .heart { fill: var(--ph-dim); }
#tree .heart-lit .heart-ring { stroke: var(--ph-accent); }
#tree .heart-lit .heart { fill: var(--ph-accent); }

/* chip-card nodes, like _PersonNode */
#tree .node { cursor: pointer; }
#tree .node rect.body {
  fill: var(--ph-card); stroke: var(--ph-line); stroke-width: 1;
}
#tree .node.is-ego rect.body {
  fill: color-mix(in srgb, var(--ph-accent) 14%, var(--ph-card));
  stroke: var(--ph-accent); stroke-width: 2;
}
#tree .node text.name {
  fill: var(--ph-ink); font-size: 13px; font-weight: 600;
}
#tree .node text.sub { fill: var(--ph-accent); font-size: 11px; }
#tree .node text.sub.no-kin { fill: var(--ph-dim); }
#tree .node.dead { opacity: .55; }
#tree .band-label { fill: var(--ph-dim); font-size: 11px; opacity: .85; }
#tree .band-rail { stroke: var(--ph-line); stroke-width: 1.2; }

/* ------ trading-card dialog (node tap, like the app) ------ */
.sim-overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(15, 14, 12, .45); padding: 16px;
}
.trading-card {
  width: 208px; aspect-ratio: 63 / 88;
  background: var(--ph-card); border: 1px solid var(--ph-line);
  border-radius: 16px; padding: 7px;
  box-shadow: 0 8px 18px rgba(44, 35, 27, .18);
}
.tc-inner {
  height: 100%; display: flex; flex-direction: column;
  border: 1px solid rgba(140, 90, 43, .55); /* bronze frame */
  border-radius: 12px; overflow: hidden;
}
.tc-portrait {
  flex: 1; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(to bottom, var(--tc-life, rgba(95,132,104,.30)), var(--ph-chip));
}
.tc-watermark {
  position: absolute; font-size: 76px; font-weight: 200;
  color: var(--ph-ink); opacity: .12; line-height: 1;
}
.tc-avatar { width: 108px; height: 108px; position: relative; }
.tc-avatar svg { width: 100%; height: 100%; }
.tc-kin {
  position: absolute; top: 8px; left: 8px;
  background: #b0433a; color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
}
.tc-kin:empty { display: none; }
.tc-seal {
  position: absolute; bottom: 8px; right: 8px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #b0433a; border-radius: 6px;
  color: #b0433a; font-size: 16px; font-weight: 700;
}
.tc-seal:empty { display: none; }
.tc-footer { padding: 10px 12px 12px; color: var(--ph-ink); }
.tc-name { font-size: 1.05rem; font-weight: 700; }
.tc-meta {
  display: flex; align-items: center; gap: 5px;
  margin-top: 4px; color: var(--ph-dim); font-size: .82rem;
}
.tc-dot { width: 8px; height: 8px; border-radius: 50%; background: #5f8468; flex: none; }
.tc-dot.dead { background: #8a8177; }
.tc-place { margin-left: auto; }

.tc-chips {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  margin-top: 12px; max-width: 260px;
}
.action-chip {
  border: 1px solid var(--ph-line); background: var(--ph-card);
  color: var(--ph-ink); border-radius: 10px; padding: 6px 12px;
  font-size: .82rem; cursor: pointer; font-family: inherit;
}
.action-chip:hover:not(:disabled) { border-color: var(--ph-accent); }
.action-chip:disabled { opacity: .4; cursor: default; }
.action-chip.chip-danger { color: #c3392b; }

/* -------- person page (展开), the app's gallery screen -------- */
.sim-gallery {
  position: absolute; left: 0; right: 0; bottom: 0; top: 46px; z-index: 6;
  background: var(--ph-bg); color: var(--ph-ink);
  display: flex; flex-direction: column;
  animation: gallery-in .22s ease;
}
@keyframes gallery-in { from { transform: translateY(16px); opacity: 0; } }
.g-top {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid var(--ph-line); flex: none;
}
.g-back, .g-edit {
  border: 0; background: none; color: var(--ph-ink); font-size: 1.05rem;
  cursor: pointer; padding: 4px 8px; font-family: inherit;
}
.g-edit:hover, .g-back:hover { color: var(--ph-accent); }
.g-title { flex: 1; text-align: center; font-weight: 700; font-size: .95rem; }
.g-scroll { flex: 1; overflow-y: auto; padding: 14px 16px 18px; }
.g-head { display: flex; gap: 12px; align-items: center; }
.g-avatar {
  width: 76px; height: 76px; border-radius: 50%; overflow: hidden;
  background: var(--ph-chip); flex: none;
}
.g-avatar svg { display: block; }
.g-name { font-weight: 800; font-size: 1.15rem; }
.g-sub {
  display: flex; gap: 8px; align-items: center; margin-top: 4px;
  font-size: .8rem; color: var(--ph-dim); flex-wrap: wrap;
}
.g-kin {
  background: #b0433a; color: #fff; border-radius: 999px;
  padding: 1px 8px; font-size: .72rem;
}
.g-tags { margin-top: 6px; }
.g-tag {
  background: var(--ph-chip); color: var(--ph-ink); border-radius: 999px;
  padding: 2px 10px; font-size: .74rem;
}
.g-echoes {
  margin-top: 12px; display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap;
}
.g-echo-label { font-size: .78rem; color: var(--ph-dim); }
.g-echo-chip {
  border: 1px solid var(--ph-accent); color: var(--ph-accent);
  border-radius: 999px; padding: 3px 10px; font-size: .78rem;
}
.g-sec {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 8px; font-weight: 700; font-size: .95rem;
}
.g-add {
  border: 0; background: var(--ph-chip); color: var(--ph-accent);
  border-radius: 999px; padding: 5px 12px; font-size: .8rem;
  cursor: pointer; font-family: inherit;
}
.g-story {
  background: var(--ph-card); border: 1px solid var(--ph-line);
  border-radius: 14px; padding: 12px 14px;
}
.g-story-t { font-weight: 700; font-size: .88rem; }
.g-story-b { margin-top: 4px; font-size: .8rem; color: var(--ph-dim); line-height: 1.55; }
.g-label { margin: 12px 0 8px; font-size: .8rem; color: var(--ph-dim); font-weight: 600; }
.g-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.g-photo {
  position: relative; aspect-ratio: 1; border: 0; border-radius: 12px;
  cursor: pointer; overflow: hidden; padding: 0;
}
.g-photo span {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  font-size: .62rem; color: #fff; background: rgba(0, 0, 0, .38);
  padding: 3px 6px; text-align: left;
}
.ph-a { background: linear-gradient(135deg, #9bb0a5, #5f8468); }
.ph-b { background: linear-gradient(135deg, #c9a876, #8a6844); }
.ph-c { background: linear-gradient(135deg, #b98a8a, #8f5f5f); }
.g-photo::after {
  content: ''; position: absolute; width: 34px; height: 34px;
  border-radius: 50%; background: rgba(255, 255, 255, .18);
  top: 14%; right: 12%;
}
.g-tile {
  width: 96px; height: 96px; border: 1px solid var(--ph-line);
  background: var(--ph-card); color: var(--ph-accent); border-radius: 14px;
  cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  font-family: inherit;
}
.g-tile:hover { border-color: var(--ph-accent); }
.g-dur { font-size: .74rem; color: var(--ph-dim); }
.g-play { font-size: 1.5rem; }
.g-foot { margin: 18px 4px 6px; font-size: .74rem; color: var(--ph-dim); text-align: center; }

/* recenter / zoom controls, like the app's canvas FABs */
.canvas-fabs {
  position: absolute; right: 14px; bottom: 58px; z-index: 4;
  display: flex; flex-direction: column; gap: 8px;
}
.fab {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--ph-line); background: var(--ph-card);
  color: var(--ph-ink); font-size: 1rem; cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .14);
  display: flex; align-items: center; justify-content: center;
}
.fab:hover { border-color: var(--ph-accent); color: var(--ph-accent); }

/* legend under the phone */
.demo-legend {
  display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center;
  margin-top: 18px; color: var(--dim); font-size: .88rem;
}
.demo-legend i { font-style: normal; }
.demo-legend .lg-heart { color: var(--cinnabar); }
.demo-legend .lg-dash { color: #5b5fef; letter-spacing: -1px; }
.demo-legend .lg-fade { opacity: .45; }

/* freshly added person pulses once */
#tree .node.is-new rect.body { animation: node-pop .9s ease; }
@keyframes node-pop {
  0% { stroke: var(--ph-accent); stroke-width: 6; }
  100% { stroke: var(--ph-line); stroke-width: 1; }
}

/* toast triggered inside the phone — pinned to the viewport so it's seen
   even when the phone's bottom edge is scrolled out of view (fixed escapes
   the phone's overflow clip; it still inherits the --ph-* palette) */
.sim-toast {
  position: fixed; left: 50%; bottom: 72px; z-index: 60;
  transform: translate(-50%, 0);
  width: max-content; max-width: min(480px, 92vw);
  background: var(--ph-ink); color: var(--ph-bg);
  border-radius: 12px; padding: 10px 16px; font-size: .82rem;
  text-align: center; animation: toast-in .2s ease;
  box-shadow: 0 10px 30px rgba(44, 35, 27, .25);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

.phone-hint {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  background: var(--ph-card); color: var(--ph-dim);
  border: 1px solid var(--ph-line);
  border-radius: 999px; padding: 6px 16px; font-size: .82rem;
  pointer-events: none; white-space: nowrap;
}

/* ---------- download ---------- */
.download {
  margin: 72px auto 0; padding: 64px 20px;
  text-align: center; color: #f2ecdf;
  background:
    radial-gradient(900px 400px at 50% 120%, #22345c 0%, transparent 60%),
    var(--navy);
}
.dl-icon { margin: 0 auto 18px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.download .section-sub { color: #cbc3ae; }
.download .badges { margin-top: 26px; }

/* ---------- contact ---------- */
.contact { max-width: var(--maxw); margin: 0 auto; padding: 72px 20px; text-align: center; }
.mail-btn {
  display: inline-block; margin-top: 26px;
  background: var(--ink); color: var(--paper);
  border-radius: 14px; padding: 12px 28px; font-size: 1.02rem;
  transition: transform .15s ease;
}
.mail-btn:hover { transform: translateY(-2px); }
.ct-note { margin-top: 14px; color: var(--dim); font-size: .9rem; }

/* ---------- legal pages ---------- */
.legal {
  max-width: 720px; margin: 0 auto; padding: 48px 20px 72px;
}
.legal h1 { font-size: 1.8rem; margin: 18px 0 6px; }
.legal h2 { font-size: 1.12rem; text-align: left; margin: 30px 0 8px; }
.legal p, .legal li { color: var(--ink); font-size: .98rem; }
.legal ul { padding-left: 1.4em; margin-top: 6px; }
.legal li { margin: 4px 0; }
.legal a { color: var(--cinnabar); text-decoration: underline; }
.back-link {
  display: inline-block; color: var(--dim) !important;
  text-decoration: none !important; font-size: .92rem;
}
.back-link:hover { color: var(--ink) !important; }
.legal-updated { color: var(--dim); font-size: .88rem; margin-bottom: 22px; }
.legal-note {
  margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line);
  color: var(--dim); font-size: .88rem;
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  text-align: center; padding: 22px; color: var(--dim); font-size: .85rem;
}
.footer-links {
  display: flex; gap: 18px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 10px;
}
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
