* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.6 -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif; color: #0f172a; background: #eef4fb; }
.hidden { display: none !important; }

/* ---------- 登录页 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(1100px 560px at 22% 0%, #e6efff 0%, #eef4fb 46%, #eaf2fb 100%); }
.boot { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.boot .logo { width: 46px; height: 46px; border-radius: 13px; }
.boot-text { color: #64748b; font-size: 13px; letter-spacing: 1px; }
.card { background: #fff; border-radius: 16px; box-shadow: 0 10px 40px rgba(15,23,42,.10); padding: 30px; }
.login-card { width: 380px; }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 8px; }
.login-brand .logo { width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; }
.login-card h1 { margin: 0; font-size: 19px; letter-spacing: .3px; }
.tabs-line { min-height: 18px; margin-bottom: 16px; color: #64748b; font-size: 12px; }
.tabs-line.admin-tip { color: #b45309; }
input, select { width: 100%; padding: 11px 13px; margin-bottom: 12px; border: 1px solid #dbe4f0; border-radius: 10px; background: #f8fafc; font-size: 14px; transition: border-color .15s, box-shadow .15s, background .15s; }
input:focus, select:focus { outline: none; background: #fff; border-color: #93b4ff; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
button { cursor: pointer; border: 0; border-radius: 10px; padding: 10px 16px; font-size: 14px; transition: filter .15s, background .15s; }
button:hover { filter: brightness(.97); }
button:disabled { cursor: default; opacity: .7; }
button.primary { width: 100%; height: 42px; background: linear-gradient(180deg, #2f6bff, #1d4ed8); color: #fff; font-size: 15px; letter-spacing: 2px; }
button.ghost { background: #eef2f7; color: #0f172a; }
.msg { margin-top: 10px; min-height: 20px; color: #dc2626; font-size: 13px; }
.msg.info { color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 10px; line-height: 1.5; }

/* ---------- 后台 ---------- */
.app { display: flex; min-height: 100vh; }
.side { flex: 0 0 214px; width: 214px; background: #0f172a; color: #e2e8f0; padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; font-size: 15px; font-weight: 600; padding: 2px 2px 12px; border-bottom: 1px solid rgba(148,163,184,.18); white-space: nowrap; }
.brand .logo { width: 26px; height: 26px; border-radius: 7px; flex: 0 0 auto; }
.who { font-size: 12px; color: #9fc0ff; background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.22); border-radius: 8px; padding: 5px 9px; margin: 8px 0 10px; word-break: break-all; }
nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
nav a { color: #cbd5e1; text-decoration: none; padding: 9px 11px; border-radius: 8px; font-size: 13px; white-space: nowrap; transition: background .15s, color .15s; }
nav a.on { background: #1e293b; color: #fff; box-shadow: inset 3px 0 0 #3b82f6; }
nav a:hover { background: #1e293b; color: #fff; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; background: #fff; border-bottom: 1px solid #e6edf6; }
.topbar h2 { margin: 0; font-size: 17px; }
.actions { display: flex; gap: 8px; }
.actions button { background: #eef2f7; }
.content { padding: 18px 22px 40px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: 0 2px 10px rgba(15,23,42,.05); }
.stat b { display: block; font-size: 22px; margin-top: 4px; color: #1d4ed8; }
.stat span { color: #64748b; font-size: 12px; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px rgba(15,23,42,.05); font-size: 13px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid #eef2f7; white-space: nowrap; }
th { background: #f8fafc; color: #475569; font-weight: 600; position: sticky; top: 0; }
tr:hover td { background: #f8fbff; }
.tag { padding: 1px 8px; border-radius: 999px; font-size: 12px; }
.ok { background: #dcfce7; color: #166534; }
.off { background: #fee2e2; color: #991b1b; }
.warn { background: #fef3c7; color: #92400e; }
form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; background: #fff; padding: 14px; border-radius: 12px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(15,23,42,.05); }
form.inline label { display: flex; flex-direction: column; font-size: 12px; color: #475569; gap: 4px; }
form.inline input, form.inline select { margin: 0; width: 150px; }
.scroll { max-height: 65vh; overflow: auto; }
.hint { color: #64748b; font-size: 12px; margin: 6px 0 14px; }
.muted { color: #94a3b8; }

/* 弹窗（改期 / 激活 / 导航权限） */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 99; }
.modal { background: #fff; border-radius: 14px; padding: 18px 20px 14px; width: 460px; max-width: 92vw; box-shadow: 0 24px 60px rgba(15,23,42,.28); }
.modal h3 { margin: 0 0 12px; font-size: 16px; }
.modal-body { font-size: 14px; color: #0f172a; }
.modal-body input { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.modal button.primary { width: auto; }
.modal .quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.modal .quick button { padding: 6px 12px; font-size: 13px; }
.navpick { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; }
.navpick label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.navpick input { width: auto; margin: 0; }

/* ---------- 窄屏（手机上看后台也能用） ---------- */
@media (max-width: 720px) {
  .login-card { width: 100%; max-width: 420px; }
  .app { flex-direction: column; }
  .side { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; }
  .side { flex: 1 0 100%; }
  .brand { border-bottom: 0; padding: 0 8px 0 0; }
  .who { margin: 0; }
  nav { flex-direction: row; flex-wrap: wrap; flex: 1 0 100%; }
  nav a { padding: 7px 10px; }
  .topbar { padding: 12px 14px; }
  .content { padding: 12px 14px 30px; }
}
