/* 全局变量集中定义颜色和间距，便于上线前微调品牌风格。 */
:root {
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --line: rgba(255, 255, 255, 0.22);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  --accent: #caffdf;
  --green: #22c55e;
  --red: #ef4444;
  --violet: #5865f2;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color: var(--ink);
  background: #07120d;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  overflow-x: hidden;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  letter-spacing: 0;
}

/* 手机端默认使用竖版背景，图片底部中央自带 FrameX logo。 */
body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("./pics/20260703-160912.jpg");
  background-position: center center;
  background-size: cover;
  content: "";
}

/* 只在上半区压暗一点点，保证按钮可读，同时不遮挡底部 logo。 */
body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.54) 0%, rgba(0, 0, 0, 0.22) 48%, transparent 76%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.26), transparent 62%);
  pointer-events: none;
  content: "";
}

/* 弹窗打开时锁住底层页面，避免手机上滑动穿透。 */
body.is-modal-open {
  overflow: hidden;
}

button,
input,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  display: flex;
  width: 100%;
  max-width: 560px;
  min-height: 100dvh;
  margin: 0;
  padding: max(22px, env(safe-area-inset-top)) 18px max(30dvh, env(safe-area-inset-bottom));
  align-items: flex-start;
}

.content-panel {
  width: 100%;
}

.page-toolbar {
  display: flex;
  min-height: 44px;
  margin-bottom: 10px;
  justify-content: flex-end;
}

.language-toggle {
  display: inline-flex;
  min-width: 82px;
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ink);
  background: rgba(7, 18, 13, 0.52);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  backdrop-filter: blur(16px);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.language-toggle:focus-visible {
  outline: 3px solid rgba(202, 255, 223, 0.34);
  outline-offset: 3px;
}

.language-toggle-option {
  opacity: 0.48;
  transition: opacity 160ms ease;
}

.language-toggle-option.is-active {
  color: var(--accent);
  opacity: 1;
}

.language-toggle-divider {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.28);
}

.hero {
  padding: 0 2px 14px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.38);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(29px, 8vw, 46px);
  line-height: 1.02;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.34);
}

.hero-copy {
  max-width: 23rem;
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.38);
}

html[lang="en"] .hero-copy {
  max-width: 40rem;
}

.entry-section {
  margin-top: 14px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.section-kicker {
  margin: 0;
}

.section-heading h2 {
  margin-left: auto;
  font-size: 15px;
  color: var(--muted);
  font-weight: 700;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.38);
}

.entry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.entry-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow);
  text-align: left;
  backdrop-filter: blur(18px);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.entry-card:active {
  transform: translateY(1px) scale(0.99);
}

.entry-card:focus-visible,
.modal-close:focus-visible {
  outline: 3px solid rgba(202, 255, 223, 0.34);
  outline-offset: 3px;
}

.entry-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: var(--radius);
  color: #ffffff;
  font-weight: 900;
  overflow: hidden;
  padding: 8px;
}

.entry-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.redbook .entry-icon {
  padding: 7px 5px;
  background: #ff2442;
}

.x .entry-icon {
  padding: 8px;
  background: #111827;
}

.wechat .entry-icon {
  padding: 7px;
  background: #1aad19;
}

.discord .entry-icon {
  padding: 7px;
  background: #5865f2;
}

.entry-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.entry-copy strong {
  overflow-wrap: anywhere;
  font-size: 17px;
}

.entry-copy small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.entry-arrow {
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
}

.browser-note {
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid rgba(202, 255, 223, 0.24);
  border-radius: var(--radius);
  color: #ecfdf5;
  background: rgba(5, 20, 13, 0.54);
  font-size: 13px;
  line-height: 1.5;
  backdrop-filter: blur(14px);
}

.modal[hidden],
.toast[hidden],
[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.42);
}

.modal-panel {
  position: relative;
  width: min(100%, 520px);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  color: #111827;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 999px;
  color: #111827;
  background: #ffffff;
  font-size: 24px;
  line-height: 1;
}

.modal-body {
  display: grid;
  gap: 14px;
  padding-top: 8px;
}

.modal-body h2 {
  padding-right: 42px;
  font-size: 22px;
}

.modal-body p {
  color: #4b5563;
  line-height: 1.6;
}

.modal-qr {
  width: min(100%, 280px);
  aspect-ratio: 1;
  margin: 4px auto 0;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: var(--radius);
  background: #ffffff;
}

.toast {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  left: 50%;
  z-index: 30;

  width: min(480px, calc(100vw - 32px));
  box-sizing: border-box;
  padding: 16px 20px;

  border: 1px solid rgba(209, 250, 229, 0.28);
  border-radius: 16px;

  color: #f4fff7;
  background:
    linear-gradient(
      135deg,
      rgba(55, 88, 61, 0.94),
      rgba(12, 39, 25, 0.96)
    );

  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);

  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;

  backdrop-filter: blur(18px);
  transform: translateX(-50%);
  animation: toast-enter 220ms ease-out;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 480px) {
  .toast {
    top: max(12px, env(safe-area-inset-top));
    width: calc(100vw - 24px);
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 15px;
  }
}

@media (min-width: 640px) {
  /* 电脑端切换横版背景，并把操作区放在左上，避开底部中央 logo。 */
  body::before {
    background-image: url("./pics/20260703-160936.jpg");
  }

  .page-shell {
    width: min(86vw, 900px);
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(28px, 5vh, 56px) 0 30dvh;
    justify-content: center;
  }

  .content-panel {
    width: 100%;
  }

  .entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .entry-card {
    min-height: 112px;
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .entry-arrow {
    grid-column: 2;
    justify-self: end;
  }

  .modal {
    place-items: center;
  }
}

@media (max-width: 639px) {
  /* 手机宽度有限，隐藏右侧分组说明，避免压缩或溢出按钮区域。 */
  .page-shell {
    justify-content: center;
  }

  .content-panel {
    width: 100%;
    max-width: 344px;
    margin: 0 auto;
  }

  .section-heading h2 {
    display: none;
  }
}

@media (max-height: 740px) {
  /* 小高度屏幕压缩控件，继续给底部 logo 留空间。 */
  .page-shell {
    padding-bottom: 24dvh;
  }

  .hero {
    padding-bottom: 10px;
  }

  .page-toolbar {
    margin-bottom: 4px;
  }

  .entry-section {
    margin-top: 10px;
  }

  .entry-card {
    min-height: 64px;
    padding: 10px 12px;
  }
}

@media (hover: hover) {
  .language-toggle:hover {
    border-color: rgba(202, 255, 223, 0.48);
    background: rgba(7, 18, 13, 0.68);
    transform: translateY(-1px);
  }

  .entry-card:hover {
    border-color: rgba(202, 255, 223, 0.4);
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-2px);
  }
}
