:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6ec;
  --text: #1a1f2b;
  --muted: #6b7280;
  --primary: #3b5bdb;
  --primary-fg: #ffffff;
  --danger: #d63939;
  --code: #f1f3f6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 600; color: var(--text); font-size: 18px; }
.me { color: var(--muted); font-size: 14px; margin-left: auto; }
.link { font-size: 14px; }

.container {
  max-width: 920px;
  margin: 32px auto;
  padding: 0 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-head h1 { margin: 0; font-size: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text); font-size: 14px;
  cursor: pointer; font: inherit;
}
.btn:hover { background: var(--code); text-decoration: none; }
.btn.primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.btn.primary:hover { background: #2c46c4; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.list { list-style: none; margin: 0; padding: 0; }
.list-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0; border-top: 1px solid var(--border);
}
.list-item:first-child { border-top: none; }
.row-link {
  flex: 1; display: flex; align-items: baseline; justify-content: space-between;
  padding: 4px 0;
  color: var(--text);
}
.row-link:hover { text-decoration: none; color: var(--primary); }
.row-title { font-weight: 500; }
.row-meta { color: var(--muted); font-size: 13px; }
.row-del {
  background: none; border: 1px solid var(--border); color: var(--muted);
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: 16px;
}
.row-del:hover { color: var(--danger); border-color: var(--danger); }

.form { display: flex; flex-direction: column; gap: 14px; }
.form .row { display: flex; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.small { flex: 1; }
.field > span { font-size: 13px; color: var(--muted); }
.field input, .field textarea {
  font: inherit; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface); color: var(--text);
  width: 100%;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.muted { color: var(--muted); font-size: 14px; }
.error { color: var(--danger); font-size: 14px; margin: 0; }

.view { display: flex; flex-direction: column; }
.view-main { flex: 1; display: flex; min-height: 0; }
.stage {
  flex: 1; background: #1a1f2b; display: flex; align-items: stretch; justify-content: stretch;
  padding: 12px; min-width: 0;
}
#deck {
  flex: 1; width: 100%; height: 100%; border: none; background: #ffffff;
  border-radius: 6px;
}
.sidebar {
  width: 360px; flex-shrink: 0;
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 16px 20px; overflow-y: auto;
  gap: 14px;
}
.sidebar h1 { font-size: 16px; margin: 0; }

.comments { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.comment {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 12px;
}
.comment-head {
  display: flex; gap: 8px; align-items: baseline; justify-content: space-between;
  margin-bottom: 4px;
}
.comment-slide { font-weight: 600; color: var(--primary); font-size: 13px; }
.comment-meta { color: var(--muted); font-size: 12px; }
.comment-body { white-space: pre-wrap; word-wrap: break-word; font-size: 14px; }
