﻿/* guide-wiki-home 樣式統一管理 */
.wiki-hero {
  background-color: #e3f2fd;
  padding: 3rem 0;
}
.wiki-hero-container {
  max-width: 960px;
  margin: auto;
}
.wiki-hero h1 {
  color: #1565c0;
  font-weight: bold;
  margin-bottom: 1rem;
}
.wiki-hero-subtitle {
  color: #666;
  margin-bottom: 0.5rem;
}
.wiki-hero-tip {
  color: #666;
  margin-bottom: 1.5rem;
}
.wiki-hero-tip a {
  color: #1565c0;
  text-decoration: underline;
}
.wiki-search .input-group-text {
  background-color: white;
  border-right: none;
}
.wiki-search .fa {
  color: #666;
}
.wiki-tags .badge {
  background-color: #1565c0;
  color: #fff;
  margin: 0 0.25rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  text-decoration: none;
}
.wiki-tags .badge:hover {
  background-color: #0d47a1;
}

.wiki-categories {
  background-color: #f8f9fa;
  padding: 3rem 0;
}
.wiki-categories-container {
  max-width: 1320px;
  margin: auto;
}
.wiki-categories .card {
  border: none;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.wiki-categories .card-body h2 {
  color: #1565c0;
  font-weight: bold;
}
.wiki-categories .card-body p {
  color: #666;
  font-size: 0.9rem;
}

.wiki-popular {
  background-color: #fff;
  padding: 3rem 0;
}
.wiki-popular-container {
  max-width: 960px;
  margin: auto;
}
.wiki-popular h2 {
  color: #1565c0;
  font-weight: bold;
  margin-bottom: 1rem;
}
.wiki-popular .list-group-item {
  cursor: pointer;
}
.wiki-popular .list-group-item:hover {
  background-color: #e3f2fd;
  color: #1565c0;
}
.wiki-hero {
  background-color: #e3f2fd;
  padding: 2rem 0;
}
.wiki-hero-container {
  max-width: 1200px;
  margin: auto;
  gap: 1rem;
}
.wiki-hero-text {
  max-width: 80%;
}
@media (max-width: 768px) {
  .wiki-hero-text {
    max-width: 100%;
  }
}
.wiki-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
}
.wiki-tags .badge {
  background-color: #1565c0;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: background-color 0.3s;
}
.wiki-tags .badge:hover {
  background-color: #0d47a1;
}
.wiki-quickask {
  font-size: 0.9rem;
}
.wiki-quickask .fa-comments {
  font-size: 1rem;
}
.wiki-hero-image img {
  border-radius: 8px;
  max-width: 100%;
}
.wiki-line {
  color: #00C300;
}
.wiki-quickask .fa-line {
  color: #00C300;
  font-size: 1.2rem;
}

.wiki-categories .card {
  transition: transform 0.3s ease;
}
.wiki-categories .card:hover {
  transform: translateY(-5px);
}
.wiki-categories .card i {
  color: #1565c0;
}
.wiki-categories .card button {
  margin-top: 0.5rem;
}
.accordion-button {
  font-weight: bold;
}
.accordion-button:not(.collapsed) {
  background-color: #e3f2fd;
  color: #1565c0;
}
.accordion-summary {
  border-top: 1px solid #dee2e6;
}
.accordion-summary .badge {
  font-size: 0.75rem;
}
.accordion-body .faq {
  background-color: #f8f9fa;
  padding: 0.75rem;
  border-radius: 6px;
}
.accordion-body .faq h4 {
  margin-bottom: 0.5rem;
}
.accordion-body .faq strong {
  color: #1565c0;
}

.wiki-categories .accordion-summary .row > div {
  padding: 8px 12px;
}
.wiki-categories .accordion-summary .badge {
  padding: 0.75rem 1rem;
  white-space: normal;
  line-height: 1.4;
}
.wiki-categories .accordion-item {
  margin-bottom: 16px;
}
/* 單個分類按鈕 */
.wiki-category-link {
  display: inline-block;
  border: 1px solid #1565c0;
  background-color: #f5faff;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;   /* 變更為更扁平 */
  font-size: 0.9rem;
  color: #1565c0;
  text-decoration: none;
  word-break: break-word;
  line-height: 1.2;
  font-weight: 500;
  max-height: 38px; /* 控制高度 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.wiki-category-link:hover {
  background-color: #e3f2fd;
  transform: translateY(-1px);
}

/* 包裹容器只顯示一行，超出隱藏 */
.wiki-category-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow: hidden;
}
.wiki-category-link {
  display: block;
  border: 1px solid #1565c0;
  background-color: #f5faff;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  color: #1565c0;
  text-decoration: none;
  word-break: break-word;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.wiki-category-link:hover {
  background-color: #e3f2fd;
}
.wiki-summary-text {
  max-height: 1.4em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: max-height 0.4s ease;
}
.wiki-summary-text.show-all {
  max-height: none;
  white-space: normal;
}
.wiki-category-container {
  transition: all 0.4s ease;
}
/* 讓tab滑動但隱藏滾動條 */
.wiki-tabs-wrapper {
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.wiki-tabs-wrapper::-webkit-scrollbar {
  display: none;
}
.wiki-tabs-wrapper .nav-tabs {
  flex-wrap: nowrap;
}
.wiki-tabs-wrapper .nav-link {
  white-space: nowrap;
  flex: 0 0 auto;
}

/* 主分類卡片大約 400px，所以min-width設大一倍保證滑動 */
#wikiTabsSafe {
  min-width: 800px;
}

/* active狀態 */
.wiki-tabs-wrapper .nav-link.active {
  background-color: #1565c0;
  color: #fff;
  border-color: #1565c0;
  transition: all 0.3s ease;
}
.wiki-tabs-wrapper .nav-link {
  transition: all 0.3s ease;
}

/* hover陰影 */
.wiki-accordion-item:hover {
  box-shadow: 0 0 10px rgba(21, 101, 192, 0.15);
}

/* 摘要一行 */
.wiki-summary-text {
  max-height: 1.4em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wiki-tabs-wrapper {
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  cursor: grab;
}
.wiki-tabs-wrapper::-webkit-scrollbar {
  display: none;
}
.wiki-tabs-wrapper .nav-link {
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: 80%;
  padding: 0.3rem 0.6rem;
}

.wiki-tabs-wrapper.grabbing {
  cursor: grabbing;
}
.wiki-tabs-wrapper .nav-tabs {
  flex-wrap: nowrap;
}

#wikiTabsSafe,
#wikiTabsNatural {
  min-width: 800px;
}
.wiki-tabs-wrapper .nav-link.active {
  background-color: #1565c0;
  color: #fff;
  border-color: #1565c0;
  transition: all 0.3s ease;
}
.wiki-tabs-wrapper .nav-link {
  transition: all 0.3s ease;
}
.wiki-accordion-item:hover {
  box-shadow: 0 0 10px rgba(21, 101, 192, 0.15);
}
.wiki-summary-text {
  max-height: 1.4em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wiki-v8-tabs-wrapper {
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  cursor: grab;
}
.wiki-v8-tabs-wrapper::-webkit-scrollbar {
  display: none;
}
.wiki-v8-tabs-wrapper .nav-link {
  white-space: nowrap;
  flex: 0 0 auto;
  font-size: 80%;
  padding: 0.3rem 0.6rem;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tabs { -ms-overflow-style: none; scrollbar-width: none; }
.nav-tabs .nav-link {
  white-space: nowrap;
  font-size: 80%;
  padding: 0.3rem 0.6rem;
}
#guide-wiki-v8-7 .nav-tabs .nav-link {
  color: #666;
  border: none;
  font-size: 80%;
  padding: 0.3rem 0.6rem;
}
#guide-wiki-v8-7 .nav-tabs .nav-link.active {
  color: #1565c0;
  font-weight: bold;
  border-bottom: 2px solid #1565c0;
  background-color: transparent;
}
#guide-wiki-v8-7 .accordion-body {
  padding: 0.5rem 1rem;
}
#wikiCollapse0 {
  margin-top: 0 !important;
}
#guide-wiki-v8-7 .p-3 {
  padding-bottom: 0.5rem !important;
}
#guide-wiki-v8-7 .p-3 p {
  margin-bottom: 0.25rem !important;
}
#guide-wiki-v8-7 .nav-tabs .nav-link {
  color: #666;
  border: none;
  font-size: 80%;
  padding: 0.3rem 0.6rem;
  transition: background-color 0.3s, border 0.3s;
}
#guide-wiki-v8-7 .nav-tabs .nav-link:hover {
  background-color: #e3f2fd;
  border-radius: 4px;
}
#guide-wiki-v8-7 .nav-tabs .nav-link.active {
  color: #1565c0;
  font-weight: bold;
  background-color: #e3f2fd;
  border: 1px solid #1565c0;
  border-radius: 4px;
}
.accordion-item {
  border: none;
}

.accordion-button {
  border: none;
  box-shadow: none;
}
.accordion-body {
  height: 220px;
  overflow-y: auto;
}

.nav-link.active {
  background-color: #1565c0 !important;
  color: #fff !important;
  border-radius: 4px;
}

.nav-link:hover {
  background-color: #e3f2fd;
}
.wiki-category-card p.small.text-secondary {
  display: -webkit-box;
  -webkit-line-clamp: 2;  /* 只顯示2行 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 3em; /* 大約2行高度，可微調 */
}

