/* ====== RVSOFT 前台样式 ======
   基于 CSS 自定义属性实现日/夜切换，所有样式集中管理，利用浏览器缓存 */

/* ====== ROOT / THEME ====== */
:root {
  --primary: #1a56db; --primary-dark: #1e40af; --primary-light: #3b82f6; --accent: #0ea5e9;
  --dark-bg: #1a2332; --dark-bg-alt: #1f2a3a;
  --gray: #64748b; --gray-light: #94a3b8;
  --bg: #f1f3f6; --bg-alt: #e5e8ec; --text: #1e293b; --text-muted: #64748b;
  --card-bg: #fff; --card-border: rgba(0,0,0,0.06);
  --gradient-1: linear-gradient(135deg, #1e40af, #1a56db, #0ea5e9);
  --gradient-2: linear-gradient(135deg, #1a2332, #243447, #2d4a6b);
  --shadow: 0 2px 8px rgba(0,0,0,0.06); --shadow-lg: 0 12px 30px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.14);
  --radius: 10px; --radius-lg: 16px;
  --font: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
}
[data-theme="dark"] {
  --bg: #141e2b; --bg-alt: #1a2638; --text: #cbd5e1; --text-muted: #8899aa;
  --card-bg: #1e2d42; --card-border: rgba(255,255,255,0.05);
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; line-height: 1.65;
}
a { text-decoration: none; }
img { max-width: 100%; height: auto; }
.container { max-width: 1240px; }

/* NAVBAR */
.navbar {
  background: rgba(15,23,42,0.97); backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06); padding: 8px 0;
}
.navbar-brand { font-size: 1.3rem; font-weight: 800; color: #fff !important; }
.navbar-brand i, .navbar-brand span { color: var(--primary-light); }
.navbar .nav-link {
  color: rgba(255,255,255,0.72) !important; font-weight: 500; font-size: 0.86rem;
  padding: 6px 12px !important; border-radius: 6px; transition: all .2s;
  margin: 0 1px; white-space: nowrap;
}
.navbar .nav-link:hover, .navbar .nav-link.active {
  color: #fff !important; background: rgba(255,255,255,0.08);
}
.navbar .dropdown-menu {
  background: rgba(15,23,42,0.98); backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 12px;
  padding: 6px 0; margin-top: 8px;
}
.navbar .dropdown-item {
  color: rgba(255,255,255,0.68); font-size: 0.85rem;
  padding: 7px 18px; transition: all .2s;
}
.navbar .dropdown-item:hover { color: #fff; background: rgba(255,255,255,0.06); }
.navbar-toggler { border: none; }
.navbar-actions, .navbar-right-wrap {
  display: flex; align-items: center; gap: 10px; margin-left: 14px; flex-shrink: 0;
}
.navbar-clock {
  color: #fff; font-size: 0.86rem; font-weight: 400;
  white-space: nowrap; line-height: 1; letter-spacing: 0.5px;
}
.theme-btn-nav {
  background: transparent; border: 1px solid rgba(255,255,255,0.18); color: #fff;
  width: 30px; height: 30px; border-radius: 50%; font-size: 0.85rem;
  cursor: pointer; transition: all .25s;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.theme-btn-nav:hover { background: rgba(255,255,255,0.1); }

/* HERO */
.hero-section { position: relative; background: var(--gradient-2); overflow: hidden; }
.hero-banner { position: relative; z-index: 1; }
.hero-banner .swiper-slide {
  height: 480px; max-height: 70vh; background-size: cover;
  background-position: center; display: flex; align-items: center;
}
.hero-banner .swiper-slide .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(15,23,42,0.8), rgba(15,23,42,0.25), rgba(26,86,219,0.15));
}
.hero-banner .hero-content { position: relative; z-index: 2; max-width: 650px; padding: 60px; }
.hero-banner .badge {
  background: rgba(14,165,233,0.18); color: var(--accent);
  border: 1px solid rgba(14,165,233,0.3); border-radius: 50px;
  padding: 5px 18px; font-weight: 600; font-size: 0.76rem;
  letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 16px; display: inline-block;
}
.hero-banner h1 {
  color: #fff; font-size: 2.5rem; font-weight: 800;
  line-height: 1.2; margin-bottom: 12px; letter-spacing: -1px;
}
.hero-banner p { color: rgba(255,255,255,0.6); font-size: 1.02rem; margin-bottom: 20px; }
.hero-banner .swiper-pagination-bullet {
  background: rgba(255,255,255,0.35); width: 9px; height: 9px; opacity: 1;
}
.hero-banner .swiper-pagination-bullet-active { background: var(--accent); }
.hero-banner .swiper-button-next, .hero-banner .swiper-button-prev {
  color: rgba(255,255,255,0.45); transition: color .3s;
}
.hero-banner .swiper-button-next:hover, .hero-banner .swiper-button-prev:hover { color: #fff; }
.btn-primary-hero {
  background: var(--gradient-1); border: none; color: #fff;
  padding: 11px 32px; border-radius: 50px; font-weight: 600; font-size: 0.93rem;
  transition: all .3s; box-shadow: 0 6px 24px rgba(26,86,219,0.35);
  display: inline-block; margin-right: 10px;
}
.btn-primary-hero:hover {
  transform: translateY(-2px); box-shadow: 0 10px 35px rgba(26,86,219,0.5); color: #fff;
}
.btn-outline-hero {
  border: 1.5px solid rgba(255,255,255,0.3); color: #fff;
  padding: 11px 32px; border-radius: 50px; font-weight: 600; font-size: 0.93rem;
  transition: all .3s; background: transparent; display: inline-block;
}
.btn-outline-hero:hover {
  border-color: #fff; background: rgba(255,255,255,0.08); color: #fff;
}

/* SECTIONS */
.section-head { text-align: center; padding: 40px 0 24px; }
.section-tag {
  display: inline-block; background: rgba(26,86,219,0.07); color: var(--primary);
  border: 1px solid rgba(26,86,219,0.12); padding: 4px 16px; border-radius: 50px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: 10px;
}
.section-title-box {
  display: inline-block; padding: 10px 32px; border-radius: 50px;
  background: rgba(26,86,219,0.08); color: var(--primary);
  font-size: 1.6rem; font-weight: 800; letter-spacing: -0.5px;
  margin-bottom: 12px; border: 1px solid rgba(26,86,219,0.1);
}
.section-desc {
  font-size: 1.02rem; color: var(--text-muted); max-width: 620px; margin: 0 auto;
}

/* CARDS */
.card { background: var(--card-bg); }
.card-prod {
  background: var(--card-bg); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--card-border);
  transition: all .3s; height: 100%;
}
.card-prod:hover { transform: translateY(-5px); box-shadow: var(--shadow-xl); }
.card-prod-img { height: 200px; background-size: cover; background-position: center; }
.card-prod-body { padding: 20px; }
.card-prod-body h5 { font-weight: 700; font-size: 1.05rem; margin-bottom: 5px; color: var(--text); }
.card-prod-body p { font-size: 0.86rem; color: var(--text-muted); line-height: 1.55; }
.card-prod-body .tag {
  display: inline-block; padding: 3px 10px; border-radius: 50px;
  font-size: 0.72rem; font-weight: 600;
  background: rgba(14,165,233,0.08); color: var(--accent); margin-top: 6px;
}
.icon-placeholder {
  height: 200px; background: linear-gradient(135deg, #e8f0fe, #dbeafe);
  display: flex; align-items: center; justify-content: center;
}
.icon-placeholder i { font-size: 2.8rem; color: var(--primary-light); opacity: 0.5; }

/* STATS */
.stats-section { background: var(--gradient-2); color: #fff; position: relative; overflow: hidden; }
.stat-item { text-align: center; padding: 44px 16px; }
.stat-num {
  font-size: 4rem; font-weight: 900; letter-spacing: -3px;
  line-height: 1; color: #fff; opacity: 0; transition: opacity 0.4s;
}
.stat-num.animated { opacity: 1; }
.stat-label { font-size: 0.95rem; color: rgba(255,255,255,0.52); font-weight: 500; margin-top: 6px; }
.stat-bar {
  height: 4px; background: rgba(255,255,255,0.07);
  border-radius: 2px; margin-top: 10px; overflow: hidden;
}
.stat-bar-fill {
  height: 100%; background: var(--gradient-1); border-radius: 2px;
  width: 0; transition: width 1.8s ease-out;
}

/* PARTNERS */
.partner-card {
  background: var(--card-bg); border-radius: var(--radius); padding: 10px;
  text-align: center; box-shadow: var(--shadow); border: 1px solid var(--card-border);
  transition: all .25s; height: 100%; display: flex; align-items: center;
  justify-content: center; position: relative; overflow: hidden;
}
.partner-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.partner-card img { width: 160px; height: 60px; object-fit: contain; transition: opacity .25s; }
.partner-card .name {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.7); color: #fff; font-weight: 600;
  font-size: 0.75rem; padding: 4px 6px; opacity: 0; transition: opacity .25s;
  pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.partner-card:hover .name { opacity: 1; }

/* FAV */
.fav-section { background: var(--bg); }
.fav-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 12px 32px;
  border-radius: 50px; background: var(--gradient-1); color: #fff;
  font-weight: 600; font-size: 0.95rem; border: none;
  cursor: pointer; transition: all .3s;
  box-shadow: 0 6px 24px rgba(26,86,219,0.3);
}
.fav-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(26,86,219,0.45); }

/* FOOTER */
.footer { background: var(--dark-bg); color: rgba(255,255,255,0.5); font-size: 0.88rem; }
.footer h5, .footer h6 { color: #fff; font-weight: 700; margin-bottom: 14px; font-size: 0.92rem; }
.footer a { color: rgba(255,255,255,0.42); transition: color .2s; }
.footer a:hover { color: var(--primary-light); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 18px; margin-top: 30px; padding-bottom: 20px; font-size: 0.82rem;
  background: var(--dark-bg);
  color: rgba(255,255,255,0.5);
}

/* ARTICLE BODY — 文章正文统一排版 */
.article-body { font-size: 1.05rem; line-height: 1.9; color: var(--text); word-break: break-word; }
.article-body img { max-width: 100%; height: auto; border-radius: 12px; margin: 20px 0; }
.article-body table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.95rem; }
.article-body td, .article-body th { border: 1px solid var(--card-border); padding: 10px 14px; }
.article-body th { background: var(--bg-alt); font-weight: 600; color: var(--text); }
.article-body p { margin-bottom: 14px; }
.article-body p.indent { text-indent: 2em; }
.article-body p.lead { font-size: 1.1rem; font-weight: 500; color: var(--text); margin-bottom: 18px; }
.article-body p.spaced { margin-top: 20px; margin-bottom: 20px; }
.article-body h1 { font-size: 1.8rem; margin-top: 32px; margin-bottom: 16px; font-weight: 800; color: var(--text); }
.article-body h2 { font-size: 1.5rem; margin-top: 28px; margin-bottom: 14px; font-weight: 700; color: var(--text); }
.article-body h3 { font-size: 1.25rem; margin-top: 24px; margin-bottom: 12px; font-weight: 700; color: var(--text); }
.article-body h4 { font-size: 1.1rem; margin-top: 20px; margin-bottom: 10px; font-weight: 600; color: var(--text); }
.article-body ul, .article-body ol { padding-left: 24px; margin-bottom: 14px; }
.article-body ul li, .article-body ol li { margin-bottom: 6px; }
.article-body blockquote { border-left: 4px solid var(--primary); padding: 12px 20px; margin: 16px 0; background: var(--bg-alt); border-radius: 0 8px 8px 0; color: var(--text-muted); }
.article-body pre { background: #1e293b; color: #e2e8f0; padding: 16px 20px; border-radius: 10px; overflow-x: auto; font-size: 0.9rem; line-height: 1.6; margin: 16px 0; }
.article-body code { font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace; font-size: 0.88em; background: var(--bg-alt); padding: 2px 6px; border-radius: 4px; }
.article-body pre code { background: transparent; padding: 0; font-size: inherit; color: inherit; }
.article-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.article-body a:hover { color: var(--primary-dark); }
.article-body hr { margin: 24px 0; border: 0; border-top: 1px solid var(--card-border); }
.article-body figure { margin: 16px 0; text-align: center; }
.article-body figcaption { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }
.article-body .text-center { text-align: center; }
.article-body .text-right { text-align: right; }
.article-body .text-left { text-align: left; }
/* 兜底兼容旧版内联样式（已存储内容可能有 style="text-indent:..." 等） */
.article-body [style*="text-indent"] { text-indent: 2em; }

/* ====== 响应式媒体 & 表格 ====== */
.article-body iframe { max-width: 100%; border-radius: 12px; margin: 16px 0; }
.article-body video, .article-body audio { max-width: 100%; border-radius: 12px; margin: 12px 0; }
.article-body .bilibili-embed { margin: 16px 0; border-radius: 12px; overflow: hidden; }
@media (max-width: 768px) {
  .article-body table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 768px) {
  .hero-banner .swiper-slide { height: 300px; }
  .hero-banner .hero-content { padding: 20px 16px; }
  .hero-banner h1 { font-size: 1.5rem; }
  .stat-num { font-size: 2.6rem; }
  .section-title-box { font-size: 1.3rem; padding: 8px 24px; }
  .footer { text-align: center; }
}

/* 面包屑暗色模式修复 */
.breadcrumb-item.active { color: var(--text-muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* bg-light 暗色模式修复（附件下载区） */
[data-theme="dark"] .bg-light { background: var(--bg-alt) !important; color: var(--text); }
[data-theme="dark"] .bg-light h6 { color: var(--text); }

/* 暗色模式下文本覆盖 */
[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] .text-dark { color: var(--text) !important; }

/* 暗色模式下卡片内文字颜色覆盖 */
[data-theme="dark"] .card { color: var(--text); }
