/* blog-template-version: 13 */
/* Giao diện sáng/tối đồng bộ với trang chat (mặc định sáng, xanh ngọc) */
:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-subtle: #cbd5e1;
  --text-main: #0f172a;
  --text-soft: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --text-strong: #020617;
  --header-bg: rgba(255, 255, 255, .6);
  --primary: #10b981;
  --primary-hover: #059669;
  --accent-blue: #0369a1;
  --accent-rose: #e11d48;
  --max-w: 1240px;
}
/* Chế độ tối (theo lựa chọn Sáng/Tối của trang web, mặc định là sáng) */
html.dark {
  --bg-page: #09090b;
  --bg-card: #121215;
  --bg-card-hover: #18181b;
  --bg-subtle: #18181b;
  --border-color: #27272a;
  --border-subtle: #3f3f46;
  --text-main: #f4f4f5;
  --text-soft: #d4d4d8;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --text-strong: #ffffff;
  --header-bg: rgba(9, 9, 11, .5);
  --accent-blue: #38bdf8;
  --accent-rose: #f43f5e;
}

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

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

/* Header đồng bộ Chat Page */
.app-header {
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 58px;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.brand-bolt {
  font-size: 16px;
  background: #10b981;
  color: #000;
  border-radius: 6px;
  padding: 2px 5px;
  font-weight: 900;
}

.brand-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--text-strong);
}

.brand-sub {
  font-weight: 500;
  color: var(--text-muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-strong);
  background: var(--bg-card);
}

.nav-item.active {
  color: #10b981;
  font-weight: 700;
}

.badge-new {
  font-size: 9px;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  padding: 1px 6px;
  border-radius: 9999px;
}

/* Switcher bộ môn (LMHT / Bóng đá) */
.sport-switcher-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.switcher-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  font-mono: monospace;
}

.switcher-pills {
  display: flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 2px;
  border-radius: 10px;
}

.sport-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
}

.sport-pill.active {
  background: var(--border-color);
  color: #10b981;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Auth Area */
.auth-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-strong);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.user-avatar-mini {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #10b981;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
}

.user-role-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
}

.user-role-badge.badge-admin {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.user-role-badge.badge-user {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.btn-nav-login {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-nav-login:hover {
  background: var(--border-color);
}

.btn-nav-register {
  padding: 6px 14px;
  border-radius: 8px;
  background: #10b981;
  color: #000000;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-nav-register:hover {
  background: #059669;
}

/* AI Spotlight Section */
.ai-spotlight-section {
  max-width: var(--max-w);
  margin: 20px auto 0;
  padding: 0 20px;
}

.spotlight-card {
  background: radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.08), transparent 40%), var(--bg-card);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 14px;
  padding: 18px 24px;
}

.spotlight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.spotlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.pulse-indicator {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

.btn-open-chat {
  font-size: 12px;
  font-weight: 700;
  color: #10b981;
  text-decoration: none;
}

.spotlight-body {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.spotlight-icon-wrap {
  font-size: 32px;
}

.spotlight-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-strong);
}

.spotlight-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.prompt-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prompt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-soft);
  text-decoration: none;
  transition: all 0.2s;
}

.prompt-chip:hover {
  background: var(--border-color);
  border-color: #10b981;
  color: var(--text-strong);
}

.chip-arrow {
  color: #10b981;
  font-weight: 800;
}

/* Match Charts Section */
.match-chart-section {
  max-width: var(--max-w);
  margin: 20px auto 0;
  padding: 0 20px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px 24px;
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.chart-tag {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-blue);
  letter-spacing: 0.5px;
}

.chart-match-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-strong);
  margin-top: 2px;
}

.match-meta-score {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
}

.score-vs {
  font-size: 12px;
  color: var(--text-dim);
}

.chart-content-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 24px;
}

.box-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.svg-chart-container {
  width: 100%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px;
}

.gold-svg {
  width: 100%;
  height: 140px;
}

.chart-note {
  font-size: 12px;
  color: #10b981;
  margin-top: 8px;
  font-weight: 500;
}

.obj-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.obj-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
}

.obj-val-a {
  font-weight: 800;
  color: #10b981;
}

.obj-label {
  color: var(--text-muted);
  font-size: 12px;
}

.obj-val-b {
  font-weight: 800;
  color: #f43f5e;
}

.mini-simulator {
  margin-top: 14px;
}

.sim-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sim-meter {
  height: 22px;
  background: var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.sim-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  color: #000;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main 3-Column Layout */
.main-container {
  max-width: var(--max-w);
  margin: 28px auto 48px;
  padding: 0 20px;
}

.news-portal-grid {
  display: grid;
  grid-template-columns: 2.3fr 1.35fr 1.35fr;
  gap: 32px;
}

/* Cột 1: Dòng tin chính */
.col-main-stream {
  display: flex;
  flex-direction: column;
}

.news-card {
  display: flex;
  gap: 18px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px dashed var(--border-color);
}

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

.news-thumb-wrap {
  flex-shrink: 0;
  width: 220px;
  height: 145px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
}

.news-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.news-thumb-wrap:hover .news-thumb {
  transform: scale(1.04);
}

.news-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-category-bar {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-blue);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-prefix {
  color: var(--text-dim);
}

.badge-chart {
  font-size: 10px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.news-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 8px;
}

.news-title a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.2s;
}

.news-title a:hover {
  color: #10b981;
}

.news-summary {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.news-footer-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: auto;
  display: flex;
  gap: 6px;
}

/* Cột 2 & Cột 3 */
.section-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.col-notable {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  height: fit-content;
}

.notable-featured {
  margin-bottom: 16px;
}

.notable-img-wrap {
  display: block;
  width: 100%;
  height: 160px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}

.notable-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.notable-featured-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.notable-featured-title a {
  color: var(--text-strong);
  text-decoration: none;
}

.notable-featured-title a:hover {
  color: #10b981;
}

.notable-list {
  display: flex;
  flex-direction: column;
}

.notable-item {
  padding: 11px 0;
  border-top: 1px solid var(--border-color);
}

.notable-item a {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.notable-item a:hover {
  color: #10b981;
}

/* Cột 3: Góc nhìn */
.col-perspectives {
  height: fit-content;
}

.perspectives-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.perspective-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid var(--border-color);
}

.quote-symbol {
  font-size: 32px;
  line-height: 1;
  font-family: Georgia, serif;
  color: var(--accent-blue);
  margin-bottom: 6px;
}

.quote-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-main);
  margin-bottom: 16px;
}

.quote-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.author-name {
  font-size: 14px;
  font-weight: 700;
  color: #10b981;
}

.author-title {
  font-size: 12px;
  color: var(--text-dim);
}

.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
}

/* Detail Article Layout */
.detail-layout .detail-grid {
  display: grid;
  grid-template-columns: 2.8fr 1.2fr;
  gap: 36px;
}

.article-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
}

.breadcrumbs {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.breadcrumbs a {
  color: #10b981;
  text-decoration: none;
}

.article-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
  color: var(--text-strong);
}

.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.article-hero-wrap {
  width: 100%;
  max-height: 440px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
}

.article-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-body {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-soft);
}

.article-body p {
  margin-bottom: 18px;
}

.article-body h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 28px 0 14px;
  color: var(--text-strong);
}

.article-body .lead {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-main);
}

/* Callout hỏi AI */
.ask-ai-callout {
  background: var(--bg-subtle);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 10px;
  padding: 18px;
  margin: 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.callout-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.callout-icon {
  font-size: 28px;
}

.callout-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-strong);
}

.callout-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-ask-ai-now {
  background: #10b981;
  color: #000000;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

/* Comments Section */
.comments-section {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border-color);
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.comments-header h3 {
  font-size: 18px;
  font-weight: 800;
}

.comment-logged-in-alert {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 12px;
  color: var(--text-main);
}

.comment-form {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 28px;
}

.form-row {
  margin-bottom: 12px;
}

.form-input, .form-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  outline: none;
  background: var(--bg-card);
  color: var(--text-main);
  transition: border-color 0.2s;
}

.form-input:focus, .form-textarea:focus {
  border-color: #10b981;
}

.form-input.input-readonly {
  background: var(--border-color);
  color: #10b981;
  font-weight: 700;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-submit {
  background: #10b981;
  color: #000000;
  border: none;
  padding: 9px 22px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-submit:hover {
  background: #059669;
}

.comment-status-msg {
  font-size: 12px;
  font-weight: 600;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.comment-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #10b981;
  color: #000;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.comment-content-box {
  flex: 1;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.comment-author {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-strong);
}

.comment-time {
  font-size: 11.5px;
  color: var(--text-dim);
}

.comment-text {
  font-size: 13.5px;
  color: var(--text-soft);
  line-height: 1.55;
}

.no-comments {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  padding: 16px 0;
  text-align: center;
}

/* Sidebar in detail */
.sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 24px;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-strong);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.related-item {
  text-decoration: none;
  display: block;
}

.related-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-blue);
  display: block;
}

.related-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
  margin-top: 2px;
  transition: color 0.2s;
}

.related-item:hover .related-title {
  color: #10b981;
}

/* Footer */
.app-footer {
  background: var(--bg-page);
  border-top: 1px solid var(--border-color);
  padding: 28px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}


/* Responsive */
@media (max-width: 1024px) {
  .news-portal-grid {
    grid-template-columns: 1fr 1fr;
  }
  .col-main-stream {
    grid-column: span 2;
  }
  .detail-layout .detail-grid {
    grid-template-columns: 1fr;
  }
  .chart-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .news-portal-grid {
    grid-template-columns: 1fr;
  }
  .col-main-stream {
    grid-column: span 1;
  }
  .news-card {
    flex-direction: column;
  }
  .news-thumb-wrap {
    width: 100%;
    height: 180px;
  }
  .header-right .main-nav .nav-item { padding: 6px 8px; }
}

/* ===== Khối nội dung & biểu đồ (blocks.html / blog_charts.py) ===== */
.article-body .blk-heading { margin: 1.6em 0 .5em; line-height: 1.3; }
.article-body .blk-figure { margin: 1.4em 0; }
.article-body .blk-figure img { max-width: 100%; border-radius: 10px; border: 1px solid var(--border-color); }
.article-body .blk-figure figcaption, .chart-note { color: var(--text-dim); font-size: 13px; margin-top: 6px; }
.article-body .blk-quote { border-left: 3px solid var(--primary); padding: 6px 16px; margin: 1.4em 0; color: var(--text-muted); font-style: italic; }
.article-body .blk-quote cite { display: block; font-size: 13px; margin-top: 4px; color: var(--text-dim); }
.article-body .blk-list { margin: 1em 0 1em 1.4em; }
.blk-table-wrap { overflow-x: auto; margin: 1.4em 0; }
.blk-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.blk-table th, .blk-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-color); text-align: left; }
.blk-table th { color: var(--text-muted); font-weight: 600; background: var(--bg-subtle); }
.blk-table caption { text-align: left; color: var(--text-dim); font-size: 13px; margin-bottom: 6px; }
.blk-callout { border: 1px solid var(--border-subtle); border-left-width: 4px; border-radius: 8px; padding: 12px 16px; margin: 1.4em 0; background: var(--bg-card); }
.blk-callout strong { display: block; margin-bottom: 4px; }
.blk-callout.tone-info { border-left-color: var(--accent-blue); }
.blk-callout.tone-good { border-left-color: var(--primary); }
.blk-callout.tone-warn { border-left-color: #f59e0b; }
.blk-callout.tone-bad { border-left-color: var(--accent-rose); }
.blk-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 1.4em 0; }
.blk-kpis .kpi { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.kpi-value { font-size: 26px; font-weight: 800; color: var(--primary); }
.kpi-label { color: var(--text-muted); font-size: 13px; }
.kpi-note { color: var(--text-dim); font-size: 12px; }
figure.chart { margin: 1.6em 0; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; color: var(--text-main); }
figure.chart .chart-title { font-weight: 700; margin-bottom: 8px; }
figure.chart .chart-svg { display: block; max-width: 100%; height: auto; }
.chart-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; padding: 0; font-size: 13px; color: var(--text-muted); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }

/* ===== Dropdown chọn bộ môn ===== */
.sport-dropdown { position: relative; }
.sport-dropdown summary { list-style: none; display: flex; align-items: center; gap: 6px; padding: 5px 12px; background: var(--bg-subtle);
  border: 1px solid var(--border-color); border-radius: 10px; font-size: 12px; font-weight: 700; color: var(--primary); cursor: pointer; user-select: none; }
.sport-dropdown summary::-webkit-details-marker { display: none; }
.sport-dropdown[open] summary { background: var(--border-color); }
.sport-dropdown .caret { font-size: 10px; color: var(--text-dim); }
.sport-menu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 50; min-width: 220px; max-height: 60vh; overflow-y: auto; list-style: none;
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.sport-menu a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--text-muted); text-decoration: none; }
.sport-menu a:hover { background: var(--bg-subtle); color: var(--text-main); }
.sport-menu a.active { color: var(--primary); font-weight: 700; }

/* ===== Trả lời bình luận ===== */
.btn-reply { background: none; border: 0; color: var(--text-dim); font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.btn-reply:hover { color: var(--primary); }
.replies { margin-top: 8px; }
.replies > .comment-item { margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--border-color); }
.comment-item.depth-3 > .comment-content-box > .replies > .comment-item { padding-left: 0; border-left: 0; }
.reply-form { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; padding: 10px; background: var(--bg-subtle); border: 1px solid var(--border-color); border-radius: 10px; }
.reply-form .form-actions { display: flex; align-items: center; gap: 8px; }
.btn-cancel-reply { background: none; border: 1px solid var(--border-subtle); color: var(--text-muted); border-radius: 8px; padding: 6px 12px; font-size: 12px; cursor: pointer; }
.btn-cancel-reply:hover { color: var(--text-main); }

/* ===== Menu đồng nhất với trang chat (xanh ngọc) ===== */
.brand-bolt { background: linear-gradient(135deg, #10b981, #06b6d4); color: #03130d; border-radius: 8px; padding: 3px 7px; font-size: 14px; }
.brand-title { font-weight: 700; }
.brand-sub { font-weight: 800; color: #34d399; }
.nav-item:hover { color: #6ee7b7; background: rgba(16, 185, 129, .1); }
.nav-item.active { color: #6ee7b7; background: rgba(16, 185, 129, .16); }
/* khi nằm trong khung của trang web: menu chính do trang ngoài hiển thị, ở đây chỉ còn thanh chọn môn */
.embedded .brand-link, .embedded .header-right { display: none; }
.embedded .header-inner { justify-content: flex-start; }
.embedded .app-header { height: 48px; }
@media (max-width: 640px) { .header-right .main-nav { display: flex; gap: 2px; } .brand-title { display: none; } }

/* nền trang giống trang chat: quầng sáng xanh ngọc */
body { background-image: radial-gradient(60vmax 40vmax at 0% 0%, rgba(16, 185, 129, .14), transparent 70%), radial-gradient(50vmax 40vmax at 100% 100%, rgba(99, 102, 241, .10), transparent 70%); background-attachment: fixed; }
.app-header { backdrop-filter: blur(16px); }
html.dark .brand-title { color: #fff; }
.nav-item:hover, .nav-item.active { color: #047857; }
html.dark .nav-item:hover, html.dark .nav-item.active { color: #6ee7b7; }
.brand-sub { color: #059669; }
html.dark .brand-sub { color: #34d399; }

/* ===== Trang chủ blog: khối quảng cáo AI + danh sách bài soi kèo (một cột) ===== */
.news-portal-grid.single { grid-template-columns: 1fr; max-width: 900px; margin: 0 auto; }
.empty-list { padding: 40px 0; text-align: center; color: var(--text-muted); }

/* ===== Quảng cáo AI ở trang chi tiết bài: đóng/mở, câu hỏi gợi ý ===== */
.ask-ai-callout { position: relative; }
.callout-close { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-color);
  background: var(--bg-subtle); color: var(--text-muted); font-size: 13px; line-height: 1; cursor: pointer; transition: background .15s ease, color .15s ease; }
.callout-close:hover { background: rgba(244, 63, 94, .12); color: #f43f5e; border-color: rgba(244, 63, 94, .4); }
.callout-reopen { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, .35); background: rgba(16, 185, 129, .08); color: var(--text-main); font-size: 13px; font-weight: 700; cursor: pointer; }
.callout-reopen[hidden] { display: none; }
.callout-reopen span { color: #059669; font-weight: 800; }
html.dark .callout-reopen span { color: #34d399; }
.ask-ai-callout.is-closed { padding: 0; border: 0; background: none; box-shadow: none; }
.ask-ai-callout.is-closed .callout-body, .ask-ai-callout.is-closed .callout-close { display: none; }
.ai-cta-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* Ô hỏi tự do về bài viết: mở khung chat kèm nội dung bài (blog=<slug>) */
.ai-ask-form { display: flex; gap: 8px; margin-top: 12px; }
.ai-ask-form input[type=text] { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border-color);
  background: var(--bg-card); color: var(--text-main); font-size: 13px; }
.ai-ask-form input[type=text]:focus { outline: none; border-color: var(--primary); }
.ai-ask-form button { padding: 9px 16px; border-radius: 10px; border: 0; background: var(--primary); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; }
.ai-ask-form button:hover { background: var(--primary-hover); }
.chip-prompt { padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; text-decoration: none; color: var(--text-soft);
  background: var(--bg-subtle); border: 1px solid var(--border-color); transition: border-color .15s ease, color .15s ease; }
.chip-prompt:hover { border-color: rgba(16, 185, 129, .6); color: #059669; }
html.dark .chip-prompt:hover { color: #34d399; }

/* ===== Dải "Bản xem trước" của bài nháp ===== */
.preview-banner { position: sticky; top: 58px; z-index: 90; padding: 9px 20px; text-align: center; font-size: 13px;
  background: #fef3c7; color: #78350f; border-bottom: 1px solid #fcd34d; }
html.dark .preview-banner { background: #422006; color: #fde68a; border-bottom-color: #a16207; }

/* ===== So sánh hai đội trong bài (HTML do hệ thống chèn) ===== */
.vs-chart { margin: 1.4em 0; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 10px; }
.vs-head { display: flex; justify-content: space-between; font-weight: 800; font-size: 14px; margin-bottom: 12px; }
.vs-head .vs-a { color: #10b981; }
.vs-head .vs-b { color: #f43f5e; }
.vs-row { display: grid; grid-template-columns: 38px 1fr 38px; gap: 2px 8px; align-items: center; margin-bottom: 12px; }
.vs-row .vs-val { font-weight: 800; font-size: 15px; color: var(--text-strong); }
.vs-row .vs-val:nth-of-type(2) { text-align: right; }
.vs-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--bg-subtle); }
.vs-bar i { display: block; height: 100%; }
.vs-fill-a { background: #10b981; }
.vs-fill-b { background: #f43f5e; }
.vs-row .vs-label { grid-column: 2; text-align: center; font-size: 12px; color: var(--text-muted); }

/* ====================== TRANG CHỦ BLOG (bx-*): banner, bài nổi bật, lưới bài ====================== */
.bx-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border-color);
  background:
    radial-gradient(900px 380px at 15% -10%, rgba(16,185,129,.22), transparent 60%),
    radial-gradient(700px 320px at 90% 0%, rgba(56,189,248,.16), transparent 60%),
    var(--bg-page); }
.bx-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--border-color) 1px, transparent 1px), linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%); mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 72%); }
.bx-hero-inner { position: relative; max-width: var(--max-w); margin: 0 auto; padding: 56px 24px 44px; }
.bx-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--primary-hover); background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.35); }
html.dark .bx-eyebrow { color: #6ee7b7; }
.bx-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 0 rgba(16,185,129,.6); animation: bxPulse 1.8s infinite; }
@keyframes bxPulse { 70% { box-shadow: 0 0 0 9px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
.bx-hero-title { margin: 16px 0 10px; font-size: clamp(30px, 5vw, 52px); line-height: 1.1; font-weight: 900; letter-spacing: -.02em; color: var(--text-strong); }
.bx-grad { background: linear-gradient(90deg, #10b981, #38bdf8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bx-hero-sub { max-width: 640px; margin: 0; font-size: 16px; line-height: 1.6; color: var(--text-muted); }
.bx-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.bx-stat { padding: 7px 14px; border-radius: 999px; font-size: 13px; color: var(--text-soft); background: var(--bg-card); border: 1px solid var(--border-color); }
.bx-stat b { color: var(--text-strong); }

.bx-main { max-width: var(--max-w); margin: 0 auto; padding: 28px 24px 72px; }
.bx-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 26px; }
.bx-search { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; max-width: 380px; padding: 0 14px; height: 42px; border-radius: 999px;
  background: var(--bg-card); border: 1px solid var(--border-color); transition: border-color .15s, box-shadow .15s; }
.bx-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.bx-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-main); font-size: 14px; }
.bx-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.bx-pill { cursor: pointer; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-soft);
  background: var(--bg-card); border: 1px solid var(--border-color); transition: all .15s; }
.bx-pill:hover { border-color: var(--primary); color: var(--primary-hover); }
.bx-pill.active { color: #fff; background: linear-gradient(90deg, #10b981, #0ea5e9); border-color: transparent; }

.bx-feature { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; overflow: hidden; margin-bottom: 40px; border-radius: 22px;
  background: var(--bg-card); border: 1px solid var(--border-color); box-shadow: 0 18px 50px -24px rgba(2,6,23,.45); transition: transform .25s, box-shadow .25s; }
.bx-feature:hover { transform: translateY(-3px); box-shadow: 0 26px 60px -22px rgba(16,185,129,.35); }
.bx-feature-media { position: relative; display: block; min-height: 340px; overflow: hidden; }
.bx-feature-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.bx-feature:hover .bx-feature-media img { transform: scale(1.05); }
.bx-feature-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, rgba(2,6,23,.55), transparent 55%); }
.bx-feature-body { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 34px 36px; }
.bx-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.bx-tag { padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--primary-hover); background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3); }
html.dark .bx-tag { color: #6ee7b7; }
.bx-tag-soft { color: var(--accent-blue); background: rgba(56,189,248,.1); border-color: rgba(56,189,248,.28); }
.bx-feature-title { margin: 0; font-size: clamp(22px, 2.6vw, 32px); line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
.bx-feature-title a { color: var(--text-strong); text-decoration: none; }
.bx-feature-title a:hover { color: var(--primary-hover); }
.bx-feature-sum { margin: 0; font-size: 15px; line-height: 1.7; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.bx-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
.bx-meta i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; display: inline-block; }
.bx-cta { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 700;
  color: #fff; text-decoration: none; background: linear-gradient(90deg, #10b981, #0ea5e9); box-shadow: 0 10px 24px -10px rgba(16,185,129,.7); transition: transform .15s, gap .15s; }
.bx-cta:hover { transform: translateY(-1px); gap: 12px; }

.bx-badge { position: absolute; top: 14px; left: 14px; z-index: 2; max-width: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #fff; background: rgba(2,6,23,.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.18); }
.bx-badge-new { background: linear-gradient(90deg, #10b981, #0ea5e9); border-color: transparent; text-transform: uppercase; letter-spacing: .05em; }
.bx-when { position: absolute; top: 14px; right: 14px; z-index: 2; padding: 5px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 800; color: #fff; }
.bx-when:empty { display: none; }
.bx-when.today { background: #e11d48; box-shadow: 0 0 0 0 rgba(225,29,72,.6); animation: bxPulseRed 1.8s infinite; }
.bx-when.soon { background: #f59e0b; color: #1c1917; }
@keyframes bxPulseRed { 70% { box-shadow: 0 0 0 9px rgba(225,29,72,0); } 100% { box-shadow: 0 0 0 0 rgba(225,29,72,0); } }

.bx-section-title { margin: 0 0 18px; font-size: 20px; font-weight: 800; color: var(--text-strong); display: flex; align-items: center; gap: 12px; }
.bx-section-title::after { content: ""; flex: 1; height: 1px; background: var(--border-color); }
.bx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.bx-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: var(--bg-card); border: 1px solid var(--border-color);
  transition: transform .22s, box-shadow .22s, border-color .22s; }
.bx-card:hover { transform: translateY(-4px); border-color: rgba(16,185,129,.55); box-shadow: 0 20px 44px -22px rgba(16,185,129,.4); }
.bx-card-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.bx-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.bx-card:hover .bx-card-media img { transform: scale(1.07); }
.bx-card-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(2,6,23,.5), transparent 55%); }
.bx-card-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 18px 20px 18px; }
.bx-card-title { margin: 0; font-size: 17px; line-height: 1.35; font-weight: 800; }
.bx-card-title a { color: var(--text-strong); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bx-card-title a:hover { color: var(--primary-hover); }
.bx-card-sum { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bx-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border-color); }
.bx-more { font-size: 13px; font-weight: 700; color: var(--primary-hover); text-decoration: none; white-space: nowrap; }
html.dark .bx-more { color: #6ee7b7; }
.bx-more:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .bx-feature { grid-template-columns: 1fr; }
  .bx-feature-media { min-height: 220px; }
  .bx-feature-body { padding: 22px 20px 26px; }
  .bx-hero-inner { padding: 38px 16px 30px; }
  .bx-main { padding: 22px 16px 56px; }
}

/* ===== Header gọn trên điện thoại (không tràn ngang) ===== */
body { overflow-x: clip; }
@media (max-width: 640px) {
  .header-inner { padding: 0 12px; gap: 8px; }
  .header-left { gap: 8px; min-width: 0; }
  .header-right { gap: 4px; min-width: 0; }
  .main-nav { gap: 0; }
  .nav-item { white-space: nowrap; padding: 6px 9px; }
  .main-nav .nav-item:first-child { display: none; } /* "Chat": logo đã dẫn về trang chủ */
  .auth-box { gap: 6px; }
  .btn-nav-register { display: none; } /* "Đăng ký" có ngay ở trang đăng nhập */
  .btn-nav-login { white-space: nowrap; padding: 6px 10px; }
  .user-pill-btn { padding: 4px; gap: 0; }
  .user-pill-btn .user-name-text, .user-pill-btn .user-role-badge { display: none; } /* chỉ giữ avatar */
}
@media (max-width: 380px) {
  .nav-item { padding: 6px 7px; font-size: 12px; }
  .btn-nav-login { padding: 6px 8px; font-size: 11px; }
}

/* ===== Trang bài viết trên điện thoại ===== */
/* 1fr thường = minmax(auto, 1fr): nội dung rộng làm cả cột phình ra khỏi màn hình, dùng minmax(0, 1fr) để cột luôn vừa khung */
@media (max-width: 1024px) {
  .detail-layout .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .article-container { min-width: 0; }
}
@media (max-width: 640px) {
  .detail-layout .detail-grid { gap: 20px; }
  .article-container { padding: 18px 14px; border-radius: 10px; }
  .article-title { font-size: 22px; line-height: 1.3; }
  .article-body { overflow-wrap: anywhere; }
}
