/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.header h1 {
    color: #1890ff;
    margin-bottom: 10px;
}

.tabs {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.tab {
    padding: 8px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab.active {
    color: #1890ff;
    border-bottom-color: #1890ff;
}

/* 配置区域样式 */
.config-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.version-info {
    color: #666;
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-primary {
    background: #1890ff;
    color: white;
    border-color: #1890ff;
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-danger {
    background: #ff4d4f;
    color: white;
    border-color: #ff4d4f;
}

/* 编辑器样式 */
.editor-container {
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    overflow: hidden;
}

.editor-header {
    background: #fafafa;
    padding: 10px 15px;
    border-bottom: 1px solid #d9d9d9;
    font-size: 14px;
    color: #666;
}

.editor {
    width: 100%;
    min-height: 400px;
    height: 400px;
    padding: 15px;
    border: none;
    outline: none;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
}

/* 编辑器工具栏样式 */
.editor-toolbar {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.editor-actions {
    display: flex;
    gap: 10px;
}

/* 配置标签样式 */
.config-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #d9d9d9;
}

.config-tab {
    padding: 12px 24px;
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    background: #f5f5f5;
    transition: all 0.3s;
    position: relative;
    top: 1px;
}

.config-tab.active {
    background: white;
    border-color: #d9d9d9;
    color: #1890ff;
}

.config-tab:hover {
    background: #e6f7ff;
}

.config-tab-description {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

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

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: auto;
    min-width: 700px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: visible;
}

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

.modal-title {
    font-size: 18px;
    font-weight: bold;
}

.close-btn {
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
    overflow: visible;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

/* 版本信息提示栏 */
.version-info-bar {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    display: flex;
    align-items: center;
}

.version-limit-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #656d76;
    font-size: 14px;
}

.info-icon {
    font-size: 16px;
    opacity: 0.8;
}

/* 版本表格样式优化 */
.version-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13px;
}

.version-table th,
.version-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.version-table th {
    background: #fafafa;
    font-weight: 600;
    color: #262626;
}

.version-table th:nth-child(1) {
    width: 200px; /* 增加版本列宽度 */
}

.version-table th:nth-child(2) {
    width: 160px;
}

.version-table th:nth-child(3) {
    width: 220px;
}

/* 变更备注单元格样式 */
.remark-cell {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

/* 表格行高优化 */
.version-table td {
    padding: 8px 8px;
    height: 40px;
    line-height: 24px;
    vertical-align: middle;
}

/* 版本显示优化 */
.version-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    height: 24px; /* 控制整体高度 */
}

.version-time {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    color: #262626;
    line-height: 24px; /* 与父容器对齐 */
}

.current-badge {
    background: #e6f4ff;
    color: #1677ff;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #91caff;
    white-space: nowrap;
    line-height: 16px; /* 减小行高 */
    display: inline-block;
    vertical-align: middle;
}

/* 操作按钮优化 - 清新配色 */
.version-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
}

.version-actions .btn {
    padding: 4px 10px;
    font-size: 12px;
    height: 26px;
    line-height: 16px;
    border-radius: 4px;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 48px;
}

/* 清新配色方案 */
.btn-view {
    background: #f6ffed;
    color: #52c41a;
    border-color: #b7eb8f;
}

.btn-view:hover {
    background: #52c41a;
    color: white;
}

.btn-diff {
    background: #fff7e6;
    color: #faad14;
    border-color: #ffd591;
}

.btn-diff:hover {
    background: #faad14;
    color: white;
}

.btn-rollback {
    background: #fff2e8;
    color: #ff7a45;
    border-color: #ffbb96;
}

.btn-rollback:hover {
    background: #ff7a45;
    color: white;
}

.btn-export {
    background: #f9f0ff;
    color: #722ed1;
    border-color: #d3adf7;
}

.btn-export:hover {
    background: #722ed1;
    color: white;
}

/* 当前版本高亮 */
.current-version td {
    background: #f8fbff;
    border-left: none;
}

.current-version .version-time {
    font-weight: 600;
}

/* 版本显示容器 */
.version-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .version-table {
        table-layout: auto;
    }
    
    .version-table th:nth-child(1),
    .version-table th:nth-child(2) {
        width: auto;
    }
    
    .version-actions {
        flex-direction: row;
        flex-wrap: nowrap;
    }
    
    .version-actions .btn {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* 确保模态框宽度足够 */

.modal-content {
    max-width: 900px;
    min-width: 700px;
    max-height: 95vh;
}

.modal-body {
    overflow: visible;
}

/* 差异对比样式 */
.diff-container {
    background: #f6f8fa;
    border: 1px solid #d1d9e0;
    border-radius: 4px;
    padding: 15px;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.4;
    overflow-x: auto;
}

.diff-added {
    background: #e6ffed;
    color: #22863a;
}

.diff-removed {
    background: #ffeef0;
    color: #d73a49;
}

/* 警告框样式 */
.warning-box {
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
}

.warning-title {
    color: #fa8c16;
    font-weight: bold;
    margin-bottom: 8px;
}

.impact-list {
    list-style: none;
    padding-left: 0;
}

.impact-list li {
    padding: 5px 0;
    padding-left: 20px;
    position: relative;
}

.impact-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #fa8c16;
}

/* 橘色警告框样式 */
.warning-box.orange-warning {
    background: #fff2e8;
    border: 1px solid #ff7a45;
    border-left: 4px solid #ff7a45;
}

.warning-box.orange-warning .warning-title {
    color: #d4380d;
}

.warning-content {
    color: #595959;
    line-height: 1.5;
    margin-top: 8px;
}

/* 确认输入区域样式优化 */
.confirm-input-container {
    margin-top: 20px;
}

.confirm-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.confirm-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.confirm-input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.2);
}

.confirm-input::placeholder {
    color: #bfbfbf;
}

/* 按钮禁用状态 */
.btn:disabled {
    background: #f5f5f5;
    border-color: #d9d9d9;
    color: #bfbfbf;
    cursor: not-allowed;
}

.btn-primary:disabled {
    background: #f5f5f5;
    border-color: #d9d9d9;
    color: #bfbfbf;
}

/* 配置布局样式 */
.config-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.config-editor-panel {
    flex: 1;
    min-width: 0;
}

.config-params-panel {
    flex: 1;
    min-width: 0;
}

/* 分割线样式 */
.config-divider {
    width: 1px;
    background: #e8e8e8;
    margin: 0 20px;
    align-self: stretch;
}

/* 参数面板头部样式 */
.params-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.params-header h3 {
    margin: 0;
    font-size: 16px;
    color: #262626;
    font-weight: 600;
}

.params-search {
    flex-shrink: 0;
}

.params-search input {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    width: 180px;
    outline: none;
}

.params-search input:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 调整参数容器样式 */
.params-container {
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    overflow: hidden;
    height: 100%;
}

.params-table {
    overflow-y: auto;
    max-height: 400px;
}

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

.params-table th,
.params-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.params-table th {
    background: #fafafa;
    font-weight: 600;
    color: #262626;
}

.params-table td {
    color: #595959;
}

.params-table tr:last-child td {
    border-bottom: none;
}

.params-table td:first-child {
    font-family: 'Consolas', 'Monaco', monospace;
    color: #1890ff;
    font-weight: 500;
}

.params-table td:nth-child(3) {
    font-family: 'Consolas', 'Monaco', monospace;
    color: #52c41a;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .config-layout {
        flex-direction: column;
    }
    
    .config-editor-panel,
    .config-params-panel {
        width: 100%;
    }
    
    .config-divider {
        display: none;
    }
    
    .params-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .params-search input {
        width: 100%;
    }
}

/* 隐藏配置头部中的按钮 */
.config-header .action-buttons {
    display: none;
}