:root {
    --primary: #FF9F43;
    --primary-dark: #E8850A;
    --bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255,255,255,0.96);
    --text: #2d3436;
    --text-light: #636e72;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    min-height: 100vh;
    color: var(--text);
    padding: 20px;
}

.container {
    max-width: 720px;
    margin: 0 auto;
}

.page { display: none; animation: fadeIn 0.4s ease; }
.page.active { display: block; }

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

.hero {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 60px 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    margin-top: 40px;
}

.icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 32px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.features {
    list-style: none;
    text-align: left;
    max-width: 300px;
    margin: 0 auto 30px;
    color: var(--text-light);
}

.features li {
    padding: 8px 0;
    font-size: 16px;
}

button {
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
    font-size: 20px;
    padding: 16px 60px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(255,159,67,0.35);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.hint {
    margin-top: 18px;
    color: #b2bec3;
    font-size: 14px;
}

.quiz-card, .result-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    margin-top: 20px;
}

.progress-bar {
    height: 8px;
    background: #dfe6e9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 24px;
}

.quiz-card h2 {
    font-size: 22px;
    line-height: 1.6;
    margin-bottom: 28px;
}

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

.option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 14px;
    padding: 18px 20px;
    text-align: left;
    font-size: 16px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
}

.option:hover {
    border-color: var(--primary);
    background: #fff8f0;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

#loading {
    text-align: center;
    color: white;
    padding-top: 120px;
    font-size: 18px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.result-top {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 1px solid #eee;
    margin-bottom: 24px;
}

.type-label {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    margin-bottom: 12px;
}

#typeCode {
    font-size: 56px;
    letter-spacing: 8px;
    color: var(--primary);
    margin: 8px 0;
}

#typeName {
    color: var(--text-light);
    font-size: 18px;
}

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

.traits {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.trait {
    background: #f1f3f5;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    font-size: 13px;
}

.trait span {
    display: block;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    font-size: 16px;
}

.sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-card {
    background: #f8f9fa;
    border-radius: 14px;
    padding: 20px;
}

.section-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--text);
}

.section-card p {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 15px;
}

.upgrade-box, .share-box {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 26px;
    margin-top: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    text-align: center;
}

.upgrade-box h3, .share-box h3 {
    margin-bottom: 10px;
}

.upgrade-box p, .share-box p {
    color: var(--text-light);
    margin-bottom: 18px;
    font-size: 15px;
}

.btn-pay {
    background: #e17055;
    color: white;
    font-size: 18px;
    padding: 14px 40px;
    border-radius: 50px;
    font-weight: 600;
}

.btn-pay:hover { background: #d63031; }

.btn-secondary {
    background: #00b894;
    color: white;
    font-size: 16px;
    padding: 12px 32px;
    border-radius: 50px;
    margin-right: 10px;
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
    padding: 12px 32px;
    border-radius: 50px;
    display: block;
    margin: 30px auto 0;
    font-size: 16px;
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
}

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.active { display: flex; }

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    position: relative;
}

.modal-content h3 { margin-bottom: 10px; }
.modal-content p { color: var(--text-light); font-size: 14px; margin-bottom: 16px; }
.modal-content img { width: 100%; border-radius: 12px; }

.close {
    position: absolute;
    top: 10px; right: 16px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

@media (max-width: 480px) {
    .hero { padding: 40px 20px; }
    .hero h1 { font-size: 26px; }
    #typeCode { font-size: 42px; }
    .traits { grid-template-columns: repeat(2, 1fr); }
}
