/* EBView base.css —— 布局与控件通用样式（主题色经 CSS 变量覆盖） */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg, #f5f7fa);
  color: var(--fg, #303133);
}

/* ---------- 应用骨架 ---------- */
.eb-app { display: flex; flex-direction: column; min-height: 100vh; }
.eb-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 52px;
  background: var(--header-bg, #1f2937);
  color: var(--header-fg, #fff);
  flex: none;
}
.eb-header-left, .eb-header-right { display: flex; align-items: center; gap: 12px; }
.eb-logo { height: 28px; }
.eb-title { font-size: 16px; font-weight: 600; }
.eb-user { opacity: .85; }

.eb-body { display: flex; flex: 1; }
.eb-sidebar-wrap { flex: none; width: 200px; }
.eb-sidebar {
  padding: 12px 0; height: 100%;
  background: var(--sidebar-bg, #fff);
  border-right: 1px solid var(--border, #e4e7ed);
}
.eb-menu-group { margin-bottom: 8px; }
.eb-menu-title {
  padding: 6px 16px; font-size: 12px; color: var(--muted, #909399);
  cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 6px;
}
.eb-menu-title::before {
  content: "▶"; font-size: 10px; transition: transform .2s;
  display: inline-block;
}
.eb-menu-group[open] > .eb-menu-title::before {
  transform: rotate(90deg);
}
.eb-menu-group > .eb-menu-item {
  padding-left: 32px;
}
.eb-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; color: var(--fg, #303133);
  text-decoration: none; border-left: 3px solid transparent;
}
.eb-menu-item:hover { background: var(--hover, #f0f2f5); }
.eb-menu-item.active {
  background: var(--active-bg, #ecf5ff);
  border-left-color: var(--primary, #409eff);
  color: var(--primary, #409eff);
  font-weight: 600;
}
.eb-icon { display: inline-block; font-size: 15px; min-width: 18px; text-align: center; }

.eb-main { flex: 1; padding: 24px; overflow-x: auto; }

/* ---------- 页面与区块 ---------- */
.eb-page { max-width: 960px; }
.eb-page-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.eb-section { margin-bottom: 20px; }
.eb-section-title {
  font-size: 15px; font-weight: 600; margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border, #e4e7ed);
}

/* ---------- 字段与值 ---------- */
.eb-field {
  display: flex; align-items: baseline; gap: 12px;
  padding: 7px 0; border-bottom: 1px dotted var(--border, #e4e7ed);
}
.eb-label { flex: none; width: 140px; color: var(--muted, #606266); }
.eb-value { font-weight: 500; }
.eb-textview { white-space: pre-wrap; word-break: break-all;
  font-family: inherit; }
.eb-textview-mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
  font-size: 13px;
}

/* ---------- 状态与徽标 ---------- */
.eb-status { display: flex; align-items: center; gap: 8px; padding: 7px 0; }
.eb-status-dim { opacity: .55; }
.eb-pill {
  display: inline-block; padding: 1px 10px; border-radius: 10px;
  font-size: 12px; font-weight: 600; line-height: 18px;
}
.eb-pill-ok    { background: #67c23a22; color: #67c23a; }
.eb-pill-info  { background: #409eff22; color: #409eff; }
.eb-pill-warn  { background: #e6a23c22; color: #e6a23c; }
.eb-pill-error { background: #f56c6c22; color: #f56c6c; }
.eb-pill-off   { background: #90939922; color: #909399; }

/* ---------- 表格 ---------- */
.eb-table { width: 100%; border-collapse: collapse; }
.eb-table th, .eb-table td {
  padding: 8px 12px; text-align: left;
  border-bottom: 1px solid var(--border, #e4e7ed);
  font-size: 13px;
}
.eb-table th { font-weight: 600; color: var(--muted, #606266); }
.eb-empty { text-align: center; color: var(--muted, #909399); padding: 18px 0 !important; }

/* ---------- 表单 ---------- */
.eb-form-item { margin-bottom: 14px; }
.eb-form-item > .eb-label { width: 140px; display: inline-block; }
.eb-input, .eb-textarea, .eb-select {
  width: 100%; max-width: 360px; padding: 6px 10px;
  font-size: 13px; font-family: inherit;
  border: 1px solid var(--border, #dcdfe6); border-radius: 4px;
  background: var(--input-bg, #fff); color: var(--fg, #303133);
}
.eb-input:focus, .eb-textarea:focus, .eb-select:focus {
  outline: none; border-color: var(--primary, #409eff);
  box-shadow: 0 0 0 2px var(--primary28, #409eff40);
}
.eb-textarea { resize: vertical; min-height: 72px; }
.eb-select { width: auto; min-width: 200px; }
.eb-option-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; cursor: pointer; }
.eb-option-row input { accent-color: var(--primary, #409eff); }

/* ---------- 按钮 ---------- */
.eb-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; font-size: 13px; border-radius: 4px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  background: var(--btn-bg, #409eff); color: #fff; line-height: 1.4;
}
.eb-btn:hover { opacity: .9; }
.eb-btn-sm { padding: 3px 10px; font-size: 12px; }
.eb-btn-primary { background: var(--primary, #409eff); color: #fff; }
.eb-btn-second  { background: var(--btn2-bg, #e4e7ed); color: var(--fg, #303133); }
.eb-btn-danger  { background: #f56c6c; color: #fff; }
.eb-btn-warning { background: #e6a23c; color: #fff; }

.eb-footer {
  text-align: center; padding: 12px; font-size: 12px;
  color: var(--muted, #909399); flex: none;
}

/* ---------- 标签页 ---------- */
.eb-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border, #dcdfe6);
  background: var(--card-bg, #fff);
}
.eb-tab {
  display: inline-block;
  padding: 10px 20px;
  text-decoration: none;
  color: var(--muted, #606266);
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background: var(--bg, #f5f7fa);
  margin-right: 4px;
  margin-bottom: -2px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.eb-tab:hover {
  color: var(--primary, #409eff);
  background: var(--card-bg, #fff);
}
.eb-tab.active {
  color: var(--primary, #409eff);
  background: var(--card-bg, #fff);
  border-color: var(--border, #dcdfe6);
  border-bottom: 2px solid var(--card-bg, #fff);
  font-weight: 600;
}