/* ============================================================
 * 中育品格 · IT 维修工单系统 — 全局主题样式（零构建，配合 Tailwind CDN）
 * ============================================================ */
body { font-feature-settings: "tnum" 1; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ---------- 状态/标签 pill ---------- */
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 9999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill-green  { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.pill-amber  { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.pill-red    { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.pill-blue   { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.pill-gray   { background: #F1F5F9; color: #334155; border: 1px solid #CBD5E1; }
.pill-violet { background: #F5F3FF; color: #5B21B6; border: 1px solid #DDD6FE; }

/* ---------- 管理后台侧栏 / 顶部 Tab ---------- */
.nav-active { background: #EFF6FF; color: #1D4ED8; font-weight: 600; }
.top-tab { padding: 14px 4px; margin-right: 24px; font-size: 14px; color: #64748B; border-bottom: 2px solid transparent; cursor: pointer; }
.top-tab:hover { color: #0F172A; }
.top-tab-active { color: #1D4ED8; font-weight: 600; border-bottom-color: #2563EB; }

/* ---------- 设置页二级导航 / 字典 chip ---------- */
.sec-nav { display: block; padding: 7px 12px; border-radius: 8px; font-size: 13px; color: #64748B; }
.sec-nav:hover { background: #F8FAFC; color: #0F172A; }
.sec-nav-active { background: #EFF6FF; color: #1D4ED8; font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 9999px; font-size: 12px; background: #F1F5F9; color: #334155; border: 1px solid #CBD5E1; }
.chip button { color: #94A3B8; font-size: 12px; line-height: 1; }
.chip button:hover { color: #EF4444; }
.chip-select { height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid #E2E8F0; background: #fff; color: #475569; font-size: 13px; font-weight: 500; cursor: pointer; }
.chip-on { background: #EFF6FF; border-color: #93C5FD; color: #1D4ED8; font-weight: 600; }

/* ---------- Toast ---------- */
#app-toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast-item { padding: 9px 18px; border-radius: 10px; font-size: 13px; font-weight: 500; color: #fff; box-shadow: 0 8px 20px rgba(15,23,42,.18); animation: toast-in .18s ease-out; max-width: 86vw; }
.toast-success { background: #059669; }
.toast-error   { background: #DC2626; }
.toast-info    { background: #2563EB; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 模态框 ---------- */
.app-modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade-in .15s ease-out; }
.app-modal { background: #fff; border-radius: 16px; width: 100%; box-shadow: 0 20px 45px rgba(15,23,42,.25); max-height: 88vh; display: flex; flex-direction: column; animation: pop-in .18s ease-out; }
.app-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #F1F5F9; }
.app-modal-body { padding: 20px; overflow-y: auto; }
.app-modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid #F1F5F9; }
.app-modal-close { width: 30px; height: 30px; border-radius: 8px; color: #94A3B8; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.app-modal-close:hover { background: #F1F5F9; color: #0F172A; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

/* ---------- 九宫格图片上传 ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-item { position: relative; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden; background: #F1F5F9; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-item .photo-del { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 9999px; background: rgba(15,23,42,.6); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.photo-add { aspect-ratio: 1/1; border-radius: 10px; border: 2px dashed #CBD5E1; background: #F8FAFC; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #94A3B8; font-size: 11px; cursor: pointer; }
.photo-add:hover { border-color: #93C5FD; color: #2563EB; }
.photo-viewer { position: fixed; inset: 0; background: rgba(15,23,42,.85); z-index: 9500; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.photo-viewer img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }

/* ---------- 签名板 ---------- */
.sig-wrap { position: relative; height: 160px; border-radius: 12px; border: 2px dashed #CBD5E1; background: #fff; overflow: hidden; }
.sig-wrap canvas { width: 100%; height: 100%; touch-action: none; cursor: crosshair; display: block; }
.sig-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #CBD5E1; font-size: 22px; pointer-events: none; font-family: 'Xingkai SC','STXingkai','KaiTi',cursive; }
.sig-placeholder.hidden { display: none; }

/* ---------- 时间轴 ---------- */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: #E2E8F0; }
.timeline-item { position: relative; padding: 0 0 16px 12px; }
.timeline-item::before { content: ''; position: absolute; left: -19px; top: 5px; width: 10px; height: 10px; border-radius: 9999px; background: #2563EB; border: 2px solid #fff; box-shadow: 0 0 0 1px #BFDBFE; }
.timeline-item.tl-urge::before { background: #EF4444; box-shadow: 0 0 0 1px #FECACA; }
.timeline-item.tl-comment::before { background: #6366F1; box-shadow: 0 0 0 1px #C7D2FE; }
.timeline-item.tl-ok::before { background: #059669; box-shadow: 0 0 0 1px #A7F3D0; }

/* ---------- 表格通用 ---------- */
.data-table { width: 100%; text-align: left; }
.data-table thead tr { background: #F8FAFC; font-size: 12px; text-transform: uppercase; color: #64748B; border-bottom: 1px solid #E2E8F0; }
.data-table tbody tr { border-bottom: 1px solid #F1F5F9; }
.data-table tbody tr:hover { background: #F8FAFC; }
.empty-row td { text-align: center; color: #94A3B8; padding: 28px 0 !important; font-size: 13px; }

/* ---------- 进度条 ---------- */
.meter { height: 8px; border-radius: 9999px; background: #F1F5F9; overflow: hidden; }
.meter > div { height: 100%; border-radius: 9999px; }

/* ---------- 加载骨架 ---------- */
.loading-hint { text-align: center; color: #94A3B8; font-size: 13px; padding: 24px 0; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid #CBD5E1; border-top-color: #2563EB; border-radius: 9999px; animation: rot .7s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes rot { to { transform: rotate(360deg); } }
