:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #65717e;
  --line: #dce2e8;
  --surface: #ffffff;
  --canvas: #f4f6f8;
  --primary: #1c5d99;
  --primary-dark: #164a7a;
  --danger: #a52a2a;
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); line-height: 1.55; }
a { color: var(--primary); }
code { overflow-wrap: anywhere; }
.topbar { min-height: 64px; padding: 0 4vw; display: flex; align-items: center; gap: 28px; background: #14283b; color: #fff; }
.brand { color: #fff; font-size: 1.1rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.topbar nav { display: flex; align-self: stretch; }
.topbar nav a { display: flex; align-items: center; padding: 0 14px; color: #dce8f2; text-decoration: none; border-bottom: 3px solid transparent; }
.topbar nav a:hover, .topbar nav a.active { color: #fff; border-color: #69b3f2; }
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.account form { margin: 0; }
.link-button { padding: 0; border: 0; background: transparent; color: #b9d8f2; text-decoration: underline; cursor: pointer; }
.container { width: min(1180px, 92vw); margin: 36px auto 72px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 0 0 4px; font-size: 1.75rem; }
.page-heading p { margin: 0; color: var(--muted); }
.panel, .auth-card { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 16px rgb(21 39 56 / 5%); }
.auth-card { width: min(440px, 100%); margin: 10vh auto 0; }
.auth-card h1 { margin-top: 0; }
.muted { color: var(--muted); }
.notice { margin-bottom: 20px; padding: 14px 18px; border-radius: 8px; }
.notice ul { margin-bottom: 0; }
.notice.success { background: #e8f7ee; border: 1px solid #94d3aa; color: #195d31; }
.notice.error { background: #fff0f0; border: 1px solid #e2aaaa; color: #7d2020; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stats a { padding: 22px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.stats strong { color: var(--ink); font-size: 2rem; }
.stats span { color: var(--muted); }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: #4d5965; background: #f8fafb; font-size: .85rem; }
tbody tr:last-child td { border-bottom: 0; }
.actions { white-space: nowrap; text-align: right; }
.actions a { margin-left: 12px; }
.empty { padding: 40px; color: var(--muted); text-align: center; }
.button, button { appearance: none; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 15px; border: 1px solid #b9c3cc; border-radius: 7px; background: #fff; color: var(--ink); font: inherit; text-decoration: none; cursor: pointer; }
.button:hover, button:hover { background: #f5f7f9; }
.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.primary:hover { background: var(--primary-dark); }
.danger { border-color: var(--danger); background: #fff; color: var(--danger); }
.stack-form { display: flex; flex-direction: column; gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 7px; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid #abb6c0; border-radius: 6px; background: #fff; color: var(--ink); font: inherit; }
textarea { resize: vertical; line-height: 1.65; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgb(28 93 153 / 18%); border-color: var(--primary); }
input:disabled { background: #eef1f4; }
input:read-only { background: #eef1f4; color: #46515c; }
label small { color: var(--muted); font-weight: 400; }
.generated-value { min-height: 43px; padding: 9px 11px; border: 1px dashed #abb6c0; border-radius: 6px; background: #f7f9fa; color: #46515c; font-weight: 400; }
.check-row { flex-direction: row; align-items: center; font-weight: 400; }
.check-row input { width: auto; min-height: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding-top: 20px; }
.danger-zone { margin-top: 28px; padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border: 1px solid #e0b6b6; border-radius: 10px; background: #fff8f8; }
.danger-zone p { margin: 3px 0 0; color: var(--muted); }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.badge.published { background: #dff4e6; color: #176030; }
.badge.scheduled { background: #e8edff; color: #2c438e; }
.badge.draft { background: #e9edf0; color: #52606c; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 22px; }
.pagination a, .pagination span { padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; text-decoration: none; }
.pagination span[aria-disabled] { color: #9aa4ad; }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.media-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.media-card img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; background: #e9edf0; }
.media-card div { padding: 13px; display: flex; flex-direction: column; gap: 3px; }
.media-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card span { color: var(--muted); font-size: .85rem; }
.current-image { display: grid; grid-template-columns: minmax(240px, 420px) 1fr; gap: 24px; margin-bottom: 24px; }
.current-image img { width: 100%; max-height: 320px; object-fit: contain; background: #eef1f4; }
.current-image dl { margin: 0; }
.current-image dl div { margin-bottom: 14px; }
.current-image dt { color: var(--muted); font-size: .85rem; }
.current-image dd { margin: 2px 0 0; }
.preview { max-width: 860px; margin-inline: auto; }
.preview > h1 { margin: 22px 0; font-size: 2rem; }
.preview-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: .9rem; }
.preview-image { width: 100%; max-height: 540px; object-fit: contain; margin-bottom: 24px; background: #eef1f4; }
.rendered-body { font-size: 1.05rem; line-height: 1.8; overflow-wrap: anywhere; }
.rendered-body p, .rendered-body ul { margin: 0 0 1.2em; }
@media (max-width: 800px) {
  .topbar { padding: 14px 4vw; flex-wrap: wrap; gap: 10px 18px; }
  .topbar nav { order: 3; width: 100%; overflow-x: auto; }
  .topbar nav a { padding: 10px 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid, .current-image { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; }
}
@media (max-width: 480px) {
  .account span { display: none; }
  .container { width: 94vw; margin-top: 24px; }
  .stats, .media-grid { grid-template-columns: 1fr; }
  .page-heading { flex-direction: column; }
  .danger-zone { align-items: flex-start; flex-direction: column; }
}
