/* ============================================================
   Melora 官网 — 产品截图即主角
   App 八色浅色背景 / 留白分栏 / 真实应用截图
   ============================================================ */

:root {
  --bg: #eef1f6;
  --bg-soft: #e2e8f1;
  --text: #202733;
  --dim: #515b69;
  --faint: #626d7a;
  --accent: #2f5da8;
  --accent-ink: #ffffff;
  --line: rgba(32, 39, 51, 0.13);
  --font: "PingFang SC", "HarmonicOS Sans SC", "Microsoft YaHei", -apple-system,
    "Segoe UI", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  transition: background-color 0.7s ease;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(157, 180, 255, 0.35); }

img { display: block; width: 100%; height: auto; }

h1, h2 {
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.01em;
}

.kicker {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 2.2rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.25s ease, background 0.25s ease;
}

.btn:hover { background: var(--accent-hover, #254a86); transform: translateY(-2px); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn--ghost:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.45); }

/* ============ 导航 ============ */
.nav {
  position: fixed;
  top: 16px;
  left: max(16px, calc((100vw - 1120px) / 2));
  right: max(16px, calc((100vw - 1120px) / 2));
  border-radius: 999px;
  background: var(--nav-bg, #eef1f6ed);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 2.2rem;
  padding: 0.8rem 1.4rem;
  transition: background 0.35s ease, backdrop-filter 0.35s ease, border-color 0.35s ease;
  border-bottom: 1px solid transparent;
}

.nav--scrolled {
  background: var(--nav-bg, #eef1f6ed);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom-color: var(--line);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.nav__logo { width: 30px; height: 30px; }

.nav__links { display: flex; gap: 1.9rem; margin-left: auto; }

.nav__links a {
  color: var(--dim);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.25s;
}

.nav__links a:hover { color: var(--text); }

.nav__cta {
  padding: 0.45rem 1.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.25s;
}

.nav__cta:hover { background: var(--accent-hover, #254a86); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s;
}

/* ============ 移动端菜单 ============ */
.menu { display: none; }

/* ============ 手机外框 ============ */
.phone {
  border-radius: 44px;
  overflow: hidden;
  background: #000;
  border: 3px solid #26262b;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 30px 65px rgba(32, 39, 51, 0.18);
}

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: clamp(8rem, 16vh, 11rem) clamp(1.25rem, 5vw, 4rem) clamp(4rem, 9vh, 7rem);
  overflow: hidden;
}

.hero__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.hero h1 { font-size: clamp(2.8rem, 5.8vw, 4.8rem); margin-bottom: 1.6rem; }

.hero__sub {
  color: var(--dim);
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  max-width: 30em;
  margin-bottom: 2.4rem;
}

.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }

.hero__note { color: var(--faint); font-size: 0.85rem; letter-spacing: 0.04em; }

/* Hero 手机舞台：单机轮播 */
.hero__stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(480px, 62vw, 640px);
}

/* Hero 氛围光使用全站当前配色 */
.hero__aura {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  background-color: var(--seed, #2f5da8);
  opacity: 0.3;
  filter: blur(70px);
  z-index: 1;
  transition: background-color 1.1s ease;
  pointer-events: none;
}

.hero__stage .phone {
  position: relative;
  width: min(64%, 320px);
  aspect-ratio: 760 / 1406;
  z-index: 2;
}

/* 漂浮格式徽章 */
.chip {
  position: absolute;
  z-index: 3;
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  animation: float 5s ease-in-out infinite;
}

.chip--1 { top: 8%; left: 10%; animation-delay: -1s; }
.chip--2 { top: 32%; right: 4%; animation-delay: -2.5s; }
.chip--3 { bottom: 20%; left: 6%; animation-delay: -3.8s; }

.chip--4 {
  bottom: 10%;
  right: 2%;
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 700;
  animation-delay: -0.5s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ============ Feature 分栏 ============ */
.feature {
  border-top: 1px solid var(--line);
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(4.5rem, 10vw, 8rem) clamp(1.25rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: center;
}

.feature--reverse .feature__copy { order: 2; }
.feature--reverse .feature__stage { order: 1; }

.feature h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); margin-bottom: 1.4rem; }

.feature__copy > p { color: var(--dim); max-width: 32em; }

.facts {
  list-style: none;
  margin-top: 1.8rem;
  border-top: 1px solid var(--line);
}

.facts li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.96rem;
  color: var(--text);
}

.facts li::before {
  content: "—";
  color: var(--accent);
  margin-right: 0.7rem;
}

.feature__stage { display: grid; place-items: center; }

.phone--solo { width: min(72%, 340px); }

/* 主题互动预览 */
.themepick__hint {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: var(--faint);
}

.themeswap { position: relative; aspect-ratio: 760 / 1406; }

.themeswap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.themeswap img.is-active { opacity: 1; }

/* Hero 模拟波纹进度条（仅彩胶帧） */
.wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  pointer-events: none;
}

.wave span {
  flex: 1;
  border-radius: 2px;
  transform-origin: bottom;
  animation: wavePulse 1.15s ease-in-out infinite alternate;
}

#heroWave {
  position: absolute;
  left: 3%;
  right: 3%;
  top: 73.5%;
  height: 7.5%;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.45s ease;
}

#heroWave.wave--on { opacity: 1; }
#heroWave span { background: rgba(96, 110, 135, 0.3); }
#heroWave span.played { background: #4a70b8; }

@keyframes wavePulse {
  from { transform: scaleY(0.72); }
  to { transform: scaleY(1.12); }
}

/* ============ 细节（编辑式排版，无卡片） ============ */
.details {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(4.5rem, 10vw, 8rem) clamp(1.25rem, 5vw, 4rem) clamp(2.5rem, 5vw, 4rem);
}

.details h2 {
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.details__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(2.5rem, 6vw, 5rem);
}

.details__grid > div {
  padding: 1.8rem 0;
  border-top: 1px solid var(--line);
}

.details__grid dt {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.details__grid dt::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.7rem;
  vertical-align: 0.12em;
}

.details__grid dd { color: var(--dim); font-size: 0.98rem; }

.tag {
  display: inline-block;
  margin-left: 0.55rem;
  padding: 0.08rem 0.55rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  vertical-align: 0.28em;
}

/* ============ 社区 ============ */
.community {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(5rem, 11vw, 9rem) clamp(1.25rem, 5vw, 4rem);
  text-align: center;
}

.community__inner { max-width: 700px; margin: 0 auto; }

.community h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); margin-bottom: 1.4rem; }

.community__inner > p { color: var(--dim); }

.community__hash {
  margin-top: 2.2rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  color: var(--accent);
}

/* ============ 下载 ============ */
.download {
  padding: clamp(5.5rem, 12vw, 10rem) clamp(1.25rem, 5vw, 4rem);
  text-align: center;
}

.download h2 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  margin-bottom: 2.4rem;
}

.download__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.4rem;
}

.download__platforms {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem 1.8rem;
  color: var(--dim);
  font-size: 0.92rem;
}

.download__platforms li:not(:last-child)::after {
  content: "·";
  margin-left: 1.8rem;
  color: var(--faint);
}

.download__platforms .soon { color: var(--faint); }

/* ============ 页脚 ============ */
.footer {
  border-top: 1px solid var(--line);
  padding: 2.8rem clamp(1.25rem, 5vw, 4rem) 2.2rem;
  max-width: 1120px;
  margin: 0 auto;
}

.footer__inner {
  display: flex;
  align-items: baseline;
  gap: 1.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}

.footer__brand { font-weight: 800; font-size: 1.15rem; }

.footer__inner p { color: var(--dim); font-size: 0.9rem; }

.footer__copy { color: var(--faint); font-size: 0.8rem; letter-spacing: 0.05em; }

.footer__copy a { color: var(--dim); text-decoration: none; }

.footer__copy a:hover { color: var(--accent); text-decoration: underline; }

/* ============ 滚动显现 ============ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal--visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .chip { animation: none; }
  .wave span { animation: none; }
  .hero__stage .phone, .hero__aura { transition: none; }
}

/* ============ 响应式 ============ */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__copy { text-align: center; }
  .hero__sub { margin-left: auto; margin-right: auto; }
  .hero__actions { justify-content: center; }
  .hero__stage { max-width: 560px; margin: 1rem auto 0; width: 100%; }
  .hero__stage .phone { width: 52%; }

  .feature { grid-template-columns: 1fr; }
  .feature--reverse .feature__copy { order: 1; }
  .feature--reverse .feature__stage { order: 2; }
  .phone--solo { width: min(64%, 320px); }

  .details__grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: flex; }

  .menu {
    position: fixed;
    inset: 0;
    z-index: 49;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.2rem;
    background: var(--bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
  }

  .menu--open { opacity: 1; pointer-events: auto; }

  .menu a {
    color: var(--text);
    text-decoration: none;
    font-size: 1.35rem;
    letter-spacing: 0.1em;
  }

  .nav--open .nav__toggle span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav--open .nav__toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

  .chip--2 { right: 0; }
}

/* Whole-page palette controls share the App seed colors. */
.site-palette { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 1.8rem 0 0.65rem; }
.site-palette > span { width: 100%; font-size: 0.85rem; color: var(--dim); }
.site-palette__button { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--bg); background: var(--swatch); cursor: pointer; }
.site-palette__button[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 2px; }
.site-palette__hint { color: var(--faint); font-size: 0.8rem; margin-bottom: 1.4rem; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--text); outline-offset: 5px; }
section[id] { scroll-margin-top: 100px; }
.community { transition: background-color 0.7s ease; }
.nav__logo path, .nav__logo circle { stroke: var(--accent); }
.nav__logo circle { fill: var(--accent); stroke: none; }
@media (max-width: 960px) { .site-palette { justify-content: center; } }

/* Theme gallery with previous/next controls. */
.showcase { max-width: 1120px; margin: 0 auto; padding: clamp(3rem, 7vw, 5rem) clamp(1.25rem, 5vw, 4rem); border-top: 1px solid var(--line); text-align: center; }
.showcase__intro h2 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 1rem; }
.showcase__intro > p:last-child { color: var(--dim); max-width: 42em; margin: 0 auto; }
.mobile-break { display: none; }
.showcase__stage { position: relative; display: flex; justify-content: center; align-items: center; gap: clamp(1rem, 4vw, 3rem); margin: 2rem auto 1.25rem; padding: 1.5rem 1rem; border-radius: 28px; background: var(--bg-soft); transition: background-color 0.7s ease; overflow: hidden; }
.showcase__phone { width: clamp(220px, 23vw, 260px); flex-shrink: 0; border-radius: 30px; }
.showcase__phone img { object-fit: contain; }
.showcase__side { width: clamp(160px, 19vw, 210px); flex-shrink: 0; border-radius: 24px; overflow: hidden; opacity: 0.55; box-shadow: 0 15px 35px rgba(32, 39, 51, 0.1); }
.showcase__side img { display: block; aspect-ratio: 760 / 1406; object-fit: contain; background: #000; }
.showcase__caption { margin: 1.25rem auto 0; min-height: 5.5rem; }
.showcase__caption h3 { font-size: 1.25rem; font-weight: 650; margin-bottom: 0.3rem; }
.showcase__caption p { color: var(--dim); font-size: 0.95rem; }
@media (max-width: 720px) {
  .mobile-break { display: initial; }
  .showcase__stage { gap: 20px; padding: 1.5rem 0; }
  .showcase__phone { width: min(62vw, 260px); border-radius: 26px; }
  .showcase__side { width: min(45vw, 180px); }
  .showcase__caption p { max-width: 25em; margin: 0 auto; }
}

.showcase__arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--accent); padding: 0; cursor: pointer; box-shadow: 0 4px 16px rgba(32,39,51,.1); }
.showcase__arrow--previous { left: 16px; }
.showcase__arrow--next { right: 16px; }
.showcase__arrow:hover { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 720px) { .showcase__arrow { width: 44px; height: 44px; } .showcase__arrow--previous { left: 6px; } .showcase__arrow--next { right: 6px; } }

.showcase__arrow svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.hero__sub p + p { margin-top: 0.8rem; }
.nav__language { min-width: 95px; max-width: 115px; padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer; }
.nav__language:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (min-width: 721px) and (max-width: 960px) { .nav { gap: 0.8rem; } .nav__links { gap: 1rem; } }
@media (max-width: 720px) { .nav__language { margin-left: auto; } .nav__toggle { margin-left: 0; } .nav { gap: 0.75rem; } }

/* Compact source families keep a small integration set balanced. */
.sources { max-width: 1120px; margin: 0 auto; padding: 3rem clamp(1.25rem, 5vw, 4rem) 5rem; border-top: 1px solid var(--line); }
.sources__intro { margin-bottom: 2.5rem; }
.sources__intro h2 { font-size: clamp(1.8rem, 3.3vw, 2.65rem); margin-bottom: 0.8rem; }
.sources__intro > p:last-child { color: var(--dim); max-width: 42em; }
.sources__row { display: grid; grid-template-columns: 175px minmax(0, 1fr); gap: 2rem; padding: 1.8rem 0; border-top: 1px solid var(--line); }
.sources__category h3 { font-size: 1.05rem; font-weight: 650; }
.sources__category p, .source-item p, .sources__note { color: var(--dim); font-size: 0.8rem; }
.sources__servers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2rem; list-style: none; }
.source-item { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }
.source-item img, .source-item__protocol { width: 42px; height: 42px; flex-shrink: 0; }
.source-item h4 { font-size: 0.95rem; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.source-item__protocol { display: grid; place-items: center; border-radius: 12px; background: var(--bg-soft); color: var(--accent); }
.source-item__protocol svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.sources__note { margin-top: 0.8rem; max-width: 43em; }
@media (max-width: 720px) {
  .sources__row { grid-template-columns: 1fr; gap: 1.1rem; }
  .sources__servers { gap: 1.25rem 1rem; }
  .source-item { gap: 0.6rem; }
  .source-item img { width: 36px; height: 36px; }
}
@media (max-width: 380px) { .sources__servers { grid-template-columns: 1fr; } }
