/* ===== tholos 設計 token 橋接層（暫時）=====
 * tholos 由 thoth 移植。本檔案內文已改用 alumi 設計分支（refactor/design-tokens 的
 * common/setting/_tokens.scss）的 token 命名：--space-* / --fs-* / --radius-*。
 * 但那套 token 尚未合進 main，全站還沒有人定義它們，故此處暫時就地定義（值＝_tokens.scss），
 * 討論區才不會因 var() 找不到而退回瀏覽器預設。
 *
 * 【未來整合步驟】設計分支合回 main、common 全域已提供這些 token 後：
 *   → 直接刪掉下面這整段 :root 即可（內文引用不用再動），global token 會自動接上。
 *   → 唯一要保留的是最後「tholos 專用」那幾個（設計分支沒有對應）。
 *
 * 註：--primary / --primary-color / --link-hover-color 由主題 + common.css 提供，此處不定義。 */
:root {
    /* 間距 --space-*（＝ _tokens.scss，值不變） */
    --space-1: 4px;
    --space-2: 8px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;

    /* 字級 --fs-*（rem，＝ _tokens.scss） */
    --fs-xs: 0.75rem;
    /* 12px */
    --fs-sm: 0.875rem;
    /* 14px */
    --fs-base: 1rem;
    /* 16px */
    --fs-md: 1.125rem;
    /* 18px */
    --fs-lg: 1.25rem;
    /* 20px */
    --fs-2xl: 2rem;
    /* 32px */

    /* 圓角 --radius-*（名稱本就與 _tokens.scss 對齊） */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --radius-full: 50%;
    --radius-pill: 9999px;

    /* ---- 以下為 tholos 專用：設計分支 _tokens.scss 沒有對應，整合後仍需保留 ---- */
    --card-bg: #fff;
    --success-color: #28a745;
    /* 捲軸：比照課程（course/detail）——細、track 透明、thumb 淺 */
    --scrollbar-size: 6px;
    --scrollbar-thumb-color: #d0d0d0;
    --scrollbar-thumb-hover: #bdbdbd;
}

/* [tholos整合:改用原站樣式，隱藏通用規則] .main-container
.main-container {
    padding-top: var(--space-8);
}
 */

/* 內容區底部留白，避免太貼 footer */
.main-container {
    padding-bottom: 80px;
}

/* [tholos整合:改用原站樣式，隱藏通用規則] .highlight
.highlight {
    background: #ffe066;
    padding: 0 2px;
    border-radius: var(--radius-sm);
}
 */

.community-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f2f5;
    border-radius: var(--radius-sm);
    color: #6c757d;
}

.community-dropdown {
    width: 300px;
}

/* 搜尋框樣式 */
.search-container {
    max-width: 400px;
    width: 100%;
}

/* 通知徽章樣式 */
/* [tholos整合:改用原站樣式，隱藏通用規則] .badge-pill.position-absolute
.badge-pill.position-absolute {
    top: -5px;
    right: -5px;
    font-size: var(--fs-xs);
}
 */

/* 卡片樣式 */
/* [tholos整合:改用原站樣式，隱藏通用規則] .card
.card {
    border-radius: var(--radius-md);
    overflow: hidden;
}
 */

/* [tholos整合:改用原站樣式，隱藏通用規則] .card-header
.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
 */

/* 分類標籤樣式 */
.category-tags .btn {
    margin-bottom: var(--space-2);
    border-radius: var(--radius-xl);
}

.category-tags .btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* 用戶頭像樣式 */
.avatar-group img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: -8px;
    object-fit: cover;
}

.avatar-group img.border.border-white {
    border: 2px solid #fff;
}

/* 導覽列 SVG 頭像 */
.tholos-nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
}

.tholos-nav-avatar svg {
    width: 100%;
    height: 100%;
}

/* 通用 Multiavatar 頭像 */
.tholos-avatar {
    border-radius: 50%;
    overflow: hidden;
    display: inline-block;
    flex-shrink: 0;
}

.tholos-avatar svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* 文章卡片樣式 */
.post-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
}

/* 列表卡片上的讚／留言只是統計顯示，非互動元件：
   關掉滑鼠事件（不再有 hover/active 按下效果與 pointer 游標），
   點擊會穿透到卡片本身而開啟該篇文章。 */
.post-card .btn-like,
.post-card .btn-action {
    pointer-events: none;
    cursor: default;
    box-shadow: none;
}

/* 貼文操作下拉選單樣式 */
.post-actions {
    position: relative;
    z-index: 1000;
}



.post-actions-dropdown {
    border: 0;
    background-color: rgba(0, 0, 0, 0.04);
    color: #6c757d;
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.post-actions-dropdown:hover {
    background-color: rgba(0, 0, 0, 0.08);
    color: #495057;
}

/* 圓形 icon 鈕不需 Bootstrap 的下拉三角 */
.post-actions-dropdown.dropdown-toggle::after {
    display: none;
}

.post-actions-dropdown:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.post-actions .dropdown-menu {
    min-width: 200px;
    border-radius: var(--radius-md);
    box-shadow: 0 var(--space-2) var(--space-4) rgba(0, 0, 0, 0.175);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1050;
}

.post-actions .dropdown-item {
    padding: var(--space-2) var(--space-4);
    color: #495057;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.post-actions .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #495057;
}

/* 完全重構留言和回覆樣式 */
.comment-container {
    margin-bottom: var(--space-8);
}

.comment-item {
    position: relative;
    margin-bottom: var(--space-6);
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-2);
}

.comment-header img.rounded-circle {
    width: 40px;
    height: 40px;
    object-fit: cover;
    margin-right: 0.75rem;
}

.comment-header .user-info {
    display: flex;
    flex-direction: column;
}

.comment-header .user-name {
    font-weight: 600;
    margin-bottom: 0;
}

.comment-header .comment-meta {
    font-size: var(--fs-xs);
    color: #6c757d;
}

.comment-content {
    margin-left: 50px;
    margin-bottom: var(--space-2);
}

.comment-actions {
    display: flex;
    align-items: center;
}

/* [#1] 留言操作列：icon 與文字垂直置中對齊
 * btn 內 Phosphor 字形基線與文字不齊，改為 inline-flex 置中 */
.comment-actions .btn {
    display: inline-flex;
    align-items: center;
}

/* 多層回覆樣式 */
.replies-container {
    margin-left: 50px;
    margin-top: var(--space-4);
}

/* 統一所有回覆的樣式 */
.reply-item {
    margin-top: var(--space-4);
    margin-bottom: var(--space-4);
    background-color: #f8f9fa;
    border-radius: var(--radius-md);
    padding: var(--space-4);
    position: relative;
    margin-left: 50px;
}

/* 回覆表單樣式 */
.reply-form {
    margin-top: var(--space-4);
    padding: var(--space-4);
    background-color: #f8f9fa;
    border-radius: var(--radius-md);
    border: 1px solid #dee2e6;
}

.reply-form textarea {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    resize: vertical;
}

.reply-form textarea:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.reply-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-2);
}

.reply-header img.rounded-circle {
    width: 32px;
    height: 32px;
    object-fit: cover;
    margin-right: 0.75rem;
}

.reply-header .user-info {
    display: flex;
    flex-direction: column;
}

.reply-header .user-name {
    font-weight: 600;
    margin-bottom: 0;
}

.reply-header .reply-meta {
    font-size: var(--fs-xs);
    color: #6c757d;
}

.reply-content {
    margin-left: 44px;
    margin-bottom: var(--space-2);
}

.reply-actions {
    margin-left: 44px;
    display: flex;
    align-items: center;
}

.reply-actions .btn-link {
    padding: 0;
    font-size: var(--fs-sm);
    color: #6c757d;
    margin-right: var(--space-4);
}

.reply-actions .btn-link:hover {
    color: #007bff;
    text-decoration: none;
}

/* 回覆表單樣式 */
.reply-form {
    width: 100%;
    margin-top: var(--space-4);
    margin-bottom: var(--space-4);
    background-color: #f8f9fa;
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.reply-form-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-2);
}

.reply-form-header img.rounded-circle {
    width: 32px;
    height: 32px;
    object-fit: cover;
    margin-right: 0.75rem;
}

.reply-form textarea {
    width: 100%;
    resize: vertical;
}

.reply-form-actions {
    display: flex;
    justify-content: flex-end;
}

.reply-form-actions .btn {
    margin-left: var(--space-2);
}

/* 按讚效果 */
.btn-like {
    cursor: pointer;
}

.btn-like.active {
    color: var(--primary-color);
}

.btn-like.active i {
    transform: scale(1.2);
}

.post-image-carousel {
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: var(--space-4) 0;
}

.post-image-carousel .carousel-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.notification-item.unread {
    background-color: rgba(13, 110, 253, 0.05);
}

.notification-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.notification-dropdown {
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}

.notification-dropdown .dropdown-header {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.notification-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f1f1f1;
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item .text-muted {
    font-size: var(--fs-sm);
}

.notification-item strong {
    font-weight: 600;
}

.notification-item.unread {
    background-color: #f0f7ff;
}

/* [tholos整合:改用原站樣式，隱藏通用規則] .rounded-circle
.rounded-circle {
    border-radius: 50% !important;
    object-fit: cover;
}
 */

.notification-dropdown .rounded-circle {
    width: 36px;
    height: 36px;
}

/* [tholos整合:改用原站樣式，隱藏通用規則] .dropdown-menu
.dropdown-menu {
    padding: 0;
    border-radius: var(--radius-md);
    box-shadow: 0 var(--space-2) var(--space-4) rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1050;
}
 */

/* 特定的通知和訊息下拉選單樣式 */
#messageDropdown+.dropdown-menu,
#notificationDropdown+.dropdown-menu {
    min-width: 320px;
    max-width: 320px;
}

/* [tholos整合:改用原站樣式，隱藏通用規則] .dropdown-menu-right
.dropdown-menu-right {
    right: 0;
    left: auto !important;
}
 */

#messageDropdown+.dropdown-menu,
#notificationDropdown+.dropdown-menu {
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

/* [tholos整合:改用原站樣式，隱藏通用規則] .dropdown-header
.dropdown-header {
    padding: var(--space-2) var(--space-4);
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
}
 */

/* [tholos整合:改用原站樣式，隱藏通用規則] .dropdown-item
.dropdown-item {
    padding: var(--space-2) var(--space-4);
    white-space: normal;
    font-size: var(--fs-sm);
}
 */

/* [tholos整合:改用原站樣式，隱藏通用規則] .dropdown-item:last-child
.dropdown-item:last-child {
    border-bottom: none;
}
 */

/* [tholos整合:改用原站樣式，隱藏通用規則] .position-relative .badge-pill.position-absolute
.position-relative .badge-pill.position-absolute {
    top: -5px;
    right: -5px;
    font-size: var(--fs-xs);
    padding: var(--space-1) 0.4rem;
}
 */

#userDropdown img.rounded-circle {
    width: 36px;
    height: 36px;
    object-fit: cover;
}

#messageDropdown i,
#notificationDropdown i {
    font-size: var(--fs-lg);
}

/* [tholos整合:改用原站樣式，隱藏通用規則] .navbar .d-flex.align-items-center
.navbar .d-flex.align-items-center {
    display: flex !important;
    flex-direction: row !important;
}
 */

/* [tholos整合:改用原站樣式，隱藏通用規則] .navbar .logged-in-content
.navbar .logged-in-content {
    display: flex;
    flex-direction: row;
    align-items: center;
}
 */

/* [tholos整合:改用原站樣式，隱藏通用規則] .navbar .dropdown
.navbar .dropdown {
    margin-right: var(--space-4);
}
 */

/* [tholos整合:改用原站樣式，隱藏通用規則] .navbar .dropdown:last-child
.navbar .dropdown:last-child {
    margin-right: 0;
}
 */

/* [tholos整合:改用原站樣式，隱藏通用規則] .navbar .btn-link
.navbar .btn-link {
    padding: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
 */

/* [tholos整合:改用原站樣式，隱藏通用規則] .navbar .position-relative
.navbar .position-relative {
    display: inline-block;
}
 */

/* ==== 討論區導覽列：隔離客戶站佈景主題對通用 .navbar / .navbar-brand 的污染 ==== */
/* 討論區導覽列沿用通用 Bootstrap class，但客戶站的佈景主題（style_x/main.css 與各站
   theme_live.css）也會針對「站方自己的主選單」去改這些同名 class——例如把 logo 寬度
   鎖成 120~150px、加 padding-top:56px 等。這些規則會漏進討論區導覽列把它夾壞：最明顯
   的是品牌字「Compassio Tholos」被 max-width 截斷又 nowrap 溢出，壓到旁邊的討論區下拉
   鈕造成文字重疊。以下用 .tholos-navbar 命名空間把受影響的屬性還原。 */
.tholos-navbar .navbar-brand {
    max-width: none;
}

nav.tholos-navbar {
    padding: 0.5rem 1rem;
}

.reply-item .flex-grow-1 {
    min-width: 0;
    width: 100%;
}

.reply-form .flex-grow-1 {
    min-width: 0;
    width: 100%;
}

.reply-form .text-right {
    text-align: right;
}

.comment-item {
    margin-bottom: var(--space-6);
}

.reply-item+.reply-item {
    margin-top: var(--space-4);
}

/* [tholos整合:改用原站樣式，隱藏通用規則] .dropdown-toggle::after
.dropdown-toggle::after {
    margin-left: var(--space-2);
}
 */

/* [tholos整合:改用原站樣式，隱藏通用規則] .dropdown-item
.dropdown-item {
    display: flex;
    align-items: center;
    padding: var(--space-2) var(--space-4);
}
 */

/* [tholos整合:改用原站樣式，隱藏通用規則] .dropdown-item.active
.dropdown-item.active {
    background-color: #f8f9fa;
    color: #212529;
    font-weight: 500;
}
 */

/* [tholos整合:改用原站樣式，隱藏通用規則] .dropdown-item i
.dropdown-item i {
    width: var(--fs-lg);
    text-align: center;
}
 */

@media (max-width: 767.98px) {
    .category-tags .dropdown {
        margin-top: var(--space-2);
        width: 100%;
    }

    .category-tags .dropdown-toggle {
        width: 100%;
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .category-tags .dropdown-toggle::after {
        margin-left: auto;
    }
}

.thumbnail-row {
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-left: 40px;
    padding-right: 40px;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb-color) transparent;
}

.thumbnail-row::-webkit-scrollbar {
    height: var(--scrollbar-size);
}

.thumbnail-row::-webkit-scrollbar-track {
    background: transparent;
}

.thumbnail-row::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb-color);
    border-radius: 10px;
}

.thumbnail-row::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.post-thumbnails-carousel {
    margin: 0 -5px;
}

.post-thumbnails-carousel .slick-slide {
    padding: 0 5px;
}

.carousel-thumbnail {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    width: 100%;
    height: 180px;
}

.carousel-thumbnail:hover {
    transform: translateY(-3px);
}

.carousel-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

.carousel-thumbnail:hover img {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.post-thumbnails-carousel .slick-prev,
.post-thumbnails-carousel .slick-next {
    width: 32px;
    height: 32px;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.post-thumbnails-carousel .slick-prev:before,
.post-thumbnails-carousel .slick-next:before {
    font-size: 12px;
}

.post-thumbnails-carousel .slick-prev {
    left: -10px;
}

.post-thumbnails-carousel .slick-next {
    right: -10px;
}

.post-thumbnails-carousel .slick-prev:hover,
.post-thumbnails-carousel .slick-next:hover {
    background-color: white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.post-thumbnails-carousel .slick-prev:before,
.post-thumbnails-carousel .slick-next:before {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: #333;
    opacity: 0.8;
}

.post-thumbnails-carousel .slick-prev:before {
    content: '\f053';
}

.post-thumbnails-carousel .slick-next:before {
    content: '\f054';
}

.video-thumbnail .position-relative {
    width: 100%;
    height: 100%;
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0.7;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumbnail:hover .video-play-overlay {
    opacity: 1;
}

.video-play-button {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.video-thumbnail:hover .video-play-button {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.9) !important;
}

.fancybox-caption {
    padding: 10px 20px !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: var(--fs-base);
    text-align: center;
}

.fancybox-button {
    background-color: rgba(30, 30, 30, 0.8) !important;
}

.fancybox-button:hover {
    background-color: rgba(30, 30, 30, 1) !important;
}

@media (max-width: 767.98px) {
    .carousel-thumbnail img {
        height: 150px;
    }

    .post-thumbnails-carousel .slick-prev {
        left: -5px;
    }

    .post-thumbnails-carousel .slick-next {
        right: -5px;
    }

    .post-thumbnails-carousel .slick-prev,
    .post-thumbnails-carousel .slick-next {
        width: 32px;
        height: 32px;
    }
}

.notification-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background-color: #007bff;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 通知頁面專用樣式 */
.notification-item.unread {
    background-color: rgba(0, 123, 255, 0.05);
    border-left: 3px solid #007bff;
}

.notification-item {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.notification-item:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

.notification-item .font-weight-bold {
    color: #212529;
}

.notification-item .text-primary {
    color: #007bff !important;
}

.notification-item .text-primary:hover {
    color: #0056b3 !important;
    text-decoration: none;
}

/* 通知分類側邊欄樣式 */
.notification-categories .list-group-item {
    border: none;
    border-radius: 0;
    padding: var(--space-2) var(--space-4);
    transition: all 0.2s ease;
}

.notification-categories .list-group-item:hover {
    background-color: #f8f9fa;
}

.notification-categories .list-group-item.active {
    background-color: #007bff;
    color: white;
    border-left: 3px solid #0056b3;
}

.notification-categories .list-group-item.active .badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

/* 響應式設計優化 */
@media (max-width: 768px) {
    .notification-item {
        padding: 1rem;
    }

    .notification-item .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .notification-item .position-relative {
        margin-bottom: var(--space-2);
    }

    .notification-item .d-flex.justify-content-between {
        flex-direction: row;
        width: 100%;
    }
}

.conversation-list {
    height: calc(100vh - 200px);
    overflow-y: auto;
}

.chat-body {
    height: calc(100vh - 300px);
    overflow-y: auto;
    padding: 1rem;
}

.message-bubble {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--space-4);
    background-color: #f8f9fa;
    max-width: 75%;
    display: inline-block;
}

.message-bubble.sent {
    background-color: #007bff;
    color: white;
}

.message {
    margin-bottom: var(--space-4);
}

.message-time {
    font-size: var(--fs-xs);
    color: #6c757d;
    margin-top: var(--space-1);
}

.conversation-list .list-group-item {
    border-left: none;
    border-right: none;
}

.conversation-list .list-group-item:first-child {
    border-top: none;
}

.conversation-list .list-group-item.active {
    background-color: rgba(0, 123, 255, 0.1);
    border-color: rgba(0, 0, 0, 0.125);
    color: inherit;
}

.chat-input {
    border-top: 1px solid rgba(0, 0, 0, 0.125);
    padding: var(--space-4);
    background-color: white;
}

.chat-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    padding: var(--space-4);
    background-color: white;
}

/* [tholos整合:改用原站樣式，隱藏通用規則] .rounded-circle
.rounded-circle {
    object-fit: cover;
}
 */

/* [tholos整合:改用原站樣式，隱藏通用規則] .text-truncate
.text-truncate {
    max-width: 90%;
}
 */

.discover-header {
    text-align: center;
    padding: var(--space-4) 0;
}

.discover-header h1 {
    font-size: var(--fs-lg);
    font-weight: 700;
    margin-bottom: var(--space-4);
}

.discover-header p a {
    color: var(--primary-color);
    text-decoration: none;
}

.search-bar {
    position: relative;
    max-width: 800px;
    margin: 0 auto var(--space-12);
}

.search-bar .input-group {
    background: white;
    border-radius: var(--radius-pill);
    /* 膠囊：原為 --radius-full(50%) 會變橢圓 */
    padding: var(--space-2);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.search-bar input {
    border: none;
    font-size: var(--fs-md);
    padding: var(--space-2) var(--space-4);
}

.search-bar input:focus {
    box-shadow: none;
}

.search-bar .input-group-text {
    background: transparent;
    border: none;
    color: #6c757d;
    font-size: var(--fs-lg);
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    transition: all 0.3s ease;
    position: relative;
    padding-top: 3px;
}

.category-tags.expanded {
    max-height: inherit;
}

.more-button {
    position: absolute;
    right: 0;
    top: 3px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
}

.less-button {
    display: none;
}

.category-tags.expanded .more-button {
    display: none;
}

.category-tags.expanded .less-button {
    display: inline-flex;
}

/* 桌機改為自然換行，手機改水平卷軸；不再需要 fade 漸層遮罩 */
@media (max-width: 767.98px) {
    .category-tags {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: var(--space-1);
    }

    .category-tags::-webkit-scrollbar {
        display: none;
    }
}

.category-btn {
    transition: all 0.2s ease;
    background-color: #fff;
    border: 1px solid #e9ecef;
    font-size: var(--fs-xs);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-pill);
    /* 膠囊：原為 --radius-full(50%) 會變橢圓 */
    color: #495057;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-right: 0.2rem;
    margin-bottom: var(--space-2);
    white-space: nowrap;
    flex-shrink: 0;
}

.category-btn:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 500;
    border-color: #e9ecef;
}

.category-btn.active:focus {
    box-shadow: none;
    outline: none;
}

.category-tag .emoji {
    margin-right: var(--space-2);
    font-size: var(--fs-lg);
}

.community-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.community-card-link {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.community-card-link:hover {
    text-decoration: none;
    color: inherit;
    transform: translateY(-4px);
}

.community-card-link:hover .community-card {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.community-cover {
    position: relative;
    width: 100%;
    overflow: hidden;
    flex-shrink: 0;
}

/* 封面自然比例、不裁切；卡片等高由 flexbox（card flex 直向 + content flex:1）負責，不靠封面固定高度 */
.community-cover-img {
    display: block;
    width: 100%;
    height: auto;
}

/* 大廳卡片：鎖定狀態、封面鎖定遮罩、統計 icon（原本散在 forum-list.php 內嵌 style，收斂至此單一來源） */
.community-card-locked {
    opacity: 0.85;
}

.community-locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
}

.community-stats i {
    color: #aaa;
}

/* [#1] 標籤 icon 與文字垂直置中對齊：badge 預設 inline-block，
 * Phosphor 字形基線與文字不齊，改為 inline-flex 置中 */
.community-cover .badge {
    display: inline-flex;
    align-items: center;
}

.community-content {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.community-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.community-title {
    font-size: var(--fs-md);
    font-weight: 600;
    margin-bottom: 2px;
}

.community-creator {
    font-size: var(--fs-xs);
    color: #6b7280;
    margin: 0;
}

.community-description {
    font-size: var(--fs-sm);
    color: #4b5563;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.community-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    margin-top: auto;
    padding-top: var(--space-4);
}

.community-stats {
    display: flex;
    align-items: center;
}

.community-stats span {
    color: #6b7280;
    font-size: var(--fs-xs);
}

.activity-badge {
    color: #6b7280;
    font-size: var(--fs-xs);
}

.activity-badge i {
    font-size: 0.375rem;
    color: #10b981;
}

/* [tholos整合:改用原站樣式，隱藏通用規則] .badge.badge-light
.badge.badge-light {
    font-size: var(--fs-xs);
}
 */

@media (max-width: 768px) {
    .community-content {
        padding: var(--radius-lg);
    }
}

.profile-avatar {
    position: relative;
}

.online-indicator {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 12px;
    height: 12px;
    background-color: var(--success-color);
    border: 2px solid var(--card-bg);
    border-radius: 50%;
}

/* [tholos整合:改用原站樣式，隱藏通用規則] .rounded-circle
.rounded-circle {
    object-fit: cover;
}
 */

.avatar-sm {
    width: 24px;
    height: 24px;
}

.avatar-md {
    width: 36px;
    height: 36px;
}

.avatar-lg {
    width: 48px;
    height: 48px;
}

.avatar-xl {
    width: 64px;
    height: 64px;
}

.avatar-xxl {
    width: 128px;
    height: 128px;
}

.avatar-group img:first-child {
    margin-left: 0;
}

.more-categories {
    display: none;
    width: 100%;
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid #e9ecef;
}


.filter-dropdown .dropdown-toggle {
    padding: var(--space-2) var(--space-4);
    font-size: var(--fs-sm);
    color: #495057;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: var(--radius-pill);
    /* 膠囊：原為 --radius-full(50%) 會變橢圓 */
    height: 36px;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

/* 前導排序圖示轉灰，弱化為輔助元素（caret 為 ::after，不受影響） */
.filter-dropdown .dropdown-toggle i {
    color: #adb5bd;
}

.filter-dropdown .dropdown-toggle:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.filter-dropdown .dropdown-toggle:focus,
.filter-dropdown .dropdown-toggle.show {
    color: var(--primary-color);
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.15rem color-mix(in srgb, var(--primary-color), transparent 78%);
}

.filter-dropdown .dropdown-menu {
    min-width: 160px;
    margin-top: var(--space-2);
    padding: var(--space-1) 0;
    border-radius: var(--radius-md);
    border: 1px solid #e9ecef;
    box-shadow: 0 var(--space-2) var(--space-6) rgba(0, 0, 0, 0.12);
    right: 0;
    left: auto !important;
}

.filter-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--fs-sm);
    color: #495057;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* 選項圖示固定寬度對齊；預設轉灰 */
.filter-dropdown .dropdown-item i {
    width: 1em;
    text-align: center;
    color: #adb5bd;
}

.filter-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.filter-dropdown .dropdown-item:hover i {
    color: var(--primary-color);
}

/* 選中列（金底白字，主題已把 .active 接主色）：hover 仍維持金底，圖示同步轉白 */
.filter-dropdown .dropdown-item.active,
.filter-dropdown .dropdown-item.active:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.filter-dropdown .dropdown-item.active i,
.filter-dropdown .dropdown-item.active:hover i {
    color: #fff;
}

/* 響應式修復：小螢幕上的篩選下拉選單 */
@media (max-width: 767.98px) {
    .filter-dropdown {
        position: relative;
        width: auto;
    }

    .filter-dropdown .dropdown-menu {
        position: absolute !important;
        right: 0 !important;
        left: auto !important;
        transform: none !important;
        top: 100% !important;
        margin-top: var(--space-1);
        min-width: 140px;
        z-index: 1050;
        max-width: 200px;
    }

    .filter-dropdown .dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        text-align: left;
    }

    /* 確保下拉選單不會被截斷 */
    .filter-dropdown .dropdown-menu.show {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (max-width: 575.98px) {
    .filter-dropdown .dropdown-menu {
        min-width: 120px;
        right: 0 !important;
        left: auto !important;
        max-width: 180px;
    }

    .filter-dropdown .dropdown-toggle {
        font-size: var(--fs-xs);
        padding: 0.4rem 0.8rem;
    }
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 123, 255, 0.1);
    border-radius: var(--radius-xl);
    color: #007bff;
}

.stats-card {
    background-color: #f8f9fa;
    border-radius: var(--radius-md);
    padding: var(--space-6);
}

.community-info-card .community-stats {
    text-align: center;
    margin-bottom: var(--space-4);
}

.community-info-card .community-stats h5 {
    margin-bottom: var(--space-1);
    font-weight: 500;
    font-size: var(--fs-lg);
}

.community-info-card .community-stats small {
    color: #6c757d;
}

.community-category-tags {
    margin: 0 auto var(--space-8);
    max-width: 900px;
}

.community-category-tags .d-flex {
    gap: var(--space-2);
}

.community-category-tags .community-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-pill);
    /* 膠囊：原為 --radius-full(50%) 會變橢圓 */
    background: white;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid #dee2e6;
    font-size: var(--fs-sm);
    margin-bottom: var(--space-2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.community-category-tags .community-tag:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    text-decoration: none;
    color: #212529;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.community-category-tags .community-tag.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.community-category-tags .community-tag.clicked {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.community-category-tags .community-tag {
    cursor: pointer;
}

/* 側邊資訊卡封面：自然比例、不裁切（只有大廳格狀卡片才固定 16:9） */
.community-info-card .card-img-top img {
    display: block;
    width: 100%;
    height: auto;
}

.community-info-card .card-body {
    padding-top: var(--space-6);
}


.community-info-card .community-links a {
    display: block;
    margin-bottom: var(--space-2);
    transition: color 0.2s ease;
}

.community-links i {
    font-size: var(--fs-xs);
}

.community-info-card .community-links a:last-child {
    margin-bottom: 0;
}

/* 討論區卡片：比照課程內頁 .purchase-block 的柔和樣式
 * （原本走 Bootstrap 預設 .card：4px 直角 + rgba(0,0,0,.125) 灰邊 + shadow-sm，偏硬）
 * scope 限縮在 .main-container（討論區各頁最外層專屬容器），一次涵蓋左右欄所有卡片，
 * 不外溢全站其他 .card（tholos.css 是全站載入）。 */
.main-container .card {
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-lg);
    /* 12px */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    /* 蓋掉 .shadow-sm 的硬陰影 */
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

/* hover 只加深陰影、不位移：大內容卡不會跳動，也不覆蓋 .post-card 自己的上浮 */
.main-container .card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.main-container .card-body {
    padding: var(--space-6);
    /* 24px，比 Bootstrap 預設 20px 更寬鬆 */
}

.popular-posts .list-group-item-action {
    padding: var(--space-4) 0;
}

.popular-posts .list-group-item-action:hover {
    background-color: transparent;
}

.popular-posts .list-group-item-action:hover h6 {
    color: var(--link-hover-color);
}

.popular-posts .author-avatar {
    width: 24px;
    height: 24px;
}

#createPostModal .modal-content {
    border-radius: var(--radius-xl);
    /* 關閉鈕改為絕對定位，需有定位參考 */
    position: relative;
}

/* [#1] 關閉鈕：改用 Phosphor ph-x，並對齊 modal 右上邊緣 */
#createPostModal .modal-header .close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    margin: 0;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    font-size: var(--fs-lg);
    line-height: 1;
    color: #6c757d;
    opacity: 1;
    transition: background-color 0.2s, color 0.2s;
}

#createPostModal .modal-header .close:hover {
    background-color: #f4f6f8;
    color: #333;
}

/* [#2] 標題與內容左緣對齊：標題（form-control-lg）預設左內距較大，
 * 統一為 --space-2，與 #postContent 的 padding 對齊 */
#createPostModal #postTitle {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
}

#createPostModal .form-control {
    box-shadow: none;
}

#createPostModal .form-control:focus {
    box-shadow: none;
    background-color: #f8f9fa;
}

/* Contenteditable div 樣式 */
#postContent[contenteditable="true"] {
    outline: none;
    border: 1px solid transparent;
    transition: border-color 0.2s;
    min-height: 120px;
    max-height: 300px;
    overflow-y: auto;
    padding: var(--space-2);
    line-height: 1.5;
}


#postContent[contenteditable="true"]:empty:before {
    content: attr(placeholder);
    color: #6c757d;
    pointer-events: none;
}



/* [tholos整合] 卡片標題改用全站共用的 .middle-title（見各 view 的 class 標記），
 * 這裡不再覆蓋 h5.card-title / h5.modal-title 字級。
 * 原規則：h5.card-title, h5.modal-title { font-size: var(--fs-md); font-weight: 600; } */

/* 對話列表：拿掉卡片框，改用分隔線區隔（左欄專屬，不影響右欄側欄卡片）
 * 蓋掉 .shadow-sm / .main-container .card 的邊線與陰影，走扁平分隔線列表。 */
.posts-container .post-card {
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
    background: transparent;
    /* 貼文 class 帶 Bootstrap .border-0（border:0 !important），分隔線得用 !important 才壓得過 */
    border-bottom: 1px solid rgba(0, 0, 0, 0.15) !important;
    margin-bottom: 0 !important;
    overflow: visible;
    transition: background-color 0.15s ease;
}

/* 最後一篇不留線，收尾乾淨 */
.posts-container .post-card:last-child {
    border-bottom: 0;
}

/* hover 不再上浮/加陰影，改極淡底色當回饋 */
.posts-container .post-card:hover {
    box-shadow: none !important;
    background-color: rgba(0, 0, 0, 0.015);
}

/* pinned 貼文的 card-header：flat 模式下拿掉底線與底色，跟內文連成一體 */
.posts-container .post-card .card-header {
    border-bottom: 0;
    background: transparent !important;
    padding: var(--space-4) var(--space-4) 0;
}

.posts-container .post-card .row {
    padding-top: 0;
}

.posts-container .post-card .card-title.middle-title {
    margin-bottom: 0.5rem;
}

/* post-detail 內文/留言：跟列表一致的扁平風，去卡片框 */
.main-container .post-detail-card {
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
    background: transparent;
}

/* 純內容區塊，不是可點卡片 → 關掉 .main-container .card:hover 的浮起陰影 */
.main-container .post-detail-card:hover {
    box-shadow: none !important;
}

.main-container .post-detail-card .card-body {
    /* 內頁純內容、無 hover，水平內距歸零讓內容與返回連結、分隔線切齊 */
    padding: var(--space-6) 0;
}

/* #2 文章卡上緣對齊右欄卡片上緣：只移除文章卡的上內距（留言卡保留其上內距） */
.main-container .post-detail-card:not(.post-detail-comments) .card-body {
    padding-top: 0;
}

/* 文章與留言區之間用一條分隔線收邊 */
.main-container .post-detail-comments {
    border-top: 1px solid rgba(0, 0, 0, 0.12);
}

/* 每則留言之間用淡分隔線隔開（次級內容，比主線淡一階） */
.post-detail-comments .comments-list .comment-item {
    margin: 0 !important;
    padding: var(--space-6) 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.post-detail-comments .comments-list .comment-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

/* #3 留言操作（讚/回覆）是 Bootstrap .btn-link，基本狀態就有底線 → 全狀態關掉 */
.comment-actions .btn,
.comment-actions .btn:hover,
.comment-actions .btn:focus,
.comment-actions .btn:active {
    text-decoration: none;
}

/* #1 貼文操作（分享/收藏）也是 Bootstrap .btn-link，hover/focus/active 會加底線 → 關掉 */
.post-actions .btn:hover,
.post-actions .btn:focus,
.post-actions .btn:active {
    text-decoration: none;
}

/* #5 導覽列下拉鈕（社群/訊息/通知/使用者）也是 Bootstrap .btn-link，hover/focus/active 會加底線 → 關掉 */
.tholos-navbar .btn-link:hover,
.tholos-navbar .btn-link:focus,
.tholos-navbar .btn-link:active {
    text-decoration: none;
}

/* 發布後的貼文內容樣式 */
.post-card .card-text {
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-card .card-text br {
    display: block;
    content: "";
    margin: var(--space-1) 0;
}

/* 確保縮圖正確顯示 */
.post-thumbnail {
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 140px;
    object-position: center top;
}

/* 修復貼文卡片布局：flat 列表保留左右內距，讓內容有呼吸、hover 底色不貼邊 */
.post-card .card-body {
    padding: var(--space-6) var(--space-4);
}

.post-card .row {
    margin: 0;
}

.post-card .col-md-8,
.post-card .col-md-4 {
    padding: 0;
}

.post-card .col-md-4 {
    padding-left: var(--space-4);
}

#createPostModal .btn-light.rounded-circle {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#createPostModal .btn-light.rounded-circle:hover {
    background-color: #e9ecef;
}

#createPostModal .avatar-md {
    width: 48px;
    height: 48px;
    object-fit: cover;
}

#createPostModal select.form-control {
    font-size: var(--fs-sm);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-xl);
}

#imagePreviewContainer {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: var(--space-2);
    gap: var(--space-2);
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
    min-height: 100px;
}

#imagePreviewContainer::-webkit-scrollbar {
    display: none;
}

.preview-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s ease;
}

.preview-nav-arrow:hover {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.preview-nav-arrow.prev {
    left: 5px;
}

.preview-nav-arrow.next {
    right: 5px;
}

.preview-nav-arrow.hidden {
    display: none;
}

.image-preview-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.image-preview-item:hover .image-preview-remove,
.file-preview-item:hover .image-preview-remove,
.video-preview-item:hover .video-preview-remove {
    opacity: 1;
}

.upload-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    z-index: 10;
}

.upload-progress-spinner {
    color: #fff;
    font-size: 20px;
    margin-bottom: 8px;
}

.upload-progress-bar {
    width: 80%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.upload-progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #00d4ff);
    border-radius: 3px;
    transition: width 0.2s ease-out;
    width: 0%;
}

.upload-progress-text {
    color: #fff;
    font-size: 12px;
    font-weight: 500;
}

.upload-progress-text .ph-check {
    color: #4caf50;
    margin-right: 4px;
}

/* Phosphor icon 遷移（原 Font Awesome）：尺寸與載入旋轉 */
/* Phosphor 視覺上比 FA 實心細，討論區內統一放大一點補回視覺重量 */
/* scope 限 .main-container / .tholos-navbar（皆討論區專屬），不外溢其他頁 */
/* 同時涵蓋 .ph（一般）與 .ph-fill（按讚/收藏實心），切換時尺寸才一致 */
.main-container .ph,
.main-container .ph-fill,
.tholos-navbar .ph,
.tholos-navbar .ph-fill {
    font-size: 1.15em;
    /* Phosphor 字符坐在基線上、放大後視覺中心偏高，行內接文字會顯得沒對齊；
     * 補基線微調（同 Font Awesome 預設值）。flex 置中或 d-block 的 icon 會忽略此值，無副作用 */
    vertical-align: -0.125em;
}

/* .badge 是 Bootstrap 預設 font-size:75%，內含 icon 會被連帶縮小，單獨補大 */
.main-container .badge .ph,
.main-container .badge .ph-fill {
    font-size: 1.3em;
}

/* 空狀態大圖維持 2rem，須排在放大規則之後以勝出 */
.main-container .tholos-icon-lg,
.tholos-icon-lg {
    font-size: 2rem;
}

.ph-spin {
    display: inline-block;
    animation: ph-spin 0.9s linear infinite;
}

@keyframes ph-spin {
    to {
        transform: rotate(360deg);
    }
}

.video-preview-item {
    position: relative;
    width: 160px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.video-preview-item .video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-preview-item .video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-preview-item .video-platform-icon {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.video-preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.upload-placeholder {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    border: 2px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
    order: 999;
}

.upload-placeholder:hover {
    background-color: #f8f9fa;
}

.upload-placeholder .plus-icon {
    font-size: 24px;
    color: #aaa;
}

.file-preview-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: #f8f9fa;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-preview-item .file-icon {
    font-size: 32px;
    color: #6c757d;
    margin-bottom: 10px;
}

.file-preview-item .file-name {
    font-size: 12px;
    color: #333;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 5px;
}

.file-preview-item .file-size {
    font-size: 10px;
    color: #6c757d;
}

/* 統一文件圖標顏色 */
.file-preview-item .file-icon {
    color: #6c757d;
}

/* 統一文件圖標背景色 */
.file-icon {
    background-color: #f8f9fa !important;
}

.preview-container-wrapper {
    position: relative;
    width: 100%;
    margin-top: var(--space-4);
    margin-bottom: var(--space-4);
}

.tags-container {
    min-height: 38px;
    padding: 6px 0;
    display: flex;
    flex-wrap: wrap;
}

.tag-input-container {
    max-width: 450px;
}

.tag-input {
    background-color: white !important;
    border: 1px solid #e6e6e6 !important;
    box-shadow: none;
    transition: all 0.2s ease;
}

.tag-input:focus {
    border-color: #d0d0d0 !important;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.03);
}

.tag {
    display: inline-flex;
    align-items: center;
    background-color: white;
    border: 1px solid #e6e6e6;
    color: #505050;
    font-weight: 400;
    font-size: var(--fs-xs);
    border-radius: var(--radius-xl);
    padding: 5px 12px;
    margin-right: var(--radius-md);
    margin-bottom: var(--radius-md);
    transition: all 0.2s ease;
}

.tag:hover {
    background-color: #f7f7f7;
}

.tag .remove-tag {
    cursor: pointer;
    margin-left: 6px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.tag .remove-tag:hover {
    opacity: 1;
}

.action-toolbar {
    display: flex;
    align-items: center;
    padding-bottom: 12px;
}

.category-selector {
    flex: 0 0 auto;
}

.category-selector select {
    width: auto;
    min-width: 180px;
    max-width: 220px;
}

@media (max-width: 576px) {
    .action-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-buttons {
        margin-bottom: 15px;
        width: 100%;
    }

    .category-selector {
        width: 100%;
    }

    .category-selector select {
        width: 100%;
        max-width: 100%;
    }
}

.video-preview {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s ease;
}

.video-preview:hover .video-play-button {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.9) !important;
}

.video-play-button {
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.video-overlay {
    transition: background-color 0.3s ease;
}

.video-preview:hover .video-overlay {
    background-color: rgba(0, 0, 0, 0.2) !important;
}

.attached-files {
    border: 1px solid #eaeaea;
    transition: all 0.2s ease;
    background-color: #f8f9fa;
    border-radius: var(--radius-md);
}

.attached-files .file-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attached-files .file-info {
    font-size: 14px;
    line-height: 1.3;
}

.attached-files .download-btn {
    opacity: 0.7;
    transition: all 0.2s ease;
}

.attached-files .download-btn:hover {
    opacity: 1;
    background-color: #f8f9fa;
}

.attached-files a:hover .d-flex {
    background-color: #f8f9fa !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.attached-files .d-flex {
    transition: all 0.2s ease;
}

.attached-files .file-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attached-files .file-icon i {
    font-size: 16px;
}

.attached-files .download-indicator {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.attached-files a:hover .download-indicator {
    opacity: 1;
}

.video-play-button i {
    font-size: 16px;
    color: #007bff;
}

.tholos-nav-tabs .nav-link.active {
    color: var(--primary-color);
    /* 對齊全站共用頁籤 .nav-tabs-custom：選中僅靠變色＋底線區分，不額外加粗（原為 bold） */
    font-weight: 500;
    border: none;
    border-bottom: 4px solid var(--primary-color);
    background: transparent;
}

.tholos-nav-tabs .nav-link {
    /* 對齊全站共用頁籤 .nav-tabs-custom 的未選中色（原為 #999，偏淡） */
    color: #333;
    border: none;
    background: transparent;
    font-weight: 500;
    transition: color 0.2s;
}

.tholos-nav-tabs .nav-link:hover {
    color: var(--primary-color);
}

/* 手機：分頁多時（登入後可達 討論區/章節/成員/關於/切換/通知/私訊）改水平捲動，
   不換行；右緣淡出提示由 JS 加 .is-scrollable 才顯示、滑到底加 .scroll-end 收起。
   mask 用漸層淡出、與背景色無關，深色主題也適用。 */
@media (max-width: 767.98px) {
    .tholos-nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tholos-nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .tholos-nav-tabs .nav-item {
        flex: 0 0 auto;
    }

    .tholos-nav-tabs .nav-link {
        white-space: nowrap;
    }

    .tholos-nav-tabs.is-scrollable:not(.scroll-end) {
        -webkit-mask-image: linear-gradient(to right, #000 90%, transparent 100%);
                mask-image: linear-gradient(to right, #000 90%, transparent 100%);
    }
}

.community-slider-nav .slick-slide {
    margin: 0 4px;
}

.community-slider-nav .img-thumbnail {
    width: 90px;
    height: 90px;
    object-fit: cover;
    padding: 0;
    border-radius: var(--radius-md);
    border: 1px solid #eee;
}

.community-slider-nav .slick-arrow {
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: #fff;
    border-radius: 50%;
    border: 1px solid #ddd;
    width: 32px;
    height: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.community-slider-nav .slick-prev {
    left: -40px;
}

.community-slider-nav .slick-next {
    right: -40px;
}

.community-slider-nav .slick-arrow:before {
    color: #333;
    font-size: 20px;
}

.community-slider-nav {
    margin-top: 10px;
    position: relative;
}

.community-slider-nav .slick-list {
    overflow: hidden;
    padding: 5px 0;
}

.community-slider-nav .slick-track {
    display: flex;
    align-items: center;
    margin-left: 0;
    transform: translate3d(0px, 0, 0);
    padding: 5px 0;
}

.community-slider-nav .slick-slide {
    margin: 0 3px;
    padding: 0;
    width: auto !important;
    overflow: visible !important;
}

.community-slider-nav .slick-slide>div {
    outline: none;
    width: 80px;
    padding: 3px;
    box-sizing: content-box;
}

.community-slider-nav .img-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    padding: 0;
    border-radius: 6px;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    box-sizing: border-box;
    position: relative;
}

.community-slider-nav .img-thumbnail:hover {
    border-color: #007bff;
    transform: scale(1.02);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.community-slider-nav .slick-slide.slick-current .img-thumbnail {
    border-color: #007bff;
    border-width: 3px;
    transform: scale(1.02);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.4);
}

.community-slider-nav .slick-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.community-slider-nav .slick-arrow:before {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: #333;
    font-size: 12px;
    opacity: 1;
    line-height: 1;
    position: static;
    transform: none;
}

.community-slider-nav .slick-prev {
    left: -10px;
}

.community-slider-nav .slick-prev:before {
    content: '\f053';
}

.community-slider-nav .slick-next {
    right: -10px;
}

.community-slider-nav .slick-next:before {
    content: '\f054';
}

.community-slider-nav .slick-arrow:hover {
    background: #ffffff;
}

.community-info-bar {
    display: flex;
    flex-wrap: wrap;
}

.community-info-bar .info-item {
    display: flex;
    align-items: center;
    justify-content: start;
    padding: var(--space-2);
    font-size: var(--fs-sm);
    color: #333333;
    margin-right: 10px;
}

.community-info-bar .info-item i {
    font-size: var(--fs-base);
    color: #333333;
}

.community-info-bar .info-item img {
    object-fit: cover;
}

.community-info-bar .info-item span {
    color: #495057;
    font-weight: 500;
}

.community-slider-for .embed-responsive {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.community-slider-for .embed-responsive:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.community-slider-for .embed-responsive-item img {
    transition: transform 0.3s ease;
}

.community-slider-for .embed-responsive-item:hover img {
    transform: scale(1.02);
}

.fancybox-caption {
    padding: 15px 20px !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 1.1rem !important;
    text-align: center !important;
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
}

.fancybox-button {
    background-color: rgba(30, 30, 30, 0.8) !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
}

.fancybox-button:hover {
    background-color: rgba(30, 30, 30, 1) !important;
    transform: scale(1.1) !important;
}

.fancybox-bg {
    background: rgba(0, 0, 0, 0.9) !important;
}

.fancybox-button--zoom:before {
    font-size: 20px !important;
}

.fancybox-button--close:before {
    font-size: 24px !important;
}

@media (max-width: 1200px) {
    .community-slider-nav {
        padding: 0 40px;
    }
}

@media (max-width: 992px) {
    .community-slider-nav {
        padding: 0 38px;
    }
}

@media (max-width: 768px) {
    .community-slider-nav {
        padding: 0 35px;
    }

    .community-slider-nav .img-thumbnail {
        width: 70px;
        height: 70px;
    }

    .community-slider-nav .slick-slide>div {
        width: 70px;
        padding: 3px;
        box-sizing: content-box;
    }

    .community-slider-nav .slick-arrow {
        width: 28px;
        height: 28px;
    }

    .community-slider-nav .slick-arrow:before {
        font-size: 10px;
    }
}

@media (max-width: 576px) {
    .community-slider-nav {
        padding: 0 30px;
    }

    .community-slider-nav .img-thumbnail {
        width: 60px;
        height: 60px;
    }

    .community-slider-nav .slick-slide>div {
        width: 60px;
        padding: 2px;
        box-sizing: content-box;
    }

    .community-slider-nav .slick-slide {
        margin: 0 2px;
    }
}

@media (max-width: 400px) {
    .community-slider-nav {
        padding: 0 25px;
    }

    .community-slider-nav .img-thumbnail {
        width: 50px;
        height: 50px;
    }

    .community-slider-nav .slick-slide>div {
        width: 50px;
        padding: 1px;
        box-sizing: content-box;
    }

    .community-slider-nav .slick-arrow {
        width: 24px;
        height: 24px;
    }
}

.community-slider-nav .slick-slide:first-child {
    margin-left: 0;
}

.community-slider-nav .slick-track {
    transform: translate3d(0px, 0, 0);
    margin-left: 0;
}

.community-slider-nav.slick-initialized .slick-track {
    padding-left: 0;
    margin-left: 0;
}

/* 發布討論區簡潔樣式 */
/* [#1] 發文入口：整合為單一表面——拿掉「外框卡片＋內層灰色塊」的雙層疊加，
   改成一體式的柔和擬輸入框，placeholder 直接落在同一塊表面上，更乾淨 */
.start-post-box {
    background: #f4f6f8;
    border-radius: var(--radius-pill);
    box-shadow: none;
    transition: background-color 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}

.start-post-box:hover {
    background: #eef1f4;
    box-shadow: 0 1px 3px rgba(16, 30, 54, 0.06);
    cursor: pointer;
}

/* placeholder 直接落在卡片表面，不再另外套一層色塊 */
.start-post-box .flex-grow-1 {
    background: transparent;
    padding: 0;
}

.start-post-plus {
    width: 34px;
    height: 34px;
    background: var(--primary-color);
    border-radius: var(--radius-full);
    font-size: var(--fs-sm);
    color: #fff;
    transition: transform 0.2s;
}

.start-post-box:hover .start-post-plus {
    transform: scale(1.08);
}

.start-post-box img {
    object-fit: cover;
}

@media (max-width: 576px) {
    .start-post-box {
        padding: var(--space-2);
    }

    .start-post-plus {
        width: 36px;
        height: 36px;
        font-size: var(--fs-lg);
    }
}

/* tholos 課程卡片自訂樣式 */
.tholos-course-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    background: #fff;
    transition: box-shadow 0.2s;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tholos-course-card.tholos-locked img {
    filter: grayscale(0.6);
    opacity: 0.6;
}

.tholos-course-card .tholos-lock-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    font-size: var(--fs-2xl);
    color: #888;
    z-index: 2;
}

.tholos-course-card .tholos-course-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.tholos-course-card .tholos-price-tag {
    font-weight: bold;
    color: #e67e22;
    font-size: var(--fs-md);
}

.tholos-course-card .tholos-btn-join {
    font-weight: 500;
    letter-spacing: 1px;
}

.tholos-course-card .tholos-progress-label {
    font-size: var(--fs-sm);
    color: var(--primary-color);
    font-weight: 500;
}

.tholos-nav-tabs .nav-link:hover {
    color: var(--primary-color);
}

.tholos-course-card .tholos-title {
    font-size: var(--fs-md);
    font-weight: 600;
    margin-bottom: var(--space-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(26, 24, 24, 0.9);
}

.tholos-course-card .tholos-desc {
    font-size: var(--fs-sm);
    color: #6c757d;
    margin-bottom: var(--space-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.6em;
}

a:hover .tholos-course-card {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
    transition: box-shadow 0.3s, transform 0.3s;
}

/* 貼文內頁圖片：比照發文預覽做單排橫向滑動（手機不會直向堆疊過長），點擊開 fancybox 看原圖 */
.post-images {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: var(--space-2);
    padding-bottom: var(--space-1);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.post-images::-webkit-scrollbar {
    display: none;
}

.post-image-tile {
    display: block;
    position: relative;
    width: 116px;
    height: 116px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #f0f2f5;
    cursor: zoom-in;
    flex-shrink: 0;
}

.post-image-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-image-tile:hover img {
    transform: scale(1.05);
}

@media (max-width: 576px) {
    .post-image-tile {
        width: 96px;
        height: 96px;
    }
}

/* ── fancybox 燈箱美化：深色霧面背景、圓角圖片、低調控制鈕 ── */
.fancybox-bg {
    background: #14161a;
}

.fancybox-is-open .fancybox-bg {
    opacity: 0.94;
}

.fancybox-image {
    border-radius: var(--radius-md);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.fancybox-button {
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.fancybox-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.fancybox-navigation .fancybox-button {
    width: 44px;
    height: 44px;
    padding: 8px;
}

.fancybox-infobar {
    color: rgba(255, 255, 255, 0.7);
    text-shadow: none;
    font-size: var(--fs-sm);
}

/* 附件區標題（「N 個附件」）*/
.post-attachments-title {
    font-size: var(--fs-sm);
    font-weight: 500;
    display: flex;
    align-items: center;
}

/* 列表卡片的附件數量 pill */
.attachment-count-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 4px 10px;
    font-size: var(--fs-xs);
    color: #6c757d;
    background: #f0f2f5;
    border-radius: var(--radius-pill);
    line-height: 1;
}

.attachment-count-badge i {
    font-size: var(--fs-sm);
}

/* 附件列表：桌機兩欄、手機單欄（附件多時桌機不會拖太長）*/
.post-attachments-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
}

@media (max-width: 767px) {
    .post-attachments-list {
        grid-template-columns: 1fr;
    }
}

/* 統一附加檔案區塊樣式 */
.file-download-link {
    display: flex;
    align-items: center;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    background: #fff;
    border: 1px solid #e9ecef;
    transition: background 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* 下載箭頭：預設淡、hover 亮成主色 */
.file-download-link .file-download-icon {
    color: #adb5bd;
    font-size: var(--fs-md);
    flex-shrink: 0;
    transition: color 0.2s;
}

.file-download-link:hover .file-download-icon {
    color: var(--primary-color);
}

.file-download-link:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.file-download-link .file-icon {
    background-color: #f8f9fa;
    color: #6c757d;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: var(--space-6);
    margin-right: var(--space-4);
}

.file-download-link .file-info small {
    color: #6c757d;
    font-size: var(--fs-xs);
}

.file-download-link .file-info div {
    font-weight: 500;
    color: #495057;
    font-size: var(--fs-sm);
    margin-bottom: 2px;
}

@media (max-width: 576px) {
    .file-download-link {
        padding: var(--radius-md);
        font-size: var(--fs-sm);
    }

    .file-download-link .file-icon {
        width: 32px;
        height: 32px;
        font-size: var(--fs-md);
        margin-right: 10px;
    }
}

/* 編輯按鈕樣式 */
.post-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.edit-post-btn:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

.edit-post-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 貼文操作下拉選單樣式 */
.post-actions .dropdown-toggle {
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: var(--fs-lg);
}

.post-actions .dropdown-toggle:hover {
    background-color: #f5f5f5;
}

.post-actions .dropdown-toggle:focus {
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

.post-actions .dropdown-toggle::after {
    display: none;
}

.post-actions .dropdown-menu {
    min-width: 180px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #dee2e6;
    padding: var(--space-2) 0;
}

.post-actions .dropdown-item {
    padding: var(--space-2) var(--space-4);
    font-size: var(--fs-sm);
    color: #495057;
    transition: all 0.2s ease;
}

.post-actions .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #212529;
}

.post-actions .dropdown-divider {
    margin: var(--space-1) 0;
    border-color: #e9ecef;
}

/* 編輯模態框樣式 */
#editPostModal .modal-content {
    border-radius: var(--radius-lg);
}

#editPostModal .modal-header {
    border-bottom: none;
    padding-bottom: 0;
}

#editPostModal .form-control {
    border: none;
    background-color: transparent;
}

#editPostModal .form-control:focus {
    box-shadow: none;
    background-color: #f8f9fa;
    border-radius: 8px;
}

#editPostContent[contenteditable="true"] {
    min-height: 120px;
    max-height: 300px;
    overflow-y: auto;
    padding: var(--space-2);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

#editPostContent[contenteditable="true"]:focus {
    outline: none;
    border-color: #007bff;
    background-color: #f8f9fa;
}

#editPostContent[contenteditable="true"]:empty:before {
    content: attr(placeholder);
    color: #6c757d;
    pointer-events: none;
}

#editPostContent[contenteditable="true"] a {
    color: #007bff;
    text-decoration: underline;
}

#editPostContent[contenteditable="true"] a:hover {
    color: #0056b3;
    text-decoration: none;
}

/* 確認關閉對話框樣式 */
#confirmEditCloseModal {
    z-index: 1060 !important;
}

#confirmEditCloseModal .modal-backdrop {
    z-index: 1055 !important;
}

#confirmEditCloseModal .modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#confirmEditCloseModal .modal-header {
    border-bottom: none;
    padding-bottom: 0;
}

#confirmEditCloseModal .modal-title {
    color: #495057;
    font-weight: 600;
}

#confirmEditCloseModal .modal-body {
    padding: var(--space-6);
}

#confirmEditCloseModal .modal-footer {
    border-top: none;
    padding-top: 0;
}

#confirmEditCloseModal .btn {
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-6);
    font-weight: 500;
}

#confirmEditCloseModal .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

#confirmEditCloseModal .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

#confirmEditCloseModal .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

#confirmEditCloseModal .btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* 編輯模態框中的預覽容器 */
#editImagePreviewContainer {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding: var(--space-2) 0;
    margin: var(--space-2) 0;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb-color) transparent;
}

#editImagePreviewContainer::-webkit-scrollbar {
    height: var(--scrollbar-size);
}

#editImagePreviewContainer::-webkit-scrollbar-track {
    background: transparent;
}

#editImagePreviewContainer::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb-color);
    border-radius: 10px;
}

#editImagePreviewContainer::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* 編輯模態框中的標籤容器 */
#editTagsContainer {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

#editTagsContainer .tag {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    background-color: #e9ecef;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    color: #495057;
    transition: all 0.2s ease;
}

#editTagsContainer .tag:hover {
    background-color: #dee2e6;
}

#editTagsContainer .tag .remove-tag {
    margin-left: var(--space-1);
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s ease;
}

#editTagsContainer .tag .remove-tag:hover {
    color: #dc3545;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .post-actions {
        gap: var(--space-1);
    }

    .edit-post-btn {
        padding: var(--space-1) var(--space-2);
        font-size: var(--fs-sm);
    }

    #editPostModal .modal-dialog {
        margin: var(--space-4);
    }

    #editPostModal .action-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    #editPostModal .action-buttons {
        justify-content: center;
        margin-bottom: 1rem;
    }

    #editPostModal .category-selector {
        width: 100%;
    }
}

/* 新增連結和新增影片模態框的 z-index 設定 */
#addLinkModal {
    z-index: 1070 !important;
}

#addLinkModal .modal-backdrop {
    z-index: 1065 !important;
}

#addVideoModal {
    z-index: 1070 !important;
}

#addVideoModal .modal-backdrop {
    z-index: 1065 !important;
}

/* 社群連結樣式 */
.tholos-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
}

.tholos-social-links .btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s ease;
    border: 1px solid #dee2e6;
    background-color: transparent;
    color: #6c757d;
}

.tholos-social-links .btn:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
    transform: translateY(-1px);
}

.tholos-social-links .btn i {
    font-size: 14px;
}

/* 響應式設計 */
@media (max-width: 576px) {
    .tholos-social-links {
        gap: var(--space-1);
    }

    .tholos-social-links .btn {
        width: 32px;
        height: 32px;
    }

    .tholos-social-links .btn i {
        font-size: 12px;
    }
}

/* 社群連結輸入欄位樣式 */
.tholos-input::placeholder {
    color: #adb5bd;
    font-size: var(--fs-sm);
}

.tholos-input:focus::placeholder {
    color: #ced4da;
}

/* @ 提及選擇器樣式 */
.mention-selector {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 250px;
}

.mention-selector .mention-option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.mention-selector .mention-option:hover {
    background-color: #f8f9fa;
}

.mention-selector .mention-option img {
    flex-shrink: 0;
}

.mention-selector .mention-option span {
    font-weight: 500;
}

/* 提及連結樣式 */
.mention-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.mention-link:hover {
    text-decoration: underline;
}

.card .row {
    padding-top: 0;
    padding-bottom: 0;
}