/* ==========================================================================
   EG环境助手 · 官网展示用前端素材
   数值与 WinForms 源码一一对应（Theme.cs / MainForm.cs / AuthForm.cs）
   1pt = 1.333px @96DPI，所以 9pt=12px、8.5pt≈11.33px、10pt≈13.33px
   ========================================================================== */

.win {
  --bg: #f5f7fa;
  --card: #fff;
  --border: #dfe3ea;
  --text: #1c2430;
  --sub: #6c7582;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #ebf2ff;
  --success: #15914a;
  --danger: #c62828;
  --warn: #b26a0a;

  --hdr-start: #111a28;
  --hdr-end: #1c2d48;

  --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

/* 缩放工具：官网上想按比例缩小显示时，给 .win 外面套一层即可
   <div class="win-scale" style="--s:.72"><div class="win win-main">…</div></div>
   容器高度需要用 JS 或固定值跟随（transform 不改变布局尺寸） */
.win-scale {
  transform: scale(var(--s, 1));
  transform-origin: top center;
}

/* ==========================================================================
   窗口外壳
   ========================================================================== */
.win {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);          /* 官网是深色底，必须显式给窗口内文字定色 */
  line-height: normal;         /* 隔离站点全局行高，保证界面尺寸与客户端一致 */
  font-family: var(--font);
  font-size: 12px;
  box-shadow: 0 18px 48px rgba(17, 26, 40, .16), 0 2px 6px rgba(17, 26, 40, .06);
  border-radius: 10px;
}
.win-main { width: 1080px; height: 740px; }

/* 截图模式：只留目标窗口，去掉阴影与圆角，输出就是干净的界面图 */

/* ==========================================================================
   主窗口 · 标题区（RowStyle 92px）
   ========================================================================== */
.hdr {
  position: relative;
  flex: 0 0 92px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.hdr::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 1px;
  width: 4px;
  background: var(--accent);
}
.hdr-title {
  position: absolute;
  left: 22px; top: 8px;
  font-size: 21.3px;
  font-weight: 700;
  letter-spacing: .2px;
}
.hdr-sub {
  position: absolute;
  left: 24px; top: 41px;
  font-size: 11.3px;
  color: var(--sub);
  white-space: pre;
}

/* 影子系统开关一行 */
.shadow-row {
  position: absolute;
  left: 24px; top: 63px;
  display: flex;
  align-items: center;
  height: 23px;
}
.shadow-label {
  font-size: 12px;
  margin-top: 2px;
  cursor: pointer;
  user-select: none;
}
.shadow-state {
  font-size: 12px;
  font-weight: 700;
  margin: 2px 0 0 10px;
  cursor: pointer;
}
.shadow-state.on { color: var(--success); }
.shadow-state.off { color: var(--sub); }
.shadow-state.lock { color: var(--danger); }
.shadow-hint {
  font-size: 10.7px;
  color: var(--sub);
  margin: 3px 0 0 8px;
}

/* 胶囊开关 44×23，开启为绿色（ToggleSwitch.cs） */
.toggle {
  position: relative;
  width: 44px; height: 23px;
  margin-left: 10px;
  border-radius: 11px;
  background: #c6ccd6;
  transition: background .18s ease;
  cursor: pointer;
  flex: 0 0 auto;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s ease;
}
.toggle.on { background: var(--success); }
.toggle.on::after { transform: translateX(21px); }
.toggle.disabled { background: #e2e6ec; cursor: not-allowed; }
.toggle.disabled::after { background: #f8f9fb; }

/* 右上角状态徽标 */
.badge-admin {
  position: absolute;
  top: 14px; right: 22px;
  height: 30px;
  padding: 0 16px;
  border-radius: 15px;
  background: #e8f7ed;
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  letter-spacing: .3px;
}
.badge-admin.warn { background: #fdecec; color: var(--danger); }
.hdr-user {
  position: absolute;
  top: 48px; right: 22px;
  font-size: 11.3px;
  color: var(--sub);
}

/* ==========================================================================
   主窗口 · 页签（150×34，10pt Bold）
   ========================================================================== */
.tabs {
  flex: 0 0 34px;
  display: flex;
  align-items: flex-end;
  background: var(--bg);
  padding-left: 8px;
  border-bottom: 1px solid var(--border);
}
.tab {
  width: 150px;
  height: 34px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 5px 5px 0 0;
  background: transparent;
  color: #5a6272;
  font-family: var(--font);
  font-size: 13.3px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: -1px;
  transition: background .15s ease, color .15s ease;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, .6); }
.tab.active {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
  border-bottom: 1px solid var(--card);
}

/* ==========================================================================
   页签内容通用
   ========================================================================== */
.page {
  flex: 1 1 auto;
  display: none;
  flex-direction: column;
  padding: 10px 12px;
  min-height: 0;
}
.page.active { display: flex; }

.toolbar {
  flex: 0 0 54px;
  position: relative;
}
.tb-title {
  position: absolute;
  left: 2px; top: 6px;
  font-size: 16px;
  font-weight: 700;
}
.tb-sub {
  position: absolute;
  left: 2px; top: 32px;
  font-size: 11.3px;
  color: var(--sub);
}
.tb-actions {
  position: absolute;
  right: 0; top: 10px;
  display: flex;
  gap: 8px;
}

/* 按钮：Primary / Ghost / Mini（Theme.cs） */
.btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: #f3f5f8; }
.btn.primary {
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.btn.primary:hover { background: var(--accent-dark); }
.btn[disabled] {
  color: #a9b0bc;
  background: #f4f6f9;
  cursor: default;
}
.btn.mini {
  height: 24px;
  padding: 0 10px;
  font-size: 10.7px;
  color: var(--accent);
  border-color: #c4d6f6;
}
.btn.mini:hover { background: var(--accent-soft); }

/* 白色卡片：1px 描边（Theme.CardPanel） */
.card {
  flex: 1 1 auto;
  min-height: 0;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1px;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   列表（ListView Details，行高 26）
   ========================================================================== */
.lv {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  font-size: 12px;
}
.lv-head, .lv-row {
  display: flex;
  align-items: center;
  height: 26px;
  padding-left: 6px;
}
.lv-head {
  height: 28px;
  color: var(--sub);
  border-bottom: 1px solid #e9ecf1;
  background: var(--card);
}
.lv-head span { font-size: 12px; }
.lv-row { color: var(--text); }
.lv-row:hover { background: #f7f9fc; }
.lv-row.sel { background: #eaf1ff; }
.c-task { width: 252px; display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.lv-head .c-task { padding-left: 22px; }
.c-status { width: 92px; flex: 0 0 auto; }
.c-desc { flex: 1 1 auto; color: var(--sub); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* 复选框 13px */
.cb {
  width: 13px; height: 13px;
  border: 1px solid #9aa3b0;
  border-radius: 2px;
  background: #fff;
  flex: 0 0 auto;
  position: relative;
}
.cb.on { background: var(--accent); border-color: var(--accent); }
.cb.on::after {
  content: "";
  position: absolute;
  left: 3.5px; top: 1px;
  width: 4px; height: 7px;
  border: solid #fff;
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(43deg);
}

.st-running { color: var(--accent); }
.st-success { color: var(--success); }
.st-danger  { color: var(--danger); }
.st-warn    { color: var(--warn); }
.st-idle    { color: var(--sub); }

/* ==========================================================================
   日志面板（LogView：浅底 + Consolas 12px）
   ========================================================================== */
.log {
  flex: 0 0 230px;
  margin-top: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.log.short { flex: 0 0 200px; }
.log.mini { flex: 0 0 122px; }
.log-bar {
  flex: 0 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.log-bar b { font-size: 12px; font-weight: 700; }
.log-count { font-size: 10.7px; color: var(--sub); }
.log-body {
  flex: 1 1 auto;
  background: #fafbfd;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  padding: 6px 8px;
  overflow: hidden;
  color: var(--text);
}
.log-body div { white-space: pre-wrap; }
.l-info { color: var(--text); }
.l-success { color: var(--success); }
.l-warn { color: var(--warn); }
.l-error { color: var(--danger); }
.l-raw { color: #4a5364; }

/* ==========================================================================
   本机信息页（190 / 520 / 88 三列网格）
   ========================================================================== */
.grid-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 10px 14px;
}
.g-section {
  font-size: 13.3px;
  font-weight: 700;
  color: var(--accent);
  margin: 16px 0 5px;
}
.g-section:first-child { margin-top: 0; }
.g-row {
  display: flex;
  align-items: center;
  min-height: 26px;
}
.g-name { width: 190px; flex: 0 0 auto; color: var(--sub); font-size: 12px; }
.g-val  { flex: 1 1 auto; font-size: 12px; }
.g-btn  { width: 88px; flex: 0 0 auto; display: flex; justify-content: flex-start; }

/* ==========================================================================
   状态栏（30px）
   ========================================================================== */
.statusbar {
  flex: 0 0 30px;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  font-size: 11.3px;
  color: var(--sub);
}
.statusbar .ver { font-size: 10.7px; }
