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

body {
    font-family: 'Microsoft YaHei', 'Comic Sans MS', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* 梦幻背景动画 - 漂浮的星星 */
body::before {
    content: '✨ ⭐ 🌟 💫 ✨ ⭐ 🌟 💫 ✨ ⭐';
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    font-size: 2em;
    opacity: 0.3;
    animation: floatingStars 30s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes floatingStars {
    0% {
        transform: translateX(0) translateY(0);
    }
    100% {
        transform: translateX(-50%) translateY(-20px);
    }
}

.container {
    width: 100%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 30px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.4), 0 0 40px rgba(102, 126, 234, 0.3);
    overflow: hidden;
    position: relative;
    z-index: 1;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

/* 标题区域 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '🌈 ';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3em;
    animation: bounce 2s infinite;
}

.header::after {
    content: ' 🎯';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3em;
    animation: bounce 2s infinite 0.5s;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-60%) scale(1.1);
    }
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    font-weight: bold;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.2em;
    opacity: 0.95;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* 主内容区域 */
.main-content {
    padding: 30px 20px;
}

.step {
    animation: fadeIn 0.5s ease-in;
}

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

/* 摄像头区域 */
.camera-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto 30px;
    border-radius: 25px;
    overflow: hidden;
    background: linear-gradient(135deg, #000 0%, #1a1a1a 100%);
    aspect-ratio: 4/3;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(102, 126, 234, 0.3);
    border: 5px solid transparent;
    background-clip: padding-box;
}

.camera-container::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #4facfe);
    border-radius: 25px;
    z-index: -1;
    animation: borderGlow 3s linear infinite;
}

@keyframes borderGlow {
    0%, 100% {
        filter: hue-rotate(0deg);
    }
    50% {
        filter: hue-rotate(360deg);
    }
}

#video, #photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 倒计时覆盖层 */
.countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.countdown-content {
    text-align: center;
}

.countdown-number {
    font-size: 10em;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.8),
                 0 0 60px rgba(102, 126, 234, 0.6);
    animation: countdownPulse 1s ease-out;
    line-height: 1;
}

.countdown-hint {
    font-size: 1.8em;
    color: white;
    margin-top: 30px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: hintBlink 1.5s ease-in-out infinite;
}

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

@keyframes countdownPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 闪光效果 */
.flash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 20;
}

.flash-overlay.flash {
    animation: flashEffect 0.5s ease-out;
}

@keyframes flashEffect {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.camera-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.camera-tips {
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

/* 按钮样式 */
.btn {
    padding: 15px 40px;
    border: none;
    border-radius: 30px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    outline: none;
    position: relative;
    overflow: hidden;
}

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

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.4);
}

.btn-secondary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.6);
}

/* 职业选择区域 */
#step-profession h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.profession-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.profession-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 4px solid #e0e0e0;
    border-radius: 20px;
    padding: 25px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.profession-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.profession-card:hover::before {
    opacity: 1;
}

.profession-card:hover {
    transform: translateY(-10px) rotate(2deg);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.profession-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea25 0%, #764ba225 100%);
    transform: scale(1.15) rotate(-3deg);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.5);
    animation: selectedPulse 1s ease-in-out infinite;
}

@keyframes selectedPulse {
    0%, 100% {
        box-shadow: 0 20px 40px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 20px 40px rgba(118, 75, 162, 0.6);
    }
}

.profession-icon {
    font-size: 3.5em;
    margin-bottom: 12px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

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

.profession-card:hover .profession-icon {
    transform: scale(1.2);
    animation: none;
}

.profession-name {
    font-size: 1em;
    color: #333;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

#confirm-selection, #back-to-camera {
    display: block;
    margin: 10px auto;
    min-width: 200px;
}

/* 加载动画 */
.loading-container {
    text-align: center;
    padding: 60px 40px;
}

.loading-spinner {
    display: none;
}

.loading-container h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-container p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

/* 进度条 */
.progress-bar-container {
    width: 100%;
    max-width: 500px;
    height: 30px;
    background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 100%);
    border-radius: 15px;
    margin: 20px auto;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 15px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.5);
}

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

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

.progress-text {
    text-align: center;
    margin-top: 15px;
    font-size: 1.2em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 过场动画区域 */
.transition-container {
    padding: 40px 20px;
    text-align: center;
}

.transition-title {
    font-size: 2em;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titlePulse 2s ease-in-out infinite;
}

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

.transition-photos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    max-width: 1000px;
    margin: 0 auto;
}

.transition-photo-wrapper {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

.photo-label {
    font-size: 1.3em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.transition-photo {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    border: 4px solid white;
    animation: photoFadeIn 1s ease-out;
}

@keyframes photoFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.transition-effect {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    position: relative;
}

.magic-particles {
    width: 60px;
    height: 60px;
    position: relative;
    animation: rotate360 3s linear infinite;
}

.magic-particles::before,
.magic-particles::after {
    content: '✨';
    position: absolute;
    font-size: 2em;
    animation: sparkle 1.5s ease-in-out infinite;
}

.magic-particles::before {
    top: -10px;
    left: -10px;
}

.magic-particles::after {
    bottom: -10px;
    right: -10px;
    animation-delay: 0.75s;
}

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

@keyframes sparkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.arrow-icon {
    font-size: 3em;
    color: #667eea;
    margin: 10px 0;
    animation: arrowBounce 1s ease-in-out infinite;
}

@keyframes arrowBounce {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(10px);
    }
}

/* 结果展示区域 */
#step-result h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.result-container {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeIn 0.8s ease-out;
}

#result-image {
    max-width: 100%;
    width: 640px;
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 30px rgba(102, 126, 234, 0.4);
    border: 5px solid white;
    transition: transform 0.3s ease;
}

#result-image:hover {
    transform: scale(1.02);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4), 0 0 40px rgba(102, 126, 234, 0.6);
    cursor: pointer;
}

.image-hint {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9em;
    color: #999;
    animation: hintBlink 2s ease-in-out infinite;
}

.result-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 全屏图片查看器 */
.fullscreen-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
    cursor: pointer;
}

.fullscreen-close {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 3em;
    color: white;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10000;
}

.fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

#fullscreen-image {
    max-width: 95%;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.4s ease-out;
}

@keyframes zoomIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.fullscreen-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.2em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: hintBlink 2s ease-in-out infinite;
}

/* 二维码弹窗 */
.qrcode-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.qrcode-content {
    background: white;
    border-radius: 30px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.qrcode-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 2em;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.qrcode-close:hover {
    background: #f0f0f0;
    color: #333;
    transform: rotate(90deg);
}

.qrcode-content h3 {
    margin-bottom: 30px;
    font-size: 1.8em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.qrcode-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 256px;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
}

.qrcode-container canvas,
.qrcode-container img {
    max-width: 100%;
    height: auto;
}

.qrcode-tip {
    color: #666;
    font-size: 1em;
    margin-top: 20px;
    line-height: 1.6;
}

/* 错误提示 */
.error-message {
    background: #ff4444;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* 页脚 */
.footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    text-align: center;
    color: white;
    font-size: 1em;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '⭐';
    position: absolute;
    left: 10%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    animation: twinkle 2s infinite;
}

.footer::after {
    content: '⭐';
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    animation: twinkle 2s infinite 1s;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: translateY(-50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.2);
    }
}

/* 微信二维码弹窗 */
.wechat-qrcode-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 256px;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 20px;
}

.wechat-qrcode-wrapper img {
    max-width: 256px;
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        border-radius: 20px;
    }

    .header h1 {
        font-size: 2em;
    }

    .camera-container {
        max-width: 100%;
    }

    #result-image {
        width: 100%;
    }

    .profession-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .profession-card {
        padding: 15px 10px;
    }

    .profession-icon {
        font-size: 2.5em;
    }

    .btn {
        padding: 12px 30px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5em;
    }

    .header::before,
    .header::after {
        font-size: 2em;
    }

    .profession-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .loading-container h2 {
        font-size: 1.4em;
    }

    .progress-bar-container {
        max-width: 100%;
    }

    .countdown-number {
        font-size: 6em;
    }

    .countdown-hint {
        font-size: 1.2em;
        margin-top: 20px;
    }
}
