/* ---------------- TutoLab 首页专属设计（仅 index.html 加载） ---------------- */
/* 依赖 style.css 的字体与色彩变量；本文件只作用于首页新区块 */
/* 首页由 build.py 依 tutorials/*/book.json + web-builder/site.json 生成 */

/* ---- Hero ---- */
.home-hero {
  max-width: 980px; margin: 0 auto; padding: 66px 24px 26px; text-align: center;
}
.home-hero .kicker {
  font-size: 12px; letter-spacing: .22em; color: var(--accent);
  font-weight: 700; margin-bottom: 16px;
}
.home-hero h1 {
  font-family: var(--serif); font-size: 46px; font-weight: 700;
  margin: 0 0 12px; color: var(--ink); letter-spacing: .01em;
}
.home-hero .tagline {
  font-family: var(--serif); font-size: 18px; color: var(--ink-soft); margin: 0 0 26px;
}
.home-stats { display: flex; justify-content: center; }
.home-stats .stat { padding: 0 26px; border-left: 1px solid var(--hairline); }
.home-stats .stat:first-child { border-left: none; }
.home-stats .n {
  font-family: var(--serif); font-size: 25px; font-weight: 700; color: var(--ink);
  display: block; line-height: 1.2;
}
.home-stats .l { font-size: 12px; color: #8a94a3; letter-spacing: .08em; }

/* ---- 主区 + 侧栏 ---- */
.home-layout {
  max-width: 1140px; margin: 0 auto; padding: 26px 24px 30px;
  display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 44px;
  align-items: start;
}
.sec-label {
  display: flex; align-items: center; gap: 14px;
  font-size: 12px; letter-spacing: .2em; color: #8a94a3; font-weight: 700;
  margin-bottom: 22px;
}
.sec-label::after { content: ""; flex: 1; height: 1px; background: var(--hairline-soft); }

/* ---- 书架：分类块 + 书卡网格 ---- */
.cat-head {
  padding: 0 2px 10px; border-bottom: 2px solid var(--ink);
  margin: 26px 0 16px;
}
.cat-head:first-of-type { margin-top: 0; }
.cat-head h2 {
  font-family: var(--serif); font-size: 19px; margin: 0; color: var(--ink); display: inline;
}
.cat-head .cat-en {
  display: inline; font-size: 11px; color: #8a94a3; letter-spacing: .08em; margin-left: 10px;
}
.cat-head .cat-count {
  float: right; font-family: var(--sans); font-size: 12px; color: #8a94a3; margin-top: 5px;
}

.book-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px;
}
.bcard {
  --bc: var(--accent);
  display: flex; flex-direction: column; gap: 7px;
  padding: 16px 18px 13px;
  background: var(--paper-warm);
  border: 1px solid var(--hairline-soft);
  border-top: 3px solid var(--bc);
  text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.bcard:hover {
  box-shadow: 0 3px 16px rgba(29, 35, 43, .09);
  transform: translateY(-2px);
  text-decoration: none;
}
.bcard:hover .bcard-go { color: var(--bc); }
.bcard-top { display: flex; justify-content: space-between; align-items: center; }
.bcard-cat {
  font-family: var(--sans); font-size: 11px; letter-spacing: .1em;
  color: var(--bc); font-weight: 700;
}
.bcard-badge {
  font-family: var(--sans); font-size: 11px; color: #8a94a3;
  border: 1px solid var(--hairline); padding: 1px 8px; border-radius: 2px;
}
.bcard-title {
  font-family: var(--serif); font-size: 19px; font-weight: 700;
  color: var(--ink); margin: 2px 0 0; line-height: 1.35;
}
.bcard-en { font-size: 11.5px; color: #8a94a3; letter-spacing: .04em; }
.bcard-desc { font-size: 13px; line-height: 1.75; color: var(--ink-soft); margin: 2px 0 0; }
.bcard-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.bcard-tags span {
  font-family: var(--sans); font-size: 11px; color: #6b7480;
  background: #fff; border: 1px solid var(--hairline-soft);
  padding: 1px 8px; border-radius: 10px;
}
.bcard-stats {
  font-family: var(--sans); font-size: 12px; color: #6b7480;
  border-top: 1px dashed var(--hairline-soft); padding-top: 9px; margin-top: 4px;
}
.bcard-foot { display: flex; justify-content: space-between; align-items: baseline; }
.bcard-go {
  font-family: var(--sans); font-size: 12.5px; color: var(--ink-soft); font-weight: 600;
}
.bcard-date { font-family: var(--sans); font-size: 11px; color: #a7aeb8; }

.home-footnote { color: #8a94a3; font-size: 12.5px; text-align: center; margin: 26px 0 6px; }

/* ---- 侧栏组件 ---- */
.widget {
  border: 1px solid var(--hairline-soft); background: var(--paper-warm);
  padding: 15px 17px 13px; margin-bottom: 16px;
}
.widget-title {
  font-family: var(--sans); font-size: 11.5px; letter-spacing: .18em;
  color: #8a94a3; font-weight: 700; margin-bottom: 11px;
}
/* 最近更新 */
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 5px 0; border-bottom: 1px dashed var(--hairline-soft);
  font-size: 13px;
}
.recent-list li:last-child { border-bottom: none; }
.recent-list a { color: var(--ink); text-decoration: none; }
.recent-list a:hover { color: var(--accent); }
.recent-list .rd { font-family: var(--sans); font-size: 11px; color: #a7aeb8; white-space: nowrap; }
/* 分类 */
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 5px 0; border-bottom: 1px dashed var(--hairline-soft); font-size: 13px;
}
.cat-list li:last-child { border-bottom: none; }
.cat-list .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 8px; vertical-align: 1px;
}
.cat-list a { color: var(--ink); text-decoration: none; }
.cat-list a:hover { color: var(--accent); }
.cat-list .cn { font-family: var(--sans); font-size: 11.5px; color: #a7aeb8; }
/* 关于 */
.widget p { font-size: 12.8px; line-height: 1.8; color: var(--ink-soft); margin: 0 0 8px; }
.widget-rss {
  display: inline-block; font-family: var(--sans); font-size: 12.5px;
  color: var(--accent); text-decoration: none; margin-top: 2px;
}
.widget-rss:hover { text-decoration: underline; }

/* ---- 响应式 ---- */
@media (max-width: 1020px) {
  .home-layout { grid-template-columns: 1fr; }
  .home-aside { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
  .home-aside .widget { margin-bottom: 0; }
}
@media (max-width: 640px) {
  .home-hero { padding-top: 46px; }
  .home-hero h1 { font-size: 36px; }
  .home-stats .stat { padding: 0 16px; }
  .book-grid { grid-template-columns: 1fr; }
}
