/* AeroDrop · Send.wang 样式表（从 index.php 提取） */

:root {
  --bg: #f4f4f2;
  --card-glass: rgba(255, 255, 255, 0.45);
  --card-border: rgba(255, 255, 255, 0.5);
  --text: #2d3748;
  --muted: #4a5568;
  --line: rgba(255, 255, 255, 0.6);
  --dark: #2d3748;
  --ok: #2f855a;
  --warn: #b7791f;
  --bad: #c53030;
  --blue: #2b6cb0;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  color: var(--text);
}
body.room-mode{
  background: url('https://images.unsplash.com/photo-1508615039623-a25605d2b022?ixlib=rb-4.0.3&auto=format&fit=crop&w=2560&q=80') center/cover fixed;
}

/* === 首页风格 (Hero Screen，已废弃但保留样式) === */
.hero-screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(3px);
  z-index: 100; color: white;
  transition: opacity 0.6s ease;
}
.hero-header {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 24px 40px;
  display: flex; justify-content: space-between; align-items: center;
}
.hero-logo { font-family: 'Great Vibes', cursive; font-size: 2rem; }
.hero-nav { font-size: 0.85rem; letter-spacing: 2px; text-transform: uppercase; display: flex; gap: 24px;}
.hero-sub {
  font-size: 0.9rem; letter-spacing: 4px; text-transform: uppercase;
  margin-bottom: 10px; text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.hero-title {
  font-family: 'Great Vibes', cursive; font-size: 6rem; font-weight: normal;
  margin: 0 0 20px 0; text-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.hero-desc {
  font-size: 1.1rem; letter-spacing: 1px; margin-bottom: 40px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.hero-btn {
  background: transparent; border: 1px solid white; color: white;
  padding: 12px 36px; border-radius: 999px;
  font-size: 0.9rem; letter-spacing: 2px; cursor: pointer;
  backdrop-filter: blur(5px); transition: all 0.3s ease;
}
.hero-btn:hover { background: white; color: #333; }

/* === 聊天室主体 (毛玻璃清爽化) === */
button, input, textarea { font: inherit; }
button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border-radius: 12px; min-height: 40px; padding: 9px 12px;
  cursor: pointer; backdrop-filter: blur(10px); transition: background 0.2s;
}
button:hover { background: rgba(255, 255, 255, 0.9); }
button.primary { background: rgba(45, 55, 72, 0.85); border-color: transparent; color: #fff; }
button.primary:hover { background: rgba(45, 55, 72, 1); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
input, textarea {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
  border-radius: 12px; outline: none;
  padding: 10px 11px; min-height: 40px;
  backdrop-filter: blur(10px);
}
input:focus, textarea:focus { border-color: rgba(255,255,255,0.9); box-shadow: 0 0 0 3px rgba(255,255,255,0.2); background: rgba(255,255,255,0.8); }
textarea { resize: none; }

.app {
  min-height: 100%; display: grid; place-items: center; padding: 18px;
}
.chatbox {
  width: min(680px, 100%);
  height: min(820px, calc(100vh - 36px));
  background: var(--card-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.15);
  display: grid; grid-template-rows: auto 1fr auto;
  overflow: hidden;
  position: relative;
}

/* 顶部Header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.3);
}
.title { font-weight: 800; padding-bottom: 4px; }
.subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }
.status {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 10px; color: var(--text); font-size: 13px;
  background: rgba(255,255,255,0.5);
}
.brand-logo {margin-left: -20px;}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.dot.ok { background: var(--ok); }
.dot.warn { background: #eab308; }

/* 消息区 */
.messages { overflow: auto; padding: 14px; background: transparent; }
.msg {
  max-width: 82%; margin: 8px 0; padding: 10px 12px;
  border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere;
  word-break: break-word; line-height: 1.45;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.msg.long { max-width: 100%; }
.msg-text { white-space: pre-wrap; }

.copy-msg { display: none; margin-top: 7px; min-height: 28px; padding: 4px 9px; border-radius: 999px; font-size: 12px; }
.msg.show-copy .copy-msg { display: inline-flex; align-items: center; }

/* 气泡样式重构 */
.msg.me {
  margin-left: auto;
  background: rgba(198, 246, 213, 0.85);
  backdrop-filter: blur(10px);
  color: #1c4532;
  border: 1px solid rgba(255,255,255,0.6);
  border-bottom-right-radius: 5px;
}
.msg.peer {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.6);
  border-bottom-left-radius: 5px;
}
.msg.sys { max-width: 100%; text-align: center; color: var(--muted); font-size: 12px; background: transparent; box-shadow: none; padding: 4px; }
.msg.card { max-width: 100%; background: rgb(185 204 210 / 47%); backdrop-filter: blur(12px); border: 1px solid var(--line); }
.msg img { max-width: 100%; display: block; border-radius: 12px; }

/* 连接卡片 */
.connect-card { display: grid; gap: 9px; }
.connect-card-head {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none; padding: 2px 0;
}
.connect-card-head b { font-size: 15px; }
.connect-card-toggle {
  font-size: 13px; color: var(--muted); transition: transform .18s ease;
  display: inline-block; line-height: 1;
}
.connect-card.collapsed .connect-card-toggle { transform: rotate(-90deg); }
.connect-card-body { display: grid; gap: 9px; }
.connect-card.collapsed .connect-card-body { display: none; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center;}
.qrrow { display: grid; grid-template-columns: 106px 1fr; gap: 12px; align-items: center; }
.qrbox { width: 100px; height: 100px; background: rgba(255,255,255,0.8); border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; padding: 7px; }
.qrbox img, .qrbox canvas { max-width: 86px; max-height: 86px; }

/* 连接卡片内直显二维码（仿 pairtransfer，居中大图） */
.card-qr-box {
  width: 160px; height: 160px; margin: 4px auto 0;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  display: grid; place-items: center; padding: 10px; overflow: hidden;
}
.card-qr-box img, .card-qr-box canvas { max-width: 140px; max-height: 140px; }

/* 底部输入区 */
.composer {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.4);
  padding: 11px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: end;
}
.composer textarea { width: 100%; height: 42px; max-height: 120px; background: rgba(255,255,255,0.7); }
.iconbtn { width: 42px; padding: 0; font-size: 20px; background: transparent; border: none; }

.drawer { display: none; border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.3); padding: 10px 11px; }
.drawer.open { display: block; }
.drawer-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.drawer label.action {
  display: grid; place-items: center; text-align: center; min-height: 58px;
  width: 100%; box-sizing: border-box;
  border: 1px dashed var(--muted); border-radius: 12px;
  background: rgba(255,255,255,0.5); font-size: 13px; cursor: pointer;
}
.drawer label.action:hover { background: rgba(255,255,255,0.8); }
.drawer input[type=file] { display: none; }
.drawer-actions { display: flex; gap: 8px; margin-top: 8px; }
.drawer-actions .action-btn {
  flex: 1; min-height: 40px; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.5);
  font-size: 13px; cursor: pointer; transition: background .15s;
}
.drawer-actions .action-btn:hover { background: rgba(255,255,255,0.85); }
.drawer-actions .action-btn.active {
  background: rgba(47,133,90,0.85); color: #fff; border-color: transparent;
}

/* 打包下载全部 · 浮动按钮 */
.fab {
  position: absolute; right: 20px; bottom: 128px; z-index: 5;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255,255,255,0.9);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  cursor: pointer; padding: 0;
  display: grid; place-items: center; transition: transform .15s, background .15s;
}
.fab:hover { transform: translateY(-2px); background: #fff; }
.fab:active { transform: translateY(0); }
.fab-icon { display: block; width: 32px; height: 32px; }
.fab:active { transform: translateY(0); }

.filecard { border: 1px solid var(--line); border-radius: 12px; padding: 9px; margin-top: 4px; background: rgba(255,255,255,0.65); }
.filetop { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.small { font-size: 12px; color: var(--muted); }
.me .small { color: #2f5f33; }
.barwrap { height: 7px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,0.5); margin-top: 7px; }
.bar { height: 100%; width: 0; background: rgba(45,55,72,0.8); transition: width 0.2s; }
.me .bar { background: #2f855a; }
.download { color: var(--blue); text-decoration: none; display: inline-block; margin-top: 6px; font-size: 14px; }

.footbar { border-top: 1px solid var(--line); padding: 8px 12px; text-align: center; color: var(--muted); font-size: 12px; background: rgba(255,255,255,0.3); }
.footbar a { color: var(--text); text-decoration: none; margin: 0 5px; font-weight: 500; }

/* ================= 响应式自适应增强（多断点 + 触控 + 无障碍） ================= */
@media(max-width: 720px) {
  /* 移动端：用 100dvh 避免地址栏伸缩导致 100vh 溢出，
     让 .app 精确锁定可见视口高度，#messages 才能成为真正的滚动容器。 */
  html, body { height: 100%; overflow: hidden; }
  .app { padding: 0; height: 100dvh; min-height: 100dvh; }
  .chatbox { width: 100%; height: 100%; border: 0; border-radius: 0; }
  .top {
    padding: calc(12px + env(safe-area-inset-top)) 12px 12px;
    gap: 8px;
    flex-wrap: nowrap;          /* 保持单行，避免高度跳动 */
  }
  /* 移动端 .top 自适应：标题区占据剩余空间，status 不被挤压 */
  .top-title { flex: 1 1 auto; min-width: 0; }
  .title {
    font-size: 1rem;
    white-space: nowrap;        /* 标题单行，溢出省略 */
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .subtitle {
    font-size: 11px;
    white-space: nowrap;        /* 副标题也单行省略，避免换行混乱 */
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brand-logo { margin-left: 0; height: 32px; width: auto; } /* 重置负 margin，缩小 */
  .status { flex-shrink: 0; padding: 6px 9px; font-size: 12px; } /* status 不换行不被压 */
  .hero-title { font-size: 4rem; }
  .hero-header { padding: 20px; }
  .hero-nav { display: none; }
  .drawer-grid { grid-template-columns: 1fr; }
  .qrrow { grid-template-columns: 92px 1fr; }
  .qrbox { width: 88px; height: 88px; }
  .qrbox img, .qrbox canvas { max-width: 74px; max-height: 74px; }
  .card-qr-box { width: 140px; height: 140px; }
  .card-qr-box img, .card-qr-box canvas { max-width: 120px; max-height: 120px; }
  .composer { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}

/* 小屏手机（≤480px） */
@media (max-width: 480px) {
  .hero-title { font-size: 3.2rem; }
  .hero-desc { font-size: 0.95rem; letter-spacing: 0.5px; }
  .hero-sub { letter-spacing: 2px; font-size: 0.8rem; }
  .hero-btn { padding: 10px 28px; font-size: 0.85rem; }
  .hero-header { padding: 16px 18px; }
  button { min-height: 44px; }
  .iconbtn { width: 44px; }
  /* 超窄屏：标题略小，副标题隐藏省空间 */
  .title { font-size: 0.95rem; }
  .subtitle { display: none; }
  .brand-logo { height: 28px; }
  .msg { padding: 9px 10px; font-size: 0.95rem; }
  .footbar { font-size: 11px; padding: 6px 8px; }
  .lang-switch { margin-left: 6px; gap: 4px; }
  .lang-switch button { font-size: 12px; }
  .qr-modal { max-width: 90vw; padding: 18px; }
  .qr-modal img { width: 180px; height: 180px; }
}

/* 平板竖屏 / 小桌面（721-1024px） */
@media (min-width: 721px) and (max-width: 1024px) {
  .chatbox { width: min(760px, 96%); }
}

/* 手机横屏（landscape，高度小） */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .chatbox { height: 100vh; border-radius: 0; }
  .hero-title { font-size: 3rem; }
  .hero-desc { display: none; }
}

/* 大屏桌面（≥1280px） */
@media (min-width: 1280px) {
  .chatbox { width: 720px; }
}

/* iPhone 刘海/灵动岛安全区 */
@supports (padding: env(safe-area-inset-top)) {
  .hero-header { padding-top: calc(24px + env(safe-area-inset-top)); }
  .qr-overlay { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
}

/* 无障碍：尊重「减少动态」偏好 */
@media (prefers-reduced-motion: reduce) {
  .hero-screen, .qr-modal, button, input, textarea, .bar {
    transition: none !important;
    animation: none !important;
  }
}

/* 触控设备：去掉 hover 依赖 */
@media (hover: none) {
  button:hover { background: inherit; }
  .hero-btn:hover { background: transparent; color: white; }
  button.primary:hover { background: rgba(45, 55, 72, 0.85); }
}

/* ================= 全局样式 ================= */

/* 二维码弹窗遮罩 */
.qr-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; z-index: 9999;
}

/* 二维码卡片 */
.qr-modal {
  background: #fff; padding: 24px; border-radius: 20px; text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2); animation: fadeIn 0.3s; max-width: 275px;
}
.qr-modal img { width: 220px; height: 220px; display: block; margin-bottom: 15px; border-radius: 8px; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* 确认对话框（复用 qr-overlay 遮罩） */
.confirm-modal {
  background: #fff; padding: 20px 22px; border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2); animation: fadeIn 0.25s;
  max-width: 320px; width: calc(100% - 48px); text-align: center;
}
.confirm-title { font-weight: 700; font-size: 16px; margin-bottom: 10px; color: #2d3748; }
.confirm-msg { font-size: 14px; line-height: 1.55; color: #4a5568; margin-bottom: 18px; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions button { flex: 1; min-height: 40px; border-radius: 10px; font-size: 14px; cursor: pointer; border: 1px solid var(--line); }
.confirm-actions .action-btn { background: rgba(245,247,250,0.9); color: #4a5568; }
.confirm-actions .primary { background: rgba(45,55,72,0.85); color: #fff; border-color: transparent; }

/* 操作按钮增强对比度 */
button.action-btn {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border-radius: 12px;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
button.action-btn:hover { background: rgba(255, 255, 255, 0.9); }

/* 中英文切换 */
.lang-switch {
  margin-left: 12px;
  display: inline-flex;
  gap: 8px;
}
.lang-switch button {
  border: 0; background: none; cursor: pointer; font-size: 13px; opacity: .75;
}
.lang-switch button:hover { opacity: 1; }

.title-link {
  color: inherit; text-decoration: none;
}
.title-link:hover, .title-link:visited, .title-link:active {
  color: inherit; text-decoration: none;
}
