:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --ink: #20242a;
  --muted: #667085;
  --line: #d7dde3;
  --brand: #1f6f5b;
  --brand-dark: #164e42;
  --accent: #c4492d;
  --soft: #eaf5f1;
  --shadow: 0 10px 24px rgba(31, 41, 55, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  letter-spacing: 0;
}

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.header-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--brand);
  color: white;
  font-weight: 800;
}

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

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.top-nav,
.rank-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
}

.nav-tab,
.rank-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #344054;
  cursor: pointer;
  white-space: nowrap;
}

.nav-tab.is-active,
.rank-button.is-active {
  border-color: var(--brand);
  background: var(--soft);
  color: var(--brand-dark);
  font-weight: 700;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 34px;
}

.lead-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 20px;
  align-items: center;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lead-panel h1,
.lead-panel p,
.featured-card h2,
.featured-card p,
h2,
p {
  margin-top: 0;
}

.lead-panel h1 {
  margin-bottom: 10px;
  font-size: 30px;
  line-height: 1.25;
}

.lead-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.lead-stats {
  min-height: 112px;
  display: grid;
  place-items: center;
  text-align: center;
  border-left: 1px solid var(--line);
}

.lead-stats strong {
  display: block;
  font-size: 36px;
  color: var(--brand-dark);
}

.lead-stats span {
  color: var(--muted);
  font-size: 13px;
}

.featured-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}

.featured-card,
.principle-card,
.board-main,
.side-section,
.notice-box,
.dialog-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.featured-card {
  display: grid;
  grid-template-columns: 42% minmax(0, 1fr);
  overflow: hidden;
}

.featured-card img {
  width: 100%;
  height: 100%;
  min-height: 238px;
  object-fit: cover;
  background: #e6ecef;
}

.featured-card div {
  padding: 22px;
  display: grid;
  align-content: center;
}

.featured-card h2 {
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1.35;
}

.featured-card p {
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.featured-card button,
.principle-card a,
.dialog-actions a {
  min-height: 40px;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.principle-card {
  padding: 20px;
}

.principle-card h2 {
  margin-bottom: 12px;
  font-size: 19px;
}

.principle-card ul {
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.content-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.board-main {
  overflow: hidden;
}

.board-toolbar {
  padding: 20px 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.board-toolbar h2 {
  margin-bottom: 0;
  font-size: 23px;
}

.search-box {
  display: grid;
  gap: 6px;
  min-width: 260px;
  color: var(--muted);
  font-size: 12px;
}

.search-box input {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: #fbfcfd;
  color: var(--ink);
}

.rank-strip {
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
}

.board-head,
.post-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 82px 72px 72px;
  gap: 10px;
  align-items: center;
}

.board-head {
  padding: 10px 18px;
  background: #eef2f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.post-list,
.mini-rank {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-row {
  width: 100%;
  min-height: 70px;
  padding: 10px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.post-row:hover {
  background: var(--surface-soft);
}

.post-no {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.post-title {
  display: flex;
  gap: 10px;
  min-width: 0;
  align-items: center;
}

.thumb {
  width: 54px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  background: #e6ecef;
  flex: 0 0 auto;
}

.title-lines {
  min-width: 0;
}

.title-lines strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-lines small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source,
.metric {
  color: var(--muted);
  font-size: 13px;
}

.side-panel {
  display: grid;
  gap: 16px;
}

.side-section,
.notice-box {
  padding: 18px;
}

.side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.side-title h2,
.notice-box h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.side-title span {
  display: grid;
  min-width: 30px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: var(--soft);
  color: var(--brand-dark);
  font-weight: 800;
}

.mini-rank li + li {
  border-top: 1px solid var(--line);
}

.mini-rank button {
  width: 100%;
  min-height: 50px;
  padding: 9px 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.mini-rank strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-rank small {
  color: var(--muted);
}

.notice-box p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.post-dialog {
  width: min(760px, calc(100% - 24px));
  border: 0;
  padding: 0;
  background: transparent;
}

.post-dialog::backdrop {
  background: rgba(16, 24, 40, 0.46);
}

.dialog-card {
  position: relative;
  padding: 22px;
}

.icon-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

#dialogImage {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: 7px;
  background: #e6ecef;
}

.dialog-meta,
#dialogSummary,
.curator-comment {
  color: var(--muted);
  line-height: 1.7;
}

.curator-comment {
  padding: 14px;
  border-left: 4px solid var(--brand);
  background: var(--soft);
  color: #24433b;
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

#dialogTags {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 28px;
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 960px) {
  .header-inner,
  .board-toolbar {
    display: grid;
  }

  .featured-grid,
  .content-grid,
  .lead-panel {
    grid-template-columns: 1fr;
  }

  .lead-stats {
    min-height: 84px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .search-box {
    min-width: 0;
  }

  .board-head {
    display: none;
  }

  .post-row {
    grid-template-columns: 42px minmax(0, 1fr) 54px;
  }

  .post-row .source,
  .post-row .metric:last-child {
    display: none;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .page-shell,
  .site-footer {
    width: calc(100% - 20px);
  }

  .lead-panel,
  .featured-card div,
  .principle-card,
  .board-toolbar {
    padding: 18px;
  }

  .lead-panel h1 {
    font-size: 24px;
  }

  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-card img {
    min-height: 180px;
  }

  .featured-card h2 {
    font-size: 21px;
  }

  .post-row {
    padding: 10px 12px;
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .post-row .metric {
    display: none;
  }

  .thumb {
    width: 48px;
  }

  .dialog-actions {
    display: grid;
  }

  #dialogTags {
    text-align: left;
  }
}
