/* 常見問題頁 — 精細優化（保留原站風格） */

/* 統一文字尺度（覆寫 Article-Clean 1.2em 放大） */
.qna-page {
  font-size: 16px;
  line-height: 1.6;
}

.qna-page .text {
  font-size: 1rem;
}

.qna-page .wrapper {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  margin-top: 10px;
  box-shadow: none;
  align-items: flex-start;
  gap: 20px;
}

@media (min-width: 769px) {
  .qna-page .wrapper {
    gap: 24px;
  }
}

/* 側邊選單 */
.qna-sidebar {
  min-width: 260px;
  max-width: 260px;
  background: #fff;
  border: 1px solid #e8ecef !important;
  border-radius: 10px;
  margin-top: 0 !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.qna-sidebar .sidebar-header {
  background: linear-gradient(135deg, #ebaa2e 0%, #f4c430 100%);
  color: #222;
  padding: 16px 18px;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.qna-sidebar ul.components {
  text-align: left;
  border-bottom: none !important;
  padding: 8px 10px 16px;
}

.qna-sidebar .qna-nav-label {
  padding: 14px 10px 6px;
  list-style: none;
}

.qna-sidebar .qna-nav-label span {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1.4;
}

.qna-sidebar .qna-nav-label--phase2 span {
  color: #1e7e34;
  background: #eaf7ec;
}

.qna-sidebar .qna-nav-label--phase1 {
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px solid #eee;
}

.qna-sidebar .qna-nav-label--phase1 span {
  color: #966300;
  background: #fff8e8;
}

.qna-sidebar ul.components li a {
  display: block;
  padding: 10px 12px 10px 14px;
  margin: 2px 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #444;
  border-left: none;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.qna-sidebar ul.components li a:hover {
  background: #f5faf6 !important;
  color: #28a745 !important;
}

.qna-sidebar ul.components li.active > a {
  background: #eef8f0 !important;
  color: #1e7e34 !important;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #28a745;
  border-radius: 0 6px 6px 0;
}

@media (min-width: 769px) {
  .qna-sidebar {
    position: sticky;
    top: 12px;
    align-self: flex-start;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c8e6c9 transparent;
  }

  .qna-sidebar::-webkit-scrollbar {
    width: 5px;
  }

  .qna-sidebar::-webkit-scrollbar-thumb {
    background: #c8e6c9;
    border-radius: 4px;
  }
}

/* 主內容 */
.qna-main {
  flex: 1;
  min-width: 0;
  padding: 0 !important;
  min-height: auto !important;
  background: transparent;
}

.qna-toolbar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #e8ecef;
  border-radius: 10px 10px 0 0;
  border-bottom: none;
  background: #fafafa;
}

.qna-toolbar #sidebarCollapse {
  margin-left: 0;
}

.qna-toolbar-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
}

.qna-panel {
  padding: 24px 28px 32px;
  background: #fff;
  border: 1px solid #e8ecef;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.qna-page .intro {
  font-size: 1rem;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

/* ===== Section Title（參考 bestvideo.php） ===== */
.qna-page .section-title {
  margin: 0;
  position: relative;
}

.qna-page .section-title .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #198754;
  font-weight: 700;
}

.qna-page .section-title .title {
  margin: 4px 0 0;
  line-height: 1.35;
  font-weight: 800;
  font-size: clamp(1.375rem, 2.5vw, 1.625rem);
  position: relative;
  padding-left: 14px;
}

.section-title .title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 6px;
  border-radius: 3px;
  background: linear-gradient(180deg, #0d6efd, #20c997);
}

.section-title .title span {
  background: linear-gradient(transparent 60%, #fff7d6 0);
  box-shadow: 0 -6px 0 #fff inset;
  padding: 0 0.15em;
}

.qna-header {
  margin: 0 0 20px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f8fcf9 0%, #fff 100%);
  border: 1px solid #e3efe6;
  border-left: 4px solid #28a745;
  border-radius: 8px;
}

.qna-header--phase1 {
  background: linear-gradient(135deg, #fffdf8 0%, #fff 100%);
  border-color: #f0e8d8;
  border-left-color: #ebaa2e;
}

.qna-phase {
  margin: 0 0 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #28a745;
}

.qna-phase--phase1 {
  color: #966300;
}

.qna-category-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #222;
  line-height: 1.5;
}

.qna-category-title::before {
  content: none;
}

.qna-category-desc {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.65;
}

.qna-category-count {
  margin: 0;
  font-size: 0.8rem;
  color: #999;
}

/* 問答列表 */
.qna-faq-wrap {
  margin-top: 0;
}

.qna-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.qna-faq-item {
  border: 1px solid #e8ecef;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.qna-faq-item:hover {
  border-color: #dce9df;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.qna-faq-item.is-open {
  border-color: #c8e6c9;
  box-shadow: 0 2px 10px rgba(40, 167, 69, 0.07);
}

.qna-faq-q {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  color: #222;
  text-decoration: none;
  transition: background 0.15s;
}

.qna-faq-q:hover,
.qna-faq-q:focus {
  background: #f9fcfa;
  color: #222;
  text-decoration: none;
}

.qna-faq-item.is-open .qna-faq-q {
  background: #f5fbf7;
  border-bottom: 1px solid #e8f4ea;
}

.qna-faq-qnum {
  flex-shrink: 0;
  min-width: 34px;
  padding: 2px 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1e7e34;
  line-height: 1.5;
  text-align: center;
  background: #eaf7ec;
  border-radius: 4px;
}

.qna-faq-qtext {
  flex: 1;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.6;
}

.qna-faq-icon {
  flex-shrink: 0;
  margin-top: 4px;
  font-size: 0.7rem;
  color: #aaa;
  transition: transform 0.2s;
}

.qna-faq-item.is-open .qna-faq-icon {
  transform: rotate(180deg);
  color: #28a745;
}

/* 覆寫 Article-Clean.css 的 .collapse 置中，維持預設收合 */
.qna-page .qna-faq-a.collapse {
  display: none !important;
  justify-content: flex-start;
}

.qna-page .qna-faq-a.collapse.show {
  display: block !important;
}

.qna-faq-a-inner {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  background: #f8fbff;
  padding: 14px 16px 16px 62px;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #444;
}

.qna-empty {
  padding: 40px 20px;
  text-align: center;
  color: #999;
  background: #fafafa;
  border: 1px dashed #ddd;
  border-radius: 6px;
}

@media (max-width: 768px) {
  .qna-page .wrapper {
    gap: 0;
  }

  .qna-toolbar {
    display: flex;
  }

  .qna-panel {
    padding: 16px;
    border-radius: 0 0 10px 10px;
    border-top: none;
  }

  .qna-header {
    padding: 12px 14px;
  }

  .section-title::after {
    width: 90px;
  }

  .section-title .title::before {
    top: 6px;
    bottom: 6px;
  }

  .qna-faq-q {
    padding: 12px 14px;
    gap: 10px;
  }

  .qna-faq-a-inner {
    padding: 12px 14px 14px 14px;
  }
}

@media only screen
and (min-device-width: 768px)
and (max-device-width: 1024px)
and (orientation: portrait) {
  .mdhidden {
    display: none;
  }
}

@media only screen
and (min-device-width: 768px)
and (max-device-width: 1024px)
and (orientation: landscape) {
  .item > p {
    margin-left: -70px;
  }
}
