/* CSS變數定義 - 民眾黨黨色配色 */
:root {
    --primary: #28C8C8; /* 民眾黨黨色 CMYK(60,5,35,0) */
    --primaryHover: #20B5B5; /* 主色 hover */
    --secondary: #30363A; /* 深灰色 */
    --accent: #6B48FF; /* 藍紫色（少量點綴） */
    --background: #F4F4EE; /* 米白色 */
    --cardBg: #ffffff;
    --text: #30363A;
    --textSecondary: #666666;
    --footer: #30363A;
    --border: #e9ecef;
    --tagBg: #e9ecef;
    --tagText: #495057;
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--background);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: var(--primary);
    color: white;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 2rem;
    color: var(--accent);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--primary);
    color: #ffffff;
    transform: translateY(-2px);
}

/* 主要內容區域 */
.main-content {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 4rem 0;
}

.main-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.main-content p {
    font-size: 1.2rem;
    margin: 0;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 分类区域 */
.categories {
    padding: 3rem 0;
    background: var(--cardBg);
}

.categories h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: var(--text);
}

/* 統計儀表板 */
.dashboard {
    background: var(--background);
    padding: 4rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--cardBg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-content h4 {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    margin: 0;
}

.stat-content p {
    color: var(--textSecondary);
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
}

.stat-content p small {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: var(--textSecondary);
    opacity: 0.8;
    line-height: 1.3;
}

.chart-container {
    background: var(--cardBg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
    text-align: center;
}

.chart-container h4 {
    margin: 0 0 1.5rem 0;
    color: var(--text);
    font-size: 1.2rem;
}

.iframe-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 50%; /* 2:1 比例，適合圖表顯示 */
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

.iframe-note {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.iframe-note a {
    color: var(--primary);
    text-decoration: none;
}

.iframe-note a:hover {
    text-decoration: underline;
}









/* 計算器工具 */
.calculator-section {
    background: var(--background);
    padding: 4rem 0;
}

.calculator-container {
    background: var(--cardBg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
    text-align: center;
}

.calculator-container h4 {
    margin: 0 0 1.5rem 0;
    color: var(--text);
    font-size: 1.2rem;
}



/* 問卷調查 */
.survey-section {
    background: var(--cardBg);
    padding: 4rem 0;
}

.survey-form {
    max-width: 600px;
    margin: 2rem auto 0;
    background: var(--background);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-weight: 500;
}

.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.survey-form button[type="submit"] {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
    width: 100%;
}

.survey-form button[type="submit"]:hover {
    background: var(--primaryHover);
}



.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--cardBg);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(32, 201, 151, 0.35);
    border-color: var(--primary);
}

.category-card i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.category-card h4 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.category-card p {
    color: var(--textSecondary);
    font-size: 0.9rem;
}

/* Q&A区域 */
.qa-section {
    padding: 3rem 0;
    background: var(--background);
}

.qa-accordion {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 0 auto;
}

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

.qa-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.qa-header {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--cardBg);
    border: none;
    width: 100%;
    text-align: left;
    transition: background 0.3s ease;
}

.qa-header:hover {
    background: var(--background);
}

.qa-header-content {
    flex: 1;
}

.qa-category {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.qa-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    line-height: 1.4;
}

.qa-toggle {
    background: var(--primary);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.qa-toggle:hover {
    background: var(--primaryHover);
    transform: scale(1.1);
}

.qa-toggle.expanded {
    transform: rotate(180deg);
}

.qa-content {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--background);
    flex: 1;
}

.qa-content.expanded {
    max-height: 800px;
    padding: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 改善滾動條樣式 */
.qa-content.expanded::-webkit-scrollbar {
    width: 6px;
}

.qa-content.expanded::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.qa-content.expanded::-webkit-scrollbar-thumb {
    background: #20c997;
    border-radius: 3px;
}

.qa-content.expanded::-webkit-scrollbar-thumb:hover {
    background: #1ba085;
}

.qa-answer {
    color: var(--text);
    line-height: 1.6;
    margin: 0;
    white-space: pre-line;
}

.qa-keywords {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.qa-keywords span {
    display: inline-block;
    background: var(--tagBg);
    color: var(--tagText);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    margin: 0.25rem 0.25rem 0.25rem 0;
}

.qa-source {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.qa-source a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}

.qa-source a:hover {
    text-decoration: underline;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h3 {
    font-size: 2rem;
    color: var(--text);
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 1rem;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: #5a6268;
}

.qa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.qa-card {
    background: var(--cardBg);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.qa-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.qa-card h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.4;
}

.qa-card p {
    color: var(--textSecondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.qa-card .category-tag {
    display: inline-block;
    background: var(--tagBg);
    color: var(--tagText);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.qa-card .read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qa-card .read-more:hover {
    text-decoration: underline;
}

/* 关于区域 */
.about-section {
    padding: 3rem 0;
    background: white;
}

.about-section h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #333;
}

.about-section p {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem;
    color: #666;
    line-height: 1.8;
}

.source-links {
    max-width: 600px;
    margin: 0 auto;
}

.source-links h4 {
    margin-bottom: 1rem;
    color: #333;
}

.source-links ul {
    list-style: none;
}

.source-links li {
    margin-bottom: 0.5rem;
}

.source-links a {
    color: var(--primary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    display: inline-block;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.source-links a:hover {
    background: rgba(40, 200, 200, 0.12);
    text-decoration: underline;
}

/* 页脚 */
.footer {
    background: var(--secondary);
    color: white;
    text-align: center;
    padding: 2rem 0;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.close:hover {
    color: #000;
}

.modal-content h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    padding-right: 2rem;
}

.modal-content p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.modal-content .source-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.modal-content .source-link:hover {
    text-decoration: underline;
}



/* 響應式設計 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
        text-align: center; /* 確保容器內容置中 */
    }
    
    .header .container {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 0;
        text-align: center; /* 導航置中 */
    }
    
    .logo {
        font-size: 1.2rem;
        justify-content: center; /* LOGO置中 */
    }
    
    .nav {
        gap: 0.8rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 0.3rem 0.8rem;
    }
    
    .main-content {
        padding: 6rem 0 3rem;
        text-align: center; /* 主內容置中 */
    }
    
    .main-content h1 {
        font-size: 1.8rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
        text-align: center; /* 標題置中 */
    }
    
    .main-content p {
        font-size: 1.2rem;
        line-height: 1.4;
        margin-bottom: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
        padding: 0 10px;
        text-align: center; /* 段落置中 */
    }
    
    .section-header {
        flex-direction: column;
        align-items: center; /* 區塊標題置中 */
        gap: 1rem;
        text-align: center;
    }
    
    .section-header h2 {
        text-align: center; /* 區塊標題置中 */
        margin: 0 auto;
    }
    
    .section-header p {
        text-align: center; /* 區塊描述置中 */
        margin: 0 auto;
    }
    
    .filter-controls {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .filter-controls select,
    .filter-controls button {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 1rem;
    }
    
    .category-card {
        padding: 1rem 0.8rem;
    }
    
    .category-card h4 {
        font-size: 0.9rem;
        margin: 0.5rem 0;
    }
    
    .category-card p {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .qa-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .qa-card {
        padding: 1rem;
    }
    
    .qa-card h4 {
        font-size: 1rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }
    
    .qa-card p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 1.5rem;
    }
    
    .modal-content h3 {
        font-size: 1.2rem;
        line-height: 1.3;
    }
    
    .modal-content p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* 改善分類卡片的手機版佈局 */
    .categories-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
        gap: 1rem;
        padding: 0 0.5rem;
        margin: 0 auto; /* 網格置中 */
        justify-items: center; /* 卡片置中 */
    }
    
    .category-card {
        padding: 1.5rem 1rem;
        margin: 0 auto;
        border-radius: 12px;
        max-width: 350px; /* 限制卡片最大寬度 */
        width: 100%; /* 確保卡片填滿容器 */
    }
    
    .category-card h4 {
        font-size: 1.1rem;
        margin: 0.5rem 0;
        text-align: center; /* 卡片標題置中 */
    }
    
    .category-card p {
        font-size: 0.9rem;
        line-height: 1.4;
        text-align: center; /* 卡片描述置中 */
    }
    
    .category-card i {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
        display: block; /* 圖標置中 */
        margin-left: auto;
        margin-right: auto;
    }
    
    /* 改善分類展開區域的手機版佈局 */
    .category-expansion {
        margin: 0 -0.5rem;
        border-radius: 0 0 12px 12px;
        text-align: center; /* 展開內容置中 */
    }
    
    .qa-list {
        padding: 1rem;
        text-align: center; /* Q&A列表置中 */
    }
    
    .qa-item {
        padding: 0.8rem 0;
        text-align: center; /* Q&A項目置中 */
    }
    
    .qa-question {
        font-size: 0.95rem;
        line-height: 1.3;
        text-align: center; /* 問題置中 */
    }
    
    .qa-answer-content {
        font-size: 0.9rem;
        line-height: 1.5;
        text-align: center; /* 答案置中 */
    }
    
    /* 改善儀表板的手機版佈局 */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
        margin: 0 auto; /* 儀表板置中 */
        justify-items: center; /* 卡片置中 */
    }
    
    .dashboard-card {
        padding: 1.5rem 1rem;
        margin: 0 auto;
        max-width: 350px; /* 限制卡片最大寬度 */
        width: 100%; /* 確保卡片填滿容器 */
        text-align: center; /* 卡片內容置中 */
    }
    
    .dashboard-card h3 {
        font-size: 1.2rem;
        text-align: center; /* 卡片標題置中 */
    }
    
    .dashboard-card .number {
        font-size: 2rem;
        text-align: center; /* 數字置中 */
    }
    
    .dashboard-card p {
        font-size: 0.9rem;
        line-height: 1.4;
        text-align: center; /* 卡片描述置中 */
    }
    
    /* 改善iframe的手機版佈局 */
    .iframe-container {
        margin: 0 -0.5rem;
        border-radius: 8px;
        overflow: hidden;
        text-align: center; /* iframe置中 */
    }
    
    .iframe-container iframe {
        width: 100%;
        height: 300px;
        border: none;
        margin: 0 auto; /* iframe置中 */
    }
    
    .iframe-note {
        text-align: center; /* iframe說明置中 */
        margin: 1rem auto;
    }
    
    .iframe-note p {
        text-align: center; /* 說明文字置中 */
        margin: 0 auto 1rem auto;
    }
    
    .open-window-btn {
        display: block; /* 按鈕置中 */
        margin: 0 auto;
    }
    
    /* 改善實用工具的手機版佈局 */
    .tools-section {
        text-align: center; /* 工具區塊置中 */
    }
    
    .tools-section .section-header {
        text-align: center; /* 工具標題置中 */
    }
    
    .tools-section .section-header h2 {
        text-align: center; /* 工具標題置中 */
        margin: 0 auto;
    }
    
    .tools-section .section-header p {
        text-align: center; /* 工具描述置中 */
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .main-content h1 {
        font-size: 1.5rem;
    }
    
    .main-content p {
        font-size: 1.2rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: normal;
        padding: 0 10px;
    }
    
    /* 超小螢幕的分類卡片佈局 */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 0 0.3rem;
    }
    
    .category-card {
        padding: 1.2rem 0.8rem;
        border-radius: 10px;
    }
    
    .category-card h4 {
        font-size: 1rem;
        margin: 0.4rem 0;
    }
    
    .category-card p {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .category-card i {
        font-size: 1.6rem;
        margin-bottom: 0.4rem;
    }
    
    /* 超小螢幕的儀表板佈局 */
    .dashboard-grid {
        gap: 0.8rem;
        padding: 0 0.3rem;
    }
    
    .dashboard-card {
        padding: 1.2rem 0.8rem;
    }
    
    .dashboard-card h3 {
        font-size: 1.1rem;
    }
    
    .dashboard-card .number {
        font-size: 1.8rem;
    }
    
    .dashboard-card p {
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    /* 超小螢幕的iframe佈局 */
    .iframe-container iframe {
        height: 250px;
    }
    
    /* 超小螢幕的導航 */
    .nav {
        gap: 0.5rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 0.25rem 0.6rem;
    }
    
    /* 超小螢幕的標題 */
    .section-header h2 {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .section-header p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading i {
    font-size: 2rem;
    color: #667eea;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空狀態樣式 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.empty-state h4 {
    color: #495057;
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin: 0;
    font-size: 1rem;
}

/* 常見問題解答區域 */
.qa-section {
    padding: 3rem 0;
    background: #f8f9fa;
}

.qa-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-size: 2.5rem;
}

.qa-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.category-filter select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: #2c3e50;
    cursor: pointer;
    min-width: 150px;
}

.random-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.random-btn:hover {
    background: #1ba085;
}

/* 分類摺疊區域 */
.category-accordion {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
}

.category-item {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    height: fit-content;
}

.category-header {
    background: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.category-header:hover {
    background: #1ba085;
}

.category-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.category-toggle {
    font-size: 1.5rem;
    transition: transform 0.3s;
}

.category-toggle.expanded {
    transform: rotate(180deg);
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.category-content.expanded {
    max-height: 2000px;
    transition: max-height 0.5s ease-in;
}

.qa-list {
    padding: 1rem 1.5rem;
}

.qa-item {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
    cursor: pointer;
    transition: background 0.2s;
}

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

.qa-item:hover {
    background: #f8f9fa;
}

.qa-question {
    font-weight: 500;
    color: #2c3e50;
    margin: 0;
    line-height: 1.4;
}

.qa-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    margin-top: 0.5rem;
}

.qa-answer.expanded {
    max-height: 1000px; /* 增加最大高度 */
    transition: max-height 0.5s ease-in;
    overflow-y: auto; /* 添加垂直滾動 */
    overflow-x: hidden; /* 隱藏水平滾動 */
}

.qa-answer-content {
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

.qa-keywords {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.qa-keyword {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.qa-source {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.qa-source a {
    color: #20c997;
    text-decoration: none;
}

.qa-source a:hover {
    text-decoration: underline;
}

/* 響應式設計 */
@media (max-width: 1200px) {
    .category-accordion {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        max-width: 900px;
    }
}

@media (max-width: 768px) {
    .category-accordion {
        grid-template-columns: 1fr;
        max-width: 500px;
        gap: 1rem;
    }
    
    .qa-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .category-filter select {
        width: 100%;
    }
    
    .random-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* 熱門Q&A區塊手機版置中 */
    .categories-section {
        text-align: center;
    }
    
    .categories-section h2 {
        text-align: center;
        margin: 0 auto;
    }
    
    .categories-section .section-header {
        text-align: center;
    }
    
    .categories-section .section-header h2 {
        text-align: center;
        margin: 0 auto;
    }
    
    .categories-section .section-header p {
        text-align: center;
        margin: 0 auto;
    }
}

/* 熱門分類區域 */
.categories-section {
    padding: 3rem 0;
    background: #e8e8e8; /* 底板再暗一點 */
}

.categories-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-size: 2.5rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.category-card {
    background: white;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 8px 30px rgba(32, 201, 151, 0.25);
    border: 2px solid #e0e0e0; /* 添加明顯的邊框 */
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #20c997, #1ba085);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(32, 201, 151, 0.35);
    border-color: #20c997; /* 懸停時邊框變色 */
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card.active {
    border-color: #20c997;
    background: linear-gradient(135deg, #f8fffe 0%, #e8f8f5 100%);
    box-shadow: 0 12px 35px rgba(32, 201, 151, 0.3); /* 活動狀態時陰影更強 */
}

.category-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #20c997, #1ba085);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.category-card h3 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.category-card p {
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* 分類包裝器 */
.category-wrapper {
    position: relative;
}

/* 分類展開區域 */
.category-expansion {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background: #f8f9fa;
    border-radius: 0 0 16px 16px;
    margin-top: -1px;
    border: 2px solid transparent;
    border-top: none;
    width: 100%; /* 確保寬度填滿 */
}

.category-expansion.expanded {
    max-height: 4000px; /* 增加最大高度 */
    transition: max-height 0.6s ease-in;
    border-color: #20c997;
    overflow-y: auto; /* 添加垂直滾動 */
    overflow-x: hidden; /* 隱藏水平滾動 */
}

/* 分類切換按鈕 */
.category-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #20c997;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.category-toggle.expanded {
    transform: rotate(180deg);
}

/* Q&A列表樣式 */
.qa-list {
    padding: 1.5rem;
}

.qa-item {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
    cursor: pointer;
    transition: background 0.2s;
}

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

.qa-item:hover {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin: 0 -1rem;
}

.qa-question {
    font-weight: 500;
    color: #2c3e50;
    margin: 0;
    line-height: 1.4;
    font-size: 1rem;
}

.qa-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    margin-top: 0.5rem;
}

.qa-answer.expanded {
    max-height: 1000px; /* 增加最大高度 */
    transition: max-height 0.5s ease-in;
    overflow-y: auto; /* 添加垂直滾動 */
    overflow-x: hidden; /* 隱藏水平滾動 */
}

.qa-answer-content {
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

.qa-keywords {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.qa-keyword {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.qa-source {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.qa-source a {
    color: #20c997;
    text-decoration: none;
}

.qa-source a:hover {
    text-decoration: underline;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        gap: 1rem;
    }
    
    .category-card {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .categories-section {
        text-align: center;
    }
    
    .categories-section h2 {
        text-align: center;
        margin: 0 auto;
        font-size: 2rem;
    }
    
    .categories-section .section-header {
        text-align: center;
    }
    
    .categories-section .section-header h2 {
        text-align: center;
        margin: 0 auto;
        font-size: 2rem;
    }
    
    .categories-section .section-header p {
        text-align: center;
        margin: 0 auto;
    }
    
    .categories-grid {
        max-width: 350px;
        gap: 0.8rem;
    }
    
    .category-card {
        padding: 1.2rem 0.8rem;
    }
}

/* 另開視窗按鈕樣式 */
.open-window-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 10px rgba(40, 200, 200, 0.3);
}

.open-window-btn:hover {
    background: var(--primaryHover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 200, 200, 0.4);
}

.open-window-btn:active {
    transform: translateY(0);
}

.open-window-btn i {
    font-size: 0.8rem;
}

