:root {
  --bg: #f3ede0;
  --bg-strong: #e7dcc7;
  --surface: rgba(255, 252, 247, 0.78);
  --surface-strong: rgba(255, 252, 247, 0.96);
  --line: rgba(60, 43, 24, 0.14);
  --text: #261c12;
  --muted: #6b5847;
  --accent: #8f4c2f;
  --accent-strong: #6a3118;
  --success: #2d6b43;
  --danger: #9e2f2f;
  --shadow: 0 20px 50px rgba(56, 37, 17, 0.08);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  background: linear-gradient(180deg, #f6f0e6 0%, #e8ddca 100%);
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(179, 126, 86, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(111, 78, 55, 0.12), transparent 24%),
    linear-gradient(180deg, #f6f0e6 0%, #e8ddca 100%);
  font-family: "Noto Sans KR", "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
    "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(18px);
  background: rgba(246, 240, 230, 0.82);
  border-bottom: 1px solid var(--line);
}

.site-header__inner,
.site-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
}

.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 18px 0;
}

.site-title {
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.site-subtitle,
.muted,
.reader-header__subtitle,
.comments-panel__header p,
.hero__text {
  color: var(--muted);
}

.site-subtitle {
  margin: 4px 0 0;
  font-size: 0.94rem;
}

.site-nav,
.button-row,
.reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.site-nav__link,
.button,
.badge {
  border-radius: 999px;
  border: 1px solid var(--line);
}

.site-nav__link {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.55);
}

.button,
.badge {
  background: var(--accent);
  color: #fff7ee;
}

.locale-switcher {
  position: relative;
  font-family: inherit;
}

.locale-switcher__toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}

.locale-switcher__toggle::-webkit-details-marker {
  display: none;
}

.locale-switcher[open] .locale-switcher__caret {
  transform: rotate(180deg);
}

.locale-switcher__caret {
  display: inline-block;
  transition: transform 0.15s ease;
  font-size: 0.8rem;
}

.locale-switcher__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 20;
}

.locale-switcher__item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  font-weight: 500;
}

.locale-switcher__item:hover {
  background: rgba(143, 76, 47, 0.08);
}

.locale-switcher__item.is-active {
  background: var(--accent);
  color: #fff7ee;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
}

.button--secondary {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
}

.button--small {
  padding: 10px 14px;
  font-size: 0.92rem;
}

.site-shell {
  padding: 28px 0 60px;
}

.flash {
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(45, 107, 67, 0.12);
  color: var(--success);
  border: 1px solid rgba(45, 107, 67, 0.22);
}

.flash--error {
  background: rgba(158, 47, 47, 0.1);
  color: var(--danger);
  border-color: rgba(158, 47, 47, 0.18);
}

.hero,
.dashboard-hero,
.panel,
.chapter-card,
.reader-header,
.comments-panel,
.comic-page-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero,
.dashboard-hero {
  padding: 32px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  margin-bottom: 14px;
}

h2 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.stats-grid,
.dashboard-grid {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card,
.panel,
.chapter-card,
.comment-card {
  padding: 18px;
}

.stat-card dt {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card dd {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
}

.section-group {
  margin-bottom: 28px;
}

.section-group__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 12px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.chapter-card {
  display: grid;
  gap: 14px;
}

.chapter-card__number {
  display: inline-flex;
  width: fit-content;
  align-items: baseline;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--bg-strong);
}

.chapter-card__number span {
  color: var(--muted);
  font-size: 0.85rem;
}

.chapter-card__number strong {
  font-size: 1.2rem;
}

.reader-shell {
  display: grid;
  gap: 18px;
}

.reader-header {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.toolbar-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.comic-strip {
  display: grid;
  gap: 18px;
}

.comic-page-card {
  padding: 14px;
}

.comic-page-card__meta,
.comment-card__header,
.reader-pagination,
.bar-row,
.plain-list li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.comic-page-card__meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.comic-page {
  width: 100%;
  border-radius: 18px;
}

.reader-pagination {
  align-items: center;
}

.comments-panel {
  padding: 24px;
}

.comments-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.comment-form,
.comment-list {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

label {
  font-weight: 700;
}

input[type="text"],
textarea {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(56, 37, 17, 0.15);
  background: var(--surface-strong);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
}

textarea {
  resize: vertical;
}

.comment-card {
  background: rgba(255, 252, 247, 0.8);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.comment-card__header {
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.comment-card__body p:last-child {
  margin-bottom: 0;
}

.badge {
  padding: 10px 14px;
  font-size: 0.86rem;
}

.panel--wide {
  grid-column: 1 / -1;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  align-items: center;
}

.bar-row__label {
  flex: 0 0 34%;
  font-size: 0.92rem;
}

.bar-row__track {
  flex: 1 1 auto;
  height: 12px;
  border-radius: 999px;
  background: rgba(143, 76, 47, 0.12);
  overflow: hidden;
}

.bar-row__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #be7a54 0%, #7e3f24 100%);
}

.bar-row__value {
  flex: 0 0 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.locale-stacks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.plain-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.plain-list li {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.honeypot-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.back-link {
  margin: 0 0 14px;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.back-link a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.85);
}

.webtoon-card {
  position: relative;
}

.webtoon-card__tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(143, 76, 47, 0.12);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.section-group__header p.muted {
  margin: 6px 0 0;
  font-size: 0.92rem;
}

@media (max-width: 860px) {
  .reader-header,
  .comments-panel__header,
  .reader-pagination,
  .locale-stacks,
  .dashboard-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .dashboard-grid {
    display: grid;
  }

  .reader-pagination > div,
  .button {
    width: 100%;
  }

  .bar-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .bar-row__label,
  .bar-row__value,
  .bar-row__track {
    width: 100%;
    flex: initial;
  }
}

/* Mobile: 헤더 압축 + 만화 이미지 풀블리드 */
@media (max-width: 640px) {
  .site-header__inner {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
  }

  .site-title {
    font-size: 1.05rem;
    letter-spacing: -0.02em;
  }

  .site-subtitle,
  .site-nav {
    display: none;
  }

  .locale-switcher__toggle {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .locale-switcher__menu {
    min-width: 140px;
  }

  .site-shell {
    padding: 16px 0 40px;
  }

  .hero,
  .dashboard-hero {
    padding: 20px;
    margin-bottom: 18px;
    border-radius: 18px;
  }

  h1 {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
    line-height: 1.05;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-card dd {
    font-size: 1.3rem;
  }

  .section-group {
    margin-bottom: 20px;
  }

  /* 만화 리더: 뷰포트 좌우 끝까지 채우는 풀블리드 브레이크아웃 */
  .comic-strip {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    gap: 0;
  }

  .comic-page-card {
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .comic-page-card__meta {
    padding: 8px 16px;
    margin: 0;
    font-size: 0.82rem;
  }

  .comic-page {
    display: block;
    width: 100%;
    margin: 0;
    border-radius: 0;
  }

  .reader-header {
    padding: 18px;
    border-radius: 18px;
  }

  .reader-header h1 {
    font-size: 1.35rem;
    line-height: 1.2;
    margin-bottom: 8px;
  }

  .reader-header__subtitle {
    font-size: 0.9rem;
  }

  .reader-toolbar {
    margin-top: 12px;
  }

  .comments-panel {
    padding: 18px;
    border-radius: 18px;
  }
}
