:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --border: #e6e9ef;
  --text: #1f2733;
  --muted: #7a8699;
  --primary: #2f6fed;
  --primary-d: #2458c4;
  --green: #1f9d6b;
  --red: #e0483b;
  --orange: #e08a1e;
  --sidebar: #1e293b;
  --sidebar-hover: #2c3c52;
  --shadow: 0 2px 10px rgba(20, 35, 60, .06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
button { font-family: inherit; cursor: pointer; }

/* ---------- 登录页 ---------- */
.login-view {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(1100px 520px at 12% -8%, #dbe6ff 0%, rgba(219,230,255,0) 62%),
    radial-gradient(900px 480px at 105% 8%, #e2f5ef 0%, rgba(226,245,239,0) 60%),
    linear-gradient(180deg, #f6f8fc 0%, #eef2f8 100%);
}
.login-shell {
  display: grid; grid-template-columns: 1.05fr .95fr;
  width: 100%; max-width: 940px; min-height: 540px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(23, 43, 77, .12), 0 2px 8px rgba(23, 43, 77, .05);
}
/* 左侧品牌区 */
.login-brand {
  position: relative; padding: 46px 42px; color: #fff;
  background: linear-gradient(155deg, #1b2a44 0%, #23407a 55%, #2f6fed 100%);
  display: flex; flex-direction: column;
}
.login-brand::after {
  content: ""; position: absolute; inset: auto -60px -80px auto;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.lb-mark { display: grid; grid-template-columns: repeat(2, 11px); gap: 5px; margin-bottom: 26px; }
.lb-mark span { width: 11px; height: 11px; border-radius: 3px; background: rgba(255, 255, 255, .9); }
.lb-mark span:nth-child(2) { background: rgba(255, 255, 255, .55); }
.lb-mark span:nth-child(3) { background: rgba(255, 255, 255, .55); }
.lb-title { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: 3px; }
.lb-slogan { margin: 8px 0 0; font-size: 14px; color: rgba(255, 255, 255, .78); letter-spacing: 4px; }
.lb-points { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 16px; }
.lb-points li { position: relative; padding-left: 16px; }
.lb-points li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .85);
}
.lb-points b { display: block; font-size: 14px; font-weight: 700; letter-spacing: .5px; }
.lb-points span { display: block; margin-top: 3px; font-size: 12.5px; color: rgba(255, 255, 255, .7); line-height: 1.6; }
.lb-foot { margin-top: auto; padding-top: 26px; font-size: 12px; color: rgba(255, 255, 255, .62); letter-spacing: .3px; }

/* 右侧表单区 */
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 44px; background: var(--panel); }
.login-card { width: 100%; max-width: 330px; }
.lc-head { margin-bottom: 28px; }
.lc-head h2 { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: .5px; }
.lc-head p { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

.lc-field { margin-bottom: 16px; }
.lc-field label { display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 600; color: #4a5567; letter-spacing: .3px; }
.lc-input { position: relative; display: flex; align-items: center; }
.lc-input > svg { position: absolute; left: 12px; width: 17px; height: 17px; fill: #9aa5b6; pointer-events: none; }
.lc-input input {
  width: 100%; padding: 12px 14px 12px 38px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; color: var(--text); background: #fbfcfe;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.lc-input input::placeholder { color: #aeb7c6; }
.lc-input input:focus {
  outline: none; background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .13);
}
.lc-eye {
  position: absolute; right: 6px; display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border: none; border-radius: 8px; background: transparent;
}
.lc-eye svg { width: 18px; height: 18px; fill: #9aa5b6; }
.lc-eye:hover { background: #f0f3f8; }
.lc-eye:hover svg { fill: #5b6675; }

.login-err { min-height: 20px; margin: 4px 0 8px; font-size: 13px; text-align: center; color: var(--red); }

.lc-submit {
  width: 100%; padding: 13px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #3b7bf0, #2458c4);
  color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 3px;
  box-shadow: 0 6px 18px rgba(47, 111, 237, .28);
  transition: transform .12s, box-shadow .18s, filter .18s;
}
.lc-submit:hover { filter: brightness(1.06); box-shadow: 0 9px 22px rgba(47, 111, 237, .34); }
.lc-submit:active { transform: translateY(1px); }
.lc-submit:disabled { opacity: .7; cursor: not-allowed; filter: none; }

.lc-foot {
  display: flex; align-items: center; gap: 7px;
  margin-top: 26px; padding-top: 18px; border-top: 1px solid #eef1f6;
  font-size: 12px; color: var(--muted); line-height: 1.5;
}
.lc-foot svg { flex: none; width: 14px; height: 14px; fill: var(--green); }

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; max-width: 460px; }
  .login-brand { padding: 32px 30px; }
  .lb-points { display: none; }
  .lb-foot { margin-top: 18px; padding-top: 0; }
  .login-panel { padding: 32px 28px 38px; }
}

/* 布局 */
.app-view { display: flex; height: 100vh; }
.sidebar { width: 210px; background: var(--sidebar); color: #cfd8e6; display: flex; flex-direction: column; }
.brand { padding: 18px 20px; font-size: 18px; font-weight: 800; color: #fff; letter-spacing: 1px; border-bottom: 1px solid #2c3c52; }
.menu { padding: 10px 0; flex: 1; overflow: auto; }
.menu-item { padding: 11px 22px; cursor: pointer; color: #cfd8e6; display: flex; align-items: center; gap: 10px; border-left: 3px solid transparent; }
.menu-item:hover { background: var(--sidebar-hover); }
.menu-item.active { background: var(--sidebar-hover); border-left-color: var(--primary); color: #fff; }
.menu-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 56px; background: var(--panel); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 22px; }
.topbar-title { font-size: 17px; font-weight: 700; }
.topbar-user { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.badge { background: #eaf1ff; color: var(--primary); padding: 2px 9px; border-radius: 10px; font-size: 12px; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 5px 12px; border-radius: 7px; }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.content { flex: 1; overflow: auto; padding: 22px; }

/* 通用组件 */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 800; margin-top: 6px; }
.stat .value.green { color: var(--green); }
.stat .value.red { color: var(--red); }
.stat .value.orange { color: var(--orange); }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.btn { background: var(--primary); color: #fff; border: none; padding: 8px 16px; border-radius: 8px; font-weight: 600; }
.btn:hover { background: var(--primary-d); }
.btn.sm { padding: 5px 11px; font-size: 13px; }
.btn.line { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #f0b4ae; }
.btn.gray { background: #eef1f6; color: var(--text); }
input, select, textarea { font-family: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: #f7f9fc; color: var(--muted); font-weight: 600; }
tr:hover td { background: #fafbfe; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; }
.tag.green { background: #e6f6ee; color: var(--green); }
.tag.blue { background: #eaf1ff; color: var(--primary); }
.tag.orange { background: #fdf0db; color: var(--orange); }
.tag.red { background: #fdecea; color: var(--red); }
.tag.gray { background: #eef1f6; color: var(--muted); }

/* 进度步骤 */
.stepper { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.step { padding: 3px 10px; border-radius: 14px; font-size: 12px; border: 1px solid var(--border); background: #fff; color: var(--muted); }
.step.done { background: var(--green); color: #fff; border-color: var(--green); }
.step.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 图表 */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .bl { width: 64px; color: var(--muted); font-size: 12px; }
.bar-track { flex: 1; background: #eef1f6; border-radius: 6px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; }
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,25,45,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: #fff; width: 460px; max-width: 92vw; max-height: 88vh; overflow: auto; border-radius: 12px; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h3 { margin: 0 0 16px; font-size: 17px; }
.form-row { margin-bottom: 13px; }
.form-row label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 5px; }
.form-row input, .form-row select, .form-row textarea { width: 100%; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* 提示 */
.toast { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); background: #1e293b; color: #fff; padding: 10px 20px; border-radius: 8px; z-index: 99; opacity: 0; transition: opacity .25s; pointer-events: none; }
.toast.show { opacity: 1; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }
.empty { text-align: center; color: var(--muted); padding: 40px; }
.muted { color: var(--muted); }
.row-actions { display: flex; gap: 6px; }
.section-title { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
