/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 动态背景效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: 50px 50px;
    animation: backgroundMove 20s linear infinite;
    pointer-events: none;
    z-index: -1;
}

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

/* 页面容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

/* 页眉样式 */
header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    padding: 25px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    animation: headerSlideDown 0.8s ease;
}

@keyframes headerSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

header h1 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 3px;
    animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
    from { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); }
    to { text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 255, 255, 0.6); }
}

/* 主内容样式 */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    margin-top: 40px;
    animation: contentFadeIn 1s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

/* 回调区域样式 */
#callback-section {
    margin-bottom: 30px;
}

#callback-section h2 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, #667eea, #764ba2) 1;
    position: relative;
}

#callback-section h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    animation: borderExpand 1s ease forwards;
}

@keyframes borderExpand {
    from { width: 0; }
    to { width: 100px; }
}

#callback-section p {
    color: #555;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* WebSocket连接状态样式 */
.connection-status {
    padding: 15px 20px;
    border-radius: 10px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.connection-status.connected {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
    border: 2px solid #38ef7d;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(56, 239, 125, 0.3); }
    50% { box-shadow: 0 4px 25px rgba(56, 239, 125, 0.6); }
}

.connection-status.disconnected {
    background: linear-gradient(135deg, #eb3349, #f45c43);
    color: white;
    border: 2px solid #f45c43;
}

.connection-status {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: 2px solid #764ba2;
}

/* 演示区域样式 */
.demo-area {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 30px;
    margin-top: 25px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.demo-area p {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 500;
}

/* 按钮样式 */
button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.6);
}

button:active {
    transform: translateY(0) scale(0.98);
}

/* 页脚样式 */
footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

footer p {
    font-weight: 500;
    letter-spacing: 1px;
}

/* 祝贺页面样式 */
#congratulation-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow: hidden;
    animation: pageFadeIn 0.5s ease;
}

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

/* 成功横幅样式 */
.success-banner {
    background: linear-gradient(135deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
    background-size: 400% 400%;
    color: white;
    padding: 30px 50px;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: bannerGradient 3s ease infinite, bannerFloat 3s ease-in-out infinite;
}

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

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

.success-banner h1 {
    margin: 0;
    font-size: 3em;
    font-weight: 800;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.4);
    letter-spacing: 3px;
    animation: titleBounce 2s ease-in-out infinite;
}

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

.congratulation-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 50px;
    text-align: center;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    animation: contentSlideUp 0.8s ease;
    position: relative;
    overflow: hidden;
}

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

.congratulation-content::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%);
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 销售员照片区域样式 */
.salesperson-photo-container {
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.photo-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.5);
    animation: photoFloat 3s ease-in-out infinite;
}

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

.salesperson-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #fff;
    transition: transform 0.3s ease;
}

.salesperson-photo:hover {
    transform: scale(1.1);
}

.photo-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(102, 126, 234, 0.4), transparent, rgba(118, 75, 162, 0.4), transparent);
    animation: rotate 4s linear infinite;
    pointer-events: none;
}

.salesperson-name {
    font-size: 1.5em;
    font-weight: 700;
    color: #667eea;
    margin: 10px 0;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    letter-spacing: 2px;
}

.congratulation-content h2 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 20px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.congratulation-content p {
    color: #555;
    font-size: 1.2em;
    line-height: 1.8;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

/* 订单详情样式 */
.order-details {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 25px;
    margin: 25px 0;
    border-left: 5px solid #667eea;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    animation: detailsFadeIn 0.5s ease 0.3s both;
}

@keyframes detailsFadeIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.order-details p {
    margin: 12px 0;
    text-align: left;
    font-size: 1.1em;
    color: #333;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.order-details p::before {
    content: '✓';
    color: #667eea;
    margin-right: 10px;
    font-weight: bold;
}

.order-details strong {
    color: #667eea;
    min-width: 100px;
    display: inline-block;
    font-weight: 700;
}

/* 倒计时样式 */
.countdown-container {
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    position: relative;
    z-index: 1;
}

.countdown-text {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    letter-spacing: 1px;
}

#countdown {
    font-size: 1.8em;
    font-weight: 800;
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 20px;
    border-radius: 10px;
    margin: 0 8px;
    display: inline-block;
    min-width: 60px;
    animation: countdownPulse 1s ease-in-out infinite;
}

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

/* 返回按钮样式 */
#back-to-main {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 35px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 25px;
    letter-spacing: 2px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
    position: relative;
    z-index: 1;
}

#back-to-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

#back-to-main:hover::before {
    left: 100%;
}

#back-to-main:hover {
    transform: translateY(-5px) scale(1.08);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.7);
}

#back-to-main:active {
    transform: translateY(0) scale(0.98);
}

#congratulation-page.hidden {
    display: none;
}

/* 彩带动画样式 */
.confetti {
    position: absolute;
    pointer-events: none;
    z-index: 2;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }
    
    .main-content {
        padding: 30px 20px;
        margin-top: 30px;
    }
    
    .congratulation-content {
        padding: 35px 25px;
        max-width: 90%;
    }
    
    .congratulation-content h2 {
        font-size: 2rem;
    }
    
    .congratulation-content p {
        font-size: 1rem;
    }
    
    .success-banner h1 {
        font-size: 2rem;
    }
    
    button {
        padding: 12px 25px;
        font-size: 1rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

/* 加载提示样式 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 20px;
    font-size: 1.2rem;
    color: #667eea;
    font-weight: 600;
}
