body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px 24px;
    background-color: #f8f9fa;
    color: #1c1c1e;
    line-height: 1.5;
}

.container {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

.sidebar {
    flex: 1;
    min-width: 350px;
    max-width: 400px;
}

.main-content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 2;
    min-width: 700px;
    max-width: 900px;
    height: 600px;
    margin-right: 30px;
}

.main-content {
    flex: 2;
}

.supervisor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    min-width: 350px;
    max-width: 400px;
    overflow: hidden;
    height: 650px;
    max-height: calc(100vh - 100px);
}

.panel-controls-bar {
    display: flex;
    gap: 5px;
    padding: 10px 15px;
    background-color: #f5f5f7;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

.supervisor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f5f5f7;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0; 
}

.supervisor-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #2c3e50;
}

.supervisor-header button {
    padding: 8px 12px;
    font-size: 0.9em;
    min-width: 60px;
    width: auto;
}

.supervisor-content {
    flex: 2; /* 占据剩余空间 */
    padding: 15px;
    overflow-y: auto;
    min-height: 0; 
    transition: flex 0.3s ease;
}

#analysisResults {
    font-size: 0.9em;
    line-height: 1.4;
    white-space: pre-wrap;
}

.advisor-prompt-header {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 15px;
    background-color: #f5f5f7;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px; 
}

.supervisor-header .header-actions {
    gap: 5px;
}

.panel-controls {
    display: flex;
    gap: 5px;
    width: 100%;
}

.panel-toggle-btn {
	flex: 1;
    padding: 6px;
    font-size: 0.9em;
    min-width: auto;
    width: auto;
    background-color: #e0e0e0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.panel-toggle-btn:hover {
    background-color: #d0d0d0;
}

.panel-toggle-btn.active {
    background-color: #0a84ff;
    color: white;
    border-color: #0a84ff;
}

.advisor-prompt-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #2c3e50;
}

#refreshAdvisorBtn {
    padding: 8px 12px;
    font-size: 0.9em;
    min-width: 60px;
    width: auto;
    
}

#refreshAdvisorBtn:hover {
    background-color: #3a5a9f;
}

/* 开关样式 */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 8px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #0a84ff;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.toggle-label {
    font-size: 0.85em;
    color: #555;
    white-space: nowrap;
}

/* 探索关键词输入控制 */
.input-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.input-control label {
    font-size: 0.85em;
    color: #555;
    white-space: nowrap;
    margin: 0;
}

.input-control input {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85em;
    width: 100px;
}

.advisor-prompt-content {
    flex: 1; 
    padding: 15px;
    overflow-y: auto;
    min-height: 0; 
    height: auto; 
    transition: flex 0.3s ease;
}

#advisorPromptResults {
    font-size: 0.9em;
    line-height: 1.4;
    white-space: pre-wrap;
}

/* Panel visibility and sizing */
#analyzePanel.hidden {
    display: none;
}

#ideasPanel.hidden {
    display: none;
}

#analyzePanel.analyze-only {
    flex: 1;
}

#ideasPanel.ideas-only {
    flex: 1;
}

.supervisor-panel.analyze-only {
    height: 650px;
}

.supervisor-panel.ideas-only {
    height: 650px;
}

@media (max-width: 1400px) {
    .container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sidebar,
    .main-content-wrapper,
    .supervisor-panel,
    .advisor-prompt-panel {
        width: 100%;
        min-width: auto;
        max-width: 100%;
    }
    
    .main-content-wrapper {
        margin-right: 0;
        margin-bottom: 20px;
        order: 2;
    }
    
    .supervisor-panel {
        order: 3;
    }
    
    .advisor-prompt-panel {
        order: 4; 
    }
    
    .sidebar {
        order: 1;
    }
}

h1 {
    color: #2c3e50;
    text-align: center;
    margin: 10px 0;
    font-weight: 650;
    letter-spacing: -0.8px;
    font-size: 42px;
    font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    padding-bottom: 15px;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2c3e50);
    border-radius: 3px;
}

#chatLog {
    min-height: 500px;
    height: 580px;
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.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: #757575;
    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;
}

/* 用户(Advisor)消息气泡 */
.user .message-container {
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

/* AI(Client)消息气泡 */
.ai .message-container {
    background: #FFFFFF;
    color: #1C1C1E;
    border: 1px solid #E5E5EA;
    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: 4px;
}

.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消息的头部和时间颜色 */
.ai .message-header {
    color: #8E8E93;
}

.ai .speaker-name {
    color: #1C1C1E;
}

.ai .message-time {
    color: #1C1C1E;
}

.timer-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 12px;
    background-color: #f5f5f7;
    border-radius: 8px;
}

#chatTimer {
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    color: #2c3e50;
    font-weight: 500;
}

.controls {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    margin-bottom: 15px;
    justify-content: center;
}

.settings-panel {
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.settings-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 10px;
}

.settings-label {
    width: 120px;
    font-weight: 500;
}

.settings-input {
    flex-grow: 0;
    width: 50px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    min-width: 70px;
    width: auto;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background-color: #0a84ff;
    color: white;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(10, 132, 255, 0.16);
}

button:hover {
    background-color: #3a5a9f;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#endBtn:not(:disabled) {
    background-color: #ff3b30;
}

#endBtn:not(:disabled):hover {
    background-color: #d70015;
}

.input-area {
    display: flex;
    gap: 10px;
}

#userInput {
    flex-grow: 1;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.2s ease;
    background: #ffffff;
}

#userInput:focus {
    outline: none;
    border-color: #0a84ff;
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.12);
}

#typingIndicator {
    animation: pulse 1.5s infinite;
}

@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;
    }
}