* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #a67c52;
    --primary-dark: #8b6642;
    --primary-light: #c9a77a;
    --secondary: #d4b896;
    --accent: #e8d4bc;
    --success: #7a8b6e;
    --bg-dark: #1a1816;
    --bg-card: #2a2622;
    --bg-card-hover: #3a352f;
    --text-primary: #f5f2ef;
    --text-secondary: #b8b0a5;
    --text-muted: #8a8279;
    --border: #3d3830;
    --gradient-1: linear-gradient(135deg, #a67c52, #c9a77a);
    --gradient-2: linear-gradient(135deg, #d4b896, #a67c52);
}

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Screens */
.screen {
    display: none;
    width: 100%;
    animation: fadeIn 0.4s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Intro Screen */
.intro-content {
    text-align: center;
    padding: 40px 20px;
}

.badge {
    display: inline-block;
    background: var(--gradient-1);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 24px;
}

.intro-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
}

.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.features {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.feature .icon {
    font-size: 18px;
}

/* Buttons */
.btn-primary {
    background: var(--gradient-1);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(166, 124, 82, 0.4);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-large {
    padding: 18px 48px;
    font-size: 1.2rem;
}

/* Quiz Screen */
.quiz-header {
    margin-bottom: 32px;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 10px;
    transition: width 0.4s ease;
    width: 10%;
}

.progress-text {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    min-width: 50px;
}

.quiz-content {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.section-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
}

.question {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.5;
}

.question-hint {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 14px;
}

.option:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
}

.option-indicator {
    width: 22px;
    height: 22px;
    border: 2px solid var(--text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.option.selected .option-indicator {
    border-color: var(--primary);
    background: var(--primary);
}

.option.selected .option-indicator::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Multi-select checkbox style */
.option.multi .option-indicator {
    border-radius: 6px;
}

.option-text {
    font-size: 1rem;
    color: var(--text-primary);
}

.quiz-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

/* Loading Screen */
.loading-content {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-card);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 32px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-content h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.loading-text {
    color: var(--text-secondary);
}

/* Collect Screen */
.collect-content {
    text-align: center;
    padding: 40px 20px;
}

.collect-header {
    margin-bottom: 32px;
}

.collect-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
}

.collect-header h2 {
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.collect-header p {
    color: var(--text-secondary);
}

.collect-form {
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.collect-form .btn-primary {
    width: 100%;
    margin-top: 8px;
}

.privacy-note {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 24px;
}

/* Result Screen */
.result-content {
    padding: 20px 0;
}

.result-header {
    text-align: center;
    margin-bottom: 32px;
}

.result-badge {
    display: inline-block;
    background: var(--gradient-2);
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

.result-header h1 {
    font-size: 1.8rem;
}

.result-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.result-status {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.status-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.status-text h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--accent);
}

.status-text p {
    color: var(--text-secondary);
    font-size: 15px;
}

.ai-analysis {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    border: 1px solid var(--primary);
    border-left: 4px solid var(--primary);
}

.analysis-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ai-icon {
    font-size: 1.5rem;
}

.analysis-header h3 {
    color: var(--primary-light);
    font-size: 1.1rem;
}

.analysis-content {
    color: var(--text-primary);
    line-height: 1.8;
}

.analysis-content h4 {
    color: var(--accent);
    font-size: 1rem;
    margin: 20px 0 10px;
}

.analysis-content h4:first-child {
    margin-top: 0;
}

.analysis-content ul {
    margin-left: 20px;
    color: var(--text-secondary);
}

.analysis-content li {
    margin-bottom: 8px;
}

.analysis-content p {
    margin-bottom: 12px;
}

/* Share Section */
.share-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    text-align: center;
}

.share-section h4 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1rem;
}

.share-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-share {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-share:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    color: var(--text-primary);
}

.btn-share span {
    font-size: 16px;
}

.share-hint {
    color: var(--success);
    font-size: 13px;
    margin-top: 12px;
    min-height: 20px;
}

.cta-section {
    text-align: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(14, 165, 233, 0.1));
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.cta-section p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.result-content>.btn-secondary {
    display: block;
    width: 100%;
    text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
    .intro-content h1 {
        font-size: 1.8rem;
    }

    .features {
        flex-direction: column;
        gap: 12px;
    }

    .quiz-content {
        padding: 24px 20px;
    }

    .question {
        font-size: 1.2rem;
    }

    .quiz-footer {
        flex-direction: column-reverse;
    }

    .quiz-footer button {
        width: 100%;
    }

    #prevBtn {
        visibility: visible !important;
    }
}