/* ===== 物联网设备 OTA 平台 样式 ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: #24292f;
  background: #f0f3f6;
  line-height: 1.5;
}
a { color: #0969da; text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: Consolas, "Courier New", monospace;
  background: #eef1f4;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12.5px;
}
h1 { font-size: 22px; }
h2 { font-size: 20px; margin: 18px 0 14px; }
h2 small { font-size: 13px; font-weight: normal; margin-left: 8px; }
h3 { font-size: 15px; margin: 0 0 12px; }
.muted { color: #6e7781; }
.mono-break { word-break: break-all; }

/* 友好名称展示（类型 / SKU 别名） */
.board-friendly { font-weight: 600; }
.board-code {
  font-size: 11.5px; color: #6e7781; background: none; padding: 0;
  word-break: break-all;
}

/* ===== 顶栏 ===== */
.topbar { background: #1f2d3d; color: #fff; }
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; height: 52px; gap: 24px;
}
.brand { color: #fff; font-weight: 600; font-size: 16px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  color: #b6c2cf; padding: 6px 14px; border-radius: 6px; font-size: 14px;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.nav a.active { color: #fff; background: #0969da; }
.userbox { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.username { color: #d7dee6; }

/* ===== 布局 ===== */
.container { max-width: 1200px; margin: 20px auto; padding: 0 20px 40px; }
.footer { text-align: center; color: #9aa4ad; font-size: 12px; padding: 18px 0 30px; }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2col { grid-template-columns: 1fr; } }

/* ===== 卡片 ===== */
.card {
  background: #fff; border: 1px solid #dce3ea; border-radius: 10px;
  padding: 18px 20px; margin-bottom: 16px;
}

/* ===== 统计卡 ===== */
.stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 900px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: #fff; border: 1px solid #dce3ea; border-radius: 10px;
  text-align: center; padding: 16px 8px;
}
.stat-num { font-size: 28px; font-weight: 700; color: #0969da; }
.stat-label { color: #6e7781; font-size: 13px; margin-top: 4px; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table-wrap .table { min-width: 900px; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid #eaeef2; text-align: left; vertical-align: middle; }
.table thead th { background: #f6f8fa; color: #424a53; font-weight: 600; white-space: nowrap; border-bottom: 2px solid #dce3ea; }
.table tbody tr:hover { background: #f8fafc; }
.table-kv th { width: 180px; color: #57606a; font-weight: 500; white-space: nowrap; }
.notes-cell { max-width: 220px; white-space: pre-wrap; word-break: break-all; }

/* ===== 表单 ===== */
label { display: block; margin-bottom: 12px; color: #424a53; font-weight: 500; }
input[type=text], input[type=password], select, textarea {
  width: 100%; padding: 7px 10px; border: 1px solid #cfd7de; border-radius: 6px;
  font-size: 14px; font-family: inherit; background: #fff; margin-top: 4px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #0969da33; border-color: #0969da; }
.input-sm { width: auto !important; display: inline-block; margin: 0; padding: 4px 8px; font-size: 13px; }
.form-narrow { max-width: 420px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; align-items: end; }
.form-grid .full-width { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.filter-bar { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar label { margin: 0; }
.filter-bar input[type=text] { width: 240px; }
.filter-bar select { width: 220px; }
.inline-form { display: inline-block; margin: 0; }
.inline-location-form { display: flex; gap: 6px; margin: 0; }
.inline-location-form input[type=text] { width: 170px; margin: 0; }
.checkbox-inline { display: flex; align-items: center; gap: 8px; font-weight: normal; }
.checkbox-inline input { width: auto; margin: 0; }
.release-form { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; }
.release-form label { margin: 0; }
.release-form select { width: 320px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-block; padding: 7px 16px; border: 1px solid #cfd7de; border-radius: 6px;
  background: #f6f8fa; color: #24292f; font-size: 14px; cursor: pointer; font-family: inherit;
}
.btn:hover { background: #eef1f4; text-decoration: none; }
.btn-primary { background: #0969da; border-color: #0969da; color: #fff; }
.btn-primary:hover { background: #0860c4; }
.btn-danger { background: #fff; border-color: #e5534b; color: #cf222e; }
.btn-danger:hover { background: #cf222e; color: #fff; }
.btn-danger:disabled { opacity: .45; cursor: not-allowed; }
.btn-danger:disabled:hover { background: #fff; color: #cf222e; }
.btn-ghost { background: transparent; border-color: transparent; color: #0969da; }
.btn-ghost:hover { background: #eef1f4; }
.btn-sm { padding: 3px 10px; font-size: 12.5px; }
.btn-block { display: block; width: 100%; }

/* ===== 开关 ===== */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: #cfd7de; border-radius: 22px;
  transition: background .15s; cursor: pointer;
}
.slider:before {
  content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .15s;
}
.switch input:checked + .slider { background: #2da44e; }
.switch input:checked + .slider:before { transform: translateX(18px); }
.switch input:disabled + .slider { opacity: .5; cursor: wait; }

/* ===== 标签 ===== */
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 12px;
  background: #eaeef2; color: #424a53; white-space: nowrap;
}
.tag-green  { background: #dafbe1; color: #1a7f37; }
.tag-blue   { background: #ddf4ff; color: #0969da; }
.tag-orange { background: #fff8c5; color: #9a6700; }
.tag-red    { background: #ffebe9; color: #cf222e; }

/* ===== 提示框 ===== */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: #dafbe1; border-color: #aceebb; color: #1a7f37; }
.alert-error   { background: #ffebe9; border-color: #ffc1c0; color: #cf222e; }
.alert-warn    { background: #fff8c5; border-color: #f5e0a0; color: #9a6700; }
.alert-info    { background: #ddf4ff; border-color: #b6e3ff; color: #0550ae; }

/* ===== 分页 ===== */
.pagination { display: flex; gap: 6px; margin: 14px 0; }
.pagination a, .page-cur {
  padding: 4px 11px; border: 1px solid #cfd7de; border-radius: 6px; background: #fff;
}
.page-cur { background: #0969da; border-color: #0969da; color: #fff; }

/* ===== 代码块 ===== */
.code-block {
  background: #f6f8fa; border: 1px solid #dce3ea; border-radius: 8px;
  padding: 12px 14px; overflow-x: auto; font-size: 12.5px; line-height: 1.45;
  font-family: Consolas, "Courier New", monospace; max-height: 420px; overflow-y: auto;
}

/* ===== 登录页 ===== */
.login-wrap { display: flex; justify-content: center; padding-top: 70px; }
.login-card { width: 380px; }
.login-card h1 { text-align: center; margin: 4px 0 2px; }
.login-card .muted { text-align: center; margin-bottom: 18px; }
.captcha-row { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.captcha-row input { flex: 1; margin: 0; }
.captcha-row img {
  height: 40px; width: 112px; border: 1px solid #cfd7de; border-radius: 6px;
  cursor: pointer; flex-shrink: 0;
}
.captcha-tip { font-size: 12px; font-weight: normal; }
