/* DropSync 前端样式：手机优先，电脑上自动变成两栏卡片 */

:root {
  --brand: #4a6cf7;
  --brand-dark: #3a56d4;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #22242a;
  --text-soft: #6b7080;
  --line: #e4e6ec;
  --danger: #e2483d;
  --ok: #2fa96b;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.hidden { display: none !important; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.topbar-left { display: flex; align-items: center; gap: 8px; }

.logo { font-size: 17px; font-weight: 700; letter-spacing: .3px; }

.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--danger);
}
.dot-online { background: var(--ok); }

.topbar-room {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
}

.room-label { color: var(--text-soft); }

.room-code {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--brand);
  background: #eef1fe;
  padding: 2px 10px;
  border-radius: 8px;
}

.countdown { color: var(--text-soft); font-variant-numeric: tabular-nums; }

/* ---------------- 布局 ---------------- */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 14px 60px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-title { margin: 0; font-size: 16px; font-weight: 700; }
.hint { color: var(--text-soft); font-size: 12.5px; }

.row-between {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* ---------------- 表单 ---------------- */
.field-label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13px;
  color: var(--text-soft);
}

.input, .textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(74, 108, 247, .12);
}
.input-code {
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: 20px;
  text-align: center;
  font-weight: 700;
}
.textarea { resize: vertical; min-height: 76px; line-height: 1.6; }

.join-card { margin-top: 24px; padding: 24px 20px; }
.join-title { margin: 0 0 6px; font-size: 22px; text-align: center; }
.join-desc { margin: 0 0 8px; text-align: center; color: var(--text-soft); font-size: 13.5px; }
.join-actions { margin-top: 16px; }

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 4px;
  color: var(--text-soft); font-size: 13px;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

.error-text {
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 13.5px;
  text-align: center;
}

/* ---------------- 按钮 ---------------- */
.btn {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #f3f4f7; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.btn-primary:hover { background: var(--brand-dark); }

.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-block { display: block; width: 100%; }

.btn-icon {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--text-soft);
}
.btn-icon:hover { background: #f3f4f7; }
.btn-danger { color: var(--danger); border-color: #f3c9c6; }

.switch {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-soft); cursor: pointer;
}

/* ---------------- 拖拽区 ---------------- */
.dropzone {
  border: 2px dashed #cfd4e0;
  border-radius: var(--radius);
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--brand);
  background: #f4f6ff;
}
.dropzone-main { margin: 0; font-weight: 600; }
.dropzone-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--text-soft); }

/* ---------------- 传输中（上传 / 下载共用一行）---------------- */
.transfer-list:empty { display: none; }

.transfer-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.transfer-item:last-child { border-bottom: none; }

.transfer-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.transfer-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.transfer-badge {
  flex: none;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 99px;
  background: #eef1fe;
  color: var(--brand-dark);
}
.transfer-badge-download { background: #e6f5ec; color: #1d7a45; }

/* 速度用等宽数字，避免数字跳动时整行来回抖 */
.transfer-speed {
  flex: none;
  color: var(--brand);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 82px;
  text-align: right;
}

.transfer-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.progress {
  height: 6px;
  background: #eef0f4;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-bar {
  height: 100%;
  background: var(--brand);
  border-radius: 99px;
  transition: width .2s;
}

/* ---------------- 空间用量 ---------------- */
.storage {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: #fafbfd;
}
.storage-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.storage-note { margin: 6px 0 0; }

/* ---------------- 文件列表 ---------------- */
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.file-item:last-child { border-bottom: none; }

.file-thumb {
  width: 46px; height: 46px;
  border-radius: 10px;
  object-fit: cover;
  background: #eef0f4;
  flex: none;
}
.file-icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  background: #eef1fe;
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  flex: none;
}

.file-info { flex: 1; min-width: 0; }
.file-name {
  font-size: 14.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-meta { font-size: 12.5px; color: var(--text-soft); }

.file-actions { display: flex; gap: 6px; flex: none; }

/* ---------------- 文字列表 ---------------- */
.text-list { margin-top: 14px; }
.text-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 8px;
  background: #fafbfd;
}
.text-item-mine { background: #f2f5ff; border-color: #dde4fb; }
.text-content { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; }
.text-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 8px; font-size: 12px; color: var(--text-soft);
}

/* ---------------- 设备列表 ---------------- */
.device-list { display: flex; flex-wrap: wrap; gap: 8px; }
.device-chip {
  background: #eef1fe;
  color: var(--brand-dark);
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 13px;
}

/* ---------------- 提示 ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #22242a;
  color: #fff;
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 14px;
  z-index: 100;
  max-width: 90vw;
  text-align: center;
}

.footer-note {
  text-align: center;
  color: var(--text-soft);
  font-size: 12.5px;
  margin-top: 4px;
}

/* 电脑屏幕：卡片加宽一点，留白更舒服 */
@media (min-width: 720px) {
  .container { padding: 22px 20px 60px; }
  .card { padding: 20px; }
}
