* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f7ff;
  --card: #ffffff;
  --text: #1a2437;
  --muted: #6b7487;
  --accent: #1a73e8;
  --border: #d9e1f0;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: linear-gradient(140deg, #eef3ff 0%, var(--bg) 55%, #eef6ff 100%);
}

.app {
  width: min(850px, 92vw);
  margin: 36px auto 50px;
}

h1 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
}

.subtitle {
  margin: 8px 0 18px;
  color: var(--muted);
}

.composer,
.reply-form {
  display: grid;
  gap: 10px;
}

.composer {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 8px 22px rgba(26, 36, 55, 0.07);
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid #cad5e7;
  border-radius: 10px;
  padding: 10px 11px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: #84abed;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

button {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  padding: 9px 14px;
  cursor: pointer;
  justify-self: start;
}

.comment-list {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.comment {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.author {
  font-weight: 700;
}

.time {
  color: var(--muted);
  font-size: 0.82rem;
}

.comment-text {
  margin: 8px 0 10px;
  color: #2a3447;
  line-height: 1.5;
  white-space: pre-wrap;
}

.actions {
  display: flex;
  gap: 8px;
}

.actions button {
  background: #e8f0fe;
  color: #1a73e8;
  padding: 7px 10px;
  font-size: 0.88rem;
}

.children {
  margin-top: 10px;
  margin-left: 18px;
  border-left: 2px solid #dce6fa;
  padding-left: 12px;
  display: grid;
  gap: 10px;
}

.reply-wrap {
  margin-top: 10px;
}

.reply-form {
  background: #f8fbff;
  border: 1px solid #dbe5f6;
  border-radius: 10px;
  padding: 10px;
}

.hidden {
  display: none;
}
