/*!
 * iWishs SEO Content Strategy 1.6.0 — 文章版面元件＋商品卡片
 *
 * 顏色、圓角都是 CSS 變數，設定頁會輸出 :root{--scs-…}；每個 var() 都有預設值（「用網站自己的顏色」模式就是用預設值）。
 *   --scs-accent        強調色（標題左邊的線、按鈕、勾勾、步驟數字）
 *   --scs-accent-text   按鈕上的字
 *   --scs-deal          特價的價格
 *   --scs-soft          淡底色（重點整理、小提醒、常見問題、行動呼籲）
 *   --scs-border        框線
 *   --scs-text          文字
 *   --scs-muted         次要文字（原價、說明）
 *   --scs-radius        框的圓角          --scs-btn-radius 按鈕的圓角
 *   --scs-fs            文章字的大小（沒設定就跟網站一樣）
 *   --scs-card          商品卡片底色      --scs-note / --scs-note-bg / --scs-note-border「需要注意」的顏色
 *   --scs-card-ratio    商品卡片圖片比例（預設 1 / 1，書這種直式商品設 3 / 4）
 * 網站要改顏色：在自己的 CSS 寫 :root{ --scs-accent:#123456; } 就可以。
 *
 * 元件（.scs-summary、.scs-steps…）不管有沒有包在 .scs-article 裡都有樣式；
 * .scs-article 只負責整篇文章的基本排版（外掛產出的文章，設定頁打開「文章套用外掛排版」才會包）。
 */

/* ── 整篇文章的基本排版 ───────────────────────── */
.scs-article {
  font-size: var(--scs-fs, inherit);
  line-height: 1.85;
  color: var(--scs-text, inherit);
  overflow-wrap: break-word;
}
.scs-article > :first-child { margin-top: 0; }
.scs-article p { margin: 0 0 1.15em; }
.scs-article h2 {
  margin: 2.2em 0 .8em;
  padding: 0 0 0 .7em;
  border-left: 4px solid var(--scs-accent, currentColor);
  font-size: 1.42em;
  line-height: 1.45;
  font-weight: 700;
}
.scs-article h3 {
  margin: 1.7em 0 .6em;
  font-size: 1.18em;
  line-height: 1.5;
  font-weight: 700;
}
.scs-article :where(ul:not([class]), ol:not([class])) { margin: 0 0 1.2em; padding-left: 1.5em; }
.scs-article :where(li) { margin: .35em 0; }
.scs-article :where(ul:not([class])) > li::marker { color: var(--scs-accent, currentColor); }
.scs-article :where(ol:not([class])) > li::marker { color: var(--scs-accent, currentColor); font-weight: 700; }
.scs-article a:not([class]) {
  color: var(--scs-accent, inherit);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.scs-article a:not([class]):hover { text-decoration-thickness: 2px; }
.scs-article strong { font-weight: 700; }
.scs-article img { max-width: 100%; height: auto; border-radius: calc(var(--scs-radius, 12px) * .75); }
.scs-article blockquote {
  margin: 1.4em 0;
  padding: .9em 1.2em;
  border-left: 4px solid var(--scs-border, rgba(127, 127, 127, .25));
  border-radius: 0 var(--scs-radius, 12px) var(--scs-radius, 12px) 0;
  background: var(--scs-soft, rgba(127, 127, 127, .06));
}
.scs-article blockquote > :last-child { margin-bottom: 0; }
.scs-article hr { margin: 2.2em 0; border: 0; border-top: 1px solid var(--scs-border, rgba(127, 127, 127, .22)); }

/* ── 比較表 ─────────────────────────────────── */
.scs-article table,
table.scs-compare {
  width: 100%;
  margin: 1.4em 0 1.7em;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--scs-border, rgba(127, 127, 127, .25));
  border-radius: var(--scs-radius, 12px);
  overflow: hidden;
  font-size: .95em;
  line-height: 1.6;
}
.scs-article table th,
.scs-article table td,
table.scs-compare th,
table.scs-compare td {
  padding: .72em .95em;
  border: 0;
  border-bottom: 1px solid var(--scs-border, rgba(127, 127, 127, .25));
  text-align: left;
  vertical-align: top;
}
.scs-article table thead th,
table.scs-compare thead th {
  background: var(--scs-soft, rgba(127, 127, 127, .06));
  font-weight: 700;
}
.scs-article table tr:last-child > td,
table.scs-compare tr:last-child > td { border-bottom: 0; }
.scs-article table td:first-child,
table.scs-compare td:first-child { font-weight: 600; }

/* ── 重點整理 ───────────────────────────────── */
.scs-summary {
  margin: 1.6em 0 2em;
  padding: 1.15em 1.35em 1em;
  background: var(--scs-soft, rgba(127, 127, 127, .06));
  border: 1px solid var(--scs-border, rgba(127, 127, 127, .22));
  border-radius: var(--scs-radius, 12px);
}
.scs-summary .scs-summary-title {
  margin: 0 0 .5em;
  color: var(--scs-accent, inherit);
  font-size: 1.05em;
  font-weight: 700;
  letter-spacing: .03em;
}
.scs-summary ul,
.scs-summary ol { margin: 0; padding: 0; list-style: none; }
.scs-summary li { position: relative; margin: .4em 0; padding-left: 1.75em; }
.scs-summary li::before {
  content: "";
  position: absolute;
  left: .2em;
  top: .6em;
  width: .85em;
  height: .45em;
  border-left: 2.5px solid var(--scs-accent, currentColor);
  border-bottom: 2.5px solid var(--scs-accent, currentColor);
  transform: rotate(-45deg);
}

/* ── 步驟 ───────────────────────────────────── */
ol.scs-steps {
  margin: 1.3em 0 1.6em;
  padding: 0;
  list-style: none;
  counter-reset: scs-step;
}
ol.scs-steps > li {
  position: relative;
  margin: 0;
  padding: .12em 0 1.15em 3em;
  min-height: 2.2em;
  counter-increment: scs-step;
}
ol.scs-steps > li::before {
  content: counter(scs-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2em;
  height: 2em;
  border-radius: 50%;
  background: var(--scs-accent, #3f3f46);
  color: var(--scs-accent-text, #fff);
  font-weight: 700;
  line-height: 2em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
ol.scs-steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(1em - 1px);
  top: 2.3em;
  bottom: .3em;
  width: 2px;
  border-radius: 2px;
  background: var(--scs-border, rgba(127, 127, 127, .25));
}
ol.scs-steps > li:last-child { padding-bottom: .2em; }

/* ── 小提醒、需要注意 ───────────────────────── */
.scs-tip,
.scs-note {
  margin: 1.4em 0 1.6em;
  padding: .95em 1.2em;
  border: 1px solid;
  border-left-width: 4px;
  border-radius: var(--scs-radius, 12px);
}
.scs-tip {
  background: var(--scs-soft, rgba(127, 127, 127, .06));
  border-color: var(--scs-border, rgba(127, 127, 127, .22));
  border-left-color: var(--scs-accent, currentColor);
}
.scs-note {
  background: var(--scs-note-bg, #fffbeb);
  border-color: var(--scs-note-border, #fde68a);
  border-left-color: var(--scs-note, #d97706);
  color: var(--scs-note-text, #3f3a33);
}
.scs-tip > :last-child,
.scs-note > :last-child { margin-bottom: 0; }
.scs-tip > p:first-child > strong:first-child { color: var(--scs-accent, inherit); }
.scs-note > p:first-child > strong:first-child { color: var(--scs-note, #b45309); }

/* ── 常見問題 ───────────────────────────────── */
.scs-faq {
  margin: 2.2em 0;
  padding: .2em 1.4em 1.1em;
  background: var(--scs-soft, rgba(127, 127, 127, .06));
  border-radius: var(--scs-radius, 12px);
}
.scs-article .scs-faq > h2,
.scs-faq > h2 { margin-top: .9em; }
.scs-faq h3 {
  position: relative;
  margin: 1.2em 0 .4em;
  padding-left: 2.15em;
  font-size: 1.06em;
  line-height: 1.6;
}
.scs-faq h3::before {
  content: "Q";
  position: absolute;
  left: 0;
  top: .12em;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  background: var(--scs-accent, #3f3f46);
  color: var(--scs-accent-text, #fff);
  font-size: .9em;
  font-weight: 700;
  line-height: 1.6em;
  text-align: center;
}
.scs-faq > h3 ~ :not(h3) { margin-left: 2.25em; }
.scs-faq > :last-child { margin-bottom: 0; }

/* ── 行動呼籲 ───────────────────────────────── */
.scs-cta {
  margin: 2.4em 0 1.8em;
  padding: 1.6em 1.4em;
  text-align: center;
  background: var(--scs-soft, rgba(127, 127, 127, .06));
  border: 1px solid var(--scs-border, rgba(127, 127, 127, .22));
  border-radius: var(--scs-radius, 12px);
}
.scs-cta > p { margin: 0 0 1em; font-size: 1.06em; font-weight: 600; }
.scs-cta > p:last-child { margin-bottom: 0; }
.scs-cta a.scs-cta-btn {
  display: inline-block;
  padding: .78em 2.1em;
  border-radius: var(--scs-btn-radius, 999px);
  background: var(--scs-accent, #3f3f46);
  color: var(--scs-accent-text, #fff);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .45);
  transition: transform .15s ease, filter .15s ease;
}
.scs-cta a.scs-cta-btn:hover,
.scs-cta a.scs-cta-btn:focus-visible {
  color: var(--scs-accent-text, #fff);
  text-decoration: none;
  filter: brightness(.94);
  transform: translateY(-1px);
}

/* ── 文末商品卡片（[scs_products]） ───────────── */
.scs-product-showcase {
  margin: 2.6em 0 1.4em;
  padding-top: 1.8em;
  border-top: 1px solid var(--scs-border, rgba(127, 127, 127, .22));
}
.scs-product-showcase .scs-ps-title {
  margin: 0 0 .3em;
  padding: 0;
  border: 0;
  font-size: 1.35em;
  line-height: 1.4;
  text-align: center;
}
.scs-product-showcase .scs-ps-sub {
  margin: 0 0 1.3em;
  color: var(--scs-muted, #6b7280);
  font-size: .9em;
  text-align: center;
}
.scs-ps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 18px;
}
/* 只有 1、2 個商品時不要撐滿整排（卡片會太大），置中 */
.scs-ps-grid.scs-ps-n1 { grid-template-columns: minmax(0, 260px); justify-content: center; }
.scs-ps-grid.scs-ps-n2 { grid-template-columns: repeat(2, minmax(0, 260px)); justify-content: center; }
.scs-pcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--scs-card, #fff);
  color: var(--scs-text, #222);
  border: 1px solid var(--scs-border, rgba(127, 127, 127, .22));
  border-radius: var(--scs-radius, 12px);
  line-height: 1.5;
  transition: box-shadow .2s ease, transform .2s ease;
}
.scs-pcard:hover { box-shadow: 0 12px 26px -14px rgba(0, 0, 0, .3); transform: translateY(-2px); }
.scs-pcard-media { position: relative; }
.scs-product-showcase .scs-pcard-img {
  display: block;
  aspect-ratio: var(--scs-card-ratio, 1 / 1);
  overflow: hidden;
  background: var(--scs-soft, rgba(127, 127, 127, .06));
}
.scs-product-showcase .scs-pcard-img img,
.scs-product-showcase .scs-pcard-photo {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  border-radius: 0;
}
.scs-product-showcase .scs-pcard-photo-empty {
  background: linear-gradient(135deg, var(--scs-soft, #f4f4f5), var(--scs-border, #e4e4e7));
}
.scs-pcard-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--scs-accent, #3f3f46);
  color: var(--scs-accent-text, #fff);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
}
.scs-pcard-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
}
.scs-product-showcase .scs-pcard-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}
.scs-product-showcase .scs-pcard-name a {
  display: -webkit-box;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.scs-product-showcase .scs-pcard-name a:hover { color: var(--scs-accent, inherit); }
.scs-pcard-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
}
.scs-pcard-reg { color: var(--scs-muted, #6b7280); font-size: 13px; text-decoration: line-through; }
.scs-pcard-now { color: var(--scs-deal, inherit); font-size: 18px; font-weight: 700; }
.scs-product-showcase a.scs-pcard-btn {
  display: block;
  margin-top: auto;
  padding: 9px 12px;
  border-radius: var(--scs-btn-radius, 999px);
  background: var(--scs-accent, #3f3f46);
  color: var(--scs-accent-text, #fff);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  transition: filter .15s ease;
}
.scs-product-showcase a.scs-pcard-btn:hover,
.scs-product-showcase a.scs-pcard-btn:focus-visible {
  color: var(--scs-accent-text, #fff);
  text-decoration: none;
  filter: brightness(.94);
}

/* ── 文章列表（[scs_article_list]，1.5.1 併進來） ─ */
.scs-article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
}
a.scs-al-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--scs-card, #fff);
  color: var(--scs-text, inherit);
  border: 1px solid var(--scs-border, rgba(127, 127, 127, .22));
  border-radius: var(--scs-radius, 12px);
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
a.scs-al-card:hover {
  border-color: var(--scs-accent, rgba(127, 127, 127, .5));
  box-shadow: 0 4px 14px -8px rgba(0, 0, 0, .25);
  color: var(--scs-text, inherit);
  text-decoration: none;
}
.scs-al-thumb {
  flex: 0 0 110px;
  width: 110px;
  height: 148px;
  overflow: hidden;
  border-radius: calc(var(--scs-radius, 12px) * .6);
  background: var(--scs-soft, rgba(127, 127, 127, .06));
}
.scs-al-thumb img { display: block; width: 100%; height: 100%; margin: 0; object-fit: cover; }
.scs-al-no-img { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 32px; opacity: .35; }
.scs-al-body { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.scs-al-title {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.scs-al-excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--scs-muted, #64748b);
  font-size: 14px;
  line-height: 1.6;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.scs-al-meta { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 8px; color: var(--scs-muted, #94a3b8); font-size: 12px; }
.scs-al-tag {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--scs-soft, rgba(127, 127, 127, .08));
  color: var(--scs-accent, inherit);
  font-weight: 600;
}
.scs-al-empty { padding: 40px 0; color: var(--scs-muted, #9ca3af); text-align: center; }

/* ── 手機 ───────────────────────────────────── */
@media (max-width: 560px) {
  .scs-article h2 { font-size: 1.3em; }
  .scs-summary,
  .scs-faq,
  .scs-cta { padding-left: 1.05em; padding-right: 1.05em; }
  .scs-faq > h3 ~ :not(h3) { margin-left: 0; }
  .scs-ps-grid,
  .scs-ps-grid.scs-ps-n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .scs-pcard-body { padding: 10px 10px 12px; }
  .scs-product-showcase .scs-pcard-name { font-size: 14px; }
  .scs-pcard-now { font-size: 16px; }
  a.scs-al-card { flex-direction: column; gap: 12px; }
  .scs-al-thumb { flex: 0 0 auto; width: 100%; height: 180px; }
  .scs-article table th,
  .scs-article table td,
  table.scs-compare th,
  table.scs-compare td { padding: .6em .7em; }
}

@media (prefers-reduced-motion: reduce) {
  .scs-pcard,
  .scs-cta a.scs-cta-btn { transition: none; }
  .scs-pcard:hover,
  .scs-cta a.scs-cta-btn:hover { transform: none; }
}

/* ================================================================
 * 1.8.0 AI 搜尋：開頭直接回答、品牌框、參考資料
 * ================================================================ */
.scs-answer {
    margin: 0 0 1.2em;
    padding: .85em 1.1em;
    border-left: 4px solid var(--scs-accent, #2563eb);
    background: var(--scs-soft, #f5f7fb);
    border-radius: 0 var(--scs-radius, 10px) var(--scs-radius, 10px) 0;
    font-size: 1.05em;
    line-height: 1.75;
}
.scs-brand-box {
    margin: 2em 0 1.5em;
    padding: 1.1em 1.25em;
    border: 1px solid var(--scs-border, #e5e7eb);
    border-radius: var(--scs-radius, 10px);
    background: var(--scs-soft, #f9fafb);
}
.scs-brand-box .scs-brand-title { margin: 0 0 .4em; font-weight: 700; font-size: 1.05em; color: var(--scs-text, inherit); }
.scs-brand-box .scs-brand-intro { margin: 0 0 .5em; color: var(--scs-text, inherit); }
.scs-brand-box .scs-brand-points { margin: 0 0 .5em; padding-left: 1.2em; color: var(--scs-muted, #4b5563); }
.scs-brand-box .scs-brand-points li { margin: .2em 0; }
.scs-brand-box .scs-brand-more { margin: 0; }
.scs-brand-box .scs-brand-more a { color: var(--scs-accent, #2563eb); font-weight: 600; text-decoration: none; }
.scs-brand-box .scs-brand-more a:hover { text-decoration: underline; }
.scs-sources { margin: 2em 0 1em; font-size: .9em; color: var(--scs-muted, #6b7280); }
.scs-sources .scs-sources-title { margin: 0 0 .3em; font-weight: 700; }
.scs-sources ul { margin: 0; padding-left: 1.2em; }
.scs-sources li { margin: .15em 0; word-break: break-all; }
.scs-sources a { color: inherit; }
