:root {
  color-scheme: light dark;

  --bg: #F2F2F7;
  --card-bg: #FFFFFF;
  --label: #000000;
  --secondary-label: rgba(60, 60, 67, 0.6);
  --tertiary-label: rgba(60, 60, 67, 0.3);
  --separator: rgba(60, 60, 67, 0.29);
  --tint: #007AFF;
  --nav-bg: rgba(242, 242, 247, 0.94);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card-bg: #1C1C1E;
    --label: #FFFFFF;
    --secondary-label: rgba(235, 235, 245, 0.6);
    --tertiary-label: rgba(235, 235, 245, 0.3);
    --separator: rgba(84, 84, 88, 0.65);
    --tint: #0A84FF;
    --nav-bg: rgba(28, 28, 30, 0.9);
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

.nav-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
  padding: 10px 16px;
}

.nav-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.bookmark-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  padding: 4px;
  color: var(--secondary-label);
  cursor: pointer;
}

.bookmark-filter.active {
  color: var(--tint);
}

.bookmark-filter svg,
.post-bookmark svg {
  display: block;
}

main {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 12px 48px;
}

.section {
  margin-bottom: 24px;
}

.section-header {
  margin: 0 0 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary-label);
}

.section-card {
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
}

.post-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--separator);
}

.section-card .post-row:last-child {
  border-bottom: none;
}

.post-link {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}

.post-link:active {
  opacity: 0.6;
}

.post-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-favicon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
}

.post-blog-name {
  font-size: 15px;
  color: var(--secondary-label);
}

.post-bookmark {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--tertiary-label);
  cursor: pointer;
}

.post-bookmark.is-active {
  color: var(--tint);
}

.post-bookmark:active {
  opacity: 0.6;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 0;
  color: var(--secondary-label);
  font-size: 15px;
}

.loading-state[hidden],
.load-more[hidden],
.empty-state[hidden],
.error-state[hidden] {
  display: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--separator);
  border-top-color: var(--secondary-label);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state,
.error-state {
  text-align: center;
  color: var(--secondary-label);
  font-size: 15px;
  padding: 40px 16px;
}

.load-more {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--tint);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.load-more:active {
  background: var(--separator);
}

