/* 后台样式：基于 Element Plus，色板对齐设计规范 */
:root {
  --el-color-primary: #0066ff;
  --el-color-primary-light-3: #4d94ff;
  --el-color-primary-light-5: #80b3ff;
  --el-color-primary-light-7: #b3d1ff;
  --el-color-primary-light-8: #cce0ff;
  --el-color-primary-light-9: #e6f0ff;
  --el-color-primary-dark-2: #0052cc;
  --el-color-success: #31b85d;
  --el-color-warning: #ffb444;
  --el-color-danger: #ff3d3d;
  --el-text-color-primary: #2c3034;
  --el-text-color-regular: #5a5f6c;
  --el-text-color-secondary: #8a90a1;
  --el-text-color-placeholder: #adbcc7;
  --el-border-color: #dcdfea;
  --el-border-color-light: #edeff8;
  --el-border-color-lighter: #edeff8;
  --el-fill-color-light: #f9fafe;
  --el-border-radius-base: 8px;
  --el-font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif;
  --page-bg: #f6f7fb;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100vh; }
body { font-family: var(--el-font-family); background: var(--page-bg); color: var(--el-text-color-primary); -webkit-font-smoothing: antialiased; }
[v-cloak] { display: none; }
a { color: inherit; text-decoration: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: #f1f3f9; padding: 1px 6px; border-radius: 4px; }
.muted { color: var(--el-text-color-placeholder); }
.hint { margin: 18px 4px 0; color: var(--el-text-color-secondary); font-size: 12.5px; line-height: 1.7; }

/* ---------- 登录 ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--page-bg); }
.login-card {
  width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--el-border-color-light);
  border-radius: 16px; padding: 36px 36px 26px; box-shadow: 0 24px 60px -28px rgba(44, 48, 52, .28);
}
.login-card .logo-full { display: block; height: 72px; width: auto; margin: 0 auto 6px; }
.login-card h1 { margin: 6px 0 0; font-size: 22px; text-align: center; letter-spacing: .08em; }
.login-card p { margin: 6px 0 22px; text-align: center; font-size: 13px; color: var(--el-text-color-secondary); }
.login-err { margin-bottom: 14px; }
.login-btn { width: 100%; letter-spacing: .3em; }
.back { display: block; text-align: center; margin-top: 16px; font-size: 13px; color: var(--el-text-color-secondary); }
.back:hover { color: var(--el-color-primary); }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 224px; flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: #fafafa; border-right: 1px solid var(--el-border-color-light); padding: 22px 12px 18px;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; }
.side-brand .logo { height: 26px; width: auto; display: block; }
.side-brand b { display: block; font-size: 15px; letter-spacing: .08em; }
.side-brand small { color: var(--el-text-color-secondary); font-size: 12px; }
.side-menu { border-right: 0; background: transparent; }
.side-menu .el-menu-item { height: 46px; border-radius: 8px; margin-bottom: 6px; color: var(--el-text-color-regular); }
.side-menu .el-menu-item:hover { background: #f0f3fb; color: var(--el-color-primary); }
.side-menu .el-menu-item.is-active { background: rgba(0, 102, 255, .08); color: var(--el-color-primary); font-weight: 600; }
.side-foot { margin-top: auto; padding: 0 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--el-text-color-secondary); }
.side-foot a:hover { color: var(--el-color-primary); }
.main { flex: 1; min-width: 0; padding: 36px 48px 72px; }
.pwd-alert { margin-bottom: 28px; padding: 12px 16px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h2 { margin: 0; font-size: 22px; }
.page-head p { margin: 8px 0 0; font-size: 13px; color: var(--el-text-color-secondary); }
.head-ops { display: flex; gap: 10px; align-items: center; }

.table-card, .form-card { border-radius: 12px; border: 1px solid var(--el-border-color-light); }
.form-card { max-width: 640px; }
.form-card .el-card__body { padding: 32px 36px; }
.form-card .el-form-item { margin-bottom: 24px; }
.table-card .el-table { --el-table-header-bg-color: #f9fafe; --el-table-header-text-color: #5a5f6c; }
.table-card .el-table th.el-table__cell { font-weight: 600; padding: 16px 0; }
.table-card .el-table td.el-table__cell { padding: 20px 0; }          /* 行高更舒展 */
.table-card .el-table .cell { line-height: 1.6; }
.drag-handle {                 /* 六点抓手：平时隐藏，鼠标移入该行才出现 */
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border-radius: 6px; color: #aab2c8; cursor: grab; opacity: 0; transition: opacity .15s, background .15s, color .15s;
}
.el-table__row:hover .drag-handle, .env-row:hover .drag-handle, .sortable-ghost .drag-handle, .sortable-chosen .drag-handle { opacity: 1; }
.drag-handle:hover { background: #eef3ff; color: var(--el-color-primary); }
.drag-handle:active { cursor: grabbing; }
@media (hover: none) { .drag-handle { opacity: 1; } }   /* 触屏没有悬停，始终显示 */
.sortable-ghost { opacity: .5; background: #eef4ff !important; }

.tool-cell { display: flex; align-items: center; gap: 16px; min-width: 0; }
.thumb {
  flex: none; width: 44px; height: 44px; border-radius: 12px; background: #f3f5fb center / 70% no-repeat;
  border: 1px solid var(--el-border-color-light); display: grid; place-items: center; color: #a3acc2; font-weight: 700;
}
.tool-info { min-width: 0; line-height: 1.6; }
.tool-info b { margin-bottom: 2px; }
.tool-info b { display: block; font-weight: 600; }
.tool-info small { display: block; color: var(--el-text-color-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.env-tag { margin: 2px 4px 2px 0; }

.bk-desc { margin-bottom: 8px; }
.bk-block { padding-top: 26px; margin-top: 26px; border-top: 1px solid var(--el-border-color-light); }
.bk-title { font-weight: 600; margin-bottom: 10px; }
.bk-block .el-button { gap: 6px; }

/* ---------- 工具弹窗 ---------- */
.tool-dialog { max-width: 94vw; border-radius: 12px; }
.tool-dialog .el-dialog__header { padding: 22px 28px; border-bottom: 1px solid var(--el-border-color-light); margin: 0; }
.tool-dialog .el-dialog__body { padding: 26px 28px 8px; max-height: calc(100vh - 220px); overflow: auto; }
.tool-dialog .el-dialog__footer { padding: 18px 28px 22px; border-top: 1px solid var(--el-border-color-light); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.env-switch { margin-bottom: 4px; }
.env-box { width: 100%; background: #f9fafe; border: 1px solid var(--el-border-color-light); border-radius: 10px; padding: 16px; }
.env-rows { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.env-row { display: grid; grid-template-columns: 22px 140px 1fr 28px; gap: 8px; align-items: center; }
.env-row .el-button + .el-button { margin-left: 0; }
.uploader { display: flex; gap: 16px; align-items: flex-start; width: 100%; }
.preview {
  width: 88px; height: 88px; flex: none; border-radius: 16px; border: 1px dashed #c3cbe0; background: #f6f8fc center / 70% no-repeat;
  display: grid; place-items: center; color: #a3acc2; font-size: 12px;
}
.up-actions { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.up-btns { display: flex; gap: 10px; }
.up-btns .el-button { gap: 6px; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { position: static; width: auto; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; }
  .side-brand { padding: 0; }
  .side-menu { display: flex; overflow-x: auto; flex: 1 1 100%; order: 3; }
  .side-foot { flex-direction: row; margin: 0 0 0 auto; align-items: center; }
  .main { padding: 22px 16px 48px; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .env-row { grid-template-columns: 22px 1fr 1fr 28px; }
  .tool-info small { max-width: 200px; }
}
