.main-container {
    padding-top: 2rem;
}

.highlight {
    background: #ffe066;
    padding: 0 2px;
    border-radius: 3px;
}

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

.community-dropdown {
    width: 300px;
}

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

/* 通知徽章樣式 */
.badge-pill.position-absolute {
    top: -5px;
    right: -5px;
    font-size: 0.6rem;
}

/* 卡片樣式 */
.card {
    border-radius: 8px;
    overflow: hidden;
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* 分類標籤樣式 */
.category-tags .btn {
    margin-bottom: 0.5rem;
    border-radius: 20px;
}

.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;
}

/* 文章卡片樣式 */
.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;
}

/* 確保按鈕在連結內正常工作 */
.post-card .btn-action {
    position: relative;
    z-index: 2;
}

/* 確保按鈕在卡片內正常工作 */
.post-card .btn-action {
    position: relative;
    z-index: 2;
}

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



.post-actions-dropdown {
    border: none;
    background: none;
    color: #6c757d;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.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: 8px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
    border: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1050;
}

.post-actions .dropdown-item {
    padding: 0.5rem 1rem;
    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: 2rem;
}

.comment-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.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: 0.75rem;
    color: #6c757d;
}

.comment-content {
    margin-left: 50px;
    margin-bottom: 0.5rem;
}

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

/* 多層回覆樣式 */
.replies-container {
    margin-left: 50px;
    margin-top: 1rem;
}

/* 統一所有回覆的樣式 */
.reply-item {
    margin-top: 1rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    position: relative;
    margin-left: 50px;
}

/* 回覆表單樣式 */
.reply-form {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    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: 0.5rem;
}

.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: 0.75rem;
    color: #6c757d;
}

.reply-content {
    margin-left: 44px;
    margin-bottom: 0.5rem;
}

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

.reply-actions .btn-link {
    padding: 0;
    font-size: 0.875rem;
    color: #6c757d;
    margin-right: 1rem;
}

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

/* 回覆表單樣式 */
.reply-form {
    width: 100%;
    margin-top: 1rem;
    margin-bottom: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
}

.reply-form-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.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: 0.5rem;
}

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

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

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

.post-image-carousel {
    border-radius: 8px;
    overflow: hidden;
    margin: 1rem 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: 0.85rem;
}

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

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

.rounded-circle {
    border-radius: 50% !important;
    object-fit: cover;
}

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

.dropdown-menu {
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 0.5rem 1rem 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;
}

.dropdown-menu-right {
    right: 0;
    left: auto !important;
}

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

.dropdown-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    white-space: normal;
    font-size: 0.9rem;
}

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

.position-relative .badge-pill.position-absolute {
    top: -5px;
    right: -5px;
    font-size: 0.6rem;
    padding: 0.25rem 0.4rem;
}

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

#messageDropdown i,
#notificationDropdown i {
    font-size: 1.25rem;
}

.navbar .d-flex.align-items-center {
    display: flex !important;
    flex-direction: row !important;
}

.navbar .logged-in-content {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.navbar .dropdown {
    margin-right: 1rem;
}

.navbar .dropdown:last-child {
    margin-right: 0;
}

.navbar .btn-link {
    padding: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar .position-relative {
    display: inline-block;
}

.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: 1.5rem;
}

.reply-item+.reply-item {
    margin-top: 1rem;
}

.dropdown-toggle::after {
    margin-left: 0.5rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
}

.dropdown-item.active {
    background-color: #f8f9fa;
    color: #212529;
    font-weight: 500;
}

.dropdown-item i {
    width: 1.25rem;
    text-align: center;
}

@media (max-width: 767.98px) {
    .category-tags .dropdown {
        margin-top: 0.5rem;
        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;
}

.thumbnail-row::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-row::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.thumbnail-row::-webkit-scrollbar-thumb {
    background: #aaa;
    border-radius: 10px;
}

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

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

.carousel-thumbnail {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    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: 8px;
    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: 1rem;
    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: 0.75rem 1rem;
    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: 0.75rem;
    }

    .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: 0.75rem 1rem;
    border-radius: 1rem;
    background-color: #f8f9fa;
    max-width: 75%;
    display: inline-block;
}

.message-content {
    max-width: 75%;
}

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

.message {
    margin-bottom: 1rem;
}

.message-time {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.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: 1rem;
    background-color: white;
}

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

.rounded-circle {
    object-fit: cover;
}

.text-truncate {
    max-width: 90%;
}

.discover-header {
    text-align: center;
    padding: 2rem 0;
}

.discover-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.discover-header p {
    font-size: 1.25rem;
    color: #6c757d;
}

.discover-header p a {
    color: #007bff;
    text-decoration: none;
}

.search-bar {
    position: relative;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.search-bar .input-group {
    background: white;
    border-radius: 50px;
    padding: 0.5rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.search-bar input {
    border: none;
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
}

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

.search-bar .input-group-text {
    background: transparent;
    border: none;
    color: #6c757d;
    font-size: 1.2rem;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    max-height: 43px;
    overflow: hidden;
    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;
}

.category-tags::after {
    content: '';
    position: absolute;
    right: 50px;
    top: 0;
    height: 100%;
    width: 50px;
    background: linear-gradient(90deg, rgba(248, 249, 250, 0) 0%, rgba(248, 249, 250, 1) 100%);
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.category-tags.expanded::after {
    opacity: 0;
}

.category-btn {
    transition: all 0.2s ease;
    background-color: #fff;
    border: 1px solid #e9ecef;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    border-radius: 50rem;
    color: #495057;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.2rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
}

.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: 0.5rem;
    font-size: 1.2rem;
}

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

.community-card-link {
    display: block;
    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%;
    padding-top: 52%;
    overflow: hidden;
}

.community-cover-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.community-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.community-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.community-creator {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0;
}

.community-description {
    font-size: 0.95rem;
    color: #4b5563;
    margin: 12px 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.community-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
}

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

.community-stats span {
    color: #6b7280;
    font-size: 0.8125rem;
}

.activity-badge {
    color: #6b7280;
    font-size: 0.8125rem;
}

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

.badge.badge-light {
    font-size: 0.75rem;
}

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

.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%;
}

.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: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
}


.filter-dropdown .dropdown-toggle {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 50rem;
    height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-dropdown .dropdown-menu {
    min-width: 160px;
    margin-top: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    right: 0;
    left: auto !important;
}

/* 響應式修復：小螢幕上的篩選下拉選單 */
@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: 0.25rem;
        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: 0.8rem;
        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: 24px;
    color: #007bff;
}

.stats-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

.community-info-card .community-stats {
    text-align: center;
    margin-bottom: 1rem;
}

.community-info-card .community-stats h5 {
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 1.25rem;
}

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

.community-category-tags {
    margin: 0 auto 2rem;
    max-width: 900px;
}

.community-category-tags .d-flex {
    gap: 0.75rem;
}

.community-category-tags .community-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    background: white;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid #dee2e6;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    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;
}

.community-info-card .card-img-top img {
    height: 160px;
    object-fit: cover;
    width: 100%;
}

.community-info-card .card-body {
    padding-top: 1.5rem;
}


.community-info-card .community-links a {
    display: block;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

.community-links i {
    font-size: 0.8rem;
}

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

.popular-posts .list-group-item-action {
    padding: 1rem 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: 16px;
}

#createPostModal .modal-header .close {
    padding: 1rem;
    margin: -1rem;
}

#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: 0.75rem;
    line-height: 1.5;
}


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



h5.card-title,
h5.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* 發布後的貼文內容樣式 */
.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: 0.25rem 0;
}

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

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

/* 修復貼文卡片布局 */
.post-card .card-body {
    padding: 1.25rem;
}

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

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

.post-card .col-md-4 {
    padding-left: 1rem;
}

#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: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

#imagePreviewContainer {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.5rem;
    gap: 0.5rem;
    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: 8px;
    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;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.1);
}

.upload-progress-bar {
    height: 100%;
    background-color: #007bff;
    transition: width 0.2s ease;
}

.video-preview-item {
    position: relative;
    width: 160px;
    height: 120px;
    border-radius: 8px;
    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: 8px;
    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: 8px;
    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: 1rem;
    margin-bottom: 1rem;
}

.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: 13px;
    border-radius: 15px;
    padding: 5px 12px;
    margin-right: 8px;
    margin-bottom: 8px;
    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: 8px;
    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: 8px;
}

.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);
    font-weight: bold;
    border: none;
    border-bottom: 4px solid var(--primary-color);
    background: transparent;
}

.tholos-nav-tabs .nav-link {
    color: #999;
    /* 非 active 狀態顏色 */
    border: none;
    background: transparent;
    font-weight: 500;
    transition: color 0.2s;
}

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

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

.community-slider-nav .img-thumbnail {
    width: 90px;
    height: 90px;
    object-fit: cover;
    padding: 0;
    border-radius: 8px;
    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: 0.5rem;
    font-size: 0.9rem;
    color: #333333;
    margin-right: 10px;
}

.community-info-bar .info-item i {
    font-size: 1rem;
    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: 8px;
    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;
}

/* 發布討論區簡潔樣式 */
.start-post-box {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(16, 30, 54, 0.1);
    transition: box-shadow 0.2s;
    border: 1px solid #d7d7d7;
}

.start-post-box:hover {
    box-shadow: 0 4px 16px rgba(16, 30, 54, 0.12);
    cursor: pointer;
}

.start-post-plus {
    width: 30px;
    height: 30px;
    background: #f4f6f8;
    border-radius: 50%;
    font-size: 0.9rem;
    color: #333
}

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

@media (max-width: 576px) {
    .start-post-box {
        padding: 0.75rem;
    }

    .start-post-plus {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }
}

/* tholos 課程卡片自訂樣式 */
.tholos-course-card {
    border-radius: 12px;
    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: 2rem;
    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: 1.1rem;
}

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

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

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

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

.tholos-course-card .tholos-desc {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    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;
}

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

.file-download-link:hover {
    background: #f8f9fa;
    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: 8px;
    font-size: 1.5rem;
    margin-right: 16px;
}

.file-download-link .file-info small {
    color: #6c757d;
}

.file-download-link .file-info div {
    font-weight: 500;
    color: #495057;
    margin-bottom: 2px;
}

@media (max-width: 576px) {
    .file-download-link {
        padding: 8px;
        font-size: 0.95rem;
    }

    .file-download-link .file-icon {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
        margin-right: 10px;
    }
}

/* 編輯按鈕樣式 */
.post-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.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: 6px;
    font-size: 1.2rem;
}

.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: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #dee2e6;
    padding: 0.5rem 0;
}

.post-actions .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #495057;
    transition: all 0.2s ease;
}

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

.post-actions .dropdown-divider {
    margin: 0.25rem 0;
    border-color: #e9ecef;
}

/* 編輯模態框樣式 */
#editPostModal .modal-content {
    border-radius: 12px;
}

#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: 0.75rem;
    border: 1px solid transparent;
    border-radius: 8px;
    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: 12px;
    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: 1.5rem;
}

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

#confirmEditCloseModal .btn {
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    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: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    margin: 0.5rem 0;
}

#editImagePreviewContainer::-webkit-scrollbar {
    height: 4px;
}

#editImagePreviewContainer::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

#editImagePreviewContainer::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

#editImagePreviewContainer::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 編輯模態框中的標籤容器 */
#editTagsContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

#editTagsContainer .tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: #e9ecef;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #495057;
    transition: all 0.2s ease;
}

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

#editTagsContainer .tag .remove-tag {
    margin-left: 0.25rem;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s ease;
}

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

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

    .edit-post-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }

    #editPostModal .modal-dialog {
        margin: 1rem;
    }

    #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: 0.5rem;
    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: 0.25rem;
    }

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

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

/* 社群連結輸入欄位樣式 */
.tholos-input::placeholder {
    color: #adb5bd;
    font-size: 0.875rem;
}

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