/* 设备管理系统样式 */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
  color: #1f2937;
  background: #f4f6f8;
  line-height: 1.6;
}
a { color: #0b6ea8; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; font-weight: 600; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; color: #111827; }

/* 顶栏 */
.topbar {
  background: #0f5c8c;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}
.tb-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  height: 56px;
  flex-wrap: wrap;
}
.brand { color: #fff; font-weight: 600; font-size: 16px; white-space: nowrap; }
.nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav a {
  color: #d7e8f4;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
}
.nav a:hover { background: rgba(255, 255, 255, .12); text-decoration: none; }
.nav a.active { background: rgba(255, 255, 255, .2); color: #fff; }
.tb-user { color: #d7e8f4; font-size: 13px; white-space: nowrap; }
.tb-user .logout { color: #fff; margin-left: 10px; }

/* 布局 */
.wrap { max-width: 1240px; margin: 18px auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pagehead .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sub { font-size: 13px; color: #6b7280; font-weight: normal; margin-left: 6px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .08);
}
.cardhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cardhead h2 { margin: 0; }

/* 统计卡 */
.stat { text-align: center; padding: 14px 10px; }
.stat-num { font-size: 26px; font-weight: 700; color: #0f5c8c; line-height: 1.2; }
.stat-num.ok { color: #0f766e; }
.stat-num.warn { color: #b45309; }
.stat-num.danger { color: #b91c1c; }
.stat-num.info { color: #1d4ed8; }
.stat-num.muted { color: #6b7280; }
.stat-label { font-size: 13px; color: #6b7280; margin-top: 4px; }

/* 按钮 */
.btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #fff;
  color: #1f2937;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.4;
}
.btn:hover { background: #f3f6f9; text-decoration: none; }
.btn-primary { background: #0f5c8c; border-color: #0f5c8c; color: #fff; }
.btn-primary:hover { background: #0d4d75; }
.btn-danger { background: #fff; border-color: #dc2626; color: #b91c1c; }
.btn-danger:hover { background: #fef2f2; }
.btn-plain { background: #f8fafc; }
.btn-sm { padding: 4px 9px; font-size: 13px; }
.btn-block { width: 100%; padding: 10px; }

/* 表格 */
.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid #eef1f4; text-align: left; vertical-align: middle; }
.table thead th { background: #f2f5f8; color: #374151; font-weight: 600; white-space: nowrap; }
.table tbody tr:hover { background: #fafcfe; }
.table .num { text-align: right; }
.table .op { white-space: nowrap; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 13px; color: #374151; }
.empty { color: #9ca3af; text-align: center; padding: 18px; }

/* 详情表 */
.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv th { width: 110px; text-align: left; color: #6b7280; font-weight: normal; padding: 6px 8px; vertical-align: top; }
.kv td { padding: 6px 8px; border-bottom: 1px solid #f3f5f7; }

/* 列表 */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid #f3f5f7; font-size: 14px; }
.list li:last-child { border-bottom: none; }
.meta { color: #6b7280; font-size: 12.5px; margin-left: 6px; }

/* 徽标 */
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; line-height: 1.7; vertical-align: middle; }
.badge-ok { background: #e7f6ef; color: #0f766e; }
.badge-warn { background: #fdf3e3; color: #b45309; }
.badge-danger { background: #fdecec; color: #b91c1c; }
.badge-info { background: #e8effd; color: #1d4ed8; }
.badge-muted { background: #f1f3f5; color: #6b7280; }

/* 表单 */
label { display: block; margin-bottom: 10px; font-size: 14px; color: #374151; }
label > input, label > select, label > textarea, label > span { display: block; width: 100%; margin-top: 4px; }
input, select, textarea {
  padding: 8px 10px;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: #1f2937;
  background: #fff;
  max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: #60a5fa; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.sechead { margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid #eef1f4; }
.formfoot { margin-top: 14px; display: flex; gap: 10px; }
.checkline { display: flex; align-items: center; gap: 8px; color: #374151; }
.checkline input { width: auto; margin: 0; }
.req { color: #b91c1c; }
.hint { color: #6b7280; font-size: 13px; margin: 6px 0; }
.foot { text-align: center; color: #9ca3af; font-size: 12px; padding: 20px 0 30px; }
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; background: #fff; padding: 10px; border-radius: 10px; box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.filterbar input, .filterbar select { width: auto; min-width: 120px; }
.inlineform { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.inlineform input, .inlineform select { width: auto; }
.w60 { width: 60px !important; }
.w120 { width: 120px !important; }
.rowform { display: inline; }
.rowform.inline { display: inline-flex; gap: 4px; align-items: center; }
.uploadform { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.uploadform input[type=file] { flex: 1; min-width: 180px; }

/* 消息条 */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.flash-ok { background: #e7f6ef; color: #0f766e; }
.flash-warn { background: #fdf3e3; color: #92400e; }
.flash-danger { background: #fdecec; color: #b91c1c; }

/* 分页 */
.pager { display: flex; gap: 6px; margin: 14px 0; flex-wrap: wrap; }
.pager a { padding: 5px 10px; border: 1px solid #d0d7de; border-radius: 6px; background: #fff; font-size: 14px; }
.pager a.active { background: #0f5c8c; border-color: #0f5c8c; color: #fff; }

/* 二维码 */
.qrbox { text-align: center; padding: 10px 0; }
.qrbox img, .qrbox canvas { max-width: 100%; }
.qrcard { text-align: center; }
.qrcard .hint { word-break: break-all; }

/* 时间线 */
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid #eef1f4; }
.timeline li { position: relative; padding: 0 0 14px 8px; }
.timeline li:before { content: ""; position: absolute; left: -21px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: #93c5fd; }
.tl-action { font-size: 14px; font-weight: 600; }
.tl-note { font-size: 13.5px; color: #4b5563; white-space: pre-wrap; }

/* 安装页 */
.install-body { background: #f4f6f8; }
.install-title { margin: 24px 0 16px; }

/* 登录页 */
.login-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(160deg, #0f5c8c, #0b7a76);
}
.login-box {
  background: #fff; padding: 28px 26px; border-radius: 12px; width: 340px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}
.login-box h1 { font-size: 18px; text-align: center; color: #0f5c8c; }
.login-sub { text-align: center; color: #6b7280; font-size: 13px; margin: 4px 0 18px; }
.login-hint { text-align: center; color: #9ca3af; font-size: 12px; margin: 14px 0 0; }

/* 打印 */
@media print {
  .topbar, .foot, .actions, .filterbar, .pager, .nav, .rowform, .uploadform, .timeline, .btn { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  .wrap { margin: 0; max-width: none; }
}

/* 手机 */
@media (max-width: 720px) {
  .tb-inner { height: auto; padding: 10px 14px; gap: 8px; }
  .brand { font-size: 15px; }
  .tb-user { display: none; }
  .nav { gap: 0; overflow-x: auto; white-space: nowrap; padding-bottom: 2px; }
  .nav a { padding: 7px 10px; font-size: 13px; }
  .wrap { padding: 0 10px; margin: 12px auto; }
  h1 { font-size: 19px; }
  .grid2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cols { grid-template-columns: 1fr; }
  .table th, .table td { padding: 8px 8px; font-size: 13.5px; }
  .kv th { width: 84px; }
  .btn { padding: 8px 12px; }
}
