:root {
  --ink: #111827;
  --ink-2: #374151;
  --ink-3: #667085;
  --muted: #8993a4;
  --page: #f4f6f8;
  --panel: #ffffff;
  --line: rgba(17, 24, 39, 0.1);
  --line-strong: rgba(17, 24, 39, 0.16);
  --blue: #2457a6;
  --blue-soft: #edf4ff;
  --mint: #0f766e;
  --mint-soft: #e8f7f4;
  --coral: #d94f3d;
  --coral-soft: #fff0ed;
  --gold: #b7791f;
  --gold-soft: #fff7df;
  --radius: 8px;
  --shadow: 0 20px 54px rgba(15, 23, 42, 0.08);
  color: var(--ink);
  font-family: "Pretendard", "Inter", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, #ffffff 0, #f6f8fb 340px, #eef3f7 100%);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

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

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 250px minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: #111827;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 950;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 20px;
  line-height: 1.2;
}

.brand small {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 800;
}

.search-box {
  min-height: 46px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.search-box input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 15px;
  font-weight: 750;
}

.search-box span {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
}

.primary-action,
.composer-actions button {
  min-height: 44px;
  padding: 0 18px;
  color: #ffffff;
  background: var(--blue);
  border: 0;
  border-radius: var(--radius);
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(36, 87, 166, 0.18);
  white-space: nowrap;
}

.workspace {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 390px;
  gap: 24px;
  align-items: start;
}

.left-rail,
.detail-column {
  position: sticky;
  top: 96px;
  min-width: 0;
}

.rail-section,
.feed-column,
.discussion-panel,
.composer {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.rail-section {
  padding: 18px;
}

.rail-section + .rail-section {
  margin-top: 16px;
}

.rail-section h2 {
  margin: 0 0 12px;
  color: var(--ink-2);
  font-size: 14px;
}

.board-nav {
  display: grid;
  gap: 6px;
}

.board-nav button {
  min-height: 40px;
  padding: 9px 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: 7px;
  text-align: left;
  font-size: 14px;
  font-weight: 850;
}

.board-nav button:hover,
.board-nav button.is-active {
  color: var(--blue);
  background: var(--blue-soft);
}

.board-nav span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.board-nav span:first-child,
.sort-tabs button {
  white-space: nowrap;
}

.trend-list {
  display: grid;
  gap: 8px;
}

.trend-chip {
  padding: 9px 10px;
  display: grid;
  gap: 2px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.trend-chip strong {
  font-size: 13px;
}

.trend-chip small {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
}

.feed-column {
  min-width: 0;
  padding: 22px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.feed-toolbar h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.24;
}

.sort-tabs {
  min-height: 42px;
  padding: 4px;
  display: inline-flex;
  gap: 4px;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.sort-tabs button {
  min-width: 58px;
  padding: 7px 10px;
  color: var(--ink-3);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 900;
}

.sort-tabs button.is-active {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.composer {
  display: none;
  margin-bottom: 18px;
  padding: 18px;
  box-shadow: none;
}

.composer.is-open {
  display: block;
}

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

.composer-head {
  margin-bottom: 14px;
}

.composer-head button {
  width: 32px;
  height: 32px;
  color: var(--ink-3);
  background: #f1f5f9;
  border: 0;
  border-radius: 999px;
  font-size: 20px;
}

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

.composer-grid label {
  display: grid;
  gap: 6px;
}

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

.composer-grid span {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 900;
}

.field-label {
  margin-bottom: 7px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 900;
}

.composer-grid input,
.composer-grid select,
.composer-grid textarea,
.comment-form textarea,
.comment-form input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: #f8fafc;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: 0;
  font-size: 14px;
}

.composer-grid input,
.composer-grid select,
.comment-form input {
  min-height: 42px;
  padding: 0 11px;
}

.composer-grid textarea,
.comment-form textarea {
  resize: vertical;
  padding: 11px;
}

.schedule-panel {
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.schedule-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.schedule-picker button {
  min-height: 40px;
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.schedule-picker button.is-active {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}

.schedule-picker span {
  color: inherit;
  font-size: 11px;
  font-weight: 850;
  opacity: 0.76;
}

.work-preview {
  padding: 13px 14px;
  background: linear-gradient(180deg, #ffffff 0, #f8fafc 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.work-preview div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.work-preview strong {
  font-size: 15px;
}

.work-preview span,
.work-preview small {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 800;
}

.work-preview p {
  margin: 7px 0 4px;
  color: var(--ink-2);
  font-size: 13px;
}

.composer-actions {
  margin-top: 14px;
}

.composer-actions p {
  margin: 0;
  color: var(--ink-3);
  font-size: 13px;
}

.feed-stats {
  min-height: 38px;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feed-stats span {
  padding: 7px 10px;
  color: var(--ink-2);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.post-list {
  display: grid;
  gap: 10px;
}

.post-row {
  min-width: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
}

.post-row.is-active {
  border-color: rgba(36, 87, 166, 0.42);
  box-shadow: 0 14px 30px rgba(36, 87, 166, 0.1);
}

.cover-art {
  min-height: 128px;
  display: grid;
  align-content: end;
  padding: 10px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.48)),
    linear-gradient(135deg, var(--cover-a), var(--cover-b));
}

.cover-art span {
  font-size: 11px;
  font-weight: 950;
  line-height: 1.35;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.32);
}

.post-body {
  min-width: 0;
  padding: 15px 14px 14px 0;
}

.meta-line,
.post-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.meta-line {
  margin-bottom: 7px;
}

.tag {
  padding: 3px 7px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
}

.tag.spoiler {
  color: var(--coral);
  background: var(--coral-soft);
}

.meta-line small,
.post-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.post-row h2 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.36;
  word-break: keep-all;
}

.post-row p {
  margin: 0 0 11px;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.65;
}

.post-row.spoiler h2,
.post-row.spoiler p {
  filter: blur(3px);
  transition: filter 0.16s ease;
}

.post-row.spoiler:hover h2,
.post-row.spoiler:hover p,
.post-row.spoiler.is-active h2,
.post-row.spoiler.is-active p {
  filter: none;
}

.discussion-panel {
  min-height: 640px;
  padding: 0;
  overflow: hidden;
}

.discussion-empty {
  min-height: 420px;
  padding: 28px;
  display: grid;
  align-content: center;
  gap: 10px;
  color: var(--ink-3);
}

.discussion-cover {
  min-height: 170px;
  padding: 18px;
  display: grid;
  align-content: end;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.46)),
    linear-gradient(135deg, var(--cover-a), var(--cover-b));
}

.discussion-cover strong {
  max-width: 280px;
  font-size: 26px;
  line-height: 1.18;
  word-break: keep-all;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.28);
}

.discussion-content {
  padding: 20px;
}

.discussion-content h2 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.32;
  word-break: keep-all;
}

.discussion-text {
  margin: 0 0 16px;
  color: var(--ink-2);
  font-size: 15px;
}

.work-context {
  margin: 0 0 12px;
  padding: 12px;
  display: grid;
  gap: 4px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.work-context strong {
  font-size: 14px;
}

.work-context span {
  color: var(--ink-3);
  font-size: 13px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-row button,
.comment-actions button {
  min-height: 34px;
  padding: 6px 10px;
  color: var(--ink-2);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.action-row button.is-on,
.comment-actions button.is-on {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: rgba(36, 87, 166, 0.24);
}

.best-comment,
.comments-section,
.comment-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.section-title {
  margin: 0 0 10px;
  color: var(--ink-2);
  font-size: 14px;
}

.best-comment {
  background: linear-gradient(180deg, #ffffff 0, #fffaf0 100%);
}

.comment-list {
  display: grid;
  gap: 10px;
}

.comment-item {
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.comment-head {
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.comment-head strong {
  font-size: 13px;
}

.comment-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.comment-item p {
  margin: 0 0 9px;
  color: var(--ink-2);
  font-size: 14px;
}

.comment-actions {
  display: flex;
  gap: 6px;
}

.comment-form {
  display: grid;
  gap: 8px;
}

.comment-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.comment-form button {
  min-height: 40px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--mint);
  border: 0;
  border-radius: var(--radius);
  font-weight: 900;
}

.empty-state {
  padding: 28px;
  color: var(--ink-3);
  background: #f8fafc;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .detail-column {
    position: static;
    grid-column: 1 / -1;
  }
}

@media (max-width: 840px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr auto;
    padding: 14px 16px;
  }

  .search-box {
    grid-column: 1 / -1;
    order: 3;
  }

  .workspace {
    padding: 16px;
    grid-template-columns: minmax(0, 1fr);
  }

  .left-rail {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
  }

  .board-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .board-nav button {
    flex: 0 0 auto;
  }

  .rail-section.compact {
    display: none;
  }

  .feed-toolbar,
  .composer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .composer-head {
    align-items: center;
    flex-direction: row;
  }

  .sort-tabs {
    width: 100%;
  }

  .sort-tabs button {
    flex: 1;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand strong {
    font-size: 18px;
  }

  .primary-action {
    padding: 0 14px;
  }

  .feed-column,
  .rail-section,
  .discussion-content {
    padding: 16px;
  }

  .feed-toolbar h1 {
    font-size: 25px;
  }

  .composer-grid,
  .post-row,
  .comment-form-row {
    grid-template-columns: 1fr;
  }

  .post-body {
    padding: 14px;
  }

  .cover-art {
    min-height: 92px;
  }
}
