:root {
  --bg: #0b0c10;
  --card: #12141a;
  --text: #eaeaf0;
  --muted: #a9b0c0;
  --line: #232736;
  --accent: #6ea8fe;
  --danger: #ff6b6b;
  --ok: #6bff95;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, #07080b, var(--bg));
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
.container { width: min(960px, 92vw); margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(11,12,16,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; gap: 14px; align-items: center; padding: 12px 0; }
.brand { font-weight: 800; letter-spacing: .2px; }
.nav { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.nav a { padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; }
.nav a:hover { border-color: var(--line); background: rgba(255,255,255,.03); }
.search { flex: 1; max-width: 420px; }
.search input { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.02); color: var(--text); }

main.container { padding: 18px 0 50px; }
.card {
  background: rgba(18,20,26,.9);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  margin-bottom: 14px;
}
.narrow { width: min(520px, 100%); margin: 0 auto; }
h1, h2 { margin: 0 0 12px; }
label { display: block; margin-top: 12px; margin-bottom: 6px; color: var(--muted); }
input, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.02);
  color: var(--text);
  outline: none;
}
textarea { resize: vertical; }
.hint { margin-top: 10px; color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.alert { border: 1px solid rgba(255,107,107,.4); background: rgba(255,107,107,.08); padding: 10px 12px; border-radius: 12px; margin-bottom: 12px; }
.ok { border: 1px solid rgba(107,255,149,.35); background: rgba(107,255,149,.07); padding: 10px 12px; border-radius: 12px; margin-bottom: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor: pointer;
}
.btn:hover { background: rgba(255,255,255,.09); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: rgba(255,255,255,.03); }
.btn.like.active { border-color: rgba(110,168,254,.35); background: rgba(110,168,254,.12); }
.btn.danger { border-color: rgba(255,107,107,.35); color: var(--danger); }
.btn.danger:hover { background: rgba(255,107,107,.09); }

.post { padding: 14px; }
.post-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.userline { display: flex; gap: 10px; align-items: center; }
.avatar { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); object-fit: cover; background: rgba(255,255,255,.03); }
.avatar.sm { width: 30px; height: 30px; }
.avatar.xl { width: 84px; height: 84px; }
.user { font-weight: 700; }
.post-media video {
  width: 100%;
  max-height: 520px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #000;
}
.caption { margin-top: 10px; color: var(--text); }
.post-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }

.comment-form { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.comment-form input { flex: 1; }
.comments { display: grid; gap: 10px; }
.comment { display: flex; gap: 10px; align-items: flex-start; padding-top: 6px; border-top: 1px solid rgba(255,255,255,.06); }
.comment:first-child { border-top: 0; }
.comment-body { flex: 1; }

.pager { display: flex; justify-content: space-between; margin-top: 10px; }

.profile-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.profile-left { display: flex; gap: 14px; align-items: center; }
.profile-right { display: grid; gap: 10px; }
.stats { display: flex; gap: 14px; }
.stats > div { text-align: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.02); min-width: 90px; }

.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.user-pill { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.02); }
.user-pill:hover { background: rgba(255,255,255,.04); }

.footer { padding: 22px 0 30px; border-top: 1px solid var(--line); color: var(--muted); }

@media (prefers-color-scheme: light) {
  :root { --bg: #f6f7fb; --card: #fff; --text: #12141a; --muted: #586074; --line: #e6e8f0; --accent: #2563eb; }
  body { background: linear-gradient(180deg, #ffffff, #f6f7fb); }
  .topbar { background: rgba(255,255,255,.9); }
  .card { background: rgba(255,255,255,.95); }
}

@media (max-width: 700px) {
  .topbar-inner { flex-wrap: wrap; }
  .nav { width: 100%; justify-content: flex-end; }
  .search { order: 3; width: 100%; max-width: none; }
  .profile-head { flex-direction: column; align-items: stretch; }
  .comment-form { flex-direction: column; align-items: stretch; }
}
