* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: #f4f6f9; color: #333; font-size: 14px; }

/* ===== 登录页 ===== */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); }
.login-box { width: 360px; background: #fff; border-radius: 10px; padding: 40px 36px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.login-box h1 { font-size: 22px; text-align: center; margin-bottom: 6px; color: #1e3c72; }
.login-box .sub { text-align: center; color: #999; margin-bottom: 28px; font-size: 13px; }
.login-box .field { margin-bottom: 18px; }
.login-box label { display: block; margin-bottom: 6px; color: #555; font-size: 13px; }
.login-box input { width: 100%; padding: 10px 12px; border: 1px solid #dcdfe6; border-radius: 6px; outline: none; transition: border .2s; }
.login-box input:focus { border-color: #2a5298; }
.login-box .btn { width: 100%; padding: 11px; background: #2a5298; color: #fff; border: none; border-radius: 6px; font-size: 15px; cursor: pointer; }
.login-box .btn:disabled { background: #8ba3c8; cursor: not-allowed; }
.login-box .err { color: #e74c3c; font-size: 13px; margin-bottom: 12px; min-height: 18px; }

/* ===== 布局 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: #1e293b; color: #cbd5e1; flex-shrink: 0; position: fixed; top: 0; bottom: 0; overflow-y: auto; }
.sidebar .brand { padding: 18px 20px; font-size: 16px; font-weight: 600; color: #fff; border-bottom: 1px solid #2d3a4f; }
.sidebar .menu a { display: block; padding: 12px 20px; color: #cbd5e1; text-decoration: none; border-left: 3px solid transparent; }
.sidebar .menu a:hover { background: #26344a; color: #fff; }
.sidebar .menu a.active { background: #2a5298; color: #fff; border-left-color: #60a5fa; }
.main { flex: 1; margin-left: 200px; padding: 20px 28px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.topbar h2 { font-size: 20px; }
.topbar .user { color: #666; }

/* ===== 卡片与统计 ===== */
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 20px; margin-bottom: 20px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 8px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-card .num { font-size: 28px; font-weight: 700; color: #1e3c72; margin-top: 6px; }
.stat-card .label { color: #888; font-size: 13px; }
.stat-card.warn .num { color: #e67e22; }
.stat-card.danger .num { color: #e74c3c; }
.stat-card.ok .num { color: #27ae60; }

/* ===== 表格 ===== */
table.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid #f0f1f4; font-size: 13px; }
.table th { background: #f8fafc; color: #475569; font-weight: 600; white-space: nowrap; }
.table tr:hover td { background: #f8fafc; }

/* ===== 徽章 ===== */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; }
.badge.blue { background: #e0edff; color: #1d4ed8; }
.badge.green { background: #dcfce7; color: #15803d; }
.badge.orange { background: #ffedd5; color: #c2410c; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.badge.gray { background: #f1f5f9; color: #64748b; }
.badge.purple { background: #ede9fe; color: #6d28d9; }

/* ===== 提示条 ===== */
.alert { padding: 10px 14px; border-radius: 6px; font-size: 13px; }
.alert.danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.alert.warn { background: #ffedd5; color: #c2410c; border: 1px solid #fdba74; }
.alert.info { background: #e0edff; color: #1d4ed8; border: 1px solid #93c5fd; }

/* ===== 按钮 ===== */
.btn { display: inline-block; padding: 8px 16px; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; background: #2a5298; color: #fff; text-decoration: none; }
.btn:hover { opacity: .9; }
.btn:disabled { background: #a8b9d8; cursor: not-allowed; }
.btn.secondary { background: #f1f5f9; color: #334155; }
.btn.danger { background: #e74c3c; }
.btn.success { background: #27ae60; }
.btn.sm { padding: 5px 10px; font-size: 12px; }

/* ===== 表单 ===== */
.form-row { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.form-item { flex: 1; min-width: 220px; }
.form-item label { display: block; margin-bottom: 6px; color: #555; font-size: 13px; }
.form-item input, .form-item select, .form-item textarea { width: 100%; padding: 9px 12px; border: 1px solid #dcdfe6; border-radius: 6px; outline: none; font-size: 14px; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: #2a5298; }
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { padding: 8px 10px; border: 1px solid #dcdfe6; border-radius: 6px; outline: none; }

/* ===== 分页 ===== */
.pagination { display: flex; gap: 8px; margin-top: 16px; align-items: center; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid #dcdfe6; border-radius: 6px; text-decoration: none; color: #475569; font-size: 13px; }
.pagination a:hover { border-color: #2a5298; color: #2a5298; }

/* ===== 提示 ===== */
.msg { padding: 12px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; display: none; }
.msg.success { background: #dcfce7; color: #15803d; display: block; }
.msg.error { background: #fee2e2; color: #b91c1c; display: block; }
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); padding: 12px 24px; border-radius: 6px; color: #fff; font-size: 14px; z-index: 9999; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.toast.success { background: #27ae60; }
.toast.error { background: #e74c3c; }
.toast.info { background: #2a5298; }

.empty { text-align: center; color: #999; padding: 40px 0; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; word-break: break-all; }
