:root {
    /* Universal neutral theme - soft gradient with modern feel */
    --primary-bg-start: #E8E0F0;
    --primary-bg-end: #F5F3F8;
    --text-color: #4A4458;
    --accent-color: #7C6F9B;
    --card-bg: rgba(255, 255, 255, 0.5);
    --card-bg-alt: rgba(245, 243, 248, 0.6);
    --font-serif: 'Noto Serif SC', serif;
    --font-sans: 'Outfit', sans-serif;
    
    /* Safe Area Variables */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Prevent text size adjustment on orientation change */
    -webkit-text-size-adjust: 100%; 
}

body {
    background: linear-gradient(180deg, var(--primary-bg-start) 0%, var(--primary-bg-end) 100%);
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    /* Fallback for browsers that don't support dvh */
    min-height: 100dvh; 
    overflow-x: hidden;
    padding-bottom: var(--safe-area-bottom);
}

/* Grainy Texture Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    opacity: 0.08;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 700;
}

.section-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    opacity: 0.8;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(122, 74, 43, 0.2);
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* Hero Section */
.hero-section {
    height: 40vh;
    height: 40dvh; /* Dynamic viewport height for mobile browsers */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 3rem;
    text-align: center;
    overflow: hidden;
}

.hero-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* Blend mode to make it look less abrupt */
    mix-blend-mode: multiply; 
    opacity: 0.8;
}

.hero-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(232, 224, 240, 0.3) 0%, var(--primary-bg-end) 100%);
    pointer-events: none;
}

.hero-content {
    z-index: 1;
    animation: fadeInUp 1.2s ease-out;
}

.logo-area {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.9;
}

.logo-main {
    font-family: var(--font-sans);
    font-weight: 500;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.logo-sub {
    font-family: var(--font-serif);
    font-size: 0.8rem;
    margin-top: 0.2rem;
    opacity: 0.8;
}

.landing-title {
    font-size: 2.5rem;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.landing-subtitle {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 2rem;
    opacity: 0.9;
    text-transform: none;
    letter-spacing: 0.05em;
}

.test-info {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 2.5rem;
    font-family: var(--font-sans);
}

.separator {
    margin: 0 0.5rem;
}

.btn-start {
    display: inline-block;
    padding: 1rem 3rem;
    background-color: var(--text-color);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-family: var(--font-sans);
    font-weight: 500;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(122, 74, 43, 0.2);
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(122, 74, 43, 0.3);
    background-color: #5e3821;
}

.link-secondary {
    display: block;
    margin-top: 1.5rem;
    color: var(--text-color);
    font-size: 0.85rem;
    text-decoration: underline;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.link-secondary:hover {
    opacity: 1;
}

/* Adjust Hero for Landing */
.landing-hero {
    height: 100vh; 
    height: 100dvh;
    justify-content: center;
}

/* Atmosphere Section - Editorial Design */
.atmosphere-section {
    padding: 5rem 1.5rem;
    display: flex;
    justify-content: center;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.5) 100%);
}

.atmosphere-section .section-content {
    max-width: 600px;
    width: 100%;
    position: relative;
}

/* Decorative top element */
.atmosphere-section .section-content::before {
    content: '“';
    position: absolute;
    top: -2.5rem;
    left: -1rem;
    font-family: var(--font-serif);
    font-size: 5rem;
    line-height: 1;
    color: var(--theme-main);
    opacity: 0.15;
}

.core-description {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    line-height: 1.9;
    font-weight: 400;
    color: var(--text-color);
    text-align: left;
    white-space: pre-wrap;
    letter-spacing: 0.02em;
    position: relative;
    z-index: 1;
}

/* Mobile adjustments for atmosphere */
@media (max-width: 600px) {
    .atmosphere-section {
        padding: 3rem 1.5rem;
    }
    
    .core-description {
        font-size: 1.05rem;
        line-height: 1.8;
    }
}

/* Common Section Styles */
.section-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* Summary Section */
.summary-section {
    margin-bottom: 2rem;
    background-color: rgba(255, 255, 255, 0.2); /* Light background for distinction */
    padding: 1rem 0;
    border-radius: 8px; /* Soft edges */
}

.summary-list {
    list-style: none;
    padding-left: 0;
}

.summary-list li {
    position: relative;
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.6;
}

/* Removed custom dot ::before as requested by user to avoid double markers with ordered lists */

/* Sub-Archetype Badge Design */
.sub-archetype-section {
    margin-top: 2rem;
    padding: 0;
}

.sub-archetype-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.8) 100%);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
}

.sub-archetype-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--theme-main), var(--theme-accent));
}

.badge-content {
    width: 100%;
}

.badge-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #718096;
    margin-bottom: 0.4rem;
}

.badge-code {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-main);
    margin-bottom: 0.6rem;
    letter-spacing: 0.02em;
}

.badge-desc {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #4a5568;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .sub-archetype-badge {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
    }
    
    .badge-icon {
        width: 56px;
        height: 56px;
    }
    
    .badge-code {
        font-size: 1.3rem;
    }
}

/* Traits Section */
.traits-container {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 20px rgba(122, 74, 43, 0.05);
}

.trait-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px dashed rgba(122, 74, 43, 0.1);
}

.trait-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.dreamcatcher-icon {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--text-color);
    border-radius: 50%;
    margin-right: 1rem;
    position: relative;
}

.dreamcatcher-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 0 4px #fff;
}

.trait-text {
    font-weight: 500;
}

/* Content Fit Section */
.fit-columns {
    display: flex;
    gap: 1.5rem;
}

.fit-card {
    flex: 1;
    padding: 2rem;
    border-radius: 16px;
    background-color: var(--card-bg);
}

.fit-yes {
    background-color: rgba(255, 255, 255, 0.5);
}

.fit-no {
    background-color: rgba(255, 245, 235, 0.6);
}

.fit-card h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.fit-card ul {
    list-style: none;
}

.fit-card li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    position: relative;
}

/* Removed bullet point ::before to avoid double markers with numbered lists */

/* Video Pattern Section */
.step-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
    padding: 1rem 0;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 80px;
}

.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 1px solid var(--text-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Simple CSS shapes for icons */
.icon-scene::before { content: '⌂'; font-size: 1.2rem; }
.icon-conflict::before { content: '⚡'; font-size: 1rem; }
.icon-feeling::before { content: '♥'; font-size: 1rem; }
.icon-landing::before { content: '🪶'; font-size: 1.2rem; }

.step-label {
    font-size: 0.8rem;
    font-weight: 500;
}

.step-connector {
    flex: 1;
    height: 1px;
    background-color: var(--text-color);
    margin: 0 0.5rem;
    margin-bottom: 1.5rem; /* Align with icon center approx */
    opacity: 0.5;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Test Page Specifics */
.test-header {
    margin-bottom: 2rem;
    position: relative;
}

.step-indicator-top {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 0.8rem;
    font-family: var(--font-sans);
}

.progress-container {
    width: 100%;
    height: 6px;
    background-color: rgba(122, 74, 43, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--text-color);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.validation-msg {
    color: #d9534f;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 1rem;
    min-height: 1.4em;
}

/* Result Footer */
.result-footer {
    text-align: center;
    margin-top: 3rem;
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.btn-primary {
    padding: 1rem 2.5rem;
    background-color: var(--text-color);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(122, 74, 43, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(122, 74, 43, 0.3);
}

.btn-secondary {
    font-size: 0.9rem;
    color: var(--text-color);
    text-decoration: none;
    opacity: 0.7;
    border-bottom: 1px dashed var(--text-color);
}

.footer-meta {
    margin-top: 2rem;
    font-size: 0.8rem;
    opacity: 0.5;
    display: flex;
    align-items: center;
}

/* Share Overlay */
.share-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.share-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.share-card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.share-overlay.active .share-card-container {
    transform: translateY(0);
}

.share-card {
    width: 320px;
    background-color: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.card-header {
    padding: 2rem;
    text-align: center;
    color: var(--text-color);
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.card-subtitle {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.card-body {
    padding: 2rem;
    text-align: center;
    background-color: #fff;
}

.card-tagline {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.card-summary {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.card-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    opacity: 0.6;
}

.qr-placeholder {
    width: 80px;
    height: 80px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.share-actions {
    display: flex;
    gap: 1rem;
}

.btn-save, .btn-close {
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-save {
    background-color: #fff;
    color: var(--text-color);
    border: none;
}

.btn-close {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Responsive */
/* Responsive */
@media (max-width: 600px) {
    .fit-columns {
        flex-direction: column;
    }
    
    .step-flow {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .step-connector {
        display: none;
    }
    
    .landing-title {
        font-size: 2rem;
        padding: 0 1rem;
    }
    
    .landing-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .test-container {
        margin: 1rem;
        padding: 1.5rem;
        width: 95%; /* Wider on mobile */
    }
    
    .section-content {
        padding: 1.5rem;
    }
    
    .atmosphere-section {
        padding: 4rem 1.5rem;
    }
    
    /* Improve touch targets */
    .likert-option label {
        width: 44px;
        height: 44px; /* Minimum touch target size */
    }
    
    .btn-start, .btn-primary, .btn-next {
        min-height: 48px; /* Comfortable touch height */
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Adjust result cards for mobile */
    .result-card, .traits-container, .fit-card {
        padding: 1.5rem;
    }
    
    .share-card {
        width: 90%;
        max-width: 320px;
    }
}

/* WeChat Browser Specific Tweaks */
@supports (-webkit-touch-callout: none) {
    /* iOS specific adjustments if needed */
    body {
        /* Prevent elastic scrolling on body if desired, though usually handled by overflow-x: hidden */
    }
}

/* Test Page Styles (Moved from test.ejs) */
.test-container {
    max-width: 800px;
    margin: 4rem auto;
    padding: 2rem;
    background-color: var(--card-bg);
    border-radius: 16px;
    backdrop-filter: blur(5px);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* Progress Bar */
.progress-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background-color: rgba(74, 68, 88, 0.1);
    border-radius: 16px 16px 0 0;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background-color: var(--text-color);
    width: 0%;
    transition: width 0.3s ease;
}

.question-block {
    display: none; /* Hidden by default */
    opacity: 0;
    transition: opacity 0.4s ease;
}

.question-block.active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.5s ease-out;
}

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

.question-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    text-align: center;
}

.likert-scale {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-width: 600px;
    margin: 0 auto;
}

.likert-option {
    display: flex;
    align-items: center; /* Vertically center items */
    justify-content: flex-start;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(74, 68, 88, 0.15);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 3.5rem; /* Ensure consistent height */
}

.likert-option:hover {
    background-color: rgba(255, 255, 255, 0.7);
    border-color: var(--text-color);
}

.likert-option input[type="radio"] {
    margin: 0 1rem 0 0; /* Reset margins and set right margin */
    accent-color: var(--text-color);
    transform: scale(1.2);
    flex-shrink: 0; /* Prevent radio button from shrinking */
    position: relative;
    top: 1px; /* Optical adjustment */
}

.likert-option label {
    cursor: pointer;
    flex: 1;
    font-size: 1rem;
    line-height: 1.4; /* Tighter line height for better centering */
    margin: 0;
    display: flex;
    align-items: center; /* Center text within label if needed */
}

/* Selected state styling */
.likert-option:has(input:checked) {
    background-color: rgba(124, 111, 155, 0.08);
    border-color: var(--text-color);
    font-weight: 500;
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding: 0 2rem;
}

.btn-nav {
    padding: 0.8rem 2rem;
    background-color: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    border-radius: 30px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-nav:hover {
    background-color: rgba(122, 74, 43, 0.1);
}

.btn-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #ccc;
    color: #999;
}

.btn-next {
    background-color: var(--text-color);
    color: #fff;
}

.btn-next:hover {
    background-color: var(--primary-bg-start); /* Slightly lighter or different */
    opacity: 0.9;
}

.step-indicator {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.8rem;
    opacity: 0.6;
}

.step-indicator-top {
    text-align: center;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
}

/* Mobile Minimalist Overrides */
@media (max-width: 600px) {
    .test-container {
        background-color: transparent;
        box-shadow: none;
        backdrop-filter: none;
        padding: 0.5rem 1rem;
        margin: 0 auto;
        border-radius: 0;
        min-height: calc(100dvh - 2rem);
        justify-content: flex-start;
    }
    
    .test-header {
        margin-bottom: 0.5rem;
    }
    
    .step-indicator-top {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
        font-size: 0.8rem;
    }
    
    .progress-container {
        border-radius: 10px;
        position: relative;
        margin-bottom: 1rem;
        height: 4px;
    }
    
    .question-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        line-height: 1.5;
    }
    
    .likert-scale {
        gap: 0.5rem;
    }
    
    .likert-option {
        background-color: rgba(255, 255, 255, 0.6);
        padding: 0.7rem 1rem;
        margin-bottom: 0;
        border-radius: 10px;
    }
    
    .likert-option label {
        font-size: 0.9rem;
    }
    
    .likert-option input[type="radio"] {
        transform: scale(1.1);
        margin-right: 0.8rem;
    }
    
    .nav-buttons {
        padding: 0;
        margin-top: 1rem;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(to top, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.8) 100%);
        padding: 1rem;
        padding-bottom: calc(1rem + var(--safe-area-bottom));
        border-top: 1px solid rgba(0,0,0,0.05);
    }
    
    .btn-nav {
        padding: 0.7rem 1.5rem;
        font-size: 0.85rem;
    }
}
