:root {
  color-scheme: light;
  --ink: #252629;
  --muted: #70747c;
  --subtle: #9aa0aa;
  --line: #dfe3e8;
  --paper: #fffdfd;
  --surface: #ffffff;
  --surface-soft: #fff0f4;
  --accent: #cf4d70;
  --accent-strong: #9d3153;
  --teal: #20766f;
  --blue: #385f9f;
  --gold: #b77a28;
  --petal: #ffe7ee;
  --petal-strong: #ffd6e1;
  --shadow: 0 18px 50px rgba(35, 39, 45, 0.08);
  --radius: 8px;
  font-family:
    "Pretendard",
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    "Malgun Gothic",
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 214, 225, 0.26), transparent 34%),
    linear-gradient(180deg, #ffffff 0, var(--paper) 360px),
    var(--paper);
  color: var(--ink);
  line-height: 1.55;
}

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

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(223, 227, 232, 0.88);
  background: rgba(255, 250, 252, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 250px;
  border-radius: 10px;
}

.brand-icons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 86px;
  height: 42px;
  border: 1px solid rgba(207, 77, 112, 0.24);
  border-radius: 999px;
  background: linear-gradient(135deg, #fff 0%, var(--petal) 100%);
  box-shadow: 0 10px 24px rgba(207, 77, 112, 0.12);
  font-size: 1.16rem;
  line-height: 1;
}

.brand-icons span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

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

.brand strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.15;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.nav a {
  min-height: 36px;
  padding: 8px 11px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 700;
}

.nav a:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

main {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 410px);
  gap: 36px;
  align-items: end;
  padding: clamp(34px, 6vw, 64px) 0 22px;
}

.intro h1 {
  max-width: 820px;
  margin: 6px 0 14px;
  font-size: clamp(2.05rem, 5vw, 4rem);
  line-height: 1.06;
  letter-spacing: 0;
}

.intro p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.quick-stats div {
  padding: 18px 16px;
  border-right: 1px solid var(--line);
}

.quick-stats div:last-child {
  border-right: 0;
}

.quick-stats strong,
.quick-stats span {
  display: block;
}

.quick-stats strong {
  font-size: 1.72rem;
  line-height: 1;
}

.quick-stats span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.workspace {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 18px 0 64px;
}

.filters {
  position: sticky;
  top: 78px;
  display: grid;
  gap: 20px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 251, 252, 0.9);
  box-shadow: 0 12px 28px rgba(35, 39, 45, 0.05);
  scrollbar-width: thin;
  scrollbar-color: rgba(112, 116, 124, 0.5) transparent;
}

.filters::-webkit-scrollbar {
  width: 8px;
}

.filters::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(112, 116, 124, 0.35);
}

.filters::-webkit-scrollbar-track {
  background: transparent;
}

.search-field,
.submit-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

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

textarea {
  resize: vertical;
}

textarea[name="note"],
textarea[name="inlineNote"] {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: var(--subtle);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(190, 64, 88, 0.14);
}

.filter-group {
  display: grid;
  gap: 10px;
}

.filter-heading,
.results-toolbar,
.post-card-header,
.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.filter-group h2,
.results-toolbar h2,
.submit-section h2,
.guide h2 {
  margin: 0;
  line-height: 1.15;
}

.filter-group h2 {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
}

.tag-options,
.tag-list,
.active-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-button,
.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 4px 10px;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.tag-button {
  cursor: pointer;
}

.tag-button:hover {
  border-color: rgba(32, 118, 111, 0.42);
  color: var(--teal);
}

.tag-button[aria-pressed="true"] {
  border-color: rgba(190, 64, 88, 0.52);
  background: var(--petal);
  color: var(--accent-strong);
}

.tag-pill {
  background: var(--surface-soft);
  color: var(--ink);
}

.results {
  min-width: 0;
}

.results-toolbar {
  min-height: 58px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.results-toolbar h2 {
  font-size: clamp(1.45rem, 3vw, 2.1rem);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.random-button {
  min-height: 42px;
  border: 1px solid rgba(190, 64, 88, 0.28);
  border-radius: 7px;
  background: var(--petal);
  color: var(--accent-strong);
  cursor: pointer;
  padding: 9px 12px;
  font-weight: 900;
  white-space: nowrap;
}

.random-button:hover {
  border-color: rgba(190, 64, 88, 0.52);
  background: var(--petal-strong);
}

.sort-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 210px;
  color: var(--muted);
  font-weight: 800;
}

.active-tags {
  min-height: 34px;
  margin-bottom: 12px;
}

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

.post-card {
  display: grid;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(35, 39, 45, 0.04);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.post-card:hover {
  border-color: rgba(32, 118, 111, 0.35);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.post-card.is-random-pick {
  border-color: rgba(190, 64, 88, 0.7);
  background:
    linear-gradient(90deg, rgba(255, 231, 238, 0.95), rgba(255, 255, 255, 0.96) 42%),
    var(--surface);
  box-shadow: 0 18px 50px rgba(190, 64, 88, 0.16);
}

.post-card h3 {
  margin: 3px 0 0;
  font-size: clamp(1.12rem, 2vw, 1.35rem);
  line-height: 1.28;
}

.post-card-header > div {
  min-width: 0;
}

.author,
.note {
  margin: 0;
  color: var(--muted);
}

.author {
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 900;
}

.note {
  color: #535861;
}

.spotlight {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #e8d7dc;
  border-radius: var(--radius);
  background: #fff4f7;
}

.spotlight span {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
}

.spotlight .note {
  margin: 0;
}

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

.note-list .note {
  padding-left: 10px;
  border-left: 3px solid rgba(190, 64, 88, 0.28);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
}

.optional-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.inline-note-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.inline-note-form[hidden] {
  display: none;
}

.inline-note-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.inline-note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.inline-note-actions button,
.inline-note-toggle,
.like-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 6px 10px;
  font-weight: 900;
}

.inline-note-actions button[type="submit"],
.inline-note-toggle {
  border-color: rgba(190, 64, 88, 0.24);
  color: var(--accent-strong);
}

.inline-note-actions button:hover,
.inline-note-toggle:hover,
.like-button:hover {
  background: var(--petal);
  border-color: rgba(190, 64, 88, 0.44);
}

.like-button {
  border-color: rgba(207, 77, 112, 0.24);
  color: var(--accent-strong);
}

.like-button.is-liked {
  background: var(--petal);
  color: var(--accent-strong);
}

.like-button:disabled {
  opacity: 0.72;
  cursor: default;
}

.post-card-footer {
  align-self: end;
  padding-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.post-card-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(32, 118, 111, 0.2);
  border-radius: 7px;
  color: var(--teal);
  padding: 6px 10px;
  font-weight: 900;
}

.post-card-footer a:hover {
  background: #edf7f5;
}

.post-card-footer a.missing-link {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  cursor: default;
  pointer-events: none;
}

.empty-state {
  padding: 36px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.submit-section {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(320px, 1fr);
  gap: 36px;
  padding: 52px 0;
  border-top: 1px solid var(--line);
}

.submit-section p,
.guide p {
  color: var(--muted);
}

.submit-form {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(35, 39, 45, 0.05);
}

.submit-tags {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.submit-tags legend {
  padding: 0;
  color: var(--ink);
  font-weight: 800;
}

.submit-tag-options {
  display: grid;
  gap: 12px;
}

.submit-tag-group {
  display: grid;
  gap: 8px;
}

.submit-tag-group h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.submit-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.submit-form .submit-tag-choice {
  display: inline-flex;
  align-items: center;
  gap: 0;
  width: auto;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.submit-form .submit-tag-choice input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.submit-form .submit-tag-choice span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 4px 10px;
  white-space: nowrap;
}

.submit-form .submit-tag-choice input:checked + span {
  border-color: rgba(190, 64, 88, 0.52);
  background: var(--petal);
  color: var(--accent-strong);
}

.submit-form .submit-tag-choice input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(190, 64, 88, 0.14);
}

.submit-form button {
  min-height: 48px;
  border: 0;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

.submit-form button:hover {
  background: #111214;
}

.guide {
  padding: 52px 0 70px;
  border-top: 1px solid var(--line);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.guide-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius);
  background: var(--surface);
}

.guide-grid h3 {
  margin: 0 0 8px;
}

.guide-grid p {
  margin: 0;
}

.guide-grid a {
  color: var(--accent-strong);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer {
  padding: 26px 18px 38px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.back-to-top {
  position: fixed;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 20;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(37, 38, 41, 0.12);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 900;
}

.back-to-top:hover {
  background: #111214;
}

.back-to-top[hidden] {
  display: none;
}

.welcome-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(37, 38, 41, 0.28);
  backdrop-filter: blur(6px);
}

.welcome-modal[hidden] {
  display: none;
}

.welcome-dialog {
  width: min(460px, 100%);
  padding: 26px;
  border: 1px solid rgba(207, 77, 112, 0.24);
  border-radius: 12px;
  background: #fffafb;
  box-shadow: 0 24px 70px rgba(37, 38, 41, 0.18);
}

.welcome-dialog h2 {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 1.45rem;
  line-height: 1.2;
}

.welcome-dialog p {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.welcome-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.welcome-dialog button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: var(--accent-strong);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

.welcome-dialog button:hover {
  background: #7f2843;
}

.welcome-dialog .secondary-button {
  border: 1px solid rgba(139, 46, 76, 0.24);
  background: #fff;
  color: var(--accent-strong);
}

.welcome-dialog .secondary-button:hover {
  background: #fff3f6;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .intro,
  .workspace,
  .submit-section {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
  }

  .guide-grid,
  .quick-stats {
    grid-template-columns: 1fr;
  }

  .quick-stats div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .quick-stats div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 560px) {
  main {
    width: min(100% - 24px, 1200px);
  }

  .intro {
    padding-top: 30px;
  }

  .intro h1 {
    font-size: 2.25rem;
  }

  .results-toolbar,
  .post-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

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

  .sort-field {
    align-items: stretch;
    flex-direction: column;
    min-width: 0;
  }

  .post-card {
    padding: 16px;
  }
}
