:root {
  --primary: #1f6fd6;
  --primary-dark: #1758ad;
  --accent: #7c5cff;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1a2333;
  --text-sub: #5b6b85;
  --radius: 12px;
  --shadow: 0 6px 18px rgba(31, 111, 214, 0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* 登录页 */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f6fd6 0%, #4a3fd6 55%, #7c5cff 100%);
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 16px;
  padding: 28px 28px; box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.auth-card h1 { font-size: 21px; margin-bottom: 4px; }
.auth-card .sub { color: var(--text-sub); font-size: 13px; margin-bottom: 20px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 5px; }
.field input, .field select {
  width: 100%; padding: 8px 12px; border: 1px solid #dbe2ee; border-radius: 8px;
  font-size: 13px; outline: none; transition: border .15s;
}
.field input:focus, .field select:focus { border-color: var(--primary); }
.btn {
  display: inline-block; border: none; background: linear-gradient(135deg, #1f6fd6, #7c5cff);
  color: #fff; font-weight: 600; padding: 8px 18px; border-radius: 8px;
  font-size: 14px; transition: opacity .15s, transform .15s;
}
.btn:hover { opacity: .92; transform: translateY(-1px); }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid #dbe2ee; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-sub); }
.auth-switch a { color: var(--primary); font-weight: 600; }
.error { color: #d93025; font-size: 13px; margin-bottom: 12px; display: none; }

/* 主界面 */
.topbar {
  position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px); border-bottom: 1px solid rgba(31,111,214,0.08);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 20px; height: 52px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { font-weight: 800; font-size: 16px; color: var(--primary); }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.topbar-right .user { color: var(--text-sub); }

.container { max-width: 1080px; margin: 0 auto; padding: 16px 20px; }
.layout { display: flex; gap: 16px; align-items: flex-start; }
.main { flex: 1; min-width: 0; }
.sidebar { width: 340px; flex-shrink: 0; position: sticky; top: 64px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab {
  padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--text-sub);
  background: #fff; border: 1px solid #e2e8f2; cursor: pointer; transition: all .15s;
}
.tab.active { background: linear-gradient(135deg, #1f6fd6, #7c5cff); color: #fff; border-color: transparent; }

.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); margin-bottom: 12px;
}
.card h2 { font-size: 15px; margin-bottom: 10px; }
.panel { display: none; }
.panel.active { display: block; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid #eef2f8; }
th { color: var(--text-sub); font-weight: 600; font-size: 12px; }
tr:hover td { background: #f8faff; }
.empty { color: var(--text-sub); text-align: center; padding: 18px; font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.group-form { display: flex; gap: 12px; align-items: flex-end; }
.table-scroll { max-height: 380px; overflow-y: auto; }
.table-scroll thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
.center-table th, .center-table td { text-align: center; }
textarea {
  width: 100%; min-height: 70px; padding: 8px 12px; border: 1px solid #dbe2ee;
  border-radius: 8px; font-size: 13px; outline: none; font-family: inherit; resize: vertical;
}
textarea:focus { border-color: var(--primary); }
.hint { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.progress-track { height: 6px; background: #eef2f8; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, #1f6fd6, #7c5cff); transition: width .2s; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px;
  background: #eef4ff; color: var(--primary-dark);
}
.badge.green { background: #e7f8ef; color: #1b8a4b; }
.badge.red { background: #fdeeee; color: #d93025; }
.badge.gray { background: #f1f3f7; color: var(--text-sub); }

.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: #1a2333; color: #fff; padding: 10px 20px; border-radius: 8px;
  font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 999;
  animation: toast-in .2s;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal-card {
  background: #fff; border-radius: 12px; padding: 24px; min-width: 300px; max-width: 90%;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.modal-msg { font-size: 15px; margin-bottom: 20px; color: var(--text); }
.modal-btns { display: flex; justify-content: flex-end; gap: 12px; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; position: static; }
}
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
}
