/* Global Styles */
:root {
    --primary-color: #4a6fa5;
    --secondary-color: #6c757d;
    --accent-color: #28a745;
    --background-color: #f8f9fa;
    --text-color: #333;
    --border-color: #dee2e6;
    --message-bg-user: #e9f5ff;
    --message-bg-system: #f0f0f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Main Content Styles */
main {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    flex: 1;
    margin: 20px 0;
}

/* Chat Container Styles */
.chat-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: 70vh;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    padding: 0;           /* 去掉多余内边距 */
    margin: 5px 0;
  }

.chat-messages .message {
    display: flex;        /* 变成 flex 容器 */
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
  }
/* 然后让内容区域跑满剩余空间 */
.chat-messages .message .message-content {
    flex: 1 1 auto;       /* 拉伸填满父容器 */
    max-width: 100%;
    box-sizing: border-box;
  }

.message.user {
    align-items: flex-end;
}

/* 灰色内容块铺满 parent */
.chat-messages .message-content {
    display: block;
    width: 100%;
    box-sizing: border-box; /* padding 不会撑破宽度 */
    background-color: #f0f0f0;  /* 灰色背景 */
    padding: 8px 12px;      /* 根据喜好调整内边距 */
    border-radius: 4px;
    word-break: break-word; /* 内容太长可以换行 */
  }

.message.system .message-content {
    background-color: var(--message-bg-system);
    border-radius: 12px 12px 12px 0;
}

.message.user .message-content {
    background-color: var(--message-bg-user);
    border-radius: 12px 12px 0 12px;
    color: #333;
}

.message-content p {
    margin-bottom: 8px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.user-input {
    display: flex;
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.user-input textarea {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    resize: none;
    height: 50px;
    font-family: inherit;
    font-size: 0.95rem;
}

.user-input button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-input button:hover {
    background-color: #3a5a8a;
}

#resetButton {
    background-color: var(--secondary-color);
}

#resetButton:hover {
    background-color: #5a6268;
}

/* Status Panel Styles */
.status-panel {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.status-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
}

.status-header h3 {
    font-size: 1.2rem;
    font-weight: 500;
}

.status-content {
    padding: 15px;
}

.status-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.status-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.status-label {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.status-value {
    font-size: 0.95rem;
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 15px 0;
    color: var(--secondary-color);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--secondary-color);
}

.modal h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95rem;
}

.form-group input[type="range"] {
    width: calc(100% - 40px);
    vertical-align: middle;
}

#temperatureValue {
    display: inline-block;
    width: 30px;
    text-align: right;
    margin-left: 5px;
}

.submit-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 10px;
}

.submit-button:hover {
    background-color: #218838;
}

/* Responsive Styles */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }

    .chat-container {
        height: 60vh;
    }
}

/* 在你的style.css中添加以下样式 */

/* Task items styling */
.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
    transition: all 0.2s ease;
}

.task-item:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.task-item.completed {
    border-left-color: #28a745;
    background: #d4edda;
    opacity: 0.8;
    color: #6c757d;
}

.task-item.running {
    border-left-color: #ffc107;
    background: #fff3cd;
}

.task-content {
    flex: 1;
}

.task-name {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.task-description {
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
}

.task-status {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
    text-transform: uppercase;
    margin-left: 8px;
}

.status-pending {
    background: #6c757d;
    color: white;
}

.status-running {
    background: #ffc107;
    color: #212529;
}

.status-completed {
    background: #28a745;
    color: white;
}

.task-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.task-item:hover .task-actions {
    opacity: 1;
}

.task-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.complete-btn {
    background: #28a745;
    color: white;
}

.complete-btn:hover {
    background: #218838;
    transform: scale(1.1);
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Notification styling */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(100%);
    animation: slideIn 0.3s ease forwards;
}

.notification-success {
    background: #28a745;
}

.notification-error {
    background: #dc3545;
}

.notification-info {
    background: #17a2b8;
}

.notification.fade-out {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

@keyframes slideOut {
    to {
        transform: translateX(100%);
    }
}

/* Empty state */
#subtaskList li[style*="italic"] {
    text-align: center;
    padding: 20px;
    border: 2px dashed #ddd;
    border-radius: 6px;
    margin: 10px 0;
}

#terminalOutput {
    white-space: pre-wrap;
  }

/* 让 fullspan 时横跨所有格子，并置顶 */
.panel.fullspan {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    z-index: 10;
  }
  
  /* 隐藏非目标 panel */
  .panel.hidden {
    display: none;
  }

/* 保证 dashboard-right 区域本身可以接收事件 */
.dashboard-right {
    position: relative;
    pointer-events: auto;
  }
  
/* 1. Panel 不裁剪其子元素（包括 header 溢出） */
.panel {
    position: relative;
    overflow: visible !important;
    z-index: 1;
  }
  
  /* 2. Header 保证在最上层并使用 Flex 布局 */
  .panel-header {
    position: relative;      /* 参照系，供绝对定位的按钮使用 */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: #fafafa;
    z-index: 100;            /* 压过 iframe 等内容 */
  }
  
  /* ----------------------------
     全屏按钮样式
     ---------------------------- */
  
  /* 3. 按钮绝对定位到 header 右上角 */
  .fs-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
  
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
  
    z-index: 101;            /* 高于 header 本身 */
    pointer-events: auto;
  }
  
  /* 4. Hover 反馈 */
  .fs-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
  }