/* trans — 跨电脑传输工具样式 */
:root {
  --bg: #f6f7f9;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-2: #f2f4f7;
  --line: #e4e7ec;
  --line-2: #d0d5dd;
  --text: #1a1d21;
  --muted: #6b7280;
  --brand: #2f6bff;
  --brand-ink: #ffffff;
  --danger: #e5484d;
  --ok: #12b76a;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.06);
  --radius: 14px;
  --radius-sm: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d10;
    --bg-soft: #12151a;
    --card: #161a20;
    --card-2: #1c2129;
    --line: #262c36;
    --line-2: #333b47;
    --text: #e8eaed;
    --muted: #97a0ad;
    --brand: #4f83ff;
    --brand-ink: #ffffff;
    --danger: #ff6166;
    --ok: #35d08a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
kbd {
  font: inherit; font-size: 11px; padding: 1px 5px; border-radius: 6px;
  background: rgba(127,127,127,.16); border: 1px solid var(--line); opacity: .8;
}
button { font: inherit; cursor: pointer; }

/* ---------- 登录门 ---------- */
.gate {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg); z-index: 50; padding: 20px;
}
.gate-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 34px 30px; width: min(360px, 92vw);
  display: flex; flex-direction: column; gap: 12px; text-align: center;
}
.gate-logo { font-size: 42px; }
.gate-card h1 { margin: 0; font-size: 26px; letter-spacing: .5px; }
.gate-card p { margin: 0 0 6px; }
.gate-card input {
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--bg-soft); color: var(--text); font-size: 16px; outline: none;
}
.gate-card input:focus { border-color: var(--brand); }
.gate-card button {
  padding: 12px 14px; border: 0; border-radius: var(--radius-sm);
  background: var(--brand); color: var(--brand-ink); font-size: 16px; font-weight: 600;
}
.gate-err { color: var(--danger); font-size: 13px; min-height: 16px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px clamp(14px, 4vw, 32px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark { font-size: 20px; }
.brand-name { font-size: 17px; letter-spacing: .5px; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 6px; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.conn.on i { background: var(--ok); box-shadow: 0 0 0 0 rgba(18,183,106,.5); animation: pulse 2s infinite; }
.conn.off i { background: var(--danger); }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(18,183,106,.5)} 70%{box-shadow:0 0 0 7px rgba(18,183,106,0)} 100%{box-shadow:0 0 0 0 rgba(18,183,106,0)} }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--text);
  padding: 7px 12px; border-radius: 999px; font-size: 13px;
}
.ghost:hover { border-color: var(--line-2); background: var(--card-2); }
.ghost.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- 布局 ---------- */
.wrap { max-width: 820px; margin: 0 auto; padding: 20px clamp(14px, 4vw, 24px) 40px; }

/* ---------- 发送区 ---------- */
.composer {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; margin-bottom: 16px;
}
.composer textarea {
  width: 100%; border: 0; outline: none; resize: vertical; min-height: 92px;
  background: transparent; color: var(--text); font: inherit; padding: 4px 4px 10px;
}
.composer textarea::placeholder { color: var(--muted); }
.composer-actions { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.composer-hint { flex: 1; font-size: 12px; color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--card-2); color: var(--text); font-size: 14px; font-weight: 500;
}
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary kbd { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.25); color: inherit; }
.file-btn { cursor: pointer; }

/* ---------- 上传进度 ---------- */
.uploads { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.uprow {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; display: flex; align-items: center; gap: 12px;
}
.uprow .up-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.uprow .up-pct { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); min-width: 40px; text-align: right; }
.uprow .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--brand); transition: width .15s; }
.uprow { position: relative; overflow: hidden; }
.uprow.err { border-color: var(--danger); }
.uprow.err .up-pct { color: var(--danger); }

/* ---------- 记录流 ---------- */
.feed-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 2px 10px; }
.feed-head h2 { font-size: 14px; font-weight: 600; margin: 0; text-transform: none; color: var(--muted); letter-spacing: .3px; }
.feed { display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; position: relative;
  animation: rise .28s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.card.flash { animation: rise .28s ease both, flash 1.4s ease; }
@keyframes flash { 0%{ box-shadow: 0 0 0 2px var(--brand), var(--shadow);} 100%{ box-shadow: var(--shadow);} }
.card-top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.card-top .dev { display: inline-flex; align-items: center; gap: 4px; }
.card-top .sep { opacity: .5; }
.card-top .grow { flex: 1; }
.icon-btn {
  background: transparent; border: 0; color: var(--muted); padding: 4px; border-radius: 8px;
  font-size: 13px; line-height: 1;
}
.icon-btn:hover { background: var(--card-2); color: var(--text); }
.icon-btn.del:hover { color: var(--danger); }

/* 文字卡 */
.text-body {
  white-space: pre-wrap; word-break: break-word; font-size: 14.5px;
  max-height: 260px; overflow: hidden; position: relative;
}
.text-body.clamped::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46px;
  background: linear-gradient(transparent, var(--card));
}
.expand { margin-top: 6px; }
.card-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.mini {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 13px;
  border-radius: 8px; border: 1px solid var(--line-2); background: var(--card-2); color: var(--text);
}
.mini:hover { border-color: var(--brand); }
.mini.solid { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.mini.solid:hover { filter: brightness(1.06); }

/* 文件卡 */
.file-row { display: flex; align-items: center; gap: 14px; }
.file-ico {
  width: 46px; height: 46px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--card-2); font-size: 22px; border: 1px solid var(--line);
}
.file-meta { flex: 1; min-width: 0; }
.file-name { font-weight: 600; font-size: 14.5px; word-break: break-all; }
.file-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.thumb {
  margin-top: 10px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line);
  max-width: 100%; display: block;
}
.thumb img { display: block; max-width: 100%; max-height: 340px; object-fit: contain; background: var(--card-2); }
.media { margin-top: 10px; width: 100%; border-radius: 10px; }

/* 空态 */
.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty-ico { font-size: 40px; margin-bottom: 8px; }
.empty p { margin: 4px 0; }

.foot { text-align: center; padding: 24px; font-size: 12px; }

/* 拖拽遮罩 */
.dropmask {
  position: fixed; inset: 0; z-index: 40; background: color-mix(in srgb, var(--brand) 16%, transparent);
  backdrop-filter: blur(2px); display: grid; place-items: center; pointer-events: none;
}
.dropmask > div {
  border: 2.5px dashed var(--brand); color: var(--text); background: var(--card);
  padding: 26px 44px; border-radius: 18px; font-size: 18px; font-weight: 600; box-shadow: var(--shadow);
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #1a1d21; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28); opacity: 0; pointer-events: none; transition: .22s; z-index: 60;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 560px) {
  .brand-name { display: none; }
  .composer-hint { display: none; }
  .btn.primary kbd { display: none; }
}
