:root {
  --bg: #fafafa;
  --fg: #262626;
  --muted: #8e8e8e;
  --border: #dbdbdb;
  --accent: #0095f6;
  --accent-dark: #00376b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.4;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
  color: var(--fg);
}

.site-header nav a {
  margin-left: 16px;
  text-decoration: none;
  color: var(--fg);
  font-size: 14px;
}

.feed-header {
  padding: 32px 0 16px;
}

.feed-header h1 {
  margin: 0 0 4px;
}

.muted { color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding-bottom: 32px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform .1s ease-out;
}

.card:hover { transform: translateY(-2px); }

.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
}

.thumb img,
.thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb .placeholder,
.post-media .placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #eee, #ccc);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  font-size: clamp(28px, 6vw, 56px);
  letter-spacing: 0.5px;
}

.placeholder--gradient {
  background: linear-gradient(135deg, #f58529 0%, #dd2a7b 50%, #515bd4 100%);
}

.post-media .placeholder {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
}

.badge {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.meta {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

.meta span { color: var(--muted); }

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 16px 0 48px;
}

.pagination a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.empty {
  padding: 48px 0;
  text-align: center;
  color: var(--muted);
}

.post-detail {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin: 24px 0 48px;
}

.post-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.post-head h1 { margin: 0; font-size: 20px; }
.post-head time { color: var(--muted); font-size: 13px; }

.post-media {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.post-media img,
.post-media video {
  width: 100%;
  border-radius: 6px;
  background: #000;
}

.caption {
  white-space: pre-wrap;
  font-size: 15px;
  margin: 0 0 16px;
}

.stats {
  display: flex;
  gap: 24px;
  margin: 0 0 16px;
}

.stats div { display: flex; flex-direction: column; }
.stats dt { color: var(--muted); font-size: 12px; margin: 0; }
.stats dd { margin: 0; font-weight: 600; }

.actions {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

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

.embed-code pre {
  background: #f2f2f2;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 12px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}

.tag {
  background: #eef6ff;
  color: var(--accent-dark);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.tagged,
.comments {
  margin: 16px 0 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.tagged h3,
.comments h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.tagged ul,
.comments ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tagged li {
  font-size: 13px;
  color: var(--accent-dark);
}

.comments li {
  font-size: 13px;
  line-height: 1.5;
}

.comments strong { margin-right: 6px; }
.comments em { color: var(--muted); margin-left: 6px; font-style: normal; }

.comments .replies {
  margin: 6px 0 0 16px;
  padding-left: 8px;
  border-left: 2px solid var(--border);
}

.post-head-meta {
  text-align: right;
}

.post-head-meta p {
  margin: 4px 0 0;
  font-size: 13px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: #fff;
}
