:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --ink: #1d2429;
  --muted: #68747d;
  --line: #dce2e6;
  --green: #18715f;
  --green-strong: #105445;
  --coral: #e25d4f;
  --blue: #2d6cdf;
  --yellow: #f4bd3a;
  --shadow: 0 14px 40px rgba(29, 36, 41, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  line-height: 1.55;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  min-height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

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

.brand-logo {
  display: block;
  width: auto;
  height: 54px;
  border-radius: 6px;
  object-fit: contain;
}

.primary-nav {
  position: relative;
  display: flex;
  justify-content: end;
  justify-self: end;
}

.menu-trigger {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #38434a;
  cursor: pointer;
  font-weight: 700;
}

.menu-trigger:hover,
.primary-nav:focus-within .menu-trigger {
  background: #edf3f1;
  color: var(--green-strong);
}

.menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  min-width: 180px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.primary-nav:hover .menu-panel,
.primary-nav:focus-within .menu-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.menu-panel a {
  min-width: max-content;
  padding: 10px 12px;
  border-radius: 8px;
  color: #38434a;
  font-size: 14px;
}

.menu-panel a:hover,
.menu-panel a:focus {
  background: #edf3f1;
  color: var(--green-strong);
  outline: 0;
}

.header-actions,
.hero-tools,
.modal-actions,
.upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.write-button,
.secondary-button,
.text-button,
.hero-tools button {
  border: 0;
  cursor: pointer;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
}

.write-button,
.hero-tools button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

.hero {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  background: #151b1f;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(12, 18, 21, 0.82), rgba(12, 18, 21, 0.5), rgba(12, 18, 21, 0.12));
}

.hero-content {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 32px 88px;
  color: #fff;
}

.eyebrow,
.section-heading p {
  margin: 0 0 6px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-content .eyebrow {
  color: rgba(255, 255, 255, 0.88);
  font-size: 24px;
}

.hero h1 {
  max-width: 680px;
  margin: 0 0 26px;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.12;
  letter-spacing: 0;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(520px, 100%);
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.hero-tools button {
  min-height: 48px;
  flex: 0 0 128px;
  background: var(--coral);
}

.ticker {
  display: flex;
  gap: 14px;
  align-items: center;
  max-width: 1180px;
  margin: -28px auto 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  position: relative;
  overflow-x: auto;
}

.ticker strong {
  color: var(--green);
}

.ticker a {
  min-width: max-content;
  color: #3f4b52;
  font-size: 14px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  max-width: 1180px;
  margin: 28px auto;
  padding: 0 24px;
}

.main-column,
.side-column {
  display: grid;
  gap: 22px;
  align-content: start;
}

.panel,
.editorial-band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(29, 36, 41, 0.04);
}

.panel {
  padding: 22px;
}

.compact {
  padding: 20px;
}

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

.section-heading h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.section-heading a,
.text-button {
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
}

.text-button {
  background: transparent;
}

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

.board-card {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.board-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
}

.board-card h3,
.post-item h3,
.article-card h3 {
  margin: 0;
  line-height: 1.35;
}

.board-card p,
.post-meta,
.article-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.count-badge {
  min-width: 48px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef5f3;
  color: var(--green-strong);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.post-list {
  display: grid;
}

.post-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.post-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.post-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag {
  min-width: max-content;
  padding: 3px 7px;
  border-radius: 6px;
  background: #f0f4f7;
  color: #51606a;
  font-size: 12px;
  font-weight: 700;
}

.post-stats {
  display: flex;
  min-width: 112px;
  justify-content: end;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

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

.rank-list li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  counter-increment: rank;
}

.rank-list li::before {
  content: counter(rank);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.rank-list a {
  font-weight: 700;
}

.rank-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.notice-list {
  display: grid;
  gap: 10px;
  padding-left: 18px;
  margin: 0;
  color: #3d474d;
  font-size: 14px;
}

.editorial-band {
  max-width: 1180px;
  margin: 0 auto 36px;
  padding: 24px;
}

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

.article-card {
  display: block;
  min-height: 170px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f7f9fa);
}

.article-card:hover {
  border-color: rgba(24, 113, 95, 0.34);
  box-shadow: 0 10px 26px rgba(29, 36, 41, 0.08);
}

.article-card .tag {
  display: inline-block;
  margin-bottom: 18px;
}

.article-page {
  max-width: 920px;
  margin: 34px auto 46px;
  padding: 0 24px;
}

.article-detail,
.article-shell {
  width: 100%;
}

.article-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 34px;
  box-shadow: 0 8px 24px rgba(29, 36, 41, 0.04);
}

.article-hero-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 0 22px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef2f3;
}

.article-shell h1,
.page-title {
  margin: 10px 0 12px;
  font-size: 32px;
  line-height: 1.28;
  letter-spacing: 0;
}

.article-meta {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 14px;
}

.article-body {
  display: grid;
  gap: 18px;
  color: #303a40;
  font-size: 17px;
}

.article-body h2 {
  margin: 14px 0 -4px;
  font-size: 22px;
  line-height: 1.35;
}

.article-body p {
  margin: 0;
}

.policy-page {
  display: grid;
  gap: 14px;
}

.policy-page p {
  margin: 0;
  color: #303a40;
  font-size: 16px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--green);
  font-size: 14px;
  font-weight: 800;
}

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

.article-row {
  display: grid;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.article-row:hover {
  border-color: rgba(24, 113, 95, 0.34);
  background: #f8fbfa;
}

.article-row strong {
  font-size: 19px;
}

.article-row p {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #20272c;
  color: rgba(255, 255, 255, 0.82);
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 24px;
}

.footer-inner strong {
  display: block;
  color: #fff;
  margin-bottom: 10px;
}

.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.footer-inner p {
  margin: 0;
}

.post-modal {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
  overflow: auto;
}

.post-modal::backdrop {
  background: rgba(15, 20, 23, 0.55);
}

.post-modal form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
}

.post-modal label {
  display: grid;
  gap: 6px;
  color: #39444b;
  font-size: 14px;
  font-weight: 700;
}

.post-modal input,
.post-modal select,
.post-modal textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  font-weight: 400;
}

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

.editor-label {
  color: #39444b;
  font-size: 14px;
  font-weight: 700;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fa;
}

.editor-toolbar button,
.editor-toolbar select,
.color-tool {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #2f3a41;
  font-size: 13px;
}

.editor-toolbar button {
  padding: 0 10px;
  cursor: pointer;
}

.editor-toolbar select {
  padding: 0 8px;
}

.color-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
}

.color-tool input {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
}

.rich-editor {
  min-height: 260px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: 0;
}

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

.rich-editor img,
.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 14px 0;
  border-radius: 8px;
}

.rich-editor video,
.rich-editor iframe,
.article-body video,
.article-body iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 14px 0;
  border: 0;
  border-radius: 8px;
  background: #111;
}

.upload-row > label {
  flex: 1;
}

.secondary-button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.board-page {
  display: grid;
  gap: 24px;
  max-width: 1180px;
  margin: 28px auto 46px;
  padding: 0 24px;
}

.board-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  min-height: 180px;
  padding: 28px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(24, 113, 95, 0.92), rgba(45, 108, 223, 0.78)),
    url("assets/storymate-hero-calm.png") center / cover;
  color: #fff;
}

.board-hero-copy {
  display: flex;
  gap: 16px;
  align-items: center;
}

.board-hero-copy .board-icon {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.18) !important;
  border: 1px solid rgba(255, 255, 255, 0.34);
}

.board-hero p,
.board-hero h1,
.board-hero strong {
  margin: 0;
}

.board-hero p {
  color: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  font-weight: 800;
}

.board-hero h1 {
  font-size: 34px;
  line-height: 1.2;
}

.board-hero strong {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 600;
}

.board-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.board-hero-stats span {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  font-size: 13px;
  font-weight: 700;
}

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

.board-post-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.board-post-thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  background: #edf1f3;
}

.board-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.board-post-item h3 {
  margin: 7px 0 5px;
  font-size: 20px;
}

.board-post-item p,
.related-list small,
.empty-board p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.empty-board {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.empty-board h3 {
  margin: 0;
}

.related-posts {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.related-posts h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

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

.related-list a {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.related-list img {
  width: 92px;
  aspect-ratio: 4 / 3;
  border-radius: 7px;
  object-fit: cover;
}

.related-list strong {
  display: block;
  line-height: 1.35;
}

.related-list small {
  display: block;
  margin-top: 3px;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 12px 18px;
  }

  .primary-nav {
    grid-column: auto;
    justify-content: end;
  }

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

@media (max-width: 720px) {
  .brand {
    min-width: 0;
  }

  .brand-logo {
    height: 46px;
  }

  .hero {
    min-height: 520px;
  }

  .hero-overlay {
    background: rgba(12, 18, 21, 0.68);
  }

  .hero-content {
    padding: 58px 20px 78px;
  }

  .hero-tools,
  .upload-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-tools button {
    align-self: start;
    width: 132px;
    flex-basis: auto;
  }

  .ticker {
    margin-left: 14px;
    margin-right: 14px;
  }

  .content-grid,
  .editorial-band,
  .article-page {
    padding-left: 14px;
    padding-right: 14px;
  }

  .article-shell {
    padding: 24px 18px;
  }

  .article-shell h1,
  .page-title {
    font-size: 26px;
  }

  .board-grid,
  .article-grid,
  .related-list {
    grid-template-columns: 1fr;
  }

  .board-card,
  .post-item,
  .board-post-item {
    grid-template-columns: 1fr;
  }

  .board-hero {
    align-items: start;
    flex-direction: column;
    padding: 22px;
  }

  .board-hero-copy {
    align-items: start;
  }

  .post-stats {
    justify-content: start;
  }
}
