.navbar {
    --bs-navbar-padding-y: 1rem;
    --bs-navbar-nav-link-padding-x: 1rem;
}

.nav-item {
    border-radius: 0.5rem;
    margin: 10px;
}

.navhover:hover {
    transition: all 0.5s ease;
}

.navhover:hover {
    background-color: rgba(0, 0, 0, 0.05)
}

#btn_top {
    z-index: 9999;
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 50px;
    height: 50px;
    border-radius: 999em;
    display: none;
}

body {
    min-width: 0px;
    margin: auto;
    font-family: 'Noto Sans TC', sans-serif;
}

.card-container {
    max-width: 1024px;
    margin: auto;
}

.card-text {
    color: black;
    text-decoration: none;
    text-align: justify;
}

#adbanner {
    position: fixed;
    bottom: 10%;
    left: 20px;
    display: flex;
    flex-direction: column;
    /* 垂直堆疊 */
    align-items: center;
    justify-content: flex-start;
    /* 使內容從上方開始排列 */
    height: auto;
    /* 讓高度根據內容自適應 */
    width: 250px;
    border-radius: 15px;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    transition: left 0.5s ease-in-out;
}

/* 設置廣告輪播位置與過渡效果 */
#adCarousel {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    display: flex;
    align-items: center;
    /* 垂直居中 */
    justify-content: center;
    /* 水平居中 */
}

/* 當廣告摺疊時移到右側 */
#adbanner.collapsed {
    left: -250px;
}

/* 隱藏摺疊後的箭頭按鈕 */
#toggleAdButton {
    position: absolute;
    bottom: 5%;
    right: -40px;
    font-size: 2rem;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    transition: right 0.5s ease-in-out;
    background: none;
}

/* 當廣告摺疊時，箭頭移動並且隱藏 */
#adbanner.collapsed+#toggleAdButton {
    right: 0;
    visibility: hidden;
}

/* 自訂的 SVG 按鈕樣式 */
#toggleAdButton svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

#currentDateTime {
    color: white;
}

#adbannertext {
    color: white;
}

/* ====== Grid（手機 1 欄；>=768px 兩欄） ====== */
.list-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 36px;
    padding-right: 32px;
}

@media (min-width:768px) {
    .list-grid {
        grid-template-columns: repeat(2, 1fr)
    }
}

/* ====== Card ====== */
.list-card {
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
    transition: box-shadow .7s ease, transform .65s ease;
}

.list-card:hover,
.list-card:focus-within {
    box-shadow: 0 8px 22px rgba(0, 0, 0, .08);
    transform: translateY(-5px);
}

.list-card picture { display: block; }
.list-card picture .thumb,
.list-card .thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: #eee;
  transition: filter .45s ease;
}
.list-card:hover picture .thumb,
.list-card:hover .thumb {
  filter: brightness(1.2);
}

.list-card .body {
    padding: 24px 24px 14px 24px;
}

.list-card .footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px 0 24px;
    color: #888;
    font-size: 13px;
    margin-bottom: 24px;
    transition: transform .2s ease, color .2s ease;
}

.list-card:hover .footer span:last-child {
  transform: translateX(5px);
  color: #444;
}

.list-card .meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 8px 0;
}

.list-card .pill {
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    color: #555
}

/* ====== RWD 行數限制（同時支援 .title/.excerpt 與 .card-title/.card-text） ====== */
/* 手機（預設）：標題 3 行、大綱 3 行 */
.title,
.card-title {
    font-size: 18px;
    font-weight: bold;
    color: #000;
    text-decoration: none !important;
    text-align: justify;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
    margin-bottom: 10px;
    line-height: 1.8;
    letter-spacing: 0.05em;
}

.excerpt,
.card-text {
    font-size: 16px;
    color: #000;
    text-decoration: none !important;
    text-align: justify;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.8;
    margin-bottom: 18px;
    letter-spacing: 0.05em;
}

/* 平板/桌機：標題 2 行、大綱 4 行 */
@media (min-width:768px) {

    .title,
    .card-title {
        -webkit-line-clamp: 2
    }

    .excerpt,
    .card-text {
        -webkit-line-clamp: 4
    }
}

/* ====== 快速搜尋 chips ====== */
.quickchips {
    margin: 16px 0 0px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    overflow-x: auto;
}

.quickchips .chip {
    border: 1px solid #cfd6dc;
    background: #fff;
    color: #374151;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: .2s;
    white-space: nowrap;
}

.quickchips .chip:hover {
    background: #f7f7f7;
    transform: scale(0.9)
}

.quickchips .chip.is-active {
    background: #111;
    color: #fff;
    border-color: #111
}

/* ====== 搜尋列（可沿用你現有樣式） ====== */
.searchbar__field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff
}

.searchbar__field input {
    flex: 1;
    border: 0;
    outline: 0;
    min-height: 48px;
    font-size: 14px;
    background: transparent;
    margin-left: 16px;
}

.searchbar__submit {
    border: 0;
    padding: 10px 16px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
    font-size: 14px;
}

.searchbar__submit:hover {
    transform: scale(0.9)
}

/* ====== 觀看更多 ====== */
.loadmore {
    display: grid;
    place-items: center;
    margin: 24px 0 48px
}

#btnMore {
    border: 1px solid #bbb;
    background: #fff;
    color: #555;
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: .15s
}

#btnMore:hover:not(:disabled) {
    background: #f7f7f7;
    transform: translateY(-1px)
}

#btnMore:disabled {
    opacity: .6;
    cursor: not-allowed
}

/* ====== 狀態列 ====== */
.statebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 32px 16px 32px;
    color: #555;
}

.reset {
    border: 1px solid #cfd6dc;
    background: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer
}

.search-bar-container {
    position: sticky;
    /* 或改成 fixed 讓它永遠吸附 */
    top: 0;
    z-index: 1000;
    background-color: white;
    /* 背景要填色，避免滾動時透到底 */
    padding-left: 32px;
    padding-right: 32px;
    padding-bottom: 16px;
    padding-top: 16px;
}

.body > a{
    text-decoration: none !important;
}

/* 確保所有連結都沒有底線 */
.list-card a {
    text-decoration: none !important;
}

.list-card a:hover {
    text-decoration: none !important;
}

.subclass{
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 12px;
    letter-spacing: .02em;
}