/* 
 * UI/UX Pro Max Design System
 * Version: 0.1.0.9 (2026-05-16)
 */
:root {
    /* Color Palette - Premium Dark Mode */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --secondary: #06b6d4;
    --secondary-hover: #0891b2;
    --secondary-glow: rgba(6, 182, 212, 0.5);
    --accent: #f43f5e;
    --accent-glow: rgba(244, 63, 94, 0.5);
    --background: #0f172a;
    --background-dark: #020617;
    --surface: #1e293b;
    --surface-light: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    /* Glassmorphism */
    --glass: rgba(30, 41, 59, 0.6);
    --glass-hover: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
    /* Spacing & Layout */
    --header-height: 70px;
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;
}

html.light-theme, body.light-theme {
    /* Color Palette - Premium Light Mode (LOCALSOFT Digital Studio style) */
    --primary: #0ea5e9;
    --primary-hover: #0284c7;
    --primary-glow: rgba(14, 165, 233, 0.15);
    --secondary: #6366f1;
    --secondary-hover: #4f46e5;
    --secondary-glow: rgba(99, 102, 241, 0.15);
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.12);
    --background: #f0f7ff;
    --background-dark: #e2efff;
    --surface: #ffffff;
    --surface-light: #f1f5f9;
    --text: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #2563eb;
    
    /* Glassmorphism */
    --glass: rgba(255, 255, 255, 0.65);
    --glass-hover: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(226, 232, 240, 0.8);
    --glass-highlight: rgba(14, 165, 233, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(56, 120, 200, 0.08);

    /* Light Theme Dynamic Background */
    background-image: radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.12) 0px, transparent 50%), 
                      radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%), 
                      radial-gradient(at 50% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);
}

/* Light Theme Overrides */
.light-theme .logo-text {
    background: linear-gradient(to right, #0ea5e9, #6366f1) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.light-theme nav {
    background: rgba(255, 255, 255, 0.85) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.light-theme .nav-link,
.light-theme .nav-dropdown .dropdown-toggle {
    color: #0f172a !important;
}

.light-theme .nav-link:hover,
.light-theme .nav-dropdown .dropdown-toggle:hover {
    color: #0ea5e9 !important;
}

.light-theme .dropdown-menu {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 10px 40px rgba(56, 120, 200, 0.1) !important;
}

.light-theme .dropdown-item {
    color: #475569 !important;
}

.light-theme .dropdown-item:hover {
    background: rgba(14, 165, 233, 0.08) !important;
    color: #0ea5e9 !important;
}

.dropdown-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

.light-theme .dropdown-divider {
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* Explicit Card background override to prevent grey rendering */
.light-theme .card,
.light-theme .feature-card,
.light-theme .mailbox-status {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(14, 165, 233, 0.15) !important;
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.04) !important;
}

.light-theme .card::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, transparent 100%) !important;
}

/* Light Theme Language Selector Overrides */
.light-theme .lang-selector {
    background: rgba(14, 165, 233, 0.08) !important;
    border: 1px solid rgba(14, 165, 233, 0.15) !important;
}

.light-theme .lang-btn {
    color: #475569 !important;
}

.light-theme .lang-btn:hover {
    color: #0ea5e9 !important;
    background: rgba(14, 165, 233, 0.08) !important;
}

.light-theme .lang-btn.active {
    background: #0ea5e9 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2) !important;
}

.light-theme .theme-toggle {
    background: rgba(14, 165, 233, 0.08) !important;
    border: 1px solid rgba(14, 165, 233, 0.15) !important;
}

.light-theme .theme-toggle::before {
    background: #0ea5e9;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
    transform: none;
}

.light-theme .theme-icon-moon {
    color: #ffffff;
    opacity: 1;
    transform: scale(1);
}

.light-theme .theme-icon-sun {
    color: #64748b;
    opacity: 0;
    transform: scale(0.85);
}



.light-theme input[type="text"],
.light-theme input[type="email"],
.light-theme input[type="password"],
.light-theme select {
    background: rgba(255, 255, 255, 0.6) !important;
    color: #0f172a !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03) !important;
}

.light-theme input:focus,
.light-theme select:focus {
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.03) !important;
}

.light-theme select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

.light-theme input:-webkit-autofill,
.light-theme input:-webkit-autofill:hover,
.light-theme input:-webkit-autofill:focus,
.light-theme input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #f0f7ff inset !important;
    -webkit-text-fill-color: #0f172a !important;
    caret-color: #0f172a !important;
}

.light-theme .landing-title {
    background-image: linear-gradient(to right, #0ea5e9 20%, #6366f1 50%, #8b5cf6 80%) !important;
}

.light-theme .email-item {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    color: #0f172a !important;
}

.light-theme .email-item:hover {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: var(--primary) !important;
}

.light-theme .info-box {
    background: rgba(255, 255, 255, 0.4) !important;
}

.light-theme .modal-content {
    background: #ffffff !important;
    box-shadow: 0 25px 50px -12px rgba(56, 120, 200, 0.15) !important;
}

.light-theme .modal-close {
    background: rgba(0, 0, 0, 0.03) !important;
}

.light-theme .modal-close:hover {
    background: rgba(239, 68, 68, 0.1) !important;
}

.light-theme .alert-success {
    background: rgba(5, 150, 105, 0.08) !important;
    border-color: rgba(5, 150, 105, 0.2) !important;
    color: #047857 !important;
}

.light-theme .alert-success strong {
    color: #065f46 !important;
}

.light-theme .alert-danger {
    background: rgba(220, 38, 38, 0.08) !important;
    border-color: rgba(220, 38, 38, 0.2) !important;
    color: #b91c1c !important;
}

.light-theme .alert-danger strong {
    color: #991b1b !important;
}

.light-theme .alert-warning {
    background: rgba(217, 119, 6, 0.08) !important;
    border-color: rgba(217, 119, 6, 0.2) !important;
    color: #b45309 !important;
}

.light-theme .alert-warning strong {
    color: #92400e !important;
}

.light-theme .alert-info {
    background: rgba(37, 99, 235, 0.08) !important;
    border-color: rgba(37, 99, 235, 0.2) !important;
    color: #1d4ed8 !important;
}

.light-theme .alert-info strong {
    color: #1e40af !important;
}

.light-theme .toggle-switch-wrapper {
    background: rgba(0, 0, 0, 0.02) !important;
}

.light-theme .toggle-switch-wrapper:hover {
    background: rgba(0, 0, 0, 0.04) !important;
}

.light-theme .toggle-switch-wrapper.toggle-enabled {
    background: rgba(14, 165, 233, 0.06) !important;
    border-color: rgba(14, 165, 233, 0.3) !important;
}

.light-theme .toggle-slider {
    background: rgba(0, 0, 0, 0.08) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.light-theme .toggle-slider::before {
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15) !important;
}

.light-theme .btn-secondary {
    background: rgba(255, 255, 255, 0.6) !important;
    color: #334155 !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

.light-theme .btn-secondary:hover {
    background: #ffffff !important;
    color: #0ea5e9 !important;
    border-color: #0ea5e9 !important;
}

/* Base Reset & Typography */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    /* Dynamic Background */
    background-image: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%), radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.15) 0px, transparent 50%), radial-gradient(at 50% 100%, rgba(244, 63, 94, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Page Wrapper (Sticky Footer + AdSense compatibility) */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* AdSense Auto-Ads Whitespace Fix */
ins.adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

body > .google-auto-placed {
    margin-bottom: 0 !important;
}
body > ins.adsbygoogle:not([data-adsbygoogle-status="done"]) {
    display: none !important;
}

main {
    flex: 1 0 auto;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: var(--radius-full);
    border: 2px solid var(--background);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 90%;
}

/* Typography Enhancements */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

/* Premium Components */
/* -- Cards -- */
.card {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--glass-highlight);
}

/* -- Buttons -- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    /* 流暢的微動畫效果 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

/* Primary Button - Glow Effect */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 25px var(--primary-glow), 0 0 5px rgba(255, 255, 255, 0.3) inset;
    transform: translateY(-1px);
    color: white;
}

/* Secondary Button (Glass) */
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: var(--text);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
    color: white;
}

.desktop-nav-buttons .nav-auth-btn,
.desktop-nav-buttons .nav-user-btn {
    min-width: 68px;
    min-height: 38px;
    padding: 0.52rem 1rem;
    font-size: 0.9rem;
    line-height: 1;
}

.desktop-nav-buttons .nav-user-btn {
    max-width: 150px;
    padding-inline: 0.85rem;
}

.desktop-nav-buttons .nav-user-label {
    display: inline-block;
    min-width: 0;
    max-width: 104px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Success Button */
.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-success:hover {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
    color: white;
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-danger:hover {
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
    color: white;
}

/* Warning Button */
.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* -- Forms -- */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-size: 1rem;
    transition: all 0.2s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Ensure option elements are readable on Windows in dark mode */
select option {
    background-color: var(--surface);
    color: var(--text);
}

/* Fix Chrome Autofill flickering issue caused by backdrop-filter */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #0f172a inset !important;
    /* 使用與 --background 相同色值 */
    -webkit-text-fill-color: #f8fafc !important;
    /* 使用與 --text 相同色值 */
    transition: background-color 5000s ease-in-out 0s;
    caret-color: #f8fafc;
}

/* -- Landing Hero -- */
.landing-hero {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 4rem 2rem;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(6, 182, 212, 0.1) 40%, transparent 70%);
    filter: blur(100px);
    z-index: -1;
    animation: pulseGlow 8s infinite alternate;
}

@keyframes pulseGlow {
    0% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
}

.landing-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    background: linear-gradient(to right, #fff 20%, #a5f3fc 50%, #c4b5fd 80%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 5s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

.landing-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 3rem;
    line-height: 1.6;
}

/* -- Features Grid -- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.feature-card {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 2rem;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px -15px rgba(99, 102, 241, 0.25);
    background: rgba(30, 41, 59, 0.5);
}

.feature-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
}

.feature-card:hover .feature-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    transform: scale(1.1) rotate(5deg);
}

.feature-card .feature-title {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.feature-card .feature-desc {
    color: var(--text-muted);
}

/* -- Mailbox UI -- */
.mailbox-status {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--glass-shadow);
}

.email-list {
    display: grid;
    gap: 1rem;
}

.email-item {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.email-item:hover {
    border-color: var(--primary);
    background: rgba(30, 41, 59, 0.7);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 已移除：email-item 箭頭動畫效果（設計調整後不再使用） */
/* -- Modal -- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Email Modal Specific - Auto adjust width based on email content */
#emailModal .modal-content {
    --text: #0f172a;
    --text-muted: #475569;
    --glass-border: rgba(15, 23, 42, 0.12);
    max-width: 95vw;
    width: fit-content;
    min-width: min(800px, 95vw);
    background: #ffffff;
    color: var(--text);
    color-scheme: light;
    overflow-x: auto;
}

#emailModal .email-body-content,
#emailModal iframe {
    background: #ffffff;
    color: #0f172a;
    color-scheme: light;
}

#emailModal .modal-close {
    background: rgba(15, 23, 42, 0.05);
    border-color: var(--glass-border);
    color: var(--text-muted);
}

#emailModal .modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* -- Status Badges -- */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: normal;
    white-space: nowrap;
    transition: all 0.2s;
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* -- Alerts & Notices -- */
.alert,
.notice-box {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: start;
    gap: 1rem;
    backdrop-filter: blur(10px);
}

.alert-success,
.notice-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.alert-danger,
.notice-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-warning,
.notice-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.alert-info,
.info-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

/* -- Mobile Responsive -- */
/* -- Footer -- */
footer {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .landing-hero {
        padding: 3rem 1rem;
        min-height: auto;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .email-header {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* -- Animations -- */
.micro-anim {
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lang-selector {
    display: flex;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--glass-border);
    padding: 2px;
    border-radius: var(--radius-sm);
    align-items: center;
    flex-shrink: 0;
    gap: 1px;
}

.lang-btn {
    border: none;
    background: none;
    min-width: 32px;
    padding: 4px 7px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: calc(var(--radius-sm) - 2px);
    transition: all 0.2s ease;
}

.lang-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.lang-btn.active {
    background: var(--glass-highlight);
    color: var(--text);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 32px;
    padding: 2px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(30, 41, 59, 0.6);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 28px;
    height: 28px;
    border-radius: calc(var(--radius-sm) - 2px);
    background: var(--glass-highlight);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--glass-highlight);
    background: var(--glass-hover);
}

.theme-toggle-icon {
    position: absolute;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.theme-icon-moon {
    color: var(--text);
    opacity: 0;
    transform: scale(0.85);
}

.theme-icon-sun {
    color: var(--text);
    opacity: 1;
    transform: scale(1);
}

.mobile-header-theme-toggle {
    display: none;
}


/* Nav Link Hover Effect */
nav a:not(.btn):not(.nav-logo) {
    position: relative;
    padding-bottom: 2px;
}

nav a:not(.btn):not(.nav-logo)::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

nav a:not(.btn):not(.nav-logo):hover::after {
    width: 100%;
}

/* 強制首頁 CTA 按鈕高度一致 */
.home-cta-btn {
    height: 60px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: normal !important;
    vertical-align: middle !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-sizing: border-box !important;
}

/* [已整合] Alert 樣式已合併至下方 Enhanced 區塊與 Closable Alert 區塊 */

/* Alert System - Enhanced for Closable Alerts */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    position: relative;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text);
    /* 預設文字顏色 */
}

/* Success Alert */
.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.alert-success strong {
    color: #6ee7b7;
    /* 更亮的綠色標題 */
}

/* Danger/Error Alert */
.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.alert-danger strong {
    color: #fca5a5;
    /* 更亮的紅色標題 */
}

/* Warning Alert */
.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.alert-warning strong {
    color: #fcd34d;
    /* 更亮的黃色標題 */
}

/* Info Alert */
.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.alert-info strong {
    color: #93c5fd;
    /* 更亮的藍色標題 */
}

/* 403 Error Page Styles (Glassmorphism & Mobile Optimized) */
.error-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    z-index: 10;
}

.error-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.5s ease-out;
}

.error-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Specific styling for the forbidden icon */
.error-icon-svg {
    width: 64px;
    height: 64px;
    color: #ef4444;
    /* Red */
    filter: drop-shadow(0 4px 6px rgba(239, 68, 68, 0.3));
}

.error-code {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-family: 'Inter', system-ui, sans-serif;
}

.error-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-weight: 500;
}

.ip-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-family: 'Monaco', 'Consolas', monospace;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    display: inline-block;
    width: 100%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}


/* Closable Alert Specific Styles */
.alert-closable {
    padding-right: 2.5rem;
}

.alert-close-btn {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: inherit;
    font-size: 1.1em;
    line-height: 1;
    transition: all 0.2s;
    opacity: 0.7;
}

.alert-close-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.4);
}

/* Back To Top Button */
#back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
}

#back-to-top svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s ease;
}

#back-to-top:hover svg {
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}



/* Multiline Support via JavaScript class toggle */
.alert-closable.multiline {
    justify-content: flex-start;
    /* 內容靠上 */
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.alert-closable.multiline .alert-close-btn {
    top: 1rem;
    /* 多行時按鈕靠右上 */
    transform: none;
}

.alert-closable.multiline .alert-close-btn:hover {
    transform: scale(1.1);
}

.info-box {
    border-left: 4px solid var(--primary);
    background: rgba(255, 255, 255, 0.03);
}

/* Fix for desktop landing title animation */
.landing-title {
    background-image: linear-gradient(to right, #fff 20%, #a5f3fc 50%, #c4b5fd 80%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: shine 5s linear infinite;
}

/* Section Title with responsive colors for dark/light themes */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2rem;
    background: linear-gradient(to right, #fff 20%, #a5f3fc 80%);
    background-clip: text;

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.light-theme .section-title {
    background: linear-gradient(to right, #0ea5e9 20%, #6366f1 80%) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

.free-service-highlight {
    color: #a5f3fc !important;
}

.light-theme .free-service-highlight {
    color: #4f46e5 !important; /* Premium dark indigo in light mode */
}



@keyframes shine {
    to {
        background-position: 200% center;
    }
}

/* Force fix for desktop text gradient */
.landing-title {
    background-image: linear-gradient(to right, #fff 20%, #a5f3fc 50%, #c4b5fd 80%) !important;
    background-size: 200% auto !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    animation: shine-force 5s linear infinite !important;
}

@keyframes shine-force {
    to {
        background-position: 200% center;
    }
}

/* CTA Button Hover Effect */
.home-cta-btn {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.home-cta-btn:hover {
    transform: translateY(-5px) !important;
}

/* SVG Icon System (Lucide Icons) */
.svg-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    line-height: 1;
}

/* 圖示與文字對齊 */
h1 .svg-icon,
h2 .svg-icon,
h3 .svg-icon,
strong .svg-icon,
.btn .svg-icon {
    vertical-align: -0.15em;
}

/* 功能卡片中的大圖示 */
.feature-icon .svg-icon {
    width: 28px;
    height: 28px;
}

/* Accessibility: 尊重使用者動態偏好設定 */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ══════════════════════════════════════════════
   Toggle Switch Component (Premium Style)
   Version: 0.1.0.4 (2026-04-27)
   ══════════════════════════════════════════════ */
.toggle-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    transition: background 0.2s, border-color 0.2s;
    cursor: pointer;
    user-select: none;
}
.toggle-switch-wrapper:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}
.toggle-switch-wrapper.toggle-enabled {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.06);
}
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 12px var(--primary-glow);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
    background: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.toggle-switch input:focus-visible + .toggle-slider {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.toggle-info {
    flex: 1;
    min-width: 0;
}
.toggle-info .toggle-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    display: block;
    margin-bottom: 0.2rem;
}
.toggle-info .toggle-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.toggle-status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    transition: all 0.3s;
    letter-spacing: 0.02em;
}
.toggle-status-badge.is-on {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.toggle-status-badge.is-off {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.15);
}
/* 自動儲存旋轉指示器 */
.toggle-saving-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
    display: none;
}
.toggle-saving-spinner.active {
    display: block;
}

/* ══════════════════════════════════════════════
   Sticky Save Bar
   ══════════════════════════════════════════════ */
#sticky-save-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4), 0 -1px 0 rgba(99, 102, 241, 0.2);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
#sticky-save-bar.visible {
    transform: translateY(0);
}
#sticky-save-bar .save-bar-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0.85rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
#sticky-save-bar .save-bar-hint {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--warning);
    font-size: 0.88rem;
    font-weight: 500;
}
.save-bar-hint-dot {
    width: 8px;
    height: 8px;
    background: var(--warning);
    border-radius: 50%;
    animation: pulse-dot 1.5s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}
#sticky-save-bar .save-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ══════════════════════════════════════════════
   Toast Notification
   ══════════════════════════════════════════════ */
#settings-toast-container {
    position: fixed;
    top: 80px;
    right: 1.5rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}
.settings-toast {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    max-width: 280px;
    white-space: nowrap;
}
.settings-toast.toast-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
}
.settings-toast.toast-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #f87171;
}
.settings-toast.toast-out {
    animation: toastOut 0.3s ease-in forwards;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to   { opacity: 0; transform: translateX(30px) scale(0.95); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 設定卡片 dirty 狀態邊框 */
.card.card-dirty {
    border-color: rgba(245, 158, 11, 0.4) !important;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2) !important;
}

/* ==========================================================================
   Light Theme Readability and Toggle Switch Fixes
   ========================================================================== */

/* Toggle Switch visibility fixes */
.light-theme .toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover)) !important;
    border-color: rgba(14, 165, 233, 0.4) !important;
    box-shadow: 0 0 12px var(--primary-glow) !important;
}

/* Page Containers, Blog, Wiki, Guide readability fixes */
.light-theme .page-container h1,
.light-theme .container h1,
.light-theme .blog-content h1 {
    background: linear-gradient(to right, #0ea5e9, #6366f1) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

.light-theme .page-container h2,
.light-theme .page-container h3,
.light-theme .page-container h4,
.light-theme .container h2,
.light-theme .container h3,
.light-theme .container h4,
.light-theme .blog-content h2,
.light-theme .blog-content h3,
.light-theme .blog-content h4,
.light-theme .blog-content h5,
.light-theme .blog-content h6,
.light-theme .step-content h2 {
    color: #0f172a !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
    text-fill-color: initial !important;
}

/* Blog list titles link color override */
.light-theme .blog-grid h2 a {
    color: #0f172a !important;
}
.light-theme .blog-grid h2 a:hover {
    color: var(--primary) !important;
}

/* Step Numbers in Guide */
.light-theme .step-number {
    color: rgba(14, 165, 233, 0.15) !important;
}

/* Card details and steps container backgrounds override to prevent transparency blending issues */
.light-theme .guide-step,
.light-theme .wiki-grid-usage > div,
.light-theme .blog-content div[style*="background: rgba(255,255,255,0.03)"],
.light-theme .blog-content div[style*="background:rgba(255,255,255,0.03)"],
.light-theme .blog-content div[style*="background: rgba(99, 102, 241, 0.05)"],
.light-theme .blog-content div[style*="background:rgba(99,102,241,0.05)"],
.light-theme .blog-content div[style*="background: rgba(236, 72, 153, 0.05)"],
.light-theme .blog-content div[style*="background:rgba(236,72,153,0.05)"] {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(14, 165, 233, 0.15) !important;
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.04) !important;
    color: #334155 !important;
}

/* Make sure all body/paragraph content inside blog is readable */
.light-theme .blog-content,
.light-theme .blog-content p,
.light-theme .blog-content li,
.light-theme .blog-content td,
.light-theme .blog-content th,
.light-theme .blog-content div,
.light-theme .blog-content blockquote {
    color: #334155 !important;
}

/* Ensure strong tags stand out */
.light-theme .blog-content strong,
.light-theme .blog-content b {
    color: #0f172a !important;
}

/* Badges / Tags contrast correction */
.light-theme span.badge {
    box-shadow: 0 2px 5px rgba(0,0,0,0.02) !important;
}
.light-theme span.badge[style*="background: rgba(99,102,241"],
.light-theme span.badge[style*="background:rgba(99,102,241"] {
    background: rgba(99, 102, 241, 0.12) !important;
    color: #4f46e5 !important;
}
.light-theme span.badge[style*="background: rgba(16,185,129"],
.light-theme span.badge[style*="background:rgba(16,185,129"] {
    background: rgba(5, 150, 105, 0.12) !important;
    color: #059669 !important;
}
.light-theme span.badge[style*="background: rgba(245,158,11"],
.light-theme span.badge[style*="background:rgba(245,158,11"] {
    background: rgba(217, 119, 6, 0.12) !important;
    color: #d97706 !important;
}

/* Table styling adjustments in Light mode */
.light-theme .comparison-table-container {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(14, 165, 233, 0.15) !important;
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.04) !important;
}
.light-theme .comparison-table-container tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}
.light-theme .comparison-table-container td {
    color: #475569 !important;
}
.light-theme .comparison-table-container th {
    background: rgba(14, 165, 233, 0.05) !important;
    color: #0f172a !important;
    border-bottom: 1px solid rgba(14, 165, 233, 0.15) !important;
}

/* About, Terms, and Privacy pages readability overrides */
.light-theme .platform-title {
    color: #0f172a !important;
}
.light-theme .platform-card {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(14, 165, 233, 0.15) !important;
}
.light-theme .platform-card:hover {
    background: #ffffff !important;
    border-color: var(--primary) !important;
}
.light-theme .platform-arrow {
    color: var(--text-muted) !important;
}
.light-theme .platform-card:hover .platform-arrow {
    color: var(--primary) !important;
}
.light-theme .container div[style*="linear-gradient(135deg, rgba(30, 30, 46, 0.8)"],
.light-theme .container div[style*="linear-gradient(135deg,rgba(30,30,46,0.8)"] {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 247, 255, 0.9) 100%) !important;
    border-color: rgba(14, 165, 233, 0.15) !important;
}
.light-theme .container div[style*="color: #fff"],
.light-theme .container div[style*="color:#fff"] {
    color: #0f172a !important;
}
.light-theme .container div[style*="color: var(--primary)"],
.light-theme .container div[style*="color:var(--primary)"] {
    color: var(--primary) !important;
}
.light-theme .container div[style*="color: var(--success)"],
.light-theme .container div[style*="color:var(--success)"] {
    color: var(--success) !important;
}
.light-theme .container h3[style*="color: #fff"],
.light-theme .container h3[style*="color:#fff"] {
    color: #0f172a !important;
}
.light-theme .container h2[style*="color: #fff"],
.light-theme .container h2[style*="color:#fff"] {
    color: #0f172a !important;
}

/* ==========================================================================
   Comprehensive Light Mode Theme Colors and Readability System
   ========================================================================== */

/* Global Headings Reset under Light Theme (excluding buttons, badges, brand labels) */
.light-theme h1:not(.logo-text):not(.btn):not(.badge),
.light-theme h2:not(.btn):not(.badge),
.light-theme h3:not(.btn):not(.badge),
.light-theme h4:not(.btn):not(.badge),
.light-theme h5:not(.btn):not(.badge),
.light-theme h6:not(.btn):not(.badge) {
    color: #0f172a !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
    text-fill-color: initial !important;
}

/* Gradient text for main section titles in Light Theme */
.light-theme h1:not(.logo-text):not(.btn):not(.badge),
.light-theme .page-container h1,
.light-theme .container h1 {
    background: linear-gradient(to right, #0ea5e9, #6366f1) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

/* Handle all inline style white texts globally */
.light-theme [style*="color: #fff"]:not(.btn):not(.badge):not(.nav-link),
.light-theme [style*="color:#fff"]:not(.btn):not(.badge):not(.nav-link),
.light-theme [style*="color: #ffffff"]:not(.btn):not(.badge):not(.nav-link),
.light-theme [style*="color:#ffffff"]:not(.btn):not(.badge):not(.nav-link) {
    color: #0f172a !important;
}

/* Clean up language selects on mobile switcher */
.light-theme .mobile-lang-switcher select {
    background: rgba(255, 255, 255, 0.8) !important;
    color: #0f172a !important;
    border: 1px solid rgba(14, 165, 233, 0.15) !important;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.05) !important;
}
.light-theme .mobile-lang-switcher select option {
    background: #ffffff !important;
    color: #0f172a !important;
}

/* Global Overrides for dark transparent background divs in Light Theme */
.light-theme div[style*="background: rgba(255,255,255,0.02)"],
.light-theme div[style*="background:rgba(255,255,255,0.02)"],
.light-theme div[style*="background: rgba(255, 255, 255, 0.02)"],
.light-theme div[style*="background:rgba(255, 255, 255, 0.02)"],
.light-theme div[style*="background: rgba(255,255,255,0.03)"],
.light-theme div[style*="background:rgba(255,255,255,0.03)"],
.light-theme div[style*="background: rgba(255, 255, 255, 0.03)"],
.light-theme div[style*="background:rgba(255, 255, 255, 0.03)"],
.light-theme div[style*="background: rgba(99, 102, 241, 0.05)"],
.light-theme div[style*="background:rgba(99,102,241,0.05)"],
.light-theme div[style*="background: rgba(236, 72, 153, 0.05)"],
.light-theme div[style*="background:rgba(236,72,153,0.05)"] {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(14, 165, 233, 0.15) !important;
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.04) !important;
}

/* FAQ Accordion Styling in Light Theme */
.light-theme .faq-item {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(14, 165, 233, 0.15) !important;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.02) !important;
}
.light-theme .faq-item:hover {
    background: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.08) !important;
}
.light-theme .faq-question {
    color: #0f172a !important;
}
.light-theme .faq-answer {
    background: rgba(14, 165, 233, 0.02) !important;
}

/* Modal Content & About Modal Overrides */
.light-theme .modal-header h3,
.light-theme .modal-body strong {
    color: #0f172a !important;
}
.light-theme .modal-body p,
.light-theme .modal-body li {
    color: #475569 !important;
}

/* Footer Section Light Theme Colors */
.light-theme .site-footer {
    background-color: #f1f5f9 !important;
    border-top: 1px solid rgba(14, 165, 233, 0.15) !important;
    color: #475569 !important;
}
.light-theme .footer-link-item {
    color: #475569 !important;
}
.light-theme .footer-link-item:hover {
    color: #0ea5e9 !important;
}
.light-theme .footer-link-item::after {
    background-color: #0ea5e9 !important;
}
.light-theme .social-link {
    background: #ffffff !important;
    border-color: rgba(14, 165, 233, 0.15) !important;
    color: #475569 !important;
}
.light-theme .social-link:hover {
    background: rgba(14, 165, 233, 0.08) !important;
    color: #0ea5e9 !important;
}
.light-theme .footer-copyright {
    color: #64748b !important;
}

/* Toast Messages in Light Theme */
.light-theme .settings-toast.toast-success {
    background: #ecfdf5 !important;
    border: 1px solid rgba(5, 150, 105, 0.2) !important;
    color: #059669 !important;
}
.light-theme .settings-toast.toast-error {
    background: #fef2f2 !important;
    border: 1px solid rgba(220, 38, 38, 0.2) !important;
    color: #dc2626 !important;
}

/* FAQ Active state colors */
.faq-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.faq-item.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}
.light-theme .faq-item.active {
    border-color: var(--primary) !important;
    background: rgba(14, 165, 233, 0.08) !important;
}

/* 接收通知郵件 Toggle Switch Styles */
#notify-email-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    user-select: none;
    padding: 0.25rem 0.75rem 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.light-theme #notify-email-label {
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.04);
}

#notify-email-label:hover {
    background: var(--surface-light);
    color: var(--text);
    border-color: var(--text-dim);
}

.light-theme #notify-email-label:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.25);
}

/* Active State (Checked) */
#notify-email-label.active {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #f59e0b !important;
    border-color: rgba(245, 158, 11, 0.45) !important;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.25) !important;
}

.light-theme #notify-email-label.active {
    background: rgba(217, 119, 6, 0.12) !important;
    color: #b45309 !important; /* Higher contrast dark orange for light theme */
    border-color: rgba(217, 119, 6, 0.45) !important;
    box-shadow: 0 0 8px rgba(217, 119, 6, 0.15) !important;
}

/* Track and Thumb */
#notify-track {
    display: block;
    width: 28px;
    height: 16px;
    border-radius: 8px;
    transition: background 0.25s;
    background: rgba(255, 255, 255, 0.25);
}

.light-theme #notify-track {
    background: rgba(0, 0, 0, 0.18);
}

#notify-email-label.active #notify-track {
    background: #f59e0b !important;
}

.light-theme #notify-email-label.active #notify-track {
    background: #d97706 !important;
}

#notify-thumb {
    position: absolute;
    top: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: left 0.25s;
}

/* Email Item Detail Styles */
.email-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.email-subject {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.35rem;
    line-height: 1.4;
}

.email-sender {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.email-time {
    font-size: 0.85rem;
    color: var(--text-dim);
    flex-shrink: 0;
    margin-left: 1rem;
    white-space: nowrap;
}

/* Light Theme Overrides for Inbox Card Items */
.light-theme .email-item {
    background: rgba(255, 255, 255, 0.75) !important;
    border-color: rgba(14, 165, 233, 0.15) !important;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.02) !important;
}

.light-theme .email-item:hover {
    background: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.08) !important;
}

.light-theme .email-subject {
    color: #0f172a !important;
}

.light-theme .email-sender {
    color: #475569 !important;
}

.light-theme .email-time {
    color: #64748b !important;
}
