:root {
  --bg-color: #f5f5f5;
  --text-color: #333;
  --header-bg: #fff;
  --header-border: #ddd;
  --link-color: #666;
  --link-hover-color: #333;
  --news-item-bg: #fff;
  --news-item-border: #eee;
  --news-title-color: #333;
  --news-title-hover: #0066cc;
  --news-meta-color: #666;
  --news-source-bg: #e9ecef;
  --news-article-bg: #fff;
  --news-article-border: #eee;
  --accent-color: #0066cc;
  --blockquote-border: #ddd;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --header-bg: #1e1e1e;
    --header-border: #333;
    --link-color: #aaa;
    --link-hover-color: #eee;
    --news-item-bg: #1e1e1e;
    --news-item-border: #333;
    --news-title-color: #e0e0e0;
    --news-title-hover: #4dabff;
    --news-meta-color: #999;
    --news-source-bg: #333;
    --news-article-bg: #1e1e1e;
    --news-article-border: #333;
    --accent-color: #4dabff;
    --blockquote-border: #444;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }
}

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

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

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

a:hover {
  text-decoration: underline;
}

header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  padding: 1rem 2rem;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

.back-link {
  color: var(--link-color);
  text-decoration: none;
}

.back-link:hover {
  color: var(--link-hover-color);
}

main {
  max-width: 800px;
  margin: 2rem auto;
}

.news-list {
  list-style: none;
  background: var(--news-item-bg);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.news-item {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--news-item-border);
}

.news-item:last-child {
  border-bottom: none;
}

.news-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--news-title-color);
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
}

.news-title:hover {
  color: var(--news-title-hover);
}

.news-meta {
  font-size: 0.85rem;
  color: var(--news-meta-color);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--news-article-bg);
  padding: 1rem 0;
}

.news-source {
  background: var(--news-source-bg);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.news-date {
  color: var(--news-meta-color);
  font-size: 0.85rem;
}

.news-article {
  background: var(--news-article-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.news-article .news-meta {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--news-article-border);
  background: var(--news-article-bg);
  padding: 1rem;
  border-radius: 8px 8px 0 0;
  margin: -2rem -2rem 1.5rem -2rem;
}

.original-link {
  color: var(--accent-color);
  text-decoration: none;
}

.original-link:hover {
  text-decoration: underline;
}

.comments-link {
  color: var(--accent-color);
  text-decoration: none;
  margin-left: 1rem;
}

.comments-link:hover {
  text-decoration: underline;
}

.article-content {
  line-height: 1.8;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  margin: 1.5rem 0 1rem;
}

.article-content p {
  margin-bottom: 1rem;
}

.article-content img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
}

.article-content a {
  color: var(--accent-color);
  text-decoration: none;
}

.article-content a:hover {
  text-decoration: underline;
}

.article-content blockquote {
  border-left: 4px solid var(--blockquote-border);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--news-meta-color);
}

.article-content ul,
.article-content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.comments-section {
  background: var(--news-article-bg);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.tabs-header {
  display: flex;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-thread {
  border: 1px solid var(--news-article-border);
  border-radius: 6px;
}

.comment-thread summary {
  cursor: pointer;
  list-style: none;
  padding: 0.75rem;
}

.comment-thread summary::-webkit-details-marker {
  display: none;
}

.comment-summary {
  font-size: 0.85rem;
}

.comment-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--news-meta-color);
  margin-bottom: 0.25rem;
}

.comment-author {
  font-weight: 500;
}

.comment-time {
  color: var(--news-meta-color);
  text-decoration: none;
}

.comment-time:hover {
  text-decoration: underline;
}

.comment-body {
  margin-top: 0.5rem;
}

.comment-body .comment-thread {
  margin-left: 1.5rem;
}

@media (prefers-color-scheme: dark) {
  .comment-thread {
    border-color: #444;
  }
}

.tabbed {
  overflow-x: hidden;
  margin: 32px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--news-article-border);
}

.tabbed [type="radio"] {
  display: none;
}

.tabs {
  display: flex;
  align-items: stretch;
  list-style: none;
  padding: 0;
  border-bottom: 1px solid var(--news-article-border);
}

.tab > label {
  display: block;
  margin-bottom: -1px;
  padding: 12px 15px;
  border: 1px solid var(--news-article-border);
  background: var(--bg-color);
  color: var(--news-meta-color);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s;
}

.tab:hover label {
  border-top-color: var(--accent-color);
  color: var(--text-color);
}

.tab-content {
  display: none;
  color: var(--text-color);
}

.tabbed [type="radio"]:nth-of-type(1):checked ~ .tabs .tab:nth-of-type(1) label,
.tabbed [type="radio"]:nth-of-type(2):checked ~ .tabs .tab:nth-of-type(2) label,
.tabbed [type="radio"]:nth-of-type(3):checked ~ .tabs .tab:nth-of-type(3) label,
.tabbed [type="radio"]:nth-of-type(4):checked ~ .tabs .tab:nth-of-type(4) label,
.tabbed
  [type="radio"]:nth-of-type(5):checked
  ~ .tabs
  .tab:nth-of-type(5)
  label {
  border-bottom-color: var(--news-item-bg);
  border-top-color: var(--accent-color);
  background: var(--news-item-bg);
  color: var(--text-color);
}

.tabbed [type="radio"]:nth-of-type(1):checked ~ .tab-content:nth-of-type(1),
.tabbed [type="radio"]:nth-of-type(2):checked ~ .tab-content:nth-of-type(2),
.tabbed [type="radio"]:nth-of-type(3):checked ~ .tab-content:nth-of-type(3),
.tabbed [type="radio"]:nth-of-type(4):checked ~ .tab-content:nth-of-type(4),
.tabbed [type="radio"]:nth-of-type(5):checked ~ .tab-content:nth-of-type(5) {
  display: block;
}




#cache-status {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  padding: 0.5rem 2rem;
  font-size: 0.85rem;
  z-index: 1000;
}
#cache-status.hidden {
  display: none;
}
#cache-progress {
  color: var(--text-color);
}
#cache-errors {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #d32f2f;
}
@media (prefers-color-scheme: dark) {
  #cache-errors {
    color: #ef5350;
  }
}
