:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #222327;
  --muted: #8b8d91;
  /* 主按钮与我方消息采用暖色渐变，统一为首页的粉→橙气氛 */
  --primary-1: #ff6b6b; /* coral */
  --primary-2: #ff8f1f; /* orange */
  /* 主视觉采用粉→橙的日落渐变 */
  --accent-1: #ff55c3; /* vivid pink */
  --accent-2: #ff6b6b; /* coral */
  --accent-3: #ff8f1f; /* orange */
  --glass: rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.22);
  --glass-hover: rgba(255,255,255,0.12);
  /* 统一的间距刻度（8px 基线） */
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
}

* { box-sizing: border-box; }
html { height: 100%; overflow-x: hidden; }
body.app { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji"; min-height: 100vh; min-height: 100dvh; overflow-x: hidden; touch-action: pan-y; overscroll-behavior: none; }
/* 强制隐藏带有 hidden 属性的元素，避免被其他 display 规则覆盖 */
[hidden] { display: none !important; }

.app-bar { position: sticky; top: 0; display: flex; flex-direction: column; gap: 6px; align-items: stretch; justify-content: center; padding: 12px 16px; color: #fff; background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3)); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.app-bar-row { display: flex; align-items: center; justify-content: space-between; }
.app-bar-note { font-size: 12px; line-height: 1.45; color: rgba(255,255,255,0.92); }
.app-title { font-weight: 600; }
/* 顶部右侧复制链接按钮在渐变背景上使用白色胶囊，提高可读性 */
.app-bar .ghost-btn.small {
  background: rgba(255,255,255,0.92);
  color: var(--text);
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.app-bar .ghost-btn.small:hover { background: #fff; }

.content { padding: 16px; }
.hero { min-height: 100vh; min-height: 100dvh; padding: 56px 16px 40px; text-align: center; color: #fff; overflow: hidden;
  background-image:
    radial-gradient(1200px 1200px at 70% 10%, rgba(255,255,255,0.18), rgba(255,255,255,0.05) 40%, transparent 60%),
    linear-gradient(120deg, var(--accent-1), var(--accent-2) 55%, var(--accent-3));
  display: flex; flex-direction: column; align-items: center; position: relative;
}
.hero-inner { width: 100%; max-width: 640px; }
.hero-title { font-size: 40px; line-height: 1.15; letter-spacing: 0; font-weight: 800; margin: 0 0 var(--space-2); text-shadow: 0 8px 30px rgba(0,0,0,0.2); }
.hero-sub { font-size: 18px; opacity: 0.98; margin: 0 0 var(--space-1); text-shadow: 0 2px 12px rgba(0,0,0,0.25); }
.hero-sub2 { font-size: 15px; opacity: 0.96; margin: 0 0 var(--space-4); line-height: 1.55; text-shadow: 0 2px 12px rgba(0,0,0,0.25); }
.hero-points { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: var(--space-2); margin: 0 0 var(--space-3); }
.hero-point { font-size: 16px; line-height: 1.55; opacity: 0.96; margin: 0; }
.features { display: flex; gap: var(--space-3); flex-wrap: wrap; justify-content: center; margin: var(--space-2) 0 var(--space-4); }
.feature-item { width: 180px; max-width: 48%; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; }
/* 新增图标容器样式以增强质感 */
.feature-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-border); display: grid; place-items: center; box-shadow: 0 12px 30px rgba(0,0,0,0.28); }
.feature-icon svg { width: 32px; height: 32px; color: #fff; }
.feature-title { font-weight: 600; }
.feature-desc { font-size: 12px; opacity: 0.9; }
.steps { display: grid; grid-template-columns: 1fr; gap: var(--space-2); justify-content: center; justify-items: start; text-align: left; margin: var(--space-2) 0 var(--space-4); position: relative; }
.steps::before { content: ""; display: block; grid-column: 1 / -1; height: 1px; background: linear-gradient(90deg, rgba(255,255,255,0.08), rgba(255,255,255,0.45), rgba(255,255,255,0.08)); margin-bottom: var(--space-2); }
.steps .feature-title { font-weight: 700; font-size: 16px; line-height: 1.5; white-space: pre; margin: 0; font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.steps .step-no { display: inline-block; min-width: 1.3em; font-weight: 800; letter-spacing: 0.02em; background-image: linear-gradient(135deg, var(--primary-1), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: white; }
@media (min-width: 600px) { .steps { grid-template-columns: 1fr 1fr; } }
.cta { width: 100%; max-width: 640px; border-radius: 22px; padding: 26px; border: 1px solid var(--glass-border); background: var(--glass); backdrop-filter: saturate(120%) blur(16px); box-shadow: 0 20px 60px rgba(0,0,0,0.28); margin: var(--space-4) auto 0; }
.hero-tip { color: #fff; opacity: 0.95; margin: 0 0 14px; font-size: 14px; text-shadow: 0 2px 12px rgba(0,0,0,0.25); }
/* 统一 CTA 内输入框与按钮的间距 */
.cta > .link-row { margin-bottom: 8px; }
.card { background: var(--card); border-radius: 16px; padding: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.tip { color: var(--muted); margin: 0 0 12px; }

.primary-btn { background: linear-gradient(135deg, var(--primary-1), var(--primary-2)); color: #fff; border: none; padding: 12px 16px; border-radius: 14px; font-weight: 700; box-shadow: 0 12px 26px rgba(255,107,107,0.35); }
.primary-btn.xl { padding: 18px 22px; font-size: 18px; border-radius: 18px; min-width: 260px; width: 100%; }
.secondary-btn { background: #f2f3f5; color: var(--text); border: none; padding: 10px 12px; border-radius: 10px; }
.ghost-btn { background: transparent; color: #fff; border: 1.2px solid rgba(255,255,255,0.75); padding: 10px 14px; border-radius: 12px; backdrop-filter: blur(4px); box-shadow: 0 6px 16px rgba(0,0,0,0.16) inset; }
.ghost-btn.small, .primary-btn.small { padding: 8px 12px; border-radius: 10px; font-size: 14px; }

.result { margin-top: 12px; }
.result { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.link-row { display: flex; gap: 8px; align-items: stretch; }
.link-row input { flex: 1; padding: 12px 14px; border-radius: 14px; border: 1.2px solid #e5e7eb; transition: all .2s ease; }
.hero .link-row input { background: rgba(255,255,255,0.18); color: #fff; border-color: rgba(255,255,255,0.50); box-shadow: 0 1px 4px rgba(0,0,0,0.10) inset; }
/* 复制按钮与输入框高度对齐，并采用克制的半透明白样式 */
.hero .link-row .secondary-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border-radius: 14px; background: rgba(255,255,255,0.92); color: var(--text); border: 1px solid rgba(255,255,255,0.72); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.hero .link-row .secondary-btn.small { padding: 6px 10px; border-radius: 10px; font-size: 13px; align-self: center; }
.hero .link-row input:focus { outline: none; border-color: #fda4af; box-shadow: 0 0 0 3px rgba(244,63,94,0.35); }
.hero .link-row input::placeholder { color: rgba(255,255,255,0.85); }

/* 管理员房间列表的左侧信息区：备注输入 + 元信息 */
.hero .room-left { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.hero .room-meta { font-size: 12px; color: rgba(255,255,255,0.9); text-align: left; }
.hero .room-meta code { background: rgba(255,255,255,0.18); color: #fff; padding: 0 4px; border-radius: 4px; }
.hero mark { background: rgba(255,255,255,0.18); color: #fff; border-radius: 4px; padding: 0 3px; }

/* 管理员房间列表的行使用居中对齐，避免按钮被拉伸到与输入框等高 */
.hero .room-row { align-items: center; gap: 6px; }

/* 针对“进入房间”按钮的重构样式，避免与输入框或容器边界重叠 */
#openBtn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1.4px solid rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  transition: all .2s ease;
}
#openBtn:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.9); }
#openBtn:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,0.25); }
#openBtn:active { transform: translateY(1px); }

.chat-content { height: calc(100vh - 120px); padding: 10px 12px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); overflow-y: auto; }
.messages { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.msg-item { width: 100%; padding: 12px 14px; background: #fff; color: var(--text); border: 1px solid #e9edf3; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
.msg-item.system { color: var(--muted); font-style: italic; background: #fff; border: 1px dashed #e5e7eb; }
.msg-meta { font-size: 12px; color: var(--muted); margin-top: 6px; text-align: right; }
.msg-media { max-width: 100%; border-radius: 10px; }
/* 日期分割线（Telegram风格） */
.msg-divider { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 12px; }
.msg-divider::before, .msg-divider::after { content: ""; flex: 1; height: 1px; background: #eef2f7; }
.msg-divider span { background: #f6f7fb; padding: 2px 8px; border-radius: 10px; border: 1px solid #eef2f7; }

.composer { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); padding: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: center; border-top: 1px solid #ebedf0; }
.text-input { flex: 1; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; background: #fff; }
.text-input:focus { outline: none; border-color: #fda4af; box-shadow: 0 0 0 2px rgba(244,63,94,0.25); }
.file-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: #f3f4f6; font-size: 18px; border: 1px solid #e5e7eb; }
.icon-svg { width: 20px; height: 20px; color: var(--text); }
.file-btn.disabled { opacity: 0.6; pointer-events: none; }
.primary-btn.small:disabled { opacity: 0.6; }

/* 发送按钮在输入区内的尺寸与权重优化 */
.composer .primary-btn.small { height: 40px; padding: 0 16px; border-radius: 10px; box-shadow: 0 8px 20px rgba(255,107,107,0.28); }

/* 额外的背景光晕层，提升“高级科技风”的层次 */
.hero::before {
  content: "";
  position: absolute;
  inset: -120px -180px -120px -180px;
  background: radial-gradient(520px 520px at 18% 82%, rgba(255,143,31,0.22), transparent 60%),
              radial-gradient(640px 640px at 86% 22%, rgba(255,85,195,0.24), transparent 60%);
  filter: blur(28px);
  z-index: 0;
}

.hero-inner, .cta, .features { position: relative; z-index: 1; }


@media (max-width: 480px) {
  .msg-item { padding: 10px 12px; }
  .hero-title { font-size: 32px; }
  .features { gap: 18px; }
  .feature-item { width: 46%; }
  .steps { gap: var(--space-2); }
}
