/* ==========================================================================
   禁果短剧 · 分享落地页样式（纯静态，无外部依赖）
   主题：深色底 + 主色 #F03078（玫红） + VIP 金 #F0C078
   移动端优先，桌面端居中约束在 480px 阅读宽度内
   ========================================================================== */

:root {
  --primary: #f03078;
  --primary-strong: #ff4d8d;
  --primary-soft: rgba(240, 48, 120, 0.16);
  --gold: #f0c078;
  --gold-soft: rgba(240, 192, 120, 0.16);

  --bg: #0b0b12;
  --bg-glow-a: rgba(240, 48, 120, 0.22);
  --bg-glow-b: rgba(90, 120, 255, 0.14);
  --surface: #16161f;
  --surface-2: #1d1d2a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);

  --text: #f4f4f8;
  --text-dim: #b6b8c6;
  --text-mute: #7b7d8f;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow-card: 0 18px 44px rgba(0, 0, 0, 0.45);
  --shadow-primary: 0 12px 28px rgba(240, 48, 120, 0.38);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 18% -8%, var(--bg-glow-a), transparent 46%),
    radial-gradient(circle at 92% 4%, var(--bg-glow-b), transparent 42%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding: calc(20px + var(--safe-top)) 0 calc(28px + var(--safe-bottom));
}

.page {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- 品牌 ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  box-shadow: var(--shadow-primary);
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* ---------- 邀请信息 ---------- */
.invite {
  padding: 6px 0 2px;
}

.invite-kicker {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.24em;
  color: var(--primary-strong);
  text-transform: uppercase;
}

.invite-headline {
  margin: 0;
  font-size: clamp(22px, 6.4vw, 28px);
  line-height: 1.32;
  font-weight: 800;
  word-break: break-word;
}

/* ---------- 剧卡片 ---------- */
.drama-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.drama-card[hidden] {
  display: none;
}

.drama-cover {
  position: relative;
  flex: 0 0 96px;
  width: 96px;
  height: 128px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(150deg, #2a2a3c, #16161f);
  display: flex;
  align-items: center;
  justify-content: center;
}

.drama-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.drama-cover img.is-loaded {
  display: block;
}

.cover-fallback {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  text-align: center;
  padding: 0 6px;
}

.drama-cover.has-image .cover-fallback {
  display: none;
}

.drama-body {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drama-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.drama-intro {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.drama-intro[hidden] {
  display: none;
}

.drama-meta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.chip[hidden] {
  display: none;
}

.chip-gold {
  color: var(--gold);
  background: var(--gold-soft);
  border-color: rgba(240, 192, 120, 0.34);
}

/* ---------- 邀请码 ---------- */
.code-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(160deg, var(--primary-soft), transparent 62%),
    var(--surface);
}

.code-card[hidden] {
  display: none;
}

.code-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.code-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.code-text {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(240, 48, 120, 0.5);
  background: rgba(0, 0, 0, 0.32);
  color: var(--gold);
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  overflow-wrap: anywhere;
}

.copy-btn {
  flex: 0 0 auto;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.copy-btn:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.16);
}

.copy-btn.is-ok {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
}

.code-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-mute);
}

/* ---------- 操作按钮 ---------- */
.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 2px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.98);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  box-shadow: var(--shadow-primary);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
}

.btn-gold {
  color: #2a1c06;
  background: linear-gradient(135deg, #ffd79a, var(--gold));
  box-shadow: 0 12px 28px rgba(240, 192, 120, 0.32);
}

.btn.is-busy .btn-label::after {
  content: "…";
}

.actions-hint {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-mute);
}

/* ---------- 页脚 ---------- */
.footer {
  margin-top: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
}

.footer-links a:active {
  color: var(--primary-strong);
}

.dot {
  color: var(--text-mute);
}

.copyright {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-mute);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + var(--safe-bottom));
  transform: translate(-50%, 12px);
  max-width: 82vw;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(20, 20, 30, 0.94);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 14px;
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.toast[hidden] {
  display: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 提示条（微信内引导） ---------- */
.wechat-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--gold-soft);
  border: 1px solid rgba(240, 192, 120, 0.34);
  color: var(--gold);
  font-size: 13px;
  line-height: 1.45;
}

.wechat-tip[hidden] {
  display: none;
}

.wechat-tip .arrow {
  flex: 0 0 auto;
  font-size: 16px;
}

/* ---------- 下载引导页附加 ---------- */
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}

.qr-slot {
  width: 168px;
  height: 168px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-mute);
  font-size: 12px;
  line-height: 1.5;
  padding: 12px;
}

.qr-caption {
  font-size: 12px;
  color: var(--text-mute);
  margin: 0;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

.steps .step-no {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
}

.ios-note {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ---------- 大屏微调 ---------- */
@media (min-width: 520px) {
  body {
    padding-top: calc(40px + var(--safe-top));
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
