/* 赴德专题区 – guides imported by tools/annie/guide_import.py (Chinese site).
   Adapted from the content team's stylesheet (网页版/assets/style.css, Annie's layout decisions of
   2026-11-17/18: red headings, fixed question menu, swipeable cards). Every class carries the prefix
   g- so nothing collides with the site's CSS; the site's header, footer, fonts and contact block are
   used. Annie 2026-11-18: same page width as the other pages (1200 px frame, text column 760 px
   like the news articles) and a redesigned question menu. */

.g-page {
  --g-col: 760px;
  --g-red: #C2191F;
  --g-red-dark: #9E1419;
  --g-ink: #333333;
  --g-ink-soft: #5c5c5c;
  --g-grey: #B5B5B6;
  --g-line: #EDEDED;
  --g-pink: #FBE8E9;
  --g-paper: #FFFFFF;
  --g-cream: #FBF8F5;
  --g-radius: 10px;
  background: var(--g-paper);
  color: var(--g-ink);
  font-size: 17px;
  line-height: 1.85;
}
.g-page img { max-width: 100%; height: auto; display: block; }
/* in the site's components layer and at zero specificity, so the site's buttons (also in that layer)
   keep their own colours */
@layer components {
  :where(.g-page) a { color: var(--g-red); text-decoration: none; }
  :where(.g-page) a:hover { text-decoration: underline; }
}

/* ---------- question menu: a bar below the site header, sticky ---------- */
.g-bar {
  position: sticky; top: 77px; z-index: 50;
  background: var(--g-cream);
  border-top: 1px solid var(--g-line);
  border-bottom: 1px solid var(--g-line);
}
.g-bar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: stretch; justify-content: space-between; gap: 24px; position: relative;
}
:where(.g-page) a.g-bar-title {
  display: flex; flex-direction: column; justify-content: center; padding: 10px 0;
  color: var(--g-ink); font-size: 17px; font-weight: 700; line-height: 1.3; white-space: nowrap;
}
.g-bar-title small { color: var(--g-red); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
:where(.g-page) a.g-bar-title:hover { color: var(--g-red); text-decoration: none; }

.g-main-nav { display: flex; align-items: stretch; gap: 4px; }
.g-main-nav details, .g-menu { position: relative; display: flex; }
.g-main-nav summary {
  display: flex; align-items: center; gap: 8px; padding: 0 10px; cursor: pointer; list-style: none;
  font-size: 15px; font-weight: 500; line-height: 1.4; color: var(--g-ink); white-space: nowrap;
  border-bottom: 3px solid transparent; border-top: 3px solid transparent;
}
.g-main-nav summary::-webkit-details-marker { display: none; }
.g-qn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--g-grey); color: var(--g-ink-soft); font-size: 12px; font-weight: 700; line-height: 1;
}
.g-main-nav summary:hover, .g-main-nav details[open] > summary { color: var(--g-red); }
.g-main-nav summary:hover .g-qn, .g-main-nav details[open] > summary .g-qn { border-color: var(--g-red); color: var(--g-red); }
.g-main-nav details.g-cur > summary { color: var(--g-red); font-weight: 700; border-bottom-color: var(--g-red); }
.g-main-nav details.g-cur > summary .g-qn { background: var(--g-red); border-color: var(--g-red); color: #fff; }
.g-main-nav .g-sub {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; width: 340px;
  background: var(--g-paper); border: 1px solid var(--g-line); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0,0,0,.12); padding: 8px;
}
.g-main-nav details.g-right .g-sub { left: auto; right: 0; }
:where(.g-page) .g-main-nav .g-sub a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--g-ink); font-size: 15px; line-height: 1.5; }
.g-main-nav .g-sub a small { display: block; color: var(--g-ink-soft); font-size: 12px; }
:where(.g-page) .g-main-nav .g-sub a.g-ov { border-bottom: 1px solid var(--g-line); border-radius: 8px 8px 0 0; margin-bottom: 4px; font-weight: 700; }
:where(.g-page) .g-main-nav .g-sub a:hover { background: var(--g-cream); color: var(--g-red); text-decoration: none; }
:where(.g-page) .g-main-nav .g-sub a[aria-current="page"] { background: var(--g-pink); color: var(--g-red); }

.g-menu-toggle {
  display: none; align-items: center; gap: 8px; align-self: center;
  border: 1px solid var(--g-grey); background: var(--g-paper); border-radius: 999px; padding: 6px 14px;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--g-ink); cursor: pointer;
}
.g-chev { width: 8px; height: 8px; border-right: 2px solid var(--g-red); border-bottom: 2px solid var(--g-red); transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.g-bar.g-menu-open .g-chev { transform: translateY(2px) rotate(-135deg); }

@media (max-width: 1000px) {
  .g-menu-toggle { display: inline-flex; }
  .g-main-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--g-paper); border-bottom: 1px solid var(--g-line); box-shadow: 0 16px 30px rgba(0,0,0,.10);
    max-height: calc(100vh - 150px); overflow-y: auto; padding: 4px 16px 12px;
  }
  .g-bar.g-menu-open .g-main-nav { display: flex; }
  .g-main-nav details, .g-menu { display: block; border-top: 1px solid var(--g-line); }
  .g-main-nav details:first-child { border-top: 0; }
  .g-main-nav summary { padding: 12px 4px; font-size: 16px; border: 0; }
  .g-main-nav details.g-cur > summary { border: 0; }
  .g-main-nav .g-sub { position: static; width: auto; box-shadow: none; border: 0; padding: 0 0 8px 30px; }
}

/* 回到顶部（右下角） */
.g-to-top {
  position: fixed; right: 20px; bottom: 24px; z-index: 40;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--g-red); color: #fff; box-shadow: 0 6px 18px rgba(194,25,31,.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.g-to-top span { font-size: 20px; font-weight: 700; }
.g-to-top small { font-size: 11px; margin-top: 2px; }
.g-to-top.g-show { opacity: 1; transform: none; pointer-events: auto; }
.g-to-top:hover { background: var(--g-red-dark); text-decoration: none; }

/* 面包屑 */
.g-crumbs { max-width: var(--g-col); margin: 0 auto; padding: 14px 20px 0; font-size: 14px; color: var(--g-ink-soft); }
.g-crumbs a { color: var(--g-ink-soft); }
.g-crumbs span { margin: 0 6px; color: var(--g-grey); }

/* 细讲页的图片轮播：左右滑动，上面是图，下面是小圆点和页码（11/18 Annie 定） */
.g-carousel { max-width: var(--g-col); margin: 18px auto 0; padding: 0 20px; position: relative; }
.g-carousel .g-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; border-radius: var(--g-radius); outline: none;
}
.g-carousel .g-track::-webkit-scrollbar { display: none; }
.g-carousel .g-slide { flex: 0 0 100%; margin: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.g-carousel .g-slide img { width: 100%; }
.g-carousel .g-nav {
  position: absolute; top: calc(50% - 30px); transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.92); color: var(--g-ink); font-size: 30px; line-height: 1;
  box-shadow: 0 3px 12px rgba(0,0,0,.18); display: flex; align-items: center; justify-content: center; padding-bottom: 4px;
}
.g-carousel .g-nav:hover { color: var(--g-red); }
.g-carousel .g-prev { left: 32px; }
.g-carousel .g-next { right: 32px; }
.g-carousel .g-nav:disabled { opacity: 0; pointer-events: none; }
.g-carousel .g-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.g-carousel .g-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.g-carousel .g-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px; background: var(--g-grey); cursor: pointer; transition: width .2s, background .2s; }
.g-carousel .g-dots button.g-on { width: 22px; background: var(--g-red); }
.g-carousel .g-count { font-size: 14px; color: var(--g-ink-soft); font-variant-numeric: tabular-nums; }
.g-carousel .g-img-note { text-align: left; margin-top: 4px; }
@media (max-width: 720px) {
  .g-carousel .g-nav { width: 38px; height: 38px; font-size: 24px; }
  .g-carousel .g-prev { left: 26px; } .g-carousel .g-next { right: 26px; }
}

/* 文章头 */
.g-article-head { max-width: var(--g-col); margin: 0 auto; padding: 28px 20px 8px; }
.g-kicker { color: var(--g-red); font-weight: 700; font-size: 15px; letter-spacing: .02em; margin: 0 0 6px; }
.g-article-head h1 { font-size: 32px; line-height: 1.35; margin: 0 0 14px; font-weight: 800; color: var(--g-ink); }
.g-lead { font-size: 18px; color: var(--g-ink-soft); margin: 0; }

.g-cover { max-width: var(--g-col); margin: 22px auto 0; padding: 0 20px; }
.g-cover img { width: 100%; border-radius: var(--g-radius); }
.g-img-note { margin: 6px 0 0; text-align: right; font-size: 12px; color: var(--g-grey); line-height: 1.5; }

/* 正文 */
.g-article-body { max-width: var(--g-col); margin: 0 auto; padding: 18px 20px 10px; }
.g-article-body p { margin: 0 0 1.05em; }
/* 大标题（一、二、三……）：安妮红、加粗、比正文大两号；小标题（1. 2. 3.）：黑色加粗，和正文一样大（11/17 Annie 定） */
.g-article-body h2 {
  font-size: 1.25em; line-height: 1.5; margin: 2em 0 .8em;
  color: var(--g-red); font-weight: 700;
}
.g-article-body h3 { font-size: 1em; line-height: 1.7; margin: 1.5em 0 .5em; font-weight: 700; color: var(--g-ink); }
.g-article-body .g-intro { font-size: 18px; }

.g-article-body figure { margin: 1.4em 0 1.6em; }
.g-article-body figure img { width: 100%; border-radius: var(--g-radius); }

.g-article-body .g-q { margin: 1.3em 0 .35em; font-weight: 700; }
.g-article-body .g-q b, .g-article-body .g-a b {
  display: inline-block; min-width: 1.6em; margin-right: 6px; padding: 0 6px;
  border-radius: 4px; font-size: 14px; line-height: 1.7; text-align: center; vertical-align: 2px;
}
.g-article-body .g-q b { background: var(--g-red); color: #fff; }
.g-article-body .g-a b { background: var(--g-line); color: var(--g-ink); font-weight: 700; }
.g-article-body .g-a { margin: 0 0 1em; }

.g-article-body .g-step { position: relative; padding-left: 44px; margin: 0 0 1em; }
.g-article-body .g-step .g-num {
  position: absolute; left: 0; top: .15em;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--g-red); color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

.g-about {
  background: var(--g-cream); border: 1px solid var(--g-line); border-radius: var(--g-radius);
  padding: 18px 22px; margin: 2.2em 0 1.4em;
}
.g-about h3 { margin: 0 0 .4em !important; font-size: 17px !important; color: var(--g-red); }
.g-about p { margin: 0 !important; font-size: 16px; }

.g-sources { font-size: 14px; line-height: 1.75; color: var(--g-ink-soft); border-top: 1px solid var(--g-line); padding-top: 14px; margin-top: 1.6em !important; }

/* 上一篇 / 下一篇 */
.g-pager { max-width: var(--g-col); margin: 26px auto 0; padding: 0 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.g-pager a, .g-pager .g-empty {
  display: block; border: 1px solid var(--g-line); border-radius: var(--g-radius); padding: 14px 16px; color: var(--g-ink);
}
.g-pager a:hover { border-color: var(--g-red); text-decoration: none; }
.g-pager small { display: block; color: var(--g-ink-soft); font-size: 13px; }
.g-pager strong { display: block; font-size: 16px; line-height: 1.5; }
.g-pager .g-next { text-align: right; }
.g-pager .g-empty { border-style: dashed; color: var(--g-grey); }

/* 专题首页 */
.g-hero { max-width: var(--g-col); margin: 20px auto 0; padding: 0 20px; }
.g-hero .g-frame { position: relative; border-radius: var(--g-radius); overflow: hidden; }
.g-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.g-hero .g-text { margin: 26px 0 0; }
.g-hero h1 { font-size: 34px; line-height: 1.35; margin: 0 0 12px; font-weight: 800; }

.g-home-body { max-width: var(--g-col); margin: 0 auto; padding: 8px 20px 0; }
.g-home-body h2 { font-size: 1.25em; margin: 1.9em 0 .8em; color: var(--g-red); font-weight: 700; line-height: 1.5; }
.g-home-body p { margin: 0 0 1em; }

.g-howto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.g-howto div { background: var(--g-cream); border: 1px solid var(--g-line); border-radius: var(--g-radius); padding: 14px 16px; font-size: 15.5px; line-height: 1.7; }
.g-howto b { display: block; color: var(--g-red); margin-bottom: 4px; font-size: 16px; }

.g-toc { max-width: var(--g-col); margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 1fr; gap: 18px; }
.g-toc a { display: block; border: 1px solid var(--g-line); border-radius: var(--g-radius); overflow: hidden; color: var(--g-ink); background: var(--g-paper); transition: box-shadow .15s, border-color .15s; }
.g-toc a:hover { border-color: var(--g-red); box-shadow: 0 8px 26px rgba(0,0,0,.08); text-decoration: none; }
.g-toc img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.g-toc .g-meta { padding: 14px 16px 16px; }
.g-toc .g-no { color: var(--g-red); font-weight: 700; font-size: 14px; }
.g-toc h3 { margin: 2px 0 6px; font-size: 18px; line-height: 1.45; }
.g-toc p { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--g-ink-soft); }
/* guides still being written (赴德专题区 overview): same card, not a link */
.g-toc > .g-soon { display: block; border: 1px dashed var(--g-grey); border-radius: var(--g-radius); overflow: hidden; background: var(--g-paper); }
.g-toc .g-soon img { opacity: .55; }
.g-toc .g-soon .g-no::after { content: "　整理中"; color: var(--g-ink-soft); font-weight: 400; }
.g-toc img { aspect-ratio: 16 / 9; object-fit: cover; }

/* 指南：副标题、总览页里的细讲链接、细讲页的卡片和文字版 */
.g-subtitle { margin: -4px 0 12px; font-size: 14px; color: var(--g-ink-soft); }
.g-chapter-nav a.g-current { background: var(--g-red); border-color: var(--g-red); color: #fff; font-weight: 600; }

.g-detail-link {
  display: flex; gap: 14px; align-items: center;
  margin: -0.2em 0 1.4em; padding: 10px; border: 1px solid var(--g-line); border-radius: var(--g-radius);
  background: var(--g-paper); color: var(--g-ink);
}
.g-detail-link:hover { border-color: var(--g-red); text-decoration: none; box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.g-detail-link img { width: 72px; height: 96px; object-fit: cover; border-radius: 6px; flex: none; }
.g-detail-link span { display: block; line-height: 1.55; }
.g-detail-link small { display: block; color: var(--g-red); font-weight: 700; font-size: 13px; }
.g-detail-link strong { display: block; font-size: 16px; }
.g-detail-link em { display: block; font-style: normal; color: var(--g-ink-soft); font-size: 13px; margin-top: 2px; }

.g-cards { max-width: var(--g-col); margin: 18px auto 0; padding: 0 20px; }
.g-cards .g-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.g-cards .g-grid a { display: block; border-radius: var(--g-radius); overflow: hidden; }
.g-cards .g-grid img { width: 100%; }

.g-article-body .g-num-item { position: relative; padding-left: 40px; margin: 0 0 .8em; }
.g-article-body .g-num-item .g-num {
  position: absolute; left: 0; top: .2em; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px;
  background: var(--g-pink); color: var(--g-red); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.g-article-body .g-bullet { position: relative; padding-left: 22px; margin: 0 0 .7em; }
.g-article-body .g-bullet::before { content: ""; position: absolute; left: 6px; top: .8em; width: 7px; height: 7px; border-radius: 50%; background: var(--g-red); }
.g-article-body .g-arrow { padding-left: 22px; position: relative; font-weight: 600; }
.g-article-body .g-arrow::before { content: "→"; position: absolute; left: 0; color: var(--g-red); }
.g-article-body .g-note { background: var(--g-pink); border-radius: 8px; padding: 10px 14px; }
.g-article-body .g-note b { color: var(--g-red); margin-right: 8px; }
.g-article-body .g-note.g-tip { background: var(--g-cream); border: 1px solid var(--g-line); }
.g-article-body .g-mini { font-weight: 700; margin: 1.2em 0 .5em; }
.g-back-topic { margin-top: 1.6em !important; font-weight: 600; }
.g-toc .g-count { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--g-red); background: var(--g-pink); border-radius: 999px; padding: 2px 10px; }

@media (max-width: 720px) {
  body { font-size: 16.5px; }
  .g-article-head h1, .g-hero h1 { font-size: 26px; }
  .g-lead { font-size: 17px; }
  .g-howto { grid-template-columns: 1fr; }
  .g-pager { grid-template-columns: 1fr; }
  .g-pager .g-next { text-align: left; }
  .g-hero img { aspect-ratio: 16 / 9; }
}

/* ---------- page frame (Annie 2026-11-18): full page width like the community page ---------- */
.g-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.g-wrap > * { max-width: none; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
.g-wrap .g-crumbs { padding-top: 20px; }
.g-wrap .g-article-head { padding-top: 24px; }
.g-wrap .g-article-head h1, .g-wrap .g-hero h1 { font-size: clamp(28px, 3.4vw, 40px); }
.g-wrap .g-lead { max-width: 900px; }
/* cover and hero picture across the full width, as on the community page */
.g-wrap .g-cover img, .g-wrap .g-hero img { aspect-ratio: 16 / 9; object-fit: cover; border-radius: 18px; }
.g-wrap .g-hero { margin-top: 20px; }
/* guide articles (overviews, detail pages) read like the WeChat articles (Annie 2026-11-18): one
   centred column; text, cover, cards and pictures all share its width */
.g-wrap.g-col > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.g-wrap.g-col .g-carousel .g-slide { flex-basis: 100%; }
.g-wrap.g-col .g-article-body figure { max-width: none; }
.g-wrap.g-col .g-article-body figure img { width: 100%; }
.g-page .g-col + section .blog-end { max-width: 768px; }
.g-wrap .g-howto { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* card overview (赴德专题区, guide front page) */
.g-wrap .g-toc { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* swipeable cards: 3 side by side on computers, 2 on tablets, 1 on phones (guide.js steps one card) */
.g-wrap .g-carousel .g-track { gap: 16px; }
.g-wrap .g-carousel .g-slide { flex: 0 0 calc((100% - 32px) / 3); }
.g-wrap .g-carousel .g-prev { left: 12px; }
.g-wrap .g-carousel .g-next { right: 12px; }
.g-wrap .g-carousel .g-slide img { border-radius: var(--g-radius); }
@media (max-width: 1000px) {
  .g-wrap .g-toc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-wrap .g-carousel .g-slide { flex-basis: calc((100% - 16px) / 2); }
}
@media (max-width: 640px) {
  .g-wrap { padding: 0 20px; }
  .g-wrap .g-toc, .g-wrap .g-howto { grid-template-columns: minmax(0, 1fr); }
  .g-wrap .g-carousel .g-slide { flex-basis: 100%; }
  .g-wrap .g-cover img, .g-wrap .g-hero img { border-radius: 12px; }
}
.g-soon-link { margin-top: 1.6em; }
.g-wrap > .g-toc:last-child { margin-bottom: 72px; }
