* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(47, 154, 86, .25), transparent 60%),
    radial-gradient(circle at 50% 30%, #2a2f38, #0d1015);
  color: #e8e8e8;
  min-height: 100vh;
}
a { color: #ffd86b; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; background: rgba(0,0,0,.3); border-bottom: 1px solid rgba(255,255,255,.06);
}
.logo {
  margin: 0; font-size: 22px; letter-spacing: 3px; text-decoration: none;
  background: linear-gradient(180deg, #fff3c4, #e0a810);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar .right { display: flex; align-items: center; gap: 14px; font-size: 14px; color: #bbb; flex-wrap: wrap; }
.topbar .right b { color: #ffd86b; }
.wrap { max-width: 1100px; margin: 24px auto; padding: 0 20px; }
.card {
  background: linear-gradient(180deg, rgba(37,45,56,.92), rgba(26,32,41,.92));
  border: 1px solid #3a4250; border-radius: 14px;
  padding: 20px 22px; margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
.card h2 { margin: 0 0 14px; font-size: 18px; }
.btn {
  border: none; border-radius: 8px; padding: 8px 16px; font-size: 14px; font-weight: bold;
  color: #fff; cursor: pointer; font-family: inherit;
  background: #3a4453; transition: filter .15s;
}
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #e8a83d, #b97a1c); }
.btn.green { background: linear-gradient(180deg, #3cc06c, #238a4a); }
.btn.danger { background: linear-gradient(180deg, #d04848, #9c2e2e); }
.btn.ghost { background: transparent; border: 1px solid #555; color: #ccc; }
.btn.small { padding: 4px 10px; font-size: 12px; }
input, select {
  font-family: inherit; font-size: 14px;
  padding: 7px 10px; border-radius: 8px; border: 1px solid #4a5260;
  background: #1c222b; color: #fff;
}
input:focus, select:focus { outline: none; border-color: #e8a83d; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 16px; align-items: end; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #aaa; }
.form-grid label.chk { flex-direction: row; align-items: center; gap: 8px; padding-bottom: 8px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; color: #999; font-weight: normal; padding: 8px; border-bottom: 1px solid #3a4250; white-space: nowrap; }
table.list td { padding: 9px 8px; border-bottom: 1px solid rgba(255,255,255,.05); }
table.list tr:hover td { background: rgba(255,255,255,.03); }
table.list td.actions { white-space: nowrap; }
table.list td.actions .btn { margin-right: 4px; }
.empty { color: #888; text-align: center; padding: 20px; }
.pos { color: #4cff8a; }
.neg { color: #ff6b6b; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #3a4453; }
.tag.on { background: #238a4a; }
.tag.off { background: #7a2b2b; }
.warn {
  background: linear-gradient(90deg, rgba(208,72,72,.25), rgba(208,72,72,.1));
  border: 1px solid #a33; border-radius: 10px; padding: 12px 16px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* 弹窗 & 提示 */
.modal-wrap {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: #222a35; border: 1px solid #3a4250; border-radius: 14px; padding: 22px 24px;
  min-width: 320px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.modal h3 { margin: 0 0 4px; }
.modal label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #aaa; }
.modal .note { margin: 0; color: #ccc; font-size: 14px; }
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.toast {
  position: fixed; left: 50%; top: 24px; transform: translate(-50%, -20px); opacity: 0;
  background: #238a4a; color: #fff; padding: 10px 20px; border-radius: 10px; z-index: 200;
  transition: all .3s; box-shadow: 0 6px 20px rgba(0,0,0,.4); font-size: 14px;
}
.toast.error { background: #a33; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* 登录页 */
.login-box {
  width: 360px; margin: 12vh auto 0; text-align: center;
}
.login-box .suits { font-size: 40px; letter-spacing: 10px; margin-bottom: 4px; }
.login-box .suits .r { color: #e04040; }
.login-box h1 { margin: 0 0 24px; font-size: 30px; letter-spacing: 6px; }
.login-box form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-box input { padding: 11px 14px; font-size: 15px; }
.login-box .btn { padding: 12px; font-size: 16px; }
.login-box .err { color: #ff6b6b; min-height: 20px; font-size: 14px; text-align: center; }
