/*
Theme Name: Richwinner (Twenty Twenty-Two Child)
Theme URI: https://richwinner.com
Description: Richwinner 設計系統子主題 — Stripe 風格的色票、字級與元件樣式。版面沿用 Twenty Twenty-Two，只覆寫全域 token 與首頁段落樣式。
Author: Richwinner
Template: twentytwentytwo
Version: 1.0.6
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: richwinner-child
*/

/* ─────────────────────────────────────────────────────────────────────
   顏色 / 陰影 / 圓角全部取自 theme.json 的 settings.custom.rw，
   WordPress 會產生 --wp--custom--rw--* 變數，這裡只引用、不重新定義。
   ───────────────────────────────────────────────────────────────────── */

/* ── 全域微調（全站生效，但只動字重與間距，不動版面） ─────────────── */
body {
  /* 中文沒有真正的 Light 字重，300 只能讓瀏覽器合成細字，看起來灰又糊；
     -webkit-font-smoothing: antialiased 又會在 Windows 關掉 ClearType
     次像素反鋸齒，把「糊」放大。兩者都不要。 */
  font-weight: 400;
  line-height: 1.6; /* 中文行高；Stripe 的 1.40 是為拉丁字設計 */
}

.wp-site-blocks h1,
.wp-site-blocks h2,
.wp-site-blocks h3 {
  font-weight: 500;
  letter-spacing: 0; /* 漢字不吃負字距：擠在一起會顯得糊 */
}

.wp-site-blocks p {
  line-height: 1.6;
}

/* 父主題（Twenty Twenty-Two）產生的全域樣式會印在子主題 stylesheet 之後，
   裡面同樣有 body { -webkit-font-smoothing: antialiased }；用高一階的
   specificity 才能蓋回來（auto = 用系統預設的次像素反鋸齒）。 */
html body {
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

/* ── 首頁容器 ─────────────────────────────────────────────────────── */
.rw-home {
  --rw-gutter: 32px;
  font-family: var(--wp--preset--font-family--body, var(--wp--preset--font-family--system-font));
}

.rw-home > * + * {
  margin-block-start: 0;
}

.rw-home .wp-block-group {
  margin-block-start: 0;
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.rw-hero {
  position: relative;
  padding-block: 72px 0;
  text-align: center;
  overflow: hidden;
}

.rw-hero::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: -180px;
  height: 520px;
  background:
    radial-gradient(560px 300px at 78% 30%, rgba(234, 34, 97, 0.07), transparent 70%),
    radial-gradient(520px 280px at 22% 18%, rgba(249, 107, 238, 0.09), transparent 72%);
  pointer-events: none;
}

.rw-hero > * { position: relative; }

.rw-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 24px;
  padding: 5px 10px;
  border: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
  border-radius: 4px;
  background: #fff;
  color: var(--wp--custom--rw--colors--muted, #64748d);
  font-family: var(--wp--preset--font-family--mono, monospace);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
}

.rw-eyebrow__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wp--custom--rw--colors--success, #15be53);
}

.rw-hero__title {
  max-width: 860px;
  margin: 0 auto;
  font-family: var(--wp--preset--font-family--body, system-ui);
  font-size: clamp(2rem, 4.4vw, 3.5rem);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: 0;
}

.rw-lede {
  max-width: 620px;
  margin: 20px auto 0;
  color: var(--wp--custom--rw--colors--muted, #47556b);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
}

.rw-nb { white-space: nowrap; }

.rw-actions {
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.rw-note {
  margin-top: 12px;
  color: var(--wp--custom--rw--colors--muted, #47556b);
  font-size: 12px;
  font-weight: 400;
}

/* ── 按鈕（覆寫 core/button） ─────────────────────────────────────── */
.rw-home .wp-block-button__link,
.wp-block-button__link {
  border-radius: 4px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  padding: 12px 16px;
  transition: background-color 150ms cubic-bezier(0.2, 0, 0, 1),
              border-color 150ms cubic-bezier(0.2, 0, 0, 1);
}

.rw-btn-primary .wp-block-button__link,
.wp-block-button.is-style-fill .wp-block-button__link {
  background: var(--wp--custom--rw--colors--purple, #533afd);
  color: #fff;
  border: 1px solid transparent;
}

.rw-btn-primary .wp-block-button__link:hover {
  background: var(--wp--custom--rw--colors--purple-hover, #4434d4);
}

.rw-home .is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--wp--custom--rw--colors--purple, #533afd);
  border: 1px solid rgba(83, 58, 253, 0.45);
}

.rw-home .is-style-outline .wp-block-button__link:hover {
  background: rgba(83, 58, 253, 0.05);
}

/* ── 產品預覽卡 ───────────────────────────────────────────────────── */
.rw-preview {
  max-width: 900px;
  margin: 48px auto 0;
  border: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--wp--custom--rw--shadow--raised);
  overflow: hidden;
  text-align: left;
}

.rw-preview__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
  background: var(--wp--custom--rw--colors--surface, #f6f9fc);
}

.rw-preview__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d7dee8;
}

.rw-preview__path {
  margin-left: 8px;
  min-width: 0;
  font-family: var(--wp--preset--font-family--mono, monospace);
  font-size: 12px;
  color: var(--wp--custom--rw--colors--muted, #64748d);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rw-preview__body { padding: 20px 24px 24px; }

.rw-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.rw-stat__label {
  color: var(--wp--custom--rw--colors--muted, #64748d);
  font-size: 12px;
}

.rw-stat__value {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.22px;
  font-variant-numeric: tabular-nums;
}

.rw-stat__delta {
  margin-top: 2px;
  color: var(--wp--custom--rw--colors--success, #15be53);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.rw-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 84px;
  margin-top: 20px;
  padding-top: 8px;
  border-top: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
}

.rw-chart__bar {
  flex: 1;
  border-radius: 1px 1px 0 0;
  background: #e9eff6;
}

.rw-chart__bar--now { background: var(--wp--custom--rw--colors--purple, #533afd); }

.rw-rows {
  margin-top: 20px;
  border-top: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
}

.rw-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 0.9fr;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
  font-size: 14px;
}

.rw-row:last-child { border-bottom: 0; }

.rw-row__date {
  color: var(--wp--custom--rw--colors--muted, #64748d);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.rw-badge {
  justify-self: start;
  padding: 1px 6px;
  border: 1px solid;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.6;
}

.rw-badge--ok {
  background: rgba(21, 190, 83, 0.2);
  border-color: rgba(21, 190, 83, 0.4);
  color: #108c3d;
}

.rw-badge--wait {
  background: var(--wp--custom--rw--colors--surface, #f6f9fc);
  border-color: var(--wp--custom--rw--colors--border, #e5edf5);
  color: var(--wp--custom--rw--colors--muted, #64748d);
}

.rw-badge--off {
  background: rgba(234, 34, 97, 0.12);
  border-color: rgba(234, 34, 97, 0.3);
  color: var(--wp--custom--rw--colors--ruby, #ea2261);
}

/* ── 社會證明 ─────────────────────────────────────────────────────── */
.rw-logos {
  padding-block: 48px;
  border-bottom: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
  text-align: center;
}

.rw-logos__label {
  color: var(--wp--custom--rw--colors--muted, #64748d);
  font-size: 12px;
}

.rw-logos__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-top: 20px;
}

.rw-logos__item {
  color: var(--wp--custom--rw--colors--label, #273951);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.08em;
  opacity: 0.55;
}

/* ── 段落 ─────────────────────────────────────────────────────────── */
.rw-section { padding-block: 72px 0; }

.rw-section__head { max-width: 640px; }

.rw-section__title {
  margin: 0;
  font-family: var(--wp--preset--font-family--body, system-ui);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0;
}

.rw-section__lede {
  margin-top: 12px;
  color: var(--wp--custom--rw--colors--muted, #47556b);
  font-size: 16px;
  font-weight: 400;
}

/* ── 功能格 ───────────────────────────────────────────────────────── */
.rw-features {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.rw-features .wp-block-column { margin: 0; }

.rw-feature__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
  border-radius: 6px;
  background: var(--wp--custom--rw--colors--surface, #f6f9fc);
  color: var(--wp--custom--rw--colors--label, #273951);
}

.rw-feature__title {
  margin: 16px 0 0;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.3;
}

.rw-feature__body {
  margin-top: 8px;
  color: var(--wp--custom--rw--colors--muted, #47556b);
  font-size: 16px;
  font-weight: 400;
}

/* ── 深色段 ───────────────────────────────────────────────────────── */
.rw-band {
  margin-block-start: 72px !important;
  padding-block: 72px;
  padding-inline: 48px;
  border-radius: 8px;
  background: var(--wp--custom--rw--colors--deep, #1c1e54);
  color: #fff;
}

.rw-band .rw-section__title,
.rw-band h2 { color: #fff; max-width: 720px; }

.rw-band__lede {
  max-width: 620px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  font-weight: 300;
}

.rw-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.rw-metric__value {
  font-size: 48px;
  font-weight: 400;
  letter-spacing: -0.5px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.rw-metric__label {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
}

/* ── 程式碼段 ─────────────────────────────────────────────────────── */
.rw-code-wrap {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 48px;
}

.rw-code {
  border: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
  border-radius: 8px;
  background: var(--wp--custom--rw--colors--surface, #f6f9fc);
  box-shadow: var(--wp--custom--rw--shadow--raised);
  overflow: auto;
}

.rw-code__head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
  font-family: var(--wp--preset--font-family--mono, monospace);
  font-size: 12px;
  color: var(--wp--custom--rw--colors--muted, #64748d);
}

.rw-code__body {
  margin: 0;
  padding: 16px 20px;
  font-family: var(--wp--preset--font-family--mono, monospace);
  font-size: 12px;
  font-weight: 500;
  line-height: 2;
  color: var(--wp--custom--rw--colors--label, #273951);
  white-space: pre;
  overflow-x: auto;
}

.rw-code__key { color: var(--wp--custom--rw--colors--purple, #533afd); }
.rw-code__str { color: #108c3d; }
.rw-code__cmt { color: var(--wp--custom--rw--colors--muted, #64748d); }

/* ── 定價 ─────────────────────────────────────────────────────────── */
.rw-prices {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.rw-price {
  padding: 20px;
  border: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
  border-radius: 6px;
  background: #fff;
}

.rw-price--featured {
  border-color: rgba(83, 58, 253, 0.45);
  box-shadow: var(--wp--custom--rw--shadow--raised);
}

.rw-price__tier {
  margin: 0;
  color: var(--wp--custom--rw--colors--label, #273951);
  font-size: 14px;
  font-weight: 400;
}

.rw-price__amount {
  margin: 8px 0 0;
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.64px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.rw-price__period {
  font-size: 12px;
  color: var(--wp--custom--rw--colors--muted, #64748d);
  letter-spacing: 0;
}

.rw-price__list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.rw-price__list li {
  color: var(--wp--custom--rw--colors--muted, #64748d);
  font-size: 14px;
  font-weight: 300;
}

.rw-price__list li::before {
  content: "—  ";
  color: #cbd6e2;
}

.rw-more {
  margin-top: 24px;
  font-size: 14px;
}

.rw-more a,
.rw-link {
  color: var(--wp--custom--rw--colors--purple, #533afd);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.rw-more a:hover,
.rw-link:hover { border-bottom-color: currentColor; }

/* ── 引言 ─────────────────────────────────────────────────────────── */
.rw-quote {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr);
  gap: 32px;
  align-items: center;
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
}

.rw-quote__text {
  font-size: 22px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
}

.rw-quote__who {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.rw-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
  background: var(--wp--custom--rw--colors--surface, #f6f9fc);
  font-size: 12px;
}

.rw-quote__name { font-size: 14px; font-weight: 400; }
.rw-quote__role { font-size: 12px; font-weight: 400; color: var(--wp--custom--rw--colors--muted, #47556b); }

/* ── 收尾 CTA ─────────────────────────────────────────────────────── */
.rw-final {
  margin-top: 72px;
  padding-block: 64px;
  border-top: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
  text-align: center;
}

.rw-final .rw-section__title { margin-inline: auto; max-width: 620px; }

/* ── 2026-11-26 首頁改版：AI 客服優先 ─────────────────────────────── */
.rw-hero--compact { padding-block: 48px 0; }

.rw-hero--compact .rw-hero__title {
  font-size: clamp(1.85rem, 3.6vw, 2.75rem);
  max-width: 780px;
  line-height: 1.18;
}

.rw-note a {
  color: var(--wp--custom--rw--colors--purple, #533afd);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rw-section .rw-band { margin-block-start: 32px !important; }

.rw-band__eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.85);
}

.rw-band__points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.rw-band__points span {
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.rw-band .rw-actions { margin-top: 28px; justify-content: flex-start; }

.rw-btn-inverse .wp-block-button__link {
  background: #fff;
  border: 1px solid #fff;
  color: var(--wp--custom--rw--colors--deep, #1c1e54);
}

.rw-btn-inverse .wp-block-button__link:hover { background: rgba(255, 255, 255, 0.88); }

.rw-btn-ghost-light .wp-block-button__link {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
}

.rw-btn-ghost-light .wp-block-button__link:hover { background: rgba(255, 255, 255, 0.08); }

/* ── 會員流程頁（登入／註冊／補齊資料／訂閱／付款／付款結果）──────────────
   同一個版型：隱藏頁面大標題與其 wide 分隔線，把 32px spacer 縮小。
   851 會員登入的卡片本身已有「會員登入」標題，853/855 顯示 PMM 訊息。 */
body.page-id-851 .wp-block-post-title,
body.page-id-853 .wp-block-post-title,
body.page-id-855 .wp-block-post-title { display: none !important; }

body.page-id-851 .wp-block-post-title + .wp-block-separator,
body.page-id-853 .wp-block-post-title + .wp-block-separator,
body.page-id-855 .wp-block-post-title + .wp-block-separator { display: none !important; }

/* 857 訂閱方案／859 付款／861 付款結果：內容沒有其他頁面標題，
   保留小標題（20px）以免只剩一行訊息，失去上下文。 */
body.page-id-857 .wp-block-post-title,
body.page-id-859 .wp-block-post-title,
body.page-id-861 .wp-block-post-title {
  font-size: 20px !important;
  line-height: 1.3;
  margin-bottom: 8px !important;
}

body.page-id-857 .wp-block-post-title + .wp-block-separator,
body.page-id-859 .wp-block-post-title + .wp-block-separator,
body.page-id-861 .wp-block-post-title + .wp-block-separator { margin-block: 0 8px; }

body.page-id-851 .wp-block-spacer,
body.page-id-853 .wp-block-spacer,
body.page-id-855 .wp-block-spacer,
body.page-id-857 .wp-block-spacer,
body.page-id-859 .wp-block-spacer,
body.page-id-861 .wp-block-spacer { height: 8px !important; }

body.page-id-851 .pmm-login-page {
  max-width: 440px;
  margin: 8px auto 24px;
}

body.page-id-851 .pmm-login-page .pmm-login-card {
  padding: 24px;
  border-radius: 16px;
}

body.page-id-851 .pmm-login-page .pmm-login-title { font-size: 20px; }

/* ── 響應式 ───────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .rw-features,
  .rw-prices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rw-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rw-code-wrap,
  .rw-quote { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

@media (max-width: 781px) {
  .rw-hero { padding-block: 48px 0; }
  .rw-section { padding-block: 40px 0; }
  .rw-band { margin-top: 48px; padding-block: 48px; }
  .rw-final { margin-top: 48px; padding-block: 48px; }
  .rw-features,
  .rw-prices,
  .rw-metrics { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .rw-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rw-stats .rw-stat:last-child { display: none; }
  .rw-row { grid-template-columns: 1.4fr 1fr; }
  .rw-row__date { display: none; }
  .rw-quote { margin-top: 48px; padding-top: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .rw-home *,
  .rw-home *::before,
  .rw-home *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ── Header（覆寫 TT2 預設 header part） ─────────────────────────── */
.rw-header {
  position: sticky;
  top: 0;
  z-index: 30;
  margin-block-start: 0 !important;
  padding-block: 0;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
}

.rw-header > .wp-block-group {
  min-height: 64px;
  align-items: center;
  gap: 24px;
}

.rw-header .rw-brand {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.32px;
  line-height: 1.2;
}

.rw-header .rw-brand a {
  color: var(--wp--custom--rw--colors--ink, #061b31);
  text-decoration: none;
  font-style: normal;
}

.rw-header .rw-nav a {
  color: var(--wp--custom--rw--colors--ink, #061b31);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
}

.rw-header .rw-nav a:hover { color: var(--wp--custom--rw--colors--purple, #533afd); }

.rw-header__actions { gap: 8px; }

.rw-header__actions .wp-block-button__link {
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.2;
}

.rw-btn-quiet .wp-block-button__link {
  background: transparent;
  color: var(--wp--custom--rw--colors--ink, #061b31);
  border: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
}

.rw-btn-quiet .wp-block-button__link:hover { border-color: var(--wp--custom--rw--colors--ink, #061b31); }

/* ── Footer ──────────────────────────────────────────────────────── */
.rw-footer {
  margin-block-start: 0;
  padding-block: 48px 0;
  border-top: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
}

.rw-footer__grid { gap: 32px; }

.rw-footer__brand {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0;
}

.rw-footer__brand a { font-style: normal; }

.rw-footer__brand a { color: var(--wp--custom--rw--colors--ink, #061b31); text-decoration: none; }

.rw-footer__tagline {
  margin-top: 12px;
  max-width: 30ch;
  color: var(--wp--custom--rw--colors--muted, #47556b);
  font-size: 14px;
  font-weight: 400;
}

.rw-footer__title {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--wp--custom--rw--colors--ink, #061b31);
}

.rw-footer__link { margin: 8px 0 0; line-height: 1.5; }

.rw-footer__link a {
  color: var(--wp--custom--rw--colors--muted, #47556b);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
}

.rw-footer__link a:hover { color: var(--wp--custom--rw--colors--ink, #061b31); }

.rw-footer__bottom {
  margin-top: 32px;
  padding-block: 20px;
  border-top: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
  color: var(--wp--custom--rw--colors--muted, #64748d);
  font-size: 12px;
}

.rw-footer__bottom p { margin: 0; font-size: 12px; }
.rw-footer__legal a { color: inherit; text-decoration: none; }
.rw-footer__legal a:hover { color: var(--wp--custom--rw--colors--ink, #061b31); }

@media (max-width: 781px) {
  .rw-header .rw-nav { display: none; }
  .rw-footer { margin-block-start: 48px; }
  .rw-footer__grid { flex-direction: column; gap: 24px; }
  .rw-footer__grid .wp-block-column { flex-basis: auto !important; }
}

/* 深色段落內的子區塊靠左（WP 的 constrained layout 會自動置中） */
.rw-band > * { margin-inline: 0 !important; }

/* 段落標題靠左對齊（WP 的 constrained group 會自動置中） */
.rw-section > .rw-section__title,
.rw-section > .rw-section__lede,
.rw-section > .rw-more {
  max-width: 640px !important;
  margin-inline: 0 !important;
}

/* 定價卡：直接給欄位上外框（內容用原生 list/paragraph，編輯器仍可改） */
.rw-prices > .wp-block-column {
  padding: 20px;
  border: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
  border-radius: 6px;
  background: #fff;
}

.rw-prices > .wp-block-column:nth-child(2) {
  border-color: rgba(83, 58, 253, 0.45);
  box-shadow: var(--wp--custom--rw--shadow--raised);
}

.rw-prices .rw-price__amount { margin-bottom: 0; }
.rw-prices .rw-price__list { margin-top: 16px; }

/* 手機 header：品牌與按鈕維持同一列，避免「免費開始」掉到第二行 */
@media (max-width: 781px) {
  .rw-header > .wp-block-group {
    flex-wrap: nowrap !important;
    gap: 8px;
  }

  .rw-header .rw-brand {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 16px;
  }

  .rw-header .rw-brand a {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .rw-header__actions {
    flex-wrap: nowrap !important;
    flex: none;
  }

  .rw-header__actions .wp-block-button__link {
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap;
  }
}

/* 極窄螢幕：登入按鈕收起來，只留主要 CTA */
@media (max-width: 480px) {
  .rw-header .rw-btn-quiet { display: none; }
}


/* ── PMM 表單外觀修正 ──────────────────────────────────────────────
   GoDaddy 的 wp-site-designer-contrast-fallback 會對
   body .wp-site-blocks input 注入 border:1px solid color-mix(...)，
   但 TT2 色票沒有 base/contrast 這兩個 slug，color-mix 解析失敗 →
   整條 border 失效，登入框看起來像沒有框線。這裡明確補回來。 */
body .wp-site-blocks .pmm-form-row input[type="text"],
body .wp-site-blocks .pmm-form-row input[type="email"],
body .wp-site-blocks .pmm-form-row input[type="password"],
body .wp-site-blocks .pmm-login-form input.input {
  width: 100% !important;
  max-width: 100%;
  padding: 12px 14px !important;
  border: 1px solid #8fa3b8 !important;
  box-shadow: inset 0 1px 2px rgba(6, 27, 49, 0.06) !important;
  border-radius: 4px !important;
  background: #fff !important;
  color: #061b31 !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
}

body .wp-site-blocks .pmm-form-row input:focus,
body .wp-site-blocks .pmm-login-form input.input:focus {
  border-color: #533afd !important;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
}

body .wp-site-blocks .pmm-login-form .submit {
  margin-top: 20px;
}

body .wp-site-blocks .pmm-login-form input[type="submit"],
body .wp-site-blocks .pmm-login-form button[type="submit"],
body .wp-site-blocks .pmm-form-row input[type="submit"],
body .wp-site-blocks .pmm-form-row button[type="submit"] {
  width: auto !important;
  min-width: 120px;
  padding: 12px 20px !important;
  background: #533afd !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 4px !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  cursor: pointer;
}

body .wp-site-blocks .pmm-login-form input[type="submit"]:hover,
body .wp-site-blocks .pmm-login-form button[type="submit"]:hover {
  background: #4434d4 !important;
}

body .wp-site-blocks .pmm-form-row label {
  display: inline-block;
  margin-bottom: 6px;
  font-weight: 400;
}

body .wp-site-blocks .pmm-form-row {
  margin: 0 0 16px;
}


/* ── 一般表單控制項（Contact Form 7／留言／搜尋）─────────────────────
   同一個 GoDaddy 注入的 color-mix() 宣告會讓所有 input 變成
   無邊框＋透明背景（base/contrast 這兩個色票在 TT2 子主題不存在）。
   上面那段只補了 PMM 的登入與表單，站上其他表單（CF7）一樣會壞。 */
body .wp-site-blocks input:not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]):not([type="color"]),
body .wp-site-blocks textarea,
body .wp-site-blocks select {
  box-sizing: border-box;
  width: 100%;
  padding: 10px 12px !important;
  border: 1px solid #8fa3b8 !important;
  box-shadow: inset 0 1px 2px rgba(6, 27, 49, 0.06) !important;
  border-radius: 6px !important;
  background: #fff !important;
  color: #061b31 !important;
  font-size: 16px !important;
  line-height: 1.4 !important;
}

body .wp-site-blocks input:not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="range"]):not([type="color"]):focus,
body .wp-site-blocks textarea:focus,
body .wp-site-blocks select:focus {
  border-color: #533afd !important;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(83, 58, 253, 0.15);
}

body .wp-site-blocks input[type="submit"],
body .wp-site-blocks button[type="submit"] {
  width: auto;
  padding: 12px 20px !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: #533afd !important;
  color: #fff !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
  cursor: pointer;
}

body .wp-site-blocks input[type="submit"]:hover,
body .wp-site-blocks button[type="submit"]:hover {
  background: #4434d4 !important;
}

/* Contact Form 7：標籤與欄位節奏 */
body .wp-site-blocks .wpcf7 p { margin: 0 0 16px; }
body .wp-site-blocks .wpcf7 label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 400; color: #273951; }
body .wp-site-blocks .wpcf7 textarea.wpcf7-form-control { min-height: 160px; resize: vertical; }


/* ── 短碼輸出的版面（原本靠 WP 區塊的 is-layout-flex 行內樣式）── */
.rw-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

/* 首頁內容最上方的主選單（[rw_main_menu] 即時讀 WP「主選單」） */
.rw-main-menu-bar {
  max-width: 1080px;
  margin: 12px auto 0;
  padding: 0 24px;
}

.rw-main-menu {
  justify-content: center;
  gap: 20px;
  font-size: 14px;
}

.rw-main-menu .rw-nav__link {
  color: var(--wp--custom--rw--colors--muted, #47556b);
  text-decoration: none;
}

.rw-main-menu .rw-nav__link:hover {
  color: var(--wp--custom--rw--colors--purple, #533afd);
}

.rw-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.rw-header__actions .wp-block-button {
  margin: 0;
}

.rw-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.rw-actions .wp-block-button {
  margin: 0;
}

.rw-footer__title + .rw-footer__link { margin-top: 12px; }

@media (max-width: 781px) {
  .rw-nav { gap: 16px; }
  .rw-actions { gap: 10px; margin-top: 24px; }
}

/* ── 2026-11 網站改版：公司首頁與 AI 客服頁 ─────────────────────── */
.rw-surface {
  background: var(--wp--custom--rw--colors--surface, #f6f9fc);
  border-block: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
  margin-block-start: 72px !important; /* 色塊上方的卡片不要貼在色塊邊線上（.rw-home .wp-block-group 會把 margin 歸零） */
  padding-block: 64px;
}

.rw-grid { display: grid; gap: 24px; margin-top: 32px; }
.rw-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rw-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rw-grid--tight { margin-top: 24px; }

.rw-card {
  border: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
  border-radius: 6px;
  background: #fff;
  padding: 20px;
}

.rw-card--accent {
  border-color: rgba(83, 58, 253, 0.45);
  box-shadow: var(--wp--custom--rw--shadow--raised);
}

.rw-card--plain { background: transparent; }

.rw-card__num {
  font-family: var(--wp--preset--font-family--mono, monospace);
  font-size: 12px;
  color: var(--wp--custom--rw--colors--muted, #64748d);
}

.rw-card__title {
  margin: 8px 0 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
}

.rw-card__body {
  margin-top: 8px;
  color: var(--wp--custom--rw--colors--muted, #47556b);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
}

.rw-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.rw-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; white-space: nowrap; }
.rw-tag--live { background: rgba(21, 190, 83, 0.12); border: 1px solid rgba(21, 190, 83, 0.35); color: #108c3d; }
.rw-tag--dev { background: var(--wp--custom--rw--colors--surface, #f6f9fc); border: 1px solid var(--wp--custom--rw--colors--border, #e5edf5); color: var(--wp--custom--rw--colors--muted, #64748d); }

.rw-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 6px; }
.rw-list li { font-size: 14px; font-weight: 400; color: var(--wp--custom--rw--colors--muted, #47556b); }

.rw-price-core {
  border: 1px solid rgba(83, 58, 253, 0.45);
  border-radius: 8px;
  box-shadow: var(--wp--custom--rw--shadow--raised);
  padding: 32px;
  background: #fff;
}

.rw-price-tag { font-size: 44px; font-weight: 400; letter-spacing: -0.3px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rw-price-tag small { font-size: 14px; color: var(--wp--custom--rw--colors--muted, #64748d); letter-spacing: 0; }

.rw-addon {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
}
.rw-addon:last-child { border-bottom: 0; }
.rw-addon__name { font-size: 16px; }
.rw-addon__desc { margin-top: 2px; font-size: 12px; color: var(--wp--custom--rw--colors--muted, #64748d); }
.rw-addon__price { white-space: nowrap; font-variant-numeric: tabular-nums; }

.rw-note { margin-top: 12px; color: var(--wp--custom--rw--colors--muted, #64748d); font-size: 12px; }

.rw-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rw-table th, .rw-table td {
  text-align: left; padding: 12px 14px; vertical-align: top;
  border-bottom: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
}
.rw-table th { font-size: 12px; font-weight: 400; color: var(--wp--custom--rw--colors--muted, #64748d); }
.rw-table tr:last-child td { border-bottom: 0; }
.rw-table-wrap { border: 1px solid var(--wp--custom--rw--colors--border, #e5edf5); border-radius: 6px; overflow-x: auto; }

.rw-faq { border-top: 1px solid var(--wp--custom--rw--colors--border, #e5edf5); margin-top: 24px; }
.rw-faq details { border-bottom: 1px solid var(--wp--custom--rw--colors--border, #e5edf5); padding-block: 16px; }
.rw-faq summary { cursor: pointer; font-size: 16px; font-weight: 400; }
.rw-faq p { margin-top: 8px; font-size: 14px; color: var(--wp--custom--rw--colors--muted, #64748d); }

@media (max-width: 1023px) {
  .rw-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rw-surface { padding-block: 48px; }
}

@media (max-width: 781px) {
  .rw-grid--3, .rw-grid--2 { grid-template-columns: minmax(0, 1fr); }
  .rw-price-core { padding: 20px; }
  .rw-surface { padding-block: 40px; }
}

/* ── 產品內頁導覽（不進全站 header） ─────────────────────────── */
.rw-productbar {
  background: #fff;
  border-bottom: 1px solid var(--wp--custom--rw--colors--border, #e5edf5);
}

.rw-productbar__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 32px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.rw-productbar__label {
  color: var(--wp--custom--rw--colors--purple, #533afd);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.rw-productbar nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.rw-productbar a {
  color: var(--wp--custom--rw--colors--ink, #061b31);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
}

.rw-productbar a:hover {
  color: var(--wp--custom--rw--colors--purple, #533afd);
}

.rw-productbar .rw-productbar__cta {
  color: var(--wp--custom--rw--colors--purple, #533afd);
  font-weight: 500;
}

@media (max-width: 700px) {
  .rw-productbar__inner { padding: 10px 16px; gap: 10px 16px; }
  .rw-productbar nav { gap: 14px; }
}

.rw-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  color: var(--wp--custom--rw--colors--purple, #533afd) !important;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.rw-card__cta:hover { border-bottom-color: currentColor; }
.rw-card--product { display: flex; flex-direction: column; }
.rw-card--product .rw-card__cta { margin-top: auto; padding-top: 18px; }
