/* ==========================================================================
   21-C213 —— 仅补充 JanPNP 样式表里没有的应用级组件
   基础变量、布局、按钮、卡片、表格、设置项、登录页全部直接复用
   style.css / base.css / login.css / index.css / settings.css / mobile.css
   ========================================================================== */

/* ---------- 基础辅助 ---------- */
.muted { color: var(--text-secondary); }
.note { color: var(--text-secondary); font-size: 13px; line-height: 1.6; margin-top: 10px; }
.link { color: var(--primary-color); font-size: 13px; }
.link:hover { text-decoration: underline; }
.empty { text-align: center; padding: 28px 12px; color: var(--text-secondary); font-size: 13px; }
.empty-state { text-align: center; padding: 48px 20px; }
.big-emoji { font-size: 40px; font-weight: 700; color: var(--border-color); letter-spacing: 2px; margin-bottom: 12px; }
.narrow { max-width: 560px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ctl-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 24px; align-items: start; margin-bottom: 24px; }

/* ---------- 通用卡片（沿用 JanPNP 卡片观感） ---------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2, .card-head h3, .card > h3 { font-size: 18px; font-weight: 600; }

/* ---------- 统计卡 ---------- */
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--hover-bg);
    color: var(--primary-color);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0;
}
.stat-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .stat-icon { background: var(--hover-bg); }
.stat-sub { color: var(--text-secondary); font-size: 11.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    white-space: nowrap;
}
.chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--success-color); }

/* ---------- 进度条 ---------- */
.progress { position: relative; width: 100%; height: 24px; background: rgba(107, 114, 128, 0.24); border-radius: 12px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--primary-color); border-radius: 12px; transition: width 0.3s; }
.progress.slim { height: 8px; border-radius: 4px; }
.progress.slim > i { border-radius: 4px; }
.progress-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.65); }
.pbar { width: 110px; height: 8px; border-radius: 4px; background: rgba(107, 114, 128, 0.24); overflow: hidden; }
.pbar > i { display: block; height: 100%; background: var(--primary-color); border-radius: 4px; }

/* ---------- 小按钮 / 表单 ---------- */
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 4px; }
.form-error { color: var(--danger-color); font-size: 13px; line-height: 1.5; min-height: 18px; margin-top: 6px; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; }
.inline-form.wrap { flex-wrap: wrap; }
.inline-form > input { flex: 1; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.field > span { font-weight: 500; }

/* ---------- 表格里的任务单元格 ---------- */
.order-table .t-title { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.order-table .t-title img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border-color); background: var(--bg-color); flex-shrink: 0; }
.order-table .t-title .tn { min-width: 0; }
.order-table .t-title .tn b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.order-table .t-title .tn small { color: var(--text-secondary); font-size: 11px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- 打印机卡片 ---------- */
.printer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; }
.pcard {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.pcard-media { position: relative; display: block; height: 210px; background: #000; overflow: hidden; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-badges { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pcard-offline .pcard-media img { filter: grayscale(1) brightness(0.65); }
.pcard-body { padding: 16px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.pcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pcard-head h3 { font-size: 18px; font-weight: 600; line-height: 1.3; }
.pcard-sub { color: var(--text-secondary); font-size: 12.5px; margin-top: 2px; }
.pcard-file { margin: 12px 0 10px; font-size: 14px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 21px; }
.pcard-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--text-secondary); font-size: 12.5px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.pcard-meta b { color: var(--text-primary); font-weight: 600; }
.pcard-actions { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.pcard-actions .spacer { flex: 1; }
.skeleton-card {
    height: 380px; border-radius: 16px; border: 1px solid var(--border-color);
    background: linear-gradient(100deg, var(--card-bg) 30%, var(--bg-color) 50%, var(--card-bg) 70%);
    background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 队列 / 动态 ---------- */
.queue, .timeline { display: flex; flex-direction: column; }
.qitem { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.qitem:last-child { border-bottom: none; }
.qthumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border-color); background: var(--bg-color); flex-shrink: 0; }
.qmain { min-width: 0; flex: 1; }
.qtitle { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qsub { color: var(--text-secondary); font-size: 12px; margin-top: 2px; }
.qright { flex-shrink: 0; }
.event { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-color); font-size: 13px; align-items: flex-start; }
.event:last-child { border-bottom: none; }
.event .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary-color); margin-top: 7px; flex-shrink: 0; }
.event.ok .dot { background: var(--success-color); }
.event.warn .dot { background: var(--danger-color); }
.event .etime { color: var(--text-secondary); font-size: 12px; width: 90px; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ---------- 打印机详情 ---------- */
.camera-actions { display: flex; gap: 8px; padding: 12px 16px; justify-content: flex-end; border-top: 1px solid var(--border-color); }
.job-line { margin: 8px 0 4px; color: var(--text-primary); font-size: 14px; min-height: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-progress-meta { display: flex; justify-content: space-between; color: var(--text-secondary); font-size: 13px; margin-top: 8px; }
.files { display: flex; flex-direction: column; max-height: 380px; overflow: auto; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border-color); font-size: 13px; }
.file-row:last-child { border-bottom: none; }
.file-row .fname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row .fsize { color: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ---------- 系统 ---------- */
.cores { display: flex; flex-direction: column; gap: 14px; }
.core { display: grid; grid-template-columns: 56px 1fr 52px; align-items: center; gap: 12px; font-size: 13px; color: var(--text-secondary); }
.core .bar { height: 10px; border-radius: 5px; background: rgba(107, 114, 128, 0.24); overflow: hidden; }
.core .bar i { display: block; height: 100%; border-radius: 5px; background: var(--success-color); transition: width 0.4s; }
.core.warm .bar i { background: var(--warning-color); }
.core.hot .bar i { background: var(--danger-color); }
.services { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.svc { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); border: 1px solid var(--border-color); border-radius: 6px; padding: 4px 10px; }
.svc i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-secondary); }
.svc.on i { background: var(--success-color); }
.svc.off i { background: var(--danger-color); }

/* ---------- 上传 ---------- */
.upload-card { padding: 0; overflow: hidden; margin-bottom: 24px; }
.drop-inner {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 36px 20px; text-align: center;
    border: 2px dashed var(--border-color); border-radius: 12px; margin: 12px;
    transition: all 0.2s;
}
.drop-inner.hot { border-color: var(--primary-color); background: var(--hover-bg); }
.drop-icon svg { width: 32px; height: 32px; fill: none; stroke: var(--primary-color); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.drop-inner h2 { font-size: 18px; font-weight: 600; }
.drop-inner p { max-width: 560px; color: var(--text-secondary); font-size: 13px; }
.upload-status { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.upload-status .row-between { font-size: 13px; color: var(--text-secondary); }

/* ---------- 任务详情 ---------- */
.job-hero { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 24px; }
.job-thumb img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; border: 1px solid var(--border-color); background: var(--bg-color); }
.job-main { min-width: 0; }
.job-main h2 { font-size: 20px; font-weight: 600; }

/* ---------- 登录页补充 ---------- */
body.login-body { overflow: auto; }
.login-hint { text-align: center; font-size: 12px; color: var(--text-secondary); margin-top: 18px; line-height: 1.7; }
.login-theme { position: fixed; top: 20px; right: 20px; z-index: 20; }
.login-theme svg { width: 18px; height: 18px; }

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 1000px var(--bg-color) inset;
    box-shadow: 0 0 0 1000px var(--bg-color) inset;
    caret-color: var(--text-primary);
    transition: background-color 5000s ease-in-out 0s;
}

/* ---------- 确认弹窗（JanPNP base.css 用的是 svg 图标，这里补 img） ---------- */
.confirm-header img { width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; }

/* ---------- 导航 SVG ---------- */
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 移动端补充 ---------- */
.mobile-logout-btn { display: none; }

@media (max-width: 1180px) {
    .split, .detail-grid { grid-template-columns: 1fr; }
    .printer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .mobile-logout-btn { display: inline-flex; }
    .nav-item svg { width: 19px; height: 19px; }
    .split, .detail-grid { gap: 16px; }
    .printer-grid { gap: 16px; }
    .pcard-media { height: 190px; }
    .job-hero { grid-template-columns: 1fr; }
    .job-thumb img { max-height: 260px; }
}

@media (max-width: 480px) {
    .nav-item svg { width: 18px; height: 18px; }
    .pcard-media { height: 170px; }
    .order-table th, .order-table td { padding: 10px 8px; font-size: 12px; }
}

/* ---------- 图标 / 数值小字 ---------- */
.btn-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-value small { font-size: 15px; font-weight: 500; color: var(--text-secondary); margin-left: 2px; }
.login-theme { background: var(--card-bg); }

[hidden] { display: none !important; }

/* 前端筛选/表单控件 */
.inline-form .field input,
.inline-form .field select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}
.inline-form .field input:focus,
.inline-form .field select:focus {
  border-color: var(--primary-color);
}

/* 创建订单 */
.print-options { display: flex; flex-wrap: wrap; gap: 16px; padding: 4px 0 8px; }
.print-options label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-primary); cursor: pointer; }
.bom-row { cursor: pointer; }
.bom-row.selected { border-color: var(--primary-color); background: var(--hover-bg); }

/* JanPNP 风格复选框 */
.print-options label { gap: 8px; line-height: 20px; user-select: none; }
.print-options input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
  box-sizing: border-box;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.print-options input[type="checkbox"]:hover { border-color: var(--primary-color); }
.print-options input[type="checkbox"]:checked {
  background: var(--primary-color);
  border-color: var(--primary-color);
}
.print-options input[type="checkbox"]:checked::after {
  content: "";
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
.print-options input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* 卡片/链接按钮不要下划线 */
a.btn, a.btn:hover, a.btn:focus, a.btn:active { text-decoration: none !important; }
.sidebar-footer a, a.btn-logout, a.btn-logout:hover, a.btn-logout:focus { text-decoration: none !important; }
.setting-value { color: var(--text-primary); font-size: 14px; }

/* 修改密码卡片弹窗 */
.password-modal-content { max-width: 420px; width: calc(100% - 40px); }
.password-modal-content .form-group { margin-bottom: 14px; }
.password-modal-content label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-secondary); }
.password-modal-content input { width: 100%; padding: 10px 12px; background: var(--bg-color); color: var(--text-primary); border: 1px solid var(--border-color); border-radius: 8px; outline: none; font-size: 14px; }
.password-modal-content input:focus { border-color: var(--primary-color); }
.password-modal-content .error-message { min-height: 18px; font-size: 13px; color: var(--danger-color); }
.password-modal-content .modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--border-color); }
