/* ==========================================================================
   小芽奇境 · 学习指南（复刻站）
   只用一层：/css/guides.css —— 索引页 + 文章页共用
   色板：奶油纸 / 暖金 / 深林绿
   ========================================================================== */

:root {
  --ground: #f4f1e4;
  --paper: #fdfaf1;
  --paper-top: #fffdf6;
  --line: #e7e0cb;
  --line-soft: #efe9d8;

  --ink: #2f2a24;
  --ink-strong: #24201b;
  --muted: #7c7466;

  --green: #1f4b3a;
  --green-deep: #16382c;
  --green-soft: #e8efd9;
  --green-tab: #eef0df;

  --gold: #c79a3e;
  --gold-soft: #e9d3a0;
  --amber: #8a5a24;

  --radius: 16px;
  --radius-sm: 10px;

  --shadow-card: 0 4px 14px rgba(73, 60, 27, 0.05), 0 1px 2px rgba(73, 60, 27, 0.04);
  --shadow-lift: 0 16px 30px rgba(73, 60, 27, 0.12), 0 2px 6px rgba(73, 60, 27, 0.06);

  --font: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --shell: min(calc(100% - 48px), 72rem);
  --column: min(calc(100% - 48px), 820px);
}

/* ------------------------------------------------------------------ 基础 */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.guides-site {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

h1, h2, h3 { margin: 0; line-height: 1.3; font-weight: 700; }

:where(a, button):focus-visible {
  outline: 3px solid var(--gold-soft);
  outline-offset: 3px;
  border-radius: 8px;
}

.guides-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ 顶栏 */

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

.guides-header-inner {
  width: var(--shell);
  margin-inline: auto;
  min-height: 72px;
  padding-block: 5px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.guides-brand {
  flex: 0 0 auto;
  display: block;
  border-radius: 12px;
  line-height: 0;
}

.guides-brand img {
  width: 78px;
  height: 62px;
  object-fit: contain;
}

/* 分段胶囊导航 */
.guides-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  background: var(--green-tab);
  border-radius: 12px;
}

.guides-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}

.guides-tabs a:hover { background: #e3e8d1; }

.guides-tabs a.guides-tab--on,
.guides-tabs a.guides-tab--on:hover {
  background: var(--green);
  color: #fffdf6;
}

/* 右侧导航 */
.guides-nav {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.guides-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  transition: background 0.16s ease;
}

.guides-nav a:hover { background: #f2eee0; }

.guides-nav a.guides-nav--on {
  background: var(--green-soft);
  color: var(--green-deep);
}

/* ------------------------------------------------------------- 页面容器 */

.guides-main {
  padding: 26px 0 72px;
}

.guides-shell {
  width: var(--shell);
  margin-inline: auto;
}

/* --------------------------------------------------------------- 栏目标题 */

.guides-shelf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.guides-shelf-header h2 {
  position: relative;
  padding-left: 13px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink-strong);
}

.guides-shelf-header h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 21px;
  margin-top: -10px;
  border-radius: 2px;
  background: var(--gold);
}

.guides-shelf-more {
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.16s ease;
}

.guides-shelf-more:hover { color: var(--green); }

/* ----------------------------------------------------------------- 卡片 */

.guides-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.guides-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.guides-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: #ded5b9;
}

.guides-card[hidden] { display: none; }

.guides-card-link {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
}

.guides-card-art {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f1ead5;
  overflow: hidden;
}

.guides-card-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.guides-card-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 14px 16px 16px;
  min-width: 0;
}

.guides-card-tag {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
}

.guides-card-tag--english { background: #e7efdc; color: #3d6b46; }
.guides-card-tag--math { background: #f8eed1; color: #8a6520; }
.guides-card-tag--chinese { background: #fbe5df; color: #b2574a; }

.guides-card-title {
  font-size: 17.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink-strong);
}

.guides-card-excerpt {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.guides-card-action {
  margin-top: auto;
  padding-top: 2px;
  font-size: 13.5px;
  font-weight: 700;
}

.guides-card-action--english { color: #3d6b46; }
.guides-card-action--math { color: #8a6520; }
.guides-card-action--chinese { color: #b2574a; }

.guides-empty {
  margin: 8px 0 0;
  padding: 26px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: #fbf8ee;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

/* --------------------------------------------------------- 文章页外壳 */

.guides-main--article { padding-top: 28px; }

.guides-column {
  width: var(--column);
  margin-inline: auto;
}

.guides-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--muted);
}

.guides-breadcrumb a {
  color: var(--muted);
  transition: color 0.16s ease;
}

.guides-breadcrumb a:hover { color: var(--green); }

.guides-breadcrumb-sep { color: #b8ae98; }

.guides-sheet {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 26px rgba(51, 61, 25, 0.06);
  padding: 38px 40px 44px;
}

/* 文章抬头 */
.guides-post-topic {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  font-size: 12.5px;
  font-weight: 700;
}

.guides-post-kind {
  padding: 1px 9px;
  border-radius: 999px;
  background: #f4e8c4;
  color: var(--amber);
}

.guides-post-subject {
  padding: 1px 9px;
  border-radius: 999px;
}

.guides-post-subject--english { background: #e7efdc; color: #3d6b46; }
.guides-post-subject--math { background: #f8eed1; color: #8a6520; }
.guides-post-subject--chinese { background: #fbe5df; color: #b2574a; }

.guides-post-header h1 {
  margin: 6px 0 0;
  font-size: clamp(26px, 3.6vw, 34px);
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: 0.005em;
  color: var(--ink-strong);
}

.guides-byline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--muted);
}

.guides-byline-dot { color: #c3b9a2; }

.guides-intro {
  margin: 16px 0 0;
  font-size: 18.5px;
  font-weight: 600;
  line-height: 1.85;
  color: #453f34;
}

.guides-post-cover {
  width: 100%;
  height: auto;
  margin: 26px 0 8px;
  border-radius: 12px;
  background: #f1ead5;
}

/* 正文 */
.guides-reading {
  font-size: 17px;
  line-height: 1.9;
  color: #34302a;
  word-break: break-word;
}

.guides-reading > p {
  margin: 1.15em 0;
}

.guides-reading > h2 {
  position: relative;
  margin: 1.85em 0 0.6em;
  padding-left: 13px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink-strong);
}

.guides-reading > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 3px;
  height: 0.95em;
  border-radius: 2px;
  background: var(--gold);
}

.guides-reading h3 {
  margin: 1.5em 0 0.45em;
  font-size: 18px;
  font-weight: 700;
  color: #2b382f;
}

.guides-reading strong { font-weight: 700; color: #26221d; }

.guides-reading mark {
  padding: 0 3px;
  border-radius: 4px;
  background: #fbefc9;
  color: #4a4029;
}

.guides-reading ul,
.guides-reading ol {
  margin: 1.05em 0;
  padding-left: 1.5em;
}

.guides-reading li {
  margin: 0.35em 0;
  padding-left: 0.25em;
}

.guides-reading ol li::marker {
  color: #967f4d;
  font-weight: 700;
}

.guides-reading ul li::marker { color: #b3a37c; }

.guides-reading blockquote {
  margin: 1.4em 0;
  padding: 16px 20px;
  background: #f7f2e1;
  border-left: 3px solid #d9bc79;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #4b4537;
  font-size: 16.5px;
  line-height: 1.85;
}

.guides-reading blockquote p { margin: 0.5em 0; }
.guides-reading blockquote p:first-child { margin-top: 0; }
.guides-reading blockquote p:last-child { margin-bottom: 0; }

.guides-reading figure {
  margin: 1.7em 0;
}

.guides-reading figure img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #f1ead5;
}

.guides-reading figcaption {
  margin-top: 9px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
  text-align: center;
}

/* 继续学习 */
.guides-related {
  margin-top: 22px;
  padding: 22px 24px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.guides-related h2 {
  display: flex;
  align-items: center;
  margin: 0 0 10px;
  padding-left: 13px;
  position: relative;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-strong);
}

.guides-related h2::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--gold);
}

.guides-related ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guides-related li + li { border-top: 1px solid var(--line-soft); }

.guides-related a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 2px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  transition: color 0.16s ease;
}

.guides-related a:hover { color: var(--green); }

.guides-related small {
  flex: 0 0 auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: #f4f1e4;
  color: var(--muted);
  font-size: 12px;
}

/* ---------------------------------------------------------------- 响应式 */

/* 平板及以上：卡片横排（缩略图在左） */
@media (min-width: 640px) {
  .guides-card-link {
    flex-direction: row;
    align-items: stretch;
    gap: 16px;
    padding: 10px;
  }

  .guides-card-art {
    flex: 0 0 clamp(170px, 42%, 230px);
    width: auto;
    aspect-ratio: auto;
    min-height: 0;
    align-self: stretch;
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    background: #f1ead5;
  }

  /* 缩略图按 16:9 原比例显示在砂色面板里，不裁切封面 */
  .guides-card-cover {
    position: static;
    inset: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  .guides-card-text {
    padding: 5px 8px 5px 0;
    gap: 5px;
  }
}

/* 桌面：两列 */
@media (min-width: 1000px) {
  .guides-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
  }
}

@media (max-width: 999px) {
  .guides-sheet { padding: 26px 22px 32px; }
  .guides-intro { font-size: 17px; }
  .guides-reading { font-size: 16.5px; }
}

@media (max-width: 860px) {
  .guides-header-inner {
    flex-wrap: wrap;
    row-gap: 8px;
    padding-block: 8px;
  }

  .guides-tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .guides-tabs::-webkit-scrollbar { display: none; }

  .guides-tabs a {
    flex: 1 0 auto;
    padding: 0 10px;
    font-size: 14.5px;
  }

  .guides-nav a { padding: 0 12px; font-size: 15px; }
}

@media (max-width: 640px) {
  :root { --shell: min(calc(100% - 28px), 72rem); --column: min(calc(100% - 28px), 820px); }

  .guides-main { padding: 18px 0 52px; }

  .guides-header-inner { gap: 8px; }
  .guides-brand img { width: 62px; height: 50px; }

  .guides-shelf-header h2 { font-size: 20px; }

  .guides-card-text { padding: 13px 14px 15px; }
  .guides-card-title { font-size: 16.5px; }

  .guides-sheet { padding: 22px 16px 26px; border-radius: 14px; }
  .guides-post-header h1 { font-size: 23px; }
  .guides-intro { font-size: 16px; line-height: 1.8; }
  .guides-post-cover { margin: 20px 0 4px; }
  .guides-reading { font-size: 16px; line-height: 1.85; }
  .guides-reading > h2 { font-size: 19px; }
  .guides-reading blockquote { padding: 14px 16px; font-size: 15.5px; }

  .guides-related { padding: 18px 16px 8px; }
  .guides-related a { font-size: 14.5px; }
}
