/* ============================================================
   仕迈 PMIS 原型 · 基础层：重置 / 排版 / 背景 / 焦点 / 降级动效
   ============================================================ */

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  letter-spacing: .01em;
  min-height: 100vh;
}

/* 图纸网格 + 颗粒：氛围层，替代纯色平铺 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--color-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-accent-deep); }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* 数字一律等宽 */
.num, .mono, td.num, .tb-cell .val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

::selection { background: var(--color-accent); color: #fff; }

/* 焦点可见（2px 描边 + 2px 偏移，工业感橙色） */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* 滚动条收敛 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(27,32,37,.22); border-radius: 6px; border: 2px solid var(--color-bg); }
::-webkit-scrollbar-track { background: transparent; }

/* —— 入场序列（编排一次，3–6 组错峰） —— */
.reveal {
  opacity: 0;
  transform: translateY(18px);
}
.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.reveal.d1 { transition-delay: 60ms; }
.reveal.d2 { transition-delay: 140ms; }
.reveal.d3 { transition-delay: 220ms; }
.reveal.d4 { transition-delay: 300ms; }
.reveal.d5 { transition-delay: 380ms; }

/* —— 降级动效：reduce 下全部关闭 —— */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* 表格基础 */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--color-line); }
th {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-muted);
  text-transform: none;
  background: var(--color-surface-2);
  white-space: nowrap;
}
