/* ==========================================================================
   批八字 (m.mfpbz.com) - 纯自研独立内核前端样式
   中国传统红金国潮美学，手机移动端全响应式深度适配
   ========================================================================== */

:root {
  --primary-color: #b21016;
  --primary-hover: #cf1322;
  --primary-light: #fff1f0;
  --primary-border: #ffa39e;
  --gold-color: #d48806;
  --gold-light: #fffbe6;
  --gold-border: #ffe58f;
  --text-main: #262626;
  --text-muted: #8c8c8c;
  --bg-page: #fbf8f5;
  --bg-card: #ffffff;
  --border-card: #f0eae4;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 6px 16px rgba(178,16,22,0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 15px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-color);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ================== 页头与导航 ================== */
.cs-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #a8071a 0%, #b21016 50%, #cf1322 100%);
  box-shadow: 0 4px 16px rgba(178,16,22,0.25);
}

.cs-header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 8px;
}

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

.brand-title {
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.brand-badge {
  background: var(--gold-color);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255,255,255,0.4);
}

/* 横向滑动导航条 */
.cs-nav {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  background: rgba(0,0,0,0.12);
  padding: 0 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.cs-nav::-webkit-scrollbar {
  display: none;
}

.cs-nav-item {
  display: inline-block;
  padding: 10px 14px;
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 600;
  position: relative;
  transition: all 0.25s ease;
}

.cs-nav-item.is-active,
.cs-nav-item:hover {
  color: #fffb8f;
}

.cs-nav-item.is-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: #fffb8f;
  border-radius: 3px 3px 0 0;
}

/* ================== 主体布局 ================== */
.cs-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 12px 40px;
}

.cs-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 992px) {
  .cs-layout {
    flex-direction: row;
    align-items: flex-start;
  }
  .cs-main-col {
    flex: 1;
    min-width: 0;
  }
  .cs-side-col {
    width: 340px;
    flex-shrink: 0;
  }
}

/* 公告栏 */
.cs-notice-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gold-light);
  border: 1px solid var(--gold-border);
  color: #ad6800;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  font-weight: 500;
}

.notice-icon {
  color: var(--gold-color);
  font-size: 16px;
}

/* 模块容器卡片 */
.cs-block {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  padding: 18px 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.cs-block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #f5ede6;
  padding-bottom: 12px;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 800;
  color: #1f1f1f;
}

.cs-block-sub {
  font-size: 12px;
  font-weight: normal;
  color: var(--text-muted);
}

.cs-more-link {
  font-size: 13px;
  color: var(--primary-color);
  font-weight: 600;
}

/* ================== 1. 热门测算八宫格 ================== */
.index_item {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  list-style: none;
}

@media (max-width: 480px) {
  .index_item {
    gap: 8px;
  }
}

.index_item li a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  border-radius: var(--radius-sm);
  background: #fdfaf7;
  border: 1px solid #f5ede6;
  text-align: center;
  transition: all 0.25s ease;
}

.index_item li a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.index_item li img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  margin-bottom: 8px;
}

.index_item li p {
  font-size: 13px;
  font-weight: 700;
  color: #262626;
}

/* ================== 2. 推荐测算横幅 ================== */
.ib_box {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  list-style: none;
}

@media (max-width: 768px) {
  .ib_box {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ib_box li a {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease;
}

.ib_box li a:hover {
  transform: scale(1.02);
}

.ib_box li img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* ================== 3. 排行榜卡片列表 ================== */
.il_box {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  list-style: none;
}

@media (max-width: 600px) {
  .il_box {
    grid-template-columns: 1fr;
  }
}

.il_box li {
  background: #faf6f2;
  border: 1px solid #f0e6dc;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
}

.il_box li:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.il_box li a {
  display: flex;
  gap: 12px;
  padding: 10px;
}

.il_box li img {
  width: 90px;
  height: 65px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.il_words {
  font-size: 13px;
  font-weight: 700;
  color: #262626;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.il_number {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 6px 12px;
  border-top: 1px dashed #f0eae4;
  font-size: 11px;
}

.il_number .look {
  color: #8c8c8c;
}

.il_number .zhun {
  color: var(--primary-color);
  font-weight: 800;
}

/* ================== 4. 名师长文卡片网格 ================== */
.cs-articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 640px) {
  .cs-articles-grid {
    grid-template-columns: 1fr;
  }
}

.cs-article-card {
  background: #fdfaf7;
  border: 1px solid #f0e6dc;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cs-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--primary-light);
  color: var(--primary-color);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--primary-border);
}

.cs-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  padding-right: 60px;
}

.cs-card-desc {
  font-size: 12px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 12px;
}

.cs-card-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #8c8c8c;
  border-top: 1px solid #f5ede6;
  padding-top: 8px;
}

/* ================== 侧边栏排行样式 ================== */
.cs-side-block {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.cs-side-title {
  display: flex;
  align-items: center;
  border-bottom: 2px solid #f5ede6;
  padding-bottom: 10px;
  margin-bottom: 14px;
  font-size: 16px;
  font-weight: 800;
}

.douhao-talk-list {
  list-style: none;
}

.douhao-talk-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #f5ede6;
  font-size: 13px;
}

.douhao-talk-list li:last-child {
  border-bottom: none;
}

.rank-num {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  color: #666;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.rank-num.top {
  background: var(--primary-color);
  color: #fff;
}

.cs-side-article-list {
  list-style: none;
}

.cs-side-article-list li {
  padding: 10px 0;
  border-bottom: 1px solid #f5ede6;
}

.cs-side-article-list li:last-child {
  border-bottom: none;
}

.cs-side-article-list h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.4;
}

.cs-side-article-list p {
  font-size: 11px;
  color: #8c8c8c;
  line-height: 1.4;
}

.cs-trust-card {
  background: linear-gradient(135deg, #fff7e6 0%, #fffbe6 100%);
  border-color: #ffe58f;
  text-align: center;
}

.trust-badge {
  display: inline-block;
  background: var(--gold-color);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.cs-trust-card h4 {
  font-size: 15px;
  font-weight: 800;
  color: #873800;
  margin-bottom: 6px;
}

.cs-trust-card p {
  font-size: 12px;
  color: #ad6800;
  margin-bottom: 12px;
}

.trust-icons {
  display: flex;
  justify-content: space-around;
  font-size: 12px;
  color: #873800;
  font-weight: 700;
}

/* ================== 测算表单通用布局 ================== */
.bh-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 992px) {
  .bh-layout {
    flex-direction: row;
    align-items: flex-start;
  }
  .bh-main {
    flex: 1;
    min-width: 0;
  }
  .bh-side {
    width: 340px;
    flex-shrink: 0;
  }
}

.bh-combo {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.bh-hero {
  position: relative;
}

.m_top_tip {
  background: rgba(0,0,0,0.65);
  color: #ffd591;
  padding: 8px 14px;
  font-size: 12px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.bh-hero img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
}

.bh-form-card {
  padding: 24px 20px;
}

.bh-group {
  background: #fdfaf7;
  border: 1px solid #f0e6dc;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.group-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f5ede6;
}

.bh-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .bh-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.bh-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #595959;
  margin-bottom: 6px;
}

.bh-field input[type="text"],
.bh-field input[type="date"],
.bh-field input[type="tel"],
.bh-field select {
  width: 100%;
  height: 42px;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  background: #fff;
  transition: border-color 0.2s;
}

.bh-field input:focus,
.bh-field select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(178,16,22,0.15);
}

.calc-radio-group {
  display: flex;
  gap: 16px;
  height: 42px;
  align-items: center;
  font-size: 14px;
}

.bh-agree {
  font-size: 12px;
  color: #8c8c8c;
  margin-bottom: 16px;
  text-align: center;
}

.bh-submit-btn {
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, #cf1322 0%, #b21016 50%, #820014 100%);
  color: #ffffff;
  border: none;
  border-radius: 26px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(178,16,22,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.bh-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(178,16,22,0.45);
}

.yf-user-pay {
  background: #fdfaf7;
  border: 1px dashed #f0e6dc;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 16px 0;
  overflow: hidden;
  height: 38px;
}

.yf-user-pay-ul {
  list-style: none;
  position: relative;
  transition: top 0.4s ease;
}

.yf-user-pay-ul li {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.feature-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (max-width: 600px) {
  .feature-pills {
    grid-template-columns: 1fr;
  }
}

.pill-item {
  display: flex;
  gap: 10px;
  background: #fdfaf7;
  border: 1px solid #f5ede6;
  border-radius: 8px;
  padding: 10px;
}

.pill-num {
  font-size: 16px;
  font-weight: 900;
  color: var(--primary-color);
}

.pill-text {
  font-size: 12px;
  line-height: 1.4;
}

/* ================== 文章正文排版 ================== */
.article-breadcrumb {
  font-size: 13px;
  color: #8c8c8c;
  margin-bottom: 14px;
}

.article-container {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
}

.article-title {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.4;
  margin-bottom: 12px;
  color: #1f1f1f;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: #8c8c8c;
  border-bottom: 1px solid #f0eae4;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.article-summary {
  background: #fffbe6;
  border-left: 4px solid var(--gold-color);
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 14px;
  color: #873800;
  line-height: 1.6;
  margin-bottom: 20px;
}

.article-body {
  font-size: 16px;
  line-height: 1.8;
  color: #262626;
}

.article-body h2,
.article-body h3 {
  color: var(--primary-color);
  margin: 24px 0 12px;
  font-size: 18px;
  border-left: 4px solid var(--primary-color);
  padding-left: 10px;
}

.article-body p {
  margin-bottom: 14px;
  text-align: justify;
}

.article-body ul,
.article-body ol {
  margin: 12px 0 16px 24px;
}

.article-body li {
  margin-bottom: 6px;
}

.article-body .tip-box {
  background: #fdfaf7;
  border: 1px solid #f5ede6;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 16px 0;
}

.article-cta-box {
  background: linear-gradient(135deg, #fff1f0 0%, #fff7e6 100%);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 30px;
  text-align: center;
}

.cta-text h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 6px;
}

.cta-text p {
  font-size: 13px;
  color: #595959;
  margin-bottom: 16px;
}

.cta-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.cta-btn {
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.cta-btn.btn-primary {
  background: var(--primary-color);
  color: #fff;
}

.cta-btn.btn-secondary {
  background: var(--gold-color);
  color: #fff;
}

.article-footer-tips {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px dashed #f0eae4;
  font-size: 12px;
  color: #8c8c8c;
}

/* ================== 文章列表页 ================== */
.cs-list-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cs-list-item {
  border-bottom: 1px dashed #f0eae4;
  padding-bottom: 16px;
}

.cs-list-item:last-child {
  border-bottom: none;
}

.list-item-title a {
  font-size: 16px;
  font-weight: 700;
  color: #1f1f1f;
  line-height: 1.4;
}

.list-item-title a:hover {
  color: var(--primary-color);
}

.list-item-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin: 6px 0 10px;
}

.list-item-meta {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: #8c8c8c;
  align-items: center;
}

.read-more {
  margin-left: auto;
  color: var(--primary-color);
  font-weight: 700;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination a {
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
}

.pagination a.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

/* ================== 页脚 ================== */
.cs-footer {
  background: #1f1f1f;
  color: #bfbfbf;
  padding: 24px 16px 36px;
  text-align: center;
  font-size: 12px;
}

.cs-footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 14px;
}

.cs-footer-links a {
  color: #ffffff;
}

.cs-copyright {
  margin-bottom: 4px;
}

.cs-icp a {
  color: #8c8c8c;
}

.cs-disclaimer {
  max-width: 700px;
  margin: 12px auto 0;
  font-size: 11px;
  color: #595959;
  line-height: 1.5;
}

/* 返回顶部 */
.cs-backtop {
  position: fixed;
  bottom: 24px;
  right: 18px;
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  cursor: pointer;
  z-index: 99;
  display: none;
}

.cs-backtop.show {
  display: flex;
}

/* 加载动画遮罩 */
.cs-loading-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999999;
  align-items: center;
  justify-content: center;
}

.cs-loading-mask.is-show {
  display: flex;
}

.cs-loading-card {
  background: #fff;
  border-radius: 14px;
  padding: 28px 36px;
  text-align: center;
  max-width: 320px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.cs-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #fff1f0;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: csSpin 0.8s linear infinite;
}

@keyframes csSpin {
  to { transform: rotate(360deg); }
}

.cs-loading-text {
  font-size: 15px;
  font-weight: 800;
  color: #1f1f1f;
  margin-bottom: 6px;
}

.cs-loading-sub {
  font-size: 12px;
  color: #8c8c8c;
}
