/* ===== 第0关：山麓·照镜 ===== */

/* 星野评论气泡 */
.xingye-comment {
    position: fixed;
    bottom: 120px;
    left: 20px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    pointer-events: none;
    z-index: 100;
}

.xingye-comment.show {
    opacity: 1;
    transform: translateY(0);
}

.xingye-avatar-small {
    font-size: 36px;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    animation: xingye-float 2s ease-in-out infinite;
}

@keyframes xingye-float {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-5px) rotate(5deg); }
}

.xingye-bubble {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 12px 16px;
    max-width: 280px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
}

.xingye-bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    bottom: 10px;
    border: 8px solid transparent;
    border-right-color: rgba(255, 255, 255, 0.95);
}

.xingye-name {
    display: block;
    font-size: 12px;
    color: #ffd700;
    font-weight: 600;
    margin-bottom: 4px;
}

.xingye-text {
    margin: 0;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    font-style: italic;
}

/* 星野初遇场景 */
.companion-intro-scene {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 40px 20px;
}

.companion-intro-content {
    text-align: center;
    max-width: 500px;
    animation: fadeInUp 0.8s ease;
}

.companion-icon-large {
    font-size: 80px;
    margin-bottom: 20px;
    animation: xingye-glow 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
}

@keyframes xingye-glow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0.8)); transform: scale(1.1); }
}

.companion-intro-title {
    font-size: 28px;
    font-weight: 300;
    color: #fff;
    margin-bottom: 20px;
    letter-spacing: 4px;
}

.companion-intro-text {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.8;
}

.companion-dialogue-box-mini {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    text-align: left;
}

.companion-line {
    color: #ffd700;
    font-size: 15px;
    margin-bottom: 12px;
    line-height: 1.6;
}

.companion-line:last-child {
    margin-bottom: 0;
}

.companion-thought {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 14px;
}

.companion-choice {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.companion-choice button {
    min-width: 280px;
    padding: 14px 24px;
    font-size: 15px;
}

.level0-container {
    background: transparent;
}

.level0-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

/* 开场 */
.level0-intro {
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 1s ease;
}

.level0-intro h2 {
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 6px;
    margin-bottom: 20px;
}

.level0-intro p {
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 500px;
    margin: 0 auto 30px;
}

.mirror-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

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

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

/* 捏脸环节 */
.level0-customize {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.customize-header {
    text-align: center;
    margin-bottom: 40px;
}

.customize-header h3 {
    font-size: 20px;
    font-weight: 300;
    letter-spacing: 4px;
    margin-bottom: 12px;
}

.customize-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.face-customizer {
    display: flex;
    gap: 60px;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: center;
}

.face-preview-container {
    flex-shrink: 0;
}

.face-preview {
    width: 200px;
    height: 260px;
    background: linear-gradient(180deg, rgba(107, 127, 215, 0.1) 0%, rgba(244, 162, 97, 0.05) 100%);
    border: 2px solid rgba(107, 127, 215, 0.4);
    border-radius: 100px 100px 80px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 10px 40px rgba(107, 127, 215, 0.2),
        inset 0 -20px 40px rgba(0, 0, 0, 0.1);
}

.face-preview::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(-10%, -10%); }
    50% { transform: translate(10%, 10%); }
}

.face-preview .preview-glow {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow-blue) 0%, transparent 70%);
    opacity: 0.4;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(20px);
    transition: all 0.5s ease;
}

.face-preview .preview-face {
    position: relative;
    z-index: 2;
    text-align: center;
}

.face-preview .face-hair-slot {
    width: 100px;
    height: 60px;
    margin-bottom: -10px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.face-preview .face-hair-icon {
    font-size: 50px;
    line-height: 1;
    transition: all 0.3s ease;
}

.face-preview .face-eyes-slot {
    font-size: 28px;
    letter-spacing: 8px;
    margin-bottom: 5px;
    margin-top: 8px;
    transition: all 0.3s ease;
}

.face-preview .face-mouth-slot {
    font-size: 28px;
    margin-top: 8px;
    display: flex;
    justify-content: center;
    transition: all 0.3s ease;
}

.face-preview .face-label {
    position: absolute;
    bottom: 15px;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.face-options {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

.face-option-group {
    margin-bottom: 28px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.face-option-group:hover {
    border-color: rgba(107, 127, 215, 0.3);
    background: rgba(107, 127, 215, 0.05);
}

.face-option-group h4 {
    font-size: 13px;
    color: var(--primary-light);
    margin-bottom: 16px;
    font-weight: 500;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.face-option-group h4::before {
    content: '';
    width: 20px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

.face-option-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.face-option-btn {
    padding: 14px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.face-option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-warm));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.face-option-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(107, 127, 215, 0.2);
}

.face-option-btn.selected {
    border-color: var(--primary-color);
    background: rgba(107, 127, 215, 0.15);
}

.face-option-btn.selected::before {
    opacity: 0.1;
}

.face-option-btn .option-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 6px;
    transition: transform 0.3s ease;
}

.face-option-btn:hover .option-icon {
    transform: scale(1.1);
}

.face-option-btn .option-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.face-option-btn.selected .option-label {
    color: var(--primary-light);
}

.customize-actions {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.customize-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-style: italic;
}

/* 选中的特征标签 */
.selected-traits {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    justify-content: center;
}

.trait-tag {
    padding: 6px 12px;
    background: rgba(107, 127, 215, 0.15);
    border: 1px solid rgba(107, 127, 215, 0.3);
    border-radius: 20px;
    font-size: 12px;
    color: var(--primary-light);
    animation: tagPop 0.3s ease;
}

/* 情境卡片 */
.scenario-container {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.scenario-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 20px;
    animation: slideIn 0.5s ease;
}

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

.scenario-num {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.scenario-text {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.scenario-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scenario-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    color: var(--text-primary);
}

.scenario-option:hover {
    background: rgba(107, 127, 215, 0.1);
    border-color: var(--primary-color);
}

.scenario-option.selected {
    background: rgba(107, 127, 215, 0.2);
    border-color: var(--primary-color);
}

.option-letter {
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    line-height: 1.6;
    font-size: 14px;
}

.scenario-feedback {
    margin-top: 16px;
    padding: 16px;
    background: rgba(42, 157, 143, 0.1);
    border-left: 3px solid var(--accent-green);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    animation: fadeIn 0.3s ease;
}

.scenario-feedback strong {
    color: var(--accent-green);
}

.choice-feedback-simple {
    text-align: center;
    padding: 12px 20px;
    animation: fadeInUp 0.4s ease;
}

.choice-feedback-simple .feedback-glow {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s ease-in-out infinite;
}

.choice-feedback-simple p {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
    font-style: italic;
    opacity: 0.9;
}

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

@keyframes pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.next-btn-container {
    text-align: right;
    margin-top: 10px;
}

/* 关卡结局 */
.level0-ending {
    text-align: center;
    padding: 20px;
    animation: fadeIn 1s ease;
}

.ending-portrait {
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 40px var(--glow-blue);
}

.ending-portrait .ending-glow {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow-blue) 0%, transparent 70%);
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.ending-portrait .ending-face {
    position: relative;
    z-index: 2;
}

.ending-title {
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 6px;
    margin-bottom: 10px;
}

.ending-subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 14px;
}

.trait-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    max-width: 500px;
    margin: 0 auto 30px;
}

.trait-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.trait-card-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.trait-card-name {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.trait-card-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.knowledge-gained {
    background: rgba(244, 162, 97, 0.1);
    border-radius: var(--radius-md);
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.knowledge-gained h4 {
    color: var(--accent-warm);
    margin-bottom: 12px;
    font-size: 14px;
    letter-spacing: 2px;
}

.knowledge-list {
    list-style: none;
    text-align: left;
}

.knowledge-list li {
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
    padding-left: 20px;
    position: relative;
}

.knowledge-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent-green);
}

/* 镜子效果 */
.mirror-effect {
    filter: sepia(0.3) contrast(1.1);
}

/* ===== 性格特质选择 ===== */
.traits-selection {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeIn 0.8s ease;
}

.traits-header {
    text-align: center;
    margin-bottom: 40px;
}

.traits-header h3 {
    font-size: 22px;
    font-weight: 300;
    letter-spacing: 4px;
    margin-bottom: 12px;
}

.traits-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.traits-hint {
    font-size: 12px !important;
    color: var(--accent-warm) !important;
    font-style: italic;
    opacity: 0.8;
}

.traits-section {
    margin-bottom: 36px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.traits-section h4 {
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--primary-light);
    letter-spacing: 2px;
}

.section-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.traits-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.trait-select-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    color: var(--text-primary);
    font-family: inherit;
}

.trait-select-btn:hover {
    background: rgba(107, 127, 215, 0.1);
    border-color: rgba(107, 127, 215, 0.3);
    transform: translateY(-2px);
}

.trait-select-btn.selected {
    background: rgba(107, 127, 215, 0.2);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(107, 127, 215, 0.2);
}

.trait-select-btn .trait-icon {
    font-size: 28px;
}

.trait-select-btn .trait-name {
    font-size: 13px;
    font-weight: 500;
}

.trait-select-btn .trait-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.selection-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

.traits-actions {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
}

/* ===== 对比区域 ===== */
.comparison-section {
    max-width: 600px;
    margin: 30px auto;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.comparison-section h4 {
    text-align: center;
    color: var(--accent-warm);
    margin-bottom: 20px;
    font-size: 16px;
    letter-spacing: 2px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: center;
}

.comparison-col {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 16px;
}

.comparison-col h5 {
    font-size: 13px;
    color: var(--primary-light);
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 1px;
}

.comparison-traits {
    font-size: 13px;
}

.comp-label {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
    margin-bottom: 2px;
}

.comp-label:first-child {
    margin-top: 0;
}

.comp-value {
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 13px;
}

.comparison-arrow {
    font-size: 24px;
    color: var(--accent-warm);
    text-align: center;
}

.comparison-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 20px;
    line-height: 1.7;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ===== 心理过程分布 ===== */
.mental-process-section {
    max-width: 600px;
    margin: 30px auto;
    background: rgba(107, 127, 215, 0.05);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid rgba(107, 127, 215, 0.15);
}

.mental-process-section h4 {
    text-align: center;
    color: var(--primary-light);
    margin-bottom: 8px;
    font-size: 16px;
    letter-spacing: 2px;
}

.mental-process-section .section-desc {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.process-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.process-bar-item {
    width: 100%;
}

.process-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.process-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.process-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-warm));
    border-radius: 4px;
    transition: width 1s ease;
}

.process-summary {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(107, 127, 215, 0.1);
    font-size: 14px;
    color: var(--text-secondary);
}

.process-summary strong {
    color: var(--primary-light);
}

.process-summary small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ===== 多元智能 ===== */
.intelligence-section {
    max-width: 600px;
    margin: 30px auto;
    background: rgba(42, 157, 143, 0.05);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid rgba(42, 157, 143, 0.15);
}

.intelligence-section h4 {
    text-align: center;
    color: var(--accent-green);
    margin-bottom: 20px;
    font-size: 16px;
    letter-spacing: 2px;
}

.top-intelligences {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.intelligence-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

.intelligence-item .intel-icon {
    font-size: 24px;
}

.intelligence-item .intel-name {
    flex: 1;
    font-size: 14px;
}

.intelligence-item .intel-score {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent-green);
}

.btn-link {
    display: block;
    margin: 16px auto 0;
    background: none;
    border: none;
    color: var(--accent-green);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    text-decoration: underline;
}

.btn-link:hover {
    opacity: 0.8;
}

.all-intelligences-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.all-intel-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.all-intel-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.all-intel-name {
    font-size: 13px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.all-intel-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.all-intel-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), var(--primary-color));
    border-radius: 3px;
}

.all-intel-score {
    font-size: 12px;
    color: var(--accent-green);
    font-weight: 500;
}

/* 响应式 */
@media (max-width: 600px) {
    .traits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-arrow {
        transform: rotate(90deg);
    }
    
    .all-intelligences-grid {
        grid-template-columns: 1fr;
    }
}
