﻿/* === 页面基础样式 === */
body {
  font-family: "Segoe UI", Arial, sans-serif;
  margin: 0;
  background: #f4f6f9;
}
header {
  background: linear-gradient(90deg,#0078d7,#005a9e);
  color: #fff;
  padding: 15px 30px;
  font-size: 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
header .left a {
  color: #fff;
  margin-right: 15px;
  text-decoration: none;
}
header .right button { margin-left:10px; }
.container { padding: 20px; }
.section {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 20px;
  margin-bottom: 20px;
}
.section-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}
.grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display:grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* === 按钮样式 === */
button {
  margin: 5px;
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  background: #0078d7;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s;
}
button:hover { background: #005a9e; }
.btn-secondary { background:#6c757d; }
.btn-warning { background:#f0ad4e; }
.btn-danger { background:#dc3545; }
.btn-success { background:#28a745; }
.btn-info { background:#17a2b8; }
.btn-info:hover { background:#117a8b; }

/* === 表格容器：限制高度并允许滚动 === */
.tasks-table-container,
.nodes-table-container {
  max-height: 300px;   /* 可根据需要调整显示高度 */
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
}

/* === 表格 Sticky 表头 === */
#tasksTable, #nodesTable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
#tasksTable th, #nodesTable th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
#tasksTable th, #tasksTable td,
#nodesTable th, #nodesTable td {
  padding: 8px;
  border: 1px solid #ccc;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 40px;
  line-height: 40px;
}

/* === 表格 hover 效果 === */
#tasksTable tbody tr:hover,
#nodesTable tbody tr:hover {
  background: #f1f1f1;
  cursor: pointer;
}

/* === 表格容器滚动条美化 === */
.tasks-table-container::-webkit-scrollbar,
.nodes-table-container::-webkit-scrollbar {
  width: 8px;
}
.tasks-table-container::-webkit-scrollbar-thumb,
.nodes-table-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
.tasks-table-container::-webkit-scrollbar-thumb:hover,
.nodes-table-container::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* === 输出区块样式 === */
#proxyOutput,
#analyticsOutput,
#schedulerOutput {
  margin-top: 10px;
  padding: 10px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  color: #333;
}

/* === 图表区块样式 === */
.charts {
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.chart-card {
  background:#fff;
  border-radius:8px;
  box-shadow:0 2px 6px rgba(0,0,0,0.1);
  padding:16px;
}

/* === 表单样式 === */
.form-row {
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.full { grid-column: 1 / -1; }
label { font-size:13px; color:#555; }
input, select, textarea {
  margin: 5px 0;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width:100%;
}
input[type="range"] { width: 100%; }
input[type="number"] { width: 100%; }
select { width: 100%; }

/* === 标签与提示 === */
.muted { color:#666; font-size:12px; }
.inline { display:flex; gap:8px; align-items:center; }
.pill { display:inline-block; padding:2px 8px; border-radius:12px; font-size:12px; }
.pill-on { background:#e6ffed; color:#1f7a33; border:1px solid #28a745; }
.pill-off { background:#fff5f5; color:#8a1c1c; border:1px solid #dc3545; }

/* === 代码块样式 === */
pre {
  background: #272822;
  color: #f8f8f2;
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
}

/* 悬浮窗口基础样式 */
.vnc-window {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 520px;
    height: 360px;
    background: #111827;
    color: #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
}

/* 默认隐藏 */
.vnc-window.hidden {
    display: none;
}

/* 头部 */
.vnc-window-header {
    height: 36px;
    background: #1f2937;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    cursor: move;
    user-select: none;
}

.vnc-window-header span {
    font-size: 13px;
    color: #d1d5db;
}

.vnc-window-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    padding: 0 6px;
}

.vnc-window-close:hover {
    color: #f97373;
}

/* 内容区 */
.vnc-window-body {
    flex: 1;
    background: #000;
}

.vnc-window-iframe {
    width: 100%;
    height: 100%;
}

/* 右下角缩放句柄 */
.vnc-window-resize-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    right: 2px;
    bottom: 2px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 0, transparent 50%, #4b5563 50%, #9ca3af 100%);
}

