/* 中医肥胖体质人格测试 H5 - 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #4a7c59;
    --primary-light: #6b9e7c;
    --primary-dark: #3a6347;
    --accent: #c4a35a;
    --bg: #f7f5f0;
    --text: #2c3e2d;
    --text-light: #5a6b5c;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(74, 124, 89, 0.15);
    --radius: 16px;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* 页面容器 */
.page {
    display: none;
    width: 100%;
    min-height: 100vh;
    position: relative;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

/* 封面页 */
#page-cover {
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #f7f5f0 0%, #e8f0e8 100%);
    padding: 20px;
}

.cover-wrapper {
    position: relative;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cover-img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    object-fit: contain;
    display: block;
}

.btn-start {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    max-width: 280px;
    padding: 14px 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--white);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(74, 124, 89, 0.35);
    transition: all 0.3s ease;
    letter-spacing: 2px;
    z-index: 10;
}

.btn-start:active {
    transform: translateX(-50%) scale(0.96);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.25);
}

/* 性别选择页 */
#page-gender {
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background: linear-gradient(180deg, #f7f5f0 0%, #e8f0e8 100%);
}

#page-gender h2 {
    font-size: 24px;
    margin-bottom: 40px;
    color: var(--text);
    letter-spacing: 2px;
}

.gender-options {
    display: flex;
    gap: 24px;
    width: 100%;
    max-width: 400px;
    justify-content: center;
}

.gender-card {
    flex: 1;
    max-width: 160px;
    aspect-ratio: 1;
    background: var(--white);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.gender-card:hover, .gender-card:active {
    border-color: var(--primary);
    transform: translateY(-4px);
}

.gender-icon {
    font-size: 48px;
    line-height: 1;
    color: var(--primary);
}

.gender-card div:last-child {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
}

/* 测试题页 */
#page-quiz {
    padding: 24px 20px 40px;
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e8e0;
    border-radius: 3px;
    margin-bottom: 24px;
    overflow: hidden;
}

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

.question-number {
    font-size: 14px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.question-text {
    font-size: 20px;
    line-height: 1.5;
    margin-bottom: 32px;
    color: var(--text);
    font-weight: 600;
}

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

.option-btn {
    width: 100%;
    padding: 18px 20px;
    background: var(--white);
    border: 2px solid #e0e8e0;
    border-radius: 12px;
    font-size: 16px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.25s;
}

.option-btn:hover, .option-btn:active {
    border-color: var(--primary-light);
    background: #f0f7f0;
    transform: translateX(4px);
}

.option-btn:active::before {
    opacity: 1;
}

/* 结果页 */
#page-result {
    padding: 20px;
    background: linear-gradient(180deg, #f7f5f0 0%, #e8f0e8 100%);
    justify-content: flex-start;
    align-items: center;
}

.result-container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.result-img {
    width: 100%;
    max-width: 420px;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--white);
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 320px;
    margin-top: 8px;
}

.btn-download, .btn-share {
    width: 100%;
    padding: 14px 0;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-download {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(74, 124, 89, 0.25);
}

.btn-share {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: 0 4px 12px rgba(74, 124, 89, 0.1);
}

.btn-download:active, .btn-share:active {
    transform: scale(0.96);
}

.share-tip {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
    text-align: center;
}

/* 分享弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.share-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease;
}

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

.share-content h3 {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 16px;
}

.share-content p {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.6;
    padding: 16px;
    background: #f7f5f0;
    border-radius: 10px;
    margin-bottom: 20px;
    word-break: break-all;
}

.share-content button {
    padding: 10px 28px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 24px;
    font-size: 15px;
    cursor: pointer;
}

/* 适配PC端 */
@media (min-width: 768px) {
    body {
        background: #e8e8e8;
    }
    .page {
        background: var(--bg) !important;
    }
    #page-result, #page-gender, #page-cover {
        background: linear-gradient(180deg, #f7f5f0 0%, #e8f0e8 100%) !important;
    }
}

/* 小屏手机适配 */
@media (max-width: 360px) {
    .question-text { font-size: 18px; }
    .option-btn { padding: 16px; font-size: 15px; }
    .cover-img, .result-img { max-width: 100%; }
    .btn-start {
        bottom: 16px;
        padding: 12px 0;
        font-size: 16px;
    }
}
