/* === AI Daily News v7 === */
:root {
  --text-primary: #1a1a1a;
  --text-secondary: #555;
  --text-muted: #888;
  --bg-primary: #fdf6e3;
  --bg-paper: #fff9f0;
  --bg-trending: #f5f0e6;
  --border-color: #2a2a2a;
  --border-light: #ccc;
  --accent: #8b0000;
  --link-color: #1a1a1a;
  --link-hover: #8b0000;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, "Times New Roman", serif;
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-serif);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

.newspaper {
  max-width: 960px;
  margin: 2rem auto;
  padding: 2rem 2.5rem;
  background: var(--bg-paper);
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

/* --- Header --- */
.header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.rule-heavy {
  border: none;
  border-top: 3px double var(--border-color);
  margin: 0.5rem 0;
}

.rule-light {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 0;
}

.masthead {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  margin: 0.8rem 0 0.4rem;
  font-family: var(--font-serif);
}

.header-meta {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

/* --- Two-column flow --- */
.columns {
  column-count: 2;
  column-gap: 2.5rem;
  column-rule: 1px solid var(--border-light);
  padding-top: 0.5rem;
}

/* --- Section --- */
.col-section {
  break-inside: avoid;
  margin-bottom: 2rem;
}

.col-section-title {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.3rem;
  margin-bottom: 1rem;
}

/* --- News item --- */
.item {
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px dotted var(--border-light);
}

.item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.item-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 0.3rem;
}

.item-title a {
  color: var(--link-color);
  text-decoration: none;
}

.item-title a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.item-meta {
  margin-bottom: 0.3rem;
}

.item-source {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  color: var(--text-muted);
  background: #f0e8d8;
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
}

.item-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- Trending --- */
.trending {
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.trending-title {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 0.3rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.trending-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.trending-src {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.2rem;
  margin-bottom: 0.5rem;
}

.trending-ol {
  list-style: none;
  counter-reset: t;
}

.trending-ol li {
  counter-increment: t;
  padding: 0.15rem 0 0.15rem 1.5rem;
  position: relative;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.trending-ol li::before {
  content: counter(t);
  position: absolute;
  left: 0;
  top: 0.2rem;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  background: #f0e8d8;
  width: 1.2rem;
  height: 1.2rem;
  line-height: 1.2rem;
  text-align: center;
  border-radius: 2px;
}

.trending-ol li:nth-child(-n+3)::before {
  color: var(--accent);
  background: #f0e0d8;
  font-weight: 800;
}

.trending-ol a {
  color: var(--text-secondary);
  text-decoration: none;
}

.trending-ol a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* --- Archive --- */
.archive-months {
  margin: 1rem 0;
}

.archive-month {
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-light);
  border-radius: 3px;
}

.archive-month-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-family: var(--font-sans);
  background: #f8f4ec;
  list-style: none;
}

.archive-month-head::-webkit-details-marker { display: none; }

.archive-month-head::before {
  content: "▸";
  margin-right: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

details[open] > .archive-month-head::before {
  transform: rotate(90deg);
}

.archive-month-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.archive-month-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.archive-month-body {
  padding: 0;
}

.archive-item {
  display: flex;
  justify-content: space-between;
  padding: 0.7rem 1rem 0.7rem 2rem;
  text-decoration: none;
  color: var(--text-primary);
  border-top: 1px dotted var(--border-light);
  transition: background 0.15s;
}

.archive-item:hover {
  background: rgba(139, 0, 0, 0.03);
}

.archive-date { font-weight: 600; font-size: 0.9rem; }
.archive-count { font-family: var(--font-sans); font-size: 0.8rem; color: var(--text-muted); }

/* --- Footer --- */
.footer {
  text-align: center;
  margin-top: 2rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

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

/* === Responsive === */
@media (max-width: 768px) {
  .newspaper {
    margin: 0;
    padding: 1rem 1.2rem;
    box-shadow: none;
  }
  .masthead { font-size: 1.8rem; letter-spacing: 0.15em; }
  .columns { column-count: 1; }
  .trending-cols { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .masthead { font-size: 1.5rem; }
  .header-meta { font-size: 0.8rem; }
}
