* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: #111318;
  color: #eee;
  min-height: 100vh;
}

.topbar {
  padding: 12px 16px;
  background: #1a1d24;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.topbar h1 {
  margin: 0;
  font-size: 1.05rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-btn {
  background: #262b36;
  border: none;
  color: #eee;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn:active { background: #323847; }

.chip-btn {
  background: #262b36;
  border: none;
  color: #ccc;
  font-size: 0.78rem;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}
.chip-btn.chip-active { background: #e63946; color: white; }

main { padding: 14px; max-width: 700px; margin: 0 auto; }

.cards { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: #1e222b;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.card:active { background: #262b36; transform: scale(0.99); }
.card-failed { border: 1px solid #e63946; background: #2a1a1c; }
.card-failed .reason { color: #ff8f94; }
.card-read { opacity: 0.45; }

.card-thumb {
  width: 120px;
  min-width: 120px;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  background: #0d0f13;
  border-radius: 8px;
  margin: 10px 0 10px 10px;
}
.card-body {
  padding: 12px 14px 12px 0;
  min-width: 0; /* allow text truncation inside flex child */
  flex: 1;
}

.read-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: #9fd8a3;
  cursor: pointer;
  width: fit-content;
}
.read-toggle input { width: 16px; height: 16px; }
.detail-read-toggle { margin: 0; }

.card h3 { margin: 0 0 6px; font-size: 0.95rem; line-height: 1.4; }
.card .stars { font-size: 0.9rem; margin-bottom: 4px; }
.card .reason {
  font-size: 0.82rem;
  color: #aaa;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty { text-align: center; color: #777; margin-top: 40px; }

.detail-thumb {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}
.detail-body { padding: 16px; }

.stars { color: #ffd166; font-size: 1.1rem; }
.reason { color: #bbb; margin: 4px 0 14px; }

.detail-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.open-video-btn {
  display: inline-block;
  background: #e63946;
  color: white;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
}

section { margin-top: 22px; }
section h3 { border-bottom: 1px solid #2a2f3a; padding-bottom: 6px; }
.content-block {
  white-space: pre-wrap;
  line-height: 1.8;
  font-size: 0.95rem;
  color: #ddd;
}
