/* pages/knowledge.css — 知識園地共用樣式 (2026-10) */
:root {
  --brand: #0a5bb5;
  --brand-ink: #0b2545;
  --accent: #f08a24;
  --green: #4f8f1f;
  --teal: #1593a6;
  --amber: #d99611;
  --line: #e2e8f0;
  --text: #334155;
  --muted: #64748b;
  --radius: 14px;
}

.knowledge-body {
  background: linear-gradient(180deg, #eef4fa 0%, #f6f9fc 320px, #f6f9fc 100%);
  padding: 0 1rem 3.5rem;
  color: var(--text);
}

.knowledge-body .breadcrumb {
  max-width: 1200px;
  margin: 87px auto 0;
  box-sizing: border-box;
  background: transparent;
  box-shadow: none;
  padding: 1.1rem 0 0.4rem;
}

.knowledge-body a:hover {
  color: var(--brand);
}

.knowledge-container {
  max-width: 1200px;
  box-sizing: border-box;
  margin: 0.8rem auto 0;
  padding: 2.4rem 2.6rem;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(15, 40, 80, 0.07);
}

.knowledge-container.article {
  max-width: 960px;
}

/* 頁首 */
.page-header {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  padding-bottom: 1.6rem;
  margin-bottom: 1.8rem;
  border-bottom: 1px solid var(--line);
}

.page-header h1 {
  margin: 0 0 0.4rem;
  font-size: 1.75rem;
  color: var(--brand-ink);
}

.page-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.page-icon {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  color: #fff;
  background: linear-gradient(135deg, #3fa2f5, var(--brand));
  box-shadow: 0 6px 16px rgba(10, 91, 181, 0.3);
}

.block-title {
  font-size: 1.2rem;
  color: var(--brand-ink);
  margin: 2.2rem 0 1rem;
  padding-left: 0.8rem;
  border-left: 4px solid var(--brand);
}

.page-header + .block-title {
  margin-top: 0;
}

/* 知識園地首頁卡片 */
.kh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.4rem;
}

.kh-card {
  --c: var(--brand);
  --bg: #e8f1fc;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.6rem 1.6rem 1.3rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.kh-card:hover {
  transform: translateY(-4px);
  border-color: var(--c);
  box-shadow: 0 14px 30px rgba(15, 40, 80, 0.12);
  color: var(--text) !important;
}

.kh-green { --c: var(--green); --bg: #eef6e6; }
.kh-teal { --c: var(--teal); --bg: #e3f5f7; }
.kh-amber { --c: var(--amber); --bg: #fdf4dc; }
.kh-orange { --c: var(--accent); --bg: #fdf0e3; }

.kh-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: var(--c);
  background: var(--bg);
}

.kh-tag {
  position: absolute;
  top: 1.6rem;
  right: 1.6rem;
  font-size: 0.78rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  color: var(--c);
  background: var(--bg);
  font-weight: 600;
}

.kh-card h2 {
  margin: 1rem 0 0.5rem;
  font-size: 1.18rem;
  color: var(--brand-ink);
  line-height: 1.45;
}

.kh-card p {
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.kh-more {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--c);
  font-weight: 600;
  font-size: 0.92rem;
}

.kh-card:hover .kh-more i {
  transform: translateX(3px);
}

.kh-more i {
  transition: transform 0.2s ease;
}

/* 方法清單 */
.legend {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.method-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.method-list li + li {
  border-top: 1px solid var(--line);
}

.method-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.95rem 1.2rem;
  color: var(--text);
  transition: background-color 0.2s ease;
}

a.method-row:hover {
  background: #f3f8fe;
}

.method-name {
  flex: 1;
  font-weight: 500;
}

.method-row > i {
  color: #94a3b8;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: Consolas, "Courier New", monospace;
  color: var(--brand);
  background: #e8f1fc;
  white-space: nowrap;
}

.badge-green {
  font-family: inherit;
  color: var(--green);
  background: #eef6e6;
}

.tag {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.tag-read {
  color: var(--green);
  background: #eef6e6;
}

.tag-ext {
  color: #7c5a12;
  background: #fbf1d9;
}

/* 主題卡 (法規) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.topic-card {
  display: block;
  padding: 1.3rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.topic-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(15, 40, 80, 0.1);
  color: var(--text) !important;
}

.topic-card > i {
  font-size: 1.5rem;
  color: var(--brand);
}

.topic-card h3 {
  margin: 0.6rem 0 0.4rem;
  font-size: 1.05rem;
  color: var(--brand-ink);
  line-height: 1.45;
}

.topic-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.65;
}

/* 小常識 */
.tip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.tip-card {
  padding: 1.3rem 1.3rem 1.1rem;
  border-radius: 12px;
  background: #f8fbfe;
  border: 1px solid var(--line);
}

.tip-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  color: #fff;
  background: linear-gradient(135deg, #3fa2f5, var(--brand));
}

.tip-card:nth-child(3n + 2) .tip-icon {
  background: linear-gradient(135deg, #8cc63f, var(--green));
}

.tip-card:nth-child(3n) .tip-icon {
  background: linear-gradient(135deg, #ffb062, var(--accent));
}

.tip-card h3 {
  margin: 0.8rem 0 0.4rem;
  font-size: 1.05rem;
  color: var(--brand-ink);
}

.tip-card p {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.75;
}

/* 文章 / 方法頁 */
.article-header {
  padding-bottom: 1.4rem;
  margin-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
}

.article-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--brand);
  font-weight: 600;
}

.article-header h1 {
  margin: 0.6rem 0 0.8rem;
  font-size: 1.7rem;
  line-height: 1.45;
  color: var(--brand-ink);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.2rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.article-meta i {
  margin-right: 0.3rem;
}

.method-body {
  line-height: 1.9;
  font-size: 1rem;
}

.method-section {
  margin-bottom: 1.6rem;
}

.method-section h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.7rem;
  font-size: 1.15rem;
  color: var(--brand-ink);
}

.sec-no {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 0.3rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #fff;
  background: var(--brand);
}

.method-section p {
  margin: 0.35rem 0;
}

.method-section p.l1 { padding-left: 0; }
.method-section p.l2 { padding-left: 1.5rem; }
.method-section p.l3 { padding-left: 3rem; }
.method-section p.l4 { padding-left: 4.5rem; }
.method-section p.l5 { padding-left: 6rem; }

.method-section p.note,
.method-section.notes p {
  font-size: 0.9rem;
  color: var(--muted);
  padding-left: 0;
}

.method-figure {
  margin: 1.2rem 0;
  text-align: center;
}

.method-figure img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.6rem;
}

.method-figure figcaption {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* 文章內文 */
.prose h2 {
  font-size: 1.2rem;
  color: var(--brand-ink);
  margin: 2rem 0 0.7rem;
  padding-left: 0.8rem;
  border-left: 4px solid var(--green);
}

.prose p {
  margin: 0 0 1rem;
  text-align: justify;
}

.prose .lead {
  font-size: 1.06rem;
  color: #1e293b;
  padding: 1rem 1.2rem;
  background: #f3f8fe;
  border-radius: 10px;
}

.feature-pills {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.feature-pills li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: #eef6e6;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 600;
}

/* 表格 */
.table-scroll {
  overflow-x: auto;
  margin: 1rem 0 1.4rem;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  line-height: 1.65;
}

.data-table caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  color: var(--brand-ink);
  padding-bottom: 0.5rem;
}

.data-table th,
.data-table td {
  border: 1px solid var(--line);
  padding: 0.6rem 0.8rem;
  vertical-align: top;
  text-align: left;
}

.data-table thead th {
  background: #0b4a8f;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

.data-table tbody tr:nth-child(even) {
  background: #f8fbfe;
}

.data-table tbody th {
  background: #f0f6fd;
  color: var(--brand-ink);
  white-space: nowrap;
}

.compare-table {
  min-width: 760px;
}

.abbr-table th a {
  color: var(--brand);
}

/* 提示框 / 資料來源 */
.callout {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  margin: 1.4rem 0;
  padding: 1rem 1.2rem;
  border-radius: 10px;
  background: #fff8ec;
  border: 1px solid #f7dcb4;
  line-height: 1.75;
}

.callout > i {
  font-size: 1.3rem;
  color: var(--accent);
}

.callout a {
  color: var(--brand);
  font-weight: 600;
}

.source-box {
  margin-top: 2rem;
  padding: 1.1rem 1.4rem;
  border-radius: 10px;
  background: #f6f8fb;
  border: 1px dashed #c8d3e1;
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--muted);
}

.source-box h2 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
  color: var(--brand-ink);
}

.source-box ul {
  list-style: disc;
  padding-left: 1.2rem;
  margin: 0;
}

.source-box a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 上下篇 */
.article-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.8rem;
  margin-top: 2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  align-items: stretch;
}

.article-pager a {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.5;
}

.article-pager a:hover {
  border-color: var(--brand);
}

.article-pager small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.pager-next {
  text-align: right;
}

.pager-list {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--brand) !important;
  font-weight: 600;
  white-space: nowrap;
}

/* 響應式 */
@media (max-width: 768px) {
  .knowledge-body {
    padding: 0 0.6rem 2.5rem;
  }

  .knowledge-container {
    padding: 1.4rem 1.1rem;
  }

  .page-header {
    flex-direction: column;
    gap: 0.8rem;
  }

  .page-header h1,
  .article-header h1 {
    font-size: 1.4rem;
  }

  .kh-grid {
    grid-template-columns: 1fr;
  }

  .method-row {
    flex-wrap: wrap;
    gap: 0.4rem 0.6rem;
  }

  .method-name {
    flex-basis: 100%;
  }

  .method-row > i {
    display: none;
  }

  .method-section p.l3 { padding-left: 1.5rem; }
  .method-section p.l4 { padding-left: 2.2rem; }
  .method-section p.l5 { padding-left: 2.8rem; }

  .article-pager {
    grid-template-columns: 1fr;
  }

  .pager-next {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .knowledge-body .breadcrumb {
    margin-top: 70px;
  }
}
