/* ============================================================
   Glassmorphism Design — 毛玻璃 + 透明悬浮卡片
   Overrides newspaper style.css for a modern frosted-glass look.

   Loading order: Bootstrap → style.css → glassmorphism.css (last wins)
   ============================================================ */

/* =================================================================
   LAYER 0: BACKGROUND — dark fallback, painting injected by JS
   The daily painting is applied to html::before via daily-painting.js.
   ================================================================= */

html {
  min-height: 100vh;
  background-color: #0f172a;  /* fallback if painting fails to load */
}

body {
  /* background-image 由 daily-painting.js 内联设置（名画+暗色叠加层） */
  background-color: #0f172a;  /* 图片加载前/失败时的兜底色 */
  color: #e2e8f0 !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* 移除旧的 body::before，名画直接由 JS 设在 body 上 */
body::before {
  display: none !important;
}

/* =================================================================
   LAYER 1: NAVBAR — frosted glass header
   ================================================================= */

.navbar {
  background: rgba(15, 23, 42, 0.55) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3) !important;
  padding: 0.75rem 0 !important;
}


.navbar-brand {
  font-family: system-ui, -apple-system, sans-serif !important;
  font-weight: 700 !important;
  font-size: 1.25rem !important;
  letter-spacing: -0.01em !important;
  color: rgba(255, 255, 255, 0.92) !important;
  transition: color 0.2s ease;
}

.navbar-brand:hover {
  color: #fff !important;
}

.navbar-brand i {
  color: rgba(129, 140, 248, 0.9);
}

.navbar .nav-link {
  font-family: system-ui, -apple-system, sans-serif !important;
  font-weight: 500 !important;
  font-size: 0.875rem !important;
  color: rgba(255, 255, 255, 0.65) !important;
  letter-spacing: 0 !important;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.navbar .nav-link:hover {
  color: rgba(255, 255, 255, 0.95) !important;
  background: rgba(255, 255, 255, 0.06);
}

.navbar .nav-link.active {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.1);
  border-bottom: none !important;
}

/* =================================================================
   LAYER 2: MAIN CONTENT WRAPPER — sits above background
   ================================================================= */

main.container {
  position: relative;
  z-index: 1;
}

/* =================================================================
   LAYER 3: SECTION TITLES
   ================================================================= */

.section-title {
  font-family: system-ui, -apple-system, sans-serif !important;
  font-weight: 700 !important;
  font-size: 1.35rem !important;
  letter-spacing: -0.01em !important;
  color: rgba(255, 255, 255, 0.9) !important;
  padding-bottom: 8px !important;
  margin-bottom: 20px !important;
}

.section-title::after {
  height: 2px !important;
  width: 48px !important;
  border-radius: 2px;
  opacity: 0.6;
}

.section-title.daily { color: rgba(248, 180, 180, 0.9) !important; }
.section-title.daily::after { background: rgba(248, 180, 180, 0.7); }

.section-title.deep { color: rgba(168, 220, 168, 0.9) !important; }
.section-title.deep::after { background: rgba(168, 220, 168, 0.7); }

.section-title.global { color: rgba(168, 200, 240, 0.9) !important; }
.section-title.global::after { background: rgba(168, 200, 240, 0.7); }

.section-title small {
  color: rgba(255, 255, 255, 0.45) !important;
  font-family: system-ui, -apple-system, sans-serif !important;
}

/* =================================================================
   LAYER 4: CARDS — the core glassmorphism cards
   ================================================================= */

/* Main content cards */
.card {
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px !important;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.04) inset !important;
  transition: all 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.card:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.3),
    0 2px 0 rgba(255, 255, 255, 0.06) inset,
    0 0 0 1px rgba(255, 255, 255, 0.04) inset !important;
  transform: translateY(-2px);
}

/* =================================================================
   LAYER 5: CARD HEADERS — desaturated section colors on glass
   ================================================================= */

.card-header {
  border-radius: 16px 16px 0 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  font-family: system-ui, -apple-system, sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: -0.005em !important;
  padding: 0.875rem 1.25rem !important;
}

/* Daily boards — soft rose/maroon */
.board-daily .card-header {
  background: linear-gradient(135deg, rgba(180, 80, 80, 0.35) 0%, rgba(160, 70, 70, 0.20) 100%) !important;
  color: rgba(255, 220, 220, 0.95) !important;
  border-bottom: 1px solid rgba(255, 180, 180, 0.10) !important;
}

.board-daily .card {
  border-left: 2px solid rgba(220, 140, 140, 0.30) !important;
}

/* Deep articles — soft sage/green */
.board-deep .card-header {
  background: linear-gradient(135deg, rgba(80, 150, 80, 0.35) 0%, rgba(60, 120, 60, 0.20) 100%) !important;
  color: rgba(200, 240, 200, 0.95) !important;
  border-bottom: 1px solid rgba(140, 200, 140, 0.10) !important;
}

.board-deep .card {
  border-left: 2px solid rgba(120, 190, 120, 0.30) !important;
}

/* Global — soft periwinkle/blue */
.board-global .card-header {
  background: linear-gradient(135deg, rgba(80, 120, 200, 0.35) 0%, rgba(60, 90, 170, 0.20) 100%) !important;
  color: rgba(200, 220, 255, 0.95) !important;
  border-bottom: 1px solid rgba(140, 170, 240, 0.10) !important;
}

.board-global .card {
  border-left: 2px solid rgba(140, 170, 220, 0.30) !important;
}

/* Card header badges */
.card-header .badge.bg-light {
  background: rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.8) !important;
}

/* =================================================================
   LAYER 6: NEWS ITEMS — transparent rows inside glass cards
   ================================================================= */

.board-section .p-3 {
  transition: background 0.2s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.board-section .p-3:last-child {
  border-bottom: none !important;
}

.board-section .p-3:hover {
  background: rgba(255, 255, 255, 0.04) !important;
}

.item-title {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: 1.05rem !important;
  line-height: 1.5;
  transition: color 0.2s ease;
}

.item-title:hover {
  color: #fff !important;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

.item-title i {
  opacity: 0.50;
}

/* Summary & metadata text */
.board-section .text-muted,
.board-section .text-muted.small {
  color: rgba(255, 255, 255, 0.55) !important;
}

.board-section .text-muted.small p,
.board-section p.text-muted {
  color: rgba(255, 255, 255, 0.55) !important;
}

.board-section .text-muted span {
  color: rgba(255, 255, 255, 0.55) !important;
}

.board-section .text-success {
  color: rgba(168, 220, 168, 0.75) !important;
}

/* =================================================================
   LAYER 7: NAVIGATION STAT CARDS — glass chips
   ================================================================= */

.board-nav-card {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
  background: rgba(255, 255, 255, 0.07) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  border-radius: 14px !important;
}

.board-nav-card:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  transform: translateY(-3px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset !important;
}

.board-nav-card .card-body {
  padding: 0.85rem 0.5rem !important;
}

/* 板块名称：大字加粗 */
.board-nav-card small.text-muted,
.board-nav-card small {
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
}

/* 图标稍大 */
.board-nav-card .card-body > div:first-child {
  font-size: 1.8rem !important;
}

/* 计数徽章 */
.board-nav-card .badge {
  background: rgba(180, 140, 210, 0.50) !important;
  color: rgba(255, 255, 255, 0.92) !important;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.25em 0.65em;
}

/* =================================================================
   LAYER 8: RANKING BADGES — inside news items
   ================================================================= */

.board-daily .badge.bg-secondary {
  background: rgba(200, 140, 140, 0.40) !important;
  color: rgba(255, 220, 220, 0.9) !important;
}

.board-deep .badge.bg-success {
  background: rgba(120, 190, 120, 0.35) !important;
  color: rgba(200, 240, 200, 0.9) !important;
}

.board-global .badge.bg-warning {
  background: rgba(200, 180, 120, 0.35) !important;
  color: rgba(255, 240, 200, 0.9) !important;
}

/* Gold/silver/bronze emoji sizing — keep but center */
.board-section .me-3 {
  opacity: 0.85;
}

/* =================================================================
   LAYER 9: BUTTONS — frosted glass
   ================================================================= */

.btn-primary {
  background: rgba(139, 110, 210, 0.40) !important;
  border: 1px solid rgba(139, 110, 210, 0.25) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px !important;
  font-weight: 500 !important;
  transition: all 0.25s ease;
}

.btn-primary:hover {
  background: rgba(139, 110, 210, 0.55) !important;
  border-color: rgba(139, 110, 210, 0.40) !important;
  color: #fff !important;
  box-shadow: 0 4px 20px rgba(139, 110, 210, 0.25);
}

.btn-outline-primary {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.75) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px !important;
  font-weight: 500 !important;
  transition: all 0.25s ease;
}

.btn-outline-primary:hover {
  background: rgba(255, 255, 255, 0.10) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #fff !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.btn-warning {
  background: rgba(200, 160, 80, 0.40) !important;
  border: 1px solid rgba(200, 160, 80, 0.25) !important;
  color: rgba(255, 240, 200, 0.9) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px !important;
}

.btn-warning:hover {
  background: rgba(200, 160, 80, 0.55) !important;
}

.btn-sm {
  border-radius: 8px !important;
  padding: 0.375rem 0.875rem !important;
}

/* =================================================================
   LAYER 10: FORM INPUTS — glass inputs
   ================================================================= */

.form-control {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  color: rgba(255, 255, 255, 0.85) !important;
  border-radius: 10px !important;
  transition: all 0.25s ease;
}

.form-control:focus {
  background: rgba(255, 255, 255, 0.10) !important;
  border-color: rgba(139, 110, 210, 0.40) !important;
  box-shadow: 0 0 0 3px rgba(139, 110, 210, 0.12) !important;
  color: #fff !important;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.30) !important;
}

.input-group-text {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  color: rgba(255, 255, 255, 0.55) !important;
  border-radius: 10px 0 0 10px !important;
}

/* =================================================================
   LAYER 11: ALERTS — frosted notifications
   ================================================================= */

.alert {
  background: rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  color: rgba(255, 255, 255, 0.85) !important;
}

.alert-success {
  border-color: rgba(120, 200, 120, 0.20) !important;
  background: rgba(120, 200, 120, 0.08) !important;
}

.alert-danger {
  border-color: rgba(220, 120, 120, 0.20) !important;
  background: rgba(220, 120, 120, 0.08) !important;
}

.alert-warning {
  border-color: rgba(200, 180, 120, 0.20) !important;
  background: rgba(200, 180, 120, 0.08) !important;
}

.btn-close {
  filter: invert(1) opacity(0.5);
}

/* =================================================================
   LAYER 12: HISTORY CARDS
   ================================================================= */

.history-card {
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  transition: all 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.history-card:hover {
  background: rgba(255, 255, 255, 0.10) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* =================================================================
   LAYER 13: FOOTER
   ================================================================= */

footer,
footer.bg-light {
  background: rgba(15, 23, 42, 0.55) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.50) !important;
  font-family: system-ui, -apple-system, sans-serif !important;
  letter-spacing: 0 !important;
}

footer a,
footer a.text-muted {
  color: rgba(255, 255, 255, 0.55) !important;
}

footer a:hover {
  color: rgba(255, 255, 255, 0.80) !important;
}

footer img {
  opacity: 0.7;
}

/* =================================================================
   LAYER 14: SCROLL TO TOP BUTTON
   ================================================================= */

#scrollTopBtn {
  background: rgba(139, 110, 210, 0.40) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50% !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

#scrollTopBtn:hover {
  background: rgba(139, 110, 210, 0.60) !important;
  opacity: 1 !important;
}

/* =================================================================
   LAYER 15: TOP BAR TEXT
   ================================================================= */

main .fw-bold.mb-1 {
  color: rgba(255, 255, 255, 0.9) !important;
}

main .text-muted {
  color: rgba(255, 255, 255, 0.45) !important;
}

.badge.bg-success {
  background: rgba(100, 200, 120, 0.30) !important;
  color: rgba(200, 240, 200, 0.9) !important;
}

.badge.bg-warning {
  background: rgba(200, 180, 100, 0.30) !important;
  color: rgba(255, 240, 200, 0.9) !important;
}

.badge.bg-primary {
  background: rgba(139, 110, 210, 0.35) !important;
  color: rgba(230, 220, 255, 0.9) !important;
}

/* =================================================================
   LAYER 16: SCROLLBAR
   ================================================================= */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.15); }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* =================================================================
   LAYER 17: SELECTION
   ================================================================= */

::selection {
  background: rgba(139, 110, 210, 0.35);
  color: #fff;
}

/* =================================================================
   LAYER 18: EMPTY STATE
   ================================================================= */

.text-center.py-5 .display-1.text-muted {
  color: rgba(255, 255, 255, 0.15) !important;
}

.text-center.py-5 h3.text-muted {
  color: rgba(255, 255, 255, 0.40) !important;
}

/* =================================================================
   LAYER 19: ANIMATIONS — keep target pulse, update color
   ================================================================= */

.board-section:target {
  animation: glassTargetPulse 0.8s ease;
}

@keyframes glassTargetPulse {
  0%   { box-shadow: 0 0 0 0 rgba(139, 110, 210, 0.5); }
  50%  { box-shadow: 0 0 0 12px rgba(139, 110, 210, 0.15); }
  100% { box-shadow: 0 0 0 0 rgba(139, 110, 210, 0); }
}

/* =================================================================
   LAYER 20: TEXT COLOR OVERRIDES — force light text everywhere
   ================================================================= */

/* Bootstrap's .text-dark forces #212529 — must override for dark bg */
.text-dark,
.card-title.text-dark,
h5.text-dark,
a.text-dark,
.history-card .text-dark,
.history-card .card-title,
.card .text-dark,
.board-section .text-dark,
p.text-dark,
span.text-dark {
  color: rgba(255, 255, 255, 0.90) !important;
}

/* .text-dark inside news item links (history_detail has these) */
a.text-dark.fw-semibold {
  color: rgba(255, 255, 255, 0.90) !important;
}

a.text-dark.fw-semibold:hover {
  color: #fff !important;
}

/* Muted text — boost contrast on dark backgrounds */
.text-muted,
small.text-muted,
p.text-muted,
span.text-muted,
.card .text-muted,
.history-card .text-muted,
.board-section small.text-muted,
footer .text-muted,
a.text-muted {
  color: rgba(255, 255, 255, 0.55) !important;
}

/* Secondary / outline button text */
.btn-outline-secondary {
  color: rgba(255, 255, 255, 0.75) !important;
  border-color: rgba(255, 255, 255, 0.20) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-outline-secondary:hover {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  background: rgba(255, 255, 255, 0.12) !important;
}

/* History detail page — card header with purple gradient override */
.card-header[style*="background"] {
  color: #fff !important;
}

/* History detail page — badge bg-secondary in cards */
.board-section .badge.bg-secondary:not(.rounded-pill) {
  background: rgba(255, 255, 255, 0.15) !important;
  color: rgba(255, 255, 255, 0.80) !important;
}

/* =================================================================
   LAYER 21: RESPONSIVE
   ================================================================= */

@media (max-width: 768px) {
  .navbar-brand {
    font-size: 1.1rem !important;
  }
  .section-title {
    font-size: 1.15rem !important;
  }
  .card {
    border-radius: 12px !important;
  }
  .card-header {
    border-radius: 12px 12px 0 0 !important;
    padding: 0.75rem 1rem !important;
  }
}

/* =================================================================
   End Glassmorphism Design
   ================================================================= */
