:root {
  --bg: #0f1115;
  --bg-card: #1a1d24;
  --border: #2a2e37;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
}
:root[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-card: #ffffff;
  --border: #e2e4e9;
  --text: #111827;
  --text-muted: #6b7280;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.15s ease, color 0.15s ease;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo { font-weight: 700; font-size: 1.25rem; color: var(--text); }
nav a { margin-left: 1.5rem; color: var(--text-muted); font-weight: 500; }
nav a:hover { color: var(--text); text-decoration: none; }

.container { max-width: 640px; margin: 2rem auto; padding: 0 1rem; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.welcome { text-align: center; padding: 3rem 1rem; }
.welcome h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.welcome p { color: var(--text-muted); }

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }

textarea, input[type="text"], input[type="password"] {
  width: 100%;
  background: #0f1115;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.6rem;
  font-family: inherit;
  font-size: 0.95rem;
}
textarea { resize: vertical; min-height: 70px; }

.post-form { display: flex; flex-direction: column; gap: 0.75rem; }
.post-author { font-weight: 600; color: var(--text); }
.post-time { font-size: 0.8rem; color: var(--text-muted); margin-left: 0.5rem; }
.post-content { margin-top: 0.5rem; white-space: pre-wrap; line-height: 1.4; }

.delete-btn {
  float: right;
  background: none;
  border: none;
  color: #f87171;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
}
.delete-btn:hover { text-decoration: underline; }

.error { color: #f87171; margin-top: 1rem; font-size: 0.9rem; }

.auth-form {
  max-width: 320px;
  margin: 4rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
}
.auth-form h1 { margin-top: 0; font-size: 1.3rem; }
.auth-form label { display: block; margin-top: 1rem; font-size: 0.9rem; color: var(--text-muted); }
.auth-form button { margin-top: 1.5rem; width: 100%; }
.auth-form .switch { margin-top: 1rem; font-size: 0.9rem; text-align: center; color: var(--text-muted); }

.site-footer { text-align: center; padding: 2rem; color: var(--text-muted); font-size: 0.85rem; }

.settings-section { margin-bottom: 1.5rem; }
.settings-section h2 { font-size: 1.05rem; margin-bottom: 0.75rem; }
.theme-toggle { display: flex; gap: 0.75rem; }
.theme-toggle button {
  flex: 1;
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
}
.theme-toggle button.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.success { color: #4ade80; margin-top: 1rem; font-size: 0.9rem; }
