* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; background: #F5F7FA; color: #1B3A5C; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1976D2, #0D47A1); }
.login-box { width: 360px; background: #fff; border-radius: 12px; padding: 40px 32px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.login-box h1 { font-size: 22px; text-align: center; margin-bottom: 8px; color: #0D47A1; }
.login-box .sub { text-align: center; color: #8A94A6; font-size: 13px; margin-bottom: 28px; }
.login-box input { width: 100%; height: 44px; border: 1px solid #DCE1E8; border-radius: 8px; padding: 0 14px; font-size: 14px; margin-bottom: 16px; }
.login-box button { width: 100%; height: 44px; background: #1976D2; color: #fff; border: none; border-radius: 8px; font-size: 15px; cursor: pointer; }
.login-box button:hover { background: #1565C0; }
.login-err { color: #E53935; font-size: 13px; min-height: 18px; margin-bottom: 10px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: #0D2540; color: #C7D3E0; position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; }
.sidebar .brand { padding: 20px 18px; font-size: 17px; font-weight: 700; color: #fff; border-bottom: 1px solid #1A3556; }
.sidebar .nav-item { padding: 13px 20px; cursor: pointer; font-size: 14px; border-left: 3px solid transparent; }
.sidebar .nav-item:hover { background: #16335A; color: #fff; }
.sidebar .nav-item.active { background: #16335A; color: #fff; border-left-color: #FF9500; }
.sidebar .nav-group { padding: 10px 20px 4px; font-size: 12px; color: #5B7A9C; text-transform: uppercase; }
.sidebar .logout { position: absolute; bottom: 16px; left: 20px; right: 20px; padding: 10px; text-align: center; background: #1A3556; border-radius: 8px; cursor: pointer; font-size: 13px; }
.main { margin-left: 210px; flex: 1; padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.topbar h2 { font-size: 20px; }
.topbar .user { font-size: 13px; color: #8A94A6; }

/* 卡片/工具条 */
.toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { height: 36px; border: 1px solid #DCE1E8; border-radius: 6px; padding: 0 12px; font-size: 13px; }
.btn { height: 36px; padding: 0 18px; background: #1976D2; color: #fff; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; }
.btn:hover { background: #1565C0; }
.btn.green { background: #34C759; }
.btn.green:hover { background: #2FB24E; }
.btn.gray { background: #90A4AE; }
.btn.red { background: #E53935; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12px; }

/* 表格 */
table { width: 100%; background: #fff; border-radius: 8px; overflow: hidden; border-collapse: collapse; font-size: 13px; }
thead th { background: #EEF3F8; text-align: left; padding: 12px 14px; color: #50617A; font-weight: 600; }
tbody td { padding: 11px 14px; border-top: 1px solid #F0F3F7; }
tbody tr:hover { background: #F8FAFC; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; background: #E3F2FD; color: #1976D2; margin: 2px; }
.tag.service { background: #E8F5E9; color: #34C759; }
.tag.insider { background: #FFF3E0; color: #FF9500; }
.tag.guard { background: #F3E5F5; color: #9C27B0; }
.tag.admin { background: #E0F7FA; color: #00838F; }
.tag.gray { background: #ECEFF1; color: #607D8B; }
.tag.green { background: #E8F5E9; color: #34C759; }
.tag.orange { background: #FFF3E0; color: #FF9500; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
.pager button { height: 32px; padding: 0 14px; border: 1px solid #DCE1E8; background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; }
.pager button:disabled { opacity: .5; cursor: default; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { width: 460px; background: #fff; border-radius: 10px; padding: 24px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-bottom: 18px; font-size: 17px; }
.modal label { display: block; font-size: 13px; color: #50617A; margin: 12px 0 6px; }
.modal input, .modal select, .modal textarea { width: 100%; border: 1px solid #DCE1E8; border-radius: 6px; padding: 9px 12px; font-size: 13px; }
.modal textarea { min-height: 80px; resize: vertical; }
.modal .row { display: flex; gap: 12px; }
.modal .row > div { flex: 1; }
.modal-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.checks label { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 13px; color: #333; }

/* 统计报表 */
.stat-cards { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-card { flex: 1; min-width: 140px; background: #fff; border-radius: 10px; padding: 20px; }
.stat-card .num { font-size: 30px; font-weight: 700; color: #1976D2; }
.stat-card .lbl { font-size: 13px; color: #8A94A6; margin-top: 6px; }
.stat-card.green .num { color: #34C759; }
.stat-card.orange .num { color: #FF9500; }
.stat-card.purple .num { color: #9C27B0; }
.chart-card { background: #fff; border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.bar-row { display: flex; align-items: center; margin: 10px 0; font-size: 13px; }
.bar-row .name { width: 120px; color: #50617A; }
.bar-row .track { flex: 1; background: #F0F3F7; border-radius: 6px; height: 22px; overflow: hidden; }
.bar-row .fill { height: 100%; background: #1976D2; border-radius: 6px; }
.bar-row .val { width: 60px; text-align: right; color: #50617A; }
.empty { text-align: center; color: #8A94A6; padding: 50px 0; }
