/* ============================================================
   Advanced News / RSS feeds  --  public stylesheet
   Light theme, red/coral accents, three-column layout
   ============================================================ */
:root {
  --c-bg:        #f5f6f8;
  --c-card:      #ffffff;
  --c-border:    #e5e7eb;
  --c-text:      #1f2937;
  --c-muted:     #6b7280;
  --c-link:      #2563eb;
  --c-accent:    #ef4444;
  --c-accent-2:  #f97316;
  --c-accent-grad: linear-gradient(135deg,#ef4444 0%,#f97316 100%);
  --c-rail:      #2563eb;
  --c-chip:      #f3f4f6;

  --radius:      8px;
  --radius-lg:   12px;
  --shadow:      0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  --font-sans:   -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}

[data-theme="dark"] {
  --c-bg:        #0f1115;
  --c-card:      #181b21;
  --c-border:    #262a33;
  --c-text:      #e5e7eb;
  --c-muted:     #9ca3af;
  --c-link:      #60a5fa;
  --c-chip:      #1f232b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--c-link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--c-border); margin: 16px 0; }

/* ---------- Layout ---------- */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px;
}
.grid {
  display: grid;
  grid-template-columns: 220px 1fr 300px;
  gap: 16px;
  align-items: start;
}
.grid--no-right { grid-template-columns: 220px 1fr; }
@media (max-width: 1024px) {
  .grid { grid-template-columns: 200px 1fr; }
  .col-right { display: none; }
}
@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; }
  .grid--no-right { grid-template-columns: 1fr; }
  .col-left { display: none; }
}

/* ---------- Card ---------- */
.card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-hd {
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.card-hd .more { font-size: 12px; color: var(--c-muted); }
.card-bd { padding: 12px 16px; }
.card-bd--tight { padding: 0; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--c-card);
  border-bottom: 1px solid var(--c-border);
  padding: 10px 16px;
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
}
.brand { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.brand-dot {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--c-accent-grad);
  display: inline-block;
}
.topbar .searchbox {
  flex: 1; max-width: 480px;
  position: relative;
}
.topbar .searchbox input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--c-border);
  border-radius: 24px;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 13px;
}
.topbar .searchbox::before {
  content: "🔍";
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 12px; opacity: .6;
}
.topbar .actions { display: flex; gap: 8px; }

/* ---------- Left nav ---------- */
.sidenav { padding: 8px 0; }
.sidenav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  color: var(--c-text);
  border-left: 3px solid transparent;
  font-weight: 500;
}
.sidenav a:hover { background: var(--c-chip); text-decoration: none; }
.sidenav a.active {
  border-left-color: var(--c-rail);
  background: var(--c-chip);
  color: var(--c-link);
}
.sidenav .ic {
  display: inline-block; width: 20px; text-align: center; opacity: .75;
}
.sidenav h6 {
  margin: 12px 14px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-muted);
}

/* ---------- Filter row ---------- */
.filter-row {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid var(--c-border);
  align-items: center;
}
.filter-row select, .filter-row input[type="text"] {
  padding: 5px 8px;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: var(--c-card);
  color: var(--c-text);
  font-size: 12px;
}
.filter-row .btn { padding: 5px 12px; font-size: 12px; }
.filter-row .grow { flex: 1; min-width: 160px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid var(--c-border);
  background: var(--c-card);
  color: var(--c-text);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--c-chip); text-decoration: none; }
.btn-primary {
  background: var(--c-accent-grad); color: #fff; border: 0;
}
.btn-primary:hover { opacity: .9; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ---------- Feed cards (grid of RSS channels) ---------- */
.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  padding: 16px;
}
.feed-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .15s, box-shadow .15s;
}
.feed-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.feed-card .thumb {
  width: 100%; aspect-ratio: 16/9;
  background: var(--c-chip);
  border-radius: 6px; overflow: hidden;
}
.feed-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.feed-card .t { font-weight: 600; font-size: 14px; }
.feed-card .meta { font-size: 12px; color: var(--c-muted); display: flex; gap: 12px; }
.feed-card .desc { font-size: 12px; color: var(--c-muted); }

/* ---------- News list (latest) ---------- */
.news-list .news-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-border);
}
.news-list .news-row--no-img {
  grid-template-columns: 1fr;
  padding: 10px 16px;
}
.news-list .news-row--no-img .t { font-size: 14.5px; margin-bottom: 4px; }
.news-list .news-row:last-child { border-bottom: 0; }
.news-list .thumb {
  aspect-ratio: 16/9;
  border-radius: 6px;
  background: var(--c-chip);
  overflow: hidden;
}
.news-list .thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-list .t { font-weight: 600; font-size: 15px; margin: 0 0 6px; }
.news-list .t a { color: var(--c-text); }
.news-list .t a:hover { color: var(--c-link); }
.news-list .meta {
  font-size: 12px; color: var(--c-muted);
  display: flex; gap: 12px; flex-wrap: wrap;
}
.news-list .summary {
  font-size: 13px; color: var(--c-text); margin: 6px 0 0;
}
.news-list .full-content {
  font-size: 13px; color: var(--c-text); margin: 10px 0 0;
  line-height: 1.6;
}
.news-list .full-content p {
  margin: 0 0 12px; padding: 0;
}
.news-list .full-content p:last-child {
  margin-bottom: 0;
}
.news-list .full-content img {
  max-width: 100%; height: auto; margin: 12px 0; border-radius: 6px;
}
.news-list .full-content a {
  color: var(--c-link);
}
.news-list .full-content blockquote {
  border-left: 4px solid var(--c-accent); padding-left: 12px; margin: 10px 0; color: var(--c-muted);
}
.news-list .full-content h1, .news-list .full-content h2, .news-list .full-content h3 {
  font-size: 14px; margin: 12px 0 8px; font-weight: 600;
}
.feed-card--no-img .thumb { display: none; }
.hot-news .item--no-img .thumb { display: none; }
@media (max-width: 600px) {
  .news-list .news-row { grid-template-columns: 1fr; }
}

/* ---------- Hot / featured badges ---------- */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-hot { background: var(--c-accent-grad); color: #fff; }
.badge-feat { background: #fef3c7; color: #92400e; }

/* ---------- Right column ---------- */
.hot-news .item {
  display: grid; grid-template-columns: 64px 1fr; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--c-border);
}
.hot-news .item:last-child { border-bottom: 0; }
.hot-news .thumb { width: 64px; height: 48px; border-radius: 4px; overflow: hidden; background: var(--c-chip); }
.hot-news .thumb img { width: 100%; height: 100%; object-fit: cover; }
.hot-news .t { font-size: 12.5px; font-weight: 600; line-height: 1.35; margin: 0; }
.hot-news .t a { color: var(--c-text); }
.hot-news .meta { font-size: 11px; color: var(--c-muted); margin-top: 4px; }

.tag-cloud { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 16px; }
.tag-cloud a {
  display: inline-block; padding: 4px 10px; border-radius: 14px;
  background: var(--c-chip); color: var(--c-text); font-size: 12px;
}

/* ---------- Article view ---------- */
.article {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
}
.article h1 { font-size: 26px; margin: 6px 0 12px; }
.article .meta { color: var(--c-muted); font-size: 12.5px; margin-bottom: 16px; display: flex; gap: 14px; flex-wrap: wrap; }
.article .hero { border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.article .body { font-size: 15px; line-height: 1.7; }
.article .body p { margin: 0 0 14px; }
.article .body h1 { font-size: 22px; font-weight: 700; margin: 18px 0 10px; line-height: 1.3; }
.article .body h2 { font-size: 19px; font-weight: 700; margin: 16px 0 8px; line-height: 1.3; }
.article .body h3 { font-size: 16px; font-weight: 700; margin: 14px 0 6px; }
.article .body h4 { font-size: 14px; font-weight: 700; margin: 12px 0 4px; }
.article .body ul, .article .body ol { padding-left: 24px; margin: 0 0 14px; }
.article .body li { margin-bottom: 6px; }
.article .body blockquote { border-left: 4px solid var(--c-accent, #2c80c0); padding: 8px 16px; margin: 12px 0; background: var(--c-bg2, #f5f5f5); border-radius: 0 4px 4px 0; font-style: italic; }
.article .body strong, .article .body b { font-weight: 700; }
.article .body figure { margin: 16px 0; }
.article .body figcaption { font-size: 12px; color: var(--c-muted, #888); margin-top: 4px; }
.article .body img { max-width: 100%; border-radius: 6px; margin: 12px 0; }
.article .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--c-border); }

/* ---------- Comments ---------- */
.comments { padding: 14px 16px; }
.comment {
  padding: 10px 0;
  border-bottom: 1px solid var(--c-border);
}
.comment:last-child { border-bottom: 0; }
.comment .who { font-weight: 600; font-size: 13px; }
.comment .when { color: var(--c-muted); font-size: 11px; margin-left: 6px; }
.comment .body { font-size: 13px; margin-top: 4px; }
.comment-form { margin-top: 12px; display: grid; gap: 8px; }
.comment-form input, .comment-form textarea {
  padding: 8px 10px; border: 1px solid var(--c-border); border-radius: 6px;
  background: var(--c-card); color: var(--c-text); font-family: inherit; font-size: 13px;
}
.comment-form textarea { min-height: 80px; resize: vertical; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 12px; padding: 16px; }
.form label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.form .field input, .form .field textarea, .form .field select {
  width: 100%;
  padding: 8px 10px; border: 1px solid var(--c-border); border-radius: 6px;
  background: var(--c-card); color: var(--c-text); font-family: inherit; font-size: 13px;
}
.form .field textarea { min-height: 90px; }
.alert {
  padding: 10px 14px; border-radius: 6px; margin: 12px 16px 0;
  background: #fef2f2; border: 1px solid #fee2e2; color: #991b1b;
  font-size: 13px;
}
.alert-ok { background: #ecfdf5; border-color: #d1fae5; color: #065f46; }

/* ---------- Pager ---------- */
.pager { display: flex; justify-content: center; gap: 6px; padding: 14px 0; }
.pager a, .pager span {
  padding: 6px 10px;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  color: var(--c-text);
  font-size: 12px;
  background: var(--c-card);
}
.pager .cur { background: var(--c-link); color: #fff; border-color: var(--c-link); }

/* ---------- Misc ---------- */
.empty {
  padding: 40px 20px; text-align: center; color: var(--c-muted); font-size: 13px;
}
.flag-mini { display: inline-block; padding: 1px 6px; border-radius: 3px; background: var(--c-chip); font-size: 10.5px; color: var(--c-muted); }

/* ---------- Embed minimal ---------- */
body.embed {
  background: transparent;
}
body.embed .topbar { display: none; }
body.embed .wrap { padding: 0; }
body.embed .grid { grid-template-columns: 1fr; }
body.embed .col-left, body.embed .col-right { display: none; }
body.embed .card { border-radius: 0; border: 0; box-shadow: none; }
