/* SFA 独立后台样式（精简 apple 风） */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f5f7; color: #1d1d1f; font-size: 14px; }
a { color: #0071e3; text-decoration: none; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 200px; background: #1d1d1f; color: #f5f5f7; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; }
.brand { padding: 20px 16px; font-weight: 700; font-size: 16px; border-bottom: 1px solid #333; }
.sidebar nav { flex: 1; padding: 12px 8px; }
.nav-item { display: block; color: #a1a1a6; padding: 10px 12px; border-radius: 8px; margin-bottom: 2px; }
.nav-item:hover { background: #2c2c2e; color: #fff; }
.nav-item.active { background: #0071e3; color: #fff; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid #333; color: #a1a1a6; font-size: 12px; }
.sidebar-foot a { color: #ff6b6b; }
.main { flex: 1; margin-left: 200px; padding: 24px; max-width: 1200px; }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 16px; }
.card { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat .v { font-size: 28px; font-weight: 700; }
.stat .l { color: #6e6e73; font-size: 12px; margin-top: 4px; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f0f0f2; }
th { background: #fbfbfd; font-weight: 600; font-size: 13px; color: #1d1d1f; }
tr:hover td { background: #fafafc; }
.btn { display: inline-block; padding: 7px 14px; border-radius: 8px; border: none; background: #0071e3; color: #fff; font-size: 13px; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn-secondary { background: #e8e8ed; color: #1d1d1f; }
.btn-danger { background: #ff3b30; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select, form input, form select, form textarea {
    padding: 8px 10px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 14px; background: #fff;
}
form .row { margin-bottom: 12px; }
form label { display: block; margin-bottom: 4px; color: #6e6e73; font-size: 12px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash-success { background: #e8f8ee; color: #1a7f37; }
.flash-error { background: #fdecea; color: #c0392b; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.badge-green { background: #e8f8ee; color: #1a7f37; }
.badge-red { background: #fdecea; color: #c0392b; }
.badge-gray { background: #f0f0f2; color: #6e6e73; }
.badge-orange { background: #fff4e5; color: #b25e09; }
.pager { margin: 14px 0; color: #6e6e73; }
.pager a { margin: 0 6px; }
/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #1d1d1f 0%, #2c2c2e 100%); }
.login-box { background: #fff; border-radius: 16px; padding: 36px; width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-box h1 { font-size: 20px; margin-bottom: 6px; text-align: center; }
.login-box .sub { color: #6e6e73; text-align: center; margin-bottom: 22px; font-size: 13px; }
.login-box input { width: 100%; padding: 11px 12px; border: 1px solid #d2d2d7; border-radius: 10px; margin-bottom: 12px; font-size: 15px; }
.login-box .btn { width: 100%; padding: 11px; font-size: 15px; border-radius: 10px; }
.modal-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; align-items: center; justify-content: center; }
.modal-bg.show { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 480px; max-width: 92vw; max-height: 90vh; overflow: auto; }
.modal h3 { margin-bottom: 14px; }
.modal .actions { text-align: right; margin-top: 16px; display: flex; gap: 8px; justify-content: flex-end; }
/* 移动端：抽屉式导航 + 卡片化间距 */
.mobile-bar, .nav-mask, .side-close { display: none; }
.nav-btn { background: #f0f0f2; color: #1d1d1f; border: none; border-radius: 8px; width: 34px; height: 34px; font-size: 17px; line-height: 1; cursor: pointer; }
@media (max-width: 820px) {
    .sidebar { width: 250px; transform: translateX(-105%); transition: transform .22s ease; z-index: 70; box-shadow: 8px 0 24px rgba(0,0,0,.18); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .nav-mask { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.38); z-index: 60; }
    .brand { display: flex; align-items: center; justify-content: space-between; font-size: 15px; padding: 16px; }
    .side-close { display: block; background: transparent; border: none; color: #a1a1a6; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
    .nav-item { font-size: 14px; padding: 11px 12px; }
    .main { margin-left: 0; padding: 12px 12px 40px; max-width: none; }
    .mobile-bar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 40;
        margin: -12px -12px 12px; padding: 8px 12px; background: rgba(255,255,255,.94);
        backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid #e8e8ed; }
    .mobile-bar .mb-title { font-weight: 600; font-size: 14px; }
    .page-title { font-size: 19px; margin-bottom: 12px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .stat { padding: 12px; border-radius: 10px; }
    .stat .v { font-size: 21px; }
    .stat .l { font-size: 11px; }
    .card { padding: 14px; border-radius: 10px; margin-bottom: 12px; overflow-x: auto; }
    .toolbar { gap: 6px; }
    .toolbar form { flex-wrap: wrap; width: 100%; }
    .toolbar input, .toolbar select { flex: 1 1 120px; min-width: 0; }
    input, select, textarea, button { font-size: 16px; }
    .btn { padding: 8px 12px; }
    table { font-size: 12px; }
    th, td { padding: 8px; white-space: nowrap; }
    .pager { font-size: 13px; }
    .modal { width: 94vw; padding: 16px; }
}

