.mbti-app {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 80px;
    min-height: 100vh;
}

/* 开始页面 */
.start-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    text-align: center;
}

.start-page h1 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.start-page .subtitle {
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 12px;
}

.start-page .desc {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 40px;
    line-height: 1.8;
    max-width: 360px;
}

.start-btn-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.start-btn {
    background-color: #000;
    color: #fff;
    border: 2px solid #000;
    padding: 14px 48px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-btn:hover {
    background-color: #fff;
    color: #000;
}

.start-btn.secondary {
    background-color: #fff;
    color: #000;
    padding: 12px 36px;
    font-size: 14px;
}

.start-btn.secondary:hover {
    background-color: #000;
    color: #fff;
}

/* 题目页面 */
.question-page {
    display: none;
    flex-direction: column;
    min-height: 70vh;
}

.progress-bar-wrapper {
    width: 100%;
    height: 4px;
    background: var(--light-border);
    border-radius: 2px;
    margin-bottom: 24px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #000;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
    text-align: right;
}

.question-text {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 32px;
    line-height: 1.6;
}

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

.option-btn {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #000;
    border-radius: 5px;
    background: #fff;
    color: #000;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.option-btn:hover {
    background: #000;
    color: #fff;
}

.option-btn:active {
    transform: scale(0.97);
}

/* Question fade transitions */
.question-page.fade-out {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.2s ease;
}

.question-page.fade-in {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.2s ease;
}

/* 结果页面 */
.result-page {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.result-page.revealed {
    opacity: 1;
    transform: translateY(0);
}

.result-page.revealed .result-header {
    animation: resultFadeIn 0.5s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

.result-page.revealed .result-dimensions {
    animation: resultFadeIn 0.5s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.result-page.revealed .result-desc {
    animation: resultFadeIn 0.5s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

.result-page.revealed .result-section {
    animation: resultFadeIn 0.5s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.result-page.revealed .result-actions {
    animation: resultFadeIn 0.5s ease forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

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

.result-header {
    margin-bottom: 28px;
    padding-top: 20px;
}

.result-type {
    font-size: 4rem;
    font-weight: bold;
    letter-spacing: 8px;
    margin-bottom: 8px;
}

.result-name {
    font-size: 1.3rem;
    color: var(--muted);
    margin-bottom: 12px;
}

.result-badge {
    display: inline-block;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 4px 16px;
    font-size: 13px;
    color: var(--muted);
}

/* 维度条 */
.result-dimensions {
    width: 100%;
    max-width: 460px;
    margin-bottom: 32px;
}

.dim-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.dim-label {
    font-size: 13px;
    font-weight: bold;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.dim-label.left {
    color: var(--fg);
}

.dim-label.right {
    color: var(--muted);
}

.dim-bar-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.dim-bar-fill {
    height: 100%;
    background: #000;
    border-radius: 5px;
    transition: width 0.8s ease;
}

.dim-pct {
    font-size: 13px;
    font-weight: bold;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.dim-pct.left {
    color: var(--fg);
}

.dim-pct.right {
    color: var(--muted);
}

/* 描述区域 */
.result-desc {
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--fg);
    max-width: 480px;
    margin-bottom: 32px;
    text-align: left;
}

.result-desc p {
    margin-bottom: 12px;
}

/* 优劣势 & 职业 */
.result-section {
    width: 100%;
    max-width: 480px;
    margin-bottom: 24px;
    text-align: left;
}

.result-section-title {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1.5px solid var(--border);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 5px 14px;
    border: 1.5px solid var(--light-border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--fg);
}

.tag.strength {
    border-color: var(--border);
}

.tag.weakness {
    border-color: var(--light-border);
    color: var(--muted);
}

.tag.career {
    border-color: var(--border);
    background: #000;
    color: #fff;
}

/* 操作按钮 */
.result-actions {
    display: flex;
    gap: 14px;
    margin-top: 12px;
    margin-bottom: 20px;
}

.action-btn {
    padding: 12px 28px;
    border: 2px solid #000;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn.primary {
    background: #000;
    color: #fff;
}

.action-btn.primary:hover {
    background: #333;
}

.action-btn.secondary {
    background: #fff;
    color: #000;
}

.action-btn.secondary:hover {
    background: var(--hover-bg);
}

/* toast */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 10px 24px;
    border-radius: 5px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

/* Gallery page */
.gallery-page {
    display: none;
    flex-direction: column;
    padding-bottom: 40px;
}

.gallery-header {
    text-align: center;
    margin-bottom: 32px;
    padding-top: 20px;
}

.gallery-header h2 {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.gallery-subtitle {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 16px;
}

.btn-back-gallery {
    background: #fff;
    color: #000;
    border: 2px solid #000;
    padding: 8px 24px;
    font-size: 14px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-back-gallery:hover {
    background: #000;
    color: #fff;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.gallery-group-title {
    grid-column: 1 / -1;
    font-size: 0.875rem;
    font-weight: bold;
    color: var(--muted);
    padding: 16px 0 4px;
    border-bottom: 1px solid var(--light-border);
    margin-top: 8px;
}

.gallery-group-title:first-child {
    margin-top: 0;
}

.gallery-card {
    border: 1.5px solid var(--border);
    border-radius: 5px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gallery-card:hover {
    border-color: #000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.gallery-card .card-code {
    font-size: 1.25rem;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.gallery-card .card-name {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.gallery-card .card-brief {
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.5;
}

.gallery-card .card-strengths {
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.gallery-card .card-strengths .tag {
    font-size: 11px;
    padding: 2px 8px;
}

.gallery-card .card-full {
    display: none;
    margin-top: 10px;
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--fg);
    text-align: left;
}

.gallery-card .card-full p {
    margin-bottom: 8px;
}

.gallery-card .card-full-title {
    font-weight: bold;
    font-size: 0.8rem;
    margin-top: 8px;
    margin-bottom: 4px;
    color: var(--fg);
}

.gallery-card .card-full .tag-list {
    margin-bottom: 8px;
}

.gallery-card.expanded {
    grid-column: 1 / -1;
}

.gallery-card.expanded .card-strengths {
    display: flex;
}

.gallery-card.expanded .card-full {
    display: block;
}

/* Pairing section */
.pairing-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.pairing-label {
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    min-width: 64px;
    padding-top: 4px;
    color: var(--fg);
}

.pairing-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pairing-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: default;
    position: relative;
    transition: all 0.2s ease;
}

.pairing-tag:hover {
    transform: translateY(-1px);
}

.pairing-tag.best {
    border: 2px solid var(--fg);
    font-weight: bold;
}

.pairing-tag.good {
    border: 1.5px solid var(--border);
}

.pairing-tag.ok {
    border: 1px solid var(--light-border);
    color: var(--muted);
}

.pairing-tag.challenge {
    border: 1.5px dashed var(--light-border);
    color: var(--muted);
}

.pairing-tag .pairing-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
    letter-spacing: 0;
    white-space: nowrap;
    margin-bottom: 4px;
    z-index: 10;
}

.pairing-tag:hover .pairing-tooltip {
    display: block;
}

@media (max-width: 480px) {
    .start-page h1 {
        font-size: 1.5rem;
    }

    .result-type {
        font-size: 3rem;
        letter-spacing: 4px;
    }

    .result-actions {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .action-btn {
        width: 100%;
        text-align: center;
    }

    .dim-label {
        font-size: 12px;
        width: 24px;
    }

    .dim-pct {
        font-size: 12px;
        width: 36px;
    }

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

    .option-btn {
        padding: 14px 16px;
        font-size: 14px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .pairing-row {
        flex-direction: column;
        gap: 4px;
    }
}
