/* 文件传输助手 —— 还原自 prd/文件传输助手 v2 设计稿 */
html, body { margin: 0; padding: 0; background: #eef0f5; }
* { box-sizing: border-box; }
body {
  font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  color: #111418;
  -webkit-font-smoothing: antialiased;
}
a { color: #111418; text-decoration: none; }
a:hover { color: #b8860b; }
::selection { background: #d4a017; color: #111418; }
input, textarea { outline: none; font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif; }

.scy::-webkit-scrollbar { width: 9px; }
.scy::-webkit-scrollbar-thumb { background: rgba(17, 20, 24, .22); border-radius: 8px; }
.scy::-webkit-scrollbar-thumb:hover { background: rgba(17, 20, 24, .4); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

.hdr-meta { display: none; }
@media (min-width: 1150px) { .hdr-meta { display: flex; } }

.app-root {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #e9edf7 0%, #e6e1f0 50%, #f3ece6 100%);
  overflow: hidden;
}

/* header */
.btn-home {
  display: flex; align-items: center; gap: 6px; flex: none;
  border: 1px solid rgba(17, 20, 24, .3); border-radius: 999px;
  padding: 7px 13px; font-size: 12px; font-weight: 600; color: #3f4854; white-space: nowrap;
  transition: border-color .14s, color .14s;
}
.btn-home:hover { border-color: #111418; color: #111418; }
.btn-new {
  display: flex; align-items: center; gap: 9px; flex: none; white-space: nowrap;
  border: none; background: #111418; color: #fff; cursor: pointer; border-radius: 999px;
  padding: 10px 20px; font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
  font-size: 13px; font-weight: 600; transition: background .14s;
}
.btn-new:hover { background: #3a3e45; }

/* conversation list */
.conv-item {
  position: relative; padding: 15px 24px 13px; border-bottom: 1px solid rgba(17, 20, 24, .14);
  cursor: pointer; background: transparent; color: #111418; transition: background .14s;
}
.conv-item:hover { background: rgba(17, 20, 24, .06); }
.conv-item.active, .conv-item.active:hover { background: #111418; color: #fff; }
.conv-row { display: flex; align-items: baseline; gap: 10px; }
.conv-idx { font-size: 10px; font-family: ui-monospace, monospace; color: #9aa3af; }
.conv-item.active .conv-idx { color: #d4a017; }
.conv-name { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: 10.5px; font-family: ui-monospace, monospace; color: #9aa3af; flex: none; }
.conv-item.active .conv-time { color: rgba(255, 255, 255, .6); }
.conv-sub { margin-top: 4px; padding-left: 26px; font-size: 12.5px; color: #5b6470; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item.active .conv-sub { color: rgba(255, 255, 255, .75); }
.conv-badge { margin-top: 6px; padding-left: 26px; font-size: 10px; font-weight: 700; letter-spacing: 1px; color: #9aa3af; }
.conv-item.active .conv-badge { color: #d4a017; }
.conv-del {
  position: absolute; top: 12px; right: 14px; width: 22px; height: 22px; border: none;
  background: transparent; cursor: pointer; border-radius: 6px; color: #9aa3af;
  display: flex; align-items: center; justify-content: center;
}
.conv-item.active .conv-del { color: rgba(255, 255, 255, .7); }
.conv-del:hover { background: rgba(128, 128, 128, .18); }

/* devices */
.device-row {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 11px;
  cursor: pointer; margin-bottom: 2px; background: transparent; transition: background .14s;
}
.device-row:hover { background: rgba(17, 20, 24, .07); }
.device-row.active { background: rgba(17, 20, 24, .08); }
.device-av {
  width: 34px; height: 34px; flex: none; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: 13.5px;
  background: #111418; color: #fff;
}
.device-row.active .device-av { background: #d4a017; color: #111418; }
.device-name-row { display: flex; align-items: center; gap: 6px; }
.device-sub { font-size: 10.5px; color: #5b6470; font-family: ui-monospace, monospace; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-me { font-size: 9px; font-weight: 700; letter-spacing: 1px; color: #111418; background: #d4a017; padding: 1px 6px; border-radius: 4px; }
.tag-view { font-size: 9px; font-weight: 700; letter-spacing: 1px; color: #fff; background: #111418; padding: 1px 6px; border-radius: 4px; }

/* message rows */
.date-sep { text-align: center; margin: 18px 0 10px; }
.date-sep span { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: #5b6470; background: rgba(17, 20, 24, .1); padding: 4px 12px; border-radius: 999px; }
.msg { display: flex; flex-direction: row; align-items: flex-start; gap: 12px; margin: 14px 0; animation: fadeUp .22s ease both; }
.msg.mine { flex-direction: row-reverse; }
.msg-av { width: 38px; height: 38px; flex: none; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14.5px; background: #111418; color: #fff; }
.msg.mine .msg-av { background: #d4a017; color: #111418; }
.msg-body { max-width: min(62%, 560px); display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.msg.mine .msg-body { align-items: flex-end; }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-direction: row; }
.msg.mine .msg-head { flex-direction: row-reverse; }
.msg-name { font-size: 12.5px; font-weight: 700; }
.msg-sub { font-size: 10.5px; color: #5b6470; font-family: ui-monospace, monospace; }
.msg-time { font-size: 10px; color: #9aa3af; font-family: ui-monospace, monospace; }
.bubble { background: rgba(255, 255, 255, .9); color: #111418; border: 1px solid rgba(17, 20, 24, .22); padding: 11px 15px; border-radius: 13px; font-size: 14.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.msg.mine .bubble { background: #111418; color: #f4f5f7; border: none; }

.img-wrap { position: relative; border-radius: 13px; overflow: hidden; border: 1px solid rgba(17, 20, 24, .25); }
.img-wrap img { display: block; max-width: 250px; max-height: 320px; cursor: zoom-in; }
.img-dl { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: 9px; background: rgba(17, 20, 24, .75); display: flex; align-items: center; justify-content: center; }
.img-dl:hover { background: #111418; }

.file-card { display: flex; align-items: center; gap: 13px; background: rgba(255, 255, 255, .85); border: 1px solid rgba(17, 20, 24, .25); border-radius: 13px; padding: 13px 15px; min-width: 260px; }
.file-ic { width: 42px; height: 42px; flex: none; border-radius: 11px; background: #d4a017; color: #111418; display: flex; align-items: center; justify-content: center; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 11px; color: #5b6470; margin-top: 3px; font-family: ui-monospace, monospace; }
.file-pdf { width: 36px; height: 36px; flex: none; border: 1px solid rgba(17, 20, 24, .3); background: transparent; cursor: pointer; border-radius: 999px; color: #3f4854; display: flex; align-items: center; justify-content: center; }
.file-pdf:hover { border-color: #111418; color: #111418; }
.file-dl { width: 36px; height: 36px; flex: none; border-radius: 999px; background: #111418; color: #fff; display: flex; align-items: center; justify-content: center; }
.file-dl:hover { background: #3a3e45; }

/* input bar */
.icon-btn { width: 34px; height: 34px; border: none; background: none; cursor: pointer; border-radius: 9px; color: #3f4854; display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: rgba(17, 20, 24, .08); }
.icon-btn.mute { color: #9aa1ab; cursor: default; }
.icon-btn.mute:hover { background: none; }
.emoji-btn { width: 34px; height: 34px; border: none; background: none; cursor: pointer; border-radius: 9px; font-size: 20px; line-height: 1; }
.emoji-btn:hover { background: rgba(17, 20, 24, .08); }
.search-clear { border: none; background: none; cursor: pointer; padding: 0; display: flex; color: #5b6470; }
.search-clear:hover { color: #111418; }
.send-btn { display: flex; align-items: center; gap: 9px; border: none; font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif; font-size: 13px; font-weight: 600; padding: 9px 20px; border-radius: 999px; transition: all .15s; }
.send-btn:hover { opacity: .92; }

/* lightbox */
#lightbox { display: flex; }
#lightbox[hidden] { display: none; }
.lb-dl { width: 44px; height: 44px; border-radius: 999px; background: #d4a017; display: flex; align-items: center; justify-content: center; }
.lb-dl:hover { background: #ffc41a; }
.lb-close { width: 44px; height: 44px; border: none; cursor: pointer; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff; display: flex; align-items: center; justify-content: center; }
.lb-close:hover { background: rgba(255, 255, 255, .3); }

/* login gate */
#loginGate {
  position: fixed; inset: 0; z-index: 120; padding: 24px;
  background: linear-gradient(165deg, #e9edf7 0%, #e6e1f0 50%, #f3ece6 100%);
  display: flex; align-items: center; justify-content: center;
}
#loginGate[hidden] { display: none; }
.gate-card {
  width: 100%; max-width: 420px; background: rgba(255, 255, 255, .72); backdrop-filter: blur(12px);
  border: 1px solid rgba(17, 20, 24, .18); border-radius: 22px; padding: 34px 32px 26px;
  box-shadow: 0 40px 80px -40px rgba(17, 20, 24, .5); animation: pop .2s ease both;
}
.gate-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.gate-logo { width: 40px; height: 40px; flex: none; border-radius: 11px; background: #111418; color: #fff; display: flex; align-items: center; justify-content: center; }
.gate-brand-title { font-size: 16px; font-weight: 700; letter-spacing: -.3px; }
.gate-brand-sub { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: #9aa3af; margin-top: 3px; }
.gate-title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.gate-desc { margin: 12px 0 24px; font-size: 13px; line-height: 1.75; color: #5b6470; }
.gate-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 1px; color: #5b6470; margin-bottom: 8px; }
.gate-label span { font-family: ui-monospace, monospace; color: #111418; letter-spacing: 0; }
.gate-input { width: 100%; border: 1px solid rgba(17, 20, 24, .28); background: rgba(255, 255, 255, .7); border-radius: 12px; padding: 13px 15px; font-size: 14.5px; color: #111418; transition: border-color .14s; }
.gate-input:focus { border-color: #111418; }
.gate-code { letter-spacing: 6px; font-family: ui-monospace, monospace; font-size: 18px; }
.gate-code::placeholder { letter-spacing: normal; font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif; font-size: 14.5px; }
.gate-btn { width: 100%; margin-top: 14px; border: none; cursor: pointer; background: #111418; color: #fff; border-radius: 12px; padding: 13px; font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif; font-size: 14px; font-weight: 600; transition: background .14s; }
.gate-btn:hover { background: #3a3e45; }
.gate-btn:disabled { background: rgba(17, 20, 24, .35); cursor: not-allowed; }
.gate-row { display: flex; justify-content: space-between; margin-top: 14px; }
.gate-link { border: none; background: none; cursor: pointer; font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif; font-size: 12.5px; font-weight: 600; color: #5b6470; }
.gate-link:hover { color: #b8860b; }
.gate-link:disabled { color: #b6bcc4; cursor: not-allowed; }
.gate-error { margin: 14px 0 0; font-size: 12.5px; line-height: 1.6; color: #c0392b; }
.gate-error[hidden] { display: none; }
.gate-home { display: inline-block; margin-top: 22px; font-size: 12px; font-weight: 600; color: #5b6470; }
.gate-home:hover { color: #b8860b; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: #111418; color: #fff; font-size: 13px; font-weight: 600;
  padding: 11px 20px; border-radius: 999px; z-index: 90;
  box-shadow: 0 18px 40px -20px rgba(17, 20, 24, .6); animation: pop .16s ease both;
}
.toast[hidden] { display: none; }
