/* ==========================================================================
   生产报工系统 - 原生前端样式（无 Vue / 无 Element Plus 依赖）
   视觉参照 Element Plus 默认主题 + 项目原有橙色品牌色 (#f59e0b)
   ========================================================================== */

:root {
  --brand: #f59e0b;
  --brand-dark: #d97706;
  --brand-light: #fff7ed;

  --primary: #409eff;
  --primary-hover: #66b1ff;
  --primary-active: #3a8ee6;

  --success: #67c23a;
  --danger: #f56c6c;
  --danger-hover: #f78989;
  --warning: #e6a23c;
  --info: #909399;

  --text-main: #1f2937;
  --text-regular: #606266;
  --text-secondary: #909399;
  --text-placeholder: #a8abb2;

  --border: #dcdfe6;
  --border-light: #ebeef5;
  --border-lighter: #f2f6fc;

  --bg-page: #f3f4f6;
  --bg-white: #ffffff;
  --bg-hover: #f5f7fa;

  --sidebar-bg: #1f2937;
  --sidebar-hover: #374151;

  --radius: 4px;
  --radius-lg: 8px;
  --shadow-card: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
  --shadow-dialog: 0 12px 32px 4px rgba(0, 0, 0, 0.06), 0 8px 20px rgba(0, 0, 0, 0.08);

  --header-height: 60px;
  --sidebar-width: 220px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
}

/* --------------------------------------------------------------------------
   通用工具
   -------------------------------------------------------------------------- */
.hidden {
  display: none !important;
}

.text-muted {
  color: var(--text-secondary);
}

/* 滚动条（贴近 Element 风格） */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: #c0c4cc;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8abb2;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* --------------------------------------------------------------------------
   布局：侧边栏 + 顶栏 + 内容区
   -------------------------------------------------------------------------- */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
}

.logo {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid var(--sidebar-hover);
  white-space: nowrap;
}

.logo svg {
  flex: 0 0 auto;
}

.nav-menu {
  padding: 6px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 20px;
  color: #d1d5db;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.nav-item svg {
  flex: 0 0 auto;
  opacity: 0.9;
}

.nav-item:hover {
  background-color: var(--sidebar-hover);
}

.nav-item.active {
  color: var(--brand);
  background-color: rgba(0, 0, 0, 0.18);
}

.layout-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.header {
  height: var(--header-height);
  flex: 0 0 var(--header-height);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 10;
}

.header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--text-regular);
}

.main {
  flex: 1;
  padding: 20px;
  min-width: 0;
}

/* --------------------------------------------------------------------------
   卡片 el-card
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header:empty {
  display: none;
}

.card-body {
  padding: 20px;
}

/* 卡片头部为空时不显示分隔线：用 body-only 修饰类 */
.card.no-header .card-body {
  padding: 20px;
}

/* --------------------------------------------------------------------------
   按钮 el-button
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 15px;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  color: var(--text-regular);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.btn:hover {
  color: var(--primary);
  border-color: #c6e2ff;
  background-color: #ecf5ff;
}

.btn:active {
  color: var(--primary-active);
  border-color: var(--primary-active);
}

.btn:disabled,
.btn.is-loading {
  cursor: not-allowed;
  opacity: 0.65;
}

.btn-primary {
  color: #fff;
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  color: #fff;
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-primary:active {
  color: #fff;
  background-color: var(--primary-active);
  border-color: var(--primary-active);
}

/* 品牌橙色按钮（登录、提交报工、扫码保存/上报） */
.btn-brand {
  color: #fff;
  background-color: var(--brand);
  border-color: var(--brand);
}

.btn-brand:hover,
.btn-brand:active {
  color: #fff;
  background-color: var(--brand-dark);
  border-color: var(--brand-dark);
}

.btn-danger {
  color: #fff;
  background-color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  color: #fff;
  background-color: var(--danger-hover);
  border-color: var(--danger-hover);
}

/* 文字按钮（表格操作）/ el-button link */
.btn-link {
  height: auto;
  padding: 0;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
}

.btn-link:hover {
  color: var(--primary-hover);
  background: none;
  border: none;
}

.btn-link.danger {
  color: var(--danger);
}

.btn-link.danger:hover {
  color: var(--danger-hover);
}

.btn-link + .btn-link {
  margin-left: 12px;
}

.btn-small {
  height: 24px;
  padding: 0 9px;
  font-size: 12px;
  border-radius: 3px;
}

.btn-large {
  height: 40px;
  padding: 0 19px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

/* loading 转圈 */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: 0 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   表单控件
   -------------------------------------------------------------------------- */
.form-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 18px;
}

.form-label {
  flex: 0 0 100px;
  width: 100px;
  padding-right: 12px;
  text-align: right;
  font-size: 14px;
  color: var(--text-regular);
  line-height: 32px;
  white-space: nowrap;
}

.form-label.top {
  text-align: left;
  width: auto;
  flex: none;
  line-height: 1.4;
  padding: 0 0 8px;
  display: block;
}

.form-control {
  flex: 1;
  min-width: 0;
}

.form-item.required .form-label::before {
  content: '*';
  color: var(--danger);
  margin-right: 4px;
}

/* inline 表单（筛选栏） */
.form-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.form-inline .form-item {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0;
  gap: 8px;
}

.form-inline .form-label {
  flex: none;
  width: auto;
  padding-right: 0;
  line-height: 32px;
}

.form-inline .form-control {
  flex: none;
}

/* 输入框 */
.input,
.select,
.textarea {
  width: 100%;
  height: 32px;
  padding: 0 11px;
  font-size: 14px;
  color: var(--text-regular);
  background-color: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-placeholder);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #c0c4cc;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
}

.input:disabled,
.select:disabled {
  background-color: #f5f7fa;
  border-color: var(--border-light);
  color: var(--text-placeholder);
  cursor: not-allowed;
}

.textarea {
  height: auto;
  min-height: 76px;
  padding: 8px 11px;
  line-height: 1.5;
  resize: vertical;
}

/* 原生 select 去掉默认箭头，加自定义箭头（模拟 el-select） */
.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5 6 8.5 10 4.5' fill='none' stroke='%23a8abb2' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 26px;
  cursor: pointer;
}

/* 数字输入 */
.input-number {
  text-align: left;
}

/* 日期 / 时间输入 */
.input-date,
.input-time {
  padding-right: 8px;
  cursor: pointer;
}

.input-date::-webkit-calendar-picker-indicator,
.input-time::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.55;
}

/* 分段按钮组（el-radio-group 的 button 样式） */
.segmented {
  display: inline-flex;
  vertical-align: middle;
  border-radius: var(--radius);
  overflow: hidden;
}

.segmented__item {
  height: 32px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-regular);
  background: #fff;
  border: 1px solid var(--border);
  border-left: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.segmented__item:first-child {
  border-left: 1px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius);
}

.segmented__item:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.segmented__item:hover {
  color: var(--primary);
}

.segmented__item.active {
  color: #fff;
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: -1px 0 0 0 var(--primary);
}

/* 开关 el-switch */
.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  vertical-align: middle;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch__slider {
  position: absolute;
  inset: 0;
  background-color: #dcdfe6;
  border-radius: 10px;
  transition: background-color 0.2s;
}

.switch__slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .switch__slider {
  background-color: var(--primary);
}

.switch input:checked + .switch__slider::after {
  transform: translateX(20px);
}

/* 复选框 */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
  cursor: pointer;
  flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   表格 el-table
   -------------------------------------------------------------------------- */
.table-wrap {
  position: relative;
  background: #fff;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  color: var(--text-regular);
}

.table th,
.table td {
  padding: 8px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.6;
}

.table th {
  background-color: #f5f7fa;
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-light);
}

.table.bordered th,
.table.bordered td {
  border-right: 1px solid var(--border-light);
}

.table.bordered th:last-child,
.table.bordered td:last-child {
  border-right: none;
}

.table tbody tr:hover > td {
  background-color: var(--bg-hover);
}

.table.striped tbody tr:nth-child(even) > td {
  background-color: #fafafa;
}

.table.striped tbody tr:nth-child(even):hover > td {
  background-color: var(--bg-hover);
}

.table td.nowrap {
  white-space: nowrap;
}

.table .cell-ellipsis {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table .col-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 0;
}

.table .col-actions {
  white-space: nowrap;
}

/* 表格 loading 遮罩 */
.loading-mask {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.loading-mask .spinner {
  width: 22px;
  height: 22px;
  border-width: 2px;
  color: var(--primary);
}

/* 标签 el-tag */
.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  font-size: 12px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  line-height: 1;
  white-space: nowrap;
}

.tag-success {
  color: #67c23a;
  background-color: #f0f9eb;
  border-color: #e1f3d8;
}

.tag-info {
  color: var(--info);
  background-color: #f4f4f5;
  border-color: #e9e9eb;
}

/* --------------------------------------------------------------------------
   分页
   -------------------------------------------------------------------------- */
.pagination {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 13px;
  color: var(--text-regular);
  flex-wrap: wrap;
}

.pagination__total {
  margin-right: 4px;
}

.pager-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-regular);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.pager-btn:hover:not(:disabled) {
  color: var(--primary);
  border-color: var(--primary);
}

.pager-btn:disabled {
  color: #c0c4cc;
  cursor: not-allowed;
}

.pager-btn.active {
  color: #fff;
  background-color: var(--primary);
  border-color: var(--primary);
}

.pager-ellipsis {
  padding: 0 2px;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   弹窗 el-dialog
   -------------------------------------------------------------------------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 15vh 16px 40px;
  z-index: 2000;
  overflow-y: auto;
  animation: fade-in 0.2s ease;
}

.modal-mask.mobile {
  padding: 8vh 12px 32px;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  width: 500px;
  max-width: 100%;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-dialog);
  animation: modal-in 0.2s ease;
}

@keyframes modal-in {
  from {
    transform: translateY(-12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px 20px 10px;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-close {
  border: none;
  background: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 4px;
}

.modal-close:hover {
  color: var(--primary);
}

.modal-body {
  padding: 10px 20px 20px;
  max-height: 65vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 10px 20px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   提示消息 el-message
   -------------------------------------------------------------------------- */
.message-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.message {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 300px;
  max-width: 90vw;
  padding: 11px 16px;
  font-size: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: #edf2fc;
  color: var(--text-regular);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  animation: msg-in 0.25s ease;
  pointer-events: auto;
}

.message.is-leaving {
  animation: msg-out 0.25s ease forwards;
}

@keyframes msg-in {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes msg-out {
  to {
    transform: translateY(-20px);
    opacity: 0;
  }
}

.message__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  font-weight: 700;
}

.message--success {
  background: #f0f9eb;
  border-color: #e1f3d8;
  color: #529b2e;
}

.message--success .message__icon {
  background: var(--success);
}

.message--error {
  background: #fef0f0;
  border-color: #fde2e2;
  color: #c45656;
}

.message--error .message__icon {
  background: var(--danger);
}

.message--warning {
  background: #fdf6ec;
  border-color: #faecd8;
  color: #b88230;
}

.message--warning .message__icon {
  background: var(--warning);
}

.message--info {
  background: #f4f4f5;
  border-color: #e9e9eb;
  color: var(--text-regular);
}

.message--info .message__icon {
  background: var(--info);
}

/* --------------------------------------------------------------------------
   空状态
   -------------------------------------------------------------------------- */
.empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 0;
  font-size: 14px;
}

/* 移动端列表空态（扫码页） */
.empty-tip {
  text-align: center;
  color: var(--text-secondary);
  padding: 48px 16px;
  font-size: 14px;
}

/* 列表页工具栏 */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   登录页
   -------------------------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
  padding: 20px;
}

.login-card {
  width: 420px;
  max-width: 100%;
  border-radius: 12px;
}

.login-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-main);
}

.login-btn {
  width: 100%;
  margin-top: 12px;
}

/* --------------------------------------------------------------------------
   数据看板
   -------------------------------------------------------------------------- */
.filter-card {
  margin-bottom: 16px;
}

.filter-card .card-body {
  padding: 18px 20px 6px;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.summary-label {
  color: #6b7280;
  font-size: 14px;
}

.summary-value {
  color: var(--brand);
  font-size: 28px;
  font-weight: 600;
  margin-top: 8px;
  line-height: 1.3;
  word-break: break-all;
}

.chart-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.chart {
  width: 100%;
  height: 320px;
  position: relative;
}

.chart svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-tip {
  position: absolute;
  pointer-events: none;
  background: rgba(50, 50, 50, 0.9);
  color: #fff;
  font-size: 12px;
  line-height: 1.6;
  padding: 7px 10px;
  border-radius: 4px;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  z-index: 6;
  transition: opacity 0.12s;
  opacity: 0;
}

.chart-tip.show {
  opacity: 1;
}

@media (max-width: 1100px) {
  .summary-row,
  .chart-row {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   报工录入
   -------------------------------------------------------------------------- */
.entry-page {
  max-width: 700px;
  margin: 0 auto;
}

.divider {
  height: 1px;
  background: var(--border-light);
  margin: 0 0 20px;
}

.preview {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.preview-item {
  flex: 1;
  background: var(--brand-light);
  padding: 16px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.preview-item span {
  color: #6b7280;
  font-size: 13px;
}

.preview-item b {
  color: var(--brand);
  font-size: 20px;
  word-break: break-all;
}

@media (max-width: 640px) {
  .preview {
    flex-direction: column;
    gap: 10px;
  }
}

/* --------------------------------------------------------------------------
   报工查询
   -------------------------------------------------------------------------- */
.data-table {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
}

/* 变更历史时间线 */
.timeline {
  padding-left: 4px;
}

.timeline-item {
  position: relative;
  padding: 0 0 22px 22px;
  border-left: 2px solid var(--border-light);
}

.timeline-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 50%;
}

.timeline-time {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 4px;
}

.timeline-content p {
  color: var(--text-regular);
  font-size: 14px;
}

.timeline-json {
  margin-top: 6px;
  background: var(--bg-page);
  padding: 8px;
  border-radius: var(--radius);
  font-size: 12px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  color: var(--text-regular);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow: auto;
}

/* --------------------------------------------------------------------------
   扫码报工页（移动端优先）
   -------------------------------------------------------------------------- */
.scan-page {
  min-height: 100vh;
  background: var(--bg-page);
  padding-bottom: 24px;
}

.scan-header {
  background: var(--sidebar-bg);
  color: #fff;
  padding: 24px 16px;
  text-align: center;
}

.scan-header h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
}

.scan-header p {
  color: #9ca3af;
  font-size: 14px;
}

.scan-tabs {
  background: #fff;
}

.tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  background: #f5f7fa;
}

.tab-item {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  font-size: 14px;
  color: var(--text-regular);
  cursor: pointer;
  border-right: 1px solid var(--border-light);
  transition: color 0.2s, background-color 0.2s;
}

.tab-item:last-child {
  border-right: none;
}

.tab-item.active {
  color: var(--brand);
  background: #fff;
  font-weight: 500;
  box-shadow: inset 0 -2px 0 var(--brand);
}

.tabs-content {
  padding: 12px;
}

.scan-form {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.form-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--bg-page);
}

.form-cell:last-child {
  border-bottom: none;
}

.form-cell .label {
  color: #6b7280;
  font-size: 15px;
  flex: 0 0 auto;
}

.form-cell .value {
  color: var(--text-main);
  font-size: 15px;
  font-weight: 500;
  text-align: right;
}

.form-cell .value.placeholder {
  color: var(--text-placeholder);
  font-weight: 400;
}

.picker-cell {
  cursor: pointer;
}

.submit-btn {
  width: calc(100% - 24px);
  margin: 20px 12px 0;
  height: 48px;
  font-size: 17px;
}

.employee-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.employee-item {
  padding: 16px;
  background: #f9fafb;
  border-radius: var(--radius-lg);
  text-align: center;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.employee-item:hover {
  background: #f0f2f5;
}

.employee-item .emp-no {
  color: var(--text-secondary);
  font-size: 14px;
}

.draft-list,
.submitted-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.draft-card,
.submitted-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
}

.draft-header,
.submitted-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 500;
}

.draft-title,
.submitted-title {
  font-weight: 500;
}

.draft-shift,
.submitted-shift {
  color: #6b7280;
  font-size: 13px;
}

.draft-body,
.submitted-body {
  color: #4b5563;
  font-size: 14px;
  line-height: 1.8;
}

.draft-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.draft-footer {
  padding-bottom: 12px;
}

.draft-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   小屏适配：侧边栏折叠为顶部横向菜单
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex: none;
  }

  .logo {
    height: 54px;
    font-size: 16px;
  }

  .nav-menu {
    display: flex;
    overflow-x: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
  }

  .nav-item {
    height: 46px;
    padding: 0 14px;
    white-space: nowrap;
    font-size: 13px;
  }

  .nav-item svg {
    display: none;
  }

  .header {
    padding: 0 14px;
  }

  .header h2 {
    font-size: 16px;
  }

  .user-actions {
    gap: 10px;
    font-size: 13px;
  }

  .main {
    padding: 12px;
  }

  .modal-mask {
    padding: 6vh 10px 24px;
  }

  .form-item {
    flex-direction: column;
    align-items: stretch;
  }

  .form-label {
    flex: none;
    width: auto;
    text-align: left;
    padding: 0 0 6px;
    line-height: 1.4;
  }

  .form-inline .form-item {
    width: 100%;
    flex-wrap: wrap;
  }

  .form-inline .form-label {
    min-width: 56px;
  }

  .summary-value {
    font-size: 24px;
  }
}

/* ==========================================================================
   材料管理（新增模块）
   ========================================================================== */

.material-page {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
}

.material-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.material-toolbar .input,
.material-toolbar .select {
  width: 150px;
  max-width: 100%;
}

.material-toolbar .input.input-date {
  width: 150px;
}

/* 废料在库统计卡片 */
.material-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.summary-card {
  flex: 1 1 150px;
  min-width: 130px;
  background: #fafbfc;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 12px 14px;
}

.summary-card__label {
  font-size: 13px;
  color: var(--text-secondary);
}

.summary-card__value {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.summary-card--brand .summary-card__value {
  color: var(--brand-dark);
}

/* 区块小标题 */
.section-title {
  margin: 18px 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.section-title:first-child {
  margin-top: 0;
}

/* 说明块 */
.material-tip {
  margin-top: 12px;
  padding: 12px 14px;
  background: #f8f9fb;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-regular);
  font-size: 13px;
  line-height: 1.9;
}

@media (max-width: 768px) {
  .material-toolbar .input,
  .material-toolbar .select,
  .material-toolbar .input.input-date {
    width: 100%;
  }

  .summary-card {
    flex: 1 1 45%;
  }
}

/* 统计卡片副标题（条数与统计区间） */
.summary-card__sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* 位于列表工具栏上方的统计行，与下方工具栏留出间距 */
.material-summary--lead {
  margin-bottom: 14px;
}
