/* ==========================================
   常見問答頁樣式
   ========================================== */

[v-cloak] { display: none; }

/* 整體 layout：左側分類 + 右側列表 */
.faq-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: start;
}

/* ========== 左側區塊選單 ========== */
.section-sidebar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    position: sticky;
    top: 90px;
}

.sidebar-title {
    padding: 16px 20px 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #003366;
    border-bottom: 1px solid #e5e7eb;
    margin: 0;
}

.section-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.section-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #374151;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
}

.section-link:hover {
    background: #f3f4f6;
    color: #003366;
}

.section-link.active {
    background: #003366;
    color: #fff;
    font-weight: 600;
}

.section-link.active .section-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.section-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.section-count {
    margin-left: auto;
    font-size: 0.8rem;
    padding: 1px 8px;
    border-radius: 10px;
    background: #f3f4f6;
    color: #9ca3af;
}

/* ========== 右側問答列表 (Accordion) ========== */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.faq-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    gap: 12px;
    transition: background 0.15s;
}

.faq-question:hover {
    background: #f9fafb;
}

.faq-q-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.faq-section-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

.faq-icon {
    color: #003366;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.faq-q-text {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.faq-toggle-icon {
    color: #9ca3af;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: transform 0.2s;
}

/* 答案區塊 */
.faq-answer {
    border-top: 1px solid #f3f4f6;
    padding: 20px;
    background: #fafbfc;
}

.faq-answer-content {
    line-height: 1.8;
    font-size: 0.95rem;
    color: #4b5563;
}

.faq-answer-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}

.faq-answer-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.faq-answer-content table td,
.faq-answer-content table th {
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
}

.faq-answer-content a {
    color: #0089A7;
    text-decoration: underline;
}

.faq-answer-content ul,
.faq-answer-content ol {
    padding-left: 24px;
    margin: 8px 0;
}

/* Accordion 展開動畫 */
.faq-slide-enter-active,
.faq-slide-leave-active {
    transition: all 0.25s ease;
    max-height: 500px;
    overflow: hidden;
}

.faq-slide-enter-from,
.faq-slide-leave-to {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

/* ========== 手機版區塊篩選 ========== */
.mobile-sections {
    display: none;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

.mobile-sec-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 0.88rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
}

.mobile-sec-btn:hover {
    border-color: #003366;
    color: #003366;
}

.mobile-sec-btn.active {
    background: #003366;
    color: #fff;
    border-color: #003366;
}

/* ========== RWD ========== */
@media (max-width: 768px) {
    .faq-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .section-sidebar {
        display: none;
    }

    .mobile-sections {
        display: flex;
    }

    .faq-question {
        padding: 14px 16px;
    }

    .faq-q-left {
        flex-wrap: wrap;
    }

    .faq-q-text {
        flex-basis: 100%;
        white-space: normal;
    }

    .faq-answer {
        padding: 16px;
    }
}
