/* ==================== 基础样式 ==================== */
body { font-size: 14px; }
.table td, .table th { vertical-align: middle; }
.cell-level { border-radius: 4px; padding: 4px 6px !important; }
.item-row textarea { resize: vertical; }
.card { border: 1px solid #e9ecef; }
.navbar-brand { font-weight: 700; }

/* ==================== 移动端优化 ==================== */
@media (max-width: 768px) {

  /* 表格横向滚动兜底 */
  .table-responsive { -webkit-overflow-scrolling: touch; }

  /* ============ 执行页卡片化 ============ */
  .exec-table thead { display: none; }
  .exec-table tbody tr {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 10px;
    background: #fff;
  }
  .exec-table tbody td {
    display: block;
    border: none !important;
    padding: 4px 2px !important;
    text-align: left !important;
    grid-column: 1 / -1;
  }
  .exec-table tbody td.cell-item:before { content: ''; }
  .exec-table tbody td.cell-meta {
    grid-column: span 1;
    text-align: center !important;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 6px 2px !important;
  }
  .exec-table tbody td.cell-meta:before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: #868e96;
    font-weight: 600;
    margin-bottom: 2px;
  }
  .exec-table tbody td.cell-meta .v {
    font-size: 15px;
    font-weight: bold;
    color: #212529;
  }
  .exec-table .btn-group { width: 100%; }
  .exec-table .btn-group .btn { flex: 1; padding: 8px 4px; font-size: 14px; }

  /* 底部操作按钮吸底 */
  .exec-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #dee2e6;
    padding: 10px 0;
    margin: 0 -12px !important;
    z-index: 10;
  }
  .exec-actions .btn { font-size: 15px; padding: 10px; }

  /* ============ 查看页卡片化 ============ */
  .view-table thead { display: none; }
  .view-table tbody tr {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 12px;
    padding: 10px;
    background: #fff;
  }
  .view-table tbody td {
    display: block;
    border: none !important;
    padding: 4px 2px !important;
    text-align: left !important;
    grid-column: 1 / -1;
    font-size: 13px;
  }
  .view-table tbody td.vt-idx {
    grid-column: span 1;
    background: #495057;
    color: #fff;
    border-radius: 4px;
    text-align: center !important;
    font-weight: 600;
    padding: 4px !important;
  }
  .view-table tbody td.vt-idx:before { content: '第 '; }
  .view-table tbody td.vt-idx:after { content: ' 项'; }
  .view-table tbody td.vt-item {
    font-size: 15px;
    font-weight: bold;
    color: #212529;
    padding: 6px 2px !important;
  }
  .view-table tbody td.vt-meta {
    grid-column: span 1;
    text-align: center !important;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 6px 2px !important;
  }
  .view-table tbody td.vt-meta:before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: #868e96;
    font-weight: 600;
  }
  .view-table tbody td.vt-meta .v {
    font-size: 15px;
    font-weight: bold;
  }
  .view-table tbody td.vt-level {
    grid-column: 1 / -1;
    text-align: center !important;
    color: #fff;
    border-radius: 4px;
    padding: 6px !important;
    font-weight: 600;
  }
  .view-table tbody td.vt-std:before,
  .view-table tbody td.vt-fail:before,
  .view-table tbody td.vt-ctrl:before,
  .view-table tbody td.vt-sug:before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: #868e96;
    font-weight: 600;
    margin-bottom: 2px;
  }

  /* ============ 检查记录列表卡片化 ============ */
  .rec-table thead { display: none; }
  .rec-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 12px;
    background: #fff;
  }
  .rec-table tbody td {
    display: block;
    border: none !important;
    padding: 0 !important;
    grid-column: 1 / -1;
  }
  .rec-table tbody td.rt-idx { display: none; }
  .rec-table tbody td.rt-title {
    grid-column: 1;
    font-size: 15px;
    font-weight: bold;
  }
  .rec-table tbody td.rt-status {
    grid-column: 2;
    text-align: right !important;
  }
  .rec-table tbody td.rt-date,
  .rec-table tbody td.rt-user {
    grid-column: 1 / -1;
    font-size: 13px;
    color: #495057;
  }
  .rec-table tbody td.rt-date:before { content: '日期：'; color: #868e96; }
  .rec-table tbody td.rt-user:before { content: '执行人：'; color: #868e96; }
  .rec-table tbody td.rt-result {
    grid-column: 1 / -1;
    padding-top: 8px !important;
    border-top: 1px solid #f1f3f5 !important;
    margin-top: 4px;
  }
  .rec-table tbody td.rt-action {
    grid-column: 1 / -1;
    padding-top: 8px !important;
    border-top: 1px solid #f1f3f5 !important;
    margin-top: 4px;
  }
  .rec-table tbody td.rt-action .btn { margin-right: 6px; }

  /* ============ 检查记录详情页卡片化 ============ */
  .recview-table thead { display: none; }
  .recview-table tbody tr {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 10px;
    background: #fff;
  }
  .recview-table tbody td {
    display: block;
    border: none !important;
    padding: 4px 2px !important;
    text-align: left !important;
    grid-column: 1 / -1;
    font-size: 13px;
  }
  .recview-table tbody td.rv-idx {
    grid-column: span 1;
    background: #495057;
    color: #fff;
    border-radius: 4px;
    text-align: center !important;
    font-weight: 600;
    padding: 4px !important;
    align-self: start;
  }
  .recview-table tbody td.rv-idx:before { content: '第 '; }
  .recview-table tbody td.rv-idx:after { content: ' 项'; }
  .recview-table tbody td.rv-item {
    grid-column: 2 / -1;
    font-size: 15px;
    font-weight: bold;
    color: #212529;
    padding: 6px 2px !important;
  }
  .recview-table tbody td.rv-meta {
    grid-column: span 1;
    text-align: center !important;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 6px 2px !important;
  }
  .recview-table tbody td.rv-meta:before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: #868e96;
    font-weight: 600;
  }
  .recview-table tbody td.rv-meta .v {
    font-size: 15px;
    font-weight: bold;
  }
  .recview-table tbody td.rv-result {
    grid-column: 1 / -1;
    text-align: center !important;
    padding-top: 8px !important;
    margin-top: 4px;
    border-top: 1px solid #f1f3f5 !important;
  }
  .recview-table tbody td.rv-note:before {
    content: '备注：';
    color: #868e96;
    font-size: 11px;
    font-weight: 600;
  }

  /* ============ 设备清单卡片化 ============ */
  .eq-table thead { display: none; }
  .eq-table tbody tr {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 10px;
    background: #fff;
  }
  .eq-table tbody td {
    display: block;
    border: none !important;
    padding: 4px 2px !important;
    text-align: left !important;
    grid-column: 1 / -1;
    font-size: 13px;
  }
  .eq-table tbody td.et-idx { display: none; }
  .eq-table tbody td.et-name {
    font-size: 16px;
    font-weight: bold;
    color: #212529;
    grid-column: 1 / -1;
    padding: 4px 2px 8px !important;
    border-bottom: 1px solid #f1f3f5 !important;
  }
  .eq-table tbody td.et-field {
    grid-column: span 1;
    text-align: center !important;
  }
  .eq-table tbody td.et-field:before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: #868e96;
    font-weight: 600;
  }
  .eq-table tbody td.et-field .v {
    font-size: 13px;
    color: #495057;
  }
  .eq-table tbody td.et-field.full {
    grid-column: 1 / -1;
    text-align: left !important;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 6px 8px !important;
  }
  .eq-table tbody td.et-action {
    grid-column: 1 / -1;
    padding-top: 8px !important;
    margin-top: 4px;
    border-top: 1px solid #f1f3f5 !important;
    text-align: right !important;
  }
  .eq-table tbody td.et-action .btn { margin-left: 4px; }

  /* ============ 检查表列表卡片化 ============ */
  .cl-table thead { display: none; }
  .cl-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 12px;
    background: #fff;
  }
  .cl-table tbody td {
    display: block;
    border: none !important;
    padding: 0 !important;
    grid-column: 1 / -1;
  }
  .cl-table tbody td.cl-idx { display: none; }
  .cl-table tbody td.cl-title {
    grid-column: 1;
    font-size: 15px;
    font-weight: bold;
  }
  .cl-table tbody td.cl-status {
    grid-column: 2;
    text-align: right !important;
  }
  .cl-table tbody td.cl-eq,
  .cl-table tbody td.cl-date {
    grid-column: 1 / -1;
    font-size: 13px;
    color: #495057;
  }
  .cl-table tbody td.cl-eq:before { content: '设备：'; color: #868e96; }
  .cl-table tbody td.cl-date:before { content: '日期：'; color: #868e96; }
  .cl-table tbody td.cl-plan {
    grid-column: 1 / -1;
    padding-top: 8px !important;
    border-top: 1px solid #f1f3f5 !important;
    margin-top: 4px;
    font-size: 13px;
  }
  .cl-table tbody td.cl-plan:before {
    content: '检查计划：';
    color: #868e96;
    margin-right: 4px;
  }
  .cl-table tbody td.cl-action {
    grid-column: 1 / -1;
    padding-top: 8px !important;
    border-top: 1px solid #f1f3f5 !important;
    margin-top: 4px;
  }
  .cl-table tbody td.cl-action .btn { margin: 2px 4px 2px 0; }

  /* ============ 检查计划列表卡片化 ============ */
  .plan-table thead { display: none; }
  .plan-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 12px;
    background: #fff;
  }
  .plan-table tbody td {
    display: block;
    border: none !important;
    padding: 0 !important;
    grid-column: 1 / -1;
  }
  .plan-table tbody td.pl-idx { display: none; }
  .plan-table tbody td.pl-title {
    grid-column: 1;
    font-size: 15px;
    font-weight: bold;
  }
  .plan-table tbody td.pl-status {
    grid-column: 2;
    text-align: right !important;
  }
  .plan-table tbody td.pl-eq,
  .plan-table tbody td.pl-cycle,
  .plan-table tbody td.pl-next,
  .plan-table tbody td.pl-resp {
    grid-column: 1 / -1;
    font-size: 13px;
    color: #495057;
  }
  .plan-table tbody td.pl-eq:before { content: '设备：'; color: #868e96; }
  .plan-table tbody td.pl-cycle:before { content: '周期：'; color: #868e96; }
  .plan-table tbody td.pl-next:before { content: '下次：'; color: #868e96; }
  .plan-table tbody td.pl-resp:before { content: '责任人：'; color: #868e96; }
  .plan-table tbody td.pl-action {
    grid-column: 1 / -1;
    padding-top: 8px !important;
    border-top: 1px solid #f1f3f5 !important;
    margin-top: 4px;
  }
  .plan-table tbody td.pl-action .btn { margin: 2px 4px 2px 0; }

  /* ============ 隐患台账卡片化 ============ */
  .hz-table thead { display: none; }
  .hz-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 12px;
    background: #fff;
  }
  .hz-table tbody td {
    display: block;
    border: none !important;
    padding: 0 !important;
    grid-column: 1 / -1;
  }
  .hz-table tbody td.hz-idx { display: none; }
  .hz-table tbody td.hz-title {
    grid-column: 1;
    font-size: 15px;
    font-weight: bold;
    color: #212529;
  }
  .hz-table tbody td.hz-title a { color: #212529; }
  .hz-table .hz-title .desc {
    display: block;
    font-size: 12px;
    color: #868e96;
    margin-top: 2px;
    line-height: 1.4;
    font-weight: normal;
  }
  .hz-table tbody td.hz-level {
    grid-column: 2;
    text-align: right !important;
  }
  .hz-table tbody td.hz-eq,
  .hz-table tbody td.hz-status,
  .hz-table tbody td.hz-resp,
  .hz-table tbody td.hz-deadline {
    grid-column: 1 / -1;
    font-size: 13px;
    color: #495057;
    padding: 2px 0 !important;
  }
  .hz-table tbody td.hz-eq:before { content: '设备：'; color: #adb5bd; }
  .hz-table tbody td.hz-status:before { content: '状态：'; color: #adb5bd; }
  .hz-table tbody td.hz-resp:before { content: '责任人：'; color: #adb5bd; }
  .hz-table tbody td.hz-deadline:before { content: '期限：'; color: #adb5bd; }
  .hz-table tbody td.hz-action {
    grid-column: 1 / -1;
    padding-top: 8px !important;
    border-top: 1px solid #f1f3f5 !important;
    margin-top: 4px;
  }
  .hz-table tbody td.hz-action .btn { margin: 2px 4px 2px 0; }

  /* ============ 用户管理列表卡片化 ============ */
  .us-table thead { display: none; }
  .us-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 12px;
    background: #fff;
  }
  .us-table tbody td {
    display: block;
    border: none !important;
    padding: 0 !important;
    grid-column: 1 / -1;
  }
  .us-table tbody td.us-idx { display: none; }
  .us-table tbody td.us-username {
    grid-column: 1;
    font-size: 15px;
    font-weight: bold;
  }
  .us-table tbody td.us-role {
    grid-column: 2;
    text-align: right !important;
  }
  .us-table tbody td.us-realname,
  .us-table tbody td.us-created {
    grid-column: 1 / -1;
    font-size: 13px;
    color: #495057;
    padding: 2px 0 !important;
  }
  .us-table tbody td.us-realname:before { content: '姓名：'; color: #adb5bd; }
  .us-table tbody td.us-created:before { content: '注册：'; color: #adb5bd; }
  .us-table tbody td.us-action {
    grid-column: 1 / -1;
    padding-top: 10px !important;
    border-top: 1px solid #f1f3f5 !important;
    margin-top: 4px;
  }
  .us-table tbody td.us-action form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .us-table tbody td.us-action form input[type=text] {
    flex: 0 0 100%;
  }
  .us-table tbody td.us-action form button[value=reset_pwd] {
    flex: 0 0 100%;
  }
  .us-table tbody td.us-action form select {
    flex: 1;
  }
  .us-table tbody td.us-action form button[value=change_role] {
    flex: 0 0 auto;
  }
  .us-table tbody td.us-action form button[value=delete] {
    flex: 0 0 100%;
  }

  /* ============ 文章管理列表卡片化 ============ */
  .art-table thead { display: none; }
  .art-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 12px;
    background: #fff;
  }
  .art-table tbody td {
    display: block;
    border: none !important;
    padding: 0 !important;
    grid-column: 1 / -1;
  }
  .art-table tbody td.at-idx { display: none; }
  .art-table tbody td.at-title {
    grid-column: 1;
    font-size: 15px;
    font-weight: bold;
    padding-right: 8px !important;
  }
  .art-table tbody td.at-title a { color: #212529; text-decoration: none; }
  .art-table tbody td.at-views {
    grid-column: 2;
    text-align: right !important;
    font-size: 12px;
    color: #868e96;
    white-space: nowrap;
  }
  .art-table tbody td.at-views:after { content: ' 阅读'; }
  .art-table tbody td.at-cat {
    grid-column: 1 / -1;
    padding: 4px 0 !important;
  }
  .art-table tbody td.at-status {
    grid-column: 1;
    padding: 2px 0 !important;
  }
  .art-table tbody td.at-date {
    grid-column: 2;
    text-align: right !important;
    font-size: 12px;
    color: #868e96;
    padding: 2px 0 !important;
  }
  .art-table tbody td.at-action {
    grid-column: 1 / -1;
    padding-top: 8px !important;
    border-top: 1px solid #f1f3f5 !important;
    margin-top: 4px;
  }
  .art-table tbody td.at-action .btn { margin: 2px 4px 2px 0; }

  /* ============ 风险大屏 TOP10 卡片化 ============ */
  .top-table thead { display: none; }
  .top-table tbody tr {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 10px;
    background: #fff;
  }
  .top-table tbody td {
    display: block;
    border: none !important;
    padding: 4px 2px !important;
    text-align: left !important;
    grid-column: 1 / -1;
    font-size: 13px;
  }
  .top-table tbody td.tt-rank {
    grid-column: span 1;
    background: #495057;
    color: #fff !important;
    border-radius: 4px;
    text-align: center !important;
    font-weight: 700;
    font-size: 14px;
    padding: 4px !important;
    align-self: start;
  }
  .top-table tbody td.tt-rank.r1 { background: #e74c3c; }
  .top-table tbody td.tt-rank.r2 { background: #e67e22; }
  .top-table tbody td.tt-rank.r3 { background: #f39c12; }
  .top-table tbody td.tt-item {
    grid-column: 2 / -1;
    font-size: 14px;
    font-weight: bold;
    color: #212529;
    padding: 4px 2px !important;
  }
  .top-table tbody td.tt-meta {
    grid-column: 1 / -1;
    font-size: 12px;
    color: #6c757d;
    padding: 2px 2px !important;
  }
  .top-table tbody td.tt-meta:before {
    content: attr(data-label) '：';
    color: #adb5bd;
  }
  .top-table tbody td.tt-num {
    grid-column: span 1;
    text-align: center !important;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 6px 2px !important;
  }
  .top-table tbody td.tt-num:before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: #868e96;
    font-weight: 600;
  }
  .top-table tbody td.tt-num .v {
    font-size: 15px;
    font-weight: bold;
    color: #212529;
  }
  .top-table tbody td.tt-level {
    grid-column: 1 / -1;
    text-align: center !important;
    padding-top: 6px !important;
    margin-top: 4px;
    border-top: 1px solid #f1f3f5 !important;
  }

  /* ============ 工作台 - 待处理隐患 ============ */
  .dash-hz-table thead { display: none; }
  .dash-hz-table tbody tr {
    display: grid; grid-template-columns: 1fr auto; gap: 4px 8px;
    border: 1px solid #dee2e6; border-radius: 6px; margin-bottom: 10px;
    padding: 12px; background: #fff;
  }
  .dash-hz-table tbody td {
    display: block; border: none !important; padding: 0 !important; grid-column: 1 / -1;
  }
  .dash-hz-table tbody td.dh-idx { display: none; }
  .dash-hz-table tbody td.dh-title {
    grid-column: 1; font-size: 15px; font-weight: bold;
  }
  .dash-hz-table tbody td.dh-level { grid-column: 2; text-align: right !important; }
  .dash-hz-table tbody td.dh-eq,
  .dash-hz-table tbody td.dh-status,
  .dash-hz-table tbody td.dh-deadline {
    grid-column: 1 / -1; font-size: 13px; padding: 2px 0 !important; color: #495057;
  }
  .dash-hz-table tbody td.dh-eq:before { content: '设备：'; color: #adb5bd; }
  .dash-hz-table tbody td.dh-status:before { content: '状态：'; color: #adb5bd; }
  .dash-hz-table tbody td.dh-deadline:before { content: '期限：'; color: #adb5bd; }
  .dash-hz-table tbody td.dh-action {
    grid-column: 1 / -1; padding-top: 8px !important;
    border-top: 1px solid #f1f3f5 !important; margin-top: 4px;
  }

  /* ============ 工作台 - 最近检查记录 ============ */
  .dash-rec-table thead { display: none; }
  .dash-rec-table tbody tr {
    display: grid; grid-template-columns: 1fr auto; gap: 4px 8px;
    border: 1px solid #dee2e6; border-radius: 6px; margin-bottom: 10px;
    padding: 12px; background: #fff;
  }
  .dash-rec-table tbody td {
    display: block; border: none !important; padding: 0 !important; grid-column: 1 / -1;
  }
  .dash-rec-table tbody td.dr-idx { display: none; }
  .dash-rec-table tbody td.dr-title {
    grid-column: 1; font-size: 15px; font-weight: bold;
  }
  .dash-rec-table tbody td.dr-status { grid-column: 2; text-align: right !important; }
  .dash-rec-table tbody td.dr-date {
    grid-column: 1 / -1; font-size: 13px; color: #495057; padding: 2px 0 !important;
  }
  .dash-rec-table tbody td.dr-date:before { content: '日期：'; color: #adb5bd; }
  .dash-rec-table tbody td.dr-result {
    grid-column: 1 / -1; font-size: 13px; padding: 4px 0 !important;
  }
  .dash-rec-table tbody td.dr-action {
    grid-column: 1 / -1; padding-top: 8px !important;
    border-top: 1px solid #f1f3f5 !important; margin-top: 4px;
  }

  /* ============ 工作台 - 最近检查表 ============ */
  .dash-cl-table thead { display: none; }
  .dash-cl-table tbody tr {
    display: grid; grid-template-columns: 1fr auto; gap: 4px 8px;
    border: 1px solid #dee2e6; border-radius: 6px; margin-bottom: 10px;
    padding: 12px; background: #fff;
  }
  .dash-cl-table tbody td {
    display: block; border: none !important; padding: 0 !important; grid-column: 1 / -1;
  }
  .dash-cl-table tbody td.dc-idx { display: none; }
  .dash-cl-table tbody td.dc-title {
    grid-column: 1; font-size: 15px; font-weight: bold;
  }
  .dash-cl-table tbody td.dc-status { grid-column: 2; text-align: right !important; }
  .dash-cl-table tbody td.dc-eq,
  .dash-cl-table tbody td.dc-date {
    grid-column: 1 / -1; font-size: 13px; color: #495057; padding: 2px 0 !important;
  }
  .dash-cl-table tbody td.dc-eq:before { content: '设备：'; color: #adb5bd; }
  .dash-cl-table tbody td.dc-date:before { content: '日期：'; color: #adb5bd; }
  .dash-cl-table tbody td.dc-action {
    grid-column: 1 / -1; padding-top: 8px !important;
    border-top: 1px solid #f1f3f5 !important; margin-top: 4px;
  }

  /* ============ 导航栏紧凑 ============ */
  .navbar-brand { font-size: 16px; }
  .badge { font-size: 11px; }
}