/**
 * HerbMend 体质辨识问卷样式
 * 响应式设计，移动端优先
 * 品牌色系：#2D5016主色 / #C8A96E辅色 / #E8F5E9浅底
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* Brand Colors */
    --hm-primary: #2D5016;
    --hm-primary-dark: #1E3A0F;
    --hm-primary-light: #4A7A2C;
    --hm-secondary: #C8A96E;
    --hm-secondary-dark: #A68B4B;
    --hm-secondary-light: #E8D5A8;
    --hm-bg-light: #E8F5E9;
    --hm-bg-card: #FFFFFF;
    --hm-text-primary: #1A1A1A;
    --hm-text-secondary: #666666;
    --hm-text-light: #999999;
    --hm-border: #E0E0E0;
    --hm-success: #4CAF50;
    --hm-warning: #FF9800;
    --hm-error: #F44336;
    
    /* Spacing */
    --hm-space-xs: 4px;
    --hm-space-sm: 8px;
    --hm-space-md: 16px;
    --hm-space-lg: 24px;
    --hm-space-xl: 32px;
    --hm-space-2xl: 48px;
    
    /* Border Radius */
    --hm-radius-sm: 8px;
    --hm-radius-md: 12px;
    --hm-radius-lg: 16px;
    --hm-radius-xl: 24px;
    --hm-radius-full: 9999px;
    
    /* Shadows */
    --hm-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --hm-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --hm-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
    
    /* Transitions */
    --hm-transition-fast: 150ms ease;
    --hm-transition-normal: 300ms ease;
    --hm-transition-slow: 500ms ease;
}

/* ========================================
   Base Styles
   ======================================== */
.herbmend-quiz {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--hm-text-primary);
    background: linear-gradient(135deg, var(--hm-bg-light) 0%, #FFFFFF 100%);
    min-height: 100vh;
    padding: var(--hm-space-md);
    box-sizing: border-box;
}

.herbmend-quiz * {
    box-sizing: border-box;
}

/* ========================================
   Select Page Styles
   ======================================== */
.quiz-select-page {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--hm-space-xl) 0;
}

.quiz-header {
    text-align: center;
    margin-bottom: var(--hm-space-xl);
}

.quiz-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--hm-primary);
    margin: 0 0 var(--hm-space-sm) 0;
    letter-spacing: -0.02em;
}

.quiz-subtitle {
    font-size: 1.125rem;
    color: var(--hm-text-secondary);
    margin: 0;
}

.quiz-intro {
    background: var(--hm-bg-card);
    border-radius: var(--hm-radius-lg);
    padding: var(--hm-space-lg);
    margin-bottom: var(--hm-space-xl);
    box-shadow: var(--hm-shadow-sm);
    text-align: center;
}

.quiz-intro p {
    margin: 0;
    color: var(--hm-text-secondary);
}

/* Version Cards */
.quiz-version-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--hm-space-md);
    margin-bottom: var(--hm-space-xl);
}

@media (max-width: 500px) {
    .quiz-version-cards {
        grid-template-columns: 1fr;
    }
}

.version-card {
    background: var(--hm-bg-card);
    border-radius: var(--hm-radius-lg);
    padding: var(--hm-space-xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--hm-transition-normal);
    border: 2px solid transparent;
    box-shadow: var(--hm-shadow-sm);
    position: relative;
}

.version-card:hover {
    border-color: var(--hm-primary);
    transform: translateY(-4px);
    box-shadow: var(--hm-shadow-md);
}

.version-card:active {
    transform: translateY(-2px);
}

.version-icon {
    font-size: 2.5rem;
    margin-bottom: var(--hm-space-md);
}

.version-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--hm-primary);
    margin: 0 0 var(--hm-space-xs) 0;
}

.version-card p {
    font-size: 0.875rem;
    color: var(--hm-text-secondary);
    margin: 0;
}

.version-tag {
    display: inline-block;
    background: var(--hm-bg-light);
    color: var(--hm-primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: var(--hm-space-xs) var(--hm-space-sm);
    border-radius: var(--hm-radius-full);
    margin-top: var(--hm-space-md);
}

.version-tag.premium {
    background: linear-gradient(135deg, var(--hm-secondary-light) 0%, var(--hm-secondary) 100%);
    color: #5D4E37;
}

/* Quiz Features */
.quiz-features {
    display: flex;
    justify-content: center;
    gap: var(--hm-space-xl);
    margin-bottom: var(--hm-space-xl);
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--hm-space-xs);
    color: var(--hm-text-secondary);
    font-size: 0.875rem;
}

.feature-icon {
    font-size: 1.25rem;
}

/* Language Toggle */
.language-toggle {
    display: flex;
    justify-content: center;
    gap: var(--hm-space-sm);
    margin-top: var(--hm-space-xl);
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--hm-border);
    border-radius: var(--hm-radius-full);
    padding: var(--hm-space-sm) var(--hm-space-md);
    font-size: 0.875rem;
    color: var(--hm-text-secondary);
    cursor: pointer;
    transition: all var(--hm-transition-fast);
}

.lang-btn:hover {
    border-color: var(--hm-primary);
    color: var(--hm-primary);
}

.lang-btn.active {
    background: var(--hm-primary);
    border-color: var(--hm-primary);
    color: white;
}

/* Gender Select */
.quiz-gender-select {
    background: var(--hm-bg-card);
    border-radius: var(--hm-radius-lg);
    padding: var(--hm-space-lg);
    margin-bottom: var(--hm-space-xl);
    text-align: center;
    box-shadow: var(--hm-shadow-sm);
}

.quiz-gender-select p {
    margin: 0 0 var(--hm-space-md) 0;
    color: var(--hm-text-secondary);
}

.gender-btn {
    background: var(--hm-bg-light);
    border: 2px solid transparent;
    border-radius: var(--hm-radius-lg);
    padding: var(--hm-space-md) var(--hm-space-xl);
    font-size: 1rem;
    font-weight: 500;
    color: var(--hm-primary);
    cursor: pointer;
    margin: 0 var(--hm-space-sm);
    transition: all var(--hm-transition-fast);
}

.gender-btn:hover {
    border-color: var(--hm-primary);
}

.gender-btn:active {
    background: var(--hm-primary);
    color: white;
}

/* ========================================
   Quiz Container
   ======================================== */
.quiz-container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--hm-space-md) 0;
}

/* Progress Bar */
.quiz-progress-bar {
    height: 8px;
    background: var(--hm-border);
    border-radius: var(--hm-radius-full);
    overflow: hidden;
    margin-bottom: var(--hm-space-sm);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--hm-primary) 0%, var(--hm-primary-light) 100%);
    border-radius: var(--hm-radius-full);
    transition: width var(--hm-transition-normal);
}

.quiz-progress-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--hm-text-secondary);
    margin-bottom: var(--hm-space-lg);
}

/* Question Card */
.question-card {
    background: var(--hm-bg-card);
    border-radius: var(--hm-radius-lg);
    padding: var(--hm-space-xl);
    margin-bottom: var(--hm-space-xl);
    box-shadow: var(--hm-shadow-md);
}

.question-number {
    display: inline-block;
    background: var(--hm-bg-light);
    color: var(--hm-primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: var(--hm-space-xs) var(--hm-space-sm);
    border-radius: var(--hm-radius-sm);
    margin-bottom: var(--hm-space-md);
}

.question-text {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--hm-text-primary);
    margin: 0 0 var(--hm-space-xl) 0;
    line-height: 1.5;
}

/* Options Grid */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: var(--hm-space-md);
}

.option-item {
    display: flex;
    align-items: center;
    gap: var(--hm-space-md);
    padding: var(--hm-space-md) var(--hm-space-lg);
    background: var(--hm-bg-light);
    border-radius: var(--hm-radius-md);
    cursor: pointer;
    transition: all var(--hm-transition-fast);
    border: 2px solid transparent;
}

.option-item:hover {
    background: var(--hm-secondary-light);
    border-color: var(--hm-secondary);
}

.option-item.selected {
    background: var(--hm-secondary-light);
    border-color: var(--hm-primary);
}

.option-item input[type="radio"] {
    display: none;
}

.option-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--hm-border);
    transition: all var(--hm-transition-fast);
    flex-shrink: 0;
}

.option-item.selected .option-circle {
    border-color: var(--hm-primary);
    background: var(--hm-primary);
    box-shadow: inset 0 0 0 4px white;
}

.option-text {
    font-size: 1rem;
    color: var(--hm-text-primary);
}

/* Navigation Buttons */
.quiz-navigation {
    display: flex;
    justify-content: space-between;
    gap: var(--hm-space-md);
    margin-bottom: var(--hm-space-md);
}

.nav-btn {
    flex: 1;
    padding: var(--hm-space-md) var(--hm-space-xl);
    border-radius: var(--hm-radius-lg);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--hm-transition-fast);
    border: none;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.prev-btn {
    background: var(--hm-bg-card);
    color: var(--hm-text-secondary);
    border: 1px solid var(--hm-border);
}

.prev-btn:hover:not(:disabled) {
    background: var(--hm-bg-light);
    color: var(--hm-text-primary);
}

.next-btn, .submit-btn {
    background: linear-gradient(135deg, var(--hm-primary) 0%, var(--hm-primary-light) 100%);
    color: white;
}

.next-btn:hover:not(:disabled), .submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--hm-shadow-md);
}

.submit-btn {
    background: linear-gradient(135deg, var(--hm-success) 0%, #66BB6A 100%);
}

/* Time Estimate */
.quiz-time-estimate {
    text-align: center;
    font-size: 0.875rem;
    color: var(--hm-text-light);
}

/* ========================================
   Result Page Styles
   ======================================== */
.quiz-result-page {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--hm-space-lg) 0;
}

.result-header {
    text-align: center;
    margin-bottom: var(--hm-space-xl);
}

.result-emoji {
    font-size: 4rem;
    margin-bottom: var(--hm-space-md);
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hm-primary);
    margin: 0;
}

/* Primary Result */
.primary-result {
    background: var(--hm-bg-card);
    border-radius: var(--hm-radius-xl);
    padding: var(--hm-space-xl);
    text-align: center;
    margin-bottom: var(--hm-space-xl);
    box-shadow: var(--hm-shadow-lg);
    border-left: 4px solid;
}

.result-badge {
    display: inline-block;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    padding: var(--hm-space-sm) var(--hm-space-lg);
    border-radius: var(--hm-radius-full);
    margin-bottom: var(--hm-space-md);
}

.result-tagline {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--hm-text-primary);
    margin: 0 0 var(--hm-space-md) 0;
}

.result-description {
    font-size: 1rem;
    color: var(--hm-text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Radar Chart */
.radar-chart-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--hm-space-xl);
    background: var(--hm-bg-card);
    border-radius: var(--hm-radius-lg);
    padding: var(--hm-space-lg);
    box-shadow: var(--hm-shadow-sm);
}

#radarChart {
    max-width: 100%;
    height: auto;
}

/* Scores List */
.scores-list {
    background: var(--hm-bg-card);
    border-radius: var(--hm-radius-lg);
    padding: var(--hm-space-lg);
    margin-bottom: var(--hm-space-xl);
    box-shadow: var(--hm-shadow-sm);
}

.score-item {
    display: flex;
    align-items: center;
    gap: var(--hm-space-md);
    padding: var(--hm-space-sm) 0;
}

.score-item.primary-score {
    padding: var(--hm-space-md);
    background: var(--hm-bg-light);
    border-radius: var(--hm-radius-md);
    margin-bottom: var(--hm-space-sm);
}

.score-label {
    width: 80px;
    font-size: 0.875rem;
    font-weight: 500;
    flex-shrink: 0;
}

.score-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--hm-border);
    border-radius: var(--hm-radius-full);
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: var(--hm-radius-full);
    transition: width var(--hm-transition-slow);
}

.score-value {
    width: 40px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--hm-text-primary);
    text-align: right;
    flex-shrink: 0;
}

/* Secondary Types */
.secondary-types {
    background: var(--hm-bg-card);
    border-radius: var(--hm-radius-lg);
    padding: var(--hm-space-lg);
    margin-bottom: var(--hm-space-xl);
    box-shadow: var(--hm-shadow-sm);
}

.secondary-types h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--hm-text-primary);
    margin: 0 0 var(--hm-space-md) 0;
}

.secondary-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--hm-space-sm);
}

.secondary-tag {
    display: inline-block;
    font-size: 0.875rem;
    padding: var(--hm-space-xs) var(--hm-space-md);
    border-radius: var(--hm-radius-full);
    border: 1px solid;
    background: white;
}

/* Suggestions Box */
.suggestions-box {
    background: linear-gradient(135deg, var(--hm-bg-light) 0%, var(--hm-secondary-light) 100%);
    border-radius: var(--hm-radius-lg);
    padding: var(--hm-space-xl);
    margin-bottom: var(--hm-space-xl);
}

.suggestions-box h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--hm-primary);
    margin: 0 0 var(--hm-space-md) 0;
}

.suggestions-list {
    margin: 0;
    padding-left: var(--hm-space-lg);
}

.suggestions-list li {
    font-size: 0.9375rem;
    color: var(--hm-text-secondary);
    margin-bottom: var(--hm-space-sm);
    line-height: 1.5;
}

.suggestions-list li:last-child {
    margin-bottom: 0;
}

/* Result Actions */
.result-actions {
    display: flex;
    flex-direction: column;
    gap: var(--hm-space-md);
    margin-bottom: var(--hm-space-xl);
}

.action-btn {
    display: block;
    width: 100%;
    padding: var(--hm-space-lg) var(--hm-space-xl);
    border-radius: var(--hm-radius-lg);
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--hm-transition-fast);
    border: none;
}

.primary-action {
    background: linear-gradient(135deg, var(--hm-primary) 0%, var(--hm-primary-light) 100%);
    color: white;
}

.primary-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--hm-shadow-lg);
}

.secondary-action {
    background: var(--hm-bg-card);
    color: var(--hm-text-primary);
    border: 1px solid var(--hm-border);
}

.secondary-action:hover {
    background: var(--hm-bg-light);
    border-color: var(--hm-secondary);
}

/* Disclaimer */
.disclaimer {
    background: var(--hm-bg-light);
    border-radius: var(--hm-radius-md);
    padding: var(--hm-space-md);
    margin-bottom: var(--hm-space-lg);
}

.disclaimer p {
    font-size: 0.75rem;
    color: var(--hm-text-light);
    margin: 0;
    text-align: center;
    line-height: 1.6;
}

/* Retake Link */
.retake-link {
    text-align: center;
}

.retake-link a {
    color: var(--hm-primary);
    font-size: 0.875rem;
    text-decoration: none;
}

.retake-link a:hover {
    text-decoration: underline;
}

/* ========================================
   Responsive Styles
   ======================================== */
@media (max-width: 480px) {
    .herbmend-quiz {
        padding: var(--hm-space-sm);
    }
    
    .quiz-title {
        font-size: 1.5rem;
    }
    
    .quiz-subtitle {
        font-size: 1rem;
    }
    
    .question-card {
        padding: var(--hm-space-lg);
    }
    
    .question-text {
        font-size: 1.125rem;
    }
    
    .option-item {
        padding: var(--hm-space-md);
    }
    
    .option-text {
        font-size: 0.9375rem;
    }
    
    .result-emoji {
        font-size: 3rem;
    }
    
    .result-title {
        font-size: 1.25rem;
    }
    
    .result-tagline {
        font-size: 1.125rem;
    }
    
    .score-label {
        width: 60px;
        font-size: 0.75rem;
    }
    
    .score-value {
        width: 35px;
        font-size: 0.75rem;
    }
}

/* ========================================
   Animation Classes
   ======================================== */
.fade-in {
    animation: fadeIn var(--hm-transition-normal) ease forwards;
}

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

.slide-in {
    animation: slideIn var(--hm-transition-normal) ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .herbmend-quiz {
        background: white;
        padding: 0;
    }
    
    .quiz-navigation,
    .language-toggle,
    .result-actions,
    .retake-link {
        display: none;
    }
    
    .question-card,
    .primary-result,
    .scores-list {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
