/* assets/css/style.css */
/* 自然清新风格 - 灵魂动物测试 - 修复缩放问题 */

/* 基础样式 */
* {
    box-sizing: border-box;
    -webkit-transform: none !important;
    transform: none !important;
    zoom: 1 !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
}

html {
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    min-height: 100vh;
    color: #2c3e50;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    zoom: 1 !important;
    position: relative;
    overflow-x: hidden;
}

/* === 关键修复：移除毛玻璃效果，使用多层阴影增强视觉效果 === */
.container {
    width: min(95%, 600px);
    max-width: min(95%, 600px);
    margin: 20px auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.98); /* 提高透明度 */
    border-radius: 20px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(78, 205, 196, 0.15), /* 添加浅色外发光 */
        inset 0 1px 0 rgba(255, 255, 255, 0.8); /* 内阴影模拟光泽感 */
    /* 移除 backdrop-filter: blur(10px); */
    border: 1px solid rgba(255, 255, 255, 0.6);
    transform: none !important;
    zoom: 1 !important;
    box-sizing: border-box;
}

/* 标题样式 */
h1 {
    color: #2c3e50;
    text-align: center;
    margin-bottom: 20px;
    font-size: clamp(1.8em, 5vw, 2.2em);
    font-weight: 700;
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transform: none !important;
}

h2 {
    color: #4ecdc4;
    text-align: center;
    margin-bottom: 15px;
    font-size: clamp(1.5em, 4vw, 1.8em);
    transform: none !important;
}

/* 按钮样式 */
.start-btn, .next-btn, .prev-btn, .submit-btn, .share-btn, .btn {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
    padding: clamp(12px, 3vw, 15px) clamp(25px, 6vw, 30px);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin: 8px;
    font-size: clamp(1em, 3vw, 1.1em);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
    text-align: center;
    transform: none !important;
    zoom: 1 !important;
    min-height: 44px;
}

.start-btn:hover, .next-btn:hover, .prev-btn:hover, .submit-btn:hover, .share-btn:hover, .btn:hover {
    background: linear-gradient(135deg, #44a08d, #4ecdc4);
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

.start-btn:active, .next-btn:active, .prev-btn:active, .submit-btn:active, .share-btn:active, .btn:active {
    transform: translateY(0) !important;
}

/* 问题页面样式 */
.question {
    margin-bottom: 25px;
    padding: clamp(15px, 4vw, 20px);
    background: rgba(248, 248, 248, 0.9);
    border-radius: 15px;
    border-left: 4px solid #4ecdc4;
    transform: none !important;
}

.question-text {
    font-size: clamp(1.1em, 3.5vw, 1.3em);
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* 选项样式 */
.option {
    display: block;
    padding: clamp(12px, 3vw, 15px) clamp(15px, 4vw, 20px);
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    font-size: clamp(1em, 3vw, 1.1em);
    line-height: 1.5;
    transform: none !important;
}

.option:hover {
    background: rgba(78, 205, 196, 0.1);
    border-color: #4ecdc4;
    transform: translateX(5px) !important;
}

.option input {
    margin-right: 12px;
    transform: scale(1.2) !important;
}

.option.selected {
    background: rgba(78, 205, 196, 0.15);
    border-color: #4ecdc4;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.2);
}

/* 结果页面样式 */
.animal-card {
    text-align: center;
    padding: clamp(20px, 5vw, 30px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 248, 248, 0.95));
    border-radius: 20px;
    margin: 20px 0;
    border: 2px solid rgba(78, 205, 196, 0.3);
    transform: none !important;
}

.animal-card h2 {
    color: #2c3e50;
    font-size: clamp(1.5em, 4vw, 2em);
    margin-bottom: 20px;
}

.animal-image-container {
    position: relative;
    display: inline-block;
    margin: 20px 0;
    transform: none !important;
}

/* 个性化结果页开始 */
.result-title {
    font-size: clamp(1.8em, 5vw, 2.2em);
    line-height: 1.3;
    margin-bottom: 30px;
    transform: none !important;
}

.animal-highlight {
    color: #e74c3c;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* 严格控制为200x200像素 - 使用 clamp() */
.spirit-animal-img {
    width: clamp(150px, 40vw, 200px);
    height: clamp(150px, 40vw, 200px);
    object-fit: contain;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 15px;
    transform: none !important;
}

.spirit-animal-img:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.animal-name-overlay {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%) !important;
    background: rgba(44, 62, 80, 0.9);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.animal-image-container:hover .animal-name-overlay {
    opacity: 1;
}

.animal-description {
    font-size: clamp(0.95em, 3vw, 1.1em);
    line-height: 1.7;
    color: #555;
    margin: 20px 0;
    padding: clamp(15px, 4vw, 20px);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    border-left: 4px solid #4ecdc4;
}

.style-tag {
    color: #7f8c8d;
    font-style: italic;
    font-size: clamp(0.8em, 2.5vw, 0.9em);
}

/* 市场聚焦标签容器 - 确保换行 */
.market-tag-container {
    display: block;
    width: 100%;
    clear: both;
    margin: 20px 0 15px 0;
}

/* 市场聚焦标签样式 - 青绿色主题 */
.market-tag {
    color: #555;
    font-style: italic;
    font-size: clamp(0.9em, 2.5vw, 1em);
	font-weight: 700;
}


/* 悬停效果 */
.market-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(78, 205, 196, 0.3);
    background: linear-gradient(135deg, #e0f8f5 0%, #d0f3ef 50%, #ffeef2 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}




/* 分享区域样式 */
.share-section {
    text-align: center;
    margin: 30px 0;
    padding: clamp(20px, 5vw, 25px);
    background: linear-gradient(135deg, rgba(168, 237, 234, 0.25), rgba(254, 214, 227, 0.25));
    border-radius: 15px;
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.share-section p {
    font-size: clamp(1em, 3.5vw, 1.2em);
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
}

.social-share {
    margin: 20px 0;
}

.social-share button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-share button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 操作按钮区域 */
.action-buttons {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid rgba(78, 205, 196, 0.3);
}

/* 进度指示器 */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(78, 205, 196, 0.2);
    border-radius: 3px;
    margin: 20px 0;
    overflow: hidden;
    transform: none !important;
}

.progress {
    height: 100%;
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #7f8c8d;
    font-size: clamp(0.8em, 2.5vw, 0.9em);
    margin-bottom: 10px;
}

/* 首页封面图片样式 */
.cover-image {
    width: 100%;
    max-width: 800px;
    height: clamp(250px, 50vw, 400px);
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    margin: 20px 0;
    border: 5px solid white;
    transition: transform 0.3s ease;
}

.cover-image:hover {
    transform: scale(1.02);
}

/* 导航按钮容器 */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    transform: none !important;
}

.nav-buttons .prev-btn {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.nav-buttons .prev-btn:hover {
    background: linear-gradient(135deg, #7f8c8d, #95a5a6);
}

.nav-buttons .next-btn {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

.nav-buttons .next-btn:hover {
    background: linear-gradient(135deg, #44a08d, #4ecdc4);
}

/* 测试介绍文字 */
.intro-text {
    text-align: center;
    font-size: clamp(1em, 3vw, 1.1em);
    line-height: 1.7;
    color: #555;
    margin-bottom: 25px;
}

/* 结果页面特殊样式 */
.result-container {
    text-align: center;
}

.result-title {
    font-size: clamp(2em, 6vw, 2.5em);
    margin-bottom: 30px;
    color: #2c3e50;
}

/* 通用图片样式 */
img {
    max-width: 100%;
    height: auto;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    animation: fadeIn 0.6s ease-out;
}

/* 加载状态 */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4ecdc4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* === 关键修复：针对401px-768px设备的专门优化 === */
@media (min-width: 401px) and (max-width: 768px) {
    html, body {
        width: 100vw !important;
        overflow-x: hidden !important;
        position: relative;
    }
    
    .container {
        width: 94vw !important;
        max-width: 94vw !important;
        margin: 15px auto !important;
        padding: 25px !important;
        transform: none !important;
        zoom: 1 !important;
    }
    
    /* 确保内容不会导致缩放 */
    .question, .animal-card, .share-section {
        max-width: 100%;
        overflow-wrap: break-word;
    }



.progress-bar {
        position: relative;
        height: 6px;
        background: rgba(78, 205, 196, 0.2);
        border-radius: 3px;
        overflow: visible; /* 改为visible */
    }
    
    .progress-bar::after {
        content: '';
        position: absolute;
        bottom: -1px;
        left: 0;
        right: 0;
        height: 1px;
        background: rgba(78, 205, 196, 0.2); /* 与背景色一致 */
        z-index: 1;
    }
    
    .progress {
        position: relative;
        z-index: 2;
        height: 6px;
        border-radius: 3px;
    }
    
    /* 隐藏进度数字 */
    .progress-text {
        display: none !important;
    }
    
    /* 或者如果进度数字在.progress元素内部 */
    .progress {
        color: transparent !important;
        font-size: 0 !important;
    }

}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 20px;
        margin: 10px auto;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    h2 {
        font-size: 1.5em;
    }
    
    .cover-image {
        height: 300px;
    }
    
    .spirit-animal-img {
        width: 200px;
        height: 200px;
    }
    
    .option {
        padding: 12px 15px;
        font-size: 1em;
    }
    
    .start-btn, .next-btn, .prev-btn, .submit-btn, .share-btn, .btn {
        padding: 10px 25px;
        font-size: 1em;
        display: block;
        width: 100%;
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    /* 结果页面特殊处理 - 明确设置字体大小 */
    .result-container .result-title {
        font-size: 2.2em; /* 恢复到原本的大小 */
    }
    
    .result-container .animal-card h2 {
        font-size: 1.8em; /* 恢复到原本的大小 */
    }
    
    .result-container .animal-description {
        font-size: 1.1em; /* 恢复到原本的大小 */
    }
    
    .result-container .style-tag {
        font-size: 0.9em; /* 恢复到原本的大小 */
    }
    
    /* 其他原有布局样式保持不变 */
    .container {
        padding: 15px;
    }
    
    .question {
        padding: 15px;
    }
    
    .animal-card {
        padding: 20px;
    }
    
    .spirit-animal-img {
        width: 200px;
        height: 200px;
    }
}

/* === 新增：防止任何JavaScript缩放 === */
.no-zoom {
    transform: none !important;
    zoom: 1 !important;
    -webkit-transform: none !important;
}

/* === 新增：视口强制控制 === */
.viewport-fixed {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
    overflow-x: hidden !important;
}

/* 页面包装器样式 */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

@media (max-width: 768px) {
    .page-wrapper {
        align-items: flex-start;
        padding: 5px;
    }
    
    .container {
        margin: 10px auto;
    }
}


/* === 修复移动端菜单按钮动画 - 安全方案 === */
/* 只在移动端生效，不影响其他元素 */
@media (max-width: 768px) {
    .mobile-menu-btn .menu-line {
        transform: none !important;
        -webkit-transform: none !important;
    }
    
    .mobile-menu-btn.active .menu-line:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px) !important;
        -webkit-transform: rotate(45deg) translate(6px, 6px) !important;
    }
    
    .mobile-menu-btn.active .menu-line:nth-child(2) {
        opacity: 0 !important;
        transform: scale(0) !important;
        -webkit-transform: scale(0) !important;
    }
    
    .mobile-menu-btn.active .menu-line:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px) !important;
        -webkit-transform: rotate(-45deg) translate(6px, -6px) !important;
    }
}



/* === 测试页面导航按钮样式 === */

/* 测试页面导航按钮容器样式 */
.nav-buttons-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    gap: 15px;
    width: 100%;
}

/* 导航按钮通用样式 */
.nav-btn {
    padding: 12px 25px; /* 增加水平内边距从20px到25px */
    font-size: 14px;
    border-radius: 20px;
    cursor: pointer;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 160px; /* 增加最大宽度从140px到160px */
    min-height: 44px;
    text-align: center;
    white-space: nowrap;
}

/* 上一题按钮 */
.prev-btn {
    background: #95a5a6;
    color: white;
}

.prev-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.4);
}

/* 下一题按钮 */
.next-btn {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
    color: white;
}

.next-btn:hover {
    background: linear-gradient(135deg, #44a08d, #4ecdc4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
}

/* 提交按钮 */
.submit-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* 占位元素保持对齐 */
.nav-btn-placeholder {
    flex: 1;
    max-width: 160px; /* 同步增加占位元素的最大宽度 */
    visibility: hidden;
}

/* 确保第一题时按钮也能正确对齐 */
.navigation {
    width: 100%;
}

/* 平板端适配 */
@media (max-width: 768px) {
    .nav-btn {
        max-width: 150px; /* 从130px增加到150px */
        padding: 10px 20px; /* 增加水平内边距从16px到20px */
        font-size: 13px;
    }
    
    .nav-buttons-container {
        gap: 12px;
    }
    
    .nav-btn-placeholder {
        max-width: 150px; /* 同步增加 */
    }
}

/* 移动端适配 */
@media (max-width: 480px) {
    .nav-btn {
        max-width: 140px; /* 从120px增加到140px */
        padding: 10px 18px; /* 增加水平内边距从14px到18px */
        font-size: 12px;
        min-height: 40px;
    }
    
    .nav-buttons-container {
        gap: 10px;
    }
    
    .nav-btn-placeholder {
        max-width: 140px; /* 同步增加 */
    }
}

/* 超小屏幕适配 */
@media (max-width: 360px) {
    .nav-btn {
        max-width: 130px; /* 从110px增加到130px */
        padding: 8px 16px; /* 增加水平内边距从12px到16px */
        font-size: 11px;
    }
    
    .nav-buttons-container {
        gap: 8px;
    }
    
    .nav-btn-placeholder {
        max-width: 130px; /* 同步增加 */
    }
}