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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft JhengHei', sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    padding: 0;
    overflow: hidden;
}

.container {
    max-width: 100%;
    height: 100vh;
    margin: 0 auto;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.header {
    background: #1a1a1a;
    color: #fff;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(46, 142, 255, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-content h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #fff;
}

.subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.user-profile {
    width: 131px;
    height: 51px;
    border-radius: 15px;
    cursor: pointer;
    transition: 0.3s ease;
    background: linear-gradient(
        to bottom right,
        #2e8eff 0%,
        rgba(46, 142, 255, 0) 30%
    );
    background-color: rgba(46, 142, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile:hover,
.user-profile:focus {
    background-color: rgba(46, 142, 255, 0.7);
    box-shadow: 0 0 10px rgba(46, 142, 255, 0.5);
    outline: none;
}

.user-profile-inner {
    width: 127px;
    height: 47px;
    border-radius: 13px;
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    font-weight: 600;
}

.user-profile-inner svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user1-badge .user-profile {
    background: linear-gradient(
        to bottom right,
        #2e8eff 0%,
        rgba(46, 142, 255, 0) 30%
    );
    background-color: rgba(46, 142, 255, 0.2);
}

.user2-badge .user-profile {
    background: linear-gradient(
        to bottom right,
        #ff6b6b 0%,
        rgba(255, 107, 107, 0) 30%
    );
    background-color: rgba(255, 107, 107, 0.2);
}

.user2-badge .user-profile:hover {
    background-color: rgba(255, 107, 107, 0.7);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.loading-screen {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #1a1a1a;
}

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

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(46, 142, 255, 0.2);
    border-top-color: #2e8eff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
}

.loading-hint {
    font-size: 13px !important;
    color: rgba(255, 255, 255, 0.5) !important;
    margin-top: 10px;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #1a1a1a;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(
        to bottom right,
        rgba(46, 142, 255, 0.1) 0%,
        rgba(46, 142, 255, 0) 50%
    );
    border-bottom: 1px solid rgba(46, 142, 255, 0.2);
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.welcome-message h2 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 22px;
}

.welcome-message p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #1a1a1a;
}

.message {
    margin-bottom: 20px;
}

.message-user {
    display: flex;
    justify-content: flex-end;
}

.message-agent {
    display: flex;
    justify-content: flex-start;
}

.message-bubble {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 20px;
    word-wrap: break-word;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: messagePop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes messagePop {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.message-bubble:hover .message-copy-btn {
    opacity: 1;
}

.message-copy-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 4px;
    padding: 4px 6px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.message-copy-btn:hover {
    background: rgba(0, 0, 0, 0.5);
}

.message-user .message-bubble {
    background: linear-gradient(
        to bottom right,
        #2e8eff 0%,
        rgba(46, 142, 255, 0.8) 100%
    );
    color: white;
    border-bottom-right-radius: 6px;
    box-shadow: 0 4px 12px rgba(46, 142, 255, 0.4);
}

.message-agent .message-bubble {
    background: #2a2a2a;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(46, 142, 255, 0.2);
    border-bottom-left-radius: 6px;
}

.message-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
    padding: 0 4px;
}

.message-user .message-time {
    text-align: right;
}

.message-agent .message-time {
    text-align: left;
}

.conclusion-panel {
    background: linear-gradient(
        to bottom right,
        rgba(255, 193, 7, 0.15) 0%,
        rgba(255, 193, 7, 0.05) 100%
    );
    border: 1px solid rgba(255, 193, 7, 0.3);
    padding: 20px;
    margin: 0 20px 20px 20px;
    border-radius: 15px;
    animation: slideDown 0.5s ease;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

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

.conclusion-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.conclusion-icon {
    font-size: 24px;
}

.conclusion-header h3 {
    color: rgba(255, 193, 7, 0.9);
    font-size: 18px;
    font-weight: 600;
}

.conclusion-content {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    white-space: pre-wrap;
    font-size: 15px;
}

.input-area {
    padding: 15px 20px;
    background: #1a1a1a;
    border-top: 1px solid rgba(46, 142, 255, 0.2);
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 10px;
}

.voice-button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #2a2a2a;
    border: 2px solid rgba(46, 142, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.voice-button:hover {
    background: rgba(46, 142, 255, 0.2);
    border-color: rgba(46, 142, 255, 0.5);
    color: #fff;
}

.voice-button.recording {
    background: rgba(220, 53, 69, 0.3);
    border-color: #dc3545;
    color: #dc3545;
    animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
}

.input-wrapper textarea {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(46, 142, 255, 0.2);
    border-radius: 20px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    transition: all 0.3s;
    max-height: 120px;
    background: #2a2a2a;
    color: #fff;
}

.input-wrapper textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-wrapper textarea:focus {
    outline: none;
    border-color: #2e8eff;
    box-shadow: 0 0 0 3px rgba(46, 142, 255, 0.2);
    background: #2f2f2f;
}

.send-button {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(
        to bottom right,
        #2e8eff 0%,
        rgba(46, 142, 255, 0.8) 100%
    );
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(46, 142, 255, 0.3);
}

.send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(46, 142, 255, 0.6);
    background: linear-gradient(
        to bottom right,
        #2e8eff 0%,
        rgba(46, 142, 255, 1) 100%
    );
}

.send-button:active {
    transform: scale(0.95);
}

.btn-share {
    flex: 1;
    padding: 12px;
    border: 2px solid rgba(46, 142, 255, 0.3);
    border-radius: 12px;
    background: rgba(46, 142, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-share:hover {
    background: rgba(46, 142, 255, 0.2);
    border-color: rgba(46, 142, 255, 0.5);
    box-shadow: 0 0 10px rgba(46, 142, 255, 0.3);
}

.btn-conclusion {
    flex: 1;
    padding: 12px;
    border: 2px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    background: rgba(255, 193, 7, 0.1);
    color: rgba(255, 193, 7, 0.9);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-conclusion:hover {
    background: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.5);
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-export {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(46, 142, 255, 0.3);
    border-radius: 10px;
    background: rgba(46, 142, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 18px;
}

.btn-export:hover {
    background: rgba(46, 142, 255, 0.2);
    border-color: rgba(46, 142, 255, 0.5);
    transform: scale(1.05);
}

.emoji-toggle-button {
    width: 44px;
    height: 44px;
    border: 2px solid rgba(46, 142, 255, 0.3);
    border-radius: 50%;
    background: #2a2a2a;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
    font-size: 20px;
}

.emoji-toggle-button:hover {
    background: rgba(46, 142, 255, 0.2);
    border-color: rgba(46, 142, 255, 0.5);
}

.emoji-picker-container {
    position: relative;
    margin-bottom: 10px;
}

.emoji-picker {
    background: #2a2a2a;
    border: 1px solid rgba(46, 142, 255, 0.3);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
}

.emoji-btn {
    background: rgba(46, 142, 255, 0.1);
    border: 1px solid rgba(46, 142, 255, 0.2);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
}

.emoji-btn:hover {
    background: rgba(46, 142, 255, 0.3);
    transform: scale(1.2);
}

.status-bar {
    padding: 10px 20px;
    background: #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(46, 142, 255, 0.2);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.stats-info {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.stats-info strong {
    color: #2e8eff;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc3545;
    animation: pulse 2s infinite;
    box-shadow: 0 0 5px rgba(220, 53, 69, 0.5);
}

.status-indicator.connected {
    background: #28a745;
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.5);
}

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

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(46, 142, 255, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(46, 142, 255, 0.5);
}

.system-message {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-style: italic;
    padding: 10px;
    margin: 15px 0;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    margin: 10px 0;
    animation: fadeIn 0.3s ease;
}

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

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(46, 142, 255, 0.6);
    animation: typingDot 1.4s infinite;
}

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

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.typing-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-style: italic;
}

.progress-bar-container {
    padding: 15px 20px;
    background: rgba(46, 142, 255, 0.05);
    border-top: 1px solid rgba(46, 142, 255, 0.2);
    animation: slideDown 0.3s ease;
}

.progress-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(46, 142, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2e8eff 0%, rgba(46, 142, 255, 0.8) 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(46, 142, 255, 0.5);
    width: 0%;
}

.celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #2e8eff;
    animation: confettiFall 3s linear forwards;
}

.confetti:nth-child(2n) { background: #ff6b6b; animation-delay: 0.1s; }
.confetti:nth-child(3n) { background: #ffc107; animation-delay: 0.2s; }
.confetti:nth-child(4n) { background: #28a745; animation-delay: 0.3s; }

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
    }
    
    .header-content h1 {
        font-size: 20px;
    }
    
    .subtitle {
        font-size: 12px;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .input-area {
        padding: 12px 15px;
    }
}
