/* ==========================================================================
   base
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #2c3e50;
  background-color: #f5f5f0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.5em;
  line-height: 1.3;
  color: #2c3e50;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

a {
  color: #3498db;
  text-decoration: none;
}

a:hover {
  color: #1f6f9f;
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

figure {
  margin: 0;
}

details summary {
  cursor: pointer;
}

button {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid #3498db;
  outline-offset: 2px;
}

/* ==========================================================================
   layout
   ========================================================================== */

.site-header {
  background-color: #fff;
  border-bottom: 1px solid #e0e0da;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 20px;
}

.brand-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2c3e50;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo:hover {
  color: #e67e22;
  text-decoration: none;
}

.brand-logo span::before {
  content: "📖 ";
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-list a {
  display: block;
  padding: 8px 14px;
  border-radius: 6px;
  color: #2c3e50;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-list a:hover {
  background-color: #ecf0f1;
  color: #1f6f9f;
  text-decoration: none;
}

.nav-list a.is-current {
  background-color: #e8f0f8;
  color: #1f6f9f;
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.nav-toggle:hover {
  background-color: #ecf0f1;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  background-color: #2c3e50;
  border-radius: 2px;
  position: relative;
  transition: transform 0.2s ease;
}

.nav-toggle-icon::before {
  position: absolute;
  top: -7px;
}

.nav-toggle-icon::after {
  position: absolute;
  top: 7px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background-color: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  transform: rotate(45deg);
  top: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  transform: rotate(-45deg);
  top: 0;
}

.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-footer {
  background-color: #2c3e50;
  color: #ecf0f1;
  margin-top: 60px;
}

.footer-columns {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.footer-col h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col a {
  color: #b0bec5;
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid #3d5165;
  padding: 16px 20px;
  text-align: center;
  font-size: 0.85rem;
  color: #90a4ae;
}

/* ==========================================================================
   components
   ========================================================================== */

.section-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
  border-bottom: 2px solid #ecf0f1;
}

.section-title::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background-color: #e67e22;
  position: absolute;
  bottom: -2px;
  left: 0;
}

.section-intro,
.section-note {
  color: #5d6d7e;
  font-size: 0.95rem;
  margin-bottom: 24px;
}

/* 面包屑 */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.9rem;
  color: #7f8c8d;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.breadcrumb a {
  color: #3498db;
}

.breadcrumb a:hover {
  color: #1f6f9f;
}

.breadcrumb-sep {
  color: #bdc3c7;
  margin: 0 2px;
}

.breadcrumb-current {
  color: #5d6d7e;
}

/* 页面标题区 */
.page-header {
  background-color: #fff;
  border-radius: 8px;
  padding: 32px 28px;
  margin-bottom: 32px;
  border-left: 4px solid #e67e22;
  box-shadow: 0 1px 3px rgba(44, 62, 80, 0.08);
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 8px;
}

.page-description {
  font-size: 1rem;
  color: #5d6d7e;
  margin-bottom: 0;
  max-width: 720px;
}

/* 卡片通用 */
.work-card,
.guide-card,
.topic-card,
.tip-card,
.faq-item,
.recommend-item,
.update-item,
.popular-item {
  background-color: #fff;
  border-radius: 8px;
  border: 1px solid #e8e8e2;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.work-card:hover,
.guide-card:hover,
.topic-card:hover,
.tip-card:hover,
.recommend-item:hover,
.update-item:hover,
.popular-item:hover {
  box-shadow: 0 4px 12px rgba(44, 62, 80, 0.1);
  transform: translateY(-2px);
}

/* 图片容器 */
.hero-media figure,
.step-figure,
.cover-wrap,
.recommend-cover {
  border-radius: 8px;
  overflow: hidden;
  background-color: #ecf0f1;
}

.hero-media img,
.step-figure img,
.cover-wrap img,
.recommend-cover img,
.work-card img,
.update-item img,
.popular-item img,
.topic-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* FAQ details/summary */
.faq-item {
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  color: #2c3e50;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e8e8e2;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  color: #e67e22;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: 12px;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  padding: 16px 20px;
  margin: 0;
  font-size: 0.95rem;
  color: #5d6d7e;
}

/* ==========================================================================
   pages
   ========================================================================== */

/* ---------- 首页 hero ---------- */

.hero-section {
  padding: 48px 0 40px;
}

.hero-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 12px;
  line-height: 1.25;
}

.hero-lead {
  font-size: 1.05rem;
  color: #5d6d7e;
  margin-bottom: 28px;
  max-width: 520px;
}

.hero-questions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-questions li a {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #fff;
  border: 1px solid #e8e8e2;
  border-left: 4px solid #e67e22;
  border-radius: 8px;
  padding: 14px 18px;
  color: #2c3e50;
  font-weight: 500;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.hero-questions li a:hover {
  background-color: #f8f9fa;
  border-left-color: #3498db;
  text-decoration: none;
}

.hero-questions li a::after {
  content: "→";
  margin-left: auto;
  color: #3498db;
  font-weight: 700;
}

.hero-media figure {
  aspect-ratio: 4 / 3;
}

/* ---------- 首页分类导航带 ---------- */

.category-nav {
  padding: 32px 0;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tag-link {
  display: inline-block;
  background-color: #ecf0f1;
  color: #2c3e50;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tag-link:hover {
  background-color: #3498db;
  color: #fff;
  text-decoration: none;
}

/* ---------- 首页最近更新 ---------- */

.recent-updates {
  padding: 32px 0;
}

.update-group {
  margin-bottom: 28px;
}

.update-date {
  font-size: 1rem;
  color: #7f8c8d;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #d5dbdb;
}

.update-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.update-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  align-items: center;
}

.update-item img {
  width: 72px;
  height: 96px;
  border-radius: 6px;
  flex-shrink: 0;
}

.update-info {
  min-width: 0;
}

.update-info a {
  font-weight: 600;
  color: #2c3e50;
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.update-info a:hover {
  color: #3498db;
}

.update-time {
  font-size: 0.8rem;
  color: #95a5a6;
}

/* ---------- 首页人气榜单 ---------- */

.popular-list {
  padding: 32px 0;
}

.popular-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popular-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
}

.rank {
  font-size: 1.375rem;
  font-weight: 700;
  color: #e67e22;
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.popular-item:nth-child(n+4) .rank {
  color: #95a5a6;
}

.popular-item img {
  width: 56px;
  height: 72px;
  border-radius: 6px;
  flex-shrink: 0;
}

.popular-info {
  min-width: 0;
  flex: 1;
}

.popular-info a {
  font-weight: 600;
  color: #2c3e50;
  display: block;
  margin-bottom: 2px;
}

.popular-info a:hover {
  color: #3498db;
}

.reason {
  font-size: 0.85rem;
  color: #7f8c8d;
  margin: 0;
  line-height: 1.5;
}

/* ---------- 首页阅读指南入口 ---------- */

.guide-entry {
  padding: 32px 0;
}

.guide-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.guide-card {
  padding: 28px;
  border-top: 4px solid #3498db;
}

.guide-card:nth-child(2) {
  border-top-color: #e67e22;
}

.guide-card h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.guide-card p {
  font-size: 0.9rem;
  color: #5d6d7e;
  margin-bottom: 16px;
}

.guide-card a {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.guide-card a::after {
  content: "→";
}

/* ---------- 首页长尾专题卡 ---------- */

.longtail-cards {
  padding: 32px 0;
}

.topic-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.topic-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topic-card img {
  aspect-ratio: 16 / 9;
}

.topic-card h3 {
  padding: 16px 20px 4px;
  font-size: 1.125rem;
}

.topic-card p {
  padding: 0 20px;
  font-size: 0.9rem;
  color: #5d6d7e;
  margin-bottom: 12px;
  flex: 1;
}

.topic-card a {
  margin: 0 20px 20px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topic-card a::after {
  content: "→";
}

/* ---------- 分类页 ---------- */

.category-index {
  background-color: #fff;
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 40px;
  border: 1px solid #e8e8e2;
}

.category-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.category-tag-list a {
  display: block;
  background-color: #ecf0f1;
  color: #2c3e50;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.category-tag-list a:hover {
  background-color: #3498db;
  color: #fff;
  text-decoration: none;
}

.category-block {
  margin-bottom: 48px;
  background-color: #fff;
  border-radius: 8px;
  padding: 28px;
  border: 1px solid #e8e8e2;
}

.category-block-head {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #ecf0f1;
}

.category-title {
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.category-desc {
  color: #5d6d7e;
  font-size: 0.9rem;
  margin-bottom: 0;
}

.category-work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.work-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.work-card img {
  aspect-ratio: 3 / 4;
}

.work-title {
  padding: 14px 16px 4px;
  font-size: 1rem;
}

.work-tags {
  padding: 0 16px 16px;
  font-size: 0.8rem;
  color: #7f8c8d;
  margin: 0;
}

.category-more {
  margin: 20px 0 0;
  text-align: right;
}

.category-more a {
  font-size: 0.9rem;
  font-weight: 600;
}

.category-note {
  background-color: #fff;
  border-radius: 8px;
  padding: 28px;
  border: 1px solid #e8e8e2;
}

.category-note p {
  color: #5d6d7e;
  font-size: 0.95rem;
}

/* ---------- 指南页 ---------- */

.guide-steps {
  background-color: #fff;
  border-radius: 8px;
  padding: 32px;
  border: 1px solid #e8e8e2;
  margin-bottom: 40px;
}

.step-item {
  display: flex;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid #ecf0f1;
}

.step-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.step-number {
  background-color: #e67e22;
  color: #fff;
  font-size: 1.125rem;
  font-weight: 700;
  min-width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-content h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.step-content p {
  color: #5d6d7e;
  font-size: 0.95rem;
}

.step-figure {
  margin-top: 16px;
  max-width: 480px;
}

.step-figure img {
  aspect-ratio: 16 / 9;
}

.step-figure figcaption {
  padding: 8px 12px;
  font-size: 0.8rem;
  color: #7f8c8d;
  background-color: #f8f9fa;
}

.guide-tips {
  background-color: #fff;
  border-radius: 8px;
  padding: 32px;
  border: 1px solid #e8e8e2;
  margin-bottom: 40px;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.tip-card {
  padding: 20px;
  border-left: 3px solid #3498db;
}

.tip-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.tip-card p {
  font-size: 0.9rem;
  color: #5d6d7e;
  margin: 0;
}

.guide-faq {
  background-color: #fff;
  border-radius: 8px;
  padding: 32px;
  border: 1px solid #e8e8e2;
}

/* ---------- 长尾推荐页（职场/生活） ---------- */

.recommend-list {
  background-color: #fff;
  border-radius: 8px;
  padding: 32px;
  border: 1px solid #e8e8e2;
  margin-bottom: 40px;
}

.recommend-list > h2 {
  font-size: 1.375rem;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid #ecf0f1;
}

.recommend-item {
  display: flex;
  gap: 24px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid #e8e8e2;
}

.recommend-item:last-child {
  margin-bottom: 0;
}

.cover-wrap,
.recommend-cover {
  flex-shrink: 0;
  width: 120px;
  height: 160px;
}

.item-info,
.recommend-info {
  flex: 1;
  min-width: 0;
}

.item-info h3,
.recommend-info h3 {
  font-size: 1.125rem;
  margin-bottom: 6px;
}

.tags,
.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tag,
.item-tags span {
  display: inline-block;
  background-color: #ecf0f1;
  color: #5d6d7e;
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 4px;
  font-weight: 500;
}

.item-info > p,
.recommend-info > p {
  font-size: 0.9rem;
  color: #5d6d7e;
  margin-bottom: 8px;
}

.reason {
  font-size: 0.85rem;
  color: #7f8c8d;
  margin: 0;
}

.reason strong {
  color: #e67e22;
  font-weight: 600;
}

.topic-insight {
  background-color: #fff;
  border-radius: 8px;
  padding: 32px;
  border: 1px solid #e8e8e2;
}

.topic-insight h2 {
  font-size: 1.375rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #ecf0f1;
}

.topic-insight p {
  color: #5d6d7e;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

/* ---------- 404页 ---------- */

.error-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 60px 20px;
}

.error-panel {
  background-color: #fff;
  border-radius: 8px;
  padding: 48px;
  text-align: center;
  max-width: 560px;
  border: 1px solid #e8e8e2;
}

.error-code {
  font-size: 4rem;
  font-weight: 700;
  color: #e67e22;
  margin-bottom: 8px;
  line-height: 1;
}

.error-panel h1 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.error-desc {
  color: #5d6d7e;
  margin-bottom: 24px;
}

.error-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.error-link {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  background-color: #3498db;
  color: #fff;
  transition: background-color 0.2s ease;
}

.error-link:hover {
  background-color: #1f6f9f;
  color: #fff;
  text-decoration: none;
}

.error-link:last-child {
  background-color: #ecf0f1;
  color: #2c3e50;
}

.error-link:last-child:hover {
  background-color: #d5dbdb;
  color: #2c3e50;
}

/* ==========================================================================
   responsive
   ========================================================================== */

@media (max-width: 992px) {
  .category-work-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-media {
    max-width: 640px;
  }

  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .header-inner {
    min-height: 56px;
    padding: 0 16px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-list {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background-color: #fff;
    border-bottom: 1px solid #e0e0da;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.1);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
    gap: 4px;
    z-index: 99;
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-list a {
    padding: 12px 14px;
    font-size: 1rem;
  }

  .site-main {
    padding: 0 16px;
  }

  .hero-section {
    padding: 32px 0 24px;
  }

  .hero-title {
    font-size: 1.625rem;
  }

  .update-list {
    grid-template-columns: 1fr;
  }

  .guide-cards,
  .topic-cards,
  .tips-grid {
    grid-template-columns: 1fr;
  }

  .footer-columns {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 16px 16px;
  }

  .footer-bottom {
    padding: 16px;
  }

  .page-header {
    padding: 24px 20px;
    margin-bottom: 24px;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .category-index,
  .category-block,
  .category-note,
  .guide-steps,
  .guide-tips,
  .guide-faq,
  .recommend-list,
  .topic-insight {
    padding: 20px;
  }

  .category-work-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .step-item {
    flex-direction: column;
    gap: 12px;
  }

  .step-number {
    min-width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .recommend-item {
    flex-direction: column;
    gap: 16px;
  }

  .cover-wrap,
  .recommend-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    max-width: 180px;
  }

  .error-panel {
    padding: 32px 20px;
  }

  .error-code {
    font-size: 3rem;
  }
}

@media (max-width: 480px) {
  .hero-questions li a {
    padding: 12px 14px;
    font-size: 0.9rem;
  }

  .category-tags {
    gap: 8px;
  }

  .tag-link {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .update-item {
    flex-direction: row;
    padding: 12px;
  }

  .update-item img {
    width: 60px;
    height: 80px;
  }

  .popular-item {
    padding: 10px 12px;
    gap: 12px;
  }

  .popular-item img {
    width: 48px;
    height: 64px;
  }

  .rank {
    font-size: 1.125rem;
    min-width: 24px;
  }

  .guide-card {
    padding: 20px;
  }

  .topic-card img {
    aspect-ratio: 16 / 10;
  }

  .category-tag-list {
    gap: 8px;
  }

  .category-tag-list a {
    padding: 6px 14px;
    font-size: 0.85rem;
  }

  .step-figure {
    max-width: 100%;
  }

  .recommend-item {
    padding: 16px;
  }

  .error-actions {
    flex-direction: column;
  }

  .error-link {
    text-align: center;
  }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
