:root {
  --bg: #f3f3f3;
  --panel: #ffffff;
  --line: #e5e5e5;
  --text: #222222;
  --muted: #767676;
  --accent: #d81e06;
  --accent-soft: #fff3ef;
  --shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

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

.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.topbar,
.navbar,
.site-footer-inner,
.footer-bottom,
.portal,
.article-page,
.auth-page,
.pay-page,
.member-page {
  width: min(1280px, calc(100% - 24px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 34px;
  color: var(--muted);
  font-size: 13px;
}

.topbar a,
.topbar button {
  margin-left: 12px;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
}

.top-link-btn {
  padding: 0;
}

.login-chip {
  padding: 2px 8px;
  color: #fff;
  background: #444;
  border-radius: 999px;
}

.navbar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 66px;
}

.brand {
  min-width: 310px;
  font-size: 20px;
  font-weight: 700;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.main-nav a {
  padding: 7px 12px;
  color: #555;
  border-radius: 4px;
  font-size: 14px;
}

.main-nav a.active,
.main-nav a:hover {
  color: #fff;
  background: var(--accent);
}

.portal,
.article-page,
.auth-page,
.pay-page,
.member-page {
  padding: 16px 0 26px;
}

.quick-line,
.hero-layout,
.library-layout,
.library-head,
.search-bar,
.quick-links,
.section-title,
.spotlight-main,
.switch-row,
.detail-layout,
.detail-hero,
.detail-actions,
.library-summary {
  display: flex;
}

.quick-line {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.search-bar {
  flex: 1;
  max-width: 560px;
}

.search-bar.narrow {
  max-width: 360px;
}

.search-bar input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-right: 0;
  outline: 0;
  background: #fff;
}

.search-bar button,
.action-btn,
.form-btn,
.plan-btn,
.expand-btn,
.chapter-btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.search-bar button {
  width: 92px;
}

.quick-links {
  gap: 12px;
  align-items: center;
}

.quick-links a {
  color: #666;
  font-size: 14px;
}

.category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.category-row a {
  color: #444;
  font-size: 14px;
}

.hero-layout {
  gap: 16px;
  align-items: stretch;
}

.hero-main,
.rank-box,
.content-box,
.side-box,
.form-box,
.article-box,
.detail-hero,
.detail-main > .content-box {
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

.hero-main,
.content-box,
.article-box,
.form-box,
.detail-hero,
.detail-main > .content-box {
  padding: 16px;
}

.hero-main {
  flex: 1;
}

.rank-box {
  width: 360px;
  padding: 16px;
}

.section-title {
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.section-title span {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}

.section-title h1,
.section-title h2 {
  margin: 0;
  line-height: 1.2;
}

.section-title h1 {
  font-size: clamp(30px, 4vw, 42px);
}

.section-title h2 {
  font-size: 30px;
}

.section-title p {
  margin: 0;
  color: #666;
  line-height: 1.75;
}

.site-intro h1 {
  font-size: clamp(24px, 3vw, 34px);
}

.site-intro {
  margin-bottom: 10px;
}

.hero-cover-grid,
.dense-grid,
.mini-dense-grid,
.audit-grid,
.company-grid,
.category-panels,
.update-stream,
.text-columns,
.detail-chapters {
  display: grid;
  gap: 14px;
}

.hero-cover-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hero-cover-grid.tight {
  gap: 12px;
}

.dense-grid.eight {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.dense-grid.seven {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.dense-grid.six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dense-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini-dense-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.top-card img,
.dense-card .cover-link img,
.spotlight-main img,
.detail-cover {
  width: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.top-card img,
.dense-card .cover-link img {
  aspect-ratio: 3 / 4.25;
}

.top-card h3,
.dense-meta h3 {
  margin: 8px 0 4px;
  font-size: 14px;
  line-height: 1.45;
}

.top-card p,
.dense-meta p,
.dense-meta span,
.author-line,
.spot-tags {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.dense-card {
  overflow: hidden;
  border: 1px solid #efefef;
  border-radius: 4px;
  background: #fff;
}

.dense-meta {
  padding: 10px;
}

.compact-cards .dense-meta {
  padding: 8px 9px;
}

.compact-cards .dense-meta h3 {
  min-height: 38px;
  font-size: 13px;
}

.expand-btn {
  width: 100%;
  height: 32px;
  margin-top: 8px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
}

.expand-panel {
  padding: 0 10px 10px;
  border-top: 1px solid #f2f2f2;
}

.expand-panel p {
  color: #666;
  font-size: 13px;
  line-height: 1.7;
}

.chapter-grid,
.detail-chapters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chapter-btn {
  min-height: 32px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
}

.content-box {
  margin-top: 16px;
}

.content-box.inner-box {
  margin-top: 16px;
}

.text-flow-box {
  padding-bottom: 12px;
}

.update-stream {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.update-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #f0f0f0;
  border-radius: 4px;
  background: #fafafa;
}

.update-item strong {
  font-size: 14px;
}

.update-item:hover,
.category-link:hover,
.text-row-link:hover,
.top-card:hover {
  color: var(--accent);
}

.update-item span,
.update-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.content-box.dual {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 360px;
  gap: 16px;
}

.spotlight-box .section-title,
.text-columns-box .section-title {
  margin-bottom: 12px;
}

.spotlight-main {
  gap: 16px;
  margin-bottom: 14px;
}

.spotlight-main img {
  width: 220px;
  aspect-ratio: 3 / 4;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  margin-top: 12px;
  border-radius: 4px;
}

.rank-box h2,
.side-box h2,
.article-box h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.rank-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed #ececec;
}

.rank-list li:last-child {
  border-bottom: 0;
}

.rank-no {
  color: var(--accent);
  font-weight: 700;
  text-align: center;
}

.rank-text strong {
  display: block;
  font-size: 14px;
}

.rank-text small,
.rank-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.category-panels {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.category-panel {
  border: 1px solid #efefef;
  border-radius: 4px;
  overflow: hidden;
}

.category-panel header,
.text-column header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #fafafa;
  border-bottom: 1px solid #efefef;
}

.category-panel h3,
.text-column h3 {
  margin: 0;
  font-size: 16px;
}

.category-panel header a {
  color: var(--accent);
  font-size: 12px;
}

.category-list,
.text-column-list {
  padding: 8px 12px;
}

.category-link,
.text-row-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #eee;
}

.category-link:last-child,
.text-row-link:last-child {
  border-bottom: 0;
}

.category-link span,
.text-row-link span {
  font-size: 14px;
}

.category-link em,
.text-row-link em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.text-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.library-head {
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.library-layout {
  gap: 16px;
  align-items: start;
}

.library-side,
.detail-side {
  width: 280px;
}

.side-box {
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list button {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: #555;
  cursor: pointer;
}

.library-main,
.detail-main {
  flex: 1;
  min-width: 0;
}

.switch-row {
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.switch-tabs {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.switch-tabs a {
  padding: 8px 14px;
  color: #666;
  background: #fff;
}

.switch-tabs a.active {
  color: #fff;
  background: var(--accent);
}

.library-summary {
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid #efefef;
  background: #fafafa;
  color: var(--muted);
  font-size: 13px;
}

.text-columns-box {
  padding-top: 14px;
}

.detail-layout {
  gap: 16px;
  align-items: start;
}

.detail-hero {
  gap: 20px;
}

.detail-cover,
.detail-cover-link {
  width: 260px;
  flex: none;
}

.detail-cover {
  aspect-ratio: 3 / 4.2;
}

.detail-meta {
  flex: 1;
  min-width: 0;
}

.detail-type {
  display: inline-flex;
  padding: 4px 10px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.detail-meta h1 {
  margin: 12px 0 10px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
}

.detail-meta h1 + .detail-author {
  margin-bottom: 10px;
}

.detail-author,
.detail-desc {
  color: #666;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.detail-tags span {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fafafa;
  font-size: 12px;
}

.detail-actions {
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.detail-info-list p {
  margin: 0 0 10px;
  color: #666;
}

.auth-page,
.pay-page,
.member-page {
  width: min(980px, calc(100% - 24px));
}

.form-box p,
.member-box p {
  color: #666;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: #666;
}

.form-grid input {
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d8d8d8;
  background: #fff;
}

.form-btn,
.plan-btn {
  height: 40px;
  border-radius: 4px;
}

.member-grid,
.plan-grid,
.audit-grid,
.company-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.member-grid,
.plan-grid {
  display: grid;
  gap: 14px;
}

.member-grid > div,
.plan,
.audit-grid > div,
.company-grid p {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fafafa;
}

.plan strong {
  display: block;
  margin: 10px 0;
  color: var(--accent);
  font-size: 30px;
}

.pay-result {
  color: #22864a;
  font-weight: 700;
}

.audit-table {
  width: 100%;
  border-collapse: collapse;
}

.audit-table th,
.audit-table td {
  padding: 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.audit-table th {
  color: #fff;
  background: var(--accent);
}

.article-list {
  margin: 0;
  padding-left: 22px;
  color: #666;
  line-height: 1.9;
}

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

.site-footer {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.site-footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 18px;
  padding: 20px 0;
}

.site-footer-inner h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.site-footer-inner p,
.site-footer-inner li,
.site-footer-inner a {
  color: #666;
  font-size: 14px;
  line-height: 1.7;
}

.site-footer-inner ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-bottom {
  padding: 12px 0 20px;
  color: #666;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 1200px) {
  .dense-grid.eight {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .dense-grid.seven,
  .dense-grid.six {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .mini-dense-grid,
  .category-panels,
  .text-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .update-stream {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .topbar,
  .navbar,
  .quick-line,
  .hero-layout,
  .library-head,
  .library-layout,
  .content-box.dual,
  .site-footer-inner,
  .library-summary,
  .detail-layout,
  .detail-hero {
    display: flex;
    flex-direction: column;
  }

  .rank-box,
  .library-side,
  .detail-side,
  .search-bar.narrow {
    width: 100%;
  }

  .hero-cover-grid,
  .dense-grid.eight,
  .dense-grid.seven,
  .dense-grid.six,
  .dense-grid.four,
  .member-grid,
  .plan-grid,
  .audit-grid,
  .company-grid,
  .category-panels,
  .update-stream,
  .text-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spotlight-main {
    flex-direction: column;
  }

  .spotlight-main img,
  .detail-cover,
  .detail-cover-link {
    width: 100%;
    max-width: 280px;
  }
}

@media (max-width: 640px) {
  .hero-cover-grid,
  .dense-grid.eight,
  .dense-grid.seven,
  .dense-grid.six,
  .dense-grid.four,
  .chapter-grid,
  .member-grid,
  .plan-grid,
  .audit-grid,
  .company-grid,
  .mini-dense-grid,
  .category-panels,
  .update-stream,
  .text-columns,
  .detail-chapters {
    grid-template-columns: 1fr;
  }

  .search-bar {
    max-width: none;
  }
}
