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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    height: 100vh;
}

.whiteboard-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background: #f0f2f5;
}

/* 工具栏样式优化 */
.toolbar {
    background: #ffffff;
    padding: 16px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 100;
    border-bottom: 1px solid #e8e8e8;
}

.toolbar h2 {
    margin-bottom: 12px;
    color: #1a1a1a;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.toolbar-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.session-info, .draw-tools, .background-tools, .recording-tools, .audio-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.session-info label, .draw-tools label, .recording-tools label, .background-tools label, .audio-tools label {
    font-size: 13px;
    color: #495057;
    white-space: nowrap;
    font-weight: 500;
}

.session-info input[type="number"],
.session-info input[type="text"],
.session-info select,
.background-url-input {
    padding: 8px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 13px;
    width: 120px;
    background: #ffffff;
    transition: all 0.2s ease;
    color: #24292f;
}

.background-url-input {
    width: 300px;
    min-width: 200px;
}

.auth-token-input {
    width: 400px !important;
    min-width: 300px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.session-info input[type="number"]:focus,
.session-info input[type="text"]:focus,
.session-info select:focus,
.background-url-input:focus {
    outline: none;
    border-color: #409eff;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.1);
}

.draw-tools input[type="color"] {
    width: 44px;
    height: 36px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.draw-tools input[type="color"]:hover {
    border-color: #409eff;
    transform: scale(1.05);
}

.draw-tools input[type="range"] {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
}

.draw-tools input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #409eff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(64, 158, 255, 0.3);
    transition: all 0.2s ease;
}

.draw-tools input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #409eff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(64, 158, 255, 0.3);
    transition: all 0.2s ease;
}

.draw-tools input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 6px rgba(64, 158, 255, 0.4);
}

.draw-tools span {
    font-size: 13px;
    color: #6c757d;
    min-width: 40px;
}

/* 工具选择器样式 */
.tool-selector {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.tool-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
    position: relative;
}

.tool-btn::before {
    display: none;
}

.tool-btn:hover:not(:disabled) {
    background: #f0f2f5;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tool-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tool-btn.active .tool-icon {
    filter: brightness(0) invert(1);
}

.tool-btn:disabled {
    background: #f5f5f5;
    opacity: 0.5;
    cursor: not-allowed;
}

.tool-icon {
    font-size: 18px;
    line-height: 1;
}

/* 按钮样式优化 */
button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

button::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;
}

button:hover:not(:disabled)::before {
    width: 300px;
    height: 300px;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    box-shadow: none;
}

.recording-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: pulse 2s infinite;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.4);
}

.recording-btn:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    box-shadow: 0 4px 16px rgba(245, 87, 108, 0.5);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 87, 108, 0.7);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(245, 87, 108, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(245, 87, 108, 0);
    }
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #ffffff;
}

.canvas-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #ffffff;
    position: relative;
}

canvas {
    display: block;
    cursor: crosshair;
    width: 100%;
    height: 100%;
    touch-action: none;
}

/* 回放控制层优化 */
.playback-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 40px;
    z-index: 50;
}

.playback-controls {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    padding: 20px 30px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: #fff;
    min-width: 450px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.playback-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #e9ecef;
    font-weight: 500;
}

.playback-progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease;
}

.playback-progress-bar:hover {
    background: rgba(255, 255, 255, 0.3);
}

.playback-progress {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.playback-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.playback-actions button, .playback-actions select {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.playback-actions button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.playback-actions select {
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
}

.playback-actions select option {
    background: #1a1a1a;
    color: #fff;
}

/* 状态栏优化 */
.status-bar {
    background: #ffffff;
    padding: 12px 24px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: #6c757d;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

.status-bar span {
    white-space: nowrap;
    padding: 4px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-weight: 500;
}

.recording-indicator {
    color: #f5576c;
    font-weight: 600;
    animation: blink 1s infinite;
    background: #fff5f5 !important;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* 聊天面板样式优化 */
.chat-panel {
    width: 360px;
    height: 100%;
    background: #ffffff;
    border-left: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.08);
}

.chat-panel-collapsed {
    transform: translateX(100%);
    border-left: none;
}

.chat-panel-collapsed .chat-content {
    display: none;
}

.chat-toggle-button {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 12px 0 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: -4px 0 16px rgba(102, 126, 234, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
}

.chat-toggle-button:hover {
    transform: translateY(-50%) translateX(-4px);
    box-shadow: -6px 0 20px rgba(102, 126, 234, 0.4);
}

.chat-toggle-button .chat-toggle-icon {
    font-size: 22px;
}

.chat-toggle-button .chat-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: #fff;
    border-radius: 12px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.4);
    border: 2px solid #fff;
}

.chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    user-select: none;
    transition: all 0.2s ease;
}

.chat-header:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.chat-toggle-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.chat-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

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

.chat-message {
    margin-bottom: 12px;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}

.chat-message:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.chat-message-own {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-left: 4px solid #667eea;
}

.chat-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
}

.chat-message-user {
    font-weight: 600;
    color: #1a1a1a;
}

.chat-message-role {
    padding: 3px 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
}

.chat-message-own .chat-message-role {
    background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
}

.chat-message-time {
    color: #8c8c8c;
    margin-left: auto;
    font-size: 11px;
}

.chat-message-content {
    color: #24292f;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    gap: 10px;
    background: #ffffff;
}

.chat-input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.chat-input:focus {
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.chat-send-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.chat-send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.chat-send-btn:disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    box-shadow: none;
}

/* 滚动条样式优化 */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* 模态框样式优化 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.modal-header h3 {
    font-size: 18px;
    color: #1a1a1a;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #8c8c8c;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    color: #1a1a1a;
    background: #f0f0f0;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.recording-list {
    list-style: none;
}

.recording-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.recording-list li:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.recording-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.rec-info {
    display: flex;
    gap: 16px;
    align-items: center;
    flex: 1;
}

.rec-time {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}

.rec-duration {
    color: #6c757d;
    font-size: 13px;
}

.rec-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}

.status-recording {
    background: #fff5f5;
    color: #f5576c;
    border: 1px solid #ffd6d6;
}

.status-completed {
    background: #f0f9eb;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-aborted {
    background: #f5f5f5;
    color: #8c8c8c;
    border: 1px solid #d9d9d9;
}

.no-data {
    text-align: center;
    color: #8c8c8c;
    padding: 40px 20px;
    font-size: 14px;
}

.recording-tools button {
    margin-right: 8px;
}

.audio-tools button {
    margin-right: 8px;
}

.audio-btn {
    padding: 8px 16px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    background: #ffffff;
    color: #495057;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.audio-btn:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #adb5bd;
}

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

.audio-btn.audio-enabled {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-color: transparent;
}

.audio-btn.audio-enabled:hover:not(:disabled) {
    background: linear-gradient(135deg, #5568d3 0%, #653a8f 100%);
}

.audio-status {
    font-size: 12px;
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f8f9fa;
}

.audio-status.audio-on {
    color: #52c41a;
    background: #f0f9eb;
    border: 1px solid #b7eb8f;
}

.rec-audio-icon {
    font-size: 18px;
    margin-left: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.rec-actions button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 8px 16px;
    font-size: 13px;
}
