/* Tutorial articles (/guides/) on top of legal.css (uses its --lg-* colour tokens, light and dark), plus the "教學文章" block on the home page (uses the hub's own tokens). */

/* ---------- article layout ---------- */
.gd-crumb { margin: 0 0 0.9rem; font-size: 0.88rem; color: var(--lg-muted); display: flex; flex-wrap: wrap; gap: 0 0.4rem; align-items: center; }
.gd-crumb a { display: inline-flex; align-items: center; min-height: 32px; color: var(--lg-muted); }
.gd-crumb span[aria-hidden] { opacity: 0.6; }
.gd-meta { margin: 0 0 1.2rem !important; font-size: 0.88rem; color: var(--lg-muted); }
.gd-lead { margin: 1rem 0 1.4rem !important; padding: 1rem 1.2rem; background: var(--lg-accent-soft); border-left: 4px solid var(--lg-accent); border-radius: 0 12px 12px 0; font-size: 1.02rem; line-height: 1.85; }
.lg-article .gd-toc { margin: 0 0 1.4rem; padding: 0.9rem 1.2rem; border: 1px solid var(--lg-line); border-radius: 12px; background: var(--lg-bg); }
.gd-toc strong { display: block; margin-bottom: 0.3rem; font-size: 0.95rem; }
.lg-article .gd-toc ol { margin: 0; padding-left: 1.3rem; }
.lg-article .gd-toc li { margin: 0.15rem 0; }
.lg-article .gd-toc a { display: inline-flex; align-items: center; min-height: 32px; }
.lg-article h3 { margin: 1.4rem 0 0.4rem; font-size: 1.05rem; line-height: 1.5; }
.lg-article ol { margin: 0.5rem 0 0.8rem; padding-left: 1.5rem; }
.lg-article ol li { margin: 0.5rem 0; }

/* ---------- figures ---------- */
.gd-fig { margin: 1.2rem 0; }
.gd-fig img { display: block; width: 100%; height: auto; border: 1px solid var(--lg-line); border-radius: 12px; background: #fff; }
.gd-fig figcaption { margin-top: 0.45rem; font-size: 0.86rem; line-height: 1.6; color: var(--lg-muted); }
.gd-fig.gd-narrow img { max-width: 520px; margin: 0 auto; }

/* ---------- tables ---------- */
.gd-table { margin: 1rem 0 1.2rem; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--lg-line); border-radius: 12px; }
.gd-table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 0.92rem; line-height: 1.6; }
.gd-table caption { padding: 0.6rem 0.8rem; text-align: left; font-size: 0.86rem; color: var(--lg-muted); caption-side: bottom; }
.gd-table th, .gd-table td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--lg-line); text-align: left; vertical-align: top; }
.gd-table thead th { background: var(--lg-accent-soft); font-weight: 700; white-space: nowrap; }
.gd-table tbody tr:last-child td { border-bottom: 0; }
.gd-table td.gd-num, .gd-table th.gd-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- call-outs ---------- */
.gd-note, .gd-owner, .gd-cta-box { margin: 1.2rem 0; padding: 0.9rem 1.1rem; border-radius: 12px; border: 1px solid var(--lg-line); background: var(--lg-bg); }
.gd-note { border-left: 4px solid var(--lg-accent); }
.gd-note p, .gd-owner p { margin: 0.3rem 0; }
.gd-owner { background: var(--lg-accent-soft); }
.gd-owner h2 { margin-top: 0 !important; }
.gd-cta-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.7rem 1.2rem; }
.gd-cta-box p { margin: 0; flex: 1 1 260px; }
.gd-cta-box .lg-cta { flex: 0 0 auto; }

/* ---------- FAQ ---------- */
.gd-faq details { margin: 0.55rem 0; padding: 0 1rem; border: 1px solid var(--lg-line); border-radius: 12px; background: var(--lg-bg); }
.gd-faq summary { min-height: 46px; display: flex; align-items: center; cursor: pointer; font-weight: 700; line-height: 1.5; }
.gd-faq details[open] { padding-bottom: 0.6rem; }
.gd-faq details p { margin: 0.2rem 0 0.4rem; }

/* ---------- more guides ---------- */
.gd-more { list-style: none; padding-left: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.6rem; }
.gd-more li { margin: 0; }
.gd-more a { display: flex; align-items: center; min-height: 48px; padding: 0.55rem 0.9rem; border: 1px solid var(--lg-line); border-radius: 12px; background: var(--lg-bg); font-weight: 700; text-decoration: none; line-height: 1.5; }
.gd-more a:hover { text-decoration: underline; }

/* ---------- guides index ---------- */
.gd-grid { list-style: none; margin: 1rem 0 0; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.9rem; }
.gd-grid li { margin: 0; }
.gd-card { display: flex; flex-direction: column; gap: 0.35rem; height: 100%; padding: 1rem 1.1rem; border: 1px solid var(--lg-line); border-radius: 14px; background: var(--lg-bg); color: inherit; text-decoration: none; }
.gd-card:hover { border-color: var(--lg-accent); }
.gd-card strong { font-size: 1.02rem; line-height: 1.5; color: var(--lg-text); }
.gd-card span { color: var(--lg-muted); font-size: 0.9rem; line-height: 1.65; }
.gd-card em { margin-top: auto; padding-top: 0.3rem; font-style: normal; font-size: 0.84rem; color: var(--lg-accent); }

/* ---------- home page block (hub tokens) ---------- */
.gd-home { max-width: 1180px; margin: 0 auto 32px; padding: 22px 24px; background: var(--bg-card, rgba(255, 255, 255, 0.06)); border: 1px solid var(--border-glass, rgba(128, 144, 170, 0.35)); border-radius: 22px; }
.gd-home h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 1.25rem; font-weight: 800; color: var(--text-main, inherit); }
.gd-home > p { margin: 0 0 16px; font-size: 0.9rem; color: var(--text-muted, inherit); }
.gd-home-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.gd-home-grid li { margin: 0; }
.gd-home-grid a { display: flex; flex-direction: column; gap: 4px; height: 100%; min-height: 44px; padding: 12px 14px; border: 1px solid var(--border-glass, rgba(128, 144, 170, 0.35)); border-radius: 14px; text-decoration: none; color: var(--text-main, inherit); background: transparent; }
.gd-home-grid a:hover { border-color: var(--border-glow, currentColor); }
.gd-home-grid strong { font-size: 0.95rem; line-height: 1.45; }
.gd-home-grid span { font-size: 0.82rem; line-height: 1.55; color: var(--text-muted, inherit); }
.gd-home-more { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; font-weight: 700; color: var(--text-main, inherit); }

@media (max-width: 600px) {
    .gd-lead { padding: 0.8rem 0.9rem; font-size: 1rem; }
    .gd-table table { font-size: 0.86rem; }
    .gd-home { padding: 18px 16px; border-radius: 18px; }
}
@media print {
    .lg-head, .site-legal, .gd-cta-box, .gd-more, .gd-crumb { display: none; }
    .lg-article { border: 0; padding: 0; }
    .gd-faq details { border: 0; }
    .gd-faq details > p { display: block; }
}
