/* ============================================================
   自由鸟 UI — MiChat 设计风格（清爽冷蓝 · 卡片风）
   核心口诀：淡蓝白底 #F6FAFF + 纯白大圆角卡片 + 靛蓝 #3651FA 主色
   + 蓝灰 #8A94A6 辅助文字 + 胶囊选中态；0.5px 细边框分层，不用重阴影
   ============================================================ */

:root {
  /* 背景与卡片 */
  --bg: #F6FAFF;            /* 页面背景：带蓝味的白 */
  --card: #FFFFFF;          /* 卡片纯白 */
  --line: #EEF3FF;          /* 卡片极细边框 */
  --line-2: #E8EEF8;        /* 未选中 pill / 输入框边框 */
  --panel-soft: #F4F7FC;    /* 未选中 pill 底 */
  --panel-gray: #F0F3F8;    /* 浅灰次要区块 */
  --sel: #EAF1FE;           /* 选中项底色 */

  /* 文字 */
  --text: #111827;          /* 标题 / 主文字 */
  --text-2: #313131;        /* 气泡文字 */
  --muted: #8A94A6;         /* 次要文字（蓝灰，风格标志色） */
  --weak: #7A8290;          /* 弱化文字 */

  /* 品牌蓝三层次 */
  --brand: #3651FA;         /* 靛蓝主色：CTA、Logo */
  --brand-hover: #2E46E0;
  --blue: #2F80ED;          /* 功能蓝：链接、已读、进度条 */
  --grad: linear-gradient(90deg, #2F7DFF, #1E63F5); /* 选中渐变 */

  /* 气泡 */
  --mine: #DCEBFF;          /* 我方淡蓝 */
  --mine-sel: #C8DCFF;
  --theirs: #FFFFFF;        /* 对方纯白 */

  /* 警示 */
  --danger: #FF5353;
  --danger-dim: #F7A5A5;

  /* 遮罩 */
  --mask: rgba(0, 0, 0, .5);

  --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 扁平淡蓝几何插画：大淡圆 + 气泡圆 + 圆点阵（不进聊天页） */
body:not(.room)::before {
  content: "";
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle 240px at 88% -60px, #E6F3FF 99%, transparent 100%),
    radial-gradient(circle 150px at -40px 42%, #E6F3FF 99%, transparent 100%),
    radial-gradient(circle 60px at 12% 12%, #D8EDFF 99%, transparent 100%);
}
body:not(.room)::after {
  content: "";
  position: fixed; z-index: 0;
  top: 68px; right: 7%;
  width: 88px; height: 52px;
  pointer-events: none;
  background: radial-gradient(#B6D8F2 2px, transparent 2.6px);
  background-size: 18px 18px;
}
.home, .landing, .lan-wrap { position: relative; z-index: 1; }

/* ============================ 落地页 ============================ */

.landing {
  max-width: 440px;
  margin: 0 auto;
  padding: 96px 24px 64px;
  text-align: center;
}

/* 首页：单屏多卡布局 */
.home {
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 24px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.home-head { text-align: center; margin-bottom: 28px; }
.home-head .mark { margin: 0 auto 14px; }
.home-head h1 { font-size: 28px; margin: 0 0 6px; font-weight: 700; letter-spacing: 4px; color: var(--text); }

.cards { display: flex; gap: 16px; align-items: stretch; }
.card {
  flex: 1 1 0;
  min-width: 0;
  padding: 26px 22px;
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.card h2 { font-size: 17px; margin: 0 0 12px; font-weight: 600; color: var(--text); }
.card .desc { font-size: 13px; line-height: 1.7; margin: 0 0 18px; }
.card .primary { margin-top: 0; }
.card-hint { color: var(--muted); font-size: 12px; margin: 14px 0 0; }
a.primary { display: inline-block; text-decoration: none; }
.card a.primary { width: auto; }
.lan-card .desc { flex: 1; }

/* 二维码卡片：标签 pill（选中蓝渐变白字，未选中蓝灰） */
.qr-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.qr-tab {
  padding: 6px 18px; border-radius: 10px; border: 0.5px solid var(--line-2);
  background: var(--panel-soft); color: var(--muted); font-size: 13px; cursor: pointer; font-family: inherit;
}
.qr-tab.active { background: var(--grad); border-color: transparent; color: #fff; }
.qr-input {
  width: 100%; padding: 11px 12px; margin-bottom: 14px;
  border-radius: 8px; border: 0.5px solid var(--line-2);
  background: var(--card); color: var(--text); font-size: 14px; font-family: inherit;
}
.qr-input::placeholder { color: var(--muted); }
.qr-input:focus { outline: none; border-color: var(--brand); }
.qr-result { margin-top: 18px; }
.qr-result img {
  width: 180px; height: 180px; display: block; margin: 0 auto 12px;
  background: #fff; padding: 10px; border-radius: 12px;
  border: 0.5px solid var(--line);
}

@media (max-width: 900px) {
  .cards { flex-wrap: wrap; }
  .card { flex: 1 1 260px; }
}
@media (max-width: 760px) {
  .home { padding: 32px 18px; min-height: 0; justify-content: flex-start; }
  .cards { flex-direction: column; }
}

/* Logo：靛蓝圆角方块 */
.mark {
  width: 40px;
  height: 40px;
  margin: 0 auto 22px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2F7DFF, #1E63F5);
}

.landing h1 {
  font-size: 30px;
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--text);
}
.tagline {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 2px;
  margin: 0 0 30px;
}

.desc {
  color: var(--muted);
  line-height: 1.9;
  font-size: 14px;
  margin: 0 auto;
  max-width: 380px;
}
.desc strong { color: var(--text); font-weight: 600; }

/* 主按钮：靛蓝实底 + 白字 + 14px 圆角 */
.primary {
  margin-top: 32px;
  padding: 13px 36px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: background .18s;
}
.primary:hover { background: var(--brand-hover); }
.primary:active { background: #2A3FD0; }
.primary:disabled { background: #AAB6F8; cursor: default; }

.once-pick {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.once-pick input { width: 15px; height: 15px; accent-color: var(--brand); }

.result { margin-top: 28px; }
.hint { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.linkbox { display: flex; gap: 8px; }
.linkbox input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 8px;
  border: 0.5px solid var(--line-2);
  background: var(--panel-soft);
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.linkbox button {
  padding: 0 18px;
  border: 0.5px solid var(--line-2);
  border-radius: 8px;
  background: var(--card);
  color: var(--brand);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.linkbox button:hover { border-color: var(--brand); }
.enter {
  display: inline-block;
  margin-top: 16px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.notes {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 0.5px solid var(--line-2);
}
.note {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
  margin: 0 0 6px;
}
.hidden { display: none !important; }

/* 语言选择器 */
.lang-btn {
  position: fixed; top: 12px; right: 14px; z-index: 80;
  display: flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: 999px;
  border: 0.5px solid var(--line-2); background: rgba(255,255,255,.85);
  color: var(--muted); font-size: 12.5px; font-family: inherit; cursor: pointer;
  backdrop-filter: blur(6px);
}
.lang-btn:hover { color: var(--brand); border-color: var(--brand); }
[dir="rtl"] .lang-btn { right: auto; left: 14px; }
body.room .lang-btn { display: none; } /* 聊天页顶栏已满，语言在首页选择并记住 */
.lang-overlay {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  background: var(--mask); backdrop-filter: blur(4px);
  padding: 20px;
}
.lang-card {
  width: min(96%, 640px); max-height: 86vh; overflow-y: auto;
  padding: 24px; background: var(--card);
  border: 0.5px solid var(--line); border-radius: 16px;
}
.lang-card h2 { margin: 0 0 18px; font-size: 18px; text-align: center; font-weight: 600; color: var(--text); }
.lang-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lang-opt {
  padding: 12px 8px; border-radius: 12px;
  border: 0.5px solid transparent; background: transparent;
  color: var(--text); font-size: 14px; font-family: inherit; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lang-opt:hover { background: var(--panel-soft); }
.lang-opt.active { background: var(--sel); border-color: transparent; color: var(--brand); font-weight: 600; }
@media (max-width: 520px) { .lang-grid { grid-template-columns: repeat(2, 1fr); } }

/* 分隔线 */
.divider { display: flex; align-items: center; gap: 12px; margin: 40px 0 24px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 0.5px; background: var(--line-2); }

/* 文件快传（首页） */
.share-section { text-align: center; }
.file-drop {
  display: block;
  margin: 18px 0 14px;
  padding: 26px 16px;
  border: 1px dashed #C9D8F0;
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.file-drop:hover { border-color: var(--brand); color: var(--text); }
.share-opts { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.share-opts label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.share-opts select {
  background: var(--card); color: var(--text); border: 0.5px solid var(--line-2);
  border-radius: 8px; padding: 6px 8px; font-size: 13px; font-family: inherit;
}
.share-progress { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.share-progress .bar { flex: 1; height: 8px; background: var(--panel-gray); border-radius: 5px; overflow: hidden; }
.share-progress .bar > div { height: 100%; width: 0; background: var(--blue); transition: width .15s; }
.share-progress span { color: var(--muted); font-size: 12px; min-width: 36px; font-variant-numeric: tabular-nums; }

/* 局域网/配对码直传页 */
.lan-wrap { max-width: 460px; margin: 0 auto; padding: 44px 20px 64px; text-align: center; }
.lan-pair {
  margin-top: 8px;
  padding: 24px 22px;
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 16px;
}
.lan-code-box { margin-bottom: 16px; }
.lan-code-label { color: var(--muted); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; }
.lan-code { font-size: 44px; font-weight: 700; letter-spacing: 8px; color: var(--brand); font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.lan-countdown { color: var(--muted); font-size: 12px; font-family: ui-monospace, monospace; margin-top: 2px; }
.lan-qr { width: 150px; height: 150px; margin: 16px auto 8px; display: block; background: #fff; padding: 8px; border-radius: 12px; border: 0.5px solid var(--line); }
.lan-join { display: flex; gap: 8px; margin: 16px 0 10px; }
.lan-join input {
  flex: 1; min-width: 0; padding: 11px 12px; border-radius: 8px;
  border: 0.5px solid var(--line-2); background: var(--card); color: var(--text); font-size: 16px;
}
.lan-join input::placeholder { color: var(--muted); }
.lan-join input:focus { outline: none; border-color: var(--brand); }
.lan-join .primary { margin: 0; padding: 11px 18px; }
.lan-wait { color: var(--muted); font-size: 13px; margin-top: 8px; }
.lan-connected {
  margin-top: 12px;
  padding: 22px;
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 16px;
}
.lan-peer-on { font-size: 15px; margin: 0 0 16px; color: var(--text); }
.lan-mode { color: var(--blue); font-size: 12px; }
.lan-send-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lan-send-btns .primary { margin: 0; }
.lan-transfers { margin: 26px auto 0; max-width: 460px; display: flex; flex-direction: column; gap: 10px; }
.lan-tx { padding: 12px 14px; border: 0.5px solid var(--line); border-radius: 12px; background: var(--card); text-align: left; }
.lan-tx-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 7px; }
.lan-tx-name { word-break: break-all; color: var(--text); }
.lan-tx-size { color: var(--muted); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.lan-tx .file-link { display: inline-block; margin-top: 8px; color: var(--blue); }

/* 文件下载页 */
.share-box { margin-top: 20px; }
.share-file { padding: 20px; background: var(--card); border: 0.5px solid var(--line); border-radius: 14px; margin-bottom: 18px; }
.share-file b { font-size: 16px; word-break: break-all; color: var(--text); }
.share-meta { color: var(--muted); font-size: 13px; margin-top: 8px; }
.share-warn { color: var(--muted); font-size: 12px; margin-top: 14px; }
.share-dead { color: var(--danger); padding: 24px; }
.back { margin-top: 24px; }
.back a { color: var(--muted); text-decoration: none; font-size: 13px; }
.back a:hover { color: var(--blue); }

/* 视觉隐藏但仍在渲染树中：iOS 允许对其编程式 .click()（display:none 会被拦截）。 */
.vh {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ============================ 聊天室 ============================ */

body.room {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* 移动端动态视口：键盘/工具栏弹出时布局不破 */
}

/* 口令门：欢迎页式淡蓝渐变（下深上浅）+ 特大圆角白卡 */
.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ECF5FF 0%, #E0EFFF 55%, #D2E6FF 100%);
}
.gate::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle 190px at 85% 8%, #E6F3FF 99%, transparent 100%),
    radial-gradient(circle 70px at 10% 22%, #D8EDFF 99%, transparent 100%),
    radial-gradient(#B6D8F2 2px, transparent 2.6px) 12% 72% / 18px 18px no-repeat;
  background-size: auto, auto, 90px 54px;
}
.gate-card {
  position: relative;
  width: min(92%, 380px);
  padding: 32px 26px;
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 28px;
  text-align: center;
}
.gate-card h2 { margin: 0 0 12px; font-size: 19px; font-weight: 600; letter-spacing: 1px; color: var(--text); }
.gate-msg { color: var(--muted); font-size: 13.5px; line-height: 1.7; margin: 0 0 20px; }
.gate-msg.error { color: var(--danger); }
.gate-msg strong { color: var(--text); }
.gate-card input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 8px;
  border: 0.5px solid var(--line-2);
  background: var(--panel-soft);
  color: var(--text);
  font-size: 16px; /* ≥16px：避免 iOS 聚焦时自动放大 */
}
.gate-card input::placeholder { color: var(--muted); }
.gate-card input:focus { outline: none; border-color: var(--brand); background: var(--card); }
.gate-card .primary { width: 100%; margin: 0; }
.gate-hint { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 16px 0 0; }

/* 顶栏：白底 + 细分割线 */
.topbar {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 18px;
  background: var(--card);
  border-bottom: 0.5px solid var(--line);
  flex: 0 0 auto;
}
.brand { font-weight: 700; letter-spacing: 1px; color: var(--text); }
.peers { color: var(--blue); font-size: 12.5px; }
.status { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.status.error { color: var(--danger); }

.leave {
  font-size: 12.5px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 0.5px solid var(--line-2);
  background: var(--panel-soft);
  color: var(--muted);
  font-family: inherit;
  cursor: pointer;
}
.leave:hover { color: var(--danger); border-color: var(--danger-dim); background: var(--card); }

.left-note { margin: auto; text-align: center; color: var(--muted); line-height: 1.8; }

/* 拖拽文件覆盖层 */
.drop-overlay {
  position: fixed; inset: 14px; z-index: 45;
  display: grid; place-items: center;
  border: 2px dashed var(--brand);
  border-radius: 16px;
  background: rgba(54, 81, 250, .06);
  backdrop-filter: blur(2px);
  color: var(--brand); font-size: 18px; font-weight: 600;
  pointer-events: none;
}

/* 离开确认弹窗：50% 黑遮罩 + 白卡 */
.modal {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: var(--mask); backdrop-filter: blur(3px);
}
.modal-card {
  width: min(92%, 380px);
  padding: 24px;
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 16px;
  text-align: center;
}
.modal-card h3 { margin: 0 0 12px; font-size: 18px; color: var(--text); }
.modal-card p { color: var(--muted); line-height: 1.7; font-size: 14px; margin: 0 0 20px; }
.modal-sub { font-size: 12.5px; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.modal-actions button { padding: 12px; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; border: 0.5px solid var(--line-2); }
.btn-danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn-danger:hover { background: #F04343; }
.btn-danger:disabled { background: var(--danger-dim); }
.btn-ghost { background: var(--card); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-text { background: transparent; border: none; color: var(--muted); font-weight: 400; }

.fs-badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 0.5px solid var(--line-2);
  color: var(--muted);
}
.fs-badge.strong { background: var(--sel); border-color: transparent; color: var(--blue); }

.safety {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  border: 0.5px solid var(--line-2);
  background: var(--panel-soft);
  color: var(--muted);
  font-family: inherit;
  cursor: pointer;
}
.safety:hover { color: var(--brand); border-color: var(--brand); background: var(--card); }

.safety-bar {
  flex: 0 0 auto;
  padding: 9px 18px;
  background: var(--sel);
  border-bottom: 0.5px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.safety-code {
  font-family: ui-monospace, monospace;
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--blue);
  font-weight: 700;
  user-select: all;
}
.safety-hint { font-size: 12px; }

.burn-pick {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--muted);
}
.burn-pick select {
  background: var(--card);
  color: var(--text);
  border: 0.5px solid var(--line-2);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 12.5px;
}

/* 消息区 */
.messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg { display: flex; }
.msg.mine { justify-content: flex-end; }
.msg.theirs { justify-content: flex-start; }

/* 气泡：我方淡蓝 / 对方纯白，文字统一 #313131，圆角 10px */
.bubble {
  max-width: min(78%, 560px);
  padding: 8px 15px;
  border-radius: 10px;
  line-height: 1.55;
  font-size: 15px;
  word-break: break-word;
  white-space: pre-wrap;
  color: var(--text-2);
}
.msg.mine .bubble { background: var(--mine); }
.msg.theirs .bubble { background: var(--theirs); border: 0.5px solid var(--line); }

.media { max-width: 100%; max-height: 360px; border-radius: 10px; display: block; }
.file-link { color: var(--blue); text-decoration: underline; }
.recv-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.progress {
  height: 6px;
  width: 180px;
  background: var(--panel-gray);
  border-radius: 3px;
  overflow: hidden;
}
.progress > div { height: 100%; width: 0; background: var(--blue); transition: width .1s; }

.burn-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  color: var(--muted);
  vertical-align: middle;
}
.msg.burning { opacity: 0; transform: scale(.96); transition: opacity .3s, transform .3s; }

/* 输入区：白底 + 细分割线 */
.compose {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--card);
  border-top: 0.5px solid var(--line);
  flex: 0 0 auto;
}
.attach-wrap { position: relative; flex: 0 0 auto; display: flex; }
.attach {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-size: 24px; line-height: 1;
  color: var(--muted);
  background: var(--panel-soft);
  border: 0.5px solid var(--line-2);
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  transition: color .15s;
}
.attach:hover { color: var(--brand); border-color: var(--brand); }

/* 上传方式弹出菜单 */
.attach-menu {
  position: absolute;
  left: 0;
  bottom: 52px;
  min-width: 168px;
  padding: 6px;
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(47, 125, 255, .10);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 20;
}
.am-item {
  text-align: left;
  padding: 11px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.am-item:hover { background: var(--panel-soft); }
.am-item:active { background: var(--sel); }
#text-input {
  flex: 1;
  min-width: 0; /* 允许在窄屏内收缩，不撑破输入栏 */
  padding: 12px 14px;
  border-radius: 8px;
  border: 0.5px solid var(--line-2);
  background: var(--panel-soft);
  color: var(--text);
  font-size: 16px; /* ≥16px：避免 iOS 聚焦时自动放大 */
}
#text-input::placeholder { color: var(--muted); }
#text-input:focus { outline: none; border-color: var(--brand); background: var(--card); }
.send {
  padding: 0 22px; height: 42px;
  border: none; border-radius: 12px;
  background: var(--brand); color: #fff;
  font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background .15s;
}
.send:hover { background: var(--brand-hover); }

/* ============================ 移动端适配 ============================ */

@media (max-width: 600px) {
  /* 落地页：收紧上方留白 */
  .landing { padding: 56px 20px 44px; }
  .landing h1 { font-size: 26px; }
  .desc { font-size: 13.5px; }

  /* 顶栏：允许换行，缩小间距/字号，避免横向溢出 */
  .topbar { flex-wrap: wrap; gap: 7px 9px; padding: 10px 14px; }
  .topbar .status { margin-left: auto; }
  .fs-badge, .peers, .safety, .burn-pick, .burn-pick select { font-size: 11.5px; }

  /* 安全码提示换行显示，避免挤成一长行 */
  .safety-bar { font-size: 12px; line-height: 1.6; }
  .safety-hint { display: block; margin-top: 3px; }

  /* 气泡更宽一点，利用窄屏空间 */
  .bubble { max-width: 86%; }
  .media { max-height: 300px; }

  /* 输入栏更紧凑 */
  .compose { gap: 8px; padding: 10px 12px; }
  .attach { width: 40px; height: 40px; font-size: 20px; }
  .send { padding: 0 16px; }
}
