/* =========================================================
   本頁專用：設定速查表、步驟清單、截圖、提示框
   沿用 base.css 的設計 tokens，另增提示框色票（亮/暗皆達 AA）
   ========================================================= */
:root {
  --tip-bg: #eef4fb;
  --tip-border: #003366;
  --warn-bg: #fff4e5;
  --warn-border: #9a4a00;
  --warn-title: #7a3a00;
  --shot-border: #c3cbd3;
}

:root[data-theme="dark"] {
  --tip-bg: #17212d;
  --tip-border: #8fb9e8;
  --warn-bg: #2a2117;
  --warn-border: #e0a458;
  --warn-title: #f0c38a;
  --shot-border: #39424c;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tip-bg: #17212d;
    --tip-border: #8fb9e8;
    --warn-bg: #2a2117;
    --warn-border: #e0a458;
    --warn-title: #f0c38a;
    --shot-border: #39424c;
  }
}

/* ---- 導言 ---- */
.lead {
  font-size: 1.0625rem;
}

/* ---- 目錄 ---- */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .9rem 1.25rem;
  margin: 1.5rem 0 2rem;
}

.toc h2 {
  margin: 0 0 .4rem;
  padding: 0;
  border: 0;
  font-size: 1rem;
  color: var(--text);
}

.markdown-body .toc ol {
  margin: 0;
}

/* ---- 小標題 ---- */
.markdown-body h3 {
  font-size: 1.0625rem;
  color: var(--text);
  margin: 1.8rem 0 .6rem;
}

/* ---- 設定速查表 ---- */
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

table.settings {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
  line-height: 1.6;
}

table.settings caption {
  text-align: left;
  font-weight: 700;
  padding: .6rem .9rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

table.settings th,
table.settings td {
  padding: .55rem .9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

table.settings tr:last-child th,
table.settings tr:last-child td {
  border-bottom: 0;
}

table.settings thead th {
  background: var(--surface);
  font-weight: 700;
  white-space: nowrap;
}

table.settings tbody th {
  font-weight: 700;
  white-space: nowrap;
}

.post .content table.settings code {
  margin: 0;
  white-space: nowrap;
}

/* ---- 提示框 ---- */
.callout {
  border-left: 4px solid var(--tip-border);
  background: var(--tip-bg);
  border-radius: 0 6px 6px 0;
  padding: .8rem 1.1rem;
  margin: 1.25rem 0 1.5rem;
}

.callout p {
  margin: .3rem 0;
}

.markdown-body .callout ul,
.markdown-body .callout ol {
  margin: .4rem 0;
}

.callout .callout-title {
  font-weight: 700;
  margin: 0 0 .2rem;
}

.callout.warn {
  border-left-color: var(--warn-border);
  background: var(--warn-bg);
}

.callout.warn .callout-title {
  color: var(--warn-title);
}

/* ---- 步驟清單 ---- */
.markdown-body ol.steps {
  list-style: none;
  counter-reset: step;
  padding-left: 0;
  margin: 1.25rem 0 1.5rem;
}

ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.6rem 2.75rem;
  margin: 0;
}

ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: .05rem;
  width: 1.85rem;
  height: 1.85rem;
  line-height: 1.85rem;
  text-align: center;
  border-radius: 50%;
  background: var(--brand);
  color: var(--bg);
  font-weight: 700;
  font-size: .9375rem;
  font-variant-numeric: tabular-nums;
}

/* 步驟之間的連接線 */
ol.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(.925rem - 1px);
  top: 2.2rem;
  bottom: .35rem;
  width: 2px;
  background: var(--border);
}

ol.steps > li > p:first-child {
  margin-top: 0;
}

ol.steps > li > p:last-child {
  margin-bottom: 0;
}

.markdown-body ol.steps ul {
  margin: .4rem 0 .8rem;
}

/* ---- 截圖 ---- */
figure.shot {
  margin: .75rem 0 .25rem;
}

figure.shot img {
  display: block;
  height: auto;
  border: 1px solid var(--shot-border);
  border-radius: 4px;
  background: #fff;
}

figure.shot figcaption {
  font-size: .875rem;
  color: var(--muted);
  margin-top: .35rem;
}

/* ---- 章節尾的回目錄連結 ---- */
.to-toc {
  text-align: right;
  font-size: .875rem;
  margin: -.5rem 0 0;
}

/* ---- 更新資訊 ---- */
.updated {
  text-align: center;
  color: var(--muted);
  font-size: .875rem;
  margin-top: -1.25rem;
}

@media (max-width: 600px) {
  ol.steps > li {
    padding-left: 2.4rem;
  }
  table.settings th,
  table.settings td {
    padding: .5rem .65rem;
  }
}
