:root {
  --bg: #f3f0e8;
  --paper: #fffdf7;
  --ink: #1f1a14;
  --muted: #6d6257;
  --line: #d9cfbf;
  --brand: #8d5b2b;
  --brand-dark: #5f3a19;
  --accent: #d7a55a;
  --danger: #a33322;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(215, 165, 90, 0.22), transparent 30%),
    linear-gradient(180deg, #f7f1e4 0%, var(--bg) 55%, #efe6d6 100%);
  font-family: "Noto Sans KR", sans-serif;
}

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

.site-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 253, 247, 0.85);
  backdrop-filter: blur(12px);
}

.brand {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.hero,
.auth-card,
.editor-card,
.empty-card,
.course-row,
.course-pane,
.note-pane {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(78, 57, 24, 0.08);
}

.empty-card {
  padding: 28px 24px;
}

.hero {
  margin-top: 28px;
  padding: 56px;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.hero-copy {
  width: min(420px, 100%);
}

.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image {
  width: min(100%, 520px);
  max-height: 420px;
  object-fit: contain;
  display: block;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

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

.hero h1 {
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.06;
  margin-bottom: 16px;
}

.hero-text,
.meta-text,
.pane-head p,
.course-row p {
  color: var(--muted);
}

.hero-actions,
.form-actions,
.course-row-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  align-self: center;
}

.primary-button,
.ghost-button,
.warn-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.ghost-button {
  background: transparent;
  border-color: var(--line);
}

.warn-button {
  background: var(--danger);
  color: #fff;
}

.full-width {
  width: 100%;
}

.auth-card {
  width: min(480px, 100%);
  margin: 48px auto 0;
  padding: 28px;
}

.auth-card form,
.editor-card,
.note-form {
  display: grid;
  gap: 16px;
}

label span {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

input[type="text"],
input[type="password"],
textarea,
input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 14px 16px;
  font: inherit;
}

textarea {
  resize: vertical;
  min-height: 180px;
}

.rich-editor-shell {
  display: grid;
  gap: 12px;
}

.rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-tool {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.editor-tool:disabled {
  opacity: 0.45;
  cursor: default;
}

.rich-editor {
  min-height: 420px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: #9a8f82;
}

.rich-editor:focus {
  outline: 2px solid rgba(141, 91, 43, 0.18);
  border-color: var(--brand);
}

.rich-editor img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  cursor: pointer;
}

.rich-editor img.is-selected {
  outline: 3px solid rgba(141, 91, 43, 0.6);
  outline-offset: 2px;
}

.rich-editor table,
.rich-block table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.rich-editor td,
.rich-editor th,
.rich-block td,
.rich-block th {
  border: 1px solid var(--line);
  padding: 8px 10px;
}

.rich-editor blockquote,
.rich-block blockquote {
  margin: 12px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--accent);
  background: #f8f1e4;
}

.page-head {
  margin-top: 28px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.course-list {
  display: grid;
  gap: 16px;
}

.course-row {
  padding: 22px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.course-row-top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.status-pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.published {
  background: #ebe3d0;
  color: var(--brand-dark);
}

.status-pill.draft {
  background: #f2d8d2;
  color: var(--danger);
}

.split-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.course-pane,
.note-pane {
  padding: 24px;
}

.rich-block {
  line-height: 1.75;
  font-size: 16px;
}

.attachment-panel {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.file-link {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  background: #f3ead9;
  border: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.editor-shell {
  margin-top: 28px;
}

.editor-card {
  padding: 24px;
}

.management-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
}

.student-list {
  display: grid;
  gap: 14px;
}

.student-row {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fcf8ef;
}

.student-row-head,
.student-row-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.flash-banner {
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 16px;
  background: #ebe3d0;
  border: 1px solid var(--line);
  font-weight: 700;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row span {
  margin: 0;
}

.error-text {
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 900px) {
  .split-layout {
    grid-template-columns: 1fr;
  }

  .management-grid {
    grid-template-columns: 1fr;
  }

  .course-row,
  .topbar,
  .page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .hero {
    padding: 32px 24px;
    min-height: auto;
    flex-direction: column;
  }
}
