/* ============================================
   LEGAL PAGE STYLES
   ============================================ */

/* Legal Page Header */
.legal-header {
    text-align: center;
    margin: 60px auto 50px;
    max-width: 800px;
}

.legal-main-title {
    font-size: 3rem;
    color: #ff7a42;
    font-weight: 800;
    margin-bottom: 15px;
}

.legal-subtitle {
    font-size: 1.2rem;
    color: #5A3E36;
    font-weight: 600;
    line-height: 1.6;
}

/* Legal Page Layout with Sidebar */
.legal-layout {
    display: flex;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: flex-start;
}

/* Sidebar Navigation */
.legal-sidebar {
    position: sticky;
    top: 100px;
    width: 280px;
    flex-shrink: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: none;
    border: 2px solid #e0e0e0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    background: transparent;
    border: none;
    border-radius: 15px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #5A3E36;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
    text-align: left;
    width: 100%;
    text-decoration: none;
}

.sidebar-item i {
    font-size: 1.3rem;
    color: #ff7a42;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.sidebar-item:hover {
    background: rgba(255, 122, 66, 0.1);
    transform: none;
    text-decoration: none;
}

.sidebar-item.active {
    background: #ff7a42;
    color: white;
    box-shadow: none;
    text-decoration: none;
}

.sidebar-item.active i {
    color: white;
}

/* Legal Content Container */
.legal-content {
    flex: 1;
    min-width: 0;
}

.legal-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.legal-section.active {
    display: block;
}

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

/* Section Header */
.section-header {
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 3px solid #ff7a42;
}

.section-title {
    font-size: 2.5rem;
    color: #ff7a42;
    font-weight: 800;
    margin-bottom: 10px;
}

.section-date {
    font-size: 1rem;
    color: #8B4513;
    font-weight: 600;
    font-style: italic;
}

/* Legal Text Content */
.legal-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #5A3E36;
}

.legal-text .intro-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: #5A3E36;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 122, 66, 0.05);
    border-left: 4px solid #ff7a42;
    border-radius: 8px;
}

.legal-text h3 {
    font-size: 1.5rem;
    color: #ff7a42;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 20px;
}

.legal-text p {
    margin-bottom: 20px;
}

.legal-text ul {
    margin: 20px 0;
    padding-left: 30px;
}

.legal-text ul li {
    margin-bottom: 15px;
    line-height: 1.7;
    position: relative;
}

.legal-text ul li::marker {
    color: #ff7a42;
    font-weight: bold;
}

.legal-text strong {
    color: #5A3E36;
    font-weight: 700;
}

.legal-text a {
    color: #ff7a42;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.3s ease;
}

.legal-text a:hover {
    color: #ff8c5a;
}

/* AI Disclaimer Notice Box */
.disclaimer-notice {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-top: 40px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(255, 122, 66, 0.1), rgba(255, 153, 102, 0.1));
    border: 2px solid #ff7a42;
    border-radius: 15px;
}

.disclaimer-notice i {
    font-size: 1.5rem;
    color: #ff7a42;
    flex-shrink: 0;
    margin-top: 3px;
}

.disclaimer-notice p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #5A3E36;
}

/* FAQ Container */
.faq-container {
    margin-top: 40px;
}

.faq-category {
    margin-bottom: 50px;
}

.faq-category-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.8rem;
    color: #ff7a42;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 122, 66, 0.3);
}

.faq-category-title i {
    font-size: 1.5rem;
}

/* FAQ Item */
.faq-item {
    margin-bottom: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(255, 122, 66, 0.3);
    box-shadow: none;
}

.faq-item.active {
    border-color: #ff7a42;
    box-shadow: none;
}

/* FAQ Question Button */
.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: white;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    color: #5A3E36;
    text-align: left;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
}

.faq-question:hover {
    background: rgba(255, 122, 66, 0.05);
}

.faq-item.active .faq-question {
    background: rgba(255, 122, 66, 0.1);
    color: #ff7a42;
}

.faq-question i {
    font-size: 1rem;
    color: #ff7a42;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

/* FAQ Answer */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, padding 0.5s ease, opacity 0.5s ease;
    background: rgba(255, 122, 66, 0.02);
    opacity: 0;  /* 新增透明度動畫 */
    padding: 0 25px;
}

.faq-item.active .faq-answer {
    padding: 20px 25px;
    border-top: 1px solid rgba(255, 122, 66, 0.2);
    opacity: 1;
    overflow: visible;  /* ✅ 展開時允許內容完全顯示 */
}

.faq-answer p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    color: #5A3E36;
    word-wrap: break-word;      /* ✅ 優化文字換行 */
    overflow-wrap: break-word;  /* ✅ 防止長單詞溢出 */
    white-space: normal;        /* ✅ 確保正常換行 */
}

/* ============================================
   DARK THEME - LEGAL PAGE
   ============================================ */

html.dark-theme .legal-main-title,
body.dark-theme .legal-main-title {
    color: #ff7a42;
}

html.dark-theme .legal-subtitle,
body.dark-theme .legal-subtitle {
    color: #e0e0e0;
}

html.dark-theme .sidebar-nav,
body.dark-theme .sidebar-nav {
    background: #2a2a2a;
    border-color: #505050;
}

html.dark-theme .sidebar-item,
body.dark-theme .sidebar-item {
    color: #e0e0e0;
    text-decoration: none;
}

html.dark-theme .sidebar-item:hover,
body.dark-theme .sidebar-item:hover {
    background: rgba(255, 122, 66, 0.2);
    text-decoration: none;
}

html.dark-theme .sidebar-item.active,
body.dark-theme .sidebar-item.active {
    background: #ff7a42;
    color: white;
    text-decoration: none;
}

html.dark-theme .section-header,
body.dark-theme .section-header {
    border-bottom-color: rgba(255, 122, 66, 0.5);
}

html.dark-theme .section-title,
body.dark-theme .section-title {
    color: #ff7a42;
}

html.dark-theme .section-date,
body.dark-theme .section-date {
    color: #d0d0d0;
}

html.dark-theme .legal-text,
body.dark-theme .legal-text {
    color: #d0d0d0;
}

html.dark-theme .legal-text .intro-text,
body.dark-theme .legal-text .intro-text {
    background: rgba(255, 122, 66, 0.15);
    color: #e0e0e0;
}

html.dark-theme .legal-text h3,
body.dark-theme .legal-text h3 {
    color: #ff7a42;
}

html.dark-theme .legal-text strong,
body.dark-theme .legal-text strong {
    color: #e0e0e0;
}

html.dark-theme .legal-text a,
body.dark-theme .legal-text a {
    color: #ff9966;
}

html.dark-theme .legal-text a:hover,
body.dark-theme .legal-text a:hover {
    color: #ffb380;
}

html.dark-theme .disclaimer-notice,
body.dark-theme .disclaimer-notice {
    background: rgba(255, 122, 66, 0.15);
    border-color: #ff7a42;
}

html.dark-theme .disclaimer-notice p,
body.dark-theme .disclaimer-notice p {
    color: #e0e0e0;
}

html.dark-theme .faq-category-title,
body.dark-theme .faq-category-title {
    color: #ff7a42;
    border-bottom-color: rgba(255, 122, 66, 0.3);
}

html.dark-theme .faq-item,
body.dark-theme .faq-item {
    background: #2a2a2a;
    border-color: #505050;
}

html.dark-theme .faq-item:hover,
body.dark-theme .faq-item:hover {
    border-color: rgba(255, 122, 66, 0.5);
}

html.dark-theme .faq-item.active,
body.dark-theme .faq-item.active {
    border-color: #ff7a42;
}

html.dark-theme .faq-question,
body.dark-theme .faq-question {
    background: #2a2a2a;
    color: #e0e0e0;
}

html.dark-theme .faq-question:hover,
body.dark-theme .faq-question:hover {
    background: rgba(255, 122, 66, 0.1);
}

html.dark-theme .faq-item.active .faq-question,
body.dark-theme .faq-item.active .faq-question {
    background: rgba(255, 122, 66, 0.2);
    color: #ff7a42;
}

html.dark-theme .faq-answer,
body.dark-theme .faq-answer {
    background: rgba(255, 122, 66, 0.05);
}

html.dark-theme .faq-item.active .faq-answer,
body.dark-theme .faq-item.active .faq-answer {
    border-top-color: rgba(255, 122, 66, 0.3);
    overflow: visible;
}

html.dark-theme .faq-answer p,
body.dark-theme .faq-answer p {
    color: #d0d0d0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* ============================================
   RESPONSIVE - LEGAL PAGE
   ============================================ */

@media (max-width: 768px) {
    .legal-header {
        margin: 40px auto 30px;
        padding: 0 20px;
    }
    
    .legal-main-title {
        font-size: 2.2rem;
    }
    
    .legal-subtitle {
        font-size: 1rem;
    }
    
    .legal-layout {
        flex-direction: column;
        gap: 30px;
    }
    
    .legal-sidebar {
        position: static;
        width: 100%;
    }
    
    .sidebar-nav {
        flex-direction: column;
        padding: 15px;
        gap: 10px;
    }
    
    .sidebar-item {
        flex-direction: row;
        width: 100%;
        padding: 15px 18px;
        gap: 15px;
        text-align: left;
        justify-content: flex-start;
    }
    
    .sidebar-item i {
        font-size: 1.3rem;
    }
    
    .sidebar-item span {
        font-size: 1rem;
    }
    
    .sidebar-item:hover {
        transform: translateX(5px);
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .legal-text .intro-text {
        font-size: 1.05rem;
        padding: 15px;
    }
    
    .legal-text h3 {
        font-size: 1.3rem;
        margin-top: 30px;
    }
    
    .legal-text ul {
        padding-left: 20px;
    }
    
    .faq-category-title {
        font-size: 1.5rem;
    }
    
    .faq-question {
        padding: 15px 18px;
        font-size: 1rem;
    }
    
    .faq-answer {
        font-size: 0.95rem;
    }
    
    .faq-item.active .faq-answer {
        max-height: 1000px;
        padding: 15px 18px;
    }
    
    .disclaimer-notice {
        flex-direction: column;
        padding: 20px;
    }
    
    .disclaimer-notice i {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .legal-main-title {
        font-size: 1.8rem;
    }
    
    .sidebar-item {
        padding: 14px 16px;
    }
    
    .sidebar-item i {
        font-size: 1.2rem;
    }
    
    .sidebar-item span {
        font-size: 0.95rem;
    }
    
    .section-title {
        font-size: 1.7rem;
    }
    
    .faq-category-title {
        font-size: 1.3rem;
    }
}
