/* ===================================
   MBTI人格测试 - 纪念碑谷风格样式
   =================================== */

/* CSS变量 - 纪念碑谷温暖配色 */
:root {
    --primary: #D4956A;
    --primary-light: #E8B87D;
    --primary-dark: #B87850;
    --secondary: #85A98C;
    --secondary-light: #A4C4AB;
    --accent: #E5D4B3;
    --accent-light: #F5ECD9;
    --text-dark: #4A3B2A;
    --text-light: #7A6B5A;
    --text-lighter: #9A8B7A;
    --white: #FFF9F0;
    --shadow: rgba(74, 59, 42, 0.15);

    /* 每种人格的专属颜色 */
    --intj-color: #6B7B8C;
    --intp-color: #7A8B9C;
    --entj-color: #C87850;
    --entp-color: #D4956A;
    --infj-color: #85A98C;
    --infp-color: #A4C4AB;
    --enfj-color: #E8B87D;
    --enfp-color: #F5C87D;
    --istj-color: #8B7B6B;
    --isfj-color: #A89888;
    --estj-color: #B87850;
    --esfj-color: #C89878;
    --istp-color: #9A8A7A;
    --isfp-color: #B8A898;
    --estp-color: #D87850;
    --esfp-color: #E89878;
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

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

.geo-shape {
    position: absolute;
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.geo-1 {
    width: 150px;
    height: 150px;
    background: var(--primary);
    top: 10%;
    left: -5%;
    transform: rotate(45deg);
    animation-delay: 0s;
}

.geo-2 {
    width: 100px;
    height: 100px;
    background: var(--secondary);
    top: 60%;
    right: -3%;
    border-radius: 50%;
    animation-delay: -5s;
}

.geo-3 {
    width: 80px;
    height: 80px;
    background: var(--primary-light);
    bottom: 20%;
    left: 10%;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    animation-delay: -10s;
}

.geo-4 {
    width: 120px;
    height: 120px;
    background: var(--accent);
    top: 30%;
    right: 15%;
    transform: rotate(30deg);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    animation-delay: -15s;
}

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

/* 页面通用样式 */
.page {
    position: relative;
    min-height: 100vh;
    display: none;
    z-index: 1;
}

.page.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease;
}

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

.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===================================
   欢迎页面
   =================================== */
#welcome-page .container {
    justify-content: center;
    align-items: center;
}

.welcome-content {
    text-align: center;
    padding: 40px 20px;
}

.logo-container {
    width: 180px;
    height: 180px;
    margin: 0 auto 30px;
    animation: logoFloat 3s ease-in-out infinite;
}

.logo-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 20px var(--shadow));
}

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

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.intro-text {
    margin-bottom: 40px;
    p {
        font-size: 1rem;
        color: var(--text-lighter);
        margin: 8px 0;
    }
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px var(--shadow);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px var(--shadow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-arrow {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.btn-primary:hover .btn-arrow {
    transform: translateX(5px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-dark);
    border: 2px solid var(--primary);
    padding: 14px 30px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
}

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

/* ===================================
   测试页面
   =================================== */
#test-page .container {
    padding-top: 30px;
}

.test-header {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--accent);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

#current-question {
    font-weight: 700;
    color: var(--primary);
}

.question-container {
    flex: 1;
    display: flex;
    align-items: center;
}

.question-card {
    background: var(--white);
    padding: 30px 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow);
    width: 100%;
    animation: questionSlide 0.4s ease;
}

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

.question-text {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 25px;
    line-height: 1.8;
}

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

.option-btn {
    background: var(--accent-light);
    border: 2px solid transparent;
    padding: 18px 20px;
    font-size: 1rem;
    color: var(--text-dark);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.option-btn:hover {
    background: var(--accent);
    border-color: var(--primary-light);
}

.option-btn.selected {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--white);
    font-weight: 500;
}

.option-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    transform: translateY(-50%) scale(0);
    transition: transform 0.3s ease;
}

.option-btn.selected::after {
    transform: translateY(-50%) scale(1);
    background: var(--white);
}

.test-footer {
    padding: 20px 0;
    text-align: center;
}

/* ===================================
   结果页面
   =================================== */
#result-page .container {
    padding-top: 20px;
    padding-bottom: 30px;
}

.result-content {
    flex: 1;
}

.result-card {
    background: var(--white);
    padding: 30px;
    border-radius: 25px;
    box-shadow: 0 15px 40px var(--shadow);
    text-align: center;
    margin-bottom: 25px;
}

.result-avatar {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: avatarPop 0.5s ease;
}

.result-avatar svg {
    width: 100%;
    height: 100%;
}

@keyframes avatarPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.result-info {
    margin-bottom: 25px;
}

.result-type {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.result-nickname {
    font-size: 1.3rem;
    color: var(--primary);
    font-weight: 500;
}

/* 维度条 */
.result-dimensions {
    margin-top: 25px;
}

.dimension-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.dim-label {
    font-size: 0.85rem;
    color: var(--text-light);
    width: 60px;
}

.dim-track {
    flex: 1;
    height: 10px;
    background: var(--accent);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.dim-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 5px;
    transition: width 0.8s ease;
}

/* 分析部分 */
.analysis-section,
.traits-section {
    background: var(--white);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 8px 25px var(--shadow);
    margin-bottom: 20px;
}

.analysis-section h3,
.traits-section h3 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-weight: 600;
}

.analysis-text {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.8;
}

.analysis-text p {
    margin-bottom: 12px;
}

/* 特点标签 */
.traits-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.trait-tag {
    background: var(--accent-light);
    color: var(--text-dark);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.trait-tag:hover {
    background: var(--primary-light);
    color: var(--white);
}

/* 结果操作按钮 */
.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding-top: 10px;
}

/* ===================================
   手机适配
   =================================== */
@media screen and (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 15px;
    }

    .welcome-content {
        padding: 30px 15px;
    }

    .logo-container {
        width: 150px;
        height: 150px;
    }

    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .btn-primary {
        padding: 14px 35px;
        font-size: 1rem;
    }

    .question-card {
        padding: 25px 20px;
    }

    .question-text {
        font-size: 1.15rem;
    }

    .option-btn {
        padding: 15px 18px;
    }

    .result-card {
        padding: 25px 20px;
    }

    .result-avatar {
        width: 120px;
        height: 120px;
    }

    .result-type {
        font-size: 2rem;
    }

    .analysis-section,
    .traits-section {
        padding: 20px 15px;
    }

    .geo-shape {
        opacity: 0.2;
    }

    .geo-1 {
        width: 100px;
        height: 100px;
    }

    .geo-2 {
        width: 70px;
        height: 70px;
    }

    .geo-3 {
        width: 50px;
        height: 50px;
    }

    .geo-4 {
        width: 80px;
        height: 80px;
    }
}

/* 超小屏幕 */
@media screen and (max-width: 320px) {
    html {
        font-size: 12px;
    }

    .title {
        font-size: 1.8rem;
    }

    .result-type {
        font-size: 1.8rem;
    }
}

/* 横屏模式 */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .logo-container {
        width: 100px;
        height: 100px;
        margin-bottom: 15px;
    }

    .title {
        font-size: 1.8rem;
        margin-bottom: 5px;
    }

    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    .intro-text {
        margin-bottom: 20px;
    }

    .intro-text p {
        margin: 3px 0;
    }
}