/* ==========================================================================
   驼奶直播 H5 观众端 公共样式
   品牌定位：高端、温暖、有信任感（中老年友好）
   ========================================================================== */

:root {
  /* 品牌色 */
  --brand: #C8A472;
  --brand-2: #A8845C;
  --brand-dark: #4A3728;
  --gold: #D4AF37;
  --gold-2: #B8932E;

  /* 背景与表面 */
  --bg-cream: #FAF7F2;
  --bg-warm: #F3EBDD;
  --bg-dark: #1F1610;
  --bg-dark-2: #2C1F14;
  --surface: #FFFFFF;

  /* 文字 */
  --text-1: #2C1F14;
  --text-2: #6B5B4B;
  --text-3: #9A8A78;
  --text-on-dark: #F5EDDD;

  /* 功能色 */
  --accent: #2D5F4F;
  --accent-2: #4A8B72;
  --warn: #C0392B;
  --info: #6B7B8E;
  --live-red: #E74C3C;

  /* 线条 */
  --line: #E8DFD0;
  --line-2: #D7C9B0;

  /* 阴影（暖色调） */
  --shadow-sm: 0 4px 12px -4px rgba(74, 55, 40, 0.12);
  --shadow-md: 0 12px 32px -12px rgba(74, 55, 40, 0.18);
  --shadow-lg: 0 24px 64px -16px rgba(74, 55, 40, 0.25);
  --shadow-gold: 0 8px 24px -8px rgba(212, 175, 55, 0.45);

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 999px;

  /* 字体 */
  --font-serif: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', serif;
  --font-sans: 'Noto Sans SC', 'PingFang SC', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font-num: 'DIN Alternate', 'Bebas Neue', 'PingFang SC', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--text-1);
  background: var(--bg-cream);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  min-height: 100vh;
  overscroll-behavior-y: contain;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; outline: none; border: none; }

/* ===== 字体类 ===== */
.font-serif { font-family: var(--font-serif); letter-spacing: 0.02em; }
.font-num { font-family: var(--font-num); font-feature-settings: 'tnum'; letter-spacing: 0.02em; }

/* ===== 移动端容器：居中、最大 480 ===== */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-cream);
  position: relative;
  overflow-x: hidden;
}

/* ===== 主按钮 ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  padding: 0 28px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #FFF7E8;
  background: linear-gradient(135deg, #C8A472 0%, #A8845C 100%);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px -8px rgba(168, 132, 92, 0.6),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:active { transform: translateY(1px); }
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: calc(var(--r-md) - 1px);
  background: linear-gradient(180deg, rgba(255,255,255,.18), transparent 40%);
  pointer-events: none;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 500;
  color: var(--brand-dark);
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: #2C1F14;
  background: linear-gradient(135deg, #E2C36F 0%, #B8932E 100%);
  border-radius: var(--r-full);
  box-shadow: var(--shadow-gold);
}

/* ===== 卡片 ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

/* ===== 标签徽章 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--r-full);
  letter-spacing: 0.05em;
}
.badge-live {
  background: var(--live-red);
  color: white;
}
.badge-live::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: white;
  animation: pulse 1.6s ease-in-out infinite;
}
.badge-soon {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-2);
  border: 1px solid var(--gold);
}
.badge-end {
  background: #EDE5D6;
  color: var(--text-2);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.7); }
}

/* ===== 弹幕 ===== */
.danmaku-track {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.danmaku-item {
  position: absolute;
  white-space: nowrap;
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FFF;
  font-size: 13px;
  border-radius: var(--r-full);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
  animation: dmRoll linear forwards;
}
.danmaku-item.is-gold {
  background: linear-gradient(135deg, rgba(212,175,55,.95), rgba(184,147,46,.95));
  color: #2C1F14;
  font-weight: 600;
  border-color: rgba(255,255,255,.4);
}
.danmaku-item.is-self {
  background: linear-gradient(135deg, rgba(166, 90, 50, .92), rgba(120, 60, 30, .92));
  color: #FFF8E7;
  border-color: rgba(255, 215, 130, .55);
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
}
@keyframes dmRoll {
  from { transform: translateX(110%); }
  to   { transform: translateX(-110%); }
}

/* ===== Hero / 品牌区 ===== */
.brand-hero {
  position: relative;
  height: 560px;
  background-image:
    linear-gradient(180deg, rgba(28,18,10,.15) 0%, rgba(28,18,10,.65) 65%, var(--bg-cream) 100%),
    url('https://images.unsplash.com/photo-1564507004663-b6dfb3c824d5?auto=format&fit=crop&w=900&q=80');
  background-size: cover;
  background-position: center;
}
.brand-hero .gold-line {
  width: 56px; height: 1px;
  background: var(--gold);
  margin: 16px 0;
}

/* ===== 信任徽章组 ===== */
.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  text-align: center;
}
.trust-row .ti {
  padding: 14px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.trust-row .ti .v {
  font-family: var(--font-num);
  font-size: 22px;
  color: var(--brand-dark);
  font-weight: 700;
}
.trust-row .ti .l {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 2px;
}

/* ===== 安全区适配 ===== */
.safe-bottom { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }

/* ===== 通用工具 ===== */
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-brand { color: var(--brand-dark); }
.text-gold { color: var(--gold-2); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  background: rgba(28, 18, 10, .92);
  color: #FFE9C4;
  border-radius: var(--r-full);
  font-size: 13px;
  z-index: 9999;
  box-shadow: var(--shadow-md);
  animation: toastIn .3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== 分割线带文字 ===== */
.divider-text {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-3); font-size: 12px; letter-spacing: .2em;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

/* ===== 底部 logo ===== */
.brand-footer {
  text-align: center;
  padding: 28px 0;
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: .15em;
}

/* ===== 视频壳 ===== */
.video-shell {
  position: relative;
  width: 100%;
  background: #000;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.video-shell video, .video-shell .placeholder {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.video-shell .placeholder {
  background-image:
    linear-gradient(135deg, rgba(0,0,0,.55), rgba(0,0,0,.2)),
    url('https://images.unsplash.com/photo-1546484959-f9a381d1330d?auto=format&fit=crop&w=900&q=80');
  background-size: cover;
  background-position: center;
}

/* ===== 顶部状态栏（直播间）===== */
.live-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(0,0,0,.55), transparent);
  z-index: 5;
  color: #fff;
}
.live-topbar .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--gold);
  background: #ddd;
  background-size: cover;
}

/* ===== 圆形指标 ===== */
.kpi-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  border-radius: var(--r-full);
  color: #fff; font-size: 12px;
}
