* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Microsoft YaHei UI", "PingFang SC", "Segoe UI", sans-serif;
  background: #eef1f6; color: #1f2937; font-size: 14px;
}

/* 登录 */
.login-wrap { display: flex; align-items: center; justify-content: center; height: 100vh; background: linear-gradient(135deg, #1d3557, #457b9d); }
.login-card { width: 360px; background: #fff; border-radius: 14px; padding: 34px 32px; box-shadow: 0 18px 50px rgba(0,0,0,.3); }
.login-card h1 { margin: 0 0 6px; font-size: 22px; color: #1d3557; }
.login-card .sub { margin: 0 0 22px; color: #8895a7; font-size: 13px; }
.login-card label { display: block; margin: 12px 0 5px; color: #4a5568; font-size: 13px; }
.login-card input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid #d5dbe3; border-radius: 8px; font-size: 14px; }
.login-card input:focus { outline: none; border-color: #457b9d; box-shadow: 0 0 0 3px rgba(69,123,157,.15); }
.login-card button { width: 100%; height: 42px; margin-top: 22px; background: #1d3557; color: #fff; border: 0; border-radius: 8px; font-size: 15px; cursor: pointer; }
.login-card button:disabled { opacity: .6; }
.login-card .err { color: #e0245e; min-height: 20px; margin: 10px 0 0; text-align: center; }

/* 布局 */
.layout { display: flex; height: 100vh; }
.sidebar { width: 210px; background: #1f2937; color: #cbd5e1; display: flex; flex-direction: column; flex-shrink: 0; }
.brand { padding: 22px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-title { font-size: 17px; font-weight: 700; color: #fff; }
.brand-sub { font-size: 11px; color: #7c8aa0; margin-top: 4px; letter-spacing: 1px; }
#nav { flex: 1; padding: 10px 0; }
.nav-item { display: block; width: 100%; text-align: left; padding: 13px 20px; background: none; border: 0; color: #cbd5e1; font-size: 14px; cursor: pointer; border-left: 3px solid transparent; }
.nav-item:hover { background: #273449; color: #fff; }
.nav-item.active { background: #273449; color: #fff; border-left-color: #4aa3ff; }
.logout { margin: 14px; padding: 11px; background: #334155; color: #e2e8f0; border: 0; border-radius: 8px; cursor: pointer; }
.logout:hover { background: #475569; }

.content { flex: 1; overflow: auto; padding: 26px 30px; }
.view { display: none; }
.view h2 { margin: 0 0 16px; font-size: 20px; color: #1f2937; }
.view h3 { margin: 22px 0 10px; font-size: 15px; color: #374151; }
.hint { color: #8895a7; margin-top: -6px; }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.stat { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat.warn .stat-val { color: #d97706; }
.stat-val { font-size: 26px; font-weight: 700; color: #1d3557; }
.stat-label { color: #6b7280; margin-top: 6px; font-size: 13px; }

/* 面板与表单 */
.panel { background: #fff; border-radius: 12px; padding: 18px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.panel h3 { margin: 0 0 12px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.inline-form label { color: #4a5568; font-size: 13px; }
.inline-form input { display: block; margin-top: 4px; height: 36px; padding: 0 10px; border: 1px solid #d5dbe3; border-radius: 7px; width: 120px; }
.gen-result { margin-top: 14px; }
.gen-result textarea { width: 100%; min-height: 160px; font-family: Consolas, monospace; font-size: 13px; border: 1px solid #d5dbe3; border-radius: 8px; padding: 10px; background: #f8fafc; }

/* 表格 */
.table-wrap { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid #eef1f6; white-space: nowrap; }
.table th { background: #f8fafc; color: #64748b; font-weight: 600; }
.table tr:hover td { background: #fafbfd; }
.table .empty { text-align: center; color: #9ca3af; padding: 28px; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; color: #334155; }
.strong { font-weight: 600; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; }
.acts button { white-space: nowrap; }

/* 按钮与徽标 */
button { font-family: inherit; }
.primary { background: #1d3557; color: #fff; border: 0; border-radius: 7px; padding: 8px 16px; cursor: pointer; font-size: 13px; }
.mini { background: #e2e8f0; color: #334155; border: 0; border-radius: 6px; padding: 4px 12px; cursor: pointer; font-size: 12px; margin-left: 8px; }
.table button { border: 0; border-radius: 6px; padding: 5px 10px; cursor: pointer; font-size: 12px; background: #eef2f7; color: #374151; }
.table button:hover { filter: brightness(.95); }
.table button.danger { background: #fde8e8; color: #c81e1e; }
.table button.ok { background: #e6f6ec; color: #15803d; }
.table button.warn { background: #fdf3e3; color: #b45309; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.green { background: #e6f6ec; color: #15803d; }
.badge.gray { background: #eef2f7; color: #64748b; }
.badge.red { background: #fde8e8; color: #c81e1e; }
.badge.orange { background: #fdf3e3; color: #b45309; }

/* toast */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 11px 20px; border-radius: 8px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.3); z-index: 999; }
.toast-err { background: #b91c1c; }
