/* ================= eDrop UI ================= */
:root {
  --bg: #070a12;
  --bg2: #0b1020;
  --panel: #101728;
  --panel2: #141d31;
  --line: #1e2a44;
  --txt: #e8eefc;
  --dim: #8fa1c4;
  --dim2: #64749a;
  --acc: #38e8b0;
  --acc2: #2bb8ff;
  --warn: #ffb547;
  --err: #ff5d6c;
  --r: 14px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(900px 500px at 82% -12%, rgba(43, 184, 255, .16), transparent 60%),
    radial-gradient(760px 480px at 8% 4%, rgba(56, 232, 176, .13), transparent 62%),
    var(--bg);
  color: var(--txt);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(7, 10, 18, .78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: .01em; }
.brand em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--dim2); border-left: 1px solid var(--line); padding-left: 10px; }

.roomchip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 5px 6px 5px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.roomchip .mono { font-size: 14px; color: var(--acc); font-weight: 700; }

.statuspill {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 6px 14px;
  font-size: 12.5px;
  color: var(--dim);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.roomchip:not([hidden]) ~ .statuspill { margin-left: 0; }
.statuspill i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--dim2);
  box-shadow: 0 0 0 3px rgba(100, 116, 154, .18);
  transition: background .2s, box-shadow .2s;
}
.statuspill.ok i { background: var(--acc); box-shadow: 0 0 0 3px rgba(56, 232, 176, .2); }
.statuspill.bad i { background: var(--err); box-shadow: 0 0 0 3px rgba(255, 93, 108, .2); }

/* ---------- landing ---------- */
.landing { max-width: 1040px; margin: 0 auto; padding: 64px 22px 80px; }

.landing h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5.4vw, 50px);
  line-height: 1.14;
  letter-spacing: -.02em;
  background: linear-gradient(96deg, #e8eefc 12%, var(--acc) 52%, var(--acc2) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.landing .sub { margin: 0 0 40px; color: var(--dim); font-size: 16px; max-width: 660px; }

.cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  padding: 24px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 18px; font-size: 15px; font-weight: 600; color: var(--txt); letter-spacing: .01em; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; font-size: 12px; color: var(--dim2); }

input[type="text"], input:not([type]), input[type="search"] {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 14px;
  color: var(--txt);
  background: #0a1120;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
input:focus { border-color: rgba(56, 232, 176, .55); box-shadow: 0 0 0 3px rgba(56, 232, 176, .12); }
input::placeholder { color: #46557a; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--txt);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: transform .12s, background .16s, border-color .16s, opacity .16s;
}
.btn:hover { background: #1a2540; border-color: #2c3d5e; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
  color: #04140e;
  background: linear-gradient(180deg, #4df3bb, var(--acc));
  border-color: transparent;
}
.btn.primary:hover { background: linear-gradient(180deg, #62ffc8, #2fd8a2); }
.btn.tiny { width: auto; padding: 8px 14px; font-size: 13px; }

.hint { margin: 12px 0 0; font-size: 12.5px; color: var(--dim2); }
.hint code { padding: 1px 5px; background: #0a1120; border: 1px solid var(--line); border-radius: 5px; font-size: 11.5px; }

.feats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}
.feats li {
  padding: 16px 18px;
  background: rgba(16, 23, 40, .6);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.feats b { display: block; margin-bottom: 4px; font-size: 13.5px; color: var(--acc); }
.feats span { font-size: 12.5px; color: var(--dim); line-height: 1.5; }

/* ---------- room ---------- */
.roomview { padding: 18px 22px 40px; }
.roombox {
  display: grid;
  gap: 18px;
  grid-template-columns: 288px minmax(0, 1fr);
  max-width: 1500px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 900px) {
  .roombox { grid-template-columns: 1fr; }
}

.peercol, .maincol {
  background: linear-gradient(180deg, rgba(20, 29, 49, .92), rgba(16, 23, 40, .92));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.peercol {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  min-height: 420px;
  overflow: hidden;
}
.maincol { padding: 18px; }

.panelhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
}
.panelhead b { color: var(--acc); margin-left: 4px; }

.iconbtn {
  padding: 5px 11px;
  font: inherit;
  font-size: 12px;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
  white-space: nowrap;
}
.iconbtn:hover { color: var(--txt); border-color: #33456a; background: rgba(255, 255, 255, .04); }

.peerlist { flex: 0 0 auto; max-height: 34%; overflow: auto; margin: 0; padding: 8px; list-style: none; }
.peerlist li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 9px;
}
.peerlist li:hover { background: rgba(255, 255, 255, .04); }
.peerlist .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--acc); flex: 0 0 auto; }
.peerlist .self { color: var(--dim2); font-size: 11px; margin-left: auto; }
.peerlist .psend { margin-left: auto; }
.peerlist .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chatwrap { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; border-top: 1px solid var(--line); }
.chatlog { flex: 1 1 auto; overflow-y: auto; margin: 0; padding: 10px 12px; list-style: none; font-size: 13px; }
.chatlog li { margin-bottom: 9px; line-height: 1.5; word-break: break-word; }
.chatlog .who { display: block; font-size: 11px; color: var(--acc2); margin-bottom: 1px; }
.chatlog .sys { color: var(--dim2); font-style: italic; font-size: 12px; }
.chatform { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chatform input { flex: 1 1 auto; padding: 9px 12px; font-size: 13px; }

/* dropzone */
.dropzone {
  position: relative;
  padding: 34px 20px;
  text-align: center;
  background:
    repeating-linear-gradient(45deg, rgba(56, 232, 176, .028) 0 12px, transparent 12px 24px),
    #0a1120;
  border: 1.5px dashed #26364f;
  border-radius: 14px;
  color: var(--dim);
  cursor: pointer;
  transition: border-color .18s, background .18s, color .18s;
}
.dropzone:hover, .dropzone.hot { border-color: var(--acc); color: var(--txt); background-color: #0c1a24; }
.dropzone.hot { box-shadow: inset 0 0 0 1px rgba(56, 232, 176, .3); }
.dzinner p { margin: 10px 0 4px; font-size: 14px; }
.dzinner small { color: var(--dim2); font-size: 12px; }
.linkbtn {
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: var(--acc);
  background: none;
  border: 0;
  border-bottom: 1px dotted currentColor;
  cursor: pointer;
}

/* metrics */
.metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin: 16px 0;
}
.metric {
  padding: 11px 14px;
  background: #0a1120;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.metric span { display: block; font-size: 11.5px; color: var(--dim2); margin-bottom: 3px; }
.metric b { font-size: 16px; font-weight: 700; color: var(--acc); font-variant-numeric: tabular-nums; }

/* panels */
.panels { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.panel {
  display: flex;
  flex-direction: column;
  background: #0a1120;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}
.panel > .panelhead { background: rgba(255, 255, 255, .015); }
.list { margin: 0; padding: 8px; list-style: none; max-height: 340px; overflow-y: auto; }
.list .empty { padding: 26px 10px; text-align: center; color: var(--dim2); font-size: 12.5px; }

.item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background .16s, border-color .16s;
}
.item + .item { margin-top: 4px; }
.item:hover { background: rgba(255, 255, 255, .035); border-color: var(--line); }
.item .row1 { display: flex; align-items: baseline; gap: 8px; }
.item .fname {
  flex: 1 1 auto;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item .fsize { font-size: 11.5px; color: var(--dim2); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.item .row2 { display: flex; align-items: center; gap: 9px; margin-top: 7px; }
.bar { flex: 1 1 auto; height: 5px; background: #16233c; border-radius: 999px; overflow: hidden; }
.bar > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--acc2), var(--acc));
  transition: width .18s linear;
}
.item .pct { flex: 0 0 auto; min-width: 46px; text-align: right; font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.item .acts { display: flex; gap: 6px; flex: 0 0 auto; }
.item .mini {
  padding: 3px 9px;
  font: inherit;
  font-size: 11.5px;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.item .mini:hover { color: var(--txt); border-color: #33456a; }
.item .mini.go { color: var(--acc); border-color: rgba(56, 232, 176, .4); }
.item .mini.no { opacity: .4; cursor: not-allowed; }
.item.done .pct { color: var(--acc); }
.item.err .pct { color: var(--err); }

.footnote { margin: 16px 2px 0; font-size: 12px; color: var(--dim2); }

/* modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 7, 13, .8);
  backdrop-filter: blur(6px);
}
.modalcard {
  position: relative;
  width: min(440px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 24px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  text-align: center;
}
.modalcard h3 { margin: 0 0 16px; font-size: 15px; font-weight: 600; }
.modalclose {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  font-size: 20px;
  line-height: 1;
  color: var(--dim2);
  background: none;
  border: 0;
  cursor: pointer;
  border-radius: 8px;
}
.modalclose:hover { color: var(--txt); background: rgba(255, 255, 255, .06); }
.modalcard img { width: 100%; max-width: 300px; border-radius: 12px; background: #fff; padding: 8px; display: block; margin: 0 auto 14px; }
.modalcard .kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 13px; text-align: left; margin-top: 6px; }
.modalcard .kv span:nth-child(odd) { color: var(--dim2); }
.modalcard .warnbox { padding: 12px 14px; margin-top: 14px; font-size: 12.5px; text-align: left; color: var(--warn); background: rgba(255, 181, 71, .08); border: 1px solid rgba(255, 181, 71, .25); border-radius: 10px; }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 120;
  transform: translate(-50%, 12px);
  padding: 11px 20px;
  font-size: 13.5px;
  color: #04140e;
  background: var(--acc);
  border-radius: 999px;
  box-shadow: 0 14px 34px -10px rgba(56, 232, 176, .6);
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  max-width: 88vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--err); color: #fff; box-shadow: 0 14px 34px -10px rgba(255, 93, 108, .6); }

/* scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #22304b; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #2f4166; background-clip: content-box; }
