:root {
  --bg: #0d0f12;
  --card: #16181d;
  --line: #262a32;
  --text: #e8eaed;
  --muted: #8b919c;
  --accent: #4f8cff;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, #1a2030 0%, var(--bg) 55%);
  color: var(--text);
  font: 15px/1.6 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  display: flex;
  justify-content: center;
  padding: 8vh 20px 40px;
}

.app {
  width: 100%;
  max-width: 460px;
}

.head {
  text-align: center;
  margin-bottom: 28px;
}

.head h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: 0.02em;
}

.head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 34px 16px;
  border: 1.5px dashed #333a46;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.drop:hover,
.drop.over {
  border-color: var(--accent);
  background: #1a2130;
}

.drop-title {
  font-weight: 600;
}

.drop-sub {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin: 18px 0;
}

.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.join {
  display: flex;
  gap: 10px;
}

.join input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0f1216;
  color: var(--text);
  font: 600 16px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  outline: none;
}

.join input:focus {
  border-color: var(--accent);
}

button {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 500;
}

button.link {
  background: none;
  color: var(--muted);
  padding: 8px;
  margin-top: 8px;
  font-weight: 400;
  font-size: 13px;
}

.label {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.code {
  font: 700 40px/1.1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.16em;
  text-align: center;
  margin: 6px 0 18px;
  user-select: all;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.small {
  font-size: 12px;
}

.fname {
  margin: 0 0 6px;
  font-weight: 600;
  word-break: break-all;
}

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

.row button {
  flex: 1;
}

.bar {
  height: 6px;
  border-radius: 99px;
  background: #0f1216;
  border: 1px solid var(--line);
  overflow: hidden;
  margin: 12px 0 10px;
}

.bar > div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #4f8cff, #6fe0c8);
  transition: width 0.2s linear;
}

.verify {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #101620;
  border: 1px solid #1f2a3a;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}

.verify b {
  font: 700 14px ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--text);
  letter-spacing: 0.08em;
}

.error h2 {
  margin: 0 0 6px;
  font-size: 18px;
  color: var(--danger);
}

.tips {
  margin: 14px 0 10px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.tips li {
  margin: 5px 0;
}

.diag {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #101620;
  border: 1px solid #1f2a3a;
  color: #9fb4d0;
  font: 12px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  word-break: break-word;
}

.relay-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.relay-list li {
  padding: 10px 12px;
  border-radius: 10px;
  background: #101620;
  border: 1px solid #1f2a3a;
  font-size: 13px;
  word-break: break-all;
}

.relay-list a {
  color: #7fb0ff;
  text-decoration: none;
}

.relay-list a:hover {
  text-decoration: underline;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: #222833;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
}
