/* ============ 未来主义管理中台 · 全局样式 ============ */
:root {
  --bg-0: #05070f;
  --bg-1: #0a0e1c;
  --bg-2: #101629;
  --panel: rgba(20, 28, 56, 0.55);
  --panel-border: rgba(120, 160, 255, 0.16);
  --cyan: #00e5ff;
  --purple: #8b5cff;
  --pink: #ff4dd8;
  --green: #3ddc97;
  --amber: #ffb648;
  --red: #ff5c6c;
  --text-0: #eef3ff;
  --text-1: #9fb0d0;
  --text-2: #5d6b8a;
  --grad-main: linear-gradient(135deg, #00e5ff 0%, #8b5cff 100%);
  --radius: 14px;
  --sidebar-w: 240px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text-0);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 动态背景 ---------- */
.bg-canvas { position: fixed; inset: 0; z-index: 0; display: block; }

.app-shell, .login-wrap { position: relative; z-index: 1; }

/* ---------- 通用 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(120,160,255,.25); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(120,160,255,.45); }

.glass {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(60, 90, 180, 0.15);
  color: var(--text-0);
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all .25s ease;
  font-family: var(--font);
}
.btn:hover { background: rgba(60, 90, 180, 0.3); border-color: var(--cyan); box-shadow: 0 0 14px rgba(0, 229, 255, .25); }
.btn-primary {
  background: var(--grad-main);
  border: none;
  color: #06101c;
  font-weight: 700;
}
.btn-primary:hover { box-shadow: 0 0 22px rgba(0, 229, 255, .55); transform: translateY(-1px); }
.btn-danger { background: rgba(255, 92, 108, .15); border-color: rgba(255,92,108,.4); color: var(--red); }
.btn-danger:hover { background: rgba(255,92,108,.3); border-color: var(--red); box-shadow: 0 0 14px rgba(255,92,108,.35); }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }

.input, select.input, textarea.input {
  width: 100%;
  background: rgba(8, 12, 26, .7);
  border: 1px solid var(--panel-border);
  color: var(--text-0);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: all .25s;
  font-family: var(--font);
}
.input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 229, 255, .12); }
select.input option { background: var(--bg-1); }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.tag-green { color: var(--green); background: rgba(61, 220, 151, .12); }
.tag-amber { color: var(--amber); background: rgba(255, 182, 72, .12); }
.tag-red { color: var(--red); background: rgba(255, 92, 108, .12); }
.tag-blue { color: var(--cyan); background: rgba(0, 229, 255, .12); }
.tag-purple { color: var(--purple); background: rgba(139, 92, 255, .14); }

/* ============ 登录页 ============ */
.login-wrap {
  height: 100vh;
  display: flex; align-items: center; justify-content: center;
  perspective: 1200px;
}

.login-card {
  width: 400px;
  padding: 44px 40px 36px;
  position: relative;
  animation: floatIn .8s cubic-bezier(.2, .9, .3, 1.2);
}
.login-card::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0,229,255,.6), transparent 40%, transparent 60%, rgba(139,92,255,.6));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

.login-logo {
  width: 64px; height: 64px; margin: 0 auto 18px;
  border-radius: 18px;
  background: var(--grad-main);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 900; color: #06101c;
  box-shadow: 0 0 30px rgba(0, 229, 255, .5);
  animation: pulseGlow 3s ease-in-out infinite;
}

.login-title { text-align: center; font-size: 24px; font-weight: 800; letter-spacing: 4px; }
.login-sub { text-align: center; color: var(--text-1); font-size: 13px; margin: 8px 0 28px; letter-spacing: 2px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12px; color: var(--text-1); margin-bottom: 7px; letter-spacing: 1px; }
.field .hint { font-size: 12px; color: var(--cyan); margin-top: 6px; }

.login-btn {
  width: 100%; padding: 13px; font-size: 15px; border-radius: 12px;
  margin-top: 6px; position: relative; overflow: hidden;
}
.login-btn::after {
  content: ""; position: absolute; top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent);
  transition: left .5s;
}
.login-btn:hover::after { left: 130%; }

.login-foot { text-align: center; color: var(--text-2); font-size: 11px; margin-top: 22px; letter-spacing: 1px; }

.login-error {
  min-height: 18px; color: var(--red); font-size: 12px;
  text-align: center; margin-top: 10px;
}

/* ============ 主框架 ============ */
.app-shell { display: flex; height: 100vh; }

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex; flex-direction: column;
  background: rgba(10, 14, 28, .8);
  border-right: 1px solid var(--panel-border);
  backdrop-filter: blur(18px);
  transition: width .3s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(120,160,255,.08);
}
.brand-icon {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--grad-main);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px; color: #06101c;
  box-shadow: 0 0 18px rgba(0,229,255,.4);
}
.brand-text b { display: block; font-size: 15px; letter-spacing: 2px; }
.brand-text span { font-size: 10px; color: var(--text-2); letter-spacing: 3px; }

.nav { padding: 16px 12px; flex: 1; overflow-y: auto; }
.nav-group-title { font-size: 10px; color: var(--text-2); letter-spacing: 3px; padding: 14px 10px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--text-1);
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 3px;
  border: 1px solid transparent;
  transition: all .22s;
  user-select: none;
  position: relative;
}
.nav-item .ico { width: 18px; display: inline-flex; margin-right: 2px; }
.nav-item .ico svg { display: block; }
.nav-item:hover { color: var(--text-0); background: rgba(0, 229, 255, .07); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(0,229,255,.16), rgba(139,92,255,.16));
  border-color: rgba(0, 229, 255, .3);
  box-shadow: inset 0 0 18px rgba(0,229,255,.08);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 20%;
  width: 3px; height: 60%; border-radius: 3px;
  background: var(--grad-main);
  box-shadow: 0 0 10px var(--cyan);
}
.nav-badge { margin-left: auto; background: var(--pink); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }

.sidebar-foot { padding: 14px; border-top: 1px solid rgba(120,160,255,.08); }

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

.topbar {
  height: 62px; flex-shrink: 0;
  display: flex; align-items: center; gap: 16px;
  padding: 0 22px;
  background: rgba(10, 14, 28, .55);
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
}
.topbar .page-title { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.search-box {
  flex: 1; max-width: 380px; position: relative;
}
.search-box input { width: 100%; background: rgba(8,12,26,.6); border: 1px solid var(--panel-border); border-radius: 999px; color: var(--text-0); padding: 8px 16px 8px 38px; font-size: 13px; outline: none; transition: .25s; font-family: var(--font); }
.search-box input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,229,255,.1); }
.search-box .s-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); opacity: .6; display: inline-flex; pointer-events: none; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(60,90,180,.15); border: 1px solid var(--panel-border);
  cursor: pointer; font-size: 16px; transition: .25s;
}
.icon-btn:hover { border-color: var(--cyan); box-shadow: 0 0 12px rgba(0,229,255,.3); }
.dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 8px var(--pink); }

.user-chip { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 5px 10px 5px 5px; border-radius: 999px; border: 1px solid transparent; transition: .25s; }
.user-chip:hover { border-color: var(--panel-border); background: rgba(60,90,180,.12); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--grad-main); color: #06101c; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 12px rgba(0,229,255,.35);
}
.user-chip .uname { font-size: 13px; font-weight: 600; }
.user-chip .urole { font-size: 10px; color: var(--text-2); }

.content { flex: 1; overflow-y: auto; padding: 22px; }

/* ---------- 仪表盘 ---------- */
.page { animation: pageIn .45s ease; display: none; }
.page.active { display: block; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 20px; }
.stat-card { padding: 20px; position: relative; overflow: hidden; cursor: default; transition: transform .25s, box-shadow .25s; }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.stat-card::after { content: ""; position: absolute; top: 0; right: 0; width: 90px; height: 90px; border-radius: 50%; background: var(--accent, var(--cyan)); opacity: .08; filter: blur(10px); }
.stat-head { display: flex; justify-content: space-between; align-items: flex-start; }
.stat-label { font-size: 13px; color: var(--text-1); }
.stat-ico { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.stat-value { font-size: 30px; font-weight: 800; margin: 8px 0 6px; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.stat-trend { font-size: 12px; color: var(--text-1); }
.stat-trend b { font-weight: 700; }
.up b { color: var(--green); }
.down b { color: var(--red); }

.panel { padding: 20px; }
.panel h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.h-ico { display: inline-flex; vertical-align: -4px; color: var(--cyan); }
.h-ico svg { display: block; }
.panel .sub { font-size: 12px; color: var(--text-2); margin-bottom: 14px; }
.panel h3 .more { margin-left: auto; font-size: 12px; color: var(--cyan); cursor: pointer; font-weight: 500; }

.dash-row { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 20px; }
.dash-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.chart-box { position: relative; }
.chart-box canvas { width: 100%; display: block; }

/* 表格 */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--text-2); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; padding: 10px 14px; border-bottom: 1px solid rgba(120,160,255,.12); }
.tbl td { padding: 13px 14px; border-bottom: 1px solid rgba(120,160,255,.06); vertical-align: middle; }
.tbl tr { transition: background .2s; }
.tbl tbody tr:hover { background: rgba(0, 229, 255, .04); }
.tbl .u { display: flex; align-items: center; gap: 10px; }
.tbl .u .avatar { width: 30px; height: 30px; font-size: 11px; }

/* 工具条 */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .sp { flex: 1; }
.toolbar .input { width: 240px; }

/* 分页 */
.pager { display: flex; gap: 6px; justify-content: flex-end; margin-top: 14px; }
.pager button {
  min-width: 32px; height: 32px; border-radius: 8px;
  background: rgba(60,90,180,.12); border: 1px solid var(--panel-border);
  color: var(--text-1); cursor: pointer; font-size: 13px; transition: .2s; font-family: var(--font);
}
.pager button:hover { border-color: var(--cyan); color: var(--text-0); }
.pager button.cur { background: var(--grad-main); color: #06101c; font-weight: 700; border: none; }
.pager .info { align-self: center; margin-right: auto; font-size: 12px; color: var(--text-2); }

/* 消息中心 */
.msg-layout { display: grid; grid-template-columns: 300px 1fr 320px; gap: 18px; height: calc(100vh - 62px - 44px); }
.msg-side { display: flex; flex-direction: column; overflow: hidden; }
.msg-tabs { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid rgba(120,160,255,.1); }
.msg-tab { flex: 1; text-align: center; font-size: 12px; padding: 7px 0; border-radius: 8px; cursor: pointer; color: var(--text-1); border: 1px solid transparent; transition: .2s; }
.msg-tab.on { background: rgba(0,229,255,.12); color: var(--cyan); border-color: rgba(0,229,255,.3); }
.msg-list { flex: 1; overflow-y: auto; }
.msg-item { padding: 13px 16px; border-bottom: 1px solid rgba(120,160,255,.06); cursor: pointer; display: flex; gap: 12px; transition: .2s; }
.msg-item:hover { background: rgba(0,229,255,.05); }
.msg-item.on { background: rgba(0,229,255,.1); border-left: 3px solid var(--cyan); }
.msg-item .m-ico { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.msg-item .m-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.msg-item .m-time { font-size: 11px; color: var(--text-2); margin-top: 3px; }
.msg-item .m-pre { font-size: 12px; color: var(--text-1); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item .unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); margin-left: auto; }
.msg-detail { padding: 22px; overflow-y: auto; display: flex; flex-direction: column; }
.msg-detail .d-from { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.msg-detail .d-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.msg-detail .d-meta { font-size: 12px; color: var(--text-2); margin-bottom: 18px; }
.msg-detail .d-body { font-size: 14px; line-height: 1.9; color: var(--text-1); flex: 1; }
.msg-detail .d-body p { margin-bottom: 12px; }
.msg-ops { display: flex; gap: 10px; margin-top: 18px; }

/* 设置 */
.set-layout { display: grid; grid-template-columns: 220px 1fr; gap: 18px; }
.set-nav { display: flex; flex-direction: column; gap: 4px; padding: 14px; height: fit-content; }
.set-nav .nav-item { padding: 10px 14px; }
.set-panel { padding: 26px; max-height: calc(100vh - 62px - 44px); overflow-y: auto; }
.set-section { margin-bottom: 26px; }
.set-section h4 { font-size: 14px; margin-bottom: 14px; color: var(--cyan); letter-spacing: 1px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 12px; color: var(--text-1); margin-bottom: 6px; }

/* 开关 */
.switch { position: relative; width: 42px; height: 23px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0; border-radius: 999px; cursor: pointer;
  background: rgba(93, 107, 138, .35); border: 1px solid var(--panel-border); transition: .3s;
}
.switch i::before {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 17px; height: 17px; border-radius: 50%; background: var(--text-1); transition: .3s;
}
.switch input:checked + i { background: var(--grad-main); border: none; box-shadow: 0 0 12px rgba(0,229,255,.4); }
.switch input:checked + i::before { left: 21px; background: #fff; }

.set-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid rgba(120,160,255,.07); }
.set-row:last-child { border-bottom: none; }
.set-row .txt { flex: 1; }
.set-row .txt b { font-size: 14px; display: block; margin-bottom: 2px; }
.set-row .txt span { font-size: 12px; color: var(--text-2); }

/* 模态框 */
.modal-mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(3, 5, 12, .7); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
}
.modal-mask.show { display: flex; animation: fadeIn .25s; }
.modal { width: 480px; padding: 26px; animation: popIn .3s cubic-bezier(.2,.9,.3,1.3); }
.modal h3 { font-size: 17px; margin-bottom: 20px; }
.modal .ops { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* Toast */
#toast-wrap { position: fixed; top: 76px; right: 24px; z-index: 99; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 12px 18px; border-radius: 12px; font-size: 13px;
  background: rgba(20, 28, 56, .9); border: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: 10px;
  animation: slideIn .3s; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.toast.ok { border-color: rgba(61,220,151,.5); }
.toast.err { border-color: rgba(255,92,108,.5); }
.toast .t-ico { font-size: 16px; }

/* 图例 */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-1); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* 进度条 */
.bar-line { height: 8px; border-radius: 99px; background: rgba(120,160,255,.12); overflow: hidden; margin: 8px 0 4px; }
.bar-line i { display: block; height: 100%; border-radius: 99px; background: var(--grad-main); box-shadow: 0 0 8px rgba(0,229,255,.5); animation: grow 1.2s ease; }
.kpi-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-1); }
.kpi-row b { color: var(--text-0); font-variant-numeric: tabular-nums; }

/* 活动流 */
.act-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(120,160,255,.06); font-size: 13px; }
.act-item:last-child { border-bottom: none; }
.act-ico { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.act-item .t { color: var(--text-1); line-height: 1.5; }
.act-item .t b { color: var(--text-0); }
.act-item .time { font-size: 11px; color: var(--text-2); margin-top: 2px; }

/* 动画 */
@keyframes floatIn { from { opacity: 0; transform: translateY(30px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes pulseGlow { 0%,100% { box-shadow: 0 0 24px rgba(0,229,255,.4); } 50% { box-shadow: 0 0 44px rgba(139,92,255,.6); } }
@keyframes grow { from { width: 0; } }
