/* Fiber-optic neon velocity and quantum light-tunnel aesthetic */
html[data-theme="light"], :root[data-theme="light"] {
    --bg-dark: #f4f7fb;
    --primary: #005ce6;
    --primary-light: #0066ff;
    --accent: #e6005c;
    --text-main: #1e293b;
    --text-dim: #505f79;
    --glass-bg: #ffffff;
    --border: rgba(0, 0, 0, 0.08);
    --glow-blue: 0 10px 25px rgba(0, 102, 255, 0.15);
    --glow-magenta: 0 10px 25px rgba(230, 0, 92, 0.15);
}

[data-theme="light"] .header { background: rgba(255, 255, 255, 0.95); box-shadow: 0 2px 10px rgba(0,0,0,0.03); border-bottom: 1px solid var(--border); }
[data-theme="light"] .logo a { color: #1e293b; text-shadow: none; }
[data-theme="light"] .nav a { color: #1e293b; font-weight: 600; text-shadow: none; }
[data-theme="light"] .nav a:hover { color: var(--primary); text-shadow: none; }
[data-theme="light"] a:hover { text-shadow: none; }
[data-theme="light"] .hero h1 { background: linear-gradient(to right, #1e293b, var(--primary), var(--accent)); -webkit-background-clip: text; }
[data-theme="light"] .btn { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
[data-theme="light"] .btn-neon { color: #fff; border: none; }
[data-theme="light"] .btn-neon::after { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }
[data-theme="light"] .hero-actions a:not(.btn-neon) { background: #fff !important; color: var(--text-main) !important; border: 1px solid var(--border) !important; box-shadow: 0 4px 12px rgba(0,0,0,0.03); }

/* Fix globally hardcoded white texts (like section titles and inline styles) */
[data-theme="light"] .section-title { background: linear-gradient(90deg, #1e293b, var(--primary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
[data-theme="light"] .eq-column:hover .eq-label { color: var(--primary); text-shadow: none; }
[data-theme="light"] [style*="color:#fff"], [data-theme="light"] [style*="color: #fff"] { color: var(--text-main) !important; }

/* Unified Light Mode Box Styles */
[data-theme="light"] .card, 
[data-theme="light"] .speed-comparator, 
[data-theme="light"] .equalizer-container,
[data-theme="light"] .toc,
[data-theme="light"] .faq-box { 
    background: #ffffff !important; 
    border: 1px solid var(--border) !important; 
    box-shadow: 0 8px 30px rgba(0,0,0,0.03) !important; 
}

[data-theme="light"] .card h3, [data-theme="light"] .pricing-card .price { color: var(--text-main) !important; text-shadow: none !important; }
[data-theme="light"] .pricing-card .currency { color: var(--primary) !important; }
[data-theme="light"] .pricing-card .period { color: var(--text-dim) !important; }
[data-theme="light"] .faq-item h4, [data-theme="light"] .card h4 { color: var(--primary); }

[data-theme="light"] .eq-bar-wrap { background: rgba(0,0,0,0.06); }
[data-theme="light"] .pricing-card ul li { border-bottom: 1px solid rgba(0,0,0,0.06); }

[data-theme="light"] .footer { background: #ffffff; border-top: 1px solid var(--border); }
[data-theme="light"] .copyright { color: #64748b; }

.theme-toggle {
    width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border);
    color: var(--text-main); transition: var(--transition); cursor: pointer; backdrop-filter: blur(5px); margin-left: 15px;
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.15); box-shadow: var(--glow-blue); transform: scale(1.1) rotate(5deg); }
.theme-toggle svg { width: 20px; height: 20px; }
[data-theme="light"] .theme-toggle { background: rgba(0, 102, 255, 0.05); color: var(--primary); }

:root {
    --bg-dark: #08090c;
    --primary: #0066ff;
    --primary-light: #3385ff;
    --accent: #ff0066;
    --text-main: #f0f4f8;
    --text-dim: #8b9bb4;
    --glass-bg: rgba(10, 15, 30, 0.65);
    --border: rgba(0, 102, 255, 0.25);
    --glow-blue: 0 0 20px rgba(0, 102, 255, 0.5);
    --glow-magenta: 0 0 20px rgba(255, 0, 102, 0.5);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
}

canvas#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

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

a:hover {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.text-center { text-align: center; }
.section { padding: 90px 0; border-bottom: 1px solid rgba(255,255,255,0.02); }

.section-title {
    font-size: 2.5rem;
    margin-bottom: 50px;
    font-weight: 800;
    background: linear-gradient(90deg, #fff, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(8, 9, 12, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 15px 0;
}

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

.logo a {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 0 15px var(--primary);
}

.logo a span {
    font-size: 1rem;
    color: var(--primary-light);
    font-weight: 400;
    letter-spacing: 1px;
}

.nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav a {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
}

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

/* Neon Circulating Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    position: relative;
    background: var(--bg-dark);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 1;
    overflow: hidden;
}

.btn-neon {
    border: none;
    box-shadow: var(--glow-blue);
}

.btn-neon::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: conic-gradient(transparent, transparent, transparent, var(--primary), var(--accent));
    animation: rotate-border 2s linear infinite;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-neon:hover::before { opacity: 1; }

.btn-neon::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: linear-gradient(135deg, #0a1128, var(--bg-dark));
    border-radius: 6px;
    z-index: -1;
}

.btn-neon:hover {
    box-shadow: var(--glow-magenta);
    transform: translateY(-2px);
}

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

/* Hero Section */
.hero {
    padding: 160px 0 80px;
    text-align: center;
}

.hero h1 {
    font-size: 3.8rem;
    margin-bottom: 20px;
    font-weight: 900;
    background: linear-gradient(to right, #fff, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: var(--text-dim);
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 60px;
}

/* Speed Comparator Widget */
.speed-comparator {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
}

.sc-header {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.sc-toggle {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.sc-toggle.active {
    color: var(--primary-light);
    background: rgba(0, 102, 255, 0.1);
    box-shadow: inset 0 -2px 0 var(--primary-light);
}

.sc-body {
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.sc-latency {
    font-size: 4rem;
    font-weight: 900;
    color: #ff3333;
    font-family: monospace;
    transition: color 0.3s;
}

.sc-latency .ms {
    font-size: 1.5rem;
    color: var(--text-dim);
}

.sc-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    color: var(--text-dim);
}

.spinner {
    width: 24px; height: 24px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #ff3333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Equalizer Section */
.equalizer-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 200px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 40px;
    margin-top: 40px;
    backdrop-filter: blur(10px);
}

.eq-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 60px;
    cursor: pointer;
}

.eq-bar-wrap {
    height: 120px;
    width: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.eq-bar {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    background: linear-gradient(to top, var(--primary), var(--accent));
    height: 30%;
    border-radius: 6px;
    transition: height 0.1s ease;
    box-shadow: var(--glow-magenta);
}

.eq-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    text-align: center;
    transition: color 0.3s;
}

.eq-column:hover .eq-label {
    color: #fff;
    text-shadow: 0 0 8px var(--primary-light);
}

/* Grid & Cards */
.grid {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 35px 25px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--glow-blue);
}

.card-icon {
    margin-bottom: 20px;
}

.card-icon svg {
    width: 45px; height: 45px;
    stroke: var(--primary-light);
    fill: none;
    stroke-width: 1.5;
    filter: drop-shadow(0 0 5px var(--primary));
}

.card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #fff;
}

.card p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* Pricing Matrix */
.pricing-card {
    position: relative;
}

.pricing-card::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(45deg, var(--primary), transparent, var(--accent), transparent);
    background-size: 400% 400%;
    z-index: -1;
    border-radius: 18px;
    opacity: 0;
    transition: opacity 0.5s;
    animation: neon-flow 6s ease infinite;
}

.pricing-card:hover::before {
    opacity: 1;
}

@keyframes neon-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.pricing-card .price {
    font-size: 2.8rem;
    font-weight: 900;
    color: #fff;
    margin: 20px 0;
    text-shadow: 0 0 10px rgba(0, 102, 255, 0.3);
}

.pricing-card .currency { font-size: 1.2rem; vertical-align: top; color: var(--primary-light); }
.pricing-card .period { font-size: 1rem; color: var(--text-dim); font-weight: normal; }

.pricing-card ul {
    list-style: none;
    padding: 0;
    margin-bottom: 30px;
}

.pricing-card ul li {
    padding: 8px 0;
    color: var(--text-dim);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Footer */
.footer {
    background: #030406;
    padding: 40px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.footer-links { margin-bottom: 15px; }
.footer-links a { margin: 0 10px; color: var(--text-dim); font-size: 0.9rem; }
.copyright { color: #556; font-size: 0.85rem; }

/* Responsive */
@media (max-width: 768px) {
    .header-container { flex-direction: column; gap: 15px; }
    .nav { flex-wrap: wrap; justify-content: center; }
    .hero h1 { font-size: 2.5rem; }
    .hero-actions { flex-direction: column; }
    .equalizer-container { overflow-x: auto; padding: 20px; justify-content: flex-start; gap: 30px; }
    .sc-body { flex-direction: column; gap: 20px; }
}
