:root {
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --accent-color: #00f0ff;
    --warm-color: #ffaa00;
    --card-bg: #111116;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Tech Background Effect */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 1px,
        rgba(0, 240, 255, 0.03) 2px,
        rgba(0, 240, 255, 0.03) 3px
    );
    pointer-events: none;
    z-index: 999;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 40px;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px; /* Space between logo and text */
}

.logo {
    display: block;
    position: relative;
    width: 120px;
    height: 50px;
    flex-shrink: 0; /* Prevent logo from shrinking */
}

.company-name {
    font-size: 22px; /* Increased from 18px */
    font-weight: 600; /* Slightly bolder for better balance */
    color: var(--text-color);
    letter-spacing: 1px;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.logo::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px; /* Explicit size larger than container */
    height: 140px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(0, 240, 255, 0.1) 40%, transparent 70%);
    z-index: -1;
    filter: blur(15px);
    border-radius: 50%;
}

.logo-img {
    height: 100%;
    width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
}

.footer-link {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--accent-color);
}

/* Removed old text logo styles if they conflict, but keeping .logo container style is fine */
/* .sub-logo { ... } can be removed or ignored */

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    text-align: center;
}

.canvas-container {
    position: fixed; /* Changed from absolute to fixed to cover full scroll */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 1; /* Ensure full opacity, controlled by JS drawing */
    pointer-events: none;
}

.hero-content h1 {
    font-size: 60px;
    font-weight: 300;
    letter-spacing: 10px;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #888);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content h2 {
    font-size: 24px;
    font-weight: 400;
    color: var(--accent-color);
    margin-bottom: 20px;
    letter-spacing: 5px;
}

.tagline {
    font-size: 18px;
    color: #aaa;
    margin-bottom: 10px;
}

.sub-tagline {
    font-size: 14px;
    color: #666;
    letter-spacing: 2px;
}

/* Sections */
.container {
    padding: 80px 20px;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--accent-color);
}

h4 {
    font-size: 28px;
    margin-bottom: 15px;
}

.trust-badges {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.badge {
    border: 1px solid var(--accent-color);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--accent-color);
    letter-spacing: 1px;
}

.card {
    background: var(--card-bg);
    padding: 60px;
    border-radius: 4px;
    margin: 40px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 240, 255, 0.3);
}

/* Feature Cards Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 240, 255, 0.1);
    padding: 20px;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.feature-card h5 {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 5px;
    position: relative;
    z-index: 2;
}

.feature-card p {
    font-size: 12px;
    color: #888;
    position: relative;
    z-index: 2;
}

/* Glitch Effect on Hover */
.feature-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.2), transparent);
    transition: 0.5s;
    z-index: 1;
}

.feature-card:hover::before {
    left: 100%;
}

.cta-button {
    padding: 15px 40px;
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cta-button:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

.cta-button.secondary {
    border-color: var(--warm-color);
}

.cta-button.secondary:hover {
    background: var(--warm-color);
}

footer {
    padding: 60px 20px;
    background: rgba(5, 5, 5, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.qr-code {
    width: 120px;
    height: 120px;
    border: 1px solid var(--accent-color);
    padding: 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
}

.qr-section p {
    font-size: 12px;
    color: var(--accent-color);
    letter-spacing: 1px;
}

.copyright {
    font-size: 12px;
    color: #444;
}

/* Toast Notification */
.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: rgba(0, 240, 255, 0.1);
    color: var(--accent-color);
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    z-index: 1000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    border: 1px solid var(--accent-color);
    font-size: 14px;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px; /* Slight float up animation */
}

/* Test Modules */
.test-module {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
}

.hidden {
    display: none !important;
}

/* Addiction Test Styles */
.question-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid rgba(0, 240, 255, 0.2);
    width: 100%;
}

.options-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.option-btn {
    padding: 15px;
    background: transparent;
    border: 1px solid #444;
    color: #ccc;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.option-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(0, 240, 255, 0.05);
}

/* Rhythm Test Styles */
/* Viral Rhythm Test Effects */
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.screen-shake {
    animation: shake 0.5s;
    animation-iteration-count: 1;
}

@keyframes flash-perfect {
    0% { box-shadow: inset 0 0 0 0 rgba(0, 240, 255, 0); }
    50% { box-shadow: inset 0 0 50px 20px rgba(0, 240, 255, 0.3); }
    100% { box-shadow: inset 0 0 0 0 rgba(0, 240, 255, 0); }
}

.perfect-flash {
    animation: flash-perfect 0.2s ease-out;
}

@keyframes flash-miss {
    0% { box-shadow: inset 0 0 0 0 rgba(255, 0, 85, 0); }
    50% { box-shadow: inset 0 0 50px 20px rgba(255, 0, 85, 0.3); }
    100% { box-shadow: inset 0 0 0 0 rgba(255, 0, 85, 0); }
}

.miss-flash {
    animation: flash-miss 0.3s ease-out;
}

.game-hud {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 300px;
    margin-bottom: 20px;
    font-family: monospace;
    color: var(--accent-color);
    font-size: 18px;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
    z-index: 10;
}

.rhythm-container-visual {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.rhythm-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 50%;
    background: 
        linear-gradient(90deg, rgba(0,240,255,0.03) 1px, transparent 1px),
        linear-gradient(rgba(0,240,255,0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    animation: rotateGrid 20s linear infinite;
}

@keyframes rotateGrid {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Utility Classes for Clean HTML (Linter Fixes) */
.version-label { font-size: 12px; vertical-align: middle; opacity: 0.5; }
.section-subtitle { margin-bottom: 40px; color: #888; }
.tag-research { color: var(--warm-color); }
.article-title { font-size: 20px; margin: 10px 0; }
.read-more { margin-top: 15px; font-size: 12px; color: var(--accent-color); }
.tag-warning { color: #ff004c; }
.card-emotion { background: linear-gradient(135deg, #0f172a 0%, #000 100%); border: 1px solid rgba(0, 255, 204, 0.2); }
.title-emotion { color: #00ffcc; text-shadow: 0 0 10px rgba(0, 255, 204, 0.3); }
.subtitle-emotion { font-family: monospace; letter-spacing: 2px; color: #666; font-size: 0.8rem; margin-bottom: 15px; }
.target-audience { margin-top: 10px; }
.btn-group-center { display: flex; gap: 20px; justify-content: center; margin-top: 25px; }
.btn-emotion { background: rgba(0, 255, 204, 0.1) !important; color: #00ffcc !important; border: 1px solid #00ffcc !important; }
.footer-info-center { text-align: center; margin-top: 20px; }
.beian-text { font-size: 12px; color: #666; margin-top: 5px; }

.rhythm-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.1s;
    background: rgba(0, 0, 0, 0.5);
    z-index: 5;
    position: relative;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.rhythm-text {
    font-family: monospace;
    font-size: 20px;
    color: var(--accent-color);
    pointer-events: none;
}

.rhythm-circle.beat {
    transform: scale(1.1);
}

.rhythm-circle.flash {
    background-color: var(--accent-color);
    box-shadow: 0 0 60px var(--accent-color), inset 0 0 30px #fff;
    border-color: #fff;
    transform: scale(1.05);
}

.rhythm-circle.flash .rhythm-text {
    color: #000;
    font-weight: bold;
    content: "TAP!";
}

/* Synesthesia Visuals */
.synesthesia-visual {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #222;
    margin: 0 auto;
    transition: all 0.5s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.stats-display {
    margin-top: 20px;
    font-family: monospace;
    color: #fff;
    font-size: 16px;
    transition: opacity 0.2s;
}

/* Share Card Styles */
#share-card-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.share-card {
    background: linear-gradient(135deg, #111, #222);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    width: 300px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.share-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0,240,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.share-header {
    color: var(--accent-color);
    letter-spacing: 2px;
    font-size: 14px;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.share-score {
    font-size: 48px;
    color: #fff;
    font-weight: 700;
    margin: 10px 0;
    text-shadow: 0 0 10px var(--accent-color);
}

.share-tag {
    background: var(--accent-color);
    color: #000;
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 15px;
    transform: skewX(-10deg);
}

.share-quote {
    color: #aaa;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    font-style: italic;
}

.share-footer {
    font-size: 12px;
    color: #555;
    margin-top: 20px;
    border-top: 1px solid #333;
    padding-top: 15px;
}

.qr-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.qr-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.share-qr {
    width: 80px;
    height: 80px;
    border: 2px solid var(--accent-color);
    border-radius: 4px;
}

.qr-item span {
    font-size: 10px;
    color: #888;
}

.save-hint {
    color: #fff;
    font-size: 14px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}