:root {
  --bg: #edf1f4;
  --ink: #20242a;
  --muted: #66707a;
  --line: #d3dbe2;
  --panel: #ffffff;
  --accent: #0b7d7b;
  --accent-dark: #075f5e;
  --danger: #b93638;
  --shadow: 0 4px 20px rgba(30, 40, 50, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.site-header {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
}

.logo-mark {
  display: inline-block;
  width: 26px; height: 26px;
  background: var(--accent);
  border-radius: 6px;
}

.logo-3d { color: var(--accent); }

.beta-badge {
  font-size: 0.6rem;
  font-weight: 700;
  background: #e53e3e;
  color: #fff;
  padding: 1px 6px;
  border-radius: 99px;
  letter-spacing: 0.06em;
}

.header-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.lang-label {
  margin-left: 10px;
}

.lang-label select {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 0.84rem;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  outline: none;
}

.header-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.header-nav a:hover { background: var(--bg); color: var(--ink); }
.header-nav a.active { background: var(--accent); color: #fff; }

/* ── Main ── */
.community-main {
  flex: 1;
  padding: 32px 16px 48px;
}

.board-container {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.board-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
}

.board-desc {
  color: var(--muted);
  margin-top: 6px;
  font-size: 0.92rem;
}

/* ── Write Box ── */
.write-box {
  background: var(--panel);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--line);
}

.write-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.write-box-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

.toggle-write {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.toggle-write:hover { background: var(--bg); }

.write-form {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
}

.write-form.collapsed { display: none; }

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

.form-row input,
.form-row select {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s;
}

.form-row input:focus,
.form-row select:focus {
  border-color: var(--accent);
}

.textarea-row { align-items: flex-end; flex-wrap: wrap; }

.form-row textarea {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.92rem;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  outline: none;
  transition: border-color 0.15s;
}

.form-row textarea:focus { border-color: var(--accent); }

.char-hint {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.content-count { align-self: flex-end; }

.form-actions { display: flex; justify-content: flex-end; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 9px 22px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Toolbar ── */
.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-tab {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-tab:hover { border-color: var(--accent); color: var(--accent); }
.filter-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.sort-group { display: flex; gap: 4px; }

.sort-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
}
.sort-btn:hover { border-color: var(--accent); color: var(--accent); }
.sort-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ── Post List ── */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.loading-state, .empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.post-card {
  background: var(--panel);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  transition: box-shadow 0.15s;
}
.post-card:hover { box-shadow: 0 6px 24px rgba(30,40,50,0.13); }

.post-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.post-category {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--bg);
  color: var(--accent);
  border: 1px solid var(--line);
}

.post-author {
  font-weight: 600;
  font-size: 0.9rem;
}

.post-date {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: auto;
}

.post-content {
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.like-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 5px 14px;
  font-size: 0.84rem;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
}
.like-btn:hover { border-color: #e53e3e; color: #e53e3e; background: #fff0f0; }
.like-btn.liked { border-color: #e53e3e; color: #e53e3e; background: #fff0f0; }

/* ── Load More ── */
.load-more-area { text-align: center; padding: 8px 0; }

.btn-outline {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 30px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ── Footer ── */
.site-footer {
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 16px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 10px 22px;
  border-radius: 99px;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 999;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Mobile ── */
@media (max-width: 600px) {
  .site-header { padding: 0 14px; gap: 12px; }
  .header-nav a { padding: 6px 10px; font-size: 0.84rem; }
  .community-main { padding: 20px 10px 40px; }
  .board-header h1 { font-size: 1.3rem; }
  .write-box-header { padding: 12px 14px; }
  .write-form { padding: 12px 14px; }
  .post-card { padding: 14px 14px; }
  .board-toolbar { flex-direction: column; align-items: flex-start; }
  .filter-tabs { gap: 4px; }
  .filter-tab { padding: 5px 10px; font-size: 0.8rem; }
}
