:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --text: #1a2233;
  --muted: #6b7791;
  --line: #e4e9f3;
  --primary: #4f6ef7;
  --primary-dark: #3855e0;
  --primary-soft: #eef2ff;
  --gold: #f5a524;
  --green: #18a058;
  --red: #e5484d;
  --shadow: 0 10px 30px rgba(30, 50, 100, .08);
  --shadow-sm: 0 4px 14px rgba(30, 50, 100, .07);
  --radius: 18px;
}

* { box-sizing: border-box; }

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

button, input, select { font: inherit; }

button { cursor: pointer; }

a { color: var(--primary); text-decoration: none; }

.hidden { display: none !important; }

.container { width: min(1120px, 92vw); margin: 0 auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(79, 110, 247, .25); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fff1f1; color: var(--red); border-color: #ffd4d4; }
.btn-danger:hover { background: #ffe3e3; }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 14px;
  background: var(--surface-soft);
  color: var(--text);
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 110, 247, .12);
}

.msg { font-size: 13px; min-height: 20px; color: var(--red); }
.msg.success { color: var(--green); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
}
.badge.green { background: #e8f8f0; color: var(--green); }
.badge.gold { background: #fff4dc; color: #b97400; }
.badge.red { background: #ffeaea; color: var(--red); }
.badge.grey { background: #eef1f6; color: var(--muted); }

.muted { color: var(--muted); }
.tiny { font-size: 12px; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #5b78ff, #7a4fe7);
  color: #fff; display: grid; place-items: center; font-size: 18px;
}
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a {
  padding: 8px 14px; border-radius: 10px; color: var(--muted);
  font-size: 14px; font-weight: 600;
}
.nav a:hover, .nav a.active { background: var(--primary-soft); color: var(--primary); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 700; background: var(--surface-soft); }
tbody tr:hover { background: var(--surface-soft); }
tbody tr:last-child td { border-bottom: none; }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .em-icon { font-size: 38px; margin-bottom: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: #1a2233; color: #fff; padding: 11px 20px; border-radius: 12px;
  font-size: 14px; z-index: 999; box-shadow: 0 12px 30px rgba(0,0,0,.2);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
