:root {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent2: #a78bfa;
  --success: #22c55e;
  --danger: #ef4444;
  --border: #334155;
  --radius: 14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 45%, #0f172a 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.site-header {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.site-header h1 {
  font-size: 1.85rem;
  font-weight: 700;
  background: linear-gradient(90deg, #38bdf8, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
  cursor: pointer;
}

.site-header p { color: var(--muted); font-size: 0.92rem; }

.nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.btn {
  background: linear-gradient(90deg, #0ea5e9, #6366f1);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

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

.btn.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm { padding: 6px 12px; font-size: 0.85rem; border-radius: 8px; }

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
}

.card h2 { font-size: 1.2rem; margin-bottom: 8px; }

.meta { font-size: 0.84rem; color: var(--muted); margin-bottom: 10px; }

.excerpt {
  color: var(--muted);
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

.form-group { margin-bottom: 14px; }

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.88rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 11px 13px;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.form-group textarea { min-height: 150px; }

.post-content {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 16px 0;
  line-height: 1.75;
}

.comments-section {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.comments-section h3 { font-size: 1.08rem; margin-bottom: 12px; }

.comment {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.comment .author { font-weight: 600; color: var(--accent); margin-bottom: 3px; }
.comment .time { font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.comment .body { white-space: pre-wrap; word-break: break-word; }

.no-data {
  text-align: center;
  color: var(--muted);
  padding: 36px 16px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.hidden { display: none !important; }

.status {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}

.status.error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.status.success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.site-footer {
  text-align: center;
  margin-top: 36px;
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 520px) {
  .site-header h1 { font-size: 1.5rem; }
  .nav { flex-direction: column; align-items: stretch; }
}
