:root {
  --bg: #f6f7fb;
  --panel: #fff;
  --text: #17142f;
  --muted: #747184;
  --line: #e8e6f0;
  --accent: #7b61ff;
  --success: #45b36b;
  --danger: #f06f6f;
  --warning: #ec8f45;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background: #fff;
  border-bottom: 1px solid #eeeaf8;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  color: #fff; font-weight: 800; background: linear-gradient(135deg, #7b61ff, #e36bca 55%, #22b8c9);
}
.brand h1 { margin: 0; font-size: 24px; }
.brand p { margin: 4px 0 0; color: var(--muted); }
.top-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pill { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border: 0; border-radius: 8px; background: #f8f7fc; color: #686477; }

.login-shell {
  min-height: 100vh;
  background: linear-gradient(108deg, rgba(255,255,255,.95) 0 48%, rgba(255,255,255,.55) 48% 100%),
    linear-gradient(135deg, #f2fbff, #faf7ff 42%, #fdeff8);
}
.login-main {
  min-height: calc(100vh - 88px);
  display: grid;
  grid-template-columns: 1fr minmax(340px, 480px);
  gap: 60px;
  align-items: center;
  padding: 42px clamp(24px, 8vw, 120px);
}
.login-copy h2 { font-size: clamp(38px, 5vw, 66px); margin: 0 0 16px; }
.login-copy h3 { font-size: 28px; margin: 0 0 18px; }
.login-copy p { color: var(--muted); font-size: 20px; }
.login-panel {
  padding: 44px;
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 18px 45px rgba(45,35,88,.12);
}
.login-panel h2 { margin: 0 0 8px; font-size: 32px; }
.field {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.field input { width: 100%; border: 0; outline: 0; background: transparent; }
.error { min-height: 20px; color: var(--danger); }

.layout { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; grid-template-rows: 88px 1fr; }
.layout .topbar { grid-column: 1 / -1; }
.sidebar {
  padding: 28px 14px;
  background: linear-gradient(180deg, #fff 0%, #f7f5ff 100%);
  border-right: 1px solid #eeeaf8;
}
.nav-btn {
  width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px;
  padding: 0 22px; border: 0; border-radius: 8px; background: transparent;
  color: #747184; text-align: left; font-size: 17px;
}
.nav-btn.active { background: #f0ebff; color: var(--accent); font-weight: 700; }
.content { min-width: 0; padding: 24px 34px 34px; background: linear-gradient(180deg, #f2efff 0, #f8f8fc 96px); }
.crumb { margin-bottom: 22px; color: #878397; }
.crumb strong { color: var(--accent); }

.dashboard { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 18px; margin-bottom: 22px; }
.card, .panel {
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(53,48,83,.06);
}
.card { min-height: 130px; padding: 22px; display: grid; align-content: center; gap: 8px; }
.card span { color: var(--muted); }
.card strong { color: var(--accent); font-size: 36px; }
.panel { padding: 28px 30px; margin-bottom: 22px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.panel-head h2 { margin: 0; font-size: 22px; }

.filters, .actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.control, textarea {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid #dcd9e8;
  border-radius: 6px;
  outline: 0;
  background: #fff;
  color: var(--text);
}
textarea { width: 100%; min-height: 150px; padding: 13px; resize: vertical; }
.btn {
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 16px; border: 1px solid #ded9ff; border-radius: 6px; background: #fff; color: var(--accent);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.green { background: #f1fbef; border-color: #d8f0d1; color: #57a957; }
.btn.red { background: #fff5f5; border-color: #ffd7d7; color: var(--danger); }
.btn.orange { background: #fff8ed; border-color: #ffd7a5; color: var(--warning); }

.table-wrap { width: 100%; min-width: 0; overflow-x: auto; }
table { width: 100%; min-width: 980px; border-collapse: collapse; }
th, td { height: 66px; padding: 0 14px; border-bottom: 1px solid #e9e7f0; text-align: center; color: #5e596a; }
th { color: var(--text); font-weight: 800; background: #fafafd; }
.status {
  min-width: 58px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px; border-radius: 6px; background: #eefbea; color: var(--success); font-weight: 700;
}
.status.off { background: #f4f1f1; color: #9b8790; }
.link { border: 0; background: transparent; color: var(--accent); }

.grid2 { display: grid; grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.3fr); gap: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 14px; }
.form-grid label { display: grid; gap: 8px; color: #4f4a62; min-width: 0; }
.form-grid .full { grid-column: 1 / -1; }
.info-list { display: grid; gap: 12px; }
.info-list p { margin: 0; padding: 14px 16px; border-radius: 8px; background: #fbfbfe; }
.info-list strong { display: block; margin-bottom: 6px; }
.info-list span { color: var(--muted); overflow-wrap: anywhere; }

.modal-mask {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 18px;
  background: rgba(20,16,36,.34); z-index: 20;
}
.modal { width: min(560px, 100%); padding: 26px; border-radius: 8px; background: #fff; box-shadow: 0 18px 45px rgba(45,35,88,.18); }
.modal h3 { margin: 0 0 18px; }
.modal label { display: grid; gap: 8px; margin: 14px 0; color: #4f4a62; }
.modal input, .modal select { width: 100%; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.toast { position: fixed; right: 22px; bottom: 22px; padding: 14px 18px; border-radius: 8px; background: #1f1a36; color: #fff; z-index: 30; }
.hidden { display: none; }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr; }
  .sidebar { display: flex; overflow-x: auto; gap: 8px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid #eeeaf8; }
  .nav-btn { width: auto; flex: 0 0 auto; }
  .dashboard, .grid2, .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .topbar { height: auto; align-items: flex-start; flex-direction: column; padding: 18px; }
  .brand h1 { font-size: 20px; }
  .login-main { grid-template-columns: 1fr; padding: 22px; }
  .login-panel, .panel { padding: 20px 18px; }
  .content { padding: 18px; }
  .filters, .actions, .panel-head { align-items: flex-start; flex-direction: column; }
  .control, .btn { width: 100%; }
  table { min-width: 760px; }
}
