﻿* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #eef1f5; color: #333; }

/* ========== 登录（原型：浅灰底 + 白色圆角卡片） ========== */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #eef1f5; }
.login-box { width: 360px; background: #fff; border-radius: 8px; padding: 28px 32px; box-shadow: 0 2px 12px rgba(0,0,0,.08); text-align: center; }
.login-title { font-size: 16px; font-weight: bold; text-align: center; color: #1a3c5e; }
.login-sub { font-size: 11px; text-align: center; color: #999; margin: 4px 0 18px; }
.login-tip { font-size: 12px; color: #b8860b; background: #fff8e1; border: 1px solid #ffe082; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; text-align: left; }
.login-msg { margin-top: 12px; font-size: 12px; color: #e74c3c; text-align: center; min-height: 18px; }
.login-link { margin-top: 12px; text-align: center; font-size: 11px; color: #1a3c5e; cursor: pointer; }
.login-link:hover { text-decoration: underline; }
.input { width: 100%; height: 38px; border: 1px solid #dfe6f0; border-radius: 4px; padding: 0 12px; font-size: 13px; margin-bottom: 10px; outline: none; background: #f7f9fc; box-sizing: border-box; }
.input:focus { border-color: #1a3c5e; background: #fff; }

/* ========== 按钮（原型：主操作深蓝 #1a3c5e、次要白底描边） ========== */
.btn { height: 36px; padding: 0 16px; border: 1px solid #c9d3e0; background: #fff; border-radius: 4px; font-size: 13px; cursor: pointer; color: #1a3c5e; }
.btn:hover { border-color: #1a3c5e; color: #1a3c5e; background: #f2f6fb; }
.btn.plain { background: #fff; color: #1a3c5e; border: 1px solid #c9d3e0; }
.btn-primary { background: #1a3c5e; border: none; color: #fff; }
.btn-primary:hover { background: #2a5688; color: #fff; opacity: 1; }
.btn-block { width: 100%; margin-top: 6px; }
.btn-small { height: 28px; padding: 0 12px; font-size: 12px; margin-left: 8px; }

/* 待审批操作按钮：横排一行，放不下可换行但不竖排 */
.pending-actions-row { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.pending-actions-row .btn-small { margin-left: 0; }
.pending-actions-row .pending-row { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }

/* ========== 顶栏（原型：页面标题 + 右上用户） ========== */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; background: none; color: #333; height: auto; padding: 0; }
.topbar .t { font-size: 15px; font-weight: bold; color: #1a3c5e; }
.topbar .u { font-size: 12px; color: #666; }
.topbar-title { font-size: 15px; font-weight: bold; color: #1a3c5e; }
.topbar-user { display: flex; align-items: center; font-size: 12px; color: #666; gap: 8px; }
.topbar-user .btn-small { border-color: #c9d3e0; color: #1a3c5e; background: #fff; }
.topbar-user .btn-small:hover { border-color: #1a3c5e; color: #1a3c5e; background: #f2f6fb; }
.topbar-link { color: #1a3c5e; cursor: pointer; }
.topbar-link:hover { text-decoration: underline; }

/* ========== 整体布局（原型：深蓝侧边栏 + 内容区） ========== */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 170px; background: #1a3c5e; color: #fff; padding-top: 10px; flex-shrink: 0; }
.side-brand { padding: 10px 14px; font-size: 13px; font-weight: bold; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 8px; color: #fff; }
.sidebar .side-item, .sidebar .nav-item { padding: 8px 14px; font-size: 12px; color: rgba(255,255,255,.75); cursor: pointer; border: none; background: none; text-align: left; width: 100%; }
.sidebar .side-item:hover, .sidebar .nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .side-item.active, .sidebar .nav-item.active { background: #2a5688; color: #fff; font-weight: normal; }
.main { flex: 1; padding: 16px; background: #f7f9fc; min-width: 0; }

/* ========== 容器（原型：白色圆角卡片） ========== */
.container { max-width: 1200px; margin: 0 auto; padding: 0; }
.card { background: #fff; border: 1px solid #e3e8f0; border-radius: 6px; padding: 14px; margin-bottom: 12px; box-shadow: none; }
.card-title { font-size: 13px; font-weight: bold; margin-bottom: 10px; color: #1a3c5e; }
.staff-tip { font-size: 12px; color: #777; background: #f7f9fc; border: 1px dashed #d8dee8; padding: 8px 10px; border-radius: 4px; margin-bottom: 12px; line-height: 1.7; }

/* ========== 表单（原型 form-grid 四列） ========== */
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 16px; }
.form-item { margin-bottom: 4px; }
.form-label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; }
.req { color: #e74c3c; }
.form-actions { margin-top: 16px; display: flex; gap: 12px; }
.radio-group { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding-top: 8px; }
.radio-label { font-size: 13px; color: #333; cursor: pointer; display: flex; align-items: center; gap: 4px; }

/* 订单操作按钮与生产行 */
.btn-danger { background: #e74c3c; color: #fff; border: none; }
.btn-danger:hover { opacity: .9; color: #fff; }
.prod-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.prod-row .input { margin-bottom: 0; height: 34px; font-size: 13px; }

/* 包装规格点选卡片 */
.radio-sub-title { font-size: 12px; color: #9aa5b4; margin: 2px 0 6px; }
.radio-card-group { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding-top: 2px; margin-bottom: 4px; }
.radio-card-group .radio-label { position: relative; display: flex; align-items: center; justify-content: center; min-height: 38px; border: 1px solid #d9dde3; border-radius: 8px; background: #fbfcfe; font-size: 13px; color: #3a4556; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; text-align: center; padding: 6px 8px; margin: 0; }
.radio-card-group .radio-label input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-card-group .radio-label:hover { border-color: #9cc3ea; background: #f2f8ff; }
.radio-card-group .radio-label:has(input:checked) { border-color: #4A90D9; background: #e8f2fc; box-shadow: inset 0 0 0 1px #4A90D9; }
.radio-card-group .radio-label input:checked + span { color: #1a3c5e; font-weight: 600; }

/* ========== 列表 ========== */
.filter-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.export-bar { display: flex; align-items: center; gap: 8px; }
.export-date { width: 150px; margin-bottom: 0; }
.export-sep { font-size: 13px; color: #8a94a6; }
.filter-tabs { display: flex; gap: 6px; }
.filter-tab { padding: 4px 12px; border: 1px solid #dfe6f0; border-radius: 3px; background: #fff; font-size: 12px; cursor: pointer; color: #555; }
.filter-tab:hover { border-color: #1a3c5e; color: #1a3c5e; }
.filter-tab.active { background: #1a3c5e; color: #fff; border-color: #1a3c5e; }
.filter-subtabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-subtab { padding: 4px 12px; border-radius: 12px; background: #fff; font-size: 12px; cursor: pointer; color: #555; border: 1px solid #e3e7ec; }
.filter-subtab.active { background: #e8f0fe; color: #1a56b0; font-weight: 600; border-color: #4A90D9; }
.search-input { width: 280px; margin-bottom: 0; }
.table-wrap { overflow-x: auto; }
.order-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.order-table th { background: #f3f6fa; padding: 7px 8px; text-align: left; font-weight: 600; color: #555; border-bottom: 1px solid #dfe6f0; white-space: nowrap; }
.order-table td { padding: 7px 8px; border-bottom: 1px solid #eef1f5; white-space: nowrap; }
.order-table tr:hover td { background: #f7fafd; }
.tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.tag-pending { background: #ffe8cc; color: #d4801f; }
.tag-progress { background: #dbeafe; color: #2563eb; }
.tag-completed { background: #d1fae5; color: #0f9d58; }
.tag-shipped { background: #ede9fe; color: #7c3aed; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; font-size: 13px; color: #5a6472; }

/* ========== 弹窗 ========== */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { width: 640px; max-width: 92vw; max-height: 82vh; background: #fff; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.modal-title { padding: 14px 20px; font-size: 15px; font-weight: bold; color: #1a3c5e; border-bottom: 1px solid #eef0f3; display: flex; justify-content: space-between; align-items: center; }
.modal-close { cursor: pointer; font-size: 20px; color: #8a94a6; }
.modal-body { padding: 16px 20px; overflow-y: auto; font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.detail-item { display: flex; }
.detail-item .k { color: #8a94a6; width: 90px; flex-shrink: 0; }
.detail-item .v { color: #2c3e50; word-break: break-all; }
.detail-full { grid-column: 1 / -1; }

/* ========== 后台管理 ========== */
.sub-title { font-size: 14px; font-weight: 700; color: #1a3c5e; margin: 18px 0 10px; }
.cfg-view { padding-top: 6px; }
.cfg-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cfg-list { display: flex; flex-direction: column; gap: 8px; }
.cfg-item { display: flex; align-items: center; justify-content: space-between; background: #f7f9fc; border: 1px solid #e8ecf1; border-radius: 6px; padding: 8px 14px; font-size: 13px; }
.cfg-item-name { font-weight: 600; color: #2c3e50; }
.cfg-item-sub { color: #8a94a6; font-size: 12px; margin-left: 8px; }
.cfg-item-actions { display: flex; gap: 6px; align-items: center; }
.btn-danger { background: #e74c3c; border: none; color: #fff; }
.btn-danger:hover { opacity: .9; color: #fff; }
.btn-warn { background: #f39c12; border: none; color: #fff; }
.btn-warn:hover { opacity: .9; color: #fff; }
.role-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.role-btn { padding: 3px 10px; border: 1px solid #d9dde3; background: #fff; border-radius: 12px; font-size: 12px; cursor: pointer; color: #5a6472; }
.role-btn.active { background: #1a3c5e; color: #fff; border-color: #1a3c5e; }
.perms-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.perm-btn { padding: 3px 10px; border: 1px solid #d9dde3; background: #fff; border-radius: 12px; font-size: 12px; cursor: pointer; color: #5a6472; }
.perm-btn.active { background: #e8f0fa; color: #1a3c5e; border-color: #4A90D9; }
/* 员工管理：角色/权限精简展示 + 弹窗入口 */
.staff-tag { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; background: #f3f6fa; color: #8a94a6; border: 1px solid #e3e9f2; vertical-align: middle; }
.staff-tag-role { background: #1a3c5e; color: #fff; border-color: #1a3c5e; }
.staff-tag-perm { background: #e8f0fa; color: #1a3c5e; border-color: #c9ddf5; }
.mini-btn { margin-left: 6px; padding: 2px 10px; border: 1px solid #4A90D9; background: #fff; color: #2a5f8a; border-radius: 6px; font-size: 12px; cursor: pointer; vertical-align: middle; }
.mini-btn:hover { background: #e8f0fa; }
.modify-item { background: #f7f9fc; border: 1px solid #e8ecf1; border-radius: 8px; padding: 12px 16px; margin-bottom: 10px; }
.modify-item .modify-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.modify-item .modify-body { font-size: 13px; color: #5a6472; line-height: 1.7; }
.modify-item .modify-actions { display: flex; gap: 8px; margin-top: 8px; }
.empty-tip { text-align: center; color: #8a94a6; padding: 30px 0; font-size: 13px; }

/* ========== 响应式 ========== */
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr 1fr; } .sidebar { width: 150px; } }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } .search-input { width: 100%; } .app { flex-direction: column; } .sidebar { width: 100%; } .main { padding: 10px; } }

/* 记录查看：员工多选 */
.worker-check-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.worker-check-list .wck-item { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid #d8dee9; border-radius: 14px; font-size: 13px; cursor: pointer; user-select: none; background: #fff; }
.worker-check-list .wck-item.checked { background: #4A90D9; color: #fff; border-color: #4A90D9; }
.worker-check-list .wck-item input { display: none; }

/* 配置管理文本域 */
.cfg-textarea { width: 100%; max-width: 640px; box-sizing: border-box; border: 1px solid #d8dee9; border-radius: 6px; padding: 8px 10px; font-size: 14px; font-family: inherit; line-height: 1.6; resize: vertical; }
.cfg-textarea:focus { outline: none; border-color: #4A90D9; }
.cfg-row { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }

/* ===== 拆单重构 S5（2026-11-09）：拆单模式标签 / 子单行 / 差额条 / 子单上限提示 ===== */
.tag-planned { background: #dbeafe; color: #2563eb; }
.tag-unplanned { background: #f1f3f5; color: #6b7280; }
.tag-over { background: #fdecec; color: #d93025; }
.sub-count-tip { margin-left: 4px; font-size: 12px; color: #8a94a6; }
.diff-bar { margin: 8px 0 10px; padding: 8px 12px; border-radius: 6px; font-size: 13px; line-height: 1.5; }
.diff-ok { background: #e6f7ee; color: #0f9d58; border: 1px solid #b7e4c9; }
.diff-short { background: #fff7e6; color: #d4801f; border: 1px solid #ffd591; }
.diff-over { background: #fdecec; color: #d93025; border: 1px solid #f5b5b0; }
.split-head { font-size: 13px; color: #3a4556; margin-bottom: 10px; line-height: 1.8; }
.split-head b { color: #1a3c5e; }
.sub-row { display: grid; grid-template-columns: 90px 120px 1fr 1fr 78px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed #eef0f3; }
.sub-row .input { margin-bottom: 0; height: 34px; font-size: 13px; }
.sub-row.row-error .sub-qty { border-color: #d93025; background: #fff5f5; }
.sub-row.row-del { opacity: .45; }
.sub-idx { font-size: 13px; color: #1a3c5e; font-weight: 600; }
.sub-new { margin-left: 4px; font-style: normal; font-size: 11px; color: #2563eb; }
.sub-meta { font-size: 12px; color: #6b7280; }
.sub-hint { grid-column: 1 / -1; font-size: 12px; color: #d93025; }
.sub-hint:empty { display: none; }
.cap-tip { margin: 6px 0 10px; padding: 8px 12px; border-radius: 6px; background: #e8f2fc; color: #1a3c5e; font-size: 13px; line-height: 1.6; }
.sum-tip { margin-top: 10px; font-size: 13px; color: #3a4556; }
.sum-tip.over { color: #d93025; font-weight: 600; }
/* 2026-11-11 合计标红：合计数字与计划量/下单量不一致时标红 */
.qty-mismatch { color: #d93025; font-weight: 700; }
.detail-total-row td { font-weight: 600; background: #fafbfc; }
.detail-qty-note { color: #8a94a6; font-size: 12px; }
.sub-table-wrap { margin-top: 10px; }
.detail-sub-title { margin: 14px 0 6px; font-size: 14px; font-weight: 600; color: #1a3c5e; }
.detail-sub-box .order-table th, .detail-sub-box .order-table td { font-size: 12px; padding: 6px 8px; }
.detail-sub-box .empty-tip { text-align: center; color: #8a94a6; }

.sub-remain { color: #1a6fbf; }
.sub-row .sub-qty { width: 110px; }
.diff-bar { font-weight: 600; }
