/* Legal Pages Styles */

.legal-hero {
    background: linear-gradient(135deg, #0a0a0f, #1a1a2e);
    padding: 120px 0 60px;
    position: relative;
    margin-top: 70px;
}

.legal-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(99, 102, 241, 0.1), transparent 70%);
}

.legal-hero .container {
    position: relative;
    z-index: 2;
}

.legal-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legal-subtitle {
    font-size: 1.2rem;
    color: #b8b8cc;
    line-height: 1.6;
    max-width: 600px;
    margin-bottom: 20px;
}

.update-date {
    background: rgba(99, 102, 241, 0.2);
    color: #6366f1;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
}

.legal-content {
    padding: 80px 0;
    background: linear-gradient(180deg, #0f0f23, #1a1a2e);
    min-height: 100vh;
}

.legal-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 60px;
    align-items: start;
}

.legal-main {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 50px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.legal-text {
    color: #e2e8f0;
    line-height: 1.8;
    font-size: 1rem;
}

.legal-text h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin: 40px 0 20px 0;
    position: relative;
    padding-left: 20px;
    background: linear-gradient(135deg, #ffffff, #e2e8f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legal-text h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 2px;
}

.legal-text h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 24px 0 16px 0;
}

.legal-text p {
    margin-bottom: 20px;
    color: #cbd5e1;
    line-height: 1.7;
}

.legal-text ul, .legal-text ol {
    margin: 20px 0;
    padding-left: 24px;
}

.legal-text li {
    margin-bottom: 12px;
    color: #cbd5e1;
    line-height: 1.6;
}

.legal-text ul li::marker {
    content: '▶';
    color: #6366f1;
    font-size: 0.8em;
}

.legal-text strong {
    color: #ffffff;
    font-weight: 600;
}

.contact-info {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #f1f5f9;
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-item i {
    color: #6366f1;
    width: 20px;
    text-align: center;
}

.legal-notice {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 16px;
    padding: 24px;
    margin-top: 40px;
}

.legal-notice h3 {
    color: #fbbf24;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legal-notice h3::before {
    content: '⚠️';
    font-size: 1.2rem;
}

.legal-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-nav, .related-links, .help-widget {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(10px);
}

.sidebar-nav h3, .related-links h3, .help-widget h3 {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 16px;
    font-weight: 600;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 8px;
}

.sidebar-nav a {
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    padding: 6px 0;
    border-radius: 6px;
    padding-left: 8px;
}

.sidebar-nav a:hover {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(4px);
}

.legal-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #f1f5f9;
    text-decoration: none;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.legal-link:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    transform: translateY(-2px);
}

.legal-link i {
    color: #6366f1;
    width: 20px;
    text-align: center;
}

.help-widget p {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* Cookie Table Styles */
.cookie-table {
    margin: 24px 0;
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.cookie-table table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.cookie-table th,
.cookie-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-table th {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
}

.cookie-table td {
    color: #cbd5e1;
    font-size: 0.9rem;
}

.cookie-table tr:hover {
    background: rgba(99, 102, 241, 0.1);
}

/* Links in legal text */
.legal-text a {
    color: #6366f1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.legal-text a:hover {
    color: #8b5cf6;
    text-decoration: underline;
}

/* Cookie Manager Widget */
.cookie-manager {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 28px;
    backdrop-filter: blur(10px);
    text-align: center;
}

.cookie-manager h3 {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.cookie-manager p {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* ================ RESPONSIVE DESIGN (RWD) ================ */

/* Large Desktop (1920px+) */
@media (min-width: 1920px) {
    .legal-layout {
        grid-template-columns: 1fr 350px;
        gap: 80px;
    }
    
    .legal-main {
        padding: 60px;
    }
}

/* Standard Desktop (1200px - 1919px) */
@media (max-width: 1200px) {
    .legal-layout {
        grid-template-columns: 1fr 280px;
        gap: 40px;
    }
}

/* Large Tablet / Small Desktop (1024px - 1199px) */
@media (max-width: 1024px) {
    .legal-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .legal-sidebar {
        position: static !important;
        top: auto !important;
        order: -1; /* 將側邊欄移到內容前面 */
    }
    
    .legal-main {
        padding: 40px 30px;
    }
    
    .legal-content {
        padding: 60px 0;
    }
    
    .legal-hero {
        padding: 100px 0 50px;
    }
}

/* Standard Tablet (768px - 1023px) */
@media (max-width: 768px) {
    .legal-hero {
        padding: 90px 0 40px;
        margin-top: 70px;
    }
    
    .legal-title {
        font-size: clamp(2rem, 8vw, 3rem);
        text-align: center;
    }
    
    .legal-subtitle {
        font-size: 1.1rem;
        text-align: center;
        margin: 0 auto 20px;
    }
    
    .update-date {
        display: block;
        text-align: center;
        margin: 0 auto;
        width: fit-content;
    }
    
    .legal-content {
        padding: 40px 0;
    }
    
    .legal-main {
        padding: 30px 20px;
        margin: 0 10px;
        border-radius: 16px;
    }
    
    .legal-text h2 {
        font-size: 1.5rem;
        margin: 30px 0 16px 0;
    }
    
    .legal-text h3 {
        font-size: 1.2rem;
        margin: 20px 0 12px 0;
    }
    
    .legal-sidebar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        margin: 0 10px;
    }
    
    .sidebar-nav, .related-links, .help-widget {
        padding: 20px;
    }
    
    .cookie-table {
        margin: 20px -10px;
        border-radius: 8px;
    }
    
    .cookie-table th,
    .cookie-table td {
        padding: 12px 8px;
        font-size: 0.85rem;
    }
    
    .cookie-table th {
        font-size: 0.8rem;
    }
    
    /* Mobile Navigation */
    .nav-toggle {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        padding: 4px;
        z-index: 1002;
    }

    .nav-toggle span {
        width: 25px;
        height: 3px;
        background: #ffffff;
        margin: 2px 0;
        transition: 0.3s;
        border-radius: 2px;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .nav-menu {
        position: fixed !important