* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", sans-serif; background: #0f172a; color: #e2e8f0; min-height: 100vh; }
a { color: #93c5fd; text-decoration: none; }

/* 顶部导航 */
.nav { background: #1e293b; display: flex; align-items: center; gap: 4px; padding: 0 16px; height: 52px; position: sticky; top: 0; z-index: 50; border-bottom: 1px solid #334155; }
.nav .brand { font-weight: bold; font-size: 16px; margin-right: 16px; color: #2563eb; }
.nav a { color: #cbd5e1; padding: 14px 12px; font-size: 14px; }
.nav a:hover { color: #fff; background: #334155; }
.nav a.active { color: #2563eb; border-bottom: 2px solid #2563eb; }
.nav .spacer { flex: 1; }
.nav .worker-box { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #94a3b8; }

.container { padding: 16px; max-width: 1500px; margin: 0 auto; }
.page-title { font-size: 18px; margin-bottom: 14px; display: flex; align-items: center; gap: 12px; }
.back-link { color: #2563eb; text-decoration: none; font-size: 13px; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.back-link:hover { text-decoration: underline; }

/* 卡片 */
.cards { display: grid; gap: 12px; margin-bottom: 16px; }
.cards.cols-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: #1e293b; border-radius: 10px; padding: 14px 18px; }
.card .label { font-size: 13px; color: #94a3b8; margin-bottom: 6px; }
.card .value { font-size: 24px; font-weight: bold; }

/* 烤箱卡片（车间看板） */
.oven-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.oven-card { background: #1e293b; border-radius: 12px; padding: 16px; cursor: pointer; border: 1px solid #334155; position: relative; }
.oven-card:hover { border-color: #2563eb; }
.oven-card .code { font-size: 22px; font-weight: bold; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.oven-card .temp { font-size: 30px; font-weight: bold; color: #2563eb; margin: 8px 0; }
.oven-card .meta { font-size: 12px; color: #94a3b8; line-height: 1.8; }
.oven-card .alarm-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.tag-running { background: #14532d; color: #86efac; }
.tag-stop { background: #1e293b; color: #94a3b8; border: 1px solid #334155; }
.tag-alarm { background: #7f1d1d; color: #fca5a5; }
.tag-pending { background: #78350f; color: #fbbf24; }

/* 面板 */
.panel { background: #1e293b; border-radius: 10px; padding: 14px; margin-bottom: 16px; }
.panel h2 { font-size: 15px; margin-bottom: 10px; color: #cbd5e1; }
.chart { width: 100%; height: 320px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: #94a3b8; font-weight: normal; padding: 8px 10px; border-bottom: 1px solid #334155; white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid #1e293b; }
tr:hover td { background: #263449; }

/* 按钮 */
.btn { display: inline-block; background: #2563eb; color: #fff; border: none; border-radius: 6px; padding: 7px 16px; font-size: 13px; cursor: pointer; }
.btn:hover { background: #1d4ed8; }
.btn.ghost { background: transparent; border: 1px solid #475569; color: #cbd5e1; }
.btn.ghost:hover { background: #334155; }
.btn.danger { background: #dc2626; }
.btn.danger:hover { background: #b91c1c; }
.btn.small { padding: 4px 10px; font-size: 12px; }

/* 表单 */
.form-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
input, select { background: #0f172a; border: 1px solid #334155; color: #e2e8f0; border-radius: 6px; padding: 8px 10px; font-size: 13px; }
input:focus, select:focus { outline: none; border-color: #2563eb; }
label { font-size: 13px; color: #94a3b8; }

/* 告警列表 */
.alarm-item { padding: 8px 10px; border-radius: 6px; margin-bottom: 6px; font-size: 13px; }
.alarm-item.warning { background: #7c2d12; color: #fdba74; }
.alarm-item.fault { background: #7f1d1d; color: #fca5a5; }
.alarm-item.info { background: #14532d; color: #86efac; }
.alarm-time { color: #94a3b8; margin-right: 8px; }
#alarmList, .scroll-list { max-height: 240px; overflow-y: auto; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal-mask.show { display: flex; }
.modal { background: #1e293b; border-radius: 12px; padding: 22px; width: 420px; max-width: 94vw; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-bottom: 16px; font-size: 16px; }

.toast { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); background: #334155; color: #fff; padding: 10px 20px; border-radius: 8px; z-index: 200; display: none; font-size: 14px; }
.stat-bar { display: flex; gap: 14px; font-size: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.stat-bar .s { background: #1e293b; border-radius: 8px; padding: 8px 16px; }
.empty-tip { color: #64748b; font-size: 13px; padding: 16px 0; }

/* 工单溢出：限定宽度 + 动态滚动显示（超出时跑马灯） */
.order-scroll { display: block; white-space: nowrap; overflow: hidden; max-width: 100%; }
.order-scroll .order-inner { display: inline-block; }
.order-scroll.overflowing .order-inner {
  animation: order-marquee var(--dur, 8s) ease-in-out infinite alternate;
}
@keyframes order-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(var(--shift, -60px)); }
}

/* ===== 烤箱卡片状态强化 ===== */
.oven-card.running { border-color: #22c55e; box-shadow: 0 0 12px rgba(34,197,94,.22); }
.oven-card.running .temp { color: #22c55e; }
.oven-card.standby { border-color: #eab308; box-shadow: 0 0 10px rgba(234,179,8,.15); }
.oven-card.standby .temp { color: #eab308; }
.oven-card.power_off { border-color: #475569; opacity: .55; }
.oven-card.pending { border-color: #f59e0b; box-shadow: 0 0 10px rgba(245,158,11,.18); }
.oven-card.pending .temp { color: #f59e0b; }
.oven-card.alarm { border-color: #ef4444; animation: alarm-pulse 1.6s ease-in-out infinite; }
.oven-card.alarm .temp { color: #ef4444; }
@keyframes alarm-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(239,68,68,.35); }
  50% { box-shadow: 0 0 18px rgba(239,68,68,.75); }
}
/* 卡片迷你曲线 */
.spark { height: 54px; margin: 2px 0 6px; }
.oven-card .meta .rec-line { color: #cbd5e1; }
