:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f4f6f8;
  color: #1f2933;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.app-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0 24px;
  border-bottom: 1px solid #d9e1e8;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
}

#status {
  margin-top: 8px;
  color: #52616f;
  font-size: 14px;
}

#status[data-state="ok"] {
  color: #16815f;
}

#status[data-state="bad"] {
  color: #b42318;
}

.token-form {
  display: flex;
  gap: 10px;
  min-width: min(420px, 100%);
}

.token-form input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 1px solid #c5d0da;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 15px;
}

.token-form button {
  height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: #1f6feb;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.message-panel {
  margin-top: 28px;
  background: #fff;
  border: 1px solid #d9e1e8;
  border-radius: 8px;
  min-height: 540px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #e6edf3;
}

.panel-head h2 {
  font-size: 18px;
}

#count {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 28px;
  border-radius: 999px;
  background: #edf2f7;
  color: #394b59;
  font-size: 13px;
  font-weight: 700;
}

.messages {
  height: min(68vh, 640px);
  overflow: auto;
  padding: 16px;
}

.empty {
  height: 100%;
  display: grid;
  place-items: center;
  color: #7b8794;
}

.message {
  padding: 14px 0;
  border-bottom: 1px solid #edf2f7;
}

.message:first-child {
  padding-top: 0;
}

.message-meta {
  color: #607080;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.message-text {
  margin-top: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1080px);
    padding: 18px 0;
  }

  .topbar,
  .token-form {
    flex-direction: column;
    align-items: stretch;
  }

  .message-panel {
    min-height: 480px;
  }
}
