/* 易智MES 车间前端公共样式 */
:root {
  --bg: #f2f4f7;
  --card: #ffffff;
  --line: #e3e7ee;
  --text: #1f2329;
  --sub: #6b7280;
  --accent: #0e7c86;
  --accent2: #e8a33d;
  --ok: #1a9e6c;
  --warn: #e8a33d;
  --bad: #d94f4f;
  --dark: #0d1b2a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
a { text-decoration: none; color: inherit; }
.topbar { background: linear-gradient(90deg, #0e7c86, #125e63); color: #fff; padding: 10px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar .logo { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.topbar .logo small { font-size: 11px; font-weight: 400; opacity: .8; margin-left: 6px; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { padding: 6px 14px; border-radius: 6px; font-size: 13px; opacity: .85; }
.topbar nav a.active, .topbar nav a:hover { background: rgba(255,255,255,.18); opacity: 1; }
.topbar .right { margin-left: auto; font-size: 12px; opacity: .85; }
.wrap { max-width: 1280px; margin: 16px auto; padding: 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.grid { display: flex; flex-wrap: wrap; gap: 12px; }
.grid > * { flex: 1 1 320px; min-width: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: #f7f9fb; color: var(--sub); font-weight: 600; position: sticky; top: 0; }
tr:hover td { background: #f4fafb; }
.bar { height: 8px; background: #eef1f4; border-radius: 4px; overflow: hidden; min-width: 90px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #0e7c86, #20a4ac); }
.bar i.warn { background: linear-gradient(90deg, #e8a33d, #f0b65c); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.pill.s0 { background: #eef1f4; color: #555; }
.pill.s2 { background: #e6f4fb; color: #0b6f9c; }
.pill.s3 { background: #e5f6ee; color: #157a4d; }
.num { font-weight: 700; font-variant-numeric: tabular-nums; }
.btn { display: inline-block; padding: 6px 16px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 13px; border: none; cursor: pointer; }
.btn.ghost { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.btn.big { padding: 12px 24px; font-size: 15px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
input, select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: #fff; width: 100%; }
label { font-size: 12px; color: var(--sub); display: block; margin: 10px 0 4px; }
.h2 { font-size: 15px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.h2 .tag { font-size: 11px; color: var(--sub); font-weight: 400; }
.empty { text-align: center; color: var(--sub); padding: 30px 0; }
.toast { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); background: rgba(20,20,20,.92); color: #fff; padding: 10px 22px; border-radius: 8px; z-index: 99; font-size: 14px; display: none; }
.toast.ok { background: rgba(26,158,108,.95); }
.toast.bad { background: rgba(217,79,79,.95); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 0 0 auto; }
@media (max-width: 640px) {
  .wrap { padding: 0 6px; }
  th, td { padding: 6px; font-size: 12px; }
  .grid > * { flex-basis: 100%; }
}
/* ---------- 深色大屏 ---------- */
body.dark { background: #0d1b2a; color: #e8edf3; }
body.dark .card { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); }
body.dark th { background: rgba(255,255,255,.06); color: #9fb0c0; }
body.dark tr:hover td { background: rgba(14,124,134,.15); }
body.dark .bar { background: rgba(255,255,255,.08); }
body.dark .pill.s0 { background: rgba(255,255,255,.08); color: #b9c4cf; }
body.dark .h2 { color: #fff; }
.user{font-size:13px;color:var(--sub);margin-left:auto;white-space:nowrap;padding-left:14px}.user b{color:var(--text)}.user a{display:inline-block;color:#fff;background:#d93025;border-radius:12px;padding:4px 13px;margin-left:10px;font-weight:600;cursor:pointer;text-decoration:none;box-shadow:0 1px 4px rgba(0,0,0,.25)}.user a:hover{background:#c5221f}

/* ========== 界面美化增强（现代卡片风格：卡片化/渐变/动效，仅追加不改坏） ========== */
.topbar { box-shadow: 0 2px 10px rgba(13,27,42,.18); position: sticky; top: 0; z-index: 50; }
.topbar nav a { transition: background .15s ease, opacity .15s ease; }
.card { border-radius: 12px; box-shadow: 0 1px 3px rgba(13,27,42,.05); transition: box-shadow .2s ease, transform .2s ease; }
.card:hover { box-shadow: 0 4px 14px rgba(13,27,42,.09); }
.h2 { padding-left: 10px; border-left: 3px solid var(--accent); }
.h2 .tag { padding: 1px 8px; background: rgba(14,124,134,.08); border-radius: 8px; }
table thead th { background: linear-gradient(180deg,#f8fafc,#f1f4f8); color:#4b5563; }
th, td { white-space: nowrap; }
tbody tr { transition: background .12s ease; }
.btn { transition: all .15s ease; box-shadow: 0 1px 2px rgba(13,27,42,.08); }
.btn:hover { filter: brightness(1.08); box-shadow: 0 2px 6px rgba(13,27,42,.15); }
.btn:active { transform: translateY(1px); }
.btn.ghost:hover { background: rgba(14,124,134,.08); }
input, select { transition: border-color .15s ease, box-shadow .15s ease; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; font-size: 14px; background: #fff; font-family: inherit; line-height: normal; min-width: 120px; box-sizing: border-box; }
select { min-width: 140px; appearance: auto; }
textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 14px; font-family: inherit; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,124,134,.12); }
.bar { min-height: 8px; }
.pill { box-shadow: inset 0 0 0 1px rgba(0,0,0,.03); }
.pager .btn { padding: 5px 12px; font-size: 12px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c3ccd6; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9fb0bf; }
::-webkit-scrollbar-track { background: transparent; }
.app-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; background: #fff; box-shadow: 0 1px 3px rgba(13,27,42,.04); transition: box-shadow .2s ease; }
.app-card:hover { box-shadow: 0 3px 10px rgba(13,27,42,.08); }
.prod { transition: box-shadow .2s ease, transform .2s ease; }
.prod:hover { box-shadow: 0 3px 10px rgba(13,27,42,.10); transform: translateY(-1px); }

/* ========== 全局搜索（对标行业标杆工具条搜索） ========== */
.gsearch { position: relative; margin-left: auto; min-width: 260px; max-width: 420px; flex: 1 1 260px; }
.topbar .right { margin-left: 0; }
.gsearch input { width: 100%; padding: 7px 12px; border-radius: 18px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.16); color: #fff; font-size: 13px; }
.gsearch input::placeholder { color: rgba(255,255,255,.75); }
.gsearch input:focus { outline: none; background: rgba(255,255,255,.28); box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
.gsbox { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 24px rgba(13,27,42,.16); max-height: 60vh; overflow-y: auto; z-index: 999; padding: 6px 0; }
.gsbox a { display: block; padding: 8px 14px; font-size: 13px; color: var(--text); border-left: 3px solid transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gsbox a:hover { background: #f0f7f8; border-left-color: var(--accent); }
.gs-kind { padding: 6px 14px 4px; font-size: 11px; color: var(--accent); font-weight: 700; background: #f7fafb; }
.gs-none { padding: 18px; text-align: center; color: var(--sub); font-size: 13px; }
@media (max-width: 768px) { .gsearch { min-width: 150px; max-width: 200px; } }

/* ========== 工单超期红标（对标行业标杆「判断配置」） ========== */
.ovd { color: var(--bad); font-weight: 700; }

/* 复选框大小统一 */
input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
input[type=radio] { width: 16px; height: 16px; cursor: pointer; }

/* ========== 统一分页控件（美化版） ========== */
.pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding: 10px 4px; border-top: 1px solid var(--line); }
.pager .btn { padding: 6px 16px; font-size: 13px; border-radius: 6px; }
.pager .page-info { font-size: 13px; color: var(--sub); padding: 0 8px; font-variant-numeric: tabular-nums; }
.pager .page-size { font-size: 13px; color: var(--sub); display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pager .page-size input { width: 64px; height: 32px; padding: 0 8px; font-size: 13px; text-align: center; min-width: 50px; }
.pager .page-jump { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--sub); }
.pager .page-jump input { width: 50px; height: 32px; padding: 0 4px; text-align: center; font-size: 13px; min-width: 40px; }
.pager .btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* 表格容器优化 */
.table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--line); }
.table-wrap table { margin: 0; }
.table-wrap th, .table-wrap td { white-space: nowrap; }

/* 响应式表格小屏 */
@media (max-width: 768px) {
  .pager { flex-direction: column; align-items: stretch; }
  .pager .page-size { margin-left: 0; justify-content: flex-end; }
  .pager .page-jump { justify-content: flex-end; }
}
