/* ============================================================
   流程极简智控平台 · 设计系统
   佛山智星科技有限公司
   ============================================================ */
:root {
  --ink: #0E1A17;
  --ink-2: #2C3D38;
  --ink-3: #4A5C56;
  --muted: #77877F;
  --muted-2: #9AA8A1;
  --line: #E2E7E2;
  --line-strong: #D2DAD4;
  --surface: #FFFFFF;
  --surface-2: #FAFBF8;
  --canvas: #F3F5F1;
  --rail: #0B1714;
  --rail-2: #10211C;
  --primary: #0B7A63;
  --primary-2: #0E8F74;
  --primary-soft: #E7F3EE;
  --lime: #C8F169;
  --lime-dim: rgba(200, 241, 105, .14);
  --amber: #D98A2B;
  --red: #C94F4F;
  --blue: #3468D6;
  --violet: #7757D6;

  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-1: 0 1px 2px rgba(14, 26, 23, .04), 0 10px 30px -22px rgba(14, 26, 23, .25);
  --shadow-2: 0 2px 6px rgba(14, 26, 23, .06), 0 24px 60px -24px rgba(14, 26, 23, .32);
  --shadow-3: 0 40px 100px -32px rgba(6, 17, 14, .55);
  --font: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", monospace;

  --rail-w: 252px;
  --topbar-h: 66px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(14, 26, 23, .045) .7px, transparent .7px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.65), transparent 70%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--lime); color: #0B1714; }

/* ---------- 图标 ---------- */
.ico {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -3px;
}
.ico--sm { width: 15px; height: 15px; stroke-width: 1.9; }
.ico--lg { width: 22px; height: 22px; stroke-width: 1.7; }
.ico--xl { width: 28px; height: 28px; stroke-width: 1.5; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD4CD; border-radius: 9px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #A8B6AE; background-clip: content-box; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 550; font-size: 13.5px;
  white-space: nowrap;
  transition: all .18s ease;
  box-shadow: 0 1px 0 rgba(14,26,23,.02);
}
.btn:hover { border-color: #B9C5BC; color: var(--ink); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary {
  background: linear-gradient(135deg, #0E876C, #0A6B57);
  border-color: #0A6B57; color: #fff;
  box-shadow: 0 8px 18px -10px rgba(11,122,99,.65), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn--primary:hover { color: #fff; border-color: #08604E; background: linear-gradient(135deg, #0F9376, #0A6B57); }
.btn--ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--ink:hover { color: #fff; background: #182B25; }
.btn--soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn--soft:hover { background: #D9EDE5; color: var(--primary); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-3); box-shadow: none; }
.btn--ghost:hover { background: rgba(14,26,23,.045); color: var(--ink); }
.btn--danger { background: #FBEDEC; border-color: transparent; color: #B03B3B; }
.btn--danger:hover { background: #F7DDDB; color: #9E2F2F; }
.btn--lime { background: var(--lime); border-color: #B4DE51; color: #23320D; }
.btn--sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; gap: 5px; }
.btn--xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 6px; gap: 4px; }
.btn--lg { height: 44px; padding: 0 22px; font-size: 15px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; color: var(--ink-3);
  transition: all .18s ease; position: relative;
}
.icon-btn:hover { background: rgba(14,26,23,.05); color: var(--ink); }

/* ---------- 徽标 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 23px; padding: 0 9px;
  border-radius: 20px; font-size: 12px; font-weight: 550;
  white-space: nowrap; line-height: 1;
}
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: inline-block; }
.badge--green { background: #E6F4EC; color: #0B7A63; }
.badge--red { background: #FBEDEC; color: #B03B3B; }
.badge--orange { background: #FCEFE4; color: #B0561D; }
.badge--amber { background: #FAF3E1; color: #95640F; }
.badge--blue { background: #EBF0FB; color: #2C55AC; }
.badge--violet { background: #F0ECFB; color: #5B3FBF; }
.badge--slate { background: #EDF1EE; color: #4E5E58; }
.badge--muted { background: #F1F3F1; color: #75847D; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-3);
  font-family: var(--mono); letter-spacing: -.2px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  position: relative;
}
.card--flat { box-shadow: none; }
.card__head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px 0;
}
.card__head h3 { font-size: 15px; font-weight: 650; letter-spacing: -.2px; }
.card__head .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card__head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card__body { padding: 18px 20px; }
.card__body--tight { padding: 12px 20px 18px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .1px; }
.field > label .req { color: var(--red); margin-left: 2px; }
.input, .select, .textarea {
  height: 38px; padding: 0 12px;
  background: #FCFDFB;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none; transition: border-color .16s, box-shadow .16s, background .16s;
  width: 100%;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 84px; line-height: 1.6; }
.input:hover, .select:hover, .textarea:hover { border-color: #BFCAC2; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(11,122,99,.10);
}
.input::placeholder, .textarea::placeholder { color: #A9B5AE; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2377877F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid .span-2 { grid-column: span 2; }
.field-hint { font-size: 12px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--primary); width: 15px; height: 15px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; }

/* ---------- 开关 ---------- */
.switch { position: relative; display: inline-flex; width: 40px; height: 23px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; border-radius: 20px; background: #D8DFD9;
  transition: .2s; cursor: pointer;
}
.switch span::after {
  content: ""; position: absolute; width: 17px; height: 17px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(17px); }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; overflow: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.data thead th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-weight: 600; font-size: 12px; letter-spacing: .4px;
  color: var(--muted); text-transform: uppercase;
  background: var(--surface-2);
  padding: 11px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data tbody td {
  padding: 14px; border-bottom: 1px solid #EEF1EE;
  vertical-align: middle; color: var(--ink-2);
}
table.data tbody tr { transition: background .16s; }
table.data tbody tr:hover { background: #FBFCFA; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { font-family: var(--mono); font-size: 12.5px; letter-spacing: -.2px; }
table.data .strong { font-weight: 600; color: var(--ink); }
table.data .actions { display: flex; gap: 4px; justify-content: flex-end; }
.cell-link { font-weight: 600; color: var(--ink); transition: color .15s; display: inline-flex; align-items: center; gap: 6px; }
.cell-link:hover { color: var(--primary); }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.code { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: -.2px; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--line); }
.pager__hint { font-size: 12.5px; color: var(--muted); }
.pager__btns { display: flex; gap: 4px; }
.pager__btn {
  min-width: 30px; height: 30px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 7px; font-size: 12.5px; color: var(--ink-3); background: #fff;
  transition: all .15s;
}
.pager__btn:hover { border-color: var(--primary); color: var(--primary); }
.pager__btn.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager__btn.is-disabled { opacity: .35; pointer-events: none; }

/* ---------- 提示条 ---------- */
.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: #F7F9F5; border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-3); line-height: 1.65;
}
.notice .ico { margin-top: 2px; color: var(--primary); }
.notice--amber { background: #FCF7EA; border-color: #F0E3C2; }
.notice--amber .ico { color: var(--amber); }

/* ---------- 空状态 ---------- */
.empty { padding: 54px 20px; text-align: center; color: var(--muted); }
.empty .ico { width: 38px; height: 38px; stroke-width: 1.2; color: #B6C2BA; margin-bottom: 12px; }
.empty h4 { color: var(--ink-3); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.empty p { font-size: 12.5px; }

/* ---------- 进度 ---------- */
.progress { height: 6px; border-radius: 6px; background: #EDF1ED; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #0B7A63, #24A98C); }
.progress--amber > i { background: linear-gradient(90deg, #D98A2B, #E9AE61); }
.progress--red > i { background: linear-gradient(90deg, #C94F4F, #DB7A7A); }

/* ---------- 头像 ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 600; flex: none; letter-spacing: 0;
  background: var(--primary);
}
.avatar--sm { width: 27px; height: 27px; border-radius: 8px; font-size: 11.5px; }
.avatar--lg { width: 48px; height: 48px; border-radius: 14px; font-size: 17px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid #fff; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- 工具类 ---------- */
.u-muted { color: var(--muted); }
.u-ink { color: var(--ink); }
.u-mono { font-family: var(--mono); }
.u-nowrap { white-space: nowrap; }
.u-right { text-align: right; }
.u-center { text-align: center; }
.u-flex { display: flex; align-items: center; gap: 8px; }
.u-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.u-wrap { flex-wrap: wrap; }
.u-gap-4 { gap: 4px; } .u-gap-8 { gap: 8px; } .u-gap-12 { gap: 12px; } .u-gap-16 { gap: 16px; }
.u-mt-8 { margin-top: 8px; } .u-mt-12 { margin-top: 12px; } .u-mt-16 { margin-top: 16px; } .u-mt-20 { margin-top: 20px; } .u-mt-24 { margin-top: 24px; }
.u-mb-8 { margin-bottom: 8px; } .u-mb-12 { margin-bottom: 12px; } .u-mb-16 { margin-bottom: 16px; }
.u-fs-12 { font-size: 12px; } .u-fs-13 { font-size: 13px; } .u-fs-15 { font-size: 15px; }
.u-w-full { width: 100%; }
.u-spacer { flex: 1; }
.u-hidden { display: none !important; }

/* ---------- 动画 ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulseDot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
@keyframes shimmer { from { background-position: -300px 0; } to { background-position: 300px 0; } }
.spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.anim-rise { animation: rise .45s cubic-bezier(.22,.85,.3,1) both; }
