/* =========================
   AA Base: focus + reduce motion
========================= */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  #sideNav2 > ul > li > h3 a,
  #articleInfo20 .tit a,
  .textEditor a { transition: none !important; }
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(23, 168, 173, 0.7);
  outline-offset: 2px;
}

/* =========================
   sideNav2
========================= */
#sideNav2 ul.Cate{
  text-align: center;
  font-size: 15px;
  color: #9e9e9e;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
}

#sideNav2 > ul > li{
  position: relative;
  display: inline-block;
  border: 1px solid #e1e1e1;
  margin: 0; /* 交給 gap */
}

#sideNav2 > ul > li > h3{ display: block; margin: 0; }

#sideNav2 > ul > li > h3 a{
  letter-spacing: 2px;
  font-size: 15px;
  font-weight: 400;
  color: #35393a;
  display: block;
  padding: 20px;
  transition: background-color .25s ease, color .25s ease, letter-spacing .25s ease;
  line-height: 1.4; /* 原本 0.8 容易切字/閱讀性差 */
  text-decoration: none;
}

#sideNav2 > ul > li > h3 a:hover,
#sideNav2 > ul > li > h3 a:focus-visible{
  background-color: #f7f7f7;
}

/* =========================
   articleInfo20
========================= */
#articleInfo20{
  margin: 30px auto;
  width: 95%;
}

#articleInfo20 .tit{ margin: 20px 0; }

/* 你新 HTML 用 h2 做段標題；同時相容舊 h3 */
#articleInfo20 .tit h2{
  border-bottom: 1px #d4d4d4 solid;
  letter-spacing: 1.5px;
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 10px;
  padding: 10px 0;
  color: var(--primary);
}
#articleInfo20 .tit h3{align-items: flex-start;letter-spacing: 0.2px;color: #1a1a1a;font-size: 16px;margin: 5px 0;font-size: 18px;letter-spacing: 0.5px;margin-bottom: 0px;padding: 10px 0 10px;}
#articleInfo20 .tit h3 span{font-weight: 400;}.textEditor{padding: 0 0 20px;}

/* 你新 HTML 連結改成 <p><a>…</a></p>，舊版可能仍是 h4 */
#articleInfo20 .tit h4{
  letter-spacing: 0.5px;
  font-size: 18px;
  margin: 5px 0;
  padding: 10px 0;
}

#articleInfo20 .tit p{ margin: 8px 0; }

#articleInfo20 .tit a{
  text-decoration: underline;
  text-underline-offset: 2px;
}

#articleInfo20 .tit a:hover,
#articleInfo20 .tit a:focus-visible{
  color: var(--primary);
}

#articleInfo20 .tit h4 span{ font-weight: 400; }

/* =========================
   textEditor
========================= */
.textEditor{ padding: 0 0 20px; }


.textEditor h4{
  font-weight: 500;
  margin: 10px 0 6px;
  color: #243f72;
}

/* 清單：外側標記較易讀，縮排更一致 */
.textEditor ol{
  margin: 10px 0 0;
  padding-left: 1.25rem; /* 原本 10px 太擠 */
  list-style: auto;
}

.textEditor li{
  margin: 10px 0;
  list-style-position: outside; /* 原本 inside 會造成換行對齊很亂 */
  color: rgb(60 60 60);
  font-size: 15px;
  line-height: 1.8;
  letter-spacing: 0.2px;
  font-weight: 400;
  font-family: var(--font-family), sans-serif;
}

/* 連結不只靠顏色（AA 常抓） */
.textEditor li a{
  color: #6a1317;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.textEditor li a:hover,
.textEditor li a:focus-visible{
  color: #4267b2;
}

/* =========================
   RWD
========================= */
@media screen and (max-width: 960px) {
  /* 你原本這條：#articleInfo20 ul li article，但新 HTML 可能沒有 article 了
     先保留但不強依賴 */
  #articleInfo20 ul li article{ font-size: 16px; }
}

@media screen and (max-width: 768px) {
  .main-article #describe article{ padding: 10px 0; }

  #articleInfo20 .tit h2,
  #articleInfo20 .tit h3{
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 19px;
    letter-spacing: 0.5px;
  }

  #articleInfo20 .tit h4{
    margin: 20px 0 10px;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
  }

  #articleInfo20 .tit p{ margin-left: 10px; }

  #articleInfo20{ width: 100%; margin: 10px auto; }
}

@media screen and (max-width: 480px) {
  #articleInfo20 ul li{ margin-bottom: 10px; padding: 8px; margin: 5px; }
  #articleInfo20 .tit{ margin: 0; }
  .textEditor h5{ font-size: 16px; }
  .textEditor ol{ padding-left: 1.25rem; }
  .textEditor li{ margin: 5px 0; }
}