/* 全局变量 */
:root {
    --primary-gradient: linear-gradient(135deg, #6B5B95 0%, #B565A7 100%);
    --secondary-gradient: linear-gradient(135deg, #FF6B6B 0%, #FFE66D 100%);
    --background-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-radius: 15px;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

/* 背景装饰 */
.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: #FF6B6B;
    top: -200px;
    left: -200px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: #B565A7;
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: #FFE66D;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

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

/* 容器 */
.container {
    width: 90%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    min-height: 600px;
    position: relative;
}

/* 页面切换动画 */
.page {
    display: none;
    padding: 50px;
    animation: fadeIn 0.6s ease-out;
}

.page.active {
    display: block;
}

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

/* 开始页面 */
.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 4em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

h1 {
    font-size: 3em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.intro {
    font-size: 1.1em;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 40px;
    text-align: center;
}

/* 测试选项卡片 */
.test-options {
    margin: 40px 0;
}

.test-options h3 {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 30px;
    font-size: 1.5em;
}

.option-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.option-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
    border-color: #B565A7;
}

.option-card i {
    font-size: 2.5em;
    color: #B565A7;
    margin-bottom: 15px;
}

.option-card h4 {
    font-size: 1.3em;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.option-card p {
    color: var(--text-secondary);
    font-size: 0.95em;
}

.recommended {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--secondary-gradient);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
}

/* 历史记录 */
.history-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.history-section h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
}

.history-section i {
    margin-right: 10px;
}

.history-item {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.history-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}

/* 测试页面 */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.back-to-home {
    background: white;
    border: 2px solid #e0e0e0;
    color: var(--text-primary);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-home:hover {
    border-color: #B565A7;
    color: #B565A7;
    transform: rotate(-10deg);
}

.progress-info {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
}

.progress-bar {
    height: 10px;
    background: #e0e0e0;
    border-radius: 10px;
    margin-bottom: 40px;
    overflow: hidden;
    position: relative;
}

.progress {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 0.8em;
    color: var(--text-primary);
    font-weight: bold;
}

.question-container {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

#questionNumber {
    color: #B565A7;
    font-size: 1.3em;
    margin-bottom: 25px;
}

.question-text {
    font-size: 1.4em;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 40px;
    min-height: 80px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.option-btn {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 20px 30px;
    font-size: 1.1em;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.option-btn:hover {
    border-color: #B565A7;
    transform: translateX(10px);
    box-shadow: 0 5px 20px rgba(181, 101, 167, 0.2);
}

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

/* 导航按钮 */
.navigation-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-secondary {
    background: white;
    border: 2px solid #e0e0e0;
    color: var(--text-primary);
    padding: 12px 25px;
    font-size: 1em;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover:not(:disabled) {
    border-color: #B565A7;
    color: #B565A7;
    transform: translateY(-2px);
}

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

/* 结果页面 */
.result-header {
    text-align: center;
    margin-bottom: 40px;
}

.result-header h1 {
    font-size: 2em;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.result-type {
    font-size: 5em;
    font-weight: bold;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 20px 0;
    letter-spacing: 5px;
}

.result-name {
    font-size: 2em;
    color: #B565A7;
    margin-bottom: 30px;
}

.result-content {
    max-width: 800px;
    margin: 0 auto;
}

.result-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.result-section h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4em;
}

.result-section h3 i {
    color: #B565A7;
}

.result-description {
    line-height: 1.8;
    color: var(--text-secondary);
}

/* 维度分析 */
.dimensions {
    display: grid;
    gap: 25px;
}

.dimension {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.dimension-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.dimension-title {
    font-weight: 600;
    color: var(--text-primary);
}

.dimension-result {
    background: var(--primary-gradient);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}

.dimension-bar {
    height: 25px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.dimension-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 1s ease;
    border-radius: 15px;
}

.dimension-label {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.9em;
    color: var(--text-secondary);
    font-weight: 600;
}

/* 性格特征网格 */
.traits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.trait-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid #B565A7;
}

.trait-item i {
    font-size: 1.5em;
    color: #B565A7;
    margin-bottom: 10px;
}

.trait-item h4 {
    color: var(--text-primary);
    margin-bottom: 5px;
}

.trait-item p {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* 认知功能 */
.cognitive-functions {
    display: grid;
    gap: 15px;
}

.function-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.function-rank {
    background: var(--primary-gradient);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.function-details h4 {
    color: var(--text-primary);
    margin-bottom: 5px;
}

.function-details p {
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* 职业建议 */
.career-suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.career-category {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.career-category h4 {
    color: #B565A7;
    margin-bottom: 15px;
}

.career-list {
    list-style: none;
}

.career-list li {
    color: var(--text-secondary);
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.career-list li:before {
    content: "•";
    color: #B565A7;
    position: absolute;
    left: 0;
}

/* 相容性 */
.compatibility {
    display: grid;
    gap: 20px;
}

.compatibility-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.compatibility-group h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
}

.type-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.type-tag {
    background: white;
    color: #B565A7;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    border: 1px solid #B565A7;
    transition: all 0.3s ease;
}

.type-tag:hover {
    background: var(--primary-gradient);
    color: white;
    transform: scale(1.05);
}

/* 成长建议 */
.growth-tips {
    display: grid;
    gap: 15px;
}

.tip-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #FFE66D;
}

.tip-item h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.tip-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 操作按钮 */
.result-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 15px 35px;
    font-size: 1.1em;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(181, 101, 167, 0.3);
}

/* 分享弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 30px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

.modal h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}

.share-preview {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.share-buttons button {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1em;
}

.share-buttons button:hover {
    border-color: #B565A7;
    transform: translateY(-2px);
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-gradient);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1em;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        width: 95%;
        margin: 20px;
    }
    
    .page {
        padding: 30px 20px;
    }
    
    h1 {
        font-size: 2.2em;
    }
    
    .result-type {
        font-size: 3.5em;
    }
    
    .option-cards {
        grid-template-columns: 1fr;
    }
    
    .share-buttons {
        grid-template-columns: 1fr;
    }
    
    .result-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* 加载动画 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}
