:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-strong: #f0f3ff;
  --text: #161a24;
  --muted: #687084;
  --line: #dfe4f0;
  --accent: #4f6bff;
  --accent-dark: #334cdc;
  --danger: #ec4b5f;
  --danger-dark: #c92d42;
  --shadow: 0 18px 50px rgba(27, 37, 78, 0.1);
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(79, 107, 255, 0.16), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(236, 75, 95, 0.1), transparent 32rem),
    var(--bg);
  color: var(--text);
}

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

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 18px;
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: var(--text);
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.06em;
  box-shadow: var(--shadow);
}

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

.top-actions, .form-actions, .filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-btn, .ghost-btn, .reaction-btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 800;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.primary-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 24px rgba(79, 107, 255, 0.22);
}
.primary-btn:hover { background: var(--accent-dark); transform: translateY(-1px); }

.ghost-btn, .reaction-btn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}
.ghost-btn:hover, .reaction-btn:hover { transform: translateY(-1px); border-color: #c6cde0; }
.ghost-link { color: var(--muted); font-weight: 800; }
.ghost-link:hover { color: var(--text); }

.main-view { display: grid; gap: 20px; }

.hero-card, .filter-card, .panel, .post-card, .post-detail {
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(223, 228, 240, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: clamp(24px, 4vw, 44px);
  overflow: hidden;
}

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

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 4rem); line-height: 1.02; margin-bottom: 12px; letter-spacing: -0.06em; }
h2 { font-size: 1.45rem; margin-bottom: 0; }
.hero-copy { color: var(--muted); font-size: 1.05rem; margin-bottom: 0; line-height: 1.6; }
.hero-btn { flex: 0 0 auto; }

.filter-card, .panel, .post-detail { padding: 22px; }
.filter-card label { display: block; font-weight: 900; margin-bottom: 10px; }

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  background: #fff;
  color: var(--text);
  outline: none;
}
textarea { resize: vertical; line-height: 1.65; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(79, 107, 255, 0.1); }

.filter-row input:first-child { flex: 1.4; }
.filter-row input:nth-child(2) { flex: 0.8; }

.tag-cloud, .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-cloud { margin-top: 14px; }

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--panel-strong);
  color: #4050a6;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 7px 10px;
}
button.tag { border: 0; cursor: pointer; }
button.tag:hover { background: #e3e8ff; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.muted { color: var(--muted); }

.post-list { display: grid; gap: 14px; }
.post-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.post-card:hover { transform: translateY(-2px); box-shadow: 0 20px 58px rgba(27, 37, 78, 0.14); }
.post-card h3 { margin: 0; font-size: 1.25rem; letter-spacing: -0.03em; }
.post-preview, .post-meta, .empty-state { color: var(--muted); line-height: 1.6; }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.92rem; }
.reaction-summary { display: flex; gap: 8px; font-weight: 900; }
.reaction-summary span { border-radius: 999px; background: #f5f6fb; padding: 7px 10px; }

.post-form { display: grid; gap: 16px; }
.post-form label { display: grid; gap: 8px; font-weight: 900; }
.form-actions { justify-content: flex-end; margin-top: 4px; }

.detail-header { display: grid; gap: 12px; margin-bottom: 22px; }
.detail-title { font-size: clamp(2rem, 5vw, 3.4rem); }
.detail-body {
  white-space: pre-wrap;
  line-height: 1.75;
  font-size: 1.04rem;
  padding: 20px;
  border-radius: 18px;
  background: #fbfcff;
  border: 1px solid var(--line);
}
.reaction-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.reaction-btn.active-like { background: var(--accent); color: #fff; border-color: var(--accent); }
.reaction-btn.active-dislike { background: var(--danger); color: #fff; border-color: var(--danger); }
.reaction-btn.danger:hover { border-color: var(--danger); }
.notice {
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff8e2;
  color: #755a00;
  border: 1px solid #f3df99;
}
.error {
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff0f2;
  color: #a51f34;
  border: 1px solid #ffc5cf;
}
.loading, .empty-state { padding: 24px; text-align: center; }

@media (max-width: 720px) {
  .app-shell { width: min(100% - 22px, 1120px); padding-top: 12px; }
  .site-header { align-items: flex-start; }
  .brand small { display: none; }
  .top-actions { gap: 8px; }
  .top-actions .ghost-btn { display: none; }
  .hero-card, .section-heading { align-items: stretch; flex-direction: column; }
  .filter-row { flex-direction: column; align-items: stretch; }
  .hero-btn, .primary-btn, .ghost-btn { width: 100%; }
  .form-actions { flex-direction: column-reverse; align-items: stretch; }
}
