body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #e2e8f0;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1, #8b5cf6);
    z-index: -1;
    border-radius: 0 0 30px 30px;
}

.container {
    display: flex;
    gap: 24px;
    margin: 40px auto;
    max-width: 1300px;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.main-content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 2;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(2, 8, 20, 0.4);
    overflow: hidden;
}

.main-content {
    flex: 2;
    padding: 24px;
}

.sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        margin: 20px auto;
    }
    
    body::before {
        height: 200px;
    }
}

h1 {
    color: #ffffff;
    text-align: center;
    margin: 0 0 30px 0;
    font-weight: 700;
    font-size: 38px;
    font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
    letter-spacing: -0.5px;
    position: relative;
    padding-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #0ea5e9, #8b5cf6);
    border-radius: 2px;
}

#chatLog {
    height: 600px;
    overflow-y: auto;
    border: none;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 0px;
    background: rgba(15, 23, 42, 0.6);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
    scrollbar-width: thin;
    scrollbar-color: #475569 #1e293b;
}

#chatLog::-webkit-scrollbar {
    width: 8px;
}

#chatLog::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 4px;
}

#chatLog::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

#chatLog::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* 以下聊天气泡样式保持不变 */
.user,
.ai,
.system {
    margin: 12px 0;
    word-wrap: break-word;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
}

.user {
    align-items: flex-end;
    transform: translateY(4px);
    opacity: 0;
    animation: messageAppear 0.4s ease forwards;
}

.ai {
    align-items: flex-start;
    transform: translateY(4px);
    opacity: 0;
    animation: messageAppear 0.4s ease forwards 0.1s;
}

.system {
    color: #cbd5e1;
    font-style: italic;
    text-align: center;
    margin: 15px auto;
    font-size: 0.85em;
    align-items: center;
}

.message-container {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    position: relative;
}

.user .message-container {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.ai .message-container {
    background: rgba(30, 41, 59, 0.7);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.8em;
    opacity: 0.8;
    gap: 8px;
}

.speaker-name {
    font-weight: 600;
    font-size: 0.85em;
}

.message-time {
    font-size: 0.75em;
    opacity: 0.7;
}

.message-content {
    font-size: 0.95em;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.user .message-header {
    color: rgba(255, 255, 255, 0.9);
}

.user .speaker-name {
    color: rgba(255, 255, 255, 0.95);
}

.user .message-time {
    color: rgba(255, 255, 255, 0.95);
}

.ai .message-header {
    color: #94a3b8;
}

.ai .speaker-name {
    color: #e2e8f0;
}

.ai .message-time {
    color: #e2e8f0;
}

.timer-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(2, 8, 20, 0.3);
}

#chatTimer {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 1.3em;
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 1px;
}

.controls {
    display: flex;
    gap: 8px;
    margin: 10px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.settings-panel {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 0;
    box-shadow: 0 4px 20px rgba(2, 8, 20, 0.3);
}

.settings-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}

.settings-label {
    width: 120px;
    font-weight: 500;
    color: #cbd5e1;
    font-size: 0.9em;
}

.settings-input {
    flex-grow: 0;
    width: 50px;
    padding: 8px 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.5);
    color: #e2e8f0;
    transition: all 0.2s ease;
}

.settings-input option {
    background: #1e293b;
    color: #e2e8f0;
}

.settings-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

button {
    min-width: 80px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-weight: 600;
    font-size: 0.95em;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
    position: relative;
    overflow: hidden;
}

button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

button:hover::after {
    transform: translateX(100%);
}

button:disabled {
    background: #475569;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

button:disabled::after {
    display: none;
}

#endBtn:not(:disabled) {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

#endBtn:not(:disabled):hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.input-area {
    display: flex;
    gap: 12px;
    margin-top: 1px;
}

#userInput {
    flex-grow: 1;
    padding: 16px 20px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: rgba(15, 23, 42, 0.5);
    color: #e2e8f0;
    box-shadow: 0 4px 10px rgba(2, 8, 20, 0.2);
}

#userInput:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
    background: rgba(15, 23, 42, 0.7);
}

#typingIndicator {
    animation: pulse 1.5s infinite;
    color: #94a3b8;
    font-size: 0.9em;
    margin: 10px 0;
}

@keyframes messageAppear {
    from {
        transform: translateY(8px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}