:root {
  --bg: #f7f1e4;
  --card: #ffffff;
  --border: #e6dcc6;
  --text: #1e3323;
  --muted: #7c7360;
  --accent: #21402a;
  --accent-hover: #16301d;
  --accent-soft: #e7eee3;
  --accent-ink: #fbf7ec;
  --solved: #3f7a52;
  --solved-soft: #e3f0e6;
  --open: #9c6b2e;
  --open-soft: #f5e8d3;
  --category: #935b3a;
  --category-soft: #f1e3d6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.display-font {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.search-form {
  flex: 1;
  max-width: 320px;
  margin: 0 16px;
}

.search-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
}
.search-form input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.user-box {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.current-user {
  font-weight: 600;
  color: var(--text);
}

.notif-wrap {
  position: relative;
}

.notif-bell {
  background: none;
  border: none;
  font-size: 18px;
  padding: 4px 6px;
  position: relative;
  line-height: 1;
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #c0392b;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  align-items: center;
  justify-content: center;
}
.notif-badge:not([hidden]) { display: flex; }

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(30, 51, 35, 0.14);
  z-index: 20;
}

.notif-item {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--accent-soft); }
.notif-item.unread { background: var(--open-soft); }

.notif-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.notif-empty {
  padding: 16px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.report-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
}
.report-link:hover { color: #b23a2c; }

.container {
  max-width: 760px;
  margin: 24px auto;
  padding: 0 20px 60px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.page-header h1 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: 26px;
  margin: 0;
  letter-spacing: -0.01em;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--card);
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 600;
}
.btn-secondary:hover { background: var(--accent-soft); }

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  gap: 14px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.post-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(30, 51, 35, 0.08); }

.vote-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 40px;
}

.vote-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 34px;
  height: 30px;
  font-size: 14px;
  color: var(--text);
}
.vote-btn:hover { background: var(--accent-soft); border-color: var(--accent); }

.vote-count {
  font-weight: 700;
  font-size: 14px;
  margin: 4px 0;
}

.post-main { flex: 1; min-width: 0; }

.post-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
}

.post-body-preview {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.post-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  align-items: center;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge-solved { background: var(--solved-soft); color: var(--solved); }
.badge-open { background: var(--open-soft); color: var(--open); }
.badge-category { background: var(--category-soft); color: var(--category); }

.new-post-form, .comment-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 20px;
}

.new-post-form select, .new-post-form input, .new-post-form textarea,
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 10px;
  background: var(--bg);
  color: var(--text);
}

.new-post-form textarea, .comment-form textarea {
  min-height: 70px;
  resize: vertical;
}

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}
.back-link:hover { color: var(--accent); }

.post-detail {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
}

.post-detail-title {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: 24px;
  margin: 10px 0 6px;
  letter-spacing: -0.01em;
}

.post-detail-body {
  font-size: 14px;
  line-height: 1.6;
  margin: 12px 0;
  white-space: pre-wrap;
}

.user-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.user-link:hover { color: var(--accent); text-decoration: underline; }

.profile-stats {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}
.profile-stats strong { color: var(--text); font-size: 15px; }

.profile-section-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  margin: 24px 0 10px;
}

.profile-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 8px;
  cursor: pointer;
}
.profile-row:hover { border-color: var(--accent); }

.profile-row-title {
  font-weight: 600;
  font-size: 14px;
  margin-left: 6px;
}

.profile-row-body {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.profile-row-meta {
  font-size: 12px;
  color: var(--muted);
}

.comments-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  margin: 20px 0 10px;
}

.feed-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.category-filter {
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
}

.feed-tab {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.feed-tab:hover { color: var(--text); }
.feed-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.comment {
  border-top: 1px solid var(--border);
  padding: 14px 0;
  display: flex;
  gap: 12px;
}

.comment .vote-col { min-width: 32px; }

.comment-body {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 6px;
}

.comment-meta {
  font-size: 12px;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 30px 0;
  font-size: 14px;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 20px;
}

.error-banner {
  background: #fbeae7;
  color: #a23b2e;
  border: 1px solid #f0c9c1;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}
