:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --line: #e3e6eb;
  --line-strong: #d3d8e0;
  --text: #1c2430;
  --muted: #6b7686;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eef3ff;
  --danger: #c0392b;
  --danger-soft: #fdf1f0;
  --ok: #0f7b52;
  --ok-soft: #eaf6f0;
  --warn: #a16207;
  --warn-soft: #fdf6e3;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Source Han Sans SC', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.muted {
  color: var(--muted);
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}
.strong {
  font-weight: 600;
}
.nowrap {
  white-space: nowrap;
}
.right {
  text-align: right;
}
.pre {
  white-space: pre-wrap;
}
.inline {
  display: inline;
}
.req {
  color: var(--danger);
  font-style: normal;
  margin-left: 2px;
}

/* ------------------------------- 布局骨架 ------------------------------- */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 210px;
  flex: 0 0 210px;
  background: #1c2430;
  color: #cbd3de;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 18px 18px 14px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav {
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-item {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  color: #c2cbd8;
  font-size: 13.5px;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
}
.nav-item.active {
  background: var(--accent);
  color: #fff;
  font-weight: 500;
}

.sidebar-foot {
  padding: 12px 18px;
  font-size: 11.5px;
  color: #6d7a8c;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h1 {
  font-size: 17px;
}
.topbar-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.userbox-name {
  font-weight: 600;
}
.userbox-role {
  color: var(--muted);
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 9px;
}

.content {
  padding: 20px 24px 48px;
  max-width: 1280px;
  width: 100%;
}

/* --------------------------------- 卡片 --------------------------------- */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-head h2 {
  font-size: 14.5px;
}
.card-head .muted {
  font-size: 12.5px;
}

.card-danger {
  border-color: #f0d3d0;
  background: #fffbfb;
}
.card-note {
  background: #fbfcfe;
}
.card-placeholder {
  border-style: dashed;
  background: transparent;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: inherit;
}
.stat:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.stat-value {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}
.stat-label {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.page-title {
  font-size: 19px;
  margin-bottom: 2px;
}
.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* --------------------------------- 表格 --------------------------------- */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
  background: #fbfcfd;
}
.table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tbody tr:hover {
  background: #fafbfe;
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.row-dim {
  opacity: 0.55;
}

.tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  color: var(--accent);
  border: 1px solid #cddcff;
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 0 5px;
  vertical-align: middle;
}

.badge {
  display: inline-block;
  font-size: 11.5px;
  border-radius: 20px;
  padding: 1px 8px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: var(--bg);
  white-space: nowrap;
}
.badge-ok {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: #bfe3d3;
}
.badge-off {
  color: var(--muted);
  background: #f1f3f6;
  border-color: var(--line-strong);
}

.empty {
  padding: 26px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: #fbfcfd;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  font-size: 13px;
}
.pager-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kv {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px 12px;
  font-size: 13.5px;
}
.kv dt {
  color: var(--muted);
  font-size: 12.5px;
}
.kv dd {
  margin: 0;
}

/* --------------------------------- 表单 --------------------------------- */

.field {
  display: block;
  margin-bottom: 12px;
}
.field-label {
  display: block;
  font-size: 12.5px;
  color: #48505c;
  margin-bottom: 4px;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
textarea {
  resize: vertical;
  line-height: 1.55;
}

.field-help {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.form-narrow {
  max-width: 720px;
}
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}
.stack-form {
  display: block;
}
.form-inline-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.form-inline-row .field {
  margin-bottom: 0;
  min-width: 160px;
  flex: 1;
}

.search-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  max-width: 520px;
}
.search-form input {
  max-width: 340px;
}

.check-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 6px 0;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}
.check input {
  width: auto;
  margin: 0;
}

/* --------------------------------- 按钮 --------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover {
  background: #f7f8fa;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #a53224;
  border-color: #a53224;
}
.btn-sm {
  padding: 3px 10px;
  font-size: 12.5px;
}

/* ------------------------------- 内联行列表 ------------------------------ */

.row-list {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.row-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
}
.row-item:last-child {
  border-bottom: none;
}
.row-new {
  border-bottom: none;
  background: #fafbfd;
  margin-top: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
}
.contact-form {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 1fr 1fr auto auto;
  gap: 8px;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.contact-form input {
  padding: 5px 8px;
  font-size: 13px;
}
.row-new .contact-form {
  grid-template-columns: 1.1fr 1.2fr 1fr 1fr auto auto;
}

/* --------------------------------- 提示 --------------------------------- */

.flash {
  border-radius: 6px;
  padding: 9px 14px;
  margin-bottom: 14px;
  font-size: 13.5px;
  border: 1px solid transparent;
}
.flash-ok {
  background: var(--ok-soft);
  border-color: #bfe3d3;
  color: var(--ok);
}
.flash-error {
  background: var(--danger-soft);
  border-color: #f0d3d0;
  color: var(--danger);
}
.flash-warn {
  background: var(--warn-soft);
  border-color: #f0e0b8;
  color: var(--warn);
}

.progress-list {
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.progress-list .done {
  color: var(--ok);
}
.progress-list .todo {
  color: var(--muted);
}

/* --------------------------------- 登录 --------------------------------- */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(160deg, #eef2f8 0%, #e4e9f2 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px 26px 22px;
  box-shadow: 0 8px 30px rgba(28, 36, 48, 0.08);
}
.login-brand {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
  letter-spacing: 0.5px;
}
.login-foot {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.stack {
  font-size: 11.5px;
  color: var(--muted);
  background: var(--bg);
  border-radius: 6px;
  padding: 10px;
  overflow: auto;
  max-height: 220px;
  white-space: pre-wrap;
}

.contact-readonly {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13.5px;
  padding: 2px 0;
}

/* ------------------------------ 首页待办 ------------------------------ */

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.todo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  border-radius: 6px;
  color: inherit;
  font-size: 13.5px;
}
.todo-row:hover {
  background: #f7f8fa;
  text-decoration: none;
}
.todo-count {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 600;
  min-width: 24px;
  text-align: right;
}
.todo-count.hot {
  color: var(--warn);
}
.card-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}
.stat-hot {
  border-color: #cddcff;
  background: linear-gradient(180deg, #f7faff, #fff);
}

/* ------------------------------ 收件与工单 ------------------------------ */

.badge-info {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #cddcff;
}
.badge-warn {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: #f0e0b8;
}
.badge-danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f0d3d0;
}
.badge-lg {
  font-size: 13px;
  padding: 3px 12px;
}

.form-narrow-wide {
  max-width: 980px;
}
.form-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.inline-select {
  width: auto;
  min-width: 120px;
}

.equip-head,
.equip-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.2fr 1.6fr;
  gap: 8px;
}
.equip-head {
  font-size: 12px;
  color: var(--muted);
  padding: 0 2px 6px;
}
.equip-row {
  margin-bottom: 8px;
}
.equip-row input {
  padding: 6px 8px;
  font-size: 13px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.photo-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #f7f8fa;
}
.photo-item img {
  display: block;
  width: 100%;
  height: 90px;
  object-fit: cover;
}
.photo-del {
  position: absolute;
  top: 4px;
  right: 4px;
}
.photo-del button {
  width: 22px;
  height: 22px;
  line-height: 1;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}
.upload-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.upload-form input[type='file'] {
  font-size: 12.5px;
  padding: 4px;
  border: 1px dashed var(--line-strong);
  background: #fbfcfd;
}

/* 拖拽上传区 */
.upload-form.drop-zone {
  border: 1.5px dashed var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfd;
  transition: border-color 0.15s, background 0.15s;
}
.upload-form.drop-zone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.upload-form.drop-zone::before {
  content: '把照片拖到这里也能上传';
  font-size: 12px;
  color: var(--muted);
}
@media (hover: none) {
  /* 手机没有拖拽，别显示这句 */
  .upload-form.drop-zone::before {
    display: none;
  }
}

/* -------------------------------- 扫码录入 ------------------------------- */

.input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.input-row input {
  flex: 1;
  min-width: 0;
}

.scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 14, 20, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.scan-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
.scan-video {
  width: 100%;
  max-height: 70vh;
  display: block;
  object-fit: cover;
}
.scan-frame {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 32%;
  height: 32%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}
.scan-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 58px;
  text-align: center;
  color: #fff;
  font-size: 13px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.scan-box > .btn {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
}

/* ------------------------------ 配件搜索选择 ------------------------------ */

.ac-field {
  flex: 2;
  min-width: 220px;
}
.ac {
  position: relative;
}
.ac-list {
  position: absolute;
  z-index: 60;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.14);
  max-height: 280px;
  overflow: auto;
}
.ac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.ac-item:last-child {
  border-bottom: none;
}
.ac-item.active,
.ac-item:hover {
  background: var(--accent-soft);
}
.ac-code {
  color: var(--muted);
  flex: 0 0 auto;
  min-width: 96px;
}
.ac-name {
  font-weight: 600;
  flex: 0 0 auto;
}
.ac-spec {
  flex: 1 1 auto;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ac-stock {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  flex: 0 0 auto;
}
.ac-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  .ac-field {
    min-width: 0;
  }
  .ac-item {
    flex-wrap: wrap;
    gap: 6px;
  }
  .ac-spec {
    flex: 1 1 100%;
  }
}
.photo-actions {
  margin-top: 8px;
}

.upload-status {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.upload-status.working {
  color: var(--accent);
}
.upload-status.done {
  color: var(--ok);
}

/* ------------------------------ 检测与报价 ------------------------------ */

.inspect-item {
  display: block;
}
.inspect-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
  font-size: 12.5px;
}
.inspect-body {
  font-size: 13px;
  display: grid;
  gap: 2px;
}
.inspect-form-wrap {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.inspect-form-wrap summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 10px;
}

.quote-table input,
.quote-table select {
  padding: 4px 6px;
  font-size: 12.5px;
}
.quote-table td {
  padding: 5px 6px;
}

.review-box {
  margin-top: 12px;
  padding: 12px 14px;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.review-title {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 8px;
}

/* -------------------------------- 寄回发货 ------------------------------- */

.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 13.5px;
}
.check-row input[type='checkbox'] {
  width: auto;
  margin: 0;
}

/* ------------------------------ 配件领用与照片 ----------------------------- */

.part-row {
  display: block;
}
.part-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13.5px;
  margin-bottom: 6px;
}
.photo-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  max-width: 520px;
  margin-bottom: 8px;
}
.photo-grid-sm .photo-item img {
  height: 68px;
}

.damage-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.damage-head {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

/* -------------------------------- 账款与保修 ------------------------------- */

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.tab {
  padding: 8px 16px;
  font-size: 13.5px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover {
  color: var(--text);
  text-decoration: none;
}
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 500;
}

.plain-list {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.9;
}

/* 提交中：整表单锁住，防重复点击 */
form.is-submitting {
  opacity: 0.6;
  pointer-events: none;
}
form.is-submitting button {
  cursor: progress;
}

/* 折叠式编辑区（设备信息补充、删除工单） */
.edit-zone {
  margin-top: 10px;
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
.edit-zone summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--accent);
  user-select: none;
}
.edit-zone summary:hover {
  text-decoration: underline;
}
.edit-zone form {
  margin-top: 10px;
}
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 10px;
  cursor: pointer;
}
.check-line input {
  width: auto;
  margin: 0;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}
.timeline li {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.timeline li:last-child {
  border-bottom: none;
}
.timeline .time {
  color: var(--muted);
  font-size: 12px;
  min-width: 118px;
}
.timeline .who {
  min-width: 60px;
  font-weight: 500;
}
.timeline .what {
  flex: 1;
}

/* --------------------------------- 响应式 -------------------------------- */

@media (max-width: 900px) {
  .shell {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    flex: none;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }
  .brand {
    border-bottom: none;
    padding: 12px 14px;
    white-space: nowrap;
  }
  .nav {
    flex-direction: row;
    padding: 6px;
    gap: 4px;
  }
  .nav-item {
    white-space: nowrap;
  }
  .sidebar-foot {
    display: none;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 14px 14px 40px;
  }
  .topbar {
    padding: 10px 14px;
    flex-wrap: wrap;
  }
  .contact-form {
    grid-template-columns: 1fr 1fr;
  }
}

/* ------------------------------ 平板 / 手机 ------------------------------ */

@media (max-width: 900px) {
  body {
    -webkit-text-size-adjust: 100%; /* 横竖屏切换时不让字号乱跳 */
  }
  /* 宽表格不再撑破页面，改成可以左右滑 */
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-scroll .table {
    min-width: 600px;
  }
  .card {
    padding: 12px;
  }
  .card-head {
    flex-wrap: wrap;
    gap: 8px;
  }
  .page-title {
    font-size: 17px;
  }
  .search-form {
    max-width: none;
    flex: 1 1 100%;
  }
  .search-form input {
    max-width: none;
  }
  .stats {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 8px;
  }
  .stat {
    padding: 10px 12px;
  }
  .stat-value {
    font-size: 19px;
  }
}

@media (max-width: 640px) {
  /* iOS 上输入框小于 16px 会在聚焦时强制放大页面 */
  input,
  select,
  textarea {
    font-size: 16px;
  }

  /* 按钮加大，手指点得准 */
  .btn {
    min-height: 40px;
    padding: 9px 14px;
  }
  .btn-sm {
    min-height: 34px;
    padding: 6px 11px;
  }

  .content {
    padding: 12px 12px 48px;
  }
  .topbar {
    padding: 8px 12px;
  }
  .topbar h1 {
    font-size: 15px;
  }
  .userbox {
    width: 100%;
    justify-content: space-between;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
  }
  .page-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .form-2col {
    grid-template-columns: 1fr;
  }
  .form-inline-row {
    flex-direction: column;
    align-items: stretch;
  }
  .form-inline-row .field {
    min-width: 0;
  }
  .form-inline-row .btn {
    width: 100%;
  }

  .kv {
    grid-template-columns: 76px 1fr;
  }

  /* 收件登记：每台设备变成一个卡片，不再挤四列 */
  .equip-head {
    display: none;
  }
  .equip-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
  }

  .contact-form {
    grid-template-columns: 1fr 1fr;
  }
  .contact-form .btn {
    grid-column: span 2;
  }

  .quote-table input,
  .quote-table select {
    font-size: 16px;
  }
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  }

  .timeline li {
    flex-direction: column;
    gap: 2px;
  }
  .timeline .time {
    min-width: 0;
  }

  .nav-item {
    padding: 10px 12px;
    font-size: 14px;
  }
  .brand {
    padding: 12px;
    font-size: 14px;
  }
}

/* ------------------------------- 页脚备案 ------------------------------- */
.site-foot {
  padding: 10px 24px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.site-foot a {
  color: var(--muted);
  text-decoration: none;
}
.site-foot a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.login-card .site-foot {
  padding: 14px 0 0;
}