/* oekaki BBS — shadcn/ui 디자인 토큰 (zinc + 커스텀 blue primary) */
* { box-sizing: border-box; }

/* ── shadcn 토큰 (light) ─────────────────────────────── */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --primary: 222 64% 47%;          /* #2c5cc5 — 오에카키 브랜드 블루 */
  --primary-foreground: 0 0% 100%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 222 64% 47%;
  --radius: 0.5rem;
}
/* ── shadcn 토큰 (dark — 토글 준비) ──────────────────── */
.dark {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --card-foreground: 0 0% 98%;
  --primary: 222 70% 60%;
  --primary-foreground: 240 5.9% 10%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --accent: 240 3.7% 15.9%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 3.7% 15.9%;
  --input: 240 3.7% 15.9%;
  --ring: 222 70% 60%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
}

header, main, footer {
  max-width: 720px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
header { padding-top: 24px; padding-bottom: 4px; }
h1 { font-size: 1.4rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 0.3em 0; }

a { color: hsl(var(--primary)); text-decoration: none; }
a:hover { text-decoration: underline; }

nav { margin: 6px 0; }
nav p { margin: 4px 0; }
nav.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: hsl(var(--background) / 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid hsl(var(--border));
  margin-bottom: 14px;
}
.navinner {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
h1.brand { font-size: 1.12rem; margin: 0; white-space: nowrap; }
nav.topnav .cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 2.25rem;
  padding: 0 1rem;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 0.875rem;
  font-weight: 500;
}
nav.topnav .cta:hover { background: hsl(var(--primary) / 0.9); text-decoration: none; color: hsl(var(--primary-foreground)); }
nav.topnav .nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: calc(var(--radius) - 2px);
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  font-weight: 500;
}
nav.topnav .nav-item:hover { background: hsl(var(--accent)); color: hsl(var(--primary)); text-decoration: none; }
nav.topnav .nav-item.active { background: hsl(var(--accent)); color: hsl(var(--primary)); }
nav.topnav .spacer { flex: 1; }
nav.sortbar {
  display: flex;
  width: 100%;
  margin: 0 0 16px;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
}
nav.sortbar a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 12px;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}
nav.sortbar a + a { border-left: 1px solid hsl(var(--border)); }
nav.sortbar a:hover { background: hsl(var(--accent)); color: hsl(var(--primary)); text-decoration: none; }
nav.sortbar a.active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
h1 svg, h2 svg, p svg, footer a svg { vertical-align: -2px; }
h1 svg, h2 svg { margin-right: 5px; }

/* ── Button (shadcn) ─────────────────────────────────── */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  height: 2.25rem;
  padding: 0 1rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
button svg { flex: none; }
button:hover { background: hsl(var(--secondary) / 0.8); }
button:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
button:disabled { opacity: 0.5; pointer-events: none; }
button[type=submit] {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
button[type=submit]:hover { background: hsl(var(--primary) / 0.9); }
button[type=reset] {
  background: transparent;
  border: 1px solid hsl(var(--input));
  color: hsl(var(--foreground));
}
button[type=reset]:hover { background: hsl(var(--accent)); }
label { cursor: pointer; }

/* ── Card (shadcn) ───────────────────────────────────── */
article, blockquote {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  padding: 12px 16px;
  margin: 14px 0;
}
figure { margin: 0 0 6px; }
figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  image-rendering: pixelated;   /* 도트 그림 선명 유지 */
}
p.chead {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0 4px;
}
p.chead .leader {
  flex: 1;
  min-width: 24px;
  overflow: hidden;
  color: hsl(var(--border));
  white-space: nowrap;
  align-self: center;
}
p.chead .leader::before {
  content: "········································································";
  letter-spacing: 3px;
}
p.chead .cdate {
  color: hsl(var(--muted-foreground));
  font-size: 0.9em;
  white-space: nowrap;
  text-align: right;
}
p.cbody { margin: 0; overflow-wrap: anywhere; }
div.comment { scroll-margin-top: 60px; }   /* sticky 네비바 높이만큼 여유 */
div.comment:target { background: hsl(var(--accent)); }
article p { margin: 4px 0; overflow-wrap: anywhere; }

hr { border: 0; border-top: 1px solid hsl(var(--border)); margin: 12px 0; }
ol { margin: 8px 0; padding-left: 22px; }

/* ── Input (shadcn) ──────────────────────────────────── */
input[type=text], input[type=password], textarea {
  font: inherit;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  background: transparent;
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  padding: 0.5rem 0.75rem;
  max-width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type=text]:focus-visible, input[type=password]:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}
textarea { width: 100%; min-height: 5.5em; resize: vertical; }
::placeholder { color: hsl(var(--muted-foreground)); }

footer { color: hsl(var(--muted-foreground)); font-size: 0.85rem; padding-bottom: 28px; }
footer p { margin: 10px 0 0; }
label.delbox { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; color: hsl(var(--destructive)); font-size: 0.9em; }
label.delbox input { accent-color: hsl(var(--destructive)); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
p.chead a svg, label.delbox svg { vertical-align: -2px; }
p.hint { color: hsl(var(--muted-foreground)); font-size: 0.88em; margin: 4px 0; }
p.hint svg { vertical-align: -2px; margin-right: 3px; }
main > article:first-of-type h2 svg { vertical-align: -3px; }
footer .credit { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
a.admin-link { display: inline-flex; align-items: center; gap: 4px; color: hsl(var(--muted-foreground) / 0.6); font-size: 0.85em; }
a.admin-link:hover { color: hsl(var(--primary)); }
h1.brand a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
h1.brand a:hover { color: hsl(var(--primary)); }
article { scroll-margin-top: 60px; }
article:target { border-color: hsl(var(--primary)); }
footer .notice { color: hsl(var(--muted-foreground) / 0.8); font-size: 0.78em; margin: 8px 0 0; line-height: 1.5; }
footer .notice a { color: hsl(var(--muted-foreground)); text-decoration: underline; }
h1.brand { display: flex; align-items: baseline; gap: 8px; }
h1.brand .basedon { color: hsl(var(--muted-foreground) / 0.7); font-size: 0.7em; white-space: nowrap; }