:root {
  --bg: #f5f2ec;
  --card: #ffffff;
  --text: #2c2a26;
  --muted: #8a8478;
  --border: #e7e2d8;
  --accent: #2f4a3d;
  --accent-hover: #24392f;
  --accent-soft: #e9efe9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.1px;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

/* ---------- Header ---------- */
header.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 16px;
  max-width: 720px;
  margin: 0 auto;
}

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

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
}

header.site-header h1 {
  font-size: 19px;
  margin: 0;
}

header.site-header h1 a {
  color: var(--text);
  text-decoration: none;
}

.tagline {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { background: var(--accent-hover); }

.btn:disabled {
  background: #b7c2bc;
  cursor: not-allowed;
}

.btn-add span {
  margin-right: 2px;
}

/* ---------- Status text ---------- */
.status-text {
  color: var(--muted);
  padding: 32px 0;
  text-align: center;
}

.status-text.inline {
  padding: 0;
  margin: 0;
  margin-right: auto;
  text-align: left;
  font-size: 13px;
}

/* ---------- Post list (cards) ---------- */
ul#post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.post-card:hover {
  box-shadow: 0 4px 14px rgba(47, 74, 61, 0.08);
  transform: translateY(-1px);
}

.post-card-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}

.post-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.post-card-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-card-meta {
  color: var(--muted);
  font-size: 12.5px;
}

.post-card-arrow {
  color: var(--border);
  flex-shrink: 0;
  transition: color 0.15s ease, transform 0.15s ease;
}

.post-card:hover .post-card-arrow {
  color: var(--accent);
  transform: translateX(2px);
}

li.empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 14px;
}

/* ---------- Write form ---------- */
form.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}

form.card h2 {
  margin: 0 0 18px;
  font-size: 17px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.field input[type="text"],
.field input[type="password"],
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
}

.field input[type="text"]:focus,
.field input[type="password"]:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.field textarea {
  min-height: 200px;
  resize: vertical;
}

.honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

/* ---------- Image attach ---------- */
.file-attach {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.file-name {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.image-preview-wrap {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.image-preview-wrap img {
  max-width: 160px;
  max-height: 160px;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: cover;
  display: block;
}

/* ---------- Post detail ---------- */
article#post-article {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
}

article#post-article h2 {
  margin: 0 0 8px;
}

article#post-article .meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
  display: block;
}

article#post-article .content {
  white-space: pre-wrap;
  word-break: break-word;
}

.post-image {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  margin: 4px 0 16px;
}

.actions {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.actions-right {
  display: flex;
  gap: 8px;
}

.btn.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn.secondary:hover {
  background: var(--accent-soft);
}

.btn.small {
  padding: 6px 12px;
  font-size: 12px;
}

.btn.danger {
  background: #b3452f;
}

.btn.danger:hover {
  background: #96351f;
}
