/* ═══════════════════════════════════
   內容庫版型：AI 小學堂 + 使用手冊
   變數沿用 site.css 的 :root，這裡不另外定義顏色
   ═══════════════════════════════════ */

/* ── 頁首（列表頁共用）── */
.page-hero {
  background: linear-gradient(180deg, rgba(69, 168, 152, .07), var(--c-bg));
  padding: 56px 0 40px;
}
.page-h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  margin: 10px 0 14px;
  line-height: 1.3;
}

/* ── 麵包屑 ── */
.crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--c-muted);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.crumb a { color: var(--c-muted); }
.crumb a:hover { color: var(--c-teal); }
.crumb i { font-size: 14px; opacity: .55; }

/* ── 分類篩選 ── */
.list-section { padding: 40px 0 80px; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
  background: var(--c-bg);
  transition: all .18s ease;
  white-space: nowrap;
}
.filter-chip:hover {
  border-color: var(--c-teal);
  color: var(--c-teal);
}
.filter-chip.is-active {
  background: var(--c-teal);
  border-color: var(--c-teal);
  color: #fff;
}
.filter-count {
  font-size: 12px;
  font-weight: 700;
  opacity: .65;
}
.filter-chip.is-active .filter-count { opacity: .85; }

/* ── 文章卡（沿用 site.css 的 .article-card，補幾項）── */
.article-thumb-link { display: block; }
.article-cover {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  display: block;
  background: var(--c-bg-soft);
}
.article-title {
  font-size: 17px;
  line-height: 1.5;
  margin: 0 0 10px;
}
.article-title a { color: var(--c-text); }
.article-title a:hover { color: var(--c-teal); }
.article-card:hover .article-link { color: var(--c-orange); }

/* ── 空狀態 ── */
.empty-state {
  text-align: center;
  padding: 72px 20px;
  color: var(--c-muted);
}
.empty-state i { font-size: 44px; color: var(--c-border); display: block; margin-bottom: 14px; }
.empty-state p { margin-bottom: 20px; }

.btn-ghost {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
  transition: all .18s ease;
}
.btn-ghost:hover { border-color: var(--c-teal); color: var(--c-teal); }

/* ── 分頁 ──（色系沿用 .filter-chip：teal 邊框、is-active 實心 teal）*/
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
  flex-wrap: wrap;
}
.pager-nav,
.pager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 6px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
  transition: all .18s ease;
}
.pager-nav:hover,
.pager-num:hover { border-color: var(--c-teal); color: var(--c-teal); }
.pager-nav.is-disabled { opacity: .38; pointer-events: none; }
.pager-num.is-active {
  background: var(--c-teal);
  border-color: var(--c-teal);
  color: #fff;
  pointer-events: none;
}
.pager-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 38px;
  color: var(--c-muted);
}
.pager-info { margin-top: 14px; text-align: center; font-size: 13px; color: var(--c-muted); }

/* ════════════════════════════════════
   文章內頁
   ════════════════════════════════════ */
.article-page { padding-bottom: 0; }
.article-head { padding: 44px 0 22px; }
.article-h1 {
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  line-height: 1.4;
  margin: 12px 0 16px;
}
.article-meta {
  font-size: 13px;
  color: var(--c-muted);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.meta-sep { opacity: .5; }
.article-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.tag-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(69, 168, 152, .1);
  color: var(--c-teal);
}
.article-hero {
  width: 100%;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 8px 0 30px;
}
.article-lead {
  font-size: 17px;
  line-height: 1.85;
  color: var(--c-text);
  padding: 18px 22px;
  background: var(--c-bg-soft);
  border-left: 3px solid var(--c-teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 34px;
}

/* ── 內文排版（Html 欄位輸出的內容）── */
.article-content, .doc-content {
  font-size: 16px;
  line-height: 1.95;
  color: var(--c-text);
}
.article-content h2, .doc-content h2 {
  font-size: 1.3rem;
  margin: 42px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--c-border);
}
.article-content h3, .doc-content h3 { font-size: 1.08rem; margin: 30px 0 12px; }
.article-content p, .doc-content p { margin-bottom: 18px; }
.article-content ul, .article-content ol,
.doc-content ul, .doc-content ol { margin: 0 0 20px; padding-left: 24px; }
.article-content li, .doc-content li { margin-bottom: 10px; }
.article-content strong, .doc-content strong { color: var(--c-teal-dark); }
.article-content a, .doc-content a {
  color: var(--c-teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-content table, .doc-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  margin: 0 0 22px;
}
.article-content th, .doc-content th {
  background: var(--c-bg-soft);
  text-align: left;
  font-weight: 700;
}
.article-content th, .article-content td,
.doc-content th, .doc-content td {
  border: 1px solid var(--c-border);
  padding: 10px 13px;
}
.article-content pre, .doc-content pre {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.7;
}

/* 內文表格在手機要能水平捲動，不可把版面撐破 */
@media (max-width: 640px) {
  .article-content table, .doc-content table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* 手冊的注意事項區塊。文件原稿用 emoji 標記，轉 HTML 時換成這個樣式 */
.doc-warning {
  display: flex;
  gap: 11px;
  padding: 15px 18px;
  margin: 0 0 22px;
  background: rgba(242, 136, 48, .08);
  border-left: 3px solid var(--c-orange);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14.5px;
  line-height: 1.75;
}
/* 用 CSS 畫的驚嘆號，不賭 icon 字型的碼位 ——
   猜錯碼位會顯示成豆腐字，而且 CDN 掛掉時整個標記會消失 */
.doc-warning::before {
  content: "!";
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--c-orange);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
}

/* ── 參考來源（AI 小學堂硬性要求，不可省略）── */
.article-sources {
  margin: 48px 0 0;
  padding: 24px 26px;
  background: var(--c-bg-soft);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
}
.article-sources h2 {
  font-size: 15px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  color: var(--c-muted);
  letter-spacing: .04em;
}
.article-sources ol { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.9; }
.article-sources a { color: var(--c-teal); text-decoration: underline; text-underline-offset: 3px; }
.article-sources .source-site,
.article-sources .source-date { color: var(--c-muted); }

/* ── 上一篇／下一篇 ── */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 44px 0 0;
}
.article-nav-item {
  padding: 16px 18px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  transition: all .18s ease;
  min-width: 0;
}
.article-nav-item:hover { border-color: var(--c-teal); background: var(--c-bg-soft); }
.article-nav-item.is-next { text-align: right; }
.article-nav-label { display: block; font-size: 12px; color: var(--c-muted); margin-bottom: 5px; }
.article-nav-title {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.5;
}
.back-row { margin: 36px 0 72px; }

/* ════════════════════════════════════
   使用手冊
   ════════════════════════════════════ */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}
.guide-card {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 24px 26px;
  background: var(--c-bg);
  transition: box-shadow .2s ease;
}
.guide-card:hover { box-shadow: var(--shadow); }
.guide-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--c-border);
}
.guide-card-head h2 { font-size: 1.05rem; margin: 0; }
.guide-count { font-size: 12px; color: var(--c-muted); white-space: nowrap; }
.guide-list { list-style: none; margin: 0; padding: 0; }
.guide-list li + li { margin-top: 3px; }
.guide-list a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 8px;
  font-size: 14.5px;
  color: var(--c-text);
  transition: all .15s ease;
}
.guide-list a:hover { background: rgba(69, 168, 152, .08); color: var(--c-teal); }
.guide-list i { color: var(--c-muted); font-size: 16px; flex-shrink: 0; }
.guide-list a:hover i { color: var(--c-teal); }

/* ── 手冊內頁：側選單 + 內文 ── */
.doc-section { padding: 40px 0 80px; }
.doc-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
}
.doc-aside { position: sticky; top: 90px; }
.doc-aside-toggle { display: none; }
.doc-nav { font-size: 14px; max-height: calc(100vh - 130px); overflow-y: auto; }
.doc-nav-group + .doc-nav-group { margin-top: 22px; }
.doc-nav-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--c-muted);
  margin-bottom: 8px;
}
.doc-nav ul { list-style: none; margin: 0; padding: 0; }
.doc-nav li + li { margin-top: 2px; }
.doc-nav a {
  display: block;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--c-text);
  border-left: 2px solid transparent;
  line-height: 1.5;
  transition: all .15s ease;
}
.doc-nav a:hover { background: var(--c-bg-soft); color: var(--c-teal); }
.doc-nav a.is-active {
  background: rgba(69, 168, 152, .1);
  border-left-color: var(--c-teal);
  color: var(--c-teal);
  font-weight: 700;
}
.doc-article { min-width: 0; }
.doc-h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 10px 0 12px; line-height: 1.35; }
.doc-meta { font-size: 13px; color: var(--c-muted); margin-bottom: 26px; }
.doc-lead {
  font-size: 16px;
  line-height: 1.85;
  color: var(--c-muted);
  padding-bottom: 22px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--c-border);
}

/* ── 404 ── */
.notfound { padding: 100px 0 120px; text-align: center; }
.notfound-code {
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--c-teal), var(--c-orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 12px;
}
.notfound h1 { font-size: 1.5rem; margin-bottom: 10px; }
.notfound p { color: var(--c-muted); margin-bottom: 28px; }
.notfound-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ════════════════════════════════════
   產品頁
   ════════════════════════════════════ */
.product-hero-visual {
  background: linear-gradient(135deg, var(--c-bg-soft), rgba(69,168,152,.08));
  border: 1px solid var(--c-border); border-radius: 20px;
  min-height: 300px; display: flex; align-items: center; justify-content: center;
  padding: 28px; position: relative; overflow: hidden;
}
.product-hero-visual svg { width: 100%; height: auto; display: block; position: relative; z-index: 1; }
.product-hero-visual::after {
  content: ''; position: absolute; bottom: -40px; right: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(242,136,48,.18), transparent);
}

.btn-solid {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--c-teal); color: #fff;
  padding: 13px 30px; border-radius: 10px;
  font-weight: 700; font-size: 15px;
  transition: background .2s, transform .2s;
}
.btn-solid:hover { background: var(--c-teal-dark); transform: translateY(-1px); color: #fff; }

.advantage-section { padding: 20px 0 10px; }
.advantage-block {
  display: grid; grid-template-columns: 64px 1fr; gap: 22px;
  padding: 30px 0; border-top: 1px solid var(--c-border);
}
.advantage-block:first-child { border-top: none; padding-top: 6px; }
.advantage-block .feat-icon { margin-bottom: 0; }
.advantage-block h2 { font-size: 19px; margin: 0 0 10px; line-height: 1.4; }
.advantage-block .adv-body p { color: var(--c-muted); font-size: 15.5px; line-height: 1.8; margin: 0 0 12px; }
.advantage-block .adv-body p:last-child { margin-bottom: 0; }
.advantage-block .adv-body a { color: var(--c-teal); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.pitch-section { padding: 10px 0 64px; }
.pitch-quote {
  max-width: 760px; margin: 0 auto; text-align: center;
  font-size: clamp(1.1rem, 2.2vw, 1.45rem); line-height: 1.7;
  color: var(--c-text); font-weight: 600; padding: 0 20px;
}
.pitch-quote::before {
  content: '“'; display: block; font-family: Georgia, serif;
  font-size: 60px; color: var(--c-teal); opacity: .32; line-height: 1; margin-bottom: -6px;
}

/* ── 產品服務總覽 /products ── */
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.product-card {
  display: block;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  padding: 30px 26px;
  transition: box-shadow .25s, transform .25s, border-color .25s;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: var(--c-teal); }
.product-card h2 { font-size: 17px; margin: 4px 0 10px; color: var(--c-text); }
.product-card p { font-size: 13.5px; color: var(--c-muted); line-height: 1.7; margin: 0; }

/* ════════════════════════════════════
   RWD
   ════════════════════════════════════ */
@media (max-width: 991px) {
  .doc-layout { grid-template-columns: 1fr; gap: 22px; }
  .doc-aside { position: static; }

  /* 手機把側選單收起來，展開才顯示 —— 十幾篇的選單會把內文推到很下面 */
  .doc-aside-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    background: var(--c-bg);
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text);
    cursor: pointer;
  }
  .doc-nav {
    display: none;
    margin-top: 16px;
    padding: 18px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    max-height: none;
  }
  .doc-nav.open { display: block; }
}

@media (max-width: 640px) {
  .page-hero { padding: 36px 0 28px; }
  .list-section { padding: 28px 0 56px; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav-item.is-next { text-align: left; }
  .article-lead { font-size: 15.5px; padding: 15px 17px; }
  .article-content, .doc-content { font-size: 15.5px; }
  .filter-bar { gap: 8px; margin-bottom: 26px; }
  .filter-chip { padding: 7px 13px; font-size: 13px; }
  .article-sources { padding: 18px 19px; }
}

/* 動態偏好：使用者要求減少動態時關掉過場 */
@media (prefers-reduced-motion: reduce) {
  .filter-chip, .btn-ghost, .article-nav-item, .guide-list a, .doc-nav a { transition: none; }
}

/* 列印：側選單、分頁、CTA 都不必印出來 */
@media print {
  .doc-aside, .article-nav, .pager, .cta-section, .site-nav, .site-footer, .back-row { display: none; }
  .doc-layout { grid-template-columns: 1fr; }
}
