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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 启动页面 */
.start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.start-container {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
}

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

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

.start-container h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}

.start-hint {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
}

.start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 18px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

/* 麦克风授权页面 */
.microphone-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.microphone-container {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
}

.microphone-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.microphone-container h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 10px;
}

.microphone-hint {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.5;
}

.authorize-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-bottom: 15px;
    width: 100%;
}

.authorize-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.skip-btn {
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
    padding: 12px 40px;
    font-size: 16px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.skip-btn:hover {
    border-color: #999;
    color: #333;
}

/* 选择客服页面 */
.agent-selection-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
}

.agent-selection-container {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    margin: 20px auto;
}

.agent-selection-container h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 10px;
}

.agent-hint {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
}

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

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading p {
    color: #666;
    font-size: 16px;
}

/* 客服列表 */
.agent-list {
    display: grid;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.agent-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.agent-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.agent-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.agent-info {
    flex: 1;
    text-align: left;
}

.agent-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.agent-status {
    font-size: 14px;
    color: #28a745;
}

.agent-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    margin-right: 5px;
    animation: pulse 2s infinite;
}

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

/* 无客服在线 */
.no-agents {
    text-align: center;
    padding: 40px 0;
}

.no-agents-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.no-agents p {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
}

.refresh-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 40px;
    font-size: 16px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .start-container,
    .microphone-container,
    .agent-selection-container {
        padding: 30px 20px;
    }

    .start-icon,
    .microphone-icon {
        font-size: 60px;
    }

    .start-container h2,
    .microphone-container h2,
    .agent-selection-container h2 {
        font-size: 22px;
    }
}

/* 二维码区域 */
.qrcode-area {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    border: 2px dashed #667eea;
}

.qrcode-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    margin-bottom: 15px;
}

.qrcode-box img {
    max-width: 200px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.qrcode-url-hint {
    color: #666;
    font-size: 14px;
    text-align: center;
    margin: 0;
}

/* 排队状态页面 */
.queue-status {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.queue-container {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
}

.queue-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: rotate 2s linear infinite;
}

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

.queue-title {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
    font-weight: 600;
}

.agent-status {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    padding: 10px 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 50px;
    display: inline-flex;
}

.agent-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.agent-dot.online {
    background: #4caf50;
    box-shadow: 0 0 10px #4caf50;
    animation: pulse 2s infinite;
}

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

.agent-text {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
}

.queue-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
}

.queue-item {
    text-align: center;
}

.queue-item-label {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.queue-item-value {
    color: #667eea;
    font-size: 28px;
    font-weight: bold;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    animation: bounce-dots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce-dots {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.cancel-queue-btn {
    background: transparent;
    color: #f44336;
    border: 2px solid #f44336;
    padding: 12px 40px;
    font-size: 16px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.cancel-queue-btn:hover {
    background: #f44336;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}
