/* ==========================================================================
   金凤区商务局安全生产检查平台 · 设计系统
   ========================================================================== */
:root {
  --brand-900: #061B3A;
  --brand-800: #0A2A5E;
  --brand-700: #0E3B85;
  --brand-600: #1450B4;
  --brand-500: #1A6DFF;
  --brand-400: #4C8DFF;
  --brand-200: #BFD5FF;
  --brand-100: #E9F1FF;
  --brand-50: #F4F8FF;

  --cyan: #0FB5A6;
  --cyan-soft: #E4F8F6;
  --amber: #F59E0B;
  --amber-soft: #FFF7E6;
  --red: #F04438;
  --red-soft: #FEECEB;
  --green: #12B76A;
  --green-soft: #E7F8F0;
  --purple: #7C5CFC;
  --purple-soft: #F0ECFF;

  --ink-900: #0B1B33;
  --ink-800: #1D2E4A;
  --ink-700: #34466B;
  --ink-500: #62748F;
  --ink-400: #8A99B0;
  --ink-300: #AFBACB;

  --line: #E5EAF3;
  --line-soft: #EFF3F9;
  --bg: #F4F6FB;
  --surface: #FFFFFF;

  --r-xl: 20px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;

  --sh-xs: 0 1px 2px rgba(15, 43, 91, .05);
  --sh-sm: 0 2px 8px rgba(15, 43, 91, .06);
  --sh-md: 0 6px 24px rgba(15, 43, 91, .08);
  --sh-lg: 0 16px 48px rgba(15, 43, 91, .12);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --num: "SF Mono", "DIN Alternate", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink-800);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
table { border-collapse: collapse; width: 100%; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #CBD5E5; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #A9B7CD; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 排版 ---------- */
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--ink-500); }
.tiny { font-size: 12px; }
.mono { font-family: var(--num); letter-spacing: -.2px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: all .18s ease; border: 1px solid transparent;
  background: var(--surface); color: var(--ink-700);
}
.btn:hover { background: var(--brand-50); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  color: #fff; box-shadow: 0 4px 14px rgba(26, 109, 255, .28);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-700), var(--brand-600)); box-shadow: 0 6px 18px rgba(26,109,255,.34); }

.btn-ghost { border-color: var(--line); color: var(--ink-700); }
.btn-ghost:hover { border-color: var(--brand-200); background: var(--brand-50); color: var(--brand-600); }

.btn-soft { background: var(--brand-100); color: var(--brand-600); }
.btn-soft:hover { background: #DCE9FF; }

.btn-danger { background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(240,68,56,.25); }
.btn-danger:hover { background: #D92D20; }

.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 13px; font-weight: 500; color: var(--ink-700); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(26, 109, 255, .1);
}
.input::placeholder { color: var(--ink-300); }
.textarea { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5L10 4.5' stroke='%238A99B0' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  border: 1px solid var(--line-soft);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 0;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--ink-900); letter-spacing: .2px; }
.card-sub { font-size: 12px; color: var(--ink-400); margin-top: 3px; }
.card-body { padding: 18px 20px; }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.tag-blue { background: var(--brand-100); color: var(--brand-600); }
.tag-green { background: var(--green-soft); color: #0A8A50; }
.tag-red { background: var(--red-soft); color: #C0281F; }
.tag-amber { background: var(--amber-soft); color: #B26A00; }
.tag-gray { background: #F0F3F8; color: var(--ink-500); }
.tag-purple { background: var(--purple-soft); color: #5B3FD9; }
.tag-cyan { background: var(--cyan-soft); color: #0A8478; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* ---------- 骨架/空态 ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 60px 20px; color: var(--ink-400); font-size: 13px;
}
.empty svg { opacity: .5; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(26,109,255,.18); border-top-color: var(--brand-500);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 动画 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .4s cubic-bezier(.22,.61,.36,1) both; }

/* ---------- Toast ---------- */
#toast-wrap {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: center;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: 10px; background: rgba(11,27,51,.94);
  color: #fff; font-size: 13.5px; box-shadow: var(--sh-lg);
  backdrop-filter: blur(8px);
  animation: toastIn .28s cubic-bezier(.22,.61,.36,1);
  max-width: 90vw;
}
.toast.ok { background: rgba(9,110,66,.96); }
.toast.err { background: rgba(180,32,24,.96); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(8, 22, 45, .48);
  backdrop-filter: blur(3px); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--surface); border-radius: var(--r-xl);
  width: 100%; max-width: 520px; max-height: 88vh; overflow: auto;
  box-shadow: var(--sh-lg); animation: modalIn .3s cubic-bezier(.22,.61,.36,1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.modal-head h3 { font-size: 16px; font-weight: 600; color: var(--ink-900); }
.modal-body { padding: 22px 24px; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 24px; border-top: 1px solid var(--line-soft);
  position: sticky; bottom: 0; background: var(--surface);
}

/* ---------- 表格 ---------- */
.tbl { font-size: 13.5px; }
.tbl th {
  text-align: left; font-weight: 500; color: var(--ink-500);
  font-size: 12.5px; padding: 10px 14px; background: #FAFBFE;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink-700); }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--brand-50); }
.tbl tbody tr:last-child td { border-bottom: none; }

/* ---------- 印刷 ---------- */
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
}
