:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: rgba(20, 27, 42, 0.66);
  --panel-strong: rgba(26, 34, 52, 0.92);
  --border: rgba(148, 163, 184, 0.14);
  --text: #e9eefb;
  --muted: #8b9bb4;
  --accent: #6ee7c8;
  --accent-soft: rgba(110, 231, 200, 0.12);
  --blue: #7aa2ff;
  --danger: #fb7185;
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0 20px 48px;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  line-height: 1.6;
  background:
    radial-gradient(1000px 620px at 12% -10%, rgba(122, 162, 255, 0.18), transparent 62%),
    radial-gradient(900px 520px at 92% 0%, rgba(110, 231, 200, 0.12), transparent 58%),
    linear-gradient(180deg, #080b12 0%, #060810 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.aurora {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 60vh;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(110, 231, 200, 0.08), transparent);
  filter: blur(30px);
  z-index: -1;
}

.hero {
  max-width: 980px;
  margin: 0 auto;
  padding: 72px 0 40px;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 22px;
  padding: 7px 16px 7px 13px;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(110, 231, 200, 0.28);
  border-radius: 999px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(110, 231, 200, 0.6);
  animation: pulse 2.4s infinite;
}

.badge.offline {
  color: var(--danger);
  background: rgba(251, 113, 133, 0.1);
  border-color: rgba(251, 113, 133, 0.3);
}

.badge.offline .dot {
  background: var(--danger);
  animation: none;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(110, 231, 200, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(110, 231, 200, 0); }
  100% { box-shadow: 0 0 0 0 rgba(110, 231, 200, 0); }
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(2.3rem, 6.4vw, 3.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.accent {
  background: linear-gradient(100deg, var(--accent), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  margin: 0 auto 26px;
  max-width: 34em;
  color: var(--muted);
  font-size: 1.02rem;
}

.url-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.url-row code {
  padding: 9px 16px;
  font-family: "Cascadia Code", Consolas, ui-monospace, monospace;
  font-size: 0.9rem;
  color: var(--text);
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--border);
  border-radius: 12px;
  user-select: all;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ghost {
  padding: 9px 16px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

.ghost:hover {
  color: var(--text);
  border-color: rgba(110, 231, 200, 0.4);
}

main {
  max-width: 980px;
  margin: 0 auto;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 30px;
}

.card {
  position: relative;
  padding: 20px 20px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(110, 231, 200, 0.5), transparent);
  opacity: 0.7;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

.value {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.hint {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board {
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 26px;
  backdrop-filter: blur(14px);
}

.board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.board-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.composer {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 210px) minmax(0, 1fr);
  padding: 18px;
  background: rgba(8, 11, 18, 0.5);
  border: 1px solid var(--border);
  border-radius: 18px;
  margin-bottom: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > span {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.field-text {
  grid-column: 2;
  grid-row: 1;
}

.field-name {
  grid-row: 1;
}

input,
textarea {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 0.94rem;
  color: var(--text);
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--border);
  border-radius: 12px;
  resize: vertical;
  transition: border-color 0.16s ease, background 0.16s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(139, 155, 180, 0.6);
}

input:focus,
textarea:focus {
  border-color: rgba(110, 231, 200, 0.5);
  background: rgba(148, 163, 184, 0.1);
}

.composer-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.primary {
  padding: 10px 26px;
  font-weight: 600;
  color: #04211a;
  background: linear-gradient(120deg, var(--accent), #8ef0d8);
  box-shadow: 0 8px 22px rgba(110, 231, 200, 0.18);
}

.primary:hover {
  transform: translateY(-1px);
}

.primary:disabled {
  cursor: progress;
  opacity: 0.6;
  transform: none;
}

.messages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.message {
  display: flex;
  gap: 14px;
  padding: 14px 12px;
  border-radius: 14px;
}

.message + .message {
  border-top: 1px solid rgba(148, 163, 184, 0.09);
}

.message:hover {
  background: rgba(148, 163, 184, 0.045);
}

.avatar {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: #04211a;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  border-radius: 50%;
}

.message-body {
  min-width: 0;
  flex: 1;
}

.message-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 2px;
}

.message-name {
  font-weight: 600;
  font-size: 0.94rem;
}

.message-time {
  font-size: 0.76rem;
  color: var(--muted);
}

.message-text {
  margin: 0;
  font-size: 0.94rem;
  color: #cdd8ea;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.empty {
  margin: 18px 0 4px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

footer {
  max-width: 980px;
  margin: 42px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

footer p {
  margin: 4px 0;
}

footer a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed rgba(110, 231, 200, 0.4);
}

.paw {
  margin-right: 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  max-width: min(92vw, 420px);
  padding: 11px 20px;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.ok {
  border-color: rgba(110, 231, 200, 0.4);
}

.toast.error {
  border-color: rgba(251, 113, 133, 0.45);
}

@media (max-width: 620px) {
  body {
    padding: 0 14px 36px;
  }

  .hero {
    padding: 48px 0 30px;
  }

  .board {
    padding: 18px;
    border-radius: 20px;
  }

  .composer {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .field-text {
    grid-column: 1;
    grid-row: auto;
  }

  .field-name {
    grid-row: auto;
  }

  .composer-foot {
    grid-column: 1;
  }

  .value {
    font-size: 1.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
