:root {
  --ink: #182033;
  --muted: #667085;
  --line: #e4e8f1;
  --soft: #f6f8fc;
  --card: #ffffff;
  --violet: #5b4df7;
  --violet-dark: #4438d8;
  --cyan: #0ba5c7;
  --green: #0f9f7a;
  --orange: #e66a16;
  --shadow: 0 18px 55px rgba(35, 35, 80, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 3%, rgba(99, 102, 241, .11), transparent 25rem),
    radial-gradient(circle at 8% 30%, rgba(14, 165, 233, .07), transparent 22rem),
    #f7f8fc;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(226, 232, 240, .9);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  width: min(1240px, calc(100% - 36px));
  min-height: 66px;
  margin: auto;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  text-decoration: none;
  font-weight: 950;
  font-size: 24px;
  letter-spacing: -.06em;
  background: linear-gradient(135deg, #5146e5 10%, #8b5cf6 55%, #0ea5e9);
  -webkit-background-clip: text;
  color: transparent;
}

.primary-nav { display: flex; align-items: center; gap: 5px; }
.primary-nav a {
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #596174;
  font-size: 14px;
  font-weight: 800;
}
.primary-nav a:hover, .primary-nav a.active { color: var(--violet); background: #f0efff; }
.topbar-spacer { flex: 1; }
.topbar-search {
  width: min(330px, 31vw);
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 6px 5px 15px;
  background: #fff;
}
.topbar-search input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink); }
.topbar-search button { border: 0; border-radius: 50%; width: 34px; height: 34px; color: #fff; background: var(--violet); cursor: pointer; }
.account-link {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 850;
  background: #fff;
}

.page-shell { width: min(1240px, calc(100% - 36px)); margin: 0 auto 70px; }
.hero {
  position: relative;
  overflow: hidden;
  margin: 28px 0 22px;
  padding: 40px 42px;
  border: 1px solid rgba(99, 102, 241, .16);
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(130deg, #24234c 0%, #4c42d4 54%, #087ba1 120%);
  box-shadow: var(--shadow);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
}
.hero::before { width: 330px; height: 330px; right: -90px; top: -195px; }
.hero::after { width: 210px; height: 210px; right: 80px; bottom: -160px; }
.hero-content { position: relative; z-index: 1; max-width: 760px; }
.eyebrow { margin: 0 0 10px; color: #c8d2ff; font-size: 12px; font-weight: 900; letter-spacing: .14em; }
.hero h1 { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.15; letter-spacing: -.05em; }
.hero p { margin: 14px 0 0; max-width: 680px; color: #e7eaff; line-height: 1.72; font-size: 15px; }
.hero-actions { margin-top: 24px; display: flex; gap: 10px; flex-wrap: wrap; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--violet);
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.button:hover { background: var(--violet-dark); transform: translateY(-1px); }
.button.light { color: #4036c8; background: #fff; }
.button.ghost { color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); }
.button.subtle { color: var(--violet); background: #f1f0ff; }
.button.small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.button.danger { background: #ef4444; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.stat {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, .9);
}
.stat span { display: block; color: var(--muted); font-size: 12px; font-weight: 750; }
.stat strong { display: block; margin-top: 5px; font-size: 22px; letter-spacing: -.04em; }

.section-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 9px 34px rgba(30, 41, 59, .045);
}
.section-head {
  min-height: 62px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 { margin: 0; font-size: 18px; letter-spacing: -.035em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.section-head-spacer { flex: 1; }

.community-section { margin-bottom: 22px; }
.community-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.community-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(150deg, #fff 40%, color-mix(in srgb, var(--accent) 8%, #fff));
}
.community-card-top { display: flex; align-items: center; gap: 10px; }
.community-icon {
  width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 13px; color: #fff; background: var(--accent); font-weight: 950;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 28%, transparent);
}
.community-card h3 { margin: 0; font-size: 15px; letter-spacing: -.025em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-card p { height: 40px; margin: 11px 0; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.6; }
.community-meta { display: flex; gap: 10px; color: #7a8498; font-size: 11px; }
.community-actions { margin-top: 13px; display: flex; gap: 7px; }

.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.feed-toolbar { padding: 14px 18px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.feed-search { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 12px; background: var(--soft); border: 1px solid transparent; border-radius: 11px; }
.feed-search:focus-within { border-color: #c7c3ff; background: #fff; }
.feed-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; }
.chip-row { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: #5f697c; background: #fff; font-size: 12px; font-weight: 800; cursor: pointer; }
.chip.active { color: #fff; border-color: var(--violet); background: var(--violet); }

.feed { padding: 4px 18px 10px; }
.post-card { padding: 22px 2px; border-bottom: 1px solid #edf0f5; cursor: pointer; }
.post-card:last-child { border-bottom: 0; }
.post-card:hover h3 { color: var(--violet); }
.post-context { display: flex; align-items: center; gap: 8px; color: #747e92; font-size: 11px; font-weight: 750; }
.context-badge { padding: 4px 8px; border-radius: 999px; color: var(--violet); background: #f0efff; }
.post-card h3 { margin: 10px 0 7px; font-size: 19px; line-height: 1.35; letter-spacing: -.035em; transition: color .15s; }
.post-excerpt { margin: 0; color: #606b7e; line-height: 1.7; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.tag { padding: 4px 7px; border-radius: 7px; color: #667085; background: #f3f5f9; font-size: 10px; font-weight: 750; }
.post-footer { display: flex; align-items: center; gap: 13px; margin-top: 14px; color: #8790a2; font-size: 11px; }
.post-footer .author { margin-right: auto; color: #4b5568; font-weight: 850; }
.inline-action { border: 0; padding: 3px; color: inherit; background: none; cursor: pointer; }
.inline-action.active { color: var(--violet); font-weight: 900; }

.side-column { display: grid; gap: 14px; }
.side-card { padding: 18px; }
.side-card h3 { margin: 0 0 12px; font-size: 15px; }
.member-mini { display: flex; gap: 11px; align-items: center; }
.avatar { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--violet), #0ea5e9); font-weight: 950; }
.member-mini strong, .member-mini span { display: block; }
.member-mini span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.side-actions { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.side-list { display: grid; gap: 10px; }
.side-list a { text-decoration: none; color: #4f586b; font-size: 12px; font-weight: 750; }
.side-list a:hover { color: var(--violet); }
.principles { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.75; }

.empty-state { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty-mark { width: 58px; height: 58px; margin: 0 auto 13px; display: grid; place-items: center; border-radius: 18px; color: var(--violet); background: #f0efff; font-size: 24px; font-weight: 950; }
.empty-state strong { display: block; color: var(--ink); }
.empty-state p { margin: 7px 0 0; font-size: 13px; }
.loading-line { height: 3px; overflow: hidden; background: #eeeefd; }
.loading-line::after { content: ""; display: block; width: 35%; height: 100%; background: var(--violet); animation: load 1s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-110%); } to { transform: translateX(390%); } }

dialog {
  width: min(720px, calc(100% - 28px));
  max-height: min(820px, calc(100vh - 30px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .28);
  color: var(--ink);
}
dialog::backdrop { background: rgba(20, 24, 42, .55); backdrop-filter: blur(4px); }
.dialog-head { padding: 19px 22px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 20px; }
.dialog-close { margin-left: auto; border: 0; width: 36px; height: 36px; border-radius: 50%; color: #64748b; background: #f3f4f7; font-size: 20px; cursor: pointer; }
.dialog-body { max-height: calc(100vh - 150px); overflow: auto; padding: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 850; color: #4e586a; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 11px; outline: 0; padding: 11px 12px; color: var(--ink); background: #fff;
}
.field textarea { min-height: 220px; resize: vertical; line-height: 1.65; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #aaa4ff; box-shadow: 0 0 0 3px #eeedff; }
.check-row { display: flex; align-items: center; gap: 8px; color: #556073; font-size: 12px; }
.dialog-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 8px; }
.detail-title { margin: 0; font-size: clamp(24px, 4vw, 36px); letter-spacing: -.045em; line-height: 1.25; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 13px 0 22px; color: var(--muted); font-size: 12px; }
.detail-content { white-space: pre-wrap; overflow-wrap: anywhere; color: #354055; line-height: 1.85; font-size: 15px; }
.detail-actions { margin: 24px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.comments { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.comment { padding: 13px 0; border-bottom: 1px solid #eef1f5; }
.comment strong { font-size: 12px; }
.comment time { margin-left: 7px; color: #98a0af; font-size: 10px; }
.comment p { margin: 6px 0 0; color: #515b6d; white-space: pre-wrap; line-height: 1.6; font-size: 13px; }
.comment-form { display: flex; gap: 8px; margin-top: 13px; }
.comment-form textarea { flex: 1; min-height: 54px; resize: vertical; border: 1px solid var(--line); border-radius: 11px; padding: 10px; }

.toast {
  position: fixed; z-index: 100; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  padding: 12px 17px; border-radius: 12px; color: #fff; background: #22263a; font-size: 13px; font-weight: 750;
  opacity: 0; pointer-events: none; transition: .22s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 960px) {
  .topbar-search { display: none; }
  .community-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-layout { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .topbar-inner, .page-shell { width: min(100% - 22px, 1240px); }
  .topbar-inner { min-height: 58px; gap: 12px; }
  .primary-nav { gap: 0; }
  .primary-nav a { padding: 8px; font-size: 12px; }
  .account-link { padding: 8px 10px; font-size: 11px; }
  .hero { margin-top: 15px; padding: 28px 22px; border-radius: 20px; }
  .hero p { font-size: 13px; }
  .stat-strip { grid-template-columns: 1fr 1fr 1fr; gap: 7px; }
  .stat { padding: 13px 10px; text-align: center; }
  .stat strong { font-size: 17px; }
  .community-grid { display: flex; overflow-x: auto; padding: 13px; scroll-snap-type: x mandatory; }
  .community-card { flex: 0 0 78vw; scroll-snap-align: start; }
  .section-head { padding: 12px 14px; }
  .section-head p { display: none; }
  .feed-toolbar { padding: 11px 13px; flex-wrap: wrap; }
  .feed-search { flex-basis: 100%; }
  .feed { padding: 2px 14px 8px; }
  .post-card { padding: 18px 0; }
  .post-card h3 { font-size: 17px; }
  .post-excerpt { -webkit-line-clamp: 3; }
  .side-column { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .dialog-body { padding: 17px; }
  .field textarea { min-height: 180px; }
}
