:root {
  --bg0: #070709;
  --bg1: #101014;
  --bg2: #18181f;
  --card: #14141b;
  --line: #2a2a35;
  --text: #f3f3f6;
  --muted: #9a9aa8;
  --red: #e10600;
  --red-dim: #8a0a0a;
  --ok: #3dd68c;
  --warn: #f5c542;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  background:
    radial-gradient(1200px 500px at 50% -80px, rgba(225, 6, 0, 0.18), transparent 55%),
    var(--bg0);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 80px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand .kicker {
  letter-spacing: 0.22em;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}
.brand h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.brand h1 span { color: var(--red); }
.home-link {
  color: var(--muted);
  font-size: 13px;
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 999px;
}
.home-link:hover { color: #fff; border-color: #444; }

.list {
  display: grid;
  gap: 14px;
}
.item {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.item:hover {
  transform: translateY(-2px);
  border-color: #4a1a1a;
}
.thumb {
  background: #0c0c10;
  min-height: 110px;
  position: relative;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 110px;
}
.thumb .empty {
  width: 100%;
  height: 100%;
  min-height: 110px;
  display: grid;
  place-items: center;
  color: #555;
  font-size: 12px;
  background: linear-gradient(160deg, #1a1a22, #0d0d12);
}
.meta { padding: 16px 16px 16px 0; min-width: 0; }
.meta h2 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.excerpt {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.date {
  font-size: 12px;
  color: #6e6e7c;
}

.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.view-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero {
  background: #0b0b10;
}
.hero img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}
.view-body { padding: 28px 26px 36px; }
.view-body h1 {
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: -0.04em;
  line-height: 1.25;
}
.view-date {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 22px;
}
.content {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 16.5px;
  color: #e8e8ee;
}
.embed-wrap {
  margin-top: 28px;
  display: grid;
  gap: 18px;
}
.embed {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.embed.yt { padding-top: 56.25%; }
.embed.yt iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.embed.tk iframe {
  width: 100%;
  min-height: 740px;
  border: 0;
  display: block;
}
.back {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}
.back:hover { color: #fff; }

/* admin */
.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-danger { background: #3a0d0d; color: #ffb4b4; }
.btn-sm { padding: 7px 10px; font-size: 12px; }

.login-box, .form-box, .admin-list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
}
label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 6px;
}
input[type="text"], input[type="password"], input[type="url"], textarea {
  width: 100%;
  background: #0d0d12;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
}
textarea { min-height: 180px; resize: vertical; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.preview {
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
  max-width: 360px;
  border: 1px solid var(--line);
}
.preview img { width: 100%; }
.msg { font-size: 13px; margin-top: 10px; }
.msg.ok { color: var(--ok); }
.msg.err { color: #ff8d8d; }
.admin-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.admin-item:last-child { border-bottom: 0; }
.hidden { display: none !important; }
.note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

@media (max-width: 680px) {
  .item { grid-template-columns: 1fr; }
  .thumb img, .thumb .empty { min-height: 180px; }
  .meta { padding: 14px 16px 16px; }
  .view-body { padding: 20px 16px 28px; }
  .view-body h1 { font-size: 24px; }
  .brand h1 { font-size: 28px; }
  .embed.tk iframe { min-height: 620px; }
}
