/* 法律文件統一樣式表 */

/* 基本重置與字型 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    line-height: 1.6;
    background-color: #f8f9fa;
    color: #333;
    padding: 0;
    margin: 0;
}

/* 文件容器 */
.legal-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* 文件標題區域 */
.legal-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 2rem 2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.company-info h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.company-info h2 {
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.9;
    margin-bottom: 0;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

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

/* 文件內容區域 */
.legal-content {
    padding: 2rem;
}

.document-body {
    max-width: 900px;
    margin: 0 auto;
}

/* 目錄樣式 */
.table-of-contents {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.table-of-contents h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc-list {
    list-style: none;
    padding: 0;
}

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-list a {
    color: #495057;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 4px;
    display: block;
    transition: all 0.2s ease;
}

.toc-list a:hover {
    background: #e9ecef;
    color: #2c3e50;
    text-decoration: none;
    padding-left: 1rem;
}

/* 章節樣式 */
.legal-section {
    margin-bottom: 2rem;
}

.section-title {
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #3498db;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-content {
    background: white;
    padding: 1.5rem 0;
}

/* 段落樣式 */
.intro-paragraph {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    border-radius: 0 8px 8px 0;
}

.legal-paragraph {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    text-align: justify;
    color: #444;
}

.final-statement {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
    font-weight: 500;
}

/* 資料類型列表 */
.data-category {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid #28a745;
}

.data-category h4 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.data-list {
    list-style: none;
    padding-left: 1rem;
}

.data-list li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
    line-height: 1.6;
}

.data-list li:before {
    content: "▪";
    color: #3498db;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* 強調文字 */
strong {
    color: #2c3e50;
    font-weight: 600;
}

/* 頁尾 */
.legal-footer {
    background: #2c3e50;
    color: white;
    padding: 2rem;
    margin-top: 3rem;
}

.footer-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.btn-back-to-top,
.btn-print {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-back-to-top:hover,
.btn-print:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.footer-info {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.8;
}

/* 手機響應式設計 */
@media (max-width: 768px) {
    .legal-header {
        padding: 1.5rem 1rem;
        text-align: center;
    }
    
    .company-info h1 {
        font-size: 1.4rem;
    }
    
    .company-info h2 {
        font-size: 1rem;
    }
    
    .legal-content {
        padding: 1.5rem 1rem;
    }
    
    .intro-paragraph {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .legal-paragraph {
        font-size: 0.95rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .table-of-contents {
        padding: 1rem;
    }
    
    .data-category {
        padding: 1rem;
    }
    
    .footer-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-back-to-top,
    .btn-print {
        min-width: 150px;
        justify-content: center;
    }
}

/* 小螢幕優化 */
@media (max-width: 480px) {
    .legal-header {
        padding: 1rem 0.5rem;
    }
    
    .company-info h1 {
        font-size: 1.2rem;
    }
    
    .legal-content {
        padding: 1rem 0.5rem;
    }
    
    .intro-paragraph,
    .data-category {
        padding: 0.8rem;
    }
    
    .close-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* 列印樣式 */
@media print {
    body {
        background: white;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .legal-container {
        box-shadow: none;
        max-width: none;
    }
    
    .legal-header {
        background: white !important;
        color: black !important;
        page-break-after: avoid;
    }
    
    .close-btn,
    .footer-actions {
        display: none !important;
    }
    
    .legal-content {
        padding: 1rem;
    }
    
    .legal-section {
        page-break-inside: avoid;
    }
    
    .section-title {
        page-break-after: avoid;
    }
    
    .table-of-contents {
        page-break-after: auto;
    }
    
    a {
        text-decoration: none !important;
        color: black !important;
    }
}

/* 平滑滾動 */
html {
    scroll-behavior: smooth;
}

/* 輔助功能 */
a:focus,
button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 載入動畫（如需要） */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}