* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif; background: #f4f6f9; color: #1f2937; font-size: 14px; }
a { color: inherit; text-decoration: none; }
.gf-toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-20px); background: #111827; color: #fff; padding: 12px 22px; border-radius: 8px; opacity: 0; pointer-events: none; transition: .25s; z-index: 9999; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.gf-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.gf-toast.error { background: #dc2626; }
.gf-toast.ok { background: #059669; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#1e3a8a,#2563eb,#0ea5e9); }
.login-card { width: 380px; background: #fff; border-radius: 16px; padding: 40px 36px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-card h1 { font-size: 22px; text-align: center; margin-bottom: 6px; color: #111827; }
.login-card .sub { text-align: center; color: #9ca3af; margin-bottom: 28px; font-size: 13px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: #6b7280; margin-bottom: 8px; }
.field input { width: 100%; height: 44px; border: 1px solid #d1d5db; border-radius: 8px; padding: 0 14px; font-size: 14px; outline: none; }
.field input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.btn { display: inline-block; height: 44px; line-height: 44px; padding: 0 22px; border: none; border-radius: 8px; background: #2563eb; color: #fff; font-size: 14px; cursor: pointer; text-align: center; }
.btn:hover { background: #1d4ed8; }
.btn.block { width: 100%; }
.btn.ghost { background: #f3f4f6; color: #374151; }
.btn.sm { height: 32px; line-height: 32px; padding: 0 14px; font-size: 13px; }
.btn.danger { background: #dc2626; }
.err { color: #dc2626; font-size: 13px; min-height: 20px; margin-bottom: 10px; text-align: center; }

/* 后台布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #111827; color: #d1d5db; flex-shrink: 0; position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; }
.sidebar .brand { height: 64px; display: flex; align-items: center; padding: 0 22px; font-size: 17px; font-weight: 600; color: #fff; border-bottom: 1px solid #1f2937; }
.sidebar .brand .dot { width: 10px; height: 10px; background: #3b82f6; border-radius: 3px; margin-right: 10px; }
.sidebar nav a { display: block; padding: 12px 22px; font-size: 14px; color: #9ca3af; }
.sidebar nav a:hover, .sidebar nav a.active { background: #1f2937; color: #fff; }
.sidebar nav .group { padding: 16px 22px 6px; font-size: 11px; color: #4b5563; text-transform: uppercase; }
.main { flex: 1; margin-left: 220px; width: calc(100% - 220px); }
.topbar { height: 64px; background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; }
.topbar .user { color: #6b7280; font-size: 13px; }
.content { padding: 28px; }
.card { background: #fff; border-radius: 12px; padding: 22px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 20px; }
.card h2 { font-size: 17px; margin-bottom: 18px; color: #111827; }
.card h2 .n { display: inline-block; width: 26px; height: 26px; line-height: 26px; text-align: center; background: #eff6ff; color: #2563eb; border-radius: 6px; font-size: 14px; margin-right: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid #eef0f3; font-size: 13px; }
th { color: #6b7280; font-weight: 500; background: #f9fafb; }
tr:hover td { background: #fafbfc; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat .label { color: #6b7280; font-size: 13px; }
.stat .num { font-size: 28px; font-weight: 600; color: #111827; margin-top: 8px; }
.stat .num.blue { color: #2563eb; }
.stat .num.green { color: #059669; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; background: #f3f4f6; color: #6b7280; }
.tag.ok { background: #d1fae5; color: #059669; }
.tag.warn { background: #fef3c7; color: #d97706; }
.tag.danger { background: #fee2e2; color: #dc2626; }
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; align-items: center; }
.toolbar .spacer { flex: 1; }
input.ip, select.ip { height: 38px; border: 1px solid #d1d5db; border-radius: 7px; padding: 0 10px; font-size: 13px; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 480px; max-height: 86vh; overflow-y: auto; padding: 26px; }
.modal h3 { font-size: 17px; margin-bottom: 20px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.checkbox-label { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font-size: 13px; color: #374151; }
.hint { color: #9ca3af; font-size: 12px; margin-top: 6px; line-height: 1.6; }
.upload-row { display: flex; gap: 8px; align-items: center; }
.upload-row input.ip { flex: 1; min-width: 0; background: #f9fafb; }
.upload-preview { display: none; max-width: 180px; max-height: 100px; margin-top: 10px; border: 1px solid #e5e7eb; border-radius: 8px; object-fit: cover; }
.upload-file { display: none; }
