/* ============================================================
   固定资产标签卡
   ============================================================ */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #1f2328;
  background: #f5f6f8;
}
body.bare { background: #fff; }

a { color: #0d6efd; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------- 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 56px;
  background: #fff; border-bottom: 1px solid #e3e6ea;
  position: sticky; top: 0; z-index: 10;
}
.topbar .brand { font-size: 16px; font-weight: 600; color: #1f2328; }
.topbar nav a { margin-left: 18px; font-size: 14px; }

main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }
main.bare-main { max-width: none; padding: 16px; }

/* ---------------------------------------------------------- 通用 */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.page-head h2 { margin: 0; font-size: 18px; }
.count { font-size: 13px; font-weight: 400; color: #6b7280; margin-left: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 7px 14px; border-radius: 6px;
  border: 1px solid #d0d5dd; background: #fff; color: #1f2328;
  font-size: 14px; cursor: pointer; line-height: 1.4; text-decoration: none;
}
.btn:hover { background: #f3f4f6; text-decoration: none; }
.btn.primary { background: #0d6efd; border-color: #0d6efd; color: #fff; }
.btn.primary:hover { background: #0b5ed7; }
.btn.danger { color: #c0392b; border-color: #f0c4be; }
.btn.danger:hover { background: #fdf2f0; }
.btn.sm { padding: 3px 10px; font-size: 13px; }

.flash {
  padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 14px;
}
.flash-ok  { background: #e7f6ec; color: #14663a; border: 1px solid #b7e2c6; }
.flash-err { background: #fdecea; color: #99271c; border: 1px solid #f5c2bd; }

.empty {
  padding: 48px 20px; text-align: center; color: #6b7280;
  background: #fff; border: 1px dashed #d8dce1; border-radius: 8px;
}
.note { margin-top: 14px; font-size: 13px; color: #6b7280; }
.note code { background: #eef0f3; padding: 1px 6px; border-radius: 4px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------------------------------------------------------- 登录 */
.login-box {
  max-width: 360px; margin: 80px auto; padding: 28px;
  background: #fff; border: 1px solid #e3e6ea; border-radius: 10px;
}
.login-box h2 { margin: 0 0 20px; font-size: 18px; text-align: center; }
.login-box input {
  width: 100%; padding: 10px 12px; margin-bottom: 14px;
  border: 1px solid #d0d5dd; border-radius: 6px; font-size: 14px;
}
.login-box button {
  width: 100%; padding: 10px; border: 0; border-radius: 6px;
  background: #0d6efd; color: #fff; font-size: 15px; cursor: pointer;
}
.login-box .hint { margin: 14px 0 0; font-size: 12px; color: #9aa1a9; text-align: center; }

/* ---------------------------------------------------------- 列表 */
.list-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid #e3e6ea; border-radius: 8px; overflow: hidden;
}
.list-table th, .list-table td {
  padding: 10px 14px; text-align: left; border-bottom: 1px solid #eef0f3;
}
.list-table th { background: #fafbfc; font-weight: 600; font-size: 13px; color: #57606a; }
.list-table tr:last-child td { border-bottom: 0; }
.list-table .op { white-space: nowrap; text-align: right; }
.list-table .op .btn { margin-left: 6px; }

/* ---------------------------------------------------------- 表单 */
.form-card {
  background: #fff; border: 1px solid #e3e6ea; border-radius: 10px; padding: 24px;
  max-width: 640px;
}
.field { display: flex; align-items: center; margin-bottom: 14px; }
.field > span {
  flex: 0 0 96px; font-size: 14px; color: #57606a;
}
.field input {
  flex: 1; padding: 9px 12px; border: 1px solid #d0d5dd; border-radius: 6px;
  font-size: 14px;
}
.field input[readonly] { background: #f5f6f8; color: #6b7280; }
.form-card .actions { margin-top: 22px; }

/* ============================================================
   标签卡 —— 还原参考图样式（黑白、黑框、居中）
   ============================================================ */
.label-card {
  background: #fff;
  border: 2px solid #000;
  width: 100%;
  max-width: 720px;
  padding: 14px 16px 12px;
}
body.bare .label-card { margin: 0 auto; }

.label-title {
  font-family: "SimHei", "Heiti SC", "Microsoft YaHei", sans-serif;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 4px;
  text-align: center;
  padding: 6px 0 14px;
  color: #000;
}

.label-body { display: flex; align-items: stretch; gap: 14px; }

.label-table {
  flex: 1 1 auto;
  border-collapse: collapse;
  font-family: "SimSun", "Songti SC", "Microsoft YaHei", serif;
  font-size: 19px;
}
.label-table th, .label-table td {
  border: 1.5px solid #000;
  padding: 7px 10px;
  text-align: center;
  color: #000;
  font-weight: 400;
  line-height: 1.35;
}
.label-table th { width: 32%; white-space: nowrap; }
.label-table td { word-break: break-all; }

.label-qr {
  flex: 0 0 132px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border: 1.5px solid #000;
  padding: 8px;
}
.qr-box { width: 104px; height: 104px; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-caption { margin-top: 5px; font-size: 12px; color: #000; }

/* 批量打印 */
.print-sheet { display: flex; flex-wrap: wrap; gap: 14px; }
.print-sheet .label-card { max-width: 360px; flex: 0 0 auto; }
.print-sheet .label-title { font-size: 20px; letter-spacing: 2px; padding: 2px 0 8px; }
.print-sheet .label-table { font-size: 13px; }
.print-sheet .label-table th { width: 36%; }
.print-sheet .label-qr { flex: 0 0 90px; }
.print-sheet .qr-box { width: 68px; height: 68px; }
.print-sheet .qr-caption { font-size: 10px; }

/* ---------------------------------------------------------- 设置页 */
.panel.grow { flex: 2 1 420px; }
.side-col { flex: 1 1 300px; display: flex; flex-direction: column; gap: 18px; }
.panel .field > span { flex: 0 0 108px; font-size: 13px; }
.fields-table { width: 100%; border-collapse: collapse; margin: 6px 0 12px; }
.fields-table th, .fields-table td {
  padding: 6px 8px; border-bottom: 1px solid #eef0f3; text-align: left; font-size: 13px;
}
.fields-table th { color: #57606a; font-weight: 600; }
.fields-table input[type=text] {
  width: 100%; padding: 6px 9px; border: 1px solid #d0d5dd; border-radius: 6px; font-size: 14px;
}
.fields-table .ops { white-space: nowrap; text-align: right; }
.fields-table .ops .btn { padding: 2px 8px; margin-left: 3px; font-size: 12px; }
.fields-table code, .info-table code {
  font-size: 12px; color: #57606a; background: #f2f4f7; padding: 1px 5px; border-radius: 4px;
}
.hint { font-size: 12px; color: #9aa1a9; }
.info-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.info-table th, .info-table td { padding: 6px 8px; border-bottom: 1px solid #eef0f3; text-align: left; }
.info-table th { color: #57606a; font-weight: 600; white-space: nowrap; width: 84px; }
.panel .actions .btn { margin-right: 8px; }

/* ---------------------------------------------------------- 导入/导出 */
.two-col { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.panel {
  flex: 1 1 320px; background: #fff; border: 1px solid #e3e6ea;
  border-radius: 10px; padding: 20px 22px;
}
.panel h3 { margin: 0 0 14px; font-size: 16px; }
.panel input[type=file] {
  width: 100%; padding: 9px; border: 1px dashed #c8cdd4; border-radius: 6px;
  background: #fafbfc; font-size: 13px; margin-bottom: 12px;
}
.panel .radios { margin-bottom: 14px; font-size: 13px; color: #57606a; }
.panel .radios label { display: block; margin-bottom: 6px; cursor: pointer; }
.panel-desc { margin: 0 0 14px; font-size: 13px; color: #57606a; }
.imp-errors {
  margin-top: 16px; padding: 10px 14px; border-radius: 6px; font-size: 13px;
  background: #fdecea; border: 1px solid #f5c2bd; color: #99271c;
  max-height: 220px; overflow: auto;
}
.imp-errors ul { margin: 8px 0 0; padding-left: 20px; }

/* 扫码查看页（无二维码）：整行铺满，卡片收窄更好看 */
.label-card.no-qr { max-width: 560px; }

/* 手机扫码打开时更好读 */
@media (max-width: 640px) {
  main.bare-main { padding: 10px; }
  .label-card { padding: 12px 12px 10px; }
  .label-card.no-qr { max-width: none; }
  .label-title { font-size: 22px; letter-spacing: 2px; padding: 4px 0 10px; }
  .label-table { font-size: 16px; }
  .label-table th { width: 36%; }
  .label-table th, .label-table td { padding: 6px; }
}

/* ---------------------------------------------------------- 打印 */
@media print {
  body { background: #fff; }
  .no-print, .topbar, .flash { display: none !important; }
  main { padding: 0; max-width: none; }
  .label-card { border-color: #000; page-break-inside: avoid; margin: 0 0 12px; }
  .print-sheet { gap: 10px; }
}
