:root {
  --bg: #f4f5f7;
  --text: #172b4d;
  --text-muted: #6b778c;
  --accent: #0052CC;
  --accent-hover: #0065ff;
  --border: #dfe1e6;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(9, 30, 66, 0.08), 0 0 1px rgba(9, 30, 66, 0.08);
  --card-shadow-hover: 0 4px 12px rgba(9, 30, 66, 0.12), 0 0 1px rgba(9, 30, 66, 0.1);
  --pill-bg: #deebff;
  --pill-text: #0747a6;
  --header-gradient: linear-gradient(135deg, #0052CC 0%, #2684FF 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --accent: #4C9AFF;
    --accent-hover: #79b8ff;
    --border: #30363d;
    --card-bg: #161b22;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 1px rgba(0, 0, 0, 0.2);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 1px rgba(0, 0, 0, 0.3);
    --pill-bg: #1c2d4a;
    --pill-text: #4C9AFF;
    --header-gradient: linear-gradient(135deg, #0747a6 0%, #0052CC 100%);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

header {
  background: var(--header-gradient);
  color: #ffffff;
  padding: 3rem 1.5rem 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  font-weight: 400;
}

.filters {
  max-width: 720px;
  margin: 0 auto 1.25rem;
  padding: 0 1rem;
  display: flex;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.4rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 9999px;
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.entry {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  animation: fadeInUp 0.35s ease both;
}

.entry:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-1px);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
}

.entry-source {
  background: var(--pill-bg);
  color: var(--pill-text);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.entry-date {
  color: var(--text-muted);
}

.entry h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  line-height: 1.45;
}

.entry h2 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.entry h2 a:hover {
  color: var(--accent);
}

.entry-summary {
  list-style: none;
  padding-left: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.entry-summary li {
  padding: 0.2rem 0 0.2rem 1.1rem;
  position: relative;
}

.entry-summary li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

.entry-summary li:last-child {
  margin-bottom: 0;
}

.entry-video {
  display: block;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
}

.entry-video img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  transition: opacity 0.15s;
}

.entry-video:hover img {
  opacity: 0.85;
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  pointer-events: none;
}

.play-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent #ffffff;
}

#load-more[hidden] {
  display: none;
}

#load-more {
  display: block;
  max-width: 720px;
  width: calc(100% - 2rem);
  margin: 1rem auto 0;
  padding: 0.7rem 1.5rem;
  background: var(--card-bg);
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

#load-more:hover {
  background: var(--accent);
  color: #ffffff;
}

#loading,
#error,
#empty {
  color: var(--text-muted);
  text-align: center;
  padding: 3rem 0;
  font-size: 0.95rem;
}

#error {
  color: #e5534b;
}

footer {
  max-width: 720px;
  margin: 3rem auto 0;
  padding: 1.5rem 1rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  header {
    padding: 2rem 1rem 1.75rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .entry {
    padding: 1rem 1.15rem;
  }
}
