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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #ff6b6b 0%, #f06595 25%, #cc5de8 50%, #845ef7 75%, #5c7cfa 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4), 0 0 40px rgba(255, 255, 255, 0.3);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.page {
    display: none;
    padding: 40px 30px;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

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

/* 欢迎页面 */
.welcome-page.active {
    display: block;
}

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

.header h1 {
    font-size: 36px;
    background: linear-gradient(135deg, #ff6b6b, #cc5de8, #5c7cfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-weight: 900;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.3);
}

.subtitle {
    font-size: 16px;
    color: #888;
    font-weight: 500;
}

.intro-card {
    background: linear-gradient(135deg, #fff5f5 0%, #f3e8ff 50%, #e0e7ff 100%);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    overflow: hidden;
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.intro-icon {
    font-size: 64px;
    text-align: center;
    margin-bottom: 15px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.intro-card h3 {
    font-size: 22px;
    background: linear-gradient(135deg, #ff6b6b, #cc5de8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 700;
}

.intro-card p {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.intro-list {
    list-style: none;
    margin-top: 15px;
}

.intro-list li {
    font-size: 14px;
    color: #555;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.intro-list li:last-child {
    border-bottom: none;
}

.primary-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #ff6b6b 0%, #f06595 50%, #cc5de8 100%);
    background-size: 200% 200%;
    animation: gradientFlow 3s ease infinite;
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
    position: relative;
    overflow: hidden;
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 2s infinite;
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.primary-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 40px rgba(255, 107, 107, 0.6);
}

.primary-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.secondary-btn {
    width: 100%;
    padding: 18px;
    background: white;
    color: #ff6b6b;
    border: 3px solid #ff6b6b;
    border-radius: 15px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.2);
}

.secondary-btn:hover {
    background: linear-gradient(135deg, #ff6b6b 0%, #f06595 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.4);
}

.footer-note {
    text-align: center;
    margin-top: 20px;
}

.footer-note p {
    font-size: 12px;
    color: #999;
}

/* 测试页面 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b 0%, #f06595 50%, #cc5de8 100%);
    background-size: 200% 100%;
    animation: progressGradient 2s ease infinite;
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
}

@keyframes progressGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.question-count {
    text-align: center;
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
}

.question-card {
    background: linear-gradient(135deg, #fff5f5 0%, #f3e8ff 50%, #e0e7ff 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.question-text {
    font-size: 22px;
    background: linear-gradient(135deg, #ff6b6b, #cc5de8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.6;
    margin-bottom: 25px;
    font-weight: 700;
}

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

.option-btn {
    padding: 18px 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, #ff6b6b, #f06595);
    transition: width 0.3s ease;
    z-index: 0;
    opacity: 0.1;
}

.option-btn:hover::before {
    width: 100%;
}

.option-btn:hover {
    border-color: #ff6b6b;
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.3);
}

.option-btn:active {
    transform: scale(0.98);
}

.option-btn.selected {
    background: linear-gradient(135deg, #ff6b6b 0%, #f06595 50%, #cc5de8 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 5px 25px rgba(255, 107, 107, 0.4);
    transform: translateX(5px);
}

.option-btn span {
    position: relative;
    z-index: 1;
}

/* 加载页面 */
.loading-page {
    text-align: center;
    padding: 80px 30px;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #ff6b6b;
    border-right: 5px solid #f06595;
    border-bottom: 5px solid #cc5de8;
    border-left: 5px solid #845ef7;
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.3);
    position: relative;
}

.spinner::before {
    content: '🧠';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
    animation: brainThink 1.5s ease-in-out infinite;
}

.spinner::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #ff6b6b;
    border-right-color: #f06595;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes brainThink {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

.loading-spinner h3 {
    font-size: 20px;
    color: #667eea;
    margin: 20px 0 10px 0;
}

.loading-spinner p {
    font-size: 14px;
    color: #999;
    min-height: 20px;
    animation: fadeInOut 2s ease-in-out infinite;
}

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

/* 加载进度条 */
.loading-progress {
    margin-top: 20px;
    width: 100%;
    height: 6px;
    background: #f3f3f3;
    border-radius: 3px;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #f06595, #cc5de8, #845ef7);
    background-size: 200% 100%;
    animation: progressMove 1.5s linear infinite, gradientShift 2s linear infinite;
    width: 0;
}

@keyframes progressMove {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 结果页面 */
.result-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 40px;
    background: linear-gradient(135deg, #ff6b6b 0%, #f06595 30%, #cc5de8 70%, #845ef7 100%);
    background-size: 300% 300%;
    animation: gradientShift 8s ease infinite;
    border-radius: 20px;
    color: white;
    box-shadow: 0 15px 50px rgba(255, 107, 107, 0.4);
    position: relative;
    overflow: hidden;
}

.result-header::after {
    content: '✨';
    position: absolute;
    top: 10px;
    left: 20px;
    font-size: 30px;
    animation: sparkle 2s ease-in-out infinite;
}

.result-header::before {
    content: '🌟';
    position: absolute;
    bottom: 10px;
    right: 20px;
    font-size: 30px;
    animation: sparkle 2.5s ease-in-out infinite reverse;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.3; transform: scale(1) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.3) rotate(180deg); }
}

.result-badge {
    font-size: 16px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 20px;
    margin-bottom: 15px;
    display: inline-block;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.personality-type {
    font-size: 64px;
    font-weight: 900;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    letter-spacing: 5px;
}

.personality-name {
    font-size: 24px;
    opacity: 0.95;
    font-weight: 500;
}

.user-number {
    font-size: 14px;
    margin-top: 10px;
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    display: inline-block;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: fadeInUp 0.8s ease-out;
}

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

/* 调用次数限制弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.limit-modal {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.limit-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.limit-modal h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.limit-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.8;
}

.highlight-number {
    color: #ff6b6b;
    font-weight: 700;
    font-size: 18px;
}

.limit-message {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: left;
}

.limit-message p {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.limit-message ul {
    margin: 0;
    padding-left: 20px;
}

.limit-message li {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.5;
}

.limit-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #f06595 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.3);
}

.limit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.limit-btn:active {
    transform: translateY(0);
}

.result-content {
    margin-bottom: 30px;
}

.result-section {
    margin-bottom: 25px;
}

.result-section h3 {
    font-size: 18px;
    color: #667eea;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.traits-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.trait-tag {
    padding: 8px 16px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.ai-description {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    line-height: 1.8;
    font-size: 15px;
    color: #333;
    border-left: 4px solid #667eea;
    min-height: 80px;
}

.ai-typing-cursor::after {
    content: '▋';
    animation: blink 1s infinite;
    color: #667eea;
}

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

.strengths-list, .suggestions-list {
    list-style: none;
}

.strengths-list li, .suggestions-list li {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.result-actions {
    display: flex;
    gap: 15px;
}

.result-actions button {
    flex: 1;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.poster {
    background: linear-gradient(135deg, #ff6b6b 0%, #f06595 30%, #cc5de8 70%, #845ef7 100%);
    border-radius: 15px;
    padding: 30px;
    color: white;
    margin-bottom: 20px;
}

.poster-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.poster-header h2 {
    font-size: 28px;
    font-weight: 900;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.poster-body {
    margin-bottom: 30px;
}

.poster-result {
    text-align: center;
    margin-bottom: 30px;
}

.poster-title {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.poster-personality-name {
    font-size: 42px;
    font-weight: 900;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
    margin-bottom: 15px;
}

.poster-traits {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

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

.poster-ai-comment {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.poster-label {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
    opacity: 0.9;
}

.poster-description {
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
}

.poster-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.poster-footer p {
    font-size: 14px;
    margin-bottom: 10px;
    opacity: 0.9;
}

.qr-placeholder {
    font-size: 60px;
    margin: 0 auto;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-actions button {
    flex: 1;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        border-radius: 15px;
    }

    .page {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 26px;
    }

    .question-text {
        font-size: 18px;
    }

    .personality-type {
        font-size: 36px;
    }

    .result-actions {
        flex-direction: column;
    }

    .poster-personality-name {
        font-size: 32px;
    }

    .modal-content {
        padding: 20px;
    }

    .poster {
        padding: 20px;
    }
}

/* 项目标识 */
.project-identifier {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 9999;
    font-size: 12px;
    color: #999;
}

.project-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    border-radius: 12px;
    margin-right: 5px;
    font-weight: 600;
}

.project-version {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    color: #888;
}

/* 本地开发模式样式 */
@media (max-width: 9999px) and (min-width: 0px) {
    /* 本地开发时隐藏项目标识 */
    .project-identifier {
        display: none !important;
    }
}
