/* ==========================================================================
   质量管理系统 QMS · 小清新主题 (Fresh Mint)
   设计语言: 淡蓝白底 + 薄荷绿主色 + 柔和圆角 + 轻投影 + 语义柔色标签
   ========================================================================== */
:root {
  /* 页面与表面 */
  --c-bg:        #f5f8fb;   /* 页面底 */
  --c-dot:       #e6edf5;   /* 底纹点阵 */
  --c-card:      #ffffff;
  --c-line:      #eaf0f6;   /* 细分隔 */
  --c-line-2:    #dce5ef;   /* 描边 */
  --c-ink-1:     #33475b;   /* 主文字 */
  --c-ink-2:     #6b7d90;   /* 次级文字 */
  --c-ink-3:     #9aa9b8;   /* 弱文字/占位 */
  --c-ink-4:     #c3ced9;   /* 禁用 */
  --c-th:        #f3f8fc;   /* 表格表头底 */

  /* 浅色结构面（顶栏/侧栏/弹窗头） */
  --c-coal-0:    #ffffff;
  --c-coal-1:    #ffffff;
  --c-coal-2:    #fbfdfe;
  --c-coal-3:    #f1f6fa;
  --c-coal-line: #eaf0f6;

  /* 主色: 薄荷绿（变量沿用旧名，值为薄荷绿） */
  --mint:        #2fb89a;
  --mint-hi:     #45c9ac;
  --mint-lo:     #269a80;
  --mint-ink:    #ffffff;
  --mint-soft:   #e7f7f3;
  --mint-line:   #bce9de;
  /* 兼容旧变量名的引用 */
  --amber:       var(--mint);
  --amber-hi:    var(--mint-hi);
  --amber-lo:    var(--mint-lo);
  --amber-ink:   var(--mint-ink);
  --amber-soft:  var(--mint-soft);
  --amber-line:  var(--mint-line);

  /* 语义色（柔和不刺眼） */
  --red:     #e8605f;  --red-soft:#fdeeee;  --red-line:#f8cfcf;
  --green:   #2fb89a;  --green-soft:#e7f7f3;--green-line:#bce9de;
  --blue:    #4d9fe0;  --blue-soft:#eaf4fc; --blue-line:#c5e2f7;
  --orange:  #e59431;  --orange-soft:#fdf4e6;--orange-line:#f7dcb4;
  --purple:  #8b7bf7;  --purple-soft:#f2f0fe;--purple-line:#d8d2fb;
  --gray:    #8b9aab;  --gray-soft:#f3f6f9;  --gray-line:#e2e9f0;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-1: 0 2px 10px rgba(51,71,91,.06);
  --shadow-2: 0 8px 26px rgba(51,71,91,.12);
}

/* ============ 基础重置 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--c-ink-1);
  background-color: var(--c-bg);
  background-image: radial-gradient(var(--c-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }
.tnum { font-variant-numeric: tabular-nums; }

/* ============ 顶部导航（浅色） ============ */
.topbar {
  height: 58px;
  background: var(--c-coal-1);
  color: var(--c-ink-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  border-bottom: 1px solid var(--c-line);
  box-shadow: 0 1px 8px rgba(51,71,91,.05);
}
.topbar-left { display: flex; align-items: center; gap: 26px; min-width: 0; }
.logo { display: flex; align-items: center; gap: 11px; }
.logo-icon {
  height: 38px; width: auto;
  background: #fff;
  border: 1px solid var(--c-line-2);
  border-radius: 8px;
  padding: 4px 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(51,71,91,.06);
}
.logo-icon img { height: 100%; width: auto; display: block; }
.logo-text { line-height: 1.25; min-width: 0; }
.logo-title { font-size: 15.5px; font-weight: 700; letter-spacing: .5px; color: var(--c-ink-1); }
.logo-sub {
  font-size: 10px; color: var(--c-ink-3);
  margin-top: 2px; letter-spacing: .6px;
  font-family: Consolas, Menlo, "Courier New", monospace;
  text-transform: uppercase;
}
.breadcrumb {
  color: var(--c-ink-2);
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.breadcrumb span:last-child { color: var(--mint-lo); font-weight: 600; }
.breadcrumb span:not(:last-child)::after {
  content: '/';
  margin-left: 8px;
  color: var(--c-ink-4);
  font-family: Consolas, monospace;
}

.topbar-right { display: flex; align-items: center; gap: 8px; position: relative; }
.topbar-action {
  position: relative;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-ink-2);
  cursor: pointer;
  transition: all .18s;
}
.topbar-action:hover { background: var(--mint-soft); color: var(--mint-lo); }
.badge-dot {
  position: absolute; top: 6px; right: 7px;
  width: 6px; height: 6px;
  background: var(--red); border-radius: 50%;
  border: 1px solid #fff;
}
.user-info {
  display: flex; align-items: center; gap: 10px;
  padding-left: 14px; margin-left: 4px;
  border-left: 1px solid var(--c-line);
  cursor: default;
}
.avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--mint-hi), #4d9fe0);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: 0 2px 6px rgba(47,184,154,.28);
}
.user-name { font-size: 13px; font-weight: 600; color: var(--c-ink-1); }
.user-role { font-size: 11px; color: var(--c-ink-3); margin-top: 1px; }

/* ============ 布局 ============ */
.layout {
  display: flex;
  padding-top: 58px;
  min-height: 100vh;
}

/* ============ 侧边菜单（浅色） ============ */
.sidebar {
  width: 218px;
  background: var(--c-coal-1);
  color: var(--c-ink-2);
  position: fixed;
  top: 58px; bottom: 0; left: 0;
  overflow-y: auto;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--c-line);
}
.menu-section { padding: 14px 0 6px; }
.menu-title {
  padding: 0 20px 7px;
  font-size: 10.5px;
  color: var(--c-ink-3);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 7px;
}
.menu-title::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--mint);
  border-radius: 2px;
  flex-shrink: 0;
}
.menu-list { padding: 0 10px; }
.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px 9px 14px;
  margin: 2px 0;
  border-radius: 8px;
  font-size: 13.5px;
  cursor: pointer;
  transition: all .18s;
  color: var(--c-ink-2);
  position: relative;
}
.menu-item:hover { background: var(--mint-soft); color: var(--mint-lo); }
.menu-item.active {
  background: var(--mint-soft);
  color: var(--mint-lo);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--mint);
}
.menu-item svg { flex-shrink: 0; }
.menu-tag {
  margin-left: auto;
  font-size: 10px;
  line-height: 1.6;
  padding: 0 7px;
  border-radius: 10px;
  font-weight: 700;
  font-family: Consolas, Menlo, monospace;
}
.tag-danger { background: var(--red); color: #fff; }
.tag-warning { background: var(--orange); color: #fff; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--c-coal-line);
}
.storage-info { line-height: 1.5; }
.storage-label { font-size: 11px; color: var(--c-ink-3); margin-bottom: 3px; letter-spacing: .5px; }
.storage-meta { margin-top: 2px; font-size: 12px; color: var(--c-ink-2); }
.storage-sub {
  margin-top: 5px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--c-ink-3);
}
.sync-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  background: var(--c-ink-4);
}
.sync-dot.ok   { background: var(--green); box-shadow: 0 0 0 3px rgba(47,184,154,.18); }
.sync-dot.warn { background: var(--orange); box-shadow: 0 0 0 3px rgba(229,148,49,.18); }
.sync-dot.off  { background: var(--red);   box-shadow: 0 0 0 3px rgba(232,96,95,.18); }

/* ============ 主内容 ============ */
.content {
  margin-left: 218px;
  flex: 1;
  padding: 20px 24px 30px;
  min-height: calc(100vh - 58px);
}

/* ============ 页面通用 ============ */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px; flex-wrap: wrap;
}
.page-title {
  font-size: 20px; font-weight: 700; color: var(--c-ink-1);
  letter-spacing: .5px;
  display: flex; align-items: center; gap: 10px;
}
.page-title::before {
  content: '';
  width: 4px; height: 18px;
  background: linear-gradient(180deg, var(--mint-hi), var(--mint));
  border-radius: 3px;
  flex-shrink: 0;
}
.page-desc { font-size: 12.5px; color: var(--c-ink-2); margin-top: 5px; padding-left: 14px; }

/* ============ 卡片 ============ */
.card {
  background: var(--c-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-1);
  border: 1px solid var(--c-line);
}
.card + .card { margin-top: 16px; }
.card-title {
  font-size: 14.5px; font-weight: 700; color: var(--c-ink-1);
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.card-title-bar { display: flex; align-items: center; gap: 8px; }
.card-title-bar::before {
  content: '';
  width: 4px; height: 14px;
  background: var(--mint);
  border-radius: 3px;
}

/* ============ 统计卡片 ============ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--c-card);
  border-radius: var(--radius-lg);
  padding: 16px 18px 14px;
  border: 1px solid var(--c-line);
  box-shadow: var(--shadow-1);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute; left: 0; top: 0; right: 0;
  height: 3px;
}
.stat-card.blue::after   { background: var(--blue); }
.stat-card.red::after    { background: var(--red); }
.stat-card.orange::after { background: var(--orange); }
.stat-card.green::after  { background: var(--green); }
.stat-card.purple::after { background: var(--purple); }
.stat-card.cyan::after   { background: #3fb6bd; }
.stat-label { font-size: 12.5px; color: var(--c-ink-2); }
.stat-value {
  font-size: 27px; font-weight: 700;
  margin-top: 6px;
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  letter-spacing: -.5px;
}
.stat-value.blue   { color: var(--blue); }
.stat-value.red    { color: var(--red); }
.stat-value.orange { color: var(--orange); }
.stat-value.green  { color: var(--green); }
.stat-value.purple { color: var(--purple); }
.stat-value.cyan   { color: #3fb6bd; }
.stat-foot {
  margin-top: 6px;
  font-size: 12px;
  color: var(--c-ink-3);
  display: flex; align-items: center; gap: 6px;
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 15px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all .18s;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.5;
}
.btn-primary { background: var(--mint); color: #fff; border-color: var(--mint-lo); box-shadow: 0 2px 6px rgba(47,184,154,.25); }
.btn-primary:hover { background: var(--mint-hi); transform: translateY(-1px); }
.btn-primary:active { background: var(--mint-lo); transform: none; }
.btn-primary:disabled { background: #b9e6db; border-color: #b9e6db; color: rgba(255,255,255,.9); cursor: not-allowed; }
.btn-default { background: #fff; color: var(--c-ink-1); border-color: var(--c-line-2); }
.btn-default:hover { color: var(--mint-lo); border-color: var(--mint); background: var(--mint-soft); }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red-line); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-danger:disabled { color: #eab5b4; border-color: #f6dede; cursor: not-allowed; }
.btn-link { background: transparent; color: var(--mint-lo); padding: 4px 8px; font-weight: 500; }
.btn-link:hover { background: var(--mint-soft); color: #1d7f6a; }
.btn-sm { padding: 3px 11px; font-size: 12px; border-radius: 6px; }
.btn-group { display: flex; gap: 8px; }

/* ============ 表格（浅表头） ============ */
.table-wrap {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--c-line);
  box-shadow: var(--shadow-1);
}
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-line);
  flex-wrap: wrap;
  gap: 10px;
}
.table-toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.table-toolbar-right { display: flex; align-items: center; gap: 10px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--c-line);
  font-size: 13px;
}
.table th {
  background: var(--c-th);
  color: var(--c-ink-2);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .3px;
  white-space: nowrap;
  border-bottom: 1px solid var(--c-line-2);
}
.table tbody tr:hover { background: #f6fbf9; }
.table tbody tr:last-child td { border-bottom: none; }
.table .col-actions { white-space: nowrap; text-align: right; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--c-line);
}
.data-table th {
  background: var(--c-th);
  color: var(--c-ink-2);
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .3px;
}
.data-table tbody tr:hover { background: #f6fbf9; }
.data-table tbody tr:last-child td { border-bottom: none; }

.empty {
  padding: 42px 16px;
  text-align: center;
  color: var(--c-ink-3);
  font-size: 13px;
}
.empty-mark {
  width: 54px; height: 54px;
  margin: 0 auto 14px;
  border: 1px solid var(--c-line-2);
  border-radius: 12px;
  background: repeating-linear-gradient(-45deg, #f4f8fb 0 6px, #eaf1f8 6px 12px), #f2f6fa;
  position: relative;
}
.empty-mark::after {
  content: '';
  position: absolute; inset: 7px;
  border: 1px dashed var(--c-line-2);
  border-radius: 8px;
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 16px;
}
.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--c-line-2);
  background: #fff;
  border-radius: 8px;
  font-size: 13px;
  color: var(--c-ink-2);
  cursor: pointer;
  transition: all .15s;
  font-variant-numeric: tabular-nums;
}
.page-btn:hover:not(:disabled) { color: var(--mint-lo); border-color: var(--mint); background: var(--mint-soft); }
.page-btn.active { background: var(--mint); color: #fff; border-color: var(--mint); box-shadow: 0 2px 6px rgba(47,184,154,.25); }
.page-btn:disabled { color: var(--c-ink-4); cursor: not-allowed; background: #fafbfc; }

/* ============ 铭牌标签 ============ */
.tag {
  background: #f2f6f9; color: #6b7d90; border-color: var(--gray-line);
}
.status-tag, .status, .severity {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
  vertical-align: middle;
  border: 1px solid transparent;
}
.tag, .status-tag, .status, .severity { border-radius: 12px; padding: 2px 10px; }
.status-pending, .pending, .severity-major, .major {
  background: var(--orange-soft); color: var(--orange); border-color: var(--orange-line);
}
.status-processing, .processing, .severity-processing { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-line); }
.status-done, .done, .severity-minor, .minor { background: var(--green-soft); color: var(--green); border-color: var(--green-line); }
.status-rejected, .rejected { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.status-concession, .concession { background: var(--purple-soft); color: var(--purple); border-color: var(--purple-line); }
.status-closed, .closed { background: var(--gray-soft); color: var(--gray); border-color: var(--gray-line); }
.severity-critical, .critical { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.tag-blue   { background: var(--blue-soft);  color: var(--blue);   border-color: var(--blue-line); }
.tag-red    { background: var(--red-soft);   color: var(--red);    border-color: var(--red-line); }
.tag-yellow { background: var(--orange-soft);color: var(--orange); border-color: var(--orange-line); }

/* ============ 表单 ============ */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; }
.form-item { display: flex; flex-direction: column; }
.form-item.full { grid-column: 1 / -1; }
.form-label {
  font-size: 13px;
  color: var(--c-ink-1);
  margin-bottom: 6px;
  font-weight: 600;
}
.form-label.required::before {
  content: '*';
  color: var(--red);
  margin-right: 4px;
  font-weight: 700;
}
.form-input, .form-select, .form-textarea {
  padding: 7px 11px;
  border: 1px solid var(--c-line-2);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  background: #fff;
  width: 100%;
  color: var(--c-ink-1);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(47,184,154,.18);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--c-ink-4); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--c-ink-3); margin-top: 4px; }

.form-section-title {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 700;
  color: var(--mint-lo);
  margin: 10px 0 -2px;
  padding: 7px 12px;
  background: var(--mint-soft);
  border-left: 3px solid var(--mint);
  border-radius: 0 8px 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.form-section-title:first-child { margin-top: 0; }

.c-impact, .i_item_cb { margin-right: 6px; vertical-align: middle; accent-color: var(--mint); }

/* ============ 模态框 ============ */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(51,71,91,.35);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal-mask.show { display: flex; animation: fadeIn .2s; }
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 720px;
  max-width: 92vw;
  max-height: 88vh;
  display: flex; flex-direction: column;
  animation: slideUp .25s;
  box-shadow: 0 20px 50px rgba(51,71,91,.24);
  overflow: hidden;
}
.modal.modal-lg { width: 1000px; }
@media (max-width: 1100px) { .modal.modal-lg { width: 92vw; } }
.modal-header {
  padding: 14px 20px;
  background: var(--c-coal-2);
  border-bottom: 1px solid var(--c-line);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-header::before {
  content: '';
  width: 4px; height: 16px;
  background: var(--mint);
  border-radius: 3px;
  margin-right: 10px;
}
.modal-title { font-size: 15px; font-weight: 700; color: var(--c-ink-1); display: flex; align-items: center; flex: 1; }
.modal-close {
  width: 28px; height: 28px;
  font-size: 20px; color: var(--c-ink-3);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.modal-close:hover { background: var(--red-soft); color: var(--red); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--c-line);
  background: #fafcfe;
  display: flex; justify-content: flex-end; gap: 8px;
  flex-shrink: 0;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideDown { from { transform: translateY(-16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============ Toast ============ */
.toast-container {
  position: fixed; top: 72px; left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: #fff;
  padding: 9px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
  min-width: 200px;
  max-width: 560px;
  animation: slideDown .25s;
  border: 1px solid var(--c-line);
  border-left: 4px solid var(--c-ink-3);
  color: var(--c-ink-1);
}
.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
.toast.warn    { border-left-color: var(--orange); }
.toast.info    { border-left-color: var(--blue); }

/* ============ 详情视图 ============ */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
}
.detail-item { display: flex; flex-direction: column; }
.detail-item.full { grid-column: 1 / -1; }
.detail-label { font-size: 12px; color: var(--c-ink-3); margin-bottom: 4px; letter-spacing: .3px; }
.detail-value { font-size: 13.5px; color: var(--c-ink-1); word-break: break-word; }
.detail-value.empty-val { color: var(--c-ink-4); font-style: italic; }

.split-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 1100px) {
  .split-2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ 条形图 ============ */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 220px;
  padding: 16px 8px 0;
  background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(51,71,91,.05) 27px 28px);
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.bar-stack { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; justify-content: flex-end; }
.bar {
  width: 68%;
  border-radius: 6px 6px 0 0;
  position: relative;
  min-height: 4px;
  transition: height .35s;
  background: var(--c-ink-4);
}
.bar.green  { background: var(--green); }
.bar.orange { background: var(--orange); }
.bar.red    { background: var(--red); }
.bar.blue   { background: var(--blue); }
.bar-value {
  position: absolute; top: -18px;
  left: 50%; transform: translateX(-50%);
  font-size: 11px; color: var(--c-ink-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.bar-label { font-size: 11px; color: var(--c-ink-2); }

/* ============ 子平台卡片 ============ */
.platform-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.platform-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-line);
  border-top: 3px solid transparent;
  padding: 16px 18px 14px;
  cursor: pointer;
  transition: all .2s;
  box-shadow: var(--shadow-1);
}
.platform-card:hover {
  border-top-color: var(--mint);
  border-color: var(--mint-line);
  box-shadow: 0 10px 24px rgba(47,184,154,.16);
  transform: translateY(-3px);
}
.platform-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.platform-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(51,71,91,.12);
}
.platform-icon.red    { background: linear-gradient(135deg, #f28382, var(--red)); }
.platform-icon.green  { background: linear-gradient(135deg, #6fd8bd, var(--green)); }
.platform-icon.orange { background: linear-gradient(135deg, #f7c07a, var(--orange)); }
.platform-icon.purple { background: linear-gradient(135deg, #b3a8fb, var(--purple)); }
.platform-icon.blue   { background: linear-gradient(135deg, #86c4f1, var(--blue)); }
.platform-name { font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.platform-desc { font-size: 12px; color: var(--c-ink-2); margin-top: 3px; line-height: 1.6; }
.platform-stats {
  display: flex; gap: 6px;
  padding-top: 11px; border-top: 1px dashed var(--c-line-2);
  flex-wrap: wrap;
  align-items: center;
}
.platform-stat-item .label { font-size: 12px; color: var(--c-ink-3); }
.platform-stat-item .val { font-size: 18px; font-weight: 700; color: var(--c-ink-1); margin-top: 3px; font-variant-numeric: tabular-nums; }
.platform-enter { margin-top: 12px; display: flex; justify-content: flex-end; }

/* ============ 标签栏 ============ */
.tabs { display: flex; border-bottom: 1px solid var(--c-line-2); margin-bottom: 16px; gap: 2px; }
.tab {
  padding: 9px 16px;
  font-size: 13.5px;
  color: var(--c-ink-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .18s;
  margin-bottom: -1px;
  border-radius: 8px 8px 0 0;
}
.tab:hover { color: var(--mint-lo); background: var(--mint-soft); }
.tab.active { color: var(--mint-lo); border-bottom-color: var(--mint); font-weight: 700; }

/* ============ 描述列表 ============ */
.descriptions {
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.desc-row { display: flex; border-bottom: 1px solid var(--c-line); }
.desc-row:last-child { border-bottom: none; }
.desc-label {
  flex: 0 0 130px;
  padding: 11px 14px;
  background: var(--c-th);
  font-size: 13px;
  color: var(--c-ink-2);
  border-right: 1px solid var(--c-line);
}
.desc-value {
  flex: 1;
  padding: 11px 14px;
  font-size: 13px;
  color: var(--c-ink-1);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ============ 进度条 ============ */
.progress {
  height: 8px;
  background: #eef3f8;
  border-radius: 6px;
  overflow: hidden;
}
.progress-fill { height: 100%; background: var(--mint); border-radius: 6px; transition: width .3s; }
.progress-fill.green  { background: var(--green); }
.progress-fill.orange { background: var(--orange); }
.progress-fill.red    { background: var(--red); }

/* ============ 快捷键提示 ============ */
.kbd {
  display: inline-block;
  padding: 1px 6px;
  background: #f7f9fb;
  border: 1px solid var(--c-line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  font-size: 11px;
  font-family: Consolas, Menlo, monospace;
  color: var(--c-ink-2);
}

/* ============ 角色徽章 ============ */
.role-badge {
  display: inline-block;
  padding: 0 10px;
  font-size: 11px;
  line-height: 20px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
  border: 1px solid transparent;
}
.role-admin    { background: var(--red-soft);    color: var(--red);    border-color: var(--red-line); }
.role-engineer { background: var(--blue-soft);   color: var(--blue);   border-color: var(--blue-line); }
.role-inspector{ background: var(--orange-soft); color: var(--orange); border-color: var(--orange-line); }

/* ============ 用户下拉 ============ */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 172px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  border: 1px solid var(--c-line);
  padding: 6px 0;
  z-index: 300;
  animation: dropIn .16s ease;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
  padding: 9px 16px;
  font-size: 13px;
  color: var(--c-ink-1);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .15s;
}
.dropdown-item:hover { background: var(--mint-soft); color: var(--mint-lo); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: var(--red-soft); color: var(--red); }

/* ============ 设置页 Tab ============ */
.settings-tabs {
  display: inline-flex;
  background: #f1f6fa;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 16px;
}
.settings-tab {
  padding: 7px 18px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--c-ink-2);
  cursor: pointer;
  transition: all .18s;
  user-select: none;
  border: 1px solid transparent;
}
.settings-tab:hover { color: var(--mint-lo); background: rgba(255,255,255,.7); }
.settings-tab.active {
  background: var(--mint);
  color: #fff;
  font-weight: 600;
  border-color: var(--mint);
  box-shadow: 0 2px 8px rgba(47,184,154,.25);
}

/* ============ 详情弹窗分组 ============ */
.detail-section { margin-bottom: 14px; }
.detail-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-ink-1);
  margin-bottom: 8px;
  padding-left: 9px;
  border-left: 3px solid var(--mint);
  letter-spacing: .3px;
}
.detail-section-body {
  font-size: 13px;
  color: var(--c-ink-1);
  line-height: 1.7;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; }
.detail-grid-2 .detail-item.full { grid-column: 1 / -1; }
.detail-grid-2 .detail-item,
.detail-item.detail-line {
  display: grid;
  grid-template-columns: 104px 1fr;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--c-line);
  align-items: start;
}
.detail-grid-2 .detail-item .detail-label { color: var(--c-ink-3); font-weight: 500; }
.detail-grid-2 .detail-item .detail-value { color: var(--c-ink-1); word-break: break-all; line-height: 1.6; }
@media (max-width: 600px) { .detail-grid-2 { grid-template-columns: 1fr; } }

/* ============ 失效照片上传 ============ */
.photo-box {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 10px;
  border: 1px dashed var(--c-line-2);
  border-radius: var(--radius);
  background: #f8fbfd;
  min-height: 62px;
  align-items: flex-start;
}
.photo-empty { font-size: 12px; color: var(--c-ink-3); padding: 14px 6px; }
.photo-thumb {
  position: relative;
  width: 76px; height: 76px;
  border: 1px solid var(--c-line-2);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 4px rgba(51,71,91,.08);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photo-del {
  position: absolute; top: 0; right: 0;
  width: 20px; height: 20px;
  background: rgba(51,71,91,.6);
  color: #fff; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0 10px 0 10px;
}
.photo-del:hover { background: var(--red); }
.photo-view { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-view img {
  width: 96px; height: 96px; object-fit: cover;
  border: 1px solid var(--c-line-2);
  border-radius: 10px;
  cursor: zoom-in;
  background: #fff;
}

/* ============ 页面切换动画 ============ */
.page-enter { animation: pageIn .28s; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cfdae5; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: #b6c5d3; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 只读/禁用 ============ */
input[disabled], select[disabled], textarea[disabled] {
  color: var(--c-ink-2);
  background: #f4f7fa;
  cursor: not-allowed;
}
input[readonly] { color: var(--c-ink-2); background: #f7fafb; cursor: default; }

/* ============ 字典与组织：按子平台归类 ============ */
.tone-red    { --tone: var(--red);    --tone-soft: var(--red-soft);    --tone-line: var(--red-line); }
.tone-blue   { --tone: var(--blue);   --tone-soft: var(--blue-soft);   --tone-line: var(--blue-line); }
.tone-orange { --tone: var(--orange); --tone-soft: var(--orange-soft); --tone-line: var(--orange-line); }
.tone-purple { --tone: var(--purple); --tone-soft: var(--purple-soft); --tone-line: var(--purple-line); }
.tone-gray   { --tone: var(--gray);   --tone-soft: var(--gray-soft);   --tone-line: var(--gray-line); }

/* 顶部快速跳转 */
.dict-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 14px; }
.dict-nav-item {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 20px;
  font-size: 12.5px; cursor: pointer; user-select: none;
  background: var(--c-card); border: 1px solid var(--c-line);
  color: var(--c-ink-2); transition: all .18s;
}
.dict-nav-item:hover { background: var(--tone-soft); border-color: var(--tone-line); color: var(--tone); }
.dict-nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tone); flex: none; }

/* 分组区块 */
.dict-group { scroll-margin-top: 74px; }
.dict-group + .dict-group { margin-top: 14px; }
.dict-group-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--tone-soft);
  border: 1px solid var(--tone-line);
  border-radius: var(--radius-lg);
  cursor: pointer; user-select: none;
  transition: box-shadow .18s;
}
.dict-group-head:hover { box-shadow: var(--shadow-1); }
.dict-group-no {
  width: 30px; height: 30px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--tone); color: #fff;
  border-radius: 9px; font-size: 12.5px; font-weight: 700;
  letter-spacing: .3px;
}
.dict-group-text { flex: 1; min-width: 0; }
.dict-group-title { font-size: 14px; font-weight: 700; color: var(--c-ink-1); line-height: 1.4; }
.dict-group-desc { font-size: 12px; color: var(--c-ink-2); line-height: 1.6; margin-top: 1px; }
.dict-group-count {
  font-size: 11.5px; color: var(--tone);
  background: rgba(255,255,255,.8);
  border: 1px solid var(--tone-line);
  padding: 3px 10px; border-radius: 20px; white-space: nowrap; flex: none;
}
.dict-group-caret { color: var(--tone); font-size: 11px; flex: none; transition: transform .2s; }
.dict-group-caret.open { transform: rotate(180deg); }
.dict-group-body {
  margin-top: 12px; padding-left: 14px;
  border-left: 3px solid var(--tone-line);
}
.dict-group-body .card + .card { margin-top: 12px; }

/* 组内字段与徽标 */
.dict-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px 18px; }
.dict-label { font-size: 12px; color: var(--c-ink-2); }
.dict-badge {
  font-size: 11.5px; font-weight: 400; color: var(--tone, var(--c-ink-3));
  background: var(--tone-soft, var(--gray-soft));
  border: 1px solid var(--tone-line, var(--gray-line));
  padding: 2px 9px; border-radius: 20px; white-space: nowrap;
}
.dict-tip { margin-top: 10px; font-size: 12px; color: var(--c-ink-3); line-height: 1.7; }

/* 工位字典 */
.dict-stations { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.dict-station {
  background: var(--c-coal-3);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.dict-station-name { font-size: 12.5px; font-weight: 600; color: var(--c-ink-1); margin-bottom: 8px; }
.dict-station-row { display: grid; grid-template-columns: 62px 1fr; gap: 8px; align-items: center; margin-bottom: 6px; }
.dict-station-row:last-child { margin-bottom: 0; }
.dict-station-tag { font-size: 11.5px; color: var(--c-ink-3); }

@media (max-width: 768px) {
  .dict-group-body { padding-left: 10px; }
  .dict-group-desc { display: none; }
  .dict-fields, .dict-stations { grid-template-columns: 1fr; }
}

/* ============ 多选筛选下拉（失效录入筛选栏） ============ */
.msel { position: relative; display: inline-block; }
.msel-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 9px 0 12px;
  border: 1px solid var(--c-line-2); border-radius: 8px;
  background: var(--c-card); color: var(--c-ink-2);
  font-size: 13px; font-family: inherit; line-height: 1;
  cursor: pointer; white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s;
}
.msel-btn:hover { border-color: var(--mint-line); color: var(--mint-lo); }
.msel-btn.active {
  border-color: var(--mint-line); background: var(--mint-soft);
  color: var(--mint-lo); font-weight: 600;
}
.msel.open .msel-btn { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(47, 184, 154, .13); }
.msel-caret { transition: transform .18s; opacity: .6; }
.msel.open .msel-caret { transform: rotate(180deg); }

/* 日期筛选：按钮做成 📅 日历图标样式 */
.msel-btn-date { padding: 0 8px 0 10px; gap: 4px; }
.msel-ico { font-size: 15px; line-height: 1; }
.msel-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--mint); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums;
}

.msel-menu {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0;
  min-width: 196px; max-width: 300px;
  background: var(--c-card);
  border: 1px solid var(--c-line-2); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(51, 71, 91, .15);
  overflow: hidden;
  animation: mselIn .14s ease-out;
}
@keyframes mselIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.msel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; font-size: 12px; color: var(--c-ink-3);
  background: var(--c-th); border-bottom: 1px solid var(--c-line);
}
.msel-clear { color: var(--mint-lo); cursor: pointer; font-size: 12px; }
.msel-clear:hover { text-decoration: underline; }

.msel-list { max-height: 264px; overflow-y: auto; padding: 4px; }
.msel-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 6px;
  font-size: 13px; color: var(--c-ink-1); cursor: pointer;
}
.msel-item:hover { background: var(--c-coal-3); }
.msel-check {
  flex: 0 0 auto; width: 15px; height: 15px; position: relative;
  border: 1.5px solid var(--c-line-2); border-radius: 4px;
  transition: background .12s, border-color .12s;
}
.msel-item.on .msel-check { background: var(--mint); border-color: var(--mint); }
.msel-item.on .msel-check::after {
  content: ''; position: absolute; left: 4px; top: 1px;
  width: 4px; height: 8px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.msel-label { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msel-item.on .msel-label { color: var(--mint-lo); font-weight: 600; }
.msel-count { flex: 0 0 auto; font-size: 11px; color: var(--c-ink-4); font-variant-numeric: tabular-nums; }
.msel-item.on .msel-count { color: var(--mint); }
.msel-empty { padding: 14px 10px; text-align: center; font-size: 12px; color: var(--c-ink-3); }

/* ---------- 失效日期：月历面板 ---------- */
.msel-menu-cal { min-width: 252px; }
.cal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 8px; background: var(--c-th); border-bottom: 1px solid var(--c-line);
}
.cal-title { font-size: 12.5px; font-weight: 600; color: var(--c-ink-1); font-variant-numeric: tabular-nums; }
.cal-nav {
  width: 22px; height: 22px; padding: 0; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-line-2); border-radius: 6px;
  background: var(--c-card); color: var(--c-ink-2);
  font-size: 14px; line-height: 1; font-family: inherit; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.cal-nav:hover { border-color: var(--mint-line); color: var(--mint-lo); }
.cal-week {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  padding: 6px 8px 0; font-size: 11px; color: var(--c-ink-3); text-align: center;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  padding: 2px 8px 6px;
}
.cal-cell {
  position: relative; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 12.5px; color: var(--c-ink-1);
}
.cal-blank { visibility: hidden; }
.cal-cell.off { color: var(--c-ink-4); }
/* 有记录的日期：可点选，薄荷底提示 */
.cal-cell.has {
  cursor: pointer; background: var(--mint-soft);
  color: var(--mint-lo); font-weight: 600;
  transition: box-shadow .12s, background .12s;
}
.cal-cell.has:hover { box-shadow: inset 0 0 0 1px var(--mint); }
.cal-cell.on { background: var(--mint); color: #fff; cursor: pointer; }
.cal-dot {
  position: absolute; left: 50%; bottom: 2px; margin-left: -2px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--mint);
}
.cal-cell.on .cal-dot { background: #fff; }
.cal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 10px; border-top: 1px solid var(--c-line);
  font-size: 11.5px; color: var(--c-ink-3);
}

/* 下拉展开时放开父容器的 overflow:hidden，否则菜单会被裁掉
   （表格行数少时容器很矮，菜单必然超出边界）。
   同时给工具栏补上顶部圆角，弥补容器不再裁剪的圆角缺失。 */
.table-wrap.msel-open { overflow: visible; }
.table-wrap.msel-open .table-toolbar { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

/* ============ 响应式 ============ */
@media (max-width: 900px) { .form-grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .content { margin-left: 0; }
  .form-grid, .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .detail-grid, .detail-grid-2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .platform-grid { grid-template-columns: 1fr; }
  .breadcrumb { display: none; }
}
@media (max-width: 600px) { .detail-item.detail-line { grid-template-columns: 90px 1fr; } }
