:root {
  --brand: #26c299;
  --brand-dark: #1eab86;
  --brand-soft: rgba(38, 194, 153, 0.12);
  --ink: #1a1f2e;
  --ink-muted: #5c6578;
  --line: #e6e9ef;
  --surface: #ffffff;
  --bg: #f4f7f9;
  --bg-glow: #e8f8f3;
  --shadow: 0 18px 50px rgba(26, 31, 46, 0.08);
  --radius: 16px;
  --font-display: "Plus Jakarta Sans", "Noto Sans SC", "Noto Sans TC", sans-serif;
  --font-body: "Manrope", "Noto Sans SC", "Noto Sans TC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
a {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.hidden {
  display: none !important;
}

/* Shared chrome */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand__logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: #2a2f3a;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 26px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 8px 20px rgba(38, 194, 153, 0.22);
  min-width: 138px;
}

.btn:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn--ghost {
  background: transparent;
  color: var(--ink-muted);
  box-shadow: none;
  border: 1px solid var(--line);
}

.btn--ghost:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-color: transparent;
}

.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.lang-trigger:hover {
  border-color: var(--brand);
  background: #fff;
}

.lang-trigger svg {
  width: 18px;
  height: 18px;
  color: var(--brand);
}

.lang-trigger__chevron {
  width: 14px;
  height: 14px;
  opacity: 0.55;
}

.link-quiet {
  background: none;
  border: none;
  color: #9aa1ad;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  font-size: 0.875rem;
}

.link-quiet:hover {
  color: var(--brand);
}

/* ===================== PC ===================== */
.layout-pc {
  --pc-pad-x: clamp(48px, 8vw, 120px);
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  overflow: hidden;
  background: #f3f6f8;
}

.layout-pc::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 50% at 72% 48%, rgba(232, 248, 243, 0.9), transparent 70%),
    linear-gradient(90deg, rgba(26, 31, 46, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(26, 31, 46, 0.025) 1px, transparent 1px);
  background-size: auto, 56px 56px, 56px 56px;
  mask-image: radial-gradient(ellipse 75% 80% at 70% 45%, #000 10%, transparent 78%);
  pointer-events: none;
}

.pc-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px var(--pc-pad-x) 0;
}

.pc-lang {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.pc-lang__btn {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: #9aa1ad;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.pc-lang__btn:hover {
  color: var(--brand);
}

.pc-lang__btn.is-active {
  color: var(--brand);
  font-weight: 600;
}

.pc-lang__sep {
  color: #c5cad3;
  font-size: 0.85rem;
  user-select: none;
}

.pc-main {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  padding: 0 var(--pc-pad-x);
  width: 100%;
  min-height: 0;
}

.pc-copy {
  animation: rise-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  padding-bottom: 8px;
  max-width: min(440px, 42vw);
  z-index: 2;
}

.pc-eyebrow {
  margin: 0 0 14px;
  color: #8b93a1;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.pc-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 2.8vw, 2.55rem);
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #2a2f3a;
  max-width: 12em;
}

.pc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
}

/* 高度适配：底贴屏幕，右贴屏幕右边缘 */
.pc-visual {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  height: calc(100vh - 56px);
  max-width: calc(100% - var(--pc-pad-x) - min(440px, 42vw) - 48px);
  pointer-events: none;
  animation: float-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.pc-visual picture {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  height: 100%;
  width: 100%;
}

.pc-visual img {
  display: block;
  height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: right bottom;
}

.pc-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 var(--pc-pad-x) 28px;
}

.pc-footer__sep {
  color: #c5cad3;
  font-size: 0.8rem;
  user-select: none;
}

/* ===================== Mobile ===================== */
/* 间距基准：iPhone 14 Pro Max 视口高度 932px */
.layout-mobile {
  --m-bottom-gap: 4.29dvh; /* 40 / 932：协议距屏幕底边 */
  --m-actions-footer-gap: 6.87dvh; /* 64 / 932：按钮与协议间距 */
  --m-btn-up: 11.16dvh; /* 104 / 932：按钮上移叠入图片 */
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 45% at 50% 28%, var(--bg-glow), transparent 70%),
    linear-gradient(180deg, #f8fbfc 0%, #eef3f6 100%);
}

.m-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* 短屏下顶栏下移一些 */
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px 0;
  flex-shrink: 0;
  z-index: 3;
}

.m-header .brand__logo {
  width: 28px;
  height: 32px;
  object-fit: contain;
}

.m-header .brand__name {
  font-size: 1.15rem;
}

.m-header .lang-trigger {
  gap: 4px;
  padding: 6px 12px;
  font-size: 0.9rem;
  color: #5c6578;
}

.m-header .lang-trigger__chevron {
  width: 14px;
  height: 14px;
  opacity: 0.6;
  color: var(--brand);
}

.m-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.m-copy {
  text-align: left;
  padding: 28px 20px 0;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  animation: rise-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.m-eyebrow {
  margin: 0 0 10px;
  color: #8b93a1;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
}

.m-copy h1,
.m-headline {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 5.8vw, 1.9rem);
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: left;
  color: #2a2f3a;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.m-headline span {
  display: block;
  white-space: nowrap;
}

/* 英文较长：略缩小字号，保证始终 3 行且中间行不折行 */
html[lang="en"] .m-eyebrow {
  font-size: clamp(0.78rem, 3.4vw, 0.95rem);
  white-space: nowrap;
}

html[lang="en"] .m-headline {
  font-size: clamp(1.05rem, 4.55vw, 1.55rem);
  letter-spacing: -0.01em;
}

.m-visual {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  /* 图片单独上移，按钮不动 → 按钮底与图片底更接近 */
  padding-bottom: 3.43dvh; /* ≈ 32 / 932 */
  position: relative;
  z-index: 1;
  overflow: hidden;
  animation: float-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.m-visual picture {
  display: block;
  width: 100%;
  max-width: 100%;
  line-height: 0;
}

.m-visual img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  /* 按宽度铺满，不 cover，避免超出屏幕 */
  object-fit: contain;
  object-position: center bottom;
}

/* 底部固定块：距屏幕底边按视口高度比例（对齐 14 Pro Max 观感） */
.m-bottom {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: var(--m-actions-footer-gap);
  margin-top: calc(-1 * var(--m-btn-up));
  padding: 0 20px calc(var(--m-bottom-gap) + env(safe-area-inset-bottom, 0px));
}

.m-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0;
}

.m-actions .btn {
  width: 100%;
  padding: 13px 12px;
  font-size: 0.92rem;
}

.m-footer {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 0;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

/* ===================== Modals ===================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(32, 36, 44, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: relative;
  width: min(640px, 92vw);
  height: min(78vh, 720px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(10px) scale(0.985);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.overlay.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #2a2f3a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  z-index: 2;
}

.modal__close:hover {
  background: #f2f4f7;
}

.modal__close svg {
  width: 18px;
  height: 18px;
}

.modal__head {
  flex-shrink: 0;
  padding: 28px 48px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.45;
  text-align: center;
  color: #2a2f3a;
}

.modal__body {
  flex: 1;
  min-height: 0;
  padding: 4px 36px 28px;
  overflow: auto;
  color: #3a4150;
  font-size: 0.92rem;
  line-height: 1.75;
}

.modal__body h3 {
  margin: 18px 0 8px;
  font-size: 0.98rem;
  font-weight: 700;
  color: #2a2f3a;
}

.modal__body h3:first-child {
  margin-top: 0;
}

.modal__body p {
  margin: 0 0 8px;
}

.modal__body ul {
  margin: 0 0 8px;
  padding-left: 1.2em;
}

.modal__body li {
  margin: 4px 0;
}

.modal__body strong {
  font-weight: 650;
  color: #2a2f3a;
}

.modal__foot {
  display: none;
  flex-shrink: 0;
  padding: 12px 20px 20px;
}

.modal__foot .btn {
  width: 100%;
}

/* thin scrollbar */
.modal__body::-webkit-scrollbar {
  width: 6px;
}

.modal__body::-webkit-scrollbar-thumb {
  background: #d0d5dd;
  border-radius: 999px;
}

.modal__body::-webkit-scrollbar-track {
  background: transparent;
}

/* Mobile legal：旧版居中卡片 + 底部确认 */
.overlay.is-mobile {
  padding: 24px 28px;
  background: rgba(18, 24, 38, 0.5);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.overlay.is-mobile .modal {
  width: min(340px, 86vw);
  height: auto;
  max-height: min(70vh, 560px);
  border-radius: 16px;
}

.overlay.is-mobile .modal__close {
  display: none;
}

.overlay.is-mobile .modal__head {
  padding: 22px 20px 10px;
  font-size: 1.05rem;
}

.overlay.is-mobile .modal__body {
  padding: 4px 20px 8px;
  font-size: 0.88rem;
  line-height: 1.7;
}

.overlay.is-mobile .modal__foot {
  display: block;
}

/* Mobile language：居中弹窗 */
.lang-overlay {
  position: fixed;
  inset: 0;
  background: rgba(18, 24, 38, 0.48);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lang-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lang-modal {
  position: relative;
  width: min(300px, 82vw);
  background: #fff;
  border-radius: 16px;
  padding: 22px 18px 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.lang-overlay.is-open .lang-modal {
  transform: translateY(0) scale(1);
}

.lang-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: #f2f4f7;
  border-radius: 999px;
  color: #5c6578;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-modal__close svg {
  width: 14px;
  height: 14px;
}

.lang-modal__title {
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  margin: 4px 0 18px;
  color: #2a2f3a;
}

.lang-modal__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lang-modal__list button {
  width: 100%;
  border: 1px solid transparent;
  background: #f2f4f7;
  text-align: center;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  color: #2a2f3a;
  font-size: 0.98rem;
  font-weight: 500;
}

.lang-modal__list button.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-dark);
  font-weight: 650;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@media (max-width: 1100px) {
  .layout-pc {
    --pc-pad-x: 40px;
  }

  .pc-copy {
    max-width: min(400px, 44vw);
  }

  .pc-visual {
    height: calc(100vh - 48px);
    max-width: calc(100% - var(--pc-pad-x) - min(400px, 44vw) - 32px);
  }
}
