/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

/* 通用样式 */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.topbar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background-color: white;
    border-bottom: 1px solid #e8e8e8;
    height: 50px;
}

.menu-icon {
    margin-right: 15px;
    font-size: 20px;
    color: #333;
}

.module-name {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.nav-tab {
    margin-right: 10px;
    padding: 5px 10px;
    background-color: #f56c6c;
    color: white;
    border-radius: 4px;
    font-size: 12px;
}

.platform-tab {
    display: flex;
    align-items: center;
    margin-right: 10px;
    padding: 5px 10px;
    background-color: #fff;
    border: 1px solid #dcdfe6;
    color: #606266;
    border-radius: 4px;
    font-size: 12px;
}

.badge {
    position: relative;
}

.badge::after {
    content: "3";
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #f56c6c;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #606266;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #e0e0e0;
    margin-right: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 主容器 */
.main-container {
    display: flex;
    height: calc(100vh - 50px);
}

/* 左侧菜单 */
.left-sidebar {
    width: 200px;
    background-color: #24243e;
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-item {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.sidebar-item.active {
    background-color: #30305a;
    border-left: 3px solid #409eff;
}

.sidebar-item:hover {
    background-color: #30305a;
}

.sidebar-icon {
    margin-right: 8px;
    font-size: 16px;
    width: 20px;
}

/* 工作区 */
.workspace {
    display: flex;
    flex: 1;
    background-color: #fff;
    border-top: 1px solid #e8e8e8;
}

/* 图表列表区域 */
.chart-list {
    width: 200px;
    border-right: 1px solid #e8e8e8;
    overflow-y: auto;
    background-color: #f9f9f9;
}

.chart-list-header, .chat-header {
    padding: 12px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e8e8e8;
    background-color: #f9f9f9;
}

.chart-list-header {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* 按钮样式 */
.action-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.icon-btn {
    font-size: 18px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #606266;
}

.icon-btn:hover {
    color: #409eff;
    transform: scale(1.1);
}

.add-chart-btn, .refresh-btn, .clear-chat-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 18px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-item {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative;
    transition: all 0.3s ease;
}

.chart-item:hover {
    background-color: #f0f0f0;
}

.chart-item.active {
    background-color: #ecf5ff;
    color: #409eff;
}

.chart-item.published {
    background-color: #f0f9eb;
    border-left: 3px solid #67c23a;
}

.chart-item.unpublished {
    background-color: #fdf6ec;
    border-left: 3px solid #e6a23c;
}

.chart-item-icon {
    font-size: 18px;
    margin-right: 10px;
    flex-shrink: 0;
}

.chart-item-info {
    flex: 1;
    min-width: 0;
}

.chart-item-name {
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-item-location {
    font-size: 12px;
    color: #909399;
}

.chart-item-actions {
    display: none;
    margin-left: 5px;
    white-space: nowrap;
    flex-direction: row;
}

.chart-item:hover .chart-item-actions {
    display: flex;
}

.edit-btn, .delete-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 16px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-btn {
    color: #409eff;
}

.edit-btn:hover {
    transform: scale(1.1);
    color: #66b1ff;
}

.delete-btn {
    color: #f56c6c;
    margin-left: 5px;
}

.delete-btn:hover {
    transform: scale(1.1);
    color: #ff7e7e;
}

.btn-delete {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    background-color: #f56c6c;
    color: white;
    transition: all 0.3s;
}

.btn-delete:hover {
    background-color: #ff7e7e;
}

.warning {
    color: #f56c6c;
    font-weight: bold;
    margin-top: 8px;
}

/* 中心区域 */
.center-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.chart-preview, .data-preview {
    padding: 16px;
}

.chart-preview {
    border-bottom: 1px solid #e8e8e8;
}

.chart-preview-header, .data-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 12px;
    font-weight: bold;
    border-bottom: 1px solid #e8e8e8;
}

.chart-preview-header span, .data-preview-header span {
    font-size: 14px;
}

.refresh-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.refreshing {
    animation: rotate 1s linear infinite;
}

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

.chart-preview-content {
    width: 100%;
    height: 350px;
    background-color: #f5f7fa;
    border: 1px dashed #dcdfe6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #909399;
    padding: 10px;
    margin-bottom: 16px;
}

#chartContainer {
    width: 100%;
    height: 100%;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    border: 1px solid #ebeef5;
    padding: 8px 12px;
    text-align: left;
}

.data-table th {
    background-color: #f5f7fa;
}

/* 对话区域 */
.chat-area {
    width: 300px;
    border-left: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    background-color: #f9f9f9;
}

.chat-header-actions {
    display: flex;
    align-items: center;
}

.chat-header-actions button {
    margin-left: 8px;
}

.chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    margin-bottom: 8px;
    max-width: 90%;
}

.message.system {
    align-self: flex-start;
}

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

.message-content {
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    width: 100%;
}

.message.system .message-content {
    background-color: #ecf5ff;
    border: 1px solid #d9ecff;
}

.message.user .message-content {
    background-color: #f0f9eb;
    border: 1px solid #e1f3d8;
}

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

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

.message-content ul {
    padding-left: 15px;
    margin: 6px 0;
}

.chat-input {
    padding: 12px;
    border-top: 1px solid #e8e8e8;
}

textarea {
    width: 100%;
    height: 80px;
    padding: 8px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    resize: none;
}

.send-btn {
    width: 100%;
    background-color: #67c23a;
    color: white;
    border: none;
    padding: 8px;
    margin-top: 8px;
    border-radius: 4px;
    cursor: pointer;
}

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

.modal-content {
    background-color: #fff;
    width: 400px;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-modal {
    font-size: 24px;
    color: #909399;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

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

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

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
}

.modal-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
}

.btn-cancel, .btn-save {
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    font-size: 14px;
    margin-left: 10px;
}

.btn-cancel {
    background-color: #f5f7fa;
    border: 1px solid #dcdfe6;
    color: #606266;
}

.btn-save {
    background-color: #409eff;
    color: white;
}

/* 拖拽调整大小控制柄 */
.resize-handle, #previewResizeHandle {
    display: none;
} 