:root {
  --bg: #ffffff;
  --text: #191919;
  --text-muted: #767676;
  --border: #ececec;
  --accent: #191919;
  --sidebar-bg: #fafafa;
  --tag-bg: #f1f1f1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15161a;
    --text: #f0f0f0;
    --text-muted: #9a9a9a;
    --border: #2a2b30;
    --accent: #f0f0f0;
    --sidebar-bg: #1c1d22;
    --tag-bg: #26272c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-header .logo {
  font-size: 1.15rem;
  font-weight: 700;
}

.site-header nav {
  display: flex;
  gap: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 56px;
  padding: 40px 20px 80px;
  align-items: start;
}

.post-list {
  display: flex;
  flex-direction: column;
}

.post {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.post:first-child { padding-top: 4px; }

.post-body { flex: 1; min-width: 0; }

.post h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
}

.post h2 a:hover { text-decoration: underline; }

.post .excerpt {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post .meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.post .tag {
  background: var(--tag-bg);
  padding: 2px 8px;
  border-radius: 4px;
}

.post .tag.no-cat { background: transparent; padding: 0; }

.thumb {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 8px;
  background-size: cover;
}

.thumb-1 { background: linear-gradient(135deg, #a8d8ea, #d4f0f0); }
.thumb-2 { background: linear-gradient(135deg, #1b1f3b, #4b5a8a); }
.thumb-3 { background: linear-gradient(135deg, #f6d365, #fda085); }

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 24px;
}

.ad-box {
  height: 250px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  background: var(--sidebar-bg);
}

.profile-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px 20px;
  text-align: center;
  background: var(--sidebar-bg);
}

.avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--tag-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.profile-name {
  font-weight: 700;
  margin-bottom: 8px;
}

.profile-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 18px;
}

.subscribe-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.category-list {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}

.category-list a {
  display: flex;
  justify-content: space-between;
  padding: 8px 4px;
  color: var(--text);
}

.category-list a.sub {
  padding-left: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.category-list a span { color: var(--text-muted); }

.category-list a.cat-all { font-weight: 700; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

@media (max-width: 780px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .sidebar { position: static; }
  .thumb { width: 90px; height: 90px; }
}
