/* 慧算账前台 v6.0.0 · 排版参考精品文档站：通栏焦点、专题横滑、排行榜、封面网格 */
:root {
  --ab-blue: #3d6bff;
  --ab-blue-2: #4a6ece;
  --ab-cyan: #30a8d5;
  --ab-bg: #f6f7f9;
  --ab-white: #ffffff;
  --ab-text: #333333;
  --ab-muted: #888888;
  --ab-line: #eeeeee;
  --ab-hot: #ff5a36;
  --ab-wrap: 1280px;
  --ab-header: 72px;
  --ab-shadow: 0 8px 24px rgba(20, 35, 70, 0.08);
}

* { box-sizing: border-box; }
body.ab-body {
  margin: 0;
  background: var(--ab-bg);
  color: var(--ab-text);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
body.ab-body a { color: inherit; text-decoration: none; }
body.ab-body img { max-width: 100%; border: 0; vertical-align: middle; }
button, input { font-family: inherit; }
.ab-wrap { width: min(var(--ab-wrap), calc(100% - 40px)); margin: 0 auto; }

.ab-header {
  position: relative;
  z-index: 30;
  height: var(--ab-header);
  background: var(--ab-white);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.page-home .ab-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0));
  box-shadow: none;
}
.ab-header__inner { display: flex; align-items: center; height: var(--ab-header); gap: 16px; }
.ab-logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  height: 46px;
  padding: 0 10px;
  background: #fff;
  border-radius: 4px;
}
.ab-logo img { max-height: 36px; width: auto; }
.ab-navwrap { flex: 1; min-width: 0; height: var(--ab-header); }
.ab-nav { display: flex; align-items: stretch; height: var(--ab-header); margin: 0; padding: 0; list-style: none; }
.ab-nav__item { position: relative; flex: 0 0 auto; }
.ab-nav__link {
  display: flex;
  align-items: center;
  height: var(--ab-header);
  padding: 0 14px;
  color: #222;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}
.page-home .ab-nav__link { color: #fff; }
.ab-nav__link.is-on, .ab-nav__link:hover { color: var(--ab-blue); }
.page-home .ab-nav__link.is-on, .page-home .ab-nav__link:hover { color: #fff; opacity: 0.85; }
.ab-nav__item:has(.ab-drop a) > .ab-nav__link::after { content: "▾"; margin-left: 4px; font-size: 11px; font-weight: 400; }
.ab-drop {
  display: none;
  position: absolute;
  top: calc(100% - 8px);
  left: 0;
  width: max-content;
  max-width: 560px;
  padding: 14px 18px 12px;
  background: #fff;
  border-radius: 4px;
  box-shadow: var(--ab-shadow);
}
.ab-nav__item:hover > .ab-drop:has(a),
.ab-nav__item:focus-within > .ab-drop:has(a) { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.ab-drop:not(:has(a)) { display: none !important; }
.ab-drop a { color: #555; font-size: 14px; font-weight: 400; line-height: 32px; white-space: nowrap; }
.ab-drop a:hover { color: var(--ab-blue); }

.ab-header__tools { flex: 0 0 auto; }
.page-home .ab-header__tools { display: none; }
.ab-user { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; color: #333; font-size: 13px; }
.page-home .ab-user { color: #fff; }
.ab-auth { display: flex; align-items: center; gap: 8px; }
.ab-auth a:hover { color: var(--ab-blue); }
.page-home .ab-auth a:hover { color: #fff; }
.ab-pub {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--ab-blue);
  border-radius: 2px;
  color: #fff !important;
  background: var(--ab-blue);
}
.page-home .ab-pub { border-color: #fff; background: transparent; }
.ab-burger {
  display: none;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.ab-burger span { display: block; height: 2px; margin: 5px 0; background: #222; border-radius: 2px; }
.page-home .ab-burger span { background: #fff; }

.ab-search { display: flex; align-items: stretch; height: 40px; background: #fff; border-radius: 2px; overflow: hidden; }
.ab-search input { width: 220px; border: 0; padding: 0 12px; outline: none; color: #333; background: transparent; }
.ab-search button {
  width: 72px;
  border: 0;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, var(--ab-blue-2), var(--ab-cyan));
}
.ab-search button:hover { filter: brightness(1.05); }
.ab-search--hero {
  height: 44px;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.ab-search--hero input { width: 100%; font-size: 14px; }
.ab-search--hero button { width: 88px; font-size: 15px; }

.ab-hero { position: relative; height: 320px; background: #3a63e8; overflow: hidden; }
.ab-slides, .ab-slide { position: absolute; inset: 0; }
.ab-slide { opacity: 0; transition: opacity 0.45s; }
.ab-slide.is-on, .ab-slides .ab-slide:first-child { opacity: 1; }
.ab-slides:has(.is-on) .ab-slide:first-child:not(.is-on) { opacity: 0; }
.ab-slide img, .ab-slide span { display: block; width: 100%; height: 100%; object-fit: cover; }
.ab-hero__btn {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.86);
  color: #333;
  font-size: 22px;
  line-height: 42px;
  cursor: pointer;
}
.ab-hero__btn:hover { background: #fff; }
.ab-hero__btn--prev { left: 18px; }
.ab-hero__btn--next { right: 18px; }
.ab-hero__dots { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 4; display: flex; justify-content: center; gap: 6px; }
.ab-hero__dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.55); cursor: pointer; }
.ab-hero__dots button.is-on { width: 18px; border-radius: 8px; background: #fff; }
.ab-hero__search {
  position: absolute;
  left: 50%;
  top: 58%;
  z-index: 5;
  width: min(560px, calc(100% - 48px));
  transform: translate(-50%, -50%);
}
.ab-hot { margin-top: 10px; color: #fff; font-size: 13px; text-align: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.ab-hot strong { font-weight: 600; }
.ab-hot a { margin: 0 6px; color: #fff; }
.ab-hot a:hover { text-decoration: underline; }

.ab-main { padding-bottom: 36px; }
.ab-block { margin-top: 28px; }
.ab-block__title { margin: 0 0 14px; font-size: 20px; font-weight: 700; color: #222; }

.ab-topics { position: relative; }
.ab-topics__view { overflow-x: auto; scrollbar-width: none; }
.ab-topics__view::-webkit-scrollbar { display: none; }
.ab-topics__track { display: flex; gap: 16px; margin: 0; padding: 2px 0 8px; list-style: none; }
.ab-topic { position: relative; flex: 0 0 260px; height: 146px; border-radius: 8px; overflow: hidden; background: #e9edf5; }
.ab-topic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ab-topic span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 12px 8px;
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62), transparent);
}
.ab-topics__btn {
  position: absolute;
  top: 88px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #333;
  font-size: 20px;
  line-height: 36px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}
.ab-topics__btn:hover { background: rgba(0, 0, 0, 0.5); }
.ab-topics__btn--prev { left: 0; }
.ab-topics__btn--next { right: 0; }

.ab-rankgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.ab-rank { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04); }
.ab-rank__hd { display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 16px; color: #fff; font-size: 16px; font-weight: 700; }
.ab-rank:nth-child(1) .ab-rank__hd { background: linear-gradient(90deg, #5b8dff, #79c2ff); }
.ab-rank:nth-child(2) .ab-rank__hd { background: linear-gradient(90deg, #ff7a3c, #ffb15a); }
.ab-rank:nth-child(3) .ab-rank__hd { background: linear-gradient(90deg, #ff5d73, #ff9aa4); }
.ab-rank__hd a { color: #fff; font-size: 13px; font-weight: 400; }
.ab-rank ol { margin: 0; padding: 8px 14px 12px; list-style: none; counter-reset: rk; }
.ab-rank li { counter-increment: rk; }
.ab-rank li a {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 36px;
  color: #555;
  font-size: 14px;
}
.ab-rank li a::before {
  content: counter(rk);
  display: inline-block;
  width: 22px;
  margin-right: 6px;
  color: #b5b5b5;
  font-weight: 700;
  font-style: italic;
}
.ab-rank li:nth-child(1) a::before { color: #ff5a36; }
.ab-rank li:nth-child(2) a::before { color: #ff8a22; }
.ab-rank li:nth-child(3) a::before { color: #f0b429; }
.ab-rank li a:hover { color: var(--ab-blue); }

.ab-sec__hd { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.ab-sec__title { font-size: 20px; font-weight: 700; color: #222; }
.ab-sec__links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 16px; }
.ab-sec__links a { color: #777; font-size: 14px; }
.ab-sec__links a:hover { color: var(--ab-blue); }
.ab-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px 16px; margin: 0; padding: 0; list-style: none; }
.ab-card { min-width: 0; }
.ab-card__meta span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-card__meta span:last-child { flex: 0 0 auto; margin-left: 8px; }
.ab-card__cover { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #eceff4; }
.ab-card__cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s; }
.ab-card:hover .ab-card__cover img { transform: scale(1.04); }
.ab-card__mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 30, 60, 0.28);
  opacity: 0;
  transition: opacity 0.2s;
}
.ab-card:hover .ab-card__mask { opacity: 1; }
.ab-card__mask span { padding: 6px 16px; background: #fff; color: var(--ab-blue); font-size: 13px; }
.ab-card__title {
  display: block;
  margin-top: 8px;
  color: #333;
  font-size: 14px;
  line-height: 22px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ab-card__title:hover { color: var(--ab-blue); }
.ab-card__meta { display: flex; justify-content: space-between; margin-top: 2px; color: #999; font-size: 12px; overflow: hidden; }
.ab-more {
  display: table;
  margin: 22px auto 0;
  min-width: 148px;
  height: 40px;
  padding: 0 28px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--ab-blue-2), var(--ab-cyan));
  color: #fff !important;
  font-size: 14px;
  line-height: 40px;
  text-align: center;
}
.ab-more:hover { filter: brightness(1.06); }

.ab-crumb { padding: 16px 0 4px; color: #999; font-size: 13px; }
.ab-crumb a { color: #777; }
.ab-crumb a:hover { color: var(--ab-blue); }
.ab-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 14px 0; }
.ab-filters b { margin-right: 4px; color: #333; font-weight: 600; }
.ab-filters a { padding: 3px 12px; color: #666; border-radius: 2px; }
.ab-filters a.is-on, .ab-filters a:hover { background: var(--ab-blue); color: #fff; }
.ab-count { margin: 0 0 14px; color: #888; }
.ab-count b { color: var(--ab-hot); font-weight: 600; }
.ab-pager { margin: 26px 0 8px; text-align: center; }
.ab-pager ul, .ab-pager .pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ab-pager li { display: inline-block; }
.ab-pager a, .ab-pager span {
  display: inline-block;
  min-width: 32px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 2px;
  color: #666;
}
.ab-pager .active span, .ab-pager .active a, .ab-pager span.current, .ab-pager .current { background: var(--ab-blue); border-color: var(--ab-blue); color: #fff; }
.ab-empty { grid-column: 1 / -1; padding: 48px 0; text-align: center; color: #999; background: #fff; }

.ab-article { margin-top: 12px; padding: 28px 36px 40px; background: #fff; border-radius: 4px; }
.ab-article__title { margin: 0; font-size: 24px; line-height: 1.4; font-weight: 700; text-align: center; }
.ab-article__meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 18px; padding-bottom: 14px; border-bottom: 1px solid #f0f0f0; color: #999; font-size: 13px; }
.ab-article__meta button { border: 0; background: none; color: var(--ab-blue); cursor: pointer; }
.ab-article__cover { margin: 0 auto 18px; max-width: 720px; background: #f3f5f8; }
.ab-article__cover img { width: 100%; height: auto; display: block; }
.ab-contact { margin: 0 0 18px; padding: 14px 16px; background: #f7f9fc; border-left: 3px solid var(--ab-blue); line-height: 1.9; }
.ab-contact b, .ab-contact font { color: var(--ab-hot) !important; }
.ab-content { font-size: 15px; line-height: 1.9; color: #333; word-break: break-word; }
.ab-content img { height: auto; }
.ab-subhead { margin: 28px 0 14px; font-size: 18px; font-weight: 700; }

.ab-searchpage { max-width: 640px; margin: 8px auto 20px; }
.ab-searchpage .ab-search { height: 44px; box-shadow: var(--ab-shadow); }
.ab-searchpage .ab-search input { width: 100%; }
.ab-key { color: var(--ab-hot); }

.ab-promise { margin-top: 36px; background: #fff; border-top: 1px solid #eee; }
.ab-promise__inner { display: flex; justify-content: space-between; gap: 12px; padding: 22px 0; }
.ab-promise span { color: #666; font-size: 15px; }
.ab-promise i { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: linear-gradient(90deg, var(--ab-blue-2), var(--ab-cyan)); }
.ab-footer { background: #1b1b1b; color: #bdbdbd; }
.ab-footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 24px; padding: 28px 0 18px; }
.ab-footer h3 { margin: 0 0 10px; color: #fff; font-size: 15px; font-weight: 600; }
.ab-footer ul { margin: 0; padding: 0; list-style: none; }
.ab-footer li { line-height: 28px; }
.ab-footer a { color: #cfcfcf; }
.ab-footer a:hover { color: #fff; }
.ab-footer__copy { border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 14px 0 18px; text-align: center; font-size: 13px; color: #9a9a9a; }
.ab-footer__copy a { margin-left: 8px; color: #bdbdbd; }

.ab-top {
  position: fixed;
  right: 18px;
  bottom: 24px;
  z-index: 50;
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 4px;
  background: var(--ab-blue);
  color: #fff;
  cursor: pointer;
}
.ab-top.is-on { display: block; }
.ab-tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  height: 54px;
  background: #fff;
  border-top: 1px solid #eee;
}
.ab-tabbar a { flex: 1; display: flex; align-items: center; justify-content: center; color: #666; font-size: 13px; }
.ab-tabbar a.is-on, .ab-tabbar a:hover { color: var(--ab-blue); }

@media (max-width: 1100px) {
  .ab-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ab-rankgrid { grid-template-columns: 1fr; }
  .ab-search input { width: 140px; }
}
@media (max-width: 768px) {
  .ab-wrap { width: calc(100% - 24px); }
  .page-home .ab-header { position: sticky; background: #3a63e8; }
  .ab-header__inner { height: 56px; }
  .ab-burger { display: block; }
  .ab-navwrap {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: auto;
    background: #fff;
    box-shadow: var(--ab-shadow);
  }
  .ab-navwrap.is-open { display: block; }
  .ab-nav { flex-direction: column; height: auto; max-height: 70vh; overflow: auto; background: #fff; }
  .ab-nav__link, .page-home .ab-nav__link { height: 44px; color: #222; }
  .ab-drop { display: flex; position: static; flex-wrap: wrap; gap: 2px 14px; max-width: none; width: auto; padding: 0 16px 8px; box-shadow: none; }
  .ab-user, .ab-header__tools { display: none; }
  .ab-hero { height: auto; padding-top: 168px; }
  .ab-slides { height: 168px; bottom: auto; }
  .ab-hero__search { position: relative; left: auto; top: auto; width: auto; margin: 12px 12px 14px; transform: none; }
  .ab-hot, .ab-hot a { color: #666; text-shadow: none; }
  .ab-hero__btn { display: none; }
  .ab-grid, .ab-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ab-sec__hd { flex-direction: column; align-items: flex-start; }
  .ab-sec__links { justify-content: flex-start; }
  .ab-topic { flex-basis: 200px; height: 120px; }
  .ab-article { padding: 18px 14px 28px; }
  .ab-promise__inner { flex-wrap: wrap; }
  body.ab-body .ab-tabbar { display: flex; }
  body.ab-body { padding-bottom: 62px; }
  .ab-top { bottom: 68px; }
}
@media (max-width: 480px) {
  .ab-grid { gap: 14px 10px; }
  .ab-footer__grid { grid-template-columns: 1fr; }
}
