
/* =======================================================================
   Engineer Tsai – Clean CSS (Astra-safe, v2025-11-24 clean)
   - Single source of truth / no duplicates
   - Query Loop safe（不動全域 flex）
   - Media-card 只在 .et-latest 啟用
   ======================================================================= */

/* ---------- Design Tokens ---------- */
:root{
  --et-accent:#2563EB;
  --et-accent-600:#1D4ED8;
  --et-ink:#0F172A;
  --et-body:#475569;
  --et-muted:#64748B;
  --et-line:#E2E8F0;
  --et-bg:#F8FAFC;
  --et-card:#FFFFFF;

  --et-radius:16px;
  --et-radius-sm:12px;
  --et-shadow:0 6px 18px rgba(2,6,23,.08);
  --et-shadow-hover:0 10px 24px rgba(2,6,23,.12);

  /* WooCommerce 主色同步 */
  --wc-color-primary:var(--et-accent);

  /* FAB */
  --et-fab-size:42px;
  --et-fab-icon:16px;
  --et-fab-gap:60px;
}

/* =======================================================================
   Base / Layout
   ======================================================================= */
body{background:#fff;color:var(--et-ink);}
a{color:var(--et-accent);}
a:hover{color:var(--et-accent-600);}
.entry-content{line-height:1.75;font-size:17.5px;}
.entry-content p{color:var(--et-body);line-height:1.85;}
.entry-content h1,
.entry-content h2,
.entry-content h3{color:var(--et-ink);letter-spacing:-.01em}

/* Astra 容器寬度 */
.container,.site-container,.entry-content{max-width:1100px;margin-inline:auto;}
.ast-container{max-width:1200px;}
.site-header,
.ast-above-header-wrap,
.ast-primary-header-bar{border-bottom:1px solid #E5E7EB;}
.home .entry-title{display:none;}

/* =======================================================================
   Buttons（僅內容區，避免影響 Header）
   ======================================================================= */
.site-main .wp-block-button__link,
.site-main .ast-button,
.site-main .button,
.btn{
  background:var(--et-accent);
  color:#fff!important;
  border:none;
  border-radius:12px;
  padding:.75rem 1rem;
  font-weight:600;
  box-shadow:0 8px 24px rgba(37,99,235,.18);
}
.site-main .wp-block-button__link:hover,
.site-main .ast-button:hover,
.btn:hover{
  background:var(--et-accent-600);
  filter:brightness(.98);
}

/* Outline 變體 */
.site-main .wp-block-button.is-style-outline > .wp-block-button__link,
.btn-outline{
  color:var(--et-accent)!important;
  background:transparent!important;
  border:2px solid var(--et-accent)!important;
  border-radius:12px!important;
  padding:.65rem 1rem;
  box-shadow:none;
}
.site-main .wp-block-button.is-style-outline > .wp-block-button__link:hover,
.btn-outline:hover{
  color:var(--et-accent-600)!important;
  border-color:var(--et-accent-600)!important;
  background:#EFF6FF!important;
}

/* =======================================================================
   Sections / Titles
   ======================================================================= */
.section,.et-section{padding-block:56px;}
.section h2,.et-section h2{margin-bottom:16px;}
.section-title{position:relative;margin:24px 0 12px;}
.section-title:after{
  content:"";
  display:block;
  width:64px;
  height:3px;
  background:var(--et-accent);
  margin-top:8px;
  border-radius:3px;
}
.entry-content .wp-block-columns{gap:1rem}
.entry-content .wp-block-buttons{gap:.6rem}

/* =======================================================================
   Hero（封面區）
   ======================================================================= */

/* 封面遮罩 */
.wp-block-cover .wp-block-cover__background{
  opacity:.55!important;
  background-color:rgba(15,23,42,.75)!important;
  pointer-events:none!important;
}

/* Hero 文字基礎色與陰影 */
.wp-block-cover.hero-wrap .wp-block-cover__inner-container h1,
.wp-block-cover.hero-wrap .wp-block-cover__inner-container p{
  color:#fff;
  text-shadow:0 2px 8px rgba(0,0,0,.55);
}

/* Hero 內文容器寬度與位置（只對 .hero-wrap 生效） */
.hero-wrap .wp-block-cover__inner-container{
  max-width:640px;
  margin-left:6%;
}

/* Hero 小眉標 */
.hero-eyebrow{
  font-size:13px;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:#E2E8F0;
  opacity:.9;
  margin:0 0 6px;
}

/* Hero 標題與說明 */
.hero-title{
  color:#fff!important;
  font-size:clamp(28px,3vw,34px);
  line-height:1.3;
  margin:0 0 12px;
}
.hero-sub{
  color:#E2E8F0!important;
  max-width:540px;
  line-height:1.9;
  margin:0 0 16px;
}
.hero-credit{
  color:#E2E8F0!important;
  font-size:14px;
  opacity:.75;
  margin:0 0 20px;
}

/* CTA 群組 */
.hero-wrap .wp-block-buttons{
  gap:8px;
  margin-top:10px;
}

/* Hero CTA 按鈕 — 共用樣式 */
.hero-wrap .et-hero-btn .wp-block-button__link{
  border-radius:999px;
  padding:10px 22px;
  font-size:15px;
  font-weight:600;
}

/* 主按鈕：實心藍色＋明顯陰影 */
.hero-wrap .et-hero-btn--primary .wp-block-button__link{
  background:#2563EB !important;
  color:#ffffff!important;
  border:none;
  box-shadow:0 14px 34px rgba(15,23,42,.55);
  transition:background .15s ease,transform .15s ease,box-shadow .15s ease;
}
.hero-wrap .et-hero-btn--primary .wp-block-button__link:hover{
  background:#1D4ED8;
  transform:translateY(-1px);
  box-shadow:0 18px 42px rgba(15,23,42,.65);
}

/* Hero 副按鈕：白底膠囊（覆蓋 is-style-outline） */
.hero-wrap .wp-block-button.is-style-outline.et-hero-btn--ghost > .wp-block-button__link,
.hero-wrap .et-hero-btn--ghost .wp-block-button__link{
  background:#ffffff!important;
  color:#1D4ED8!important;
  border:2px solid #ffffff!important;
  border-radius:999px!important;
  padding:10px 22px;
  font-size:15px;
  font-weight:600;
  box-shadow:0 10px 24px rgba(15,23,42,.35);
  transition:background .15s ease,transform .15s ease,box-shadow .15s ease;
}
.hero-wrap .wp-block-button.is-style-outline.et-hero-btn--ghost > .wp-block-button__link:hover,
.hero-wrap .et-hero-btn--ghost .wp-block-button__link:hover{
  background:transparent!important;
  color:#ffffff!important;
  border-color:#ffffff!important;
  transform:translateY(-1px);
  box-shadow:0 14px 30px rgba(15,23,42,.45);
}

/* 手機版：按鈕改成一行一顆、寬度吃滿，標題縮字 */
@media (max-width:782px){
  .hero-wrap .wp-block-buttons{
    justify-content:flex-start;
    gap:10px;
    flex-direction:column;
    align-items:stretch;
  }
  .hero-wrap .et-hero-btn{
    width:100%;
  }
  .hero-wrap .et-hero-btn .wp-block-button__link{
    display:block;
    text-align:center;
  }
  .hero-wrap .hero-title{
    font-size:24px;
  }
  .hero-wrap .wp-block-cover__inner-container{
    margin-left:0;
    padding-left:16px;
    padding-right:16px;
  }
}

/* =======================================================================
   Query Loop / 文章卡（安全預設：直式卡片）
   ======================================================================= */
.wp-block-post-title a{
  display:block!important;
  text-decoration:none;
  white-space:normal!important;
  word-break:normal!important;
  overflow:visible!important;
  -webkit-line-clamp:initial!important;
  -webkit-box-orient:initial!important;
}
.wp-block-query .wp-block-post{
  display:block;
  background:var(--et-card);
  border:1px solid var(--et-line);
  border-radius:var(--et-radius);
  padding:14px;
  margin:14px 0;
  box-shadow:0 1px 0 rgba(15,23,42,.02);
}
.wp-block-post-featured-image{
  border-radius:12px;
  overflow:hidden;
  margin-bottom:10px;
}
.wp-block-post-featured-image img{
  width:100%;
  height:auto;
  display:block;
  object-fit:cover;
}
.wp-block-post-title{margin:2px 0 6px;}
.wp-block-post-excerpt{margin:0;color:var(--et-body);}
.wp-block-post-terms.tag-links{margin-top:6px}
.wp-block-post-terms.tag-links a{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  font-size:.75rem;
  line-height:1;
  border:1px solid var(--et-line);
  background:#fff;
  margin-right:6px;
}

/* 分頁 */
.wp-block-query-pagination{
  display:flex;
  justify-content:center;
  gap:10px;
  clear:both;
}
.wp-block-query-pagination .wp-block-query-pagination-numbers a,
.wp-block-query-pagination .wp-block-query-pagination-numbers span,
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:36px;
  height:36px;
  padding:0 10px;
  border:1px solid var(--et-line);
  border-radius:999px;
  text-decoration:none;
  color:var(--et-ink);
}
.wp-block-query-pagination .current{
  background:var(--et-accent);
  color:#fff;
  border-color:var(--et-accent);
  font-weight:600;
}

/* ===== 媒體卡（圖左文右）— 只在外層 Group 加 .et-latest 才啟用 ===== */
.et-latest .wp-block-post{
  display:grid!important;
  grid-template-columns:168px 1fr;
  column-gap:16px;
  align-items:flex-start;
}
.et-latest .wp-block-post-featured-image{
  grid-column:1;
  grid-row:1 / span 3;
  aspect-ratio:16/10;
  border-radius:12px;
  overflow:hidden;
  margin:0;
}
.et-latest .wp-block-post-title,
.et-latest .wp-block-post-excerpt,
.et-latest .wp-block-post-terms{
  grid-column:2;
  min-width:0;
}

/* =======================================================================
   Featured posts（簡化）
   ======================================================================= */
.et-featured .wp-block-post-template{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}
@media (max-width:1024px){
  .et-featured .wp-block-post-template{grid-template-columns:repeat(2,1fr);}
}
@media (max-width:640px){
  .et-featured .wp-block-post-template{grid-template-columns:1fr;}
}
.et-featured .wp-block-post{
  border:1px solid var(--et-line);
  border-radius:12px;
  background:#fff;
  overflow:hidden;
  transition:box-shadow .2s,transform .2s;
}
.et-featured .wp-block-post:hover{
  box-shadow:var(--et-shadow-hover);
  transform:translateY(-2px);
}
.et-featured .wp-block-post-featured-image{
  position:relative;
  padding-top:66.6667%;
  line-height:0;
  overflow:hidden;
  margin:0;
}
.et-featured .wp-block-post-featured-image > a{
  position:absolute;
  inset:0;
  display:block;
}
.et-featured .wp-block-post-featured-image img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
}

/* =======================================================================
   FAQ（共用 details）
   ======================================================================= */
.faq details,
.tsai-faq details{
  background:#fff;
  border:1px solid var(--et-line);
  border-radius:14px;
  margin:.6rem 0;
  box-shadow:var(--et-shadow);
}
.faq details[open],
.tsai-faq details[open]{box-shadow:var(--et-shadow-hover);}
.faq summary,
.tsai-faq summary{
  cursor:pointer;
  list-style:none;
  padding:.9rem 1rem;
  font-weight:600;
  color:var(--et-ink);
}
.faq summary::-webkit-details-marker,
.tsai-faq summary::-webkit-details-marker{display:none;}
.tsai-faq .answer{
  padding:0 1rem 1rem;
  color:var(--et-body);
}

/* =======================================================================
   Header（Astra）— 文字顏色、下拉外觀、三層選單修正
   ======================================================================= */
.site-header .site-title a,
.ast-primary-header-bar .main-header-menu .menu-link{
  color:var(--et-ink)!important;
}
.ast-primary-header-bar .main-header-menu .menu-link:hover,
.ast-primary-header-bar .main-header-menu .menu-link:focus{
  color:var(--et-accent-600)!important;
}

/* 桌機下拉樣式與尺寸（Astra 的桌機斷點 921px） */
@media (min-width:921px){

  /* 移除 Astra 內建小圖示，改用 CSS caret */
  .main-header-menu .menu-item-has-children > a .ast-icon,
  .main-header-menu .menu-item-has-children > .ast-menu-toggle{
    display:none!important;
  }
  .main-header-menu .menu-item-has-children > a::after{
    content:"";
    display:inline-block;
    width:0;
    height:0;
    margin-left:.35em;
    vertical-align:middle;
    border-left:4px solid transparent;
    border-right:4px solid transparent;
    border-top:5px solid currentColor;
    transition:transform .15s ease;
  }
  .ast-desktop .main-header-menu .menu-item-has-children:hover > a::after{
    transform:rotate(180deg);
  }

  /* 第一層下拉 */
  .ast-desktop .main-header-menu .sub-menu{
    background:#fff;
    border:1px solid #E5E7EB;
    border-radius:10px;
    padding:.5rem 0;
    box-shadow:0 12px 28px rgba(2,6,23,.12);
    min-width:240px;
    z-index:9999;
    margin-top:0;
  }

  /* 第 3 層（右側飛出） */
  .ast-desktop .main-header-menu .sub-menu .sub-menu{
    top:-1px;
    left:calc(100% - 2px);
    min-width:360px;
    z-index:9999;
  }

  .ast-desktop .main-header-menu .sub-menu a{
    padding:10px 16px;
    line-height:1.2;
    white-space:nowrap;
  }
}

/* 讓下拉不被容器裁切；層級拉高 */
.ast-desktop .ast-primary-header-bar,
.ast-desktop .ast-desktop-header-content{overflow:visible;}
.main-header-bar .main-header-menu .sub-menu{z-index:2147483003!important;}

/* 只有作為分類的父項目（href="#"）不跳頁 */
.ast-desktop .main-header-menu .menu-item-has-children > a[href="#"]{
  cursor:default;
  pointer-events:none;
}

/* 行動抽屜（≤ 921px） */
.ast-header-break-point .main-header-menu,
.ast-header-break-point .main-header-menu .menu-item{
  display:block!important;
}
.ast-header-break-point .main-header-menu .menu-item > a{
  display:block!important;
  padding:14px 16px!important;
  line-height:1.35;
}
.ast-header-break-point .main-header-menu .sub-menu .menu-item > a{
  padding:12px 20px!important;
}
.ast-header-break-point .main-header-menu .sub-menu{
  display:none;
  margin:0;
  padding:0;
  background:#fff;
  border-left:2px solid #F1F5F9;
}
.ast-header-break-point .main-header-menu .menu-item .ast-menu-toggle[aria-expanded="true"] + .sub-menu,
.ast-header-break-point .main-header-menu .menu-item.ast-submenu-expanded > .sub-menu{
  display:block!important;
}
.ast-header-break-point .main-header-menu .menu-item-has-children{position:relative;}
.ast-header-break-point .main-header-menu .menu-item-has-children > .ast-menu-toggle{
  display:inline-flex!important;
  position:absolute;
  right:8px;
  top:8px;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:8px!important;
  min-width:auto!important;
  height:auto!important;
}

/* 行動抽屜遮罩與層級 */
.site-header{position:relative;z-index:2147483001!important;}
.ast-header-break-point .ast-mobile-popup-overlay{
  background:rgba(15,23,42,.32)!important;
  z-index:2147483000!important;
}
.ast-header-break-point .ast-mobile-popup-drawer,
.ast-header-break-point .ast-mobile-popup-drawer .ast-mobile-popup-inner{
  background:#fff!important;
  z-index:2147483002!important;
}

/* =======================================================================
   Categories Grid（短碼整合）
   ======================================================================= */
.et-catgrid,
.et-cat-grid{
  --et-min:240px;
  display:grid;
  gap:14px;
  grid-template-columns:repeat(auto-fit,minmax(var(--et-min),1fr));
}
.et-catcard,
.et-cat-grid .et-cat-card{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:6px;
  border:1px solid var(--et-line);
  border-radius:14px;
  padding:14px;
  background:#fff;
  text-decoration:none;
  color:var(--et-ink);
  box-shadow:0 6px 18px rgba(2,6,23,.06);
  transition:transform .18s,box-shadow .18s,border-color .18s;
}
.et-catcard:hover,
.et-cat-grid .et-cat-card:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 24px rgba(2,6,23,.10);
  border-color:#dbe2ea;
}
.et-subs{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:.35rem;
}
.et-subs a{
  display:inline-block;
  white-space:nowrap;
  font-size:12px;
  line-height:1;
  padding:6px 8px;
  border:1px solid var(--et-line);
  border-radius:999px;
  color:#475569;
  text-decoration:none;
}
.et-subs a:hover{
  background:#F8FAFC;
  border-color:#dbe2ea;
}

/* =======================================================================
   Contact / Legal（精簡外觀）
   ======================================================================= */
.tsai-legal-hero,
.tsai-contact-hero{
  background:
    radial-gradient(1200px 600px at 10% -10%, #DBEAFE 0, rgba(219,234,254,0) 70%),
    linear-gradient(180deg,#F8FAFF 0,#FFFFFF 60%);
  border:1px solid var(--et-line);
  border-radius:calc(var(--et-radius) + 6px);
  padding:2rem;
  box-shadow:var(--et-shadow);
}

/* =======================================================================
   wpDiscuz（必要最小）
   ======================================================================= */
.wc-comment-right .wc-comment-text{
  line-height:1.75;
  color:var(--et-body);
}
.wc-comment .wc-header .wc-comment-author{
  color:var(--et-ink);
}

/* =======================================================================
   Header CTA / FAB / 語言切換 / 其他
   ======================================================================= */
/* Header Resources CTA（桌機） */
.main-header-bar .menu-item.menu-cta > a{
  background:var(--et-accent)!important;
  color:#fff!important;
  font-weight:700;
  font-size:.88em;
  padding:.35em .75em!important;
  border-radius:10px!important;
  line-height:1.1;
  display:inline-flex;
  align-items:center;
  gap:.4em;
  margin-left:.35rem;
  box-shadow:0 2px 8px rgba(37,99,235,.18)!important;
}
.main-header-bar .menu-item.menu-cta > a:hover{
  background:var(--et-accent-600)!important;
}
@media (max-width:921px){
  .main-header-bar .menu-item.menu-cta{display:none!important;}
}

/* Mobile/Tablet FAB（右下） */
html body a.et-fab{
  position:fixed;
  right:16px!important;
  left:auto!important;
  bottom:calc(var(--et-fab-gap) + env(safe-area-inset-bottom))!important;
  z-index:10010!important;
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  width:var(--et-fab-size)!important;
  height:var(--et-fab-size)!important;
  border-radius:9999px!important;
  background:var(--et-accent);
  color:#fff;
  text-decoration:none;
  font-weight:800;
  box-shadow:0 10px 24px rgba(37,99,235,.20);
  transition:transform .2s,opacity .2s,background .12s;
  -webkit-transform:translateZ(0);
  backface-visibility:hidden;
}
html body a.et-fab:hover{
  background:var(--et-accent-600);
  transform:translateY(-1px);
}
.et-fab .et-fab-text{display:none!important;}
.et-fab .et-fab-icon{
  font-size:var(--et-fab-icon);
  line-height:1;
}
@media (min-width:1025px){
  html body a.et-fab{display:none!important;}
}
a.et-fab.et-hide,
a.et-fab.et-fab--hidden,
a.et-fab.is-hidden{
  transform:translateY(140%);
  opacity:0;
  pointer-events:none;
}

/* Scroll-to-top 位置 */
.ast-scroll-top{
  right:16px!important;
  bottom:16px!important;
  z-index:2147483000!important;
}

/* 語言切換單行 */
.ast-builder-layout-element .et-lang{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.et-lang a{
  white-space:nowrap;
  word-break:keep-all;
  line-height:1;
  padding:.45rem .65rem;
}
@media (max-width:921px){
  .et-lang a{
    padding:.35rem .55rem;
    font-size:13px;
  }
}

/* =======================================================================
   Utilities
   ======================================================================= */
@media (max-width:768px){
  .entry-content{font-size:16.5px;}
}
html{scroll-behavior:smooth;}
.entry-content [id]{scroll-margin-top:88px;}

/* 一般頁面內容在中間一條 */
.page .entry-content{
  max-width:960px;
  margin:0 auto 80px;
  padding:0 16px;
}

/* 調整段落的字級與行距 */
.page .entry-content p{
  font-size:16px;
  line-height:1.9;
  margin-bottom:0.9em;
}

/* 小標題（H2）上下多一點空氣 */
.page .entry-content h2{
  font-size:28px;
  margin-top:3rem;
  margin-bottom:1.2rem;
}

/* H3 略小一點，拉出層次 */
.page .entry-content h3{
  font-size:20px;
  margin-bottom:0.6rem;
}

/* =======================================================================
   My Journey 區塊
   ======================================================================= */
.et-my-journey{
  max-width:960px;
  margin:0 0 2rem;
  padding:1.5rem 1.25rem 2rem;
  border-radius:16px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  font-size:16px;
  line-height:1.6;
}
.et-mj-header h2{
  font-size:1.4rem;
  margin-bottom:0.25rem;
}
.et-mj-header p{
  opacity:.8;
  margin-bottom:1rem;
}
.et-mj-section{margin-top:1.5rem;}
.et-mj-section h3{
  font-size:1.1rem;
  margin-bottom:0.5rem;
}
.et-mj-card{
  border-radius:12px;
  padding:0.9rem 1rem;
  border:1px solid #e2e8f0;
  background:#ffffff;
}
.et-mj-stage-label{
  font-weight:600;
  margin-bottom:0.25rem;
}
.et-mj-stage-desc{margin-bottom:0.4rem;}
.et-mj-stage-note{
  font-size:0.85rem;
  opacity:0.7;
}
.et-mj-list{
  list-style:none;
  padding:0;
  margin:0;
}
.et-mj-list-item{
  border-bottom:1px solid #e2e8f0;
  padding:0.6rem 0;
}
.et-mj-list-item:last-child{border-bottom:none;}
.et-mj-list-main{
  display:flex;
  justify-content:space-between;
  gap:1rem;
  align-items:center;
}
.et-mj-item-title{font-weight:500;}
.et-mj-link{
  font-size:0.9rem;
  text-decoration:underline;
}
.et-mj-item-sub{
  font-size:0.85rem;
  opacity:0.7;
  margin-top:0.2rem;
}
.et-mj-more-note,
.et-mj-small-link{
  font-size:0.85rem;
  opacity:0.7;
  margin-top:0.4rem;
}
.et-mj-steps{padding-left:1.2rem;}
.et-mj-step{margin-bottom:0.8rem;}
.et-mj-step-type{
  font-size:0.8rem;
  text-transform:uppercase;
  letter-spacing:0.04em;
  opacity:0.7;
}
.et-mj-step-title{
  display:inline-block;
  font-weight:600;
}
.et-mj-step-note{
  font-size:0.9rem;
  opacity:0.85;
  margin-top:0.15rem;
}

/* 登出狀態按鈕 */
.et-my-journey--logged-out{
  max-width:560px;
  margin:0 auto;
  padding:2rem 1rem 3rem;
  text-align:center;
}
.et-my-journey--logged-out h2{
  font-size:1.6rem;
  margin-bottom:0.5rem;
}
.et-my-journey--logged-out p{
  margin-bottom:1.5rem;
  opacity:0.8;
}
.et-mj-btn{
  display:inline-block;
  padding:0.6rem 1.4rem;
  border-radius:999px;
  border:none;
  background:#1e293b;
  color:#fff;
  font-weight:500;
  text-decoration:none;
}

/* 隱藏 WooCommerce 我的帳號控制台那句預設說明文字 */
.woocommerce-MyAccount-content > p{
  display:none!important;
}

/* =======================================================================
   Start / 首頁專用：Step 卡、Stats、底部兩欄
   ======================================================================= */

/* 首頁三張起點卡片 */
.et-card{
  background:#ffffff;
  border-radius:16px;
  border:1px solid #e5e7eb;
  padding:20px 18px 24px;
  box-shadow:0 12px 30px rgba(15,23,42,0.06);
}
.et-card h3{
  margin-top:0;
  margin-bottom:8px;
}
.et-card p{
  line-height:1.9;
  margin-bottom:16px;
}
.et-card p:last-of-type{
  margin-bottom:1.2rem;
}
.et-card .wp-block-button__link{
  border-radius:999px;
  padding:8px 18px;
  font-size:14px;
}

/* —— Start 頁：你現在在哪一步？ Steps 深色框 —— */

.et-steps-frame{
  max-width:1040px;
  margin:28px auto 0;
  padding:22px 22px 26px;
  border-radius:24px;
  background:#020617;
  box-shadow:0 20px 50px rgba(15,23,42,0.55);
}
.et-steps-frame .et-step{
  display:flex;
  flex-direction:column;
  height:100%;
}
.et-steps-frame .et-step .wp-block-heading{
  margin:4px 0 10px;
}
.et-steps-frame .et-step p{
  margin-bottom:10px;
}

/* Step label */
.et-step-label{
  font-size:0.8rem;
  letter-spacing:0.04em;
  text-transform:uppercase;
  color:#64748b;
  margin-bottom:4px;
}

/* Step 卡片：讓三顆按鈕等高、貼齊底部 */
.et-step{
  display:flex;
  flex-direction:column;
  height:100%;
}
.et-step .wp-block-buttons{
  margin-top:auto;
}
.et-step .wp-block-button__link{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  min-height:48px;
  line-height:1.3;
}

/* —— Stats 區塊：數字卡片 —— */

/* 白底容器 */
.et-stats-section{
  margin:40px 0;
  background:#ffffff;
  border-radius:24px;
  padding:28px 24px 32px;
  box-shadow:0 22px 48px rgba(15,23,42,.16);
}

/* 標題加左側色條 */
.et-stats-section > .wp-block-heading{
  position:relative;
  padding-left:14px;
  font-size:1.6rem;
  margin:0 0 18px;
}
.et-stats-section > .wp-block-heading::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:4px;
  border-radius:999px;
  background:linear-gradient(180deg,var(--et-accent),var(--et-accent-600));
}

/* Stats grid */
.et-stats{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:20px;
}

/* 數字卡片本體 */
.et-stat{
  border-radius:16px;
  padding:20px 18px 18px;
  box-shadow:0 16px 28px rgba(15,23,42,.28);
  position:relative;
  overflow:hidden;
}

/* 三種顏色背景 */
.et-stat--blue{
  background:linear-gradient(135deg,#2563EB,#1D4ED8);
}
.et-stat--green{
  background:linear-gradient(135deg,#22C55E,#16A34A);
}
.et-stat--orange{
  background:linear-gradient(135deg,#FB923C,#F97316);
}

/* 大數字 */
.et-stat-number-wrapper{
  display:flex;
  align-items:baseline;
  gap:4px;
  margin-bottom:6px;
}
.et-stat-number{
  font-size:2.8rem;
  font-weight:800;
  line-height:1;
}
.et-stat-unit{
  font-size:1.1rem;
  font-weight:700;
}

/* 統一文字顏色：全部白色，對比拉滿 */
.entry-content .et-stat,
.entry-content .et-stat-number,
.entry-content .et-stat-unit,
.entry-content .et-stat-label,
.entry-content .et-stat-note{
  color:#ffffff;
}


/* 標籤 + 註解 */
.et-stat-label{
  margin-top:8px;
  font-size:1rem;
  font-weight:700;
  line-height:1.3;
}
.et-stat-note{
  margin-top:3px;
  font-size:0.8rem;
  line-height:1.5;
  opacity:0.95;
}

/* 手機：三張卡改成直排，避免太擠 */
@media (max-width:768px){
  .et-stats-section{
    padding:22px 16px 30px;
  }
  .et-stats{
    grid-template-columns:1fr;
    gap:14px;
  }
}

/* —— Start 頁底部：最新文章 + 常用工具 —— */

.et-latest-simple .wp-block-post{
  border:none;
  background:transparent;
  padding:4px 0;
  margin:0 0 6px;
  box-shadow:none;
}
.et-latest-simple .wp-block-post-title{
  margin:0;
}
.et-latest-simple .wp-block-post-title a{
  font-size:17px;
  font-weight:600;
  text-decoration:none;
}
.et-latest-simple .wp-block-post-date{
  font-size:13px;
  color:#64748b;
}

/* 兩欄佈局 */
.et-bottom-grid{
  display:grid;
  grid-template-columns:minmax(0,2fr) minmax(0,1.1fr);
  gap:24px;
  align-items:flex-start;
  margin-top:32px;
  padding:18px 20px 22px;
  border-radius:18px;
  background:#f9fafb;
  border:1px solid #e5e7eb;
}
.et-bottom-grid .wp-block-query .wp-block-group{
  padding:8px 0;
  border-bottom:1px solid #e5e7eb;
}
.et-bottom-grid .wp-block-query .wp-block-group:last-child{
  border-bottom:none;
}
.et-bottom-grid .wp-block-post-title{
  margin:0 0 4px;
}
.et-bottom-grid .wp-block-post-date{
  font-size:13px;
  color:#64748b;
}
@media(max-width:768px){
  .et-bottom-grid{
    grid-template-columns:1fr;
  }
}
.et-hero-btn--ghost .wp-block-button__link {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: #e2e8f0;
}
.et-hero-btn--ghost .wp-block-button__link:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.et-quiz-cta{
  display:inline-block;
  padding:10px 20px;
  border-radius:999px;
  background:#2563EB;
  color:#fff;
  text-decoration:none;
  font-weight:600;
  font-size:14px;
}
.et-quiz-cta:hover{
  background:#1D4ED8;
}

/* === Engineer Tsai：全站回報按鈕樣式 === */
.et-report-issue-bar{
  display:flex;
  justify-content:flex-end;
  margin:-0.5rem 0 1rem;
}

.et-report-issue-btn{
  font-size:0.85rem;
  padding:0.35rem 0.9rem;
  border-radius:999px;
  border:1px solid var(--et-line, #E2E8F0);
  background:#fff;
  color:var(--et-muted, #64748B);
  display:inline-flex;
  align-items:center;
  gap:0.35rem;
  cursor:pointer;
  box-shadow:0 2px 4px rgba(15,23,42,.06);
  transition:border-color .15s ease, box-shadow .15s ease, color .15s ease, transform .1s ease;
}

.et-report-issue-btn:hover{
  border-color:var(--et-accent, #2563EB);
  color:var(--et-accent, #2563EB);
  box-shadow:var(--et-shadow-hover, 0 10px 24px rgba(2,6,23,.12));
  transform:translateY(-1px);
}

/* Modal 外層 */
.et-report-issue-modal{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.35);
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:0;
  pointer-events:none;
  z-index:9999;
  padding:1.5rem;
  transition:opacity .18s ease-out;
}

.et-report-issue-modal.is-open{
  opacity:1;
  pointer-events:auto;
}

/* Dialog 內容 */
.et-report-issue-dialog{
  max-width:480px;
  width:100%;
  background:var(--et-card, #FFFFFF);
  border-radius:var(--et-radius, 16px);
  box-shadow:var(--et-shadow, 0 6px 18px rgba(2,6,23,.08));
  padding:1.5rem 1.75rem 1.75rem;
  position:relative;
}

.et-report-issue-close{
  position:absolute;
  top:0.6rem;
  right:0.7rem;
  border:none;
  background:transparent;
  font-size:1.35rem;
  line-height:1;
  cursor:pointer;
  color:var(--et-muted, #64748B);
}

.et-report-issue-title{
  font-size:1.1rem;
  margin:0 0 0.3rem;
}

.et-report-issue-intro{
  font-size:0.9rem;
  color:var(--et-muted, #64748B);
  margin:0 0 1rem;
}

.et-report-issue-label{
  display:block;
  font-size:0.9rem;
  margin-bottom:0.75rem;
}

.et-report-issue-label input[type="email"],
.et-report-issue-label textarea{
  width:100%;
  margin-top:0.25rem;
  border-radius:10px;
  border:1px solid var(--et-line, #E2E8F0);
  padding:0.45rem 0.6rem;
  font-size:0.9rem;
}

.et-report-issue-label textarea{
  min-height:120px;
  resize:vertical;
}

.et-report-issue-label input:focus,
.et-report-issue-label textarea:focus{
  outline:none;
  border-color:var(--et-accent, #2563EB);
  box-shadow:0 0 0 1px rgba(37,99,235,.1);
}

.et-report-issue-human{
  display:flex;
  align-items:center;
  gap:0.45rem;
  font-size:0.8rem;
}

.et-report-issue-human input{
  width:auto;
}

/* 蜜罐欄位：藏起來 */
.et-report-issue-hp{
  position:absolute;
  left:-9999px;
  opacity:0;
  pointer-events:none;
}

/* 送出按鈕 */
.et-report-issue-submit{
  margin-top:0.5rem;
  width:100%;
  border:none;
  border-radius:999px;
  padding:0.55rem 1rem;
  font-size:0.9rem;
  font-weight:500;
  background:var(--et-accent, #2563EB);
  color:#fff;
  cursor:pointer;
}

.et-report-issue-submit:disabled{
  opacity:0.7;
  cursor:wait;
}

/* 狀態訊息 */
.et-report-issue-status{
  margin-top:0.4rem;
  font-size:0.8rem;
  color:var(--et-muted, #64748B);
}

/* 開啟 modal 時禁止背景捲動 */
body.et-report-issue-open{
  overflow:hidden;
}

/* 手機微調 */
@media (max-width:600px){
  .et-report-issue-bar{
    margin-top:0;
  }
}

/* 回報視窗：維持置中，但整塊往下微移，避免被導覽蓋住 */
.et-report-issue-modal{
  align-items:center;          /* 回復成垂直置中 */
  padding:1.5rem;              /* 四周一點點空白就好 */
}

/* Dialog 本體：往下推一點＋高度限制，太小螢幕可以捲動 */
.et-report-issue-dialog{
  margin-top:4.5rem;           /* 往下移，避開 Header */
  max-height:calc(100vh - 5.5rem);
  overflow-y:auto;
}

/* 有登入 admin bar 再多一點距離（只調 dialog 就好） */
body.admin-bar .et-report-issue-dialog{
  margin-top:5.5rem;
}

/* 手機螢幕再縮一點，避免太低 */
@media (max-width:600px){
  .et-report-issue-dialog{
    margin-top:3.5rem;
    max-height:calc(100vh - 4.5rem);
  }
}

/* 材料庫 v0.1：案型卡片 */
.et-case-section{
  max-width:960px;
  margin:0 auto 2.5rem;
  padding:1rem 0 2rem;
}

.et-case-section > h2{
  font-size:1.6rem;
  margin-bottom:0.3rem;
}

.et-case-desc{
  font-size:0.95rem;
  color:var(--et-muted);
  margin-bottom:1rem;
}

.et-case-card{
  background:#fff;
  border-radius:16px;
  border:1px solid var(--et-line);
  box-shadow:0 8px 24px rgba(15,23,42,.06);
  margin:0.5rem 0;
  padding:0.75rem 1rem 1rem;
}

.et-case-card summary{
  list-style:none;
  cursor:pointer;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:0.5rem;
}

.et-case-card summary::-webkit-details-marker{display:none;}

.et-case-code{
  font-size:0.8rem;
  font-weight:700;
  padding:2px 8px;
  border-radius:999px;
  background:#eff6ff;
  color:#1d4ed8;
}

.et-case-title{
  font-weight:600;
}

.et-case-note{
  font-size:0.85rem;
  color:var(--et-muted);
}

.et-case-body{
  margin-top:0.85rem;
  border-top:1px solid #e5e7eb;
  padding-top:0.8rem;
}

.et-case-body h3{
  font-size:1rem;
  margin:0.4rem 0 0.3rem;
}

.et-case-list{
  margin:0 0 0.5rem 1.1rem;
  padding:0;
  font-size:0.93rem;
}

.et-case-mini-note{
  font-size:0.85rem;
  color:var(--et-muted);
  margin-top:0.5rem;
}

/* 手機排版微調 */
@media(max-width:600px){
  .et-case-card summary{
    align-items:flex-start;
  }
  .et-case-title,
  .et-case-note{
    width:100%;
  }
}

#et-material-app{
  max-width:960px;
  margin:2rem auto 4rem;
  padding:1.5rem 1.25rem 2rem;
  border-radius:16px;
  border:1px solid #e2e8f0;
  background:#ffffff;
}
.et-app-section{margin-bottom:2rem;}
.et-mode-buttons{
  display:flex;
  flex-wrap:wrap;
  gap:.75rem;
  margin-top:.75rem;
}
.et-mode-buttons button,
.et-case-item{
  border-radius:999px;
  border:1px solid #e2e8f0;
  background:#f8fafc;
  padding:.6rem 1.2rem;
  cursor:pointer;
  font-size:.95rem;
}
.et-mode-buttons button:hover,
.et-case-item:hover{
  border-color:#2563EB;
  color:#2563EB;
}
.et-qa-step{
  margin:.75rem 0;
  display:flex;
  flex-direction:column;
  gap:.25rem;
}
.et-qa-step select{
  max-width:260px;
}
#et-qa-submit{
  margin-top:1rem;
}
.et-qa-result{
  margin-top:1rem;
  padding:1rem;
  border-radius:12px;
  background:#f1f5f9;
}
#et-case-list{
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
  margin-bottom:1rem;
}
#et-case-detail{
  padding:1rem;
  border-radius:12px;
  background:#f9fafb;
}
#et-material-search{
  width:100%;
  max-width:360px;
  padding:.45rem .6rem;
  border-radius:999px;
  border:1px solid #e2e8f0;
  margin:.5rem 0 1rem;
}
.et-material-list{
  list-style:disc;
  padding-left:1.5rem;
}
.et-tip{
  font-size:.85rem;
  opacity:.75;
  margin-top:.5rem;
}

/* 材料工具 – 模式切換按鈕列 */
.et-mode-switch{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:16px 0 18px;
}

.et-mode-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 16px;
  border-radius:999px;
  border:1px solid var(--et-line);
  background:#ffffff;
  color:var(--et-ink);
  font-size:14px;
  text-decoration:none;
  line-height:1.2;
  box-shadow:0 4px 10px rgba(15,23,42,.06);
  transition:background .15s ease, color .15s ease, box-shadow .15s ease, transform .1s ease, border-color .15s ease;
}

.et-mode-btn:hover{
  border-color:var(--et-accent);
  box-shadow:0 6px 14px rgba(15,23,42,.10);
  transform:translateY(-1px);
}

/* 被選到的模式 */
.et-mode-btn.is-active{
  background:var(--et-accent);
  border-color:var(--et-accent);
  color:#ffffff;
  box-shadow:0 8px 20px rgba(37,99,235,.28);
}

/* Price report modal */
.et-price-report-btn{
  padding:.6rem 1.2rem;
  border-radius:999px;
  border:none;
  background:var(--et-accent,#2563EB);
  color:#fff;
  font-size:.95rem;
  cursor:pointer;
}

.et-price-report-modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
}

.et-price-report-modal.is-open{
  display:flex;
}

.et-price-report-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.55);
}

.et-price-report-content{
  position:relative;
  max-width:720px;
  width:92%;
  max-height:90vh;
  background:#fff;
  border-radius:16px;
  box-shadow:0 18px 40px rgba(15,23,42,.25);
  padding:1.5rem 1.75rem 1.25rem;
  overflow:auto;
}

.et-price-report-content iframe{
  width:100%;
  height:60vh;
  border:0;
  margin-top:.75rem;
}

.et-price-report-close{
  position:absolute;
  top:.75rem;
  right:.75rem;
  border:none;
  background:transparent;
  font-size:1.5rem;
  line-height:1;
  cursor:pointer;
}

.et-ms-aliases{
  font-size:0.8rem;
  color:#94a3b8;
  margin-top:2px;
}

/* 學習地圖列表：讓文章行間距寬一點，隱藏內部 hr */
.et-learn-index-list .wp-block-group,
.et-learn-all-posts .wp-block-group {
  padding: 4px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.et-learn-index-list hr.has-css-opacity,
.et-learn-all-posts hr.has-css-opacity {
  display: none;
}

/* 學習地圖 hero 區塊微調 */
.et-learn-hero {
  padding: 40px 0 24px;
}

.et-learn-hero .wp-block-columns {
  gap: 32px;
}

/* 圖片稍微圓角，看起來更像卡片 */
.et-learn-hero-image img {
  border-radius: 16px;
}

/* 手機版：上下堆疊、置中 */
@media (max-width: 781px) {
  .et-learn-hero .wp-block-columns {
    flex-direction: column;
  }
  .et-learn-hero-image {
    text-align: center;
  }
}

.et-emailbar .ml-embedded,
.et-emailbar .ml-embedded *{
  max-width:100%;
}
.et-emailbar .ml-embedded iframe{
  width:100% !important;
  max-width:100% !important;
}

/* ===== FIX: Desktop dropdown should be CLOSED by default ===== */
@media (min-width: 921px){
  body:not(.ast-header-break-point) .ast-primary-header-bar .main-header-menu .sub-menu{
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  body:not(.ast-header-break-point) .ast-primary-header-bar .main-header-menu li:hover > .sub-menu,
  body:not(.ast-header-break-point) .ast-primary-header-bar .main-header-menu li:focus-within > .sub-menu{
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

/* M35-SHELL-CLEANUP-001: remove redundant audience-facing shell blocks */
.etsc-strip[data-etsc-surface="home"],
.et-gck-ui-compat { display: none !important; }
#tsai-electro-education-scope {
  box-sizing: border-box; max-width: none !important; width: 100%;
  margin: 0 !important; padding: 16px max(24px, calc((100vw - 1140px) / 2)) !important;
  font-size: 12px !important; line-height: 1.7 !important;
  color: #475569 !important; background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important; overflow-wrap: anywhere;
}
body.home #tsai-electro-education-scope {
  background: #07151f !important; color: #a8bbc8 !important;
  border-top-color: #203643 !important;
}
@media (max-width: 600px) {
  #tsai-electro-education-scope { padding: 16px !important; }
}

@media (max-width: 480px) { .et-header .et-ctx summary { max-width: 160px; } .et-header .et-menu { flex-shrink: 0; } }
