/* =====================================================================
   GallopWave 智造工单系统 - 全局样式
   主题：深蓝左侧侧栏 + 白色主区域 + 绿色主题按钮
===================================================================== */

:root {
  /* 主色 */
  --brand-deep:      #1e3a8a;   /* 深蓝（侧栏） */
  --brand-deep-2:    #1e40af;
  --brand-light:     #3b82f6;
  --brand-bg-soft:   #eef4ff;

  /* 主题绿（按钮/强调） */
  --primary:         #10b981;   /* 主色 绿 */
  --primary-hover:   #059669;
  --primary-soft:    #d1fae5;

  /* 状态色 */
  --info:            #0ea5e9;
  --warning:         #f59e0b;
  --danger:          #ef4444;
  --success:         #10b981;
  --gray:            #6b7280;

  /* 文本 */
  --text-1:          #0f172a;
  --text-2:          #475569;
  --text-3:          #94a3b8;
  --text-onbrand:    #ffffff;
  --text-onbrand-2:  #c7d2fe;

  /* 表面 */
  --bg-page:         #f3f5f9;
  --bg-card:         #ffffff;
  --bg-hover:        #f8fafc;
  --bg-row-hover:    #f0f9ff;
  --border:          #e2e8f0;
  --border-strong:   #cbd5e1;

  /* 阴影 */
  --shadow-sm:  0 1px 2px rgba(15,23,42,.06);
  --shadow-md:  0 4px 12px rgba(15,23,42,.08);
  --shadow-lg:  0 10px 30px rgba(15,23,42,.12);

  /* 圆角 */
  --radius:     6px;
  --radius-lg:  10px;

  /* 尺寸 */
  --sidebar-w:    220px;
  --sidebar-c-w:  220px;
  --topbar-h:     52px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  color: var(--text-1);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ========= 启动屏 ========= */
.boot-screen {
  height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg-page);
}
.boot-logo {
  width: 72px; height: 72px; border-radius: 16px; background: var(--brand-deep);
  color: #fff; font-size: 40px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  margin-bottom: 16px;
}
.boot-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.boot-tip  { font-size: 12px; color: var(--text-3); }

/* ========= 登录页 ========= */
.login-shell {
  min-height: 100vh; display: flex; align-items: stretch;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0ea5e9 100%);
}
.login-left {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #fff; padding: 40px;
}
.login-brand {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.login-brand-logo {
  width: 60px; height: 60px; border-radius: 14px;
  background: rgba(255,255,255,.95);
  color: var(--brand-deep); font-size: 38px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.login-brand-title { font-size: 26px; font-weight: 700; }
.login-brand-sub   { font-size: 14px; opacity: .8; margin-top: 4px; }
.login-features { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; max-width: 480px; }
.login-feature  { display: flex; align-items: center; gap: 8px; font-size: 13px; opacity: .9; }
.login-feature-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: .7; }

.login-right {
  width: 480px; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px;
}
.login-form { width: 100%; max-width: 360px; }
.login-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.login-tab {
  padding: 12px 18px; font-size: 14px; font-weight: 500;
  color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent;
}
.login-tab.active { color: var(--brand-deep); border-bottom-color: var(--brand-deep); font-weight: 600; }

.login-row {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0 12px; height: 42px; margin-bottom: 14px;
  background: #fff; transition: border-color .15s;
}
.login-row.focus-within { border-color: var(--brand-light); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.login-row input {
  border: none; outline: none; flex: 1; font-size: 14px; background: transparent;
  color: var(--text-1);
}
.login-row-icon { width: 16px; height: 16px; color: var(--text-3); }
.login-captcha-row { display: flex; gap: 10px; align-items: center; }
.login-captcha-row .login-row { flex: 1; margin-bottom: 0; }
.login-captcha-img {
  width: 130px; height: 42px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #f6f8fa; display: flex; align-items: center; justify-content: center;
  font-weight: 700; letter-spacing: 4px; color: var(--brand-deep);
}
.login-captcha-img svg { width: 100%; height: 100%; }

.login-btn {
  width: 100%; height: 44px; border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff; font-size: 15px; font-weight: 600;
  border-radius: var(--radius); margin-top: 8px; transition: opacity .15s;
}
.login-btn:hover { opacity: .92; }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }

.login-agree { font-size: 12px; color: var(--text-3); text-align: center; margin-top: 16px; line-height: 1.7; }
.login-agree a { color: var(--brand-light); }
.login-agree input[type="checkbox"] { vertical-align: middle; margin-right: 4px; }

.login-link { text-align: center; font-size: 12px; color: var(--text-2); margin-top: 14px; }
.login-link a { color: var(--brand-light); }
.login-back-home { font-size: 12px; color: var(--text-3); margin-top: 16px; text-align: center; }

/* ========= 主布局 ========= */
.layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w); background: var(--brand-deep); color: #fff;
  flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-head {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,.95); color: var(--brand-deep);
  font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-title { font-size: 15px; font-weight: 600; line-height: 1.2; }
.sidebar-sub   { font-size: 11px; color: rgba(255,255,255,.6); margin-top: 2px; }

.sidebar-menu { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar-menu::-webkit-scrollbar { width: 4px; }
.sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px; cursor: pointer;
  font-size: 13px; color: rgba(255,255,255,.85);
  border-left: 3px solid transparent;
  transition: background .15s;
  user-select: none;
}
.menu-item:hover { background: rgba(255,255,255,.06); }
.menu-item.active {
  background: rgba(255,255,255,.12);
  border-left-color: var(--primary);
  color: #fff; font-weight: 500;
}
.menu-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: .85; }
.menu-arrow {
  margin-left: auto; transition: transform .15s; opacity: .5; font-size: 10px;
}
.menu-item.expanded .menu-arrow { transform: rotate(90deg); }

.menu-group { padding-left: 14px; }
.menu-child {
  padding: 6px 18px 6px 36px; font-size: 12.5px;
  color: rgba(255,255,255,.65); cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
}
.menu-child:hover { color: #fff; background: rgba(255,255,255,.04); }
.menu-child.active { color: var(--primary); font-weight: 500; background: rgba(16,185,129,.08); }
.menu-child .badge { background: var(--primary); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 9px; }

/* ========= 主体 ========= */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: var(--topbar-h); background: #fff;
  display: flex; align-items: center; padding: 0 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.topbar-crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.topbar-crumb .sep { color: var(--text-3); }
.topbar-crumb .cur { color: var(--text-1); font-weight: 500; }

.topbar-actions { display: flex; align-items: center; gap: 4px; }
.topbar-action {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); color: var(--text-2); cursor: pointer;
  position: relative; transition: all .15s;
}
.topbar-action:hover { background: var(--bg-hover); color: var(--brand-deep); }
.topbar-action svg { width: 18px; height: 18px; }
.topbar-action .badge {
  position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 600;
  border-radius: 9px; padding: 0 4px; display: flex; align-items: center; justify-content: center;
}
.topbar-user {
  display: flex; align-items: center; gap: 8px; padding: 0 8px;
  cursor: pointer; height: 34px; border-radius: var(--radius);
  margin-left: 4px;
}
.topbar-user:hover { background: var(--bg-hover); }
.topbar-user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px;
}
.topbar-user-name { font-size: 13px; color: var(--text-1); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dropdown-menu {
  position: absolute; right: 12px; top: calc(var(--topbar-h) + 4px);
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 4px 0; min-width: 160px;
  z-index: 100; border: 1px solid var(--border);
}
.dropdown-item { padding: 8px 14px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--text-1); }
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ========= 内容区 ========= */
.content { flex: 1; overflow: auto; padding: 16px; background: var(--bg-page); }

.page-hd {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.page-hd-title { font-size: 16px; font-weight: 600; color: var(--text-1); }
.page-hd-meta  { color: var(--text-3); font-size: 12px; }
.page-hd-actions { margin-left: auto; display: flex; gap: 8px; }

/* ========= 卡片 ========= */
.card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 16px;
}
.card-hd { display: flex; align-items: center; margin-bottom: 12px; }
.card-hd-title { font-size: 14px; font-weight: 600; color: var(--text-1); }
.card-hd-extra { margin-left: auto; font-size: 12px; color: var(--brand-light); cursor: pointer; }
.card-hd-extra:hover { text-decoration: underline; }

/* ========= 按钮 ========= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 14px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: #fff; color: var(--text-1);
  font-size: 13px; cursor: pointer;
  transition: all .15s; gap: 4px;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid transparent; }
.btn-ghost:hover { background: var(--bg-hover); border-color: transparent; color: var(--brand-deep); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-group { display: inline-flex; gap: 4px; }

/* ========= 表单 ========= */
.form-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.form-row .form-input { flex: 1; min-width: 160px; }
.form-row .form-label-fixed { width: 90px; color: var(--text-2); font-size: 13px; text-align: right; }

.input, select.input, textarea.input {
  height: 32px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; font-size: 13px; color: var(--text-1);
  outline: none; transition: border-color .15s;
  font-family: inherit;
}
textarea.input { height: auto; min-height: 80px; padding: 8px 12px; resize: vertical; }
.input:focus, select.input:focus, textarea.input:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(16,185,129,.12);
}
.input.w-sm { width: 130px; }
.input.w-md { width: 200px; }
.input.w-lg { width: 280px; }
.input.full { width: 100%; }

.form-label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.form-label.required::before { content: '*'; color: var(--danger); margin-right: 4px; }

/* ========= 筛选栏 ========= */
.filter-bar {
  background: #fff; padding: 14px 16px;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  margin-bottom: 12px;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row .filter-spacer { flex: 1; }
.filter-row .filter-btn-group { display: flex; gap: 6px; }
.filter-row .filter-btn-group .btn { font-size: 12px; padding: 0 10px; height: 28px; }
.filter-row .filter-btn-group .btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.filter-label { font-size: 13px; color: var(--text-2); margin-right: 4px; }

/* ========= 表格 ========= */
.table-card { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden; }
.table-card-hd {
  display: flex; align-items: center; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.table-card-hd-title { font-size: 14px; font-weight: 600; }
.table-card-hd-actions { margin-left: auto; display: flex; gap: 6px; }
.table-card-hd-meta { color: var(--text-3); font-size: 12px; margin-left: 8px; }

.table-scroll { overflow-x: auto; }
table.gw-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px;
}
.gw-table thead th {
  background: #f8fafc; padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; color: var(--text-2); text-align: left;
  white-space: nowrap; position: sticky; top: 0;
}
.gw-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
  vertical-align: middle;
}
.gw-table tbody tr:hover { background: var(--bg-row-hover); }
.gw-table tbody tr.selected { background: rgba(16,185,129,.06); }
.gw-table .checkbox-cell { width: 36px; text-align: center; }
.gw-table .op-cell { white-space: nowrap; }
.gw-table .col-fixed { position: sticky; right: 0; background: #fff; box-shadow: -1px 0 0 var(--border); }
.gw-table tbody tr:hover .col-fixed { background: var(--bg-row-hover); }
.gw-table .op-actions { display: flex; gap: 6px; align-items: center; }
.gw-table .op-link {
  color: var(--brand-light); font-size: 12px; cursor: pointer;
}
.gw-table .op-link:hover { text-decoration: underline; }
.gw-table .op-link.danger { color: var(--danger); }
.gw-table .op-link.primary { color: var(--primary); }

/* 空状态 */
.empty-state {
  padding: 60px 20px; text-align: center; color: var(--text-3);
}
.empty-state-ico {
  width: 80px; height: 80px; margin: 0 auto 12px; opacity: .35;
}
.empty-state-text { font-size: 13px; }

/* ========= 状态/标签 ========= */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 12px; line-height: 1.4;
}
.tag-default { background: var(--bg-hover); color: var(--text-2); }
.tag-info    { background: #e0f2fe; color: #0369a1; }
.tag-success { background: var(--primary-soft); color: var(--primary-hover); }
.tag-warning { background: #fef3c7; color: #b45309; }
.tag-danger  { background: #fee2e2; color: #b91c1c; }
.tag-purple  { background: #ede9fe; color: #6d28d9; }

.tags-list { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.tags-list .tag { font-size: 11px; padding: 1px 6px; }

/* 开关 */
.switch {
  display: inline-block; position: relative; width: 32px; height: 18px;
  background: #cbd5e1; border-radius: 9px; cursor: pointer; transition: background .15s;
}
.switch::before {
  content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px;
  background: #fff; border-radius: 50%; transition: transform .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch.on { background: var(--primary); }
.switch.on::before { transform: translateX(14px); }
.switch.small { width: 26px; height: 16px; }
.switch.small::before { width: 12px; height: 12px; }
.switch.on.small::before { transform: translateX(10px); }

/* ========= 分页 ========= */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px;
}
.pagination-info { color: var(--text-3); }
.pagination-controls { display: flex; align-items: center; gap: 4px; }
.pg-btn {
  min-width: 28px; height: 28px; padding: 0 6px;
  border: 1px solid var(--border); background: #fff;
  border-radius: var(--radius); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.pg-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pg-btn:disabled { opacity: .5; cursor: not-allowed; }
.pg-size-select { height: 28px; padding: 0 6px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }

/* ========= 弹窗 ========= */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal {
  background: #fff; border-radius: var(--radius-lg);
  width: 100%; max-width: 720px; max-height: 86vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-lg); animation: modal-in .15s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal.wide { max-width: 960px; }
.modal.narrow { max-width: 480px; }
.modal-hd {
  display: flex; align-items: center; padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close {
  margin-left: auto; width: 28px; height: 28px; border-radius: 4px;
  background: transparent; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 18px;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-1); }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-ft {
  padding: 12px 18px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ========= 工作台专用 ========= */
.workbench-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(12, 1fr);
}
.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-4  { grid-column: span 4; }
.col-6  { grid-column: span 6; }
.col-3  { grid-column: span 3; }

.switch-card {
  display: flex; align-items: center; padding: 14px 16px; gap: 12px;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand-light));
  border-radius: var(--radius-lg); color: #fff;
}
.switch-card.green { background: linear-gradient(135deg, var(--primary), var(--primary-hover)); }
.switch-card.purple { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.switch-card.orange { background: linear-gradient(135deg, #ea580c, #f59e0b); }
.switch-card.cyan   { background: linear-gradient(135deg, #0891b2, #06b6d4); }
.switch-card-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.switch-card-icon svg { width: 20px; height: 20px; }
.switch-card-meta { flex: 1; min-width: 0; }
.switch-card-title { font-size: 13px; opacity: .9; }
.switch-card-value { font-size: 22px; font-weight: 700; margin-top: 2px; }
.switch-card-action {
  width: 36px; height: 20px; background: rgba(255,255,255,.3);
  border-radius: 10px; cursor: pointer; position: relative;
}
.switch-card-action.on { background: rgba(255,255,255,.55); }
.switch-card-action::before {
  content: ''; position: absolute; left: 2px; top: 2px;
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  transition: transform .15s;
}
.switch-card-action.on::before { transform: translateX(16px); }

/* 工序进度圆环 */
.progress-dots {
  display: flex; align-items: center; gap: 4px;
}
.progress-dot {
  width: 22px; height: 22px; border-radius: 50%;
  background: #e2e8f0; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600;
  position: relative;
}
.progress-dot.done   { background: var(--primary); color: #fff; }
.progress-dot.active { background: #fff; border: 2px solid var(--primary); color: var(--primary); }
.progress-dot-line { width: 6px; height: 2px; background: #e2e8f0; }
.progress-dot-line.done { background: var(--primary); }

.progress-bar { width: 100%; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(to right, var(--primary), #34d399); }

/* 状态标签 */
.status-tag { padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; display: inline-block; }
.status-pending   { background: #fef3c7; color: #b45309; }
.status-producing { background: #dbeafe; color: #1d4ed8; }
.status-paused    { background: #ffedd5; color: #c2410c; }
.status-completed { background: var(--primary-soft); color: var(--primary-hover); }
.status-cancelled { background: #fee2e2; color: #b91c1c; }
.status-pass      { background: var(--primary-soft); color: var(--primary-hover); }
.status-fail      { background: #fee2e2; color: #b91c1c; }
.status-active    { background: #dbeafe; color: #1d4ed8; }
.status-finished  { background: var(--primary-soft); color: var(--primary-hover); }

/* 仪表卡片 */
.stat-card {
  background: #fff; border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 16px;
  display: flex; align-items: center; gap: 12px;
}
.stat-card-ico {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--brand-bg-soft); color: var(--brand-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
}
.stat-card-ico.green { background: var(--primary-soft); color: var(--primary); }
.stat-card-ico.orange { background: #fef3c7; color: #b45309; }
.stat-card-ico.red    { background: #fee2e2; color: #b91c1c; }
.stat-card-value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat-card-label { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* 快捷入口 */
.quick-entry { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.quick-entry-item {
  padding: 16px 8px; border-radius: var(--radius); background: var(--bg-hover);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; transition: all .15s;
}
.quick-entry-item:hover { background: var(--primary-soft); }
.quick-entry-ico {
  width: 36px; height: 36px; border-radius: 8px;
  background: #fff; color: var(--brand-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.quick-entry-item:hover .quick-entry-ico { background: var(--primary); color: #fff; }
.quick-entry-label { font-size: 12px; color: var(--text-2); }

/* 公告 */
.notice-list { display: flex; flex-direction: column; }
.notice-item {
  padding: 10px 0; border-bottom: 1px dashed var(--border);
  display: flex; align-items: center; gap: 10px;
}
.notice-item:last-child { border-bottom: none; }
.notice-item-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex-shrink: 0;
}
.notice-item-title { flex: 1; font-size: 13px; }
.notice-item-time { font-size: 12px; color: var(--text-3); flex-shrink: 0; }
.notice-top { color: var(--danger); font-weight: 600; }

/* 列配置弹窗 */
.col-config-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.col-config-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 4px; cursor: pointer;
}
.col-config-item:hover { background: var(--bg-hover); }
.col-config-item input[type="checkbox"] { margin: 0; }
.col-config-item.disabled { opacity: .5; cursor: not-allowed; }

/* 扩展字段弹窗 */
.ext-field-grid { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: center; }
.ext-field-grid > * { min-width: 0; }

/* 消息中心 */
.msg-category-bar {
  display: flex; gap: 4px; padding: 8px 16px; background: var(--bg-hover);
  border-radius: var(--radius); margin-bottom: 12px; flex-wrap: wrap;
}
.msg-cat-btn {
  padding: 6px 14px; border-radius: 6px; font-size: 13px;
  cursor: pointer; background: #fff; border: 1px solid transparent;
}
.msg-cat-btn.active { background: var(--primary); color: #fff; }
.msg-type-bar {
  display: flex; gap: 4px; margin-bottom: 12px;
}
.msg-type-btn {
  padding: 4px 12px; border-radius: 4px; font-size: 12px;
  cursor: pointer; color: var(--text-2);
}
.msg-type-btn.active { color: var(--primary); font-weight: 600; }
.msg-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; background: #fff;
  border-radius: var(--radius); border: 1px solid var(--border);
  margin-bottom: 8px; cursor: pointer;
}
.msg-item:hover { background: var(--bg-hover); }
.msg-item.unread { background: #fffbf0; border-color: #fde68a; }
.msg-ico {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.msg-ico.alarm  { background: #fee2e2; color: var(--danger); }
.msg-ico.todo   { background: #fef3c7; color: #b45309; }
.msg-ico.notice { background: #dbeafe; color: #1d4ed8; }
.msg-body { flex: 1; min-width: 0; }
.msg-title { font-weight: 500; }
.msg-content { color: var(--text-2); font-size: 12px; margin-top: 4px; }
.msg-time { color: var(--text-3); font-size: 12px; flex-shrink: 0; }
.msg-unread-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
  margin-right: 6px;
}
.msg-type-tag {
  display: inline-block; font-size: 11px; line-height: 1; padding: 3px 7px; border-radius: 10px;
  margin-left: 8px; vertical-align: middle; font-weight: 500;
}
.msg-type-tag.alarm { background: #fee2e2; color: var(--danger); }
.msg-type-tag.todo { background: #fef3c7; color: #b45309; }
.msg-type-tag.notify { background: #dbeafe; color: #1d4ed8; }

/* 大屏占位 */
.dashboard-placeholder {
  height: 60vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #fff; border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  color: var(--text-3);
}
.dashboard-placeholder-ico { font-size: 48px; margin-bottom: 12px; }

/* 详情页 */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px;
}
.detail-item { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.detail-item-label { color: var(--text-3); font-size: 12px; min-width: 80px; }
.detail-item-value { color: var(--text-1); font-size: 13px; flex: 1; }

/* Toast */
.toast-stack {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  padding: 8px 16px; border-radius: 6px; background: #fff;
  box-shadow: var(--shadow-md); font-size: 13px;
  display: flex; align-items: center; gap: 8px;
  animation: toast-in .15s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast.success { border-left: 4px solid var(--primary); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.info    { border-left: 4px solid var(--info); }

/* 法律文档（用户协议/隐私政策） */
.legal-doc {
  max-height: 60vh; overflow-y: auto;
  padding: 4px 0;
}
.legal-doc h2 { font-size: 16px; font-weight: 600; margin: 20px 0 8px; }
.legal-doc h3 { font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.legal-doc p  { line-height: 1.8; margin: 6px 0; font-size: 13px; color: var(--text-2); }
.legal-doc ul, .legal-doc ol { padding-left: 22px; line-height: 1.8; font-size: 13px; color: var(--text-2); }
.legal-doc li { margin: 4px 0; }

/* 响应式小屏适配 */
@media (max-width: 1100px) {
  .workbench-grid > .col-3 { grid-column: span 6; }
  .workbench-grid > .col-4 { grid-column: span 12; }
  .workbench-grid > .col-8 { grid-column: span 12; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .login-left { display: none; }
  .login-right { width: 100%; }
}

/* ===================== 机台报表 ===================== */
.report-summary { display: flex; gap: 14px; flex-wrap: wrap; margin: 4px 0 14px; }
.summary-card { flex: 1; min-width: 140px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(16,24,40,.04); }
.summary-val { font-size: 26px; font-weight: 700; color: var(--brand-deep); }
.summary-label { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.range-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid #d8dee9; background: #fff; color: var(--text-2); padding: 5px 12px; border-radius: 16px; cursor: pointer; font-size: 13px; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.custom-range { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.report-machine .filter-label { min-width: 64px; }

/* ===================== 移动端卡片配置 ===================== */
.mobile-card-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.mobile-card-field { display: flex; align-items: center; gap: 8px; border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: 13px; }
.mobile-card-field:hover { border-color: var(--primary); }
.mobile-card-preview-title { font-size: 13px; color: var(--text-3); margin: 6px 0; }
.mobile-card-preview { background: #f6f8fa; border-radius: 10px; padding: 14px; display: flex; justify-content: center; }
.mcard { width: 240px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.mcard-hd { background: var(--brand-deep); color: #fff; padding: 8px 12px; font-size: 13px; font-weight: 600; }
.mcard-row { display: flex; justify-content: space-between; padding: 8px 12px; border-top: 1px solid #f0f2f5; font-size: 13px; }
.mcard-row .mcard-val { color: var(--text-3); }
.mcard-empty { color: var(--text-3); text-align: center; padding: 24px; }

