/* ==========================================================================
   站群管理系统 · 主题层
   只覆盖视觉，不动任何业务逻辑；Element Plus 设计令牌统一在这里改写
   ========================================================================== */

:root {
  /* 品牌色：靛蓝 → 紫，避开 Element 默认蓝 */
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-3: #6366f1;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #8a94a6;
  --line: #eaeef5;
  --bg: #f6f7fb;

  /* Element Plus 令牌覆盖 */
  --el-color-primary: #4f46e5;
  --el-color-primary-light-3: #7b74f0;
  --el-color-primary-light-5: #a29df6;
  --el-color-primary-light-7: #c9c6fa;
  --el-color-primary-light-8: #dcdafc;
  --el-color-primary-light-9: #eeedfe;
  --el-color-primary-dark-2: #3f37c9;

  --el-border-radius-base: 10px;
  --el-border-radius-small: 8px;
  --el-border-radius-round: 999px;

  --el-text-color-primary: #0f172a;
  --el-text-color-regular: #334155;
  --el-text-color-secondary: #8a94a6;

  --el-border-color: #e5e9f2;
  --el-border-color-light: #eef1f7;
  --el-border-color-lighter: #f2f5fa;

  --el-box-shadow-light: 0 1px 2px rgba(16, 24, 40, .04);
  --el-font-family: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--el-font-family);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(99, 102, 241, .22); }

/* 细滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d5dbe8; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b9c2d6; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ========================= 外层框架 ========================= */

.sg-shell {
  display: flex;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 78% -12%, rgba(124, 58, 237, .07), transparent 60%),
    radial-gradient(900px 460px at 12% 4%, rgba(79, 70, 229, .06), transparent 60%),
    var(--bg);
}

/* ---------- 侧边栏 ---------- */
.sg-side {
  width: 226px;
  flex: 0 0 226px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 0 14px;
  background:
    radial-gradient(520px 320px at 20% 0%, rgba(99, 102, 241, .22), transparent 62%),
    linear-gradient(180deg, #0b1220 0%, #101a2e 55%, #0b1424 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
  overflow: hidden;
}

.sg-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 68px;
  padding: 0 18px;
  flex: 0 0 auto;
}

.sg-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, #6366f1, #a855f7);
  box-shadow: 0 6px 16px -6px rgba(124, 58, 237, .9), inset 0 1px 0 rgba(255, 255, 255, .28);
  color: #fff;
  font-size: 17px;
}

.sg-brand-txt { display: flex; flex-direction: column; line-height: 1.25; }
.sg-brand-txt b { color: #f3f6fc; font-size: 14.5px; font-weight: 600; letter-spacing: .01em; }
.sg-brand-txt span { color: #6b7a94; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; margin-top: 3px; }

.sg-nav { flex: 1; overflow-y: auto; padding-top: 6px; }
.sg-nav::-webkit-scrollbar { width: 0; }

.sg-nav-label {
  padding: 12px 24px 6px;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #55637c;
}

.sg-menu.el-menu {
  background: transparent;
  border: none;
  padding: 0 10px;
}

.sg-menu .el-menu-item {
  position: relative;
  height: 42px;
  line-height: 42px;
  margin: 3px 0;
  border-radius: 11px;
  color: #a9b5ca;
  font-size: 13.5px;
  transition: background .18s ease, color .18s ease;
}

.sg-menu .el-menu-item .el-icon { font-size: 16px; color: #7f8ca5; transition: color .18s; }

.sg-menu .el-menu-item:hover { background: rgba(255, 255, 255, .055); color: #eef2fb; }
.sg-menu .el-menu-item:hover .el-icon { color: #c7d2fe; }

.sg-menu .el-menu-item.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(99, 102, 241, .34), rgba(168, 85, 247, .14));
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .26);
}
.sg-menu .el-menu-item.is-active .el-icon { color: #c4b5fd; }
.sg-menu .el-menu-item.is-active::before {
  content: "";
  position: absolute;
  left: 0; top: 10px; bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #818cf8, #c084fc);
  box-shadow: 0 0 12px rgba(129, 140, 248, .8);
}

/* 分组标题（监控中心等）：常驻显示，不用可折叠 sub-menu，避免路由切换后子项收起看不见 */
.sg-menu-section {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  margin: 12px 0 4px;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #5c6a83;
  white-space: nowrap;
}
.sg-menu-section .el-icon { font-size: 14px; color: #55637c; }

.sg-side-foot {
  margin: 10px 14px 0;
  padding: 9px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06);
  color: #7c8aa3;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sg-side-foot .dot { width: 7px; height: 7px; border-radius: 50%; background: #64748b; flex: 0 0 auto; }
.sg-side-foot .dot.on { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .16); }

/* ---------- 主区 ---------- */
.sg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.sg-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 24px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.sg-crumb { font-size: 11.5px; color: #9aa4b6; letter-spacing: .03em; }
.sg-crumb b { color: #6b7690; font-weight: 500; }
.sg-title { margin: 3px 0 0; font-size: 17.5px; font-weight: 650; letter-spacing: -.01em; color: var(--ink); }

.sg-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .18s ease;
}
.sg-user:hover { background: #f2f4fa; }

.sg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #6366f1, #a855f7);
  color: #fff; font-size: 13px; font-weight: 600;
  box-shadow: 0 3px 10px -3px rgba(99, 102, 241, .8);
}
.sg-user-txt { display: flex; flex-direction: column; line-height: 1.25; }
.sg-user-txt b { font-size: 13px; font-weight: 600; color: #1e293b; }
.sg-user-txt span { font-size: 11px; color: #94a3b8; }

.sg-body {
  flex: 1;
  padding: 18px 24px 30px;
  min-width: 0;
}
.sg-body > * { animation: sgFade .34s cubic-bezier(.22, .61, .36, 1) both; }

@keyframes sgFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ========================= Element Plus 细节重塑 ========================= */

.el-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
  overflow: hidden;
}
.el-card:hover { box-shadow: 0 14px 34px -18px rgba(30, 41, 59, .3); border-color: #e3e8f5; }

.el-card__header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fcfdff, #f9fafd);
  font-size: 13.5px;
}
.el-card__header b { font-weight: 600; color: #1e293b; letter-spacing: -.005em; }
.el-card__body { padding: 16px 18px; }

/* 表格 */
.el-table { --el-table-border-color: #f0f3f9; font-size: 13px; }
.el-table th.el-table__cell {
  background: #f8fafd !important;
  color: #7c879c;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .03em;
  border-bottom: 1px solid #edf1f8 !important;
}
.el-table td.el-table__cell { border-bottom: 1px solid #f4f6fb; }
.el-table tbody tr:hover > td.el-table__cell { background: #f7f8ff !important; }
.el-table__inner-wrapper::before { display: none; }

/* 按钮 */
.el-button { border-radius: 9px; font-weight: 500; transition: all .18s ease; }
.el-button--primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  border-color: transparent;
  box-shadow: 0 6px 16px -8px rgba(79, 70, 229, .9);
}
.el-button--primary:hover,
.el-button--primary:focus {
  background: linear-gradient(135deg, #4338ca, #5b52ec);
  border-color: transparent;
  box-shadow: 0 10px 22px -10px rgba(79, 70, 229, 1);
  transform: translateY(-1px);
}
.el-button--primary:active { transform: none; }
.el-button--small { border-radius: 8px; }
.el-button.is-text, .el-button.is-link { font-weight: 500; }

/* 输入 / 选择 */
.el-input__wrapper,
.el-textarea__inner,
.el-select__wrapper {
  border-radius: 10px;
  box-shadow: 0 0 0 1px #e6eaf3 inset;
  transition: box-shadow .18s ease;
}
.el-input__wrapper:hover, .el-select__wrapper:hover,
.el-textarea__inner:hover { box-shadow: 0 0 0 1px #d3daea inset; }
.el-input__wrapper.is-focus, .el-select__wrapper.is-focused,
.el-textarea__inner:focus { box-shadow: 0 0 0 1px var(--brand) inset, 0 0 0 3px rgba(79, 70, 229, .12) !important; }

/* 标签 */
.el-tag { border-radius: 7px; font-weight: 500; border: none; }

/* 弹窗 */
.el-dialog { border-radius: 18px; box-shadow: 0 30px 70px -30px rgba(15, 23, 42, .5); overflow: hidden; }
.el-dialog__header { padding: 18px 22px 12px; margin: 0; border-bottom: 1px solid var(--line); }
.el-dialog__title { font-size: 15px; font-weight: 620; }
.el-dialog__body { padding: 18px 22px; }
.el-dialog__footer { padding: 12px 22px 18px; border-top: 1px solid var(--line); }

/* 提示条 */
.el-alert { border-radius: 12px; border: 1px solid transparent; }
.el-alert--info { background: linear-gradient(180deg, #f7f8ff, #f3f4ff); border-color: #e8e8fe; }
.el-alert--warning { background: linear-gradient(180deg, #fffbf2, #fff8ec); border-color: #fbeccd; }

/* 进度条 */
.el-progress-bar__outer { background: #eef1f8; }
.el-progress-bar__inner { background: linear-gradient(90deg, #6366f1, #a855f7); }

/* 菜单下拉 */
.el-dropdown-menu { border-radius: 12px; padding: 6px; box-shadow: 0 18px 40px -20px rgba(15, 23, 42, .45); }
.el-dropdown-menu__item { border-radius: 8px; font-size: 13px; }

/* 空状态 */
.el-empty__description p { color: #a3adc0; font-size: 13px; }

/* ========================= 仪表盘统计卡 ========================= */

.sg-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1440px) { .sg-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .sg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.sg-stat {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px 16px 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.sg-stat:hover {
  transform: translateY(-3px);
  border-color: #e2e7f6;
  box-shadow: 0 18px 36px -20px rgba(79, 70, 229, .45);
}
.sg-stat::after {
  content: "";
  position: absolute;
  right: -34px; top: -34px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, .1), transparent 68%);
  pointer-events: none;
}
.sg-stat .ico {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  margin-bottom: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}
.sg-stat .num {
  font-size: 27px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.sg-stat .lab { margin-top: 4px; font-size: 12.5px; color: var(--muted); }

.t-indigo .ico { background: linear-gradient(140deg, #eef0ff, #e0e3ff); color: #4f46e5; }
.t-green  .ico { background: linear-gradient(140deg, #ecfdf5, #d8f8e9); color: #059669; }
.t-teal   .ico { background: linear-gradient(140deg, #ecfeff, #d5f6fa); color: #0891b2; }
.t-violet .ico { background: linear-gradient(140deg, #f6f0ff, #ece0ff); color: #7c3aed; }
.t-amber  .ico { background: linear-gradient(140deg, #fffaf0, #ffefd6); color: #d97706; }
.t-rose   .ico { background: linear-gradient(140deg, #fff1f4, #ffe1e8); color: #e11d48; }

/* 两栏区 */
.sg-grid-2 { display: grid; grid-template-columns: 1.45fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 1180px) { .sg-grid-2 { grid-template-columns: 1fr; } }

.sg-hint { margin: 10px 0 0; font-size: 12px; color: #a3adc0; }
.sg-hint b { color: #6b7690; font-weight: 600; }

/* 段标题 */
.sg-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
}
.sg-section-title::before {
  content: "";
  width: 3px; height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #6366f1, #a855f7);
}

/* ========================= 登录页 ========================= */

.sg-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.06fr .94fr;
  background: #fff;
}
@media (max-width: 960px) {
  .sg-login { grid-template-columns: 1fr; }
  .sg-login-left { display: none; }
}

.sg-login-left {
  position: relative;
  overflow: hidden;
  padding: 54px 58px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #dbe4f5;
  background:
    radial-gradient(760px 420px at 12% 6%, rgba(99, 102, 241, .34), transparent 62%),
    radial-gradient(620px 460px at 88% 88%, rgba(168, 85, 247, .26), transparent 64%),
    linear-gradient(160deg, #0c1526 0%, #0a0f1c 100%);
}
.sg-login-left::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 30%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 30% 30%, #000 20%, transparent 78%);
  pointer-events: none;
}
.sg-login-left > * { position: relative; z-index: 1; }

.sg-login-brand { display: flex; align-items: center; gap: 12px; }
.sg-login-brand .mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #6366f1, #a855f7);
  box-shadow: 0 10px 26px -10px rgba(124, 58, 237, .95), inset 0 1px 0 rgba(255, 255, 255, .3);
  font-size: 19px;
}
.sg-login-brand b { font-size: 15px; color: #f5f8ff; letter-spacing: .01em; }
.sg-login-brand span { display: block; font-size: 10.5px; color: #66748d; letter-spacing: .18em; text-transform: uppercase; margin-top: 3px; }

.sg-login-hero h1 {
  font-size: 34px;
  line-height: 1.35;
  margin: 0 0 14px;
  font-weight: 650;
  letter-spacing: -.01em;
  color: #f7faff;
}
.sg-login-hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #a5b4fc, #e9d5ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sg-login-hero p { margin: 0; font-size: 13.5px; line-height: 1.85; color: #8e9cb6; max-width: 430px; }

.sg-login-feats { display: grid; gap: 13px; margin-top: 30px; max-width: 440px; }
.sg-login-feat { display: flex; gap: 12px; align-items: flex-start; }
.sg-login-feat .fi {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: rgba(99, 102, 241, .16);
  border: 1px solid rgba(129, 140, 248, .28);
  color: #a5b4fc;
  font-size: 15px;
}
.sg-login-feat b { display: block; font-size: 13px; color: #dfe7f7; font-weight: 600; margin-bottom: 2px; }
.sg-login-feat span { font-size: 12px; color: #7f8da7; }

.sg-login-meta { display: flex; gap: 34px; }
.sg-login-meta div b { display: block; font-size: 20px; font-weight: 700; color: #eef3ff; letter-spacing: -.02em; }
.sg-login-meta div span { font-size: 11.5px; color: #6d7b95; }

.sg-login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background:
    radial-gradient(700px 420px at 80% 10%, rgba(99, 102, 241, .07), transparent 60%),
    #fff;
}

.sg-login-card { width: 100%; max-width: 372px; }
.sg-login-card h2 { margin: 0 0 6px; font-size: 23px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
.sg-login-card .sub { margin: 0 0 26px; font-size: 13px; color: #8a94a6; }

.sg-login-card .el-form-item__label { font-size: 12.5px; color: #64748b; font-weight: 500; padding-bottom: 4px; }
.sg-login-card .el-input__wrapper { height: 44px; border-radius: 11px; }
.sg-login-card .el-button--primary { height: 44px; font-size: 14.5px; letter-spacing: .06em; }

.sg-login-tip { margin: 16px 0 0; font-size: 11.5px; color: #a9b2c2; text-align: center; line-height: 1.7; }

/* 图库缩略图 */
.sg-thumb {
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: #fff;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.sg-thumb:hover {
  transform: translateY(-3px);
  border-color: #dfe5f4;
  box-shadow: 0 16px 32px -20px rgba(30, 41, 59, .4);
}
.sg-thumb .ph {
  height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(160deg, #fafbff, #f3f5fb);
}
.sg-thumb .ph img { max-height: 112px; max-width: 100%; transition: transform .3s ease; }
.sg-thumb:hover .ph img { transform: scale(1.04); }

/* 侧边栏窄屏收起文字 */
@media (max-width: 1080px) {
  .sg-side { width: 76px; flex-basis: 76px; }
  .sg-brand-txt, .sg-nav-label, .sg-menu .el-menu-item span, .sg-menu-section span, .sg-side-foot span.txt { display: none; }
  .sg-brand { justify-content: center; padding: 0; }
  .sg-menu { padding: 0 10px; }
  .sg-menu .el-menu-item { justify-content: center; padding: 0 !important; }
  .sg-side-foot { justify-content: center; padding: 9px 0; }
}
