/* 通用漸變主按鈕 */
.gradient-primary-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, #4A90E2 0%, #6A5ACD 100%);
    color: #fff !important;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
    white-space: nowrap; /* 防止內容換行 */
}

.gradient-primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.45);
    opacity: 0.95;
}

.gradient-primary-btn .btn-plus-icon {
    margin-left: 2px;
}

.gradient-primary-btn .btn-search-icon {
    margin-right: 6px;
}

/* 搜索按鈕文字不換行 */
.gradient-primary-btn .btn-text { 
    white-space: nowrap; 
}

.forum_search_inline_wrapper .forum_search_inline_btn {
    margin-right: 10px;
}

.create-thread-btn {
    vertical-align: middle;
}
/* 論壇歡迎模塊樣式 */
.forum-welcome-container {
    margin: 0 auto;
    margin-bottom: 30px;
}

.discussion-banner-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 討論橫幅 */
.discussion-banner {
    background: #e0e7ff;
    color: #1d4ed8;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(74, 144, 226, 0.3);
}

.discussion-banner .arrow-icon {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.discussion-banner .arrow-icon::before {
    content: '↑';
    color: #4a90e2;
    font-size: 12px;
    font-weight: bold;
}

/* 歡迎標題區域 */
.welcome-header {
    text-align: center;
    margin-bottom: 30px;
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 10px;
}

.welcome-subtitle {
    font-size: 1.1rem;
    font-weight: 400;
}

/* 統計卡片容器 */
.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* 統計卡片 */
.stat-card {
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-card.blue {
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
}

.stat-card.green {
    background: linear-gradient(135deg, #e8f5e8 0%, #ffffff 100%);
}

.stat-card.purple {
    background: linear-gradient(135deg, #f3e5f5 0%, #ffffff 100%);
}

.stat-card.orange {
    background: linear-gradient(135deg, #fff3e0 0%, #ffffff 100%);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.stat-card.blue .stat-icon {
    background: #4a90e2;
}

.stat-card.green .stat-icon {
    background: #27ae60;
}

.stat-card.purple .stat-icon {
    background: #9b59b6;
}

.stat-card.orange .stat-icon {
    background: #f39c12;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
}

/* 熱門主題卡片 */
.hottest-topic-card {
    background: linear-gradient(135deg, #fff5e6 0%, #ffffff 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(243, 156, 18, 0.1);
    position: relative;
    margin-top: 20px;
}

.hottest-topic-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.flame-icon {
    width: 20px;
    height: 20px;
    background: #e74c3c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flame-icon::before {
    content: '🔥';
    font-size: 12px;
}

.hottest-topic-title {
    font-size: 14px;
    font-weight: 600;
    color: #ea580c;
}

.topic-title {
    font-size: 1.1rem;
    line-height: 1.4;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

.topic-metrics {
    display: flex;
    gap: 20px;
    align-items: center;
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #7f8c8d;
}

.metric-icon {
    width: 16px;
    height: 16px;
    background: #bdc3c7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
}

/* 帖子列表模塊 */
.forum-posts-container {

    margin-bottom: 30px;
    overflow: hidden;
}

/* 帖子列表頭部 */
.forum-posts-header {
    margin-bottom: 20px;
}

.forum-posts-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.forum-time-filters {
    display: flex;
    gap: 10px;
}

.time-filter-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.time-filter-btn.active {
    background: #4a90e2;
    color: white;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.time-filter-btn:not(.active) {
    background: white;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.time-filter-btn:not(.active):hover {
    background: #f8f9fa;
    border-color: #4a90e2;
    color: #4a90e2;
}

.time-filter-icon {
    width: 16px;
    height: 16px;
}

.forum-category-tags {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap; /* 不允許換行 */
    margin-top: 15px;
    overflow-x: auto; /* 水平滑動 */
    -webkit-overflow-scrolling: touch; /* iOS 平滑滑動 */
    padding: 10px 0; /* 增加上下內邊距 */
    scrollbar-width: thin; /* Firefox 細滾動條 */
}

/* 隱藏滾動條但保持滑動功能 */
.forum-category-tags::-webkit-scrollbar {
    height: 4px;
}

.forum-category-tags::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.forum-category-tags::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.forum-category-tags::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.category-tag {
    padding:8px 15px;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0; /* 防止標籤收縮 */
}

.category-tag.active {
    background: #4a90e2;
    color: white;
}

.category-tag:not(.active) {
    background: #fff;
    color: #333;
}

.category-tag:not(.active):hover {
    background: #dee2e6;
    color: #495057;
}

.forum-display-options {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sort-dropdown {
    position: relative;
    display: inline-block;
}

.sort-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #333;
    min-width: 120px;
    justify-content: space-between;
}

.sort-dropdown-btn:hover {
    border-color: #4a90e2;
    color: #4a90e2;
}

.sort-dropdown-btn .dropdown-arrow {
    transition: transform 0.2s ease;
}

.sort-dropdown-btn.open .dropdown-arrow {
    transform: rotate(180deg);
}

.sort-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 4px;
    display: none;
    overflow: hidden;
}

.sort-dropdown-menu.show {
    display: block;
}

.sort-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
    color: #333;
    position: relative;
}

.sort-option:hover {
    background-color: #f5f5f5;
}

.sort-option.active {
    background-color: #e8f4fd;
    color: #4a90e2;
}

.sort-option .check-icon {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sort-option.active .check-icon {
    opacity: 1;
}

.view-mode-buttons {
    display: flex;
    gap: 5px;
}

.view-mode-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.view-mode-btn.active {
    background: #4a90e2;
    color: white;
}

.view-mode-btn:not(.active) {
    background: white;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.view-mode-btn:not(.active):hover {
    background: #f8f9fa;
    border-color: #4a90e2;
    color: #4a90e2;
}

.view-mode-icon {
    width: 16px;
    height: 16px;
}

/* 帖子列表表格 */
.forum-posts-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.forum-posts-table thead {
    background: #e0f2f7;
}

.forum-posts-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #d0d0d0;
    border-right: 1px solid #d0d0d0;
    font-size: 14px;
    position: relative;
}

.forum-posts-table th:last-child {
    border-right: none;
}

.forum-posts-table th:nth-child(2),
.forum-posts-table th:nth-child(3),
.forum-posts-table th:nth-child(4),
.forum-posts-table th:nth-child(5),
.forum-posts-table th:nth-child(6) {
    text-align: center;
}

/* 表頭圖標樣式 */
.forum-posts-table th svg {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    color: #4a90e2;
    vertical-align: middle;
}

.forum-posts-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    vertical-align: middle;
    transition: background-color 0.2s ease;
}

.forum-posts-table td:last-child {
    border-right: none;
}

.forum-posts-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.forum-posts-table tbody tr:hover {
    background-color: #e3f2fd;
}

.forum-posts-table tbody tr:last-child td {
    border-bottom: none;
}

.post-topic {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pinned-badge {
    background: #ff4757;
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    flex-shrink: 0;
}

.digest-badge {
    background: #ffd93d;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    margin-right: 6px;
    display: inline-block;
    flex-shrink: 0;
}

.topic-title {
    text-decoration: none;
    transition: color 0.3s ease;
    margin-bottom: 5px;
    color: #222;
}

.topic-title:hover {
    color: #4a90e2;
}

/* 置頂帖子行樣式 */
tr[data-forum-id] {
    position: relative;
}

tr[data-forum-id]:has(.pinned-badge) {
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
    border-left: 4px solid #ff4757;
}

tr[data-forum-id]:has(.pinned-badge) td {
    border-top: 1px solid #ffebee;
    border-bottom: 1px solid #ffebee;
}

/* 置頂卡片樣式 */
.forum-card:has(.tag.pinned) {
    border: 2px solid #ff4757;
    box-shadow: 0 4px 20px rgba(255, 71, 87, 0.15);
}

.forum-card:has(.tag.pinned) .cards-inner {
    border-radius: 12px;

}

/* 置頂標籤在卡片中的樣式 */
.cards-tags .tag.pinned {
    background: #ff4757;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: 6px;
    display: inline-block;
}

.cards-tags .tag.digest {
    background: #ffd93d;
    color: #333;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

.topic-expand-icon {
    width: 16px;
    height: 16px;
    color: #6c757d;
    cursor: pointer;
}

.post-author {
    font-size: 14px;
    text-align: center;
    /* 限制最多顯示一行 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-replies {
    color: #16a34a;
    font-weight: 600;
    font-size: 16px;
    text-align: center;
}

.post-views {
    color: #9333ea;
    font-weight: 600;
    font-size: 16px;
    text-align: center;
}

.post-date {
    font-size: 14px;
    text-align: center;
}

.post-time {
    font-size: 16px;
    text-align: center;
}

/* 論壇提示橫幅 */
.forum-hint-banner {
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
    border: 1px solid #bbdefb;
    border-radius: 15px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(33, 150, 243, 0.1);
}

.hint-icon {
    width: 24px;
    height: 24px;
    background: #2196f3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hint-icon svg {
    width: 16px;
    height: 16px;
    color: white;
}

.hint-text {
    color: #1976d2;
    font-size: 14px;
    font-weight: 500;
}

/* 論壇模式切換 */
.forum-mode {
    transition: all 0.3s ease;
}

/* 論壇卡片容器 */
.forum-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* 論壇卡片 */
.forum-card {
    background: transparent;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    height: auto;
    min-height: 280px;
    perspective: 1000px;
}

.forum-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 卡片內部容器 */
.cards-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 280px;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

/* 卡片翻轉效果 */
.forum-card.flipped .cards-inner {
    transform: rotateY(180deg);
}

/* 卡片正面和背面通用樣式 */
.cards-front,
.cards-back {
    position: absolute;
    width: 100%;
    height: 100%;
    min-height: 280px;
    backface-visibility: hidden;
    border-radius: 15px;
    background: white;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* 卡片背面 */
.cards-back {
    transform: rotateY(180deg);
}

/* 卡片頭部 */
.cards-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.cards-header-top {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.cards-avatar {
    width: 60px;
    height: 60px;
    background: #4a90e2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
    overflow: hidden;
    border: 5px solid rgba(219 234 254,1);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cards-avatar:hover {
    transform: scale(1.05);
}

.cards-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cards-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    margin-top: 5px;
}

.tag {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid;
}

.tag.pinned {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border-color: #e74c3c;
}

.tag.essence {
    background: rgba(241, 196, 15, 0.1);
    color: #f1c40f;
    border-color: #f1c40f;
}

.tag.digest {
    background: rgba(241, 196, 15, 0.1);
    color: #f1c40f;
    border-color: #f1c40f;
}

.tag.general {
    background: rgba(74, 144, 226, 0.1);
    color: #4a90e2;
    border-color: #4a90e2;
}

.cards-flip-btn {
    position: absolute;
    top: 0;
    right: 0;
    padding: 6px 12px;
    background: linear-gradient(135deg, #4A90E2 0%, #6A5ACD 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.cards-flip-btn:hover {
    background: linear-gradient(135deg, #357abd 0%, #5A4FCF 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

/* 卡片內容 */
.cards-content {
    margin-top: 10px;
}

.cards-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    cursor: pointer;
    transition: color 0.2s ease;
    /* 限制最多顯示兩行 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cards-title:hover {
    color: #4a90e2;
}

.cards-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: #7f8c8d;
}

.cards-author {
    font-weight: 500;
}

.cards-date {
    color: #95a5a6;
}

/* 卡片分隔線 */
.cards-separator {
    height: 1px;
    background: #ecf0f1;
    margin: 15px 0;
}

/* 卡片底部 */
.cards-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cards-last-reply {
    margin-top: 15px;
    font-size: 15px;
    color: #333;
    background-color: #eff6ff;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 8px;
}

.reply-author {
    color: #4a90e2;
    font-weight: 500;
}

.reply-date {
    color: #95a5a6;
}

.cards-stats {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 8px;
    position: relative;
}

.cards-stats-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    color: #555;
    font-weight: 500;
}

.cards-stats-icon {
    width: 20px;
    height: 20px;
    color: #555;
}

.cards-detail-link {
    text-align: right;
    margin-top: 8px;
}

.cards-detail-link a {
    color: #95a5a6;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
}

.cards-detail-link a:hover {
    color: #4a90e2;
}

/* 卡片背面樣式 */
.cards-back-header {
    margin-bottom: 20px;
}

.cards-back-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    width: fit-content;
    font-size: 14px;
    color: #6c757d;
}

.user-icon {
    width: 16px;
    height: 16px;
    color: #95a5a6;
}

.cards-back-content {
    flex: 1;
    display: flex;
    flex-direction: column;

    text-align: left;
}

.cards-back-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.4;
    /* 限制最多顯示兩行 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cards-back-message {
    color: #495057;
    line-height: 1.6;
    font-size: 15px;
    /* 限制最多顯示兩行 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cards-back-message p {
    margin-bottom: 12px;
}

.cards-back-message p:last-child {
    margin-bottom: 0;
}

.cards-back-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-view-full {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #4a90e2 0%, #9b59b6 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.btn-view-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.btn-icon {
    width: 16px;
    height: 16px;
}

.btn-return {
    padding: 12px 24px;
    background: white;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-return:hover {
    background: #f8f9fa;
    border-color: #4a90e2;
    color: #4a90e2;
}

/* 響應式設計 */
@media (max-width: 768px) {
    
    .welcome-title {
        font-size: 2.5rem; /* 與桌面一致，避免過小 */
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 2.2rem; /* 與桌面一致 */
    }
    
    .topic-metrics {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .forum-posts-controls {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .forum-time-filters {
        display: none; /* 隱藏時間篩選模塊 */
    }
    
    .forum-display-options {
        justify-content: flex-end;
    }
    
    .forum-category-tags {
        overflow-x: auto;
        white-space: nowrap;
        padding: 10px 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-tag {
        display: inline-block;
        margin-right: 8px;
        flex-shrink: 0;
    }
    
    .forum-posts-table th,
    .forum-posts-table td {
        padding: 10px 15px;
        font-size: 14px; /* 與桌面一致 */
    }
    
    /* 輸入框高度 */
    .tag_field > input {
        height:44px !important;
        min-height: 44px !important;
    }
}

@media (max-width: 480px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr); /* 保持兩列顯示 */
    }
    
    .welcome-title {
        font-size: 2.5rem; /* 與桌面一致 */
    }
    
    .welcome-subtitle {
        font-size: 1.1rem; /* 與桌面一致 */
    }
    
    .forum-time-filters {
        display: none; /* 隱藏時間篩選模塊 */
    }
    
    .forum-category-tags {
        overflow-x: auto;
        white-space: nowrap;
        padding: 10px 0;
        -webkit-overflow-scrolling: touch;
        gap: 0; /* 移除gap，使用margin控制間距 */
    }
    
    .category-tag {
        font-size: 15px; /* 與桌面一致 */
        padding: 8px 15px; /* 與桌面一致 */
        display: inline-block;
        margin-right: 8px;
        flex-shrink: 0;
    }
    
    .forum-posts-table {
        font-size: 14px; /* 與桌面一致 */
        width: 100%;
        table-layout: fixed; /* 固定表格布局 */
    }
    
    .forum-posts-table th,
    .forum-posts-table td {
        padding: 8px 6px; /* 減少內邊距 */
        font-size: 14px; /* 保持字體大小 */
        word-wrap: break-word; /* 允許文字換行 */
        overflow: hidden;
    }
    
    /* 移動端只顯示主題列 */
    .forum-posts-table th:nth-child(2),
    .forum-posts-table td:nth-child(2),
    .forum-posts-table th:nth-child(3),
    .forum-posts-table td:nth-child(3),
    .forum-posts-table th:nth-child(4),
    .forum-posts-table td:nth-child(4),
    .forum-posts-table th:nth-child(5),
    .forum-posts-table td:nth-child(5) {
        display: none; /* 隱藏作者、回應、瀏覽、日期列 */
    }
    
    /* 主題列佔滿全寬 */
    .forum-posts-table th:nth-child(1),
    .forum-posts-table td:nth-child(1) {
        width: 100%; /* 主題列佔100% */
    }
    
    /* 卡片模式響應式設計 */
    .forum-cards-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cards-header {
        gap: 12px;
    }
    
    .cards-avatar {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .cards-title {
        font-size: 1.2rem; /* 與桌面一致 */
    }
    
    .cards-stats {
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .cards-stats-item {
        font-size: 16px; /* 與桌面一致 */
    }
    
    .cards-flip-btn {
        font-size: 14px; /* 與桌面一致 */
        padding: 4px 8px;
    }
    
    /* 卡片背面響應式設計 */
    .forum-card {
        height: auto;
        min-height: 280px;
    }
    
    .cards-back-title {
        font-size: 1.3rem; /* 與桌面一致 */
    }
    
    .cards-back-message {
        font-size: 15px; /* 與桌面一致 */
    }
    
    .cards-back-actions {
        gap: 8px;
    }
    
    .btn-view-full,
    .btn-return {

        padding: 10px 16px;
        font-size: 14px; /* 與桌面一致 */
    }
    .forum_search_inline_btn{
        display: none;
    }
}

/* 論壇分類標籤滾動條美化 */
.forum-category-tags {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: rgba(74, 144, 226, 0.3) transparent; /* Firefox */
    padding-bottom: 8px; /* 為滾動條留出空間 */
}

/* Webkit 瀏覽器滾動條樣式 */
.forum-category-tags::-webkit-scrollbar {
    height: 6px;
}

.forum-category-tags::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.forum-category-tags::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4A90E2 0%, #6A5ACD 100%);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.forum-category-tags::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #3A7BC8 0%, #5A4AB8 100%);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

/* 隱藏滾動條但保持滾動功能（可選） */
.forum-category-tags.hide-scrollbar {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.forum-category-tags.hide-scrollbar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* 頂部操作欄樣式 */
.top-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.back-to-forum {
    flex-shrink: 0;
}

.top-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: #e9ecef;
    color: #212529;
    border-color: #adb5bd;
    text-decoration: none;
}

.back-btn svg {
    transition: transform 0.2s ease;
}

.back-btn:hover svg {
    transform: translateX(-2px);
}

/* 主題內容卡片樣式 */
.thread-content-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #e9ecef;
}

.thread-header-layout {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.thread-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.thread-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thread-content-area {
    flex: 1;
}

.thread-badges {
    margin-bottom: 8px;
}
.thread-badges svg{
    vertical-align: middle;
    position: relative;
    top: -2px;
    width: 12px;
    height: 12px;
}

.thread-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
    vertical-align: middle;
    border: 1px solid transparent;
}

.thread-badge.pinned {
    background: #ff4757;
    color: white;
    border-color: #ff3742;
}

.thread-badge.digest {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.thread-title {
    font-size: 24px;
    font-weight: 600;
    color: #111;
    margin-bottom: 8px;
    line-height: 1.4;
    word-break: break-word;
}

.thread-meta {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.meta-separator {
    margin: 0 6px;
    color: #adb5bd;
    font-size: 12px;
}

.thread-views {
    display: flex;
    align-items: center;
    color: #6c757d;
}

.thread-views svg {
    opacity: 0.7;
}

.thread-content {
    color: #111;
    line-height: 1.6;
    font-size: 17px;
    margin-bottom: 20px;
}

.thread-content p {
    margin-bottom: 12px;
}

.thread-content p:last-child {
    margin-bottom: 0;
}

.thread-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.thread-actions-left {
    display: flex;
    gap: 12px;
}

.thread-actions-right {
    display: flex;
    gap: 12px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #495057;
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.action-btn.like-btn.liked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.action-btn.like-btn.liked:hover {
    background: linear-gradient(135deg, #5568d3 0%, #654098 100%);
    border-color: #5568d3;
}

.action-btn.collect-btn.favorited {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-color: #f093fb;
}

.action-btn.collect-btn.favorited:hover {
    background: linear-gradient(135deg, #df82ea 0%, #e4465b 100%);
    border-color: #df82ea;
}

.action-btn.edit-btn {
    background: #f8f9fa;
    color: #495057;
    border-color: #dee2e6;
}

.action-btn.edit-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
}

.action-btn.delete-btn {
    background: #fff5f5;
    color: #dc3545;
    border-color: #f5c2c7;
}

.action-btn.delete-btn:hover {
    background: #ffe5e5;
    border-color: #f1aeb5;
    color: #b02a37;
}

/* 回復模塊樣式 */
.replies-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    overflow: hidden;
    margin-bottom: 24px;
}

.replies-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.replies-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.replies-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.wow_thread_replies {
    padding: 0;
}

/* 快速回復框樣式 */
.quick-reply-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    padding: 20px;
    margin-bottom: 24px;
}
.quick-reply-section .bbcode-toolbar{
    display: none;
}

.quick-reply-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 20px;
    color: #1f2937;
}

.quick-reply-title {
    font-weight: 600;
    color: #1f2937;
}

.quick-reply-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.quick-reply-actions .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.quick-reply-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quick-reply-section .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease;
    margin-top: 10px;
}

.quick-reply-section .form-control:focus {
    border-color: #4a90e2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* 漸變按鈕樣式 */
.btn-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-gradient:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: #fff;
}

.btn-gradient:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-gradient:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* 載入更多按鈕樣式 */
.posts_load {
    padding: 20px 24px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.load-more {
    margin: 0;
}

.load-more .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.load-more .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .top-actions-bar {
        flex-direction: row;
        gap: 12px;
        align-items: center;
        flex-wrap: wrap;
    }
    
    .back-to-forum {
        flex-shrink: 0;
    }
    
    .top-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .top-actions .btn {
        font-size: 14px;
        padding: 1px 7px;
    }
    
    .thread-content-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .thread-header-layout {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .thread-avatar {
        width: 40px;
        height: 40px;
        margin-right: 12px;
        margin-bottom: 0;
    }
    
    .thread-title {
        font-size: 18px;
    }
    
    .thread-meta {
        flex-wrap: nowrap;
        white-space: nowrap;
        gap: 6px;

    }
    .meta-separator{
        margin: 0;
    }
    
    .replies-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .replies-actions {
        justify-content: center;
    }
    
    .thread-actions {
        flex-direction: column;
        gap: 16px;
    }
    
    .thread-actions-left,
    .thread-actions-right {
        width: 100%;
        justify-content: center;
    }
    
    .quick-reply-section {
        padding: 16px;
    }

    
    .quick-reply-actions {
        justify-content: center;
    }
    
    .btn-gradient {
        width: 100%;
        padding: 14px 24px;
        font-size: 16px;
    }
}



/* 響應式滾動條 */
@media (max-width: 768px) {
    .forum-category-tags {
        padding-bottom: 6px;
    }
    
    .forum-category-tags::-webkit-scrollbar {
        height: 4px;
    }
}

/* 板塊選擇對話框樣式 */
.forum-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.forum-selector-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.forum-selector-content {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.forum-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.forum-selector-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.forum-selector-close {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.forum-selector-close:hover {
    background: #e9ecef;
    color: #495057;
}

.forum-selector-body {
    max-height: 60vh;
    overflow-y: auto;
    padding: 16px 0;
}

.forum-list {
    padding: 0 24px;
}

.forum-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: all 0.2s ease;
}

.forum-item:hover {
    background: #f8f9fa;
    margin: 0 -24px;
    padding-left: 24px;
    padding-right: 24px;
}

.forum-item:last-child {
    border-bottom: none;
}

.forum-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #4A90E2 0%, #6A5ACD 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 16px;
    flex-shrink: 0;
}

.forum-info {
    flex: 1;
    min-width: 0;
}

.forum-name {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
}

.forum-desc {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forum-arrow {
    color: #adb5bd;
    margin-left: 12px;
    flex-shrink: 0;
}

.forum-item:hover .forum-arrow {
    color: #4A90E2;
    transform: translateX(4px);
}

/* 模態框打開時的 body 樣式 */
body.modal-open {
    overflow: hidden;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .forum-selector-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .forum-selector-header {
        padding: 16px 20px;
    }
    
    .forum-list {
        padding: 0 20px;
    }
    
    .forum-item {
        padding: 12px 0;
    }
    
    .forum-icon {
        width: 40px;
        height: 40px;
        margin-right: 12px;
    }
    
    .forum-name {
        font-size: 15px;
    }
    
    .forum-desc {
        font-size: 13px;
    }
}
