:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e6e9f0;
  --accent: #4f46e5;
  --accent-2: #06b6d4;
  --ok: #15a36e;
  --err: #e0413e;
  --shadow: 0 10px 30px rgba(31, 36, 48, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, #eef1fb 0%, #f5f7fb 40%, #eafafd 100%);
  color: var(--ink);
  min-height: 100vh;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 60px;
}

h1 {
  font-size: 28px;
  margin: 0 0 6px;
  letter-spacing: .5px;
}

.sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

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

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

input[type="text"], input:not([type]), input[type="password"] {
  width: 100%;
  margin-top: 8px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}

.row { display: flex; gap: 10px; }
.row input { flex: 1; }

button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  padding: 11px 18px;
  font-weight: 600;
  transition: transform .05s, opacity .15s, background .15s;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }

.primary { background: var(--accent); color: #fff; width: 100%; }
.primary:hover { background: #4338ca; }
.ghost {
  background: #eef0fb;
  color: var(--accent);
}
.ghost:hover { background: #e3e6f9; }

.modes {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 18px;
}
.modes legend { font-size: 13px; color: var(--muted); padding: 0 6px; }
.mode { font-weight: 500; font-size: 14px; margin: 8px 0; display: flex; align-items: center; gap: 8px; }
.mode input { width: auto; margin: 0; }

.banner {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13.5px;
  margin-bottom: 18px;
}
.banner.err { background: #fdecec; color: var(--err); border: 1px solid #f6c9c8; }

.roombar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.roombar code {
  background: #f1f3fa;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 15px;
  letter-spacing: .5px;
}

#relaySwitch { font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.link { color: var(--accent); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }

.status {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
  background: #f3f4f8;
}
.status.info { background: #eef4ff; color: #2451c4; }
.status.ok { background: #e8f8f0; color: var(--ok); }
.status.err { background: #fdecec; color: var(--err); }

.sendBox { font-weight: 600; }
.sendBox input[type="file"] { margin-top: 10px; font-weight: 400; }

.prog { font-size: 13.5px; color: var(--muted); margin: 4px 0 16px; min-height: 18px; }

h3 { font-size: 15px; margin: 8px 0 12px; }

.recv { list-style: none; padding: 0; margin: 0; }
.recv li {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recv .fname { font-weight: 600; word-break: break-all; }
.recv .pct { font-size: 12.5px; color: var(--muted); }
.bar { height: 8px; background: #eef0f6; border-radius: 99px; overflow: hidden; }
.fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .15s; }
.dl { align-self: flex-start; color: #fff; background: var(--ok); padding: 8px 14px; border-radius: 9px; text-decoration: none; font-size: 13.5px; font-weight: 600; }

.foot { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-top: 8px; }
.foot b { color: var(--ink); }
