html, body { background: #f5f5f5; }
.tab-bar { position: relative; top: auto; left: auto; right: auto; display: flex; align-items: center; }
.tab-bar .tab-btn.active::after { background: rgb(224, 132, 165); opacity: 0.75; }
.tab-back {
    position: absolute; left: 0.16rem; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; color: #666;
    padding: 0.16rem 0.1rem; cursor: pointer; line-height: 1;
    display: flex; align-items: center; text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.tab-back svg { width: 0.52rem; height: 0.52rem; }
body {
    margin: 0;
    padding-bottom: 0.5rem; box-sizing: border-box;
}
#scroll-root {
    display: block;
    overflow-y: visible; background: #f5f5f5;
    padding-bottom: 0; height: auto;
}
#scroll-root::-webkit-scrollbar { display: none; }
.container {
    max-width: 23.52rem; width: 100%; margin: 0 auto;
    padding: 0.21rem 0.42rem 1.2rem 0.42rem; box-sizing: border-box;
}
.card {
    background: #fff; border-radius: 0.47rem;
    padding: 0.31rem; margin-bottom: 0.42rem;
}
.card-title {
    font-size: 0.37rem; font-weight: 600; color: #333;
    margin-bottom: 0.16rem; display: flex; align-items: center; gap: 0.16rem;
}
.card-title::before {
    content: ''; width: 0.08rem; height: 0.37rem;
    background: #E9A0BC; border-radius: 0.04rem; display: inline-block;
}
.card-subtitle {
    font-size: 0.26rem; color: #999; margin: 0 0 0.16rem 0;
    line-height: 1.5;
}

/* 工具按钮 */
.action-btns {
    display: flex; gap: 0.21rem; margin-bottom: 0.52rem;
}
.action-btn {
    flex: 1; padding: 0.26rem 0.31rem;
    font-size: 0.34rem; font-weight: 600; font-family: inherit;
    color: #fff; border: none; border-radius: 999px;
    cursor: pointer; text-align: center;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 0.06rem 0.16rem rgba(0,0,0,0.1);
    transition: transform 0.12s, opacity 0.12s;
}
.action-btn:active { transform: scale(0.97); opacity: 0.9; }
.action-btn:nth-child(1) { background: #F9D6E5; color: #B0577F; }
.action-btn:nth-child(2) { background: #FCE3EF; color: #C06A94; }

/* 弹窗 */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4); z-index: 9999;
    align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 0.47rem; padding: 0.52rem 0.37rem 0.42rem;
    width: 88%; max-width: 9rem; box-shadow: 0 0.31rem 1.05rem rgba(0,0,0,0.15);
    min-height: 42vh; max-height: none; overflow-y: auto; position: relative;
    display: flex; flex-direction: column;
}
.modal-body {
    flex: 1; display: flex; flex-direction: column; justify-content: center;
    padding: 0.31rem 0;
}
.modal-box h3 { margin: 0.16rem 0 0.21rem; font-size: 0.44rem; color: #333; }
.modal-subtitle {
    font-size: 0.29rem; color: #999; margin: 0 0 0.42rem; line-height: 1.5;
}
.modal-brand {
    font-size: 0.26rem; color: #bbb; margin: 0 0 0.21rem; text-align: center;
}
.modal-close {
    position: absolute; top: 0.16rem; right: 0.31rem;
    font-size: 0.58rem; color: #bbb; cursor: pointer;
    line-height: 1; padding: 0.1rem;
    -webkit-tap-highlight-color: transparent;
}

/* 简介卡片 */
.intro-card {
    display: flex; align-items: center; gap: 0.31rem;
    background: linear-gradient(135deg, #FCEAF1, #FDF2F7);
    border: 0.02rem solid #F3C8DB;
}
.intro-text h2 { margin: 0 0 0.1rem; font-size: 0.42rem; color: #B0577F; }
.intro-text .intro-brand { margin: 0.31rem 0 0; font-size: 0.28rem; color: #B0577F; text-align: right; }
.intro-text p { margin: 0; font-size: 0.29rem; color: #666; line-height: 1.6; }
.intro-disclaimer { margin-top: 0.16rem !important; font-size: 0.28rem !important; color: #9E9E9E !important; }

/* 宠物类型切换 */
.pet-type-tabs {
    display: flex; gap: 0.16rem; overflow-x: auto;
    padding: 0.08rem 0; scrollbar-width: none;
}
.pet-type-tabs::-webkit-scrollbar { display: none; }
.pet-type-tab {
    flex: 1 1 0; cursor: pointer; padding: 0.21rem 0.16rem;
    border-radius: 9999px; font-size: 0.34rem; color: #666;
    background: #f5f5f5; white-space: nowrap; text-align: center;
    border: none; font-family: inherit; min-width: 0;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.pet-type-tab.active {
    background: rgb(224, 132, 165); color: #fff; font-weight: 600;
    box-shadow: 0 0.08rem 0.21rem rgba(224,132,165,0.3);
}

/* 性格卡片 */
.personality-card {
    border: 0.02rem solid #f0f0f0;
    transition: box-shadow 0.2s;
}
.personality-card:hover { box-shadow: 0 0.08rem 0.31rem rgba(0,0,0,0.06); }

.personality-header {
    display: flex; align-items: center; gap: 0.26rem;
    margin-bottom: 0.21rem;
}
.personality-emoji {
    font-size: 0.84rem; width: 1.05rem; height: 1.05rem;
    border-radius: 50%; background: #F2E8FC;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.personality-name {
    font-size: 0.42rem; font-weight: bold; color: #333;
    margin-bottom: 0.04rem;
}
.personality-en {
    font-size: 0.26rem; color: #999;
    font-style: italic;
}
.personality-traits {
    display: flex; flex-wrap: wrap; gap: 0.12rem;
    margin-bottom: 0.21rem;
}
.trait-tag {
    font-size: 0.26rem; padding: 0.08rem 0.21rem;
    border-radius: 9999px;
    background: #F9D6E5; color: #B0577F;
    font-weight: 500;
}
.personality-desc p {
    margin: 0 0 0.12rem; font-size: 0.3rem; color: #555; line-height: 1.7;
}
.personality-desc p:last-child { margin-bottom: 0; }
.personality-desc b { color: #333; }

/* 知识参考卡片 */
.knowledge-card { padding: 0.37rem 0.31rem; border-radius: 0.47rem; }
.formula-text { font-size: 0.28rem; color: #666; line-height: 1.7; }
.formula-text p { margin: 0 0 0.16rem; }
.formula-text ul { margin: 0 0 0.16rem; padding-left: 0.37rem; }
.formula-text li { margin-bottom: 0.08rem; }
.formula-text strong { color: #B0577F; }

/* ===== 测试区 ===== */
.quiz-card .card-title::before { background: #C8A0E8; }

.quiz-question {
    font-size: 0.37rem; font-weight: 600; color: #333;
    margin-bottom: 0.31rem; line-height: 1.5;
}
.quiz-options {
    display: flex; flex-direction: column; gap: 0.16rem;
    margin-bottom: 0.26rem;
}
.quiz-option {
    width: 100%; text-align: left; padding: 0.26rem 0.31rem;
    font-size: 0.34rem; color: #333; font-family: inherit;
    background: #fafafa; border: 0.02rem solid #eee;
    border-radius: 0.31rem; cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.5;
}
.quiz-option:active {
    background: #F2E8FC; border-color: #DBB5F0;
    transform: scale(0.98);
}
.quiz-progress {
    text-align: center; font-size: 0.28rem; color: #ccc;
}

/* 测试结果 */
.quiz-result {
    text-align: center; padding: 0.31rem 0;
}
.result-emoji { font-size: 1.47rem; margin-bottom: 0.16rem; }
.result-name {
    font-size: 0.52rem; font-weight: bold; color: #333;
    margin-bottom: 0.08rem;
}
.result-secondary {
    font-size: 0.3rem; color: #999; margin-bottom: 0.21rem;
}
.result-secondary b {
    color: #E084A5;
}
.result-desc {
    font-size: 0.32rem; color: #555; line-height: 1.7;
    margin-bottom: 0.26rem; text-align: left;
}
.result-tip {
    font-size: 0.3rem; color: #B0577F;
    background: #FCEAF1; border-radius: 0.26rem;
    padding: 0.21rem 0.31rem; margin-bottom: 0.37rem;
    text-align: left; line-height: 1.6;
}
.quiz-retry {
    padding: 0.21rem 0.63rem; font-size: 0.34rem;
    font-family: inherit; color: #fff;
    background: linear-gradient(135deg, #DBB5F0, #EBD4FB); color: #4A2D5C;
    border: none; border-radius: 9999px;
    cursor: pointer; font-weight: 600;
    -webkit-tap-highlight-color: transparent;
}
.quiz-retry:active { opacity: 0.85; }
.share-hint {
    margin: 0 0 0.26rem;
    padding: 0.21rem;
    background: transparent;
    border: none;
    border-radius: 0;
    text-align: center;
    box-shadow: none;
}
.share-hint p {
    margin: 0;
    font-size: 0.28rem;
    color: #333;
    font-weight: 400;
    line-height: 1.6;
}

/* 知识小贴士 */
.tips-list { display: flex; flex-direction: column; gap: 0.21rem; }
.tip-item {
    display: flex; gap: 0.21rem; align-items: flex-start;
}
.tip-num {
    width: 0.63rem; height: 0.63rem; border-radius: 50%;
    background: #F9D6E5; color: #B0577F;
    font-size: 0.28rem; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tip-content {
    flex: 1; font-size: 0.3rem; color: #555; line-height: 1.7;
}
.tip-content b { color: #333; }

/* 参考来源 */
.ref-card .card-title::before { background: #80C8D8; }
.ref-list {
    margin: 0; padding-left: 0.31rem;
    font-size: 0.28rem; color: #888; line-height: 1.8;
}
.ref-list li { margin-bottom: 0.06rem; }

/* Toast */
.toast-wrap {
    position: fixed; top: 1.2rem; left: 50%; transform: translateX(-50%);
    z-index: 99999; pointer-events: none;
}
.toast-msg {
    background: rgba(0,0,0,0.6); color: #fff; font-size: 0.34rem;
    padding: 0.26rem 0.52rem; border-radius: 0.42rem;
    white-space: nowrap;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 0.16rem 0.52rem rgba(0,0,0,0.12);
    animation: toastIn 0.25s ease;
}
.toast-msg.out { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-0.3rem); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-0.3rem); } }
