* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 700px;
    width: 100%;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

/* 登录卡片 */
.login-card {
    max-width: 400px;
    margin: 0 auto;
}

.login-form {
    margin-top: 30px;
}

.login-form input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.error-msg {
    color: #e74c3c;
    font-size: 0.9rem;
    margin: 0 0 15px 0;
    min-height: 20px;
}

.card h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 10px;
}

.card h2 {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 20px;
    font-weight: normal;
}

.subtitle {
    font-size: 1.1rem;
    color: #999;
    margin-bottom: 30px;
}

/* 信息框 */
.info-box {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin: 30px 0;
    text-align: left;
}

.info-box p {
    color: #555;
    margin-bottom: 15px;
    font-weight: 500;
}

.info-box ul {
    list-style: none;
}

.info-box li {
    padding: 8px 0;
    color: #666;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
    color: white;
    font-size: 0.9rem;
}

.tag.O { background: #9b59b6; }
.tag.C { background: #3498db; }
.tag.E { background: #f39c12; }
.tag.A { background: #2ecc71; }
.tag.N { background: #e74c3c; }

/* 统计信息 */
.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
}

.stats p {
    color: #666;
    font-size: 1rem;
}

.stats strong {
    color: #667eea;
    font-size: 1.2rem;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    margin: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    margin: 5px;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.history-link {
    margin-top: 20px;
}

.history-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.95rem;
}

.history-link a:hover {
    text-decoration: underline;
}

/* 测试页面 */
.progress-bar {
    background: rgba(255, 255, 255, 0.3);
    height: 8px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: white;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    color: white;
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding: 0 5px;
}

.question-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.dimension-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    margin-bottom: 25px;
}

.question {
    font-size: 1.4rem;
    color: #333;
    line-height: 1.6;
    margin-bottom: 30px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    background: #f8f9fa;
    border: 2px solid transparent;
    padding: 15px 25px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.option-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.option-btn.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.option-btn.selected .option-label {
    color: white;
}

.option-label {
    color: #555;
    font-size: 1rem;
}

/* 结果页面 */
.result-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.result-card h1 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 10px;
}

.test-date {
    color: #999;
    margin-bottom: 30px;
}

.result-section {
    margin: 30px 0;
}

.result-section h2 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 20px;
    text-align: left;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.result-dimension {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.result-bar-container {
    flex: 1;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.result-bar {
    height: 100%;
    transition: width 1s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
}

.result-score {
    color: #333;
    font-weight: bold;
    font-size: 1rem;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.result-bar.light .result-score {
    color: #333;
}

.result-bar.dark .result-score {
    color: white;
}

.analysis-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    text-align: left;
}

.analysis-item h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.analysis-item h4 {
    color: #555;
    margin: 10px 0;
    font-size: 1rem;
}

.analysis-item p {
    color: #666;
    line-height: 1.6;
}

/* AI分析卡片 */
.ai-analysis-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf3 100%);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    text-align: left;
}

.personality-type {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
}

.personality-type h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.personality-type h4 {
    color: #333;
    font-size: 1.5rem;
    margin: 15px 0;
}

.personality-type p {
    color: #666;
    line-height: 1.6;
}

.overall-analysis {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.overall-analysis h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.overall-analysis p {
    color: #555;
    line-height: 1.8;
}

.suggestions {
    background: white;
    border-radius: 12px;
    padding: 20px;
}

.suggestions h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.suggestions ul {
    list-style: none;
    padding: 0;
}

.suggestions li {
    padding: 12px 0;
    color: #555;
    line-height: 1.6;
    border-bottom: 1px solid #f0f0f0;
}

.suggestions li:last-child {
    border-bottom: none;
}

.career-list {
    list-style: none;
    padding: 0;
}

.career-list li {
    padding: 10px 0;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}

.career-list li:last-child {
    border-bottom: none;
}

.career-list strong {
    color: #667eea;
}

.dimension-details {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.dimension-details h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.dim-detail-item {
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
}

.dim-detail-item h4 {
    color: #555;
    margin-bottom: 8px;
}

.dim-detail-item p {
    color: #666;
    line-height: 1.6;
}

.weakness-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
}

.weakness-item {
    padding: 10px 0;
    color: #856404;
    text-align: left;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 30px;
}

/* 历史记录 */
#history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    text-align: left;
    cursor: pointer;
    transition: background 0.3s;
}

.history-item:hover {
    background: #e9ecef;
}

.history-date {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.history-scores {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.history-score {
    display: flex;
    align-items: center;
    gap: 5px;
}

.history-score .tag {
    width: 25px;
    height: 25px;
    line-height: 25px;
    font-size: 0.8rem;
}

.no-history {
    color: #999;
    padding: 40px;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.share-result {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    white-space: pre-wrap;
    text-align: left;
    color: #666;
    line-height: 1.8;
}

/* AI 加载状态 */
.ai-loading {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid #e0e0e0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.ai-loading p {
    color: #666;
    font-size: 1rem;
}

/* API 配置提示 */
.api-config-alert {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.api-config-alert h4 {
    color: #856404;
    margin-bottom: 10px;
}

.api-config-alert p {
    color: #856404;
    line-height: 1.6;
    margin-bottom: 10px;
}

.api-config-alert code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #d63384;
}

.api-config-alert a {
    color: #667eea;
    text-decoration: underline;
}

/* 响应式 */
@media (max-width: 600px) {
    .card, .question-card, .result-card {
        padding: 25px;
    }

    .card h1 {
        font-size: 1.8rem;
    }

    .question {
        font-size: 1.1rem;
    }

    .stats {
        flex-direction: column;
        gap: 15px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        margin: 5px 0;
    }
}
