:root {
  --ink: #17130f;
  --ink-2: #29241f;
  --muted: #706b63;
  --soft: #9a948b;
  --paper: #f7f6f2;
  --paper-2: #eeece5;
  --surface: #ffffff;
  --line: #dcd8cf;
  --line-strong: #bab3a8;
  --orange: #f15a24;
  --orange-dark: #cc4719;
  --mint: #dcefe6;
  --blue: #e1e9f8;
  --yellow: #f6df92;
  --green: #27745b;
  --red: #b42318;
  --shadow: 0 22px 58px rgba(23, 19, 15, 0.08);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.58;
  word-break: keep-all;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(23, 19, 15, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 19, 15, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

.platform-wrap {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.platform-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 246, 242, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.platform-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.platform-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.platform-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.platform-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.platform-nav a:hover,
.platform-nav a[aria-current="page"] {
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-weight: 900;
  line-height: 1.2;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--ink);
}

.btn.primary {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.btn.primary:hover {
  background: var(--orange);
  border-color: var(--orange);
}

.btn.orange {
  color: #fff;
  background: var(--orange);
  border-color: var(--orange);
}

.btn.orange:hover {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: var(--red);
  border-color: rgba(180, 35, 24, 0.3);
}

.btn.danger:hover {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.btn.full {
  width: 100%;
}

.page {
  padding: 54px 0 96px;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 44px;
  align-items: end;
  padding: 18px 0 42px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 30px;
  height: 2px;
  background: currentColor;
}

.page-title {
  max-width: 830px;
  margin-top: 18px;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 1.03;
  font-weight: 950;
}

.page-lede {
  max-width: 710px;
  margin-top: 20px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.6;
  font-weight: 760;
}

.head-note {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--orange);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.head-note strong {
  display: block;
  font-size: 22px;
  line-height: 1.22;
  font-weight: 950;
}

.head-note span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 34px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  min-height: 104px;
  padding: 18px;
  background: var(--surface);
}

.metric span,
.table-label,
.tiny-label {
  display: block;
  color: var(--soft);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 950;
}

.store-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented button {
  min-height: 38px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 900;
}

.segmented button.is-active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

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

.course-card {
  display: flex;
  flex-direction: column;
  min-height: 414px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(23, 19, 15, 0.055);
}

.course-thumb {
  position: relative;
  min-height: 154px;
  background:
    linear-gradient(135deg, rgba(241, 90, 36, 0.16), rgba(220, 239, 230, 0.72)),
    var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.course-thumb img {
  width: 100%;
  height: 154px;
  object-fit: cover;
  filter: saturate(0.84) contrast(1.05);
}

.course-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.1), rgba(23, 19, 15, 0.12));
}

.course-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  color: var(--green);
  background: var(--mint);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}

.badge.hot {
  color: var(--ink);
  background: var(--yellow);
}

.badge.pending {
  color: var(--muted);
  background: var(--paper-2);
}

.course-card h2 {
  margin-top: 16px;
  font-size: 26px;
  line-height: 1.16;
  font-weight: 950;
}

.course-card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 730;
}

.course-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 830;
}

.course-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 22px;
}

.course-price {
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
}

.checkout-panel,
.account-panel,
.admin-panel,
.composer-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.checkout-panel {
  position: sticky;
  top: 92px;
  padding: 22px;
}

.checkout-panel h2,
.account-panel h2,
.admin-panel h2,
.composer-panel h2 {
  font-size: 24px;
  line-height: 1.18;
  font-weight: 950;
}

.checkout-selected {
  margin-top: 16px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.checkout-selected strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 950;
}

.checkout-selected span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 780;
}

.price-lines {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.price-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-weight: 820;
}

.price-line.total {
  margin-top: 6px;
  padding-top: 14px;
  color: var(--ink);
  border-top: 1px solid var(--line);
  font-size: 24px;
  font-weight: 950;
}

.coupon-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 18px;
}

.field,
.textarea,
.select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
}

.field:focus,
.textarea:focus,
.select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.13);
}

.textarea {
  min-height: 96px;
  padding-top: 10px;
  resize: vertical;
}

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

.form-grid.full {
  grid-template-columns: 1fr;
}

.field-group {
  display: grid;
  gap: 6px;
}

.field-group label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.span-2 {
  grid-column: span 2;
}

.integration-note {
  margin-top: 16px;
  padding: 14px;
  color: var(--muted);
  background: var(--blue);
  border: 1px solid rgba(52, 84, 209, 0.14);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 760;
}

.admin-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.admin-rail {
  position: sticky;
  top: 92px;
  padding: 16px;
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
}

.admin-rail strong {
  display: block;
  font-size: 20px;
  line-height: 1.16;
  font-weight: 950;
}

.admin-rail nav {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.admin-rail a {
  padding: 11px 12px;
  color: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 850;
}

.admin-rail a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.admin-stack {
  display: grid;
  gap: 22px;
}

.admin-panel {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.panel-head p {
  max-width: 720px;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 760;
}

.panel-body {
  padding: 22px;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--soft);
  background: var(--paper);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.data-table td {
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}

.data-table strong {
  color: var(--ink);
  font-weight: 950;
}

.row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.icon-btn {
  min-height: 32px;
  padding: 0 9px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 900;
}

.icon-btn:hover {
  border-color: var(--ink);
}

.icon-btn.danger {
  color: var(--red);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.status-pill.active {
  color: var(--green);
  background: var(--mint);
}

.status-pill.warning {
  color: var(--ink);
  background: var(--yellow);
}

.account-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.account-panel {
  padding: 22px;
}

.login-options {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 15px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  font-weight: 950;
}

.login-btn.kakao {
  background: #fee500;
  border-color: #f2d700;
}

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

.purchase-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.purchase-item h3 {
  font-size: 23px;
  line-height: 1.18;
  font-weight: 950;
}

.purchase-item p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}

.progress {
  overflow: hidden;
  height: 9px;
  margin-top: 14px;
  background: var(--paper-2);
  border-radius: 999px;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--orange);
}

.purchase-meta {
  display: grid;
  gap: 8px;
  min-width: 168px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 820;
}

.empty-state {
  padding: 28px;
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 760;
  text-align: center;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  max-width: min(360px, calc(100vw - 44px));
  padding: 14px 16px;
  color: #fff;
  background: var(--ink);
  border-radius: 7px;
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.22);
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

@media (max-width: 1040px) {
  .store-layout,
  .account-layout,
  .admin-shell,
  .page-head {
    grid-template-columns: 1fr;
  }

  .checkout-panel,
  .admin-rail {
    position: static;
  }

  .admin-rail nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .platform-wrap {
    width: min(100% - 28px, var(--max));
  }

  .platform-topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px 0;
  }

  .platform-nav {
    width: 100%;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .platform-nav a {
    flex: 0 0 auto;
  }

  .platform-topbar .btn {
    display: none;
  }

  .page {
    padding-top: 36px;
  }

  .metric-strip,
  .catalog-grid,
  .form-grid,
  .purchase-item {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .course-price-row,
  .panel-head,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .course-price-row .btn,
  .panel-head .btn {
    width: 100%;
  }

  .admin-rail nav {
    grid-template-columns: 1fr;
  }

  .coupon-row {
    grid-template-columns: 1fr;
  }
}
