/* 全局样式重置和基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #FFB6C1 0%, #E6E6FA 100%);
    min-height: 100vh;
    color: #2C2C2C;
    overflow-x: hidden;
}

/* 背景装饰 */
.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.gradient-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 182, 193, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(230, 230, 250, 0.3) 0%, transparent 50%);
}

.floating-hearts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.floating-hearts::before,
.floating-hearts::after {
    content: '💕';
    position: absolute;
    font-size: 20px;
    opacity: 0.1;
    animation: floatHeart 15s infinite linear;
}

.floating-hearts::before {
    left: 10%;
    animation-delay: 0s;
}

.floating-hearts::after {
    left: 80%;
    animation-delay: 7s;
}

@keyframes floatHeart {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.1;
    }
    90% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* 主容器 */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 页面基础样式 */
.page {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.page.active {
    display: block;
}

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

/* 欢迎页面样式 */
.welcome-content {
    text-align: center;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #8B4B8C;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title-heart {
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 40px;
    opacity: 0.8;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 40px 0;
}

.feature-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #8B4B8C;
    margin-bottom: 10px;
}

.feature-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 按钮样式 */
.start-btn, .primary-btn {
    background: linear-gradient(135deg, #FF69B4, #DA70D6);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.3);
    margin: 20px 10px;
}

.start-btn:hover, .primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 105, 180, 0.4);
}

.start-btn span {
    position: relative;
    z-index: 2;
}

.btn-sparkle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
}

.start-btn:hover .btn-sparkle {
    width: 300px;
    height: 300px;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.8);
    color: #8B4B8C;
    border: 2px solid #E6E6FA;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.test-info {
    margin-top: 20px;
    color: #666;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* 测试说明页面 */
.instruction-content {
    padding: 20px;
}

.instruction-content h2 {
    text-align: center;
    color: #8B4B8C;
    font-size: 2rem;
    margin-bottom: 30px;
}

.instruction-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.instruction-card h3 {
    color: #8B4B8C;
    font-size: 1.2rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instruction-card ul {
    list-style: none;
    padding-left: 0;
}

.instruction-card li {
    padding: 8px 0;
    color: #555;
    position: relative;
    padding-left: 25px;
}

.instruction-card li::before {
    content: '✨';
    position: absolute;
    left: 0;
    color: #FF69B4;
}

.btn-group {
    text-align: center;
    margin-top: 30px;
}

/* 测试页面样式 */
.test-header {
    margin-bottom: 30px;
}

.progress-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 182, 193, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF69B4, #DA70D6);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    display: block;
    text-align: center;
    color: #666;
    font-weight: 500;
}

.question-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.question-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.question-text {
    font-size: 1.3rem;
    color: #2C2C2C;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 40px;
    font-weight: 500;
}

.rating-container {
    text-align: center;
}

.rating-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    color: #666;
    font-size: 0.9rem;
}

.rating-scale {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.rating-scale input[type="radio"] {
    display: none;
}

.rating-option {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #E6E6FA;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #8B4B8C;
    user-select: none;
}

.rating-option:hover {
    transform: scale(1.1);
    border-color: #FF69B4;
    background: rgba(255, 105, 180, 0.1);
}

.rating-scale input[type="radio"]:checked + .rating-option {
    background: linear-gradient(135deg, #FF69B4, #DA70D6);
    color: white;
    border-color: #FF69B4;
    transform: scale(1.15);
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.4);
}

.test-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.nav-btn {
    flex: 1;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    max-width: 200px;
}

.nav-btn.primary {
    background: linear-gradient(135deg, #FF69B4, #DA70D6);
    color: white;
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.3);
}

.nav-btn.secondary {
    background: rgba(255, 255, 255, 0.8);
    color: #8B4B8C;
    border: 2px solid #E6E6FA;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.nav-btn:not(:disabled):hover {
    transform: translateY(-2px);
}

/* 结果页面样式 */
.result-content {
    padding: 20px;
}

.result-header {
    text-align: center;
    margin-bottom: 40px;
}

.result-header h2 {
    color: #8B4B8C;
    font-size: 2rem;
    margin-bottom: 30px;
}

.result-type-card {
    background: linear-gradient(135deg, #FF69B4, #DA70D6);
    color: white;
    border-radius: 25px;
    padding: 40px 30px;
    box-shadow: 0 15px 40px rgba(255, 105, 180, 0.3);
    position: relative;
    overflow: hidden;
}

.result-type-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: sparkle 3s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

.type-name {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.type-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.keywords {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.keyword {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.result-details {
    display: grid;
    gap: 30px;
}

.detail-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.detail-section h3 {
    color: #8B4B8C;
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.description, .relationships {
    color: #555;
    line-height: 1.7;
    font-size: 1rem;
}

.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

.radar-fallback {
    background: rgba(255, 255, 255, 0.9);
    border: 1px dashed rgba(255, 105, 180, 0.5);
    border-radius: 12px;
    padding: 16px;
    color: #555;
}

.radar-fallback-title {
    color: #8B4B8C;
    font-weight: 600;
    margin-bottom: 8px;
}

.radar-fallback-list {
    margin-left: 18px;
    line-height: 1.8;
}

.compatibility-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.compatibility-item {
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.1), rgba(218, 112, 214, 0.1));
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 105, 180, 0.2);
}

.compatibility-name {
    font-weight: 600;
    color: #8B4B8C;
    margin-bottom: 10px;
}

.compatibility-score {
    font-size: 2rem;
    font-weight: 700;
    color: #FF69B4;
    margin-bottom: 5px;
}

.compatibility-desc {
    font-size: 0.9rem;
    color: #666;
}

.tips-list {
    display: grid;
    gap: 15px;
}

.tip-item {
    background: linear-gradient(135deg, rgba(230, 230, 250, 0.5), rgba(255, 182, 193, 0.3));
    border-radius: 15px;
    padding: 20px;
    border-left: 4px solid #FF69B4;
}

.tip-title {
    font-weight: 600;
    color: #8B4B8C;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tip-content {
    color: #555;
    line-height: 1.6;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.share-btn, .restart-btn {
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-btn {
    background: linear-gradient(135deg, #1AAD19, #2DC653);
    color: white;
    box-shadow: 0 5px 15px rgba(26, 173, 25, 0.3);
}

.restart-btn {
    background: rgba(255, 255, 255, 0.8);
    color: #8B4B8C;
    border: 2px solid #E6E6FA;
}

.share-btn:hover, .restart-btn:hover {
    transform: translateY(-2px);
}

.share-icon {
    width: 20px;
    height: 20px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 25px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover {
    color: #FF69B4;
}

.modal-content h3 {
    text-align: center;
    color: #8B4B8C;
    margin-bottom: 30px;
    margin-top: 10px;
}

.share-preview {
    text-align: center;
    margin: 20px 0;
}

.share-image {
    background: linear-gradient(135deg, #FF69B4, #DA70D6);
    color: white;
    padding: 40px 20px;
    border-radius: 20px;
    margin: 0 auto;
    max-width: 300px;
    position: relative;
    overflow: hidden;
}

.share-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.share-type {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.share-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
}

.download-btn {
    background: linear-gradient(135deg, #FF69B4, #DA70D6);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    display: block;
    margin: 20px auto 0;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 105, 180, 0.4);
}

/* 验证码模态框样式 */
.verification-modal-content {
    text-align: center;
    max-width: 400px;
}

.verification-modal-content h3 {
    color: #8B4B8C;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.verification-desc {
    color: #666;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.verification-input-container {
    margin-bottom: 25px;
}

.verification-input {
    width: 100%;
    max-width: 200px;
    padding: 12px 16px;
    border: 2px solid #E6E6FA;
    border-radius: 25px;
    font-size: 1.1rem;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    letter-spacing: 2px;
    font-weight: 600;
}

.verification-input:focus {
    border-color: #FF69B4;
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
}

.verification-error {
    color: #ff4757;
    font-size: 0.85rem;
    margin-top: 8px;
    min-height: 20px;
    font-weight: 500;
}

.verification-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.verification-buttons .secondary-btn,
.verification-buttons .primary-btn {
    min-width: 80px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .welcome-content {
        padding: 15px 10px;
        min-height: 100vh;
        justify-content: space-between;
        gap: 10px;
    }
    
    .main-title {
        font-size: 1.6rem;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 10px;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        margin: 15px 0;
    }
    
    .feature-card {
        padding: 15px 12px;
    }
    
    .feature-icon {
        font-size: 1.6rem;
        margin-bottom: 8px;
    }
    
    .feature-card h3 {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .feature-card p {
        font-size: 0.8rem;
    }
    
    .start-btn {
        padding: 12px 30px;
        font-size: 1rem;
        margin: 10px 0;
    }
    
    .test-info {
        margin-top: 15px;
        font-size: 0.85rem;
    }
    
    /* 说明页面移动端优化 */
    .instruction-content {
        padding: 15px 10px;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .instruction-content h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .instruction-card {
        padding: 15px;
        margin-bottom: 12px;
    }
    
    .instruction-card h3 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .instruction-card li {
        padding: 5px 0;
        font-size: 0.85rem;
        padding-left: 20px;
    }
    
    .btn-group {
        margin-top: 20px;
        padding-bottom: 20px;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .rating-scale {
        gap: 6px;
        flex-wrap: nowrap;
    }
    
    .rating-option {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
        min-width: 40px;
        flex-shrink: 0;
    }
    
    .test-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-btn {
        max-width: none;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .compatibility-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .welcome-content {
        padding: 10px 8px;
        min-height: 100vh;
        justify-content: space-between;
        gap: 8px;
    }
    
    .main-title {
        font-size: 1.4rem;
        margin-bottom: 8px;
        gap: 4px;
    }
    
    .subtitle {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }
    
    .feature-grid {
        margin: 12px 0;
        gap: 6px;
    }
    
    .feature-card {
        padding: 12px 10px;
    }
    
    .feature-icon {
        font-size: 1.4rem;
        margin-bottom: 6px;
    }
    
    .feature-card h3 {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }
    
    .feature-card p {
        font-size: 0.75rem;
    }
    
    .start-btn {
        padding: 10px 25px;
        font-size: 0.9rem;
        margin: 8px 0;
    }
    
    .test-info {
        margin-top: 12px;
        font-size: 0.8rem;
    }
    
    /* 说明页面小屏幕优化 */
    .instruction-content {
        padding: 12px 8px;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .instruction-content h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .instruction-card {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .instruction-card h3 {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .instruction-card li {
        padding: 4px 0;
        font-size: 0.8rem;
        padding-left: 18px;
    }
    
    .btn-group {
        margin-top: 15px;
        padding-bottom: 15px;
    }
}

/* iPhone 13 Pro 特别优化 */
@media (max-width: 390px) and (max-height: 844px) {
    .welcome-content {
        padding: 8px 6px;
        min-height: 100vh;
        justify-content: space-between;
        gap: 6px;
    }
    
    .main-title {
        font-size: 1.3rem;
        margin-bottom: 6px;
        gap: 3px;
    }
    
    .subtitle {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }
    
    .feature-grid {
        margin: 8px 0;
        gap: 4px;
    }
    
    .feature-card {
        padding: 10px 8px;
    }
    
    .feature-icon {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }
    
    .feature-card h3 {
        font-size: 0.75rem;
        margin-bottom: 3px;
    }
    
    .feature-card p {
        font-size: 0.7rem;
    }
    
    .start-btn {
        padding: 8px 20px;
        font-size: 0.85rem;
        margin: 6px 0;
    }
    
    .rating-scale {
        gap: 3px;
        flex-wrap: nowrap;
        justify-content: space-between;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .rating-option {
        width: 35px;
        height: 35px;
        font-size: 0.7rem;
        min-width: 35px;
        flex-shrink: 0;
    }
    
    /* 说明页面iPhone 13 Pro优化 */
    .instruction-content {
        padding: 10px 6px;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .instruction-content h2 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
    
    .instruction-card {
        padding: 10px;
        margin-bottom: 6px;
    }
    
    .instruction-card h3 {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }
    
    .instruction-card li {
        padding: 3px 0;
        font-size: 0.75rem;
        padding-left: 16px;
    }
    
    .btn-group {
        margin-top: 12px;
        padding-bottom: 12px;
    }
    
    .question-card {
        padding: 30px 20px;
    }
    
    .rating-scale {
        gap: 4px;
        flex-wrap: nowrap;
        justify-content: space-between;
        max-width: 320px;
        margin: 0 auto;
    }
    
    .rating-option {
        width: 38px;
        height: 38px;
        font-size: 0.75rem;
        min-width: 38px;
        flex-shrink: 0;
    }
    
    .type-name {
        font-size: 1.8rem;
    }
    
    .detail-section {
        padding: 20px;
    }
}
