/* Airforce 邀请落地页 —— Genesis Black 视觉体系
   令牌与 airforce-app/lib/core/theme.dart（AF）同源：
   黑与暖白承重，金色是唯一强调色（每屏一个金箔主操作），hairline 线统一为金 20%，无其他色相。
   版式：居中单轴，邀请码卡片与按钮组同宽对位；状态信息收编为紧凑状态条。 */
@font-face {
  font-family: 'Inter Tight';
  src: url('/assets/fonts/InterTight-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
:root {
  /* ground */
  --bg: #050505;
  --bg1: #0b0b0c;
  --surface: #1b1b1d;
  /* 统一的 hairline：金 20% 与白 8/14% */
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.14);
  --gold-line: rgba(214, 169, 84, 0.2);
  /* text */
  --text: #f3f0e8;
  --lead: #c9c5bc;
  --muted: #8e8a82;
  --dim: #5d5a55;
  /* accent：金 */
  --gold: #d6a954;
  --gold-hi: #f6e1a4;
  --gold-ink: #1a1206;
  --err: #ff7a70;
  /* 金箔渐变（115°，与 app 同 stops） */
  --foil: linear-gradient(
    115deg,
    #f8e7b0 0%,
    #d6a954 30%,
    #a8792c 52%,
    #f0cf82 76%,
    #b88838 100%
  );
  --radius: 18px;
  --radius-lg: 26px;
  --radius-sm: 12px;
  /* 对位宽度：邀请码卡片与按钮组共用 */
  --column: min(464px, 100%);
}
* {
  box-sizing: border-box;
}
/* 守卫：组件自带的 display 不能击穿 hidden 属性 */
[hidden] {
  display: none !important;
}
html {
  height: 100%;
}
body {
  margin: 0;
  min-width: 320px;
  height: 100dvh;
  overflow: hidden; /* 全屏单屏布局：不滚动，内容随视口收缩 */
  font-family: 'Inter Tight', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.page {
  height: 100dvh;
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(16px, 2.8vh, 30px) clamp(20px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
/* 背景「打光」：标题后的金色光晕 + 左下暖光，取代平涂黑 */
.page::before {
  content: '';
  position: absolute;
  top: -14%;
  left: 50%;
  width: min(900px, 130vw);
  height: 62%;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    rgba(214, 169, 84, 0.085) 0%,
    rgba(214, 169, 84, 0.03) 42%,
    transparent 70%
  );
  pointer-events: none;
}
.page::after {
  content: '';
  position: absolute;
  bottom: -22%;
  left: -16%;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 169, 84, 0.05) 0%, transparent 60%);
  pointer-events: none;
}
/* app 同源噪点纹理：消除平涂感 */
.grain {
  position: absolute;
  inset: 0;
  background: url('/assets/images/grain.png') repeat;
  background-size: 190px;
  opacity: 0.045;
  pointer-events: none;
  z-index: 1;
}

.brand-row {
  position: relative;
  z-index: 3;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand .wordmark {
  height: 16px;
}
.brand span {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 12px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
}

/* 居中排版式 Hero：内容居中，金箔 Mark 水印衬底（放大出血到画布边缘） */
.hero {
  flex: 1;
  min-height: 0; /* 允许在锁定视口内收缩 */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}
.hero-watermark {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(150vw, 96vh, 860px);
  transform: translate(-50%, -50%);
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}
.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

/* eyebrow：金色小标（AFText.eyebrow，caps 必须 ≥0.06em tracking） */
.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.eyebrow i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}
h1 {
  font-size: clamp(34px, min(5vw, 7.6vh), 68px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: clamp(14px, 2.6vh, 24px) 0 0;
  color: var(--text);
}
/* 品牌名上金箔（同 app Wordmark tone=gold） */
h1 em {
  font-style: normal;
  background: var(--foil);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subline {
  color: var(--lead);
  font-size: clamp(14px, 1.5vw, 17px);
  line-height: 1.75;
  margin: clamp(12px, 2.2vh, 20px) 0 0;
  max-width: 30ch;
}

/* 邀请码卡片：页面功能主角，与按钮组同宽对位 */
.code-card {
  margin-top: clamp(20px, 3.4vh, 34px);
  width: var(--column);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  padding: 15px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 22px 60px rgba(0, 0, 0, 0.5);
}
.code-card .code-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
/* 邀请码按“读作代码的数字”呈现（app 用 JetBrains Mono，web 以系统 mono 代） */
.code-card code {
  font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text);
}
.copy-button {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold);
  background: transparent;
  border: 1px solid rgba(214, 169, 84, 0.45);
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.copy-button:hover {
  background: rgba(214, 169, 84, 0.1);
  border-color: var(--gold);
}

/* 状态区：紧凑状态条（图标 + 文案 + 内联重试），避免与按钮组抢层级 */
.state {
  margin-top: clamp(18px, 3vh, 30px);
  width: var(--column);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.status-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 22px;
}
.status-icon {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--err);
}
.state-text {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0;
}
#state-error .state-text {
  color: var(--err);
}
.text-link {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold);
  background: transparent;
  border: none;
  padding: 6px 8px;
  min-height: 24px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(214, 169, 84, 0.4);
}
.text-link:hover {
  text-decoration-color: var(--gold);
}

/* 下载按钮组：与邀请码卡片同宽对位，两列等宽（移动端单列） */
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: var(--column);
  margin-top: clamp(16px, 2.6vh, 26px);
}
#state-error .actions {
  margin-top: 14px;
}
#state-ok .actions + .fineprint {
  margin-top: 14px;
}

/* 一个金箔主操作 + hairline 次操作（Genesis Black 规则） */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: clamp(46px, 5.6vh, 54px);
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease,
    border-color 0.15s ease;
}
.button:active {
  transform: translateY(1px);
}
.button.primary {
  background: var(--foil);
  color: var(--gold-ink);
  box-shadow: 0 10px 30px rgba(214, 169, 84, 0.16);
}
.button.primary:hover {
  filter: brightness(1.06);
}
.button.secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line2);
  color: var(--text);
}
.button.secondary:hover {
  background: rgba(255, 255, 255, 0.07);
}
.button.ghost {
  background: transparent;
  border-color: var(--line2);
  color: var(--muted);
  min-height: 40px;
  font-size: 13px;
  font-weight: 500;
}
.button.ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.24);
}
.button .store-glyph {
  width: 20px;
  height: 20px;
  flex: none;
}
.button .store-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.3;
}
.button .store-copy small {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.66;
  letter-spacing: 0.02em;
}

.fineprint {
  color: var(--dim);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin: 0;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line2);
  border-top-color: var(--gold);
  animation: spin 0.8s linear infinite;
  flex: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* 动效尊重减少偏好：停循环动画，保持状态可读 */
@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2.4s;
  }
  .button,
  .af-card,
  .copy-button {
    transition: none;
  }
}

@media (max-width: 860px) {
  .hero-watermark {
    width: min(160vw, 92vh, 640px);
    top: 46%;
  }
  .actions {
    grid-template-columns: 1fr;
  }
  .code-card {
    padding: 13px 14px;
  }
}

/* 矮视口（横屏/小窗）：压缩标题与水印 */
@media (min-width: 861px) and (max-height: 720px) {
  h1 {
    font-size: clamp(30px, min(4.6vw, 7vh), 48px);
  }
  .hero-watermark {
    width: min(130vw, 80vh, 640px);
  }
}
