* { box-sizing: border-box; }
body { margin: 0; background: #f4f5f7; color: #222; font: 14px/1.6 "Microsoft YaHei", "Segoe UI", sans-serif; }
a { color: #0a6ebd; text-decoration: none; }
code { background: #f2f4f6; padding: 1px 5px; border-radius: 3px; }
.top { display: flex; justify-content: space-between; align-items: center; background: #1f2d3d; color: #fff; padding: 10px 18px; }
.brand { font-size: 16px; font-weight: 700; }
.tag { background: #0a6ebd; border-radius: 3px; padding: 1px 6px; font-size: 12px; font-weight: 400; margin-left: 6px; }
.nav a { color: #cfd8e3; margin-left: 14px; }
.nav a:hover { color: #fff; }
main { padding: 16px; }
.wrap { max-width: 1180px; margin: 0 auto; }
.bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.bar h2 { margin: 0; font-size: 18px; }
.bar-btns { display: flex; gap: 8px; }
.muted { color: #8a94a0; font-size: 13px; font-weight: 400; margin-left: 6px; }
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 16px; }
.empty { color: #888; padding: 10px 2px; }
.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { border-bottom: 1px solid #eef0f3; padding: 8px 6px; text-align: left; font-size: 13px; }
.grid th { background: #fafbfc; color: #55606e; font-weight: 600; }
.grid tr:hover td { background: #f7fbff; }
.strong { font-weight: 700; }
.ops a { margin-right: 8px; }
.thumb img { max-height: 54px; border-radius: 4px; border: 1px solid #e3e7ec; }
.warn { color: #c60; font-weight: 600; }
.btn { display: inline-block; border: 1px solid #cbd3db; background: #fff; color: #333; border-radius: 6px; padding: 8px 14px; cursor: pointer; font-size: 14px; }
.btn:hover { border-color: #0a6ebd; color: #0a6ebd; }
.btn.primary { background: #0a6ebd; border-color: #0a6ebd; color: #fff; font-weight: 600; }
.btn.primary:hover { background: #085a9a; color: #fff; }
.filter { margin-bottom: 12px; padding: 12px 16px; }
.frow { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.frow .fld { flex: 0 0 150px; }
.fbtns { display: flex; gap: 8px; padding-bottom: 2px; }
.sec { margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid #eef0f3; color: #1f2d3d; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 16px; }
.fld { display: flex; flex-direction: column; }
.fld label { color: #55606e; font-size: 13px; margin-bottom: 3px; }
.fld input, .fld select { border: 1px solid #cbd3db; border-radius: 6px; padding: 8px 10px; font-size: 14px; font-family: inherit; background: #fff; }
.fld input:focus, .fld select:focus { outline: none; border-color: #0a6ebd; }
.hint { color: #8a94a0; font-size: 12px; margin-top: 3px; }
.cropper { margin-top: 12px; }
.canvas-wrap { position: relative; display: inline-block; max-width: 100%; background: #111; border-radius: 6px; overflow: hidden; touch-action: none; }
.canvas-wrap canvas { display: block; max-width: 100%; }
.cropbox { position: absolute; border: 2px solid #ffd400; box-shadow: 0 0 0 9999px rgba(0,0,0,.35); cursor: move; touch-action: none; }
.crop-tip { position: absolute; left: 2px; top: -22px; background: #ffd400; color: #333; font-size: 12px; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.handle { position: absolute; right: -8px; bottom: -8px; width: 16px; height: 16px; background: #ffd400; border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; }
.crop-ops { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status { color: #55606e; }
.cands { margin-top: 8px; min-height: 30px; }
.chip { display: inline-block; background: #eaf4ff; border: 1px solid #b9dcff; color: #0a6ebd; border-radius: 14px; padding: 3px 12px; margin: 4px 6px 0 0; cursor: pointer; font-size: 14px; }
.chip:hover { background: #d3e9ff; }
.photo img { max-width: 420px; border-radius: 6px; border: 1px solid #e3e7ec; }
.login-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 8vh; }
.login-foot { padding-top: 18px; }
.login { width: 360px; }
.login h2 { margin: 0 0 14px; }
.login .fld { margin-bottom: 12px; }
.login .btn { width: 100%; margin-top: 6px; }
.err { color: #c00; font-size: 13px; margin-bottom: 8px; }
.remember { display: flex; align-items: center; gap: 6px; margin: 2px 0 12px; font-size: 13px; color: #55606e; cursor: pointer; }
.remember input { width: 16px; height: 16px; margin: 0; }
.printbar { max-width: 900px; margin: 0 auto 10px; display: flex; gap: 10px; }
.copy { background: #fff; max-width: 900px; margin: 0 auto 14px; padding: 12px 16px; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.cp-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid #222; padding-bottom: 6px; }
.cp-left { font-size: 13px; }
.cp-mid { font-size: 20px; font-weight: 700; letter-spacing: 4px; }
.cp-right { font-size: 12px; text-align: right; }
.cp-form { color: #888; }
.cp-line { font-size: 13px; margin: 6px 0; color: #444; }
.cp-table { width: 100%; border-collapse: collapse; }
.cp-table th, .cp-table td { border: 1px solid #333; padding: 6px 8px; font-size: 13px; min-height: 24px; }
.cp-table th { background: #f2f4f6; width: 110px; text-align: left; font-weight: 600; }
.cp-table td.mile { font-size: 17px; font-weight: 700; letter-spacing: 2px; }
.cp-sign { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: #444; }

/* 货物明细（多行） */
.items { width: 100%; border-collapse: collapse; }
.actbox { margin-top: 14px; padding: 12px 14px; background: #f8fafc; border: 1px solid #e3e9f0; border-radius: 8px; }
.actbox .btn { margin-top: 8px; }
.actbox .hint { display: block; margin-top: 6px; }
.statusline { background: #f8fafc; border: 1px solid #e3e9f0; border-radius: 8px; padding: 8px 12px; font-size: 13px; color: #3a4552; }
.sumbar { margin-bottom: 12px; font-size: 13px; color: #3a4552; }
.sumbar b { font-size: 15px; color: #1f2d3d; }
.ok { color: #0a7a34; font-weight: 700; }
.okmsg { background: #eafaf0; border: 1px solid #b7e4c7; color: #0a7a34; border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }
.errmsg { background: #fdeeee; border: 1px solid #f3b9b9; color: #c00; border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }
.foot { text-align: center; color: #7a8794; font-size: 12px; padding: 16px 12px 22px; line-height: 1.9; }
.foot a.beian { color: #7a8794; text-decoration: none; }
.foot a.beian:hover { color: #3d6ea8; text-decoration: underline; }
.quick { margin-top: 8px; font-size: 13px; color: #55606e; }
.quick a { margin-right: 4px; }
.inlineform { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inlineform input, .inlineform select { border: 1px solid #cbd3db; border-radius: 6px; padding: 5px 8px; font-size: 13px; font-family: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chipform { display: inline-flex; align-items: center; gap: 4px; background: #eef4fb; border: 1px solid #cfe0f2; border-radius: 14px; padding: 3px 10px 3px 6px; font-size: 13px; }
.chipform .btn.tiny { padding: 1px 7px; font-size: 13px; line-height: 1.2; }
.dictgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.dicttitle { font-weight: 700; color: #1f2d3d; margin-bottom: 6px; }
/* 我的放行单：今日/昨日/全部 三档 */
.tabs { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.tab { display: inline-block; padding: 7px 16px; border: 1px solid #cbd3db; border-radius: 20px; background: #fff; color: #3a4552; font-size: 14px; }
.tab b { margin-left: 4px; }
.tab.on { background: #0a6ebd; border-color: #0a6ebd; color: #fff; font-weight: 700; }
.tab.on b { color: #fff; }
.grid tr.cur td { background: #fff8dc; }
.grid tr.cur td:first-child { font-weight: 700; }
/* 操作成功的提示条：2 秒自动消失、不用点、不挡鼠标 */
.toast-wrap { position: fixed; left: 0; right: 0; top: 16px; display: flex; justify-content: center; z-index: 999; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: #eafaf0; border: 1px solid #9fd8b6; color: #0a7a34; border-radius: 10px; padding: 10px 20px; box-shadow: 0 6px 22px rgba(0,0,0,.14); max-width: 92%; font-size: 15px; animation: toastIn .18s ease-out; }
.toast-icon { font-size: 22px; line-height: 1; }
.toast-text { display: flex; flex-direction: column; line-height: 1.35; }
.toast-sub { font-size: 12.5px; color: #3f6b52; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
a.bell { color: #ffd400; font-weight: 700; }
a.bell:hover { color: #fff; }
.items th, .items td { border-bottom: 1px solid #eef0f3; padding: 6px 4px; text-align: left; font-size: 13px; vertical-align: top; }
.items th { background: #fafbfc; color: #55606e; font-weight: 600; }
.items input { width: 100%; border: 1px solid #cbd3db; border-radius: 6px; padding: 7px 9px; font-size: 14px; font-family: inherit; background: #fff; }
.items input:focus { outline: none; border-color: #0a6ebd; }
.items input[type=file] { width: auto; border: 0; padding: 0; font-size: 12px; }
.iphoto-file { font-size: 12px; }
.iphotostate { display: block; margin-top: 4px; color: #8a94a0; font-size: 12px; }
.iphotostate img.iphoto { display: block; max-height: 64px; margin-top: 4px; border-radius: 4px; border: 1px solid #e3e7ec; }
.btn.tiny { padding: 4px 9px; font-size: 12px; }
.item-ops { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.cp-sub { width: 100%; border-collapse: collapse; }
.cp-sub th, .cp-sub td { border: 1px solid #666; padding: 4px 6px; font-size: 13px; }
.cp-sub th { background: #f7f8fa; width: 30%; font-weight: 600; }
.cp-sub td.cp-qty { width: 64px; text-align: center; }
.iphoto-gallery { display: flex; flex-wrap: wrap; gap: 12px; }
.iphoto-item { margin: 0; text-align: center; font-size: 12px; color: #55606e; }
.iphoto-item img { max-height: 170px; border-radius: 6px; border: 1px solid #e3e7ec; }
@media print {
  body { background: #fff; }
  .top, .printbar, .nav, .noprint { display: none !important; }
  main { padding: 0; }
  .copy { box-shadow: none; margin: 0 0 8mm; page-break-inside: avoid; }
}

/* ================= 手机/窄屏适配 ================= */
@media (max-width: 760px) {
  main { padding: 10px; }
  .card { padding: 12px; overflow-x: auto; }
  .bar { flex-wrap: wrap; gap: 8px; }
  .bar h2 { font-size: 17px; }
  .bar-btns { display: flex; flex-wrap: wrap; gap: 6px; }
  .inpt, .fld input, .fld select, .items input, .inlineform input, .inlineform select { font-size: 16px; } /* 16px：iPhone 填表时不会自动放大 */
  .frow .fld { flex: 1 1 46%; }
  .fbtns { width: 100%; }
  .tabs { gap: 6px; }
  .tab { padding: 6px 12px; font-size: 13px; }
  .quick { line-height: 2; }

  /* 列表这类宽表格：横向滚动，别挤成一团 */
  .grid { min-width: 660px; }

  /* ★ 货物明细：表格 → 一行一张卡片（字段名在上、输入框在下） */
  .items { min-width: 0; }
  .items thead { display: none; }
  .items, .items tbody, .items tr, .items td { display: block; width: 100%; }
  .items tr { border: 1px solid #e3e9f0; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; background: #fff; }
  .items tr.cur { background: #fff8dc; }
  .items td { border: 0; padding: 5px 0; text-align: left; }
  .items td::before { content: attr(data-label); display: block; font-size: 12.5px; color: #6b7683; font-weight: 600; margin-bottom: 3px; }
  .items td[data-label=""]::before { display: none; }
  .items td:last-child { text-align: right; padding-top: 8px; }
  .items td button.idel { width: 100%; padding: 8px 0; }
  .item-ops { flex-direction: column; align-items: stretch; gap: 8px; }
  .item-ops .btn { width: 100%; }
  .iphoto-file { font-size: 13px; }
  .iphotostate img.iphoto { max-height: 120px; }

  /* 放行单内容（只读详情）：标签窄一点，别把值挤没了 */
  .cp-table th { width: 92px; font-size: 12.5px; padding: 5px 6px; }
  .cp-table td { font-size: 13px; padding: 5px 6px; }
  .cp-sub th, .cp-sub td { font-size: 12.5px; padding: 3px 4px; }
  .fold { grid-template-columns: 1fr; }
  .bntl { flex-wrap: wrap; gap: 8px; }
  .btn { padding: 9px 14px; }
}