/* 猴哥酒水供货报单系统 - 全站样式 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { background: #F6F3F1; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; color: #333; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.container { max-width: 640px; margin: 0 auto; padding: 0 14px 30px; }

/* ===== 供货人端 ===== */
.topbar { background: linear-gradient(135deg, #B01F24, #D4483B); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 8px rgba(176,31,36,.25); }
.topbar .in { max-width: 640px; margin: 0 auto; padding: 12px 10px; display: flex; align-items: center; justify-content: space-between; }
.topbar .logo { font-size: 15px; font-weight: 700; letter-spacing: 0.5px; white-space: nowrap; }
.topbar nav a { color: #fff; font-size: 12.5px; margin-left: 8px; opacity: .95; position: relative; white-space: nowrap; }
.topbar nav a .dot { position: absolute; top: -6px; right: -10px; background: #FFD34E; color: #B01F24; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 0 5px; line-height: 16px; }

.page-title { margin: 18px 0 6px; font-size: 20px; font-weight: 700; color: #B01F24; }
.page-sub { font-size: 13px; color: #999; margin-bottom: 14px; }

.card { background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.card h3 { font-size: 15px; color: #B01F24; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #F3E1E1; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field label .req { color: #C0392B; margin-left: 2px; }
.field input[type=text], .field input[type=password], .field input[type=tel], .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #DCD0CE; border-radius: 8px; font-size: 15px; background: #FDFCFC; outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #D4483B; background: #fff; }
.field textarea { min-height: 84px; resize: vertical; }
.field input[readonly] { background: #F2ECEC; color: #666; }
.field .hint { font-size: 12px; color: #A1877F; margin-top: 5px; line-height: 1.6; }
.field .hint b { color: #B0661F; font-weight: 600; }
.file-btn { display: block; border: 1px dashed #D4A0A0; border-radius: 10px; padding: 18px 12px; text-align: center; color: #B0661F; font-size: 14px; background: #FFFAF7; cursor: pointer; }
.file-btn:has(input:checked) { border-color: #B01F24; }
.file-btn input { display: none; }
.file-name { font-size: 12px; color: #27AE60; margin-top: 5px; display: none; }

.btn-main { display: block; width: 100%; background: linear-gradient(135deg, #B01F24, #D4483B); color: #fff; border: none;
  border-radius: 10px; padding: 14px; font-size: 17px; font-weight: 700; letter-spacing: 2px; cursor: pointer; margin-top: 6px; }
.btn-main:active { opacity: .88; }
.btn-light { display: inline-block; background: #fff; color: #B01F24; border: 1px solid #D9B3B3; border-radius: 8px; padding: 10px 18px; font-size: 14px; cursor: pointer; }

/* 登录/注册 */
.auth-switch { display:flex; align-items:center; justify-content:center; gap:8px; margin-top:14px; font-size:13px; color:#A1877F; }
.auth-switch button { border:1px solid #B01F24; background:#fff; color:#B01F24; border-radius:8px; padding:8px 18px; font-size:13px; font-weight:600; cursor:pointer; }
.auth-switch button:active { background:#FDECEC; }
.auth-tabs { display: flex; margin: 18px 0 0; }
.auth-tabs span { flex: 1; text-align: center; padding: 12px; font-size: 15px; font-weight: 600; color: #999; background: #EFE7E5; border-radius: 10px 10px 0 0; cursor: pointer; }
.auth-tabs span.on { background: #fff; color: #B01F24; }
.err { background: #FDECEC; color: #C0392B; font-size: 13px; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; }

/* 单据列表 */
.order-card { background: #fff; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.06); display: block; }
.order-card .row1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.order-card .did { font-size: 14px; font-weight: 700; color: #B01F24; }
.order-card .title { font-size: 13px; color: #555; line-height: 1.6; word-break: break-all; }
.order-card .time { font-size: 12px; color: #B0A6A4; margin-top: 8px; }
.empty { text-align: center; color: #B0A6A4; font-size: 14px; padding: 40px 0; }

/* 状态徽章 */
.badge { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 12px; padding: 2px 10px; line-height: 20px; }
.b-orange { background: #FDF0E0; color: #C97B1C; }
.b-blue { background: #E3F0FB; color: #2471A3; }
.b-teal { background: #E1F5F0; color: #148F77; }
.b-cyan { background: #E0F4F7; color: #0E7490; }
.b-purple { background: #F1E8F8; color: #7D3C98; }
.b-green { background: #E3F6E5; color: #1E8449; }
.b-gray { background: #EAE6E4; color: #857E7C; }

/* 详情页 */
.kv { display: flex; padding: 10px 0; border-bottom: 1px dashed #EFE3E1; font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .k { width: 88px; color: #999; flex-shrink: 0; }
.kv .v { flex: 1; color: #333; word-break: break-all; white-space: pre-wrap; }
.img-box { border-radius: 10px; overflow: hidden; border: 1px solid #EFE3E1; background: #FAF6F5; }
.img-box img { width: 100%; display: block; }
.img-tip { font-size: 13px; color: #C97B1C; background: #FDF6E8; border-radius: 8px; padding: 10px 12px; margin-top: 8px; line-height: 1.7; }
.img-none { text-align: center; color: #A1877F; font-size: 13px; background: #F8F2F0; border-radius: 10px; padding: 26px 12px; line-height: 1.8; }
.block-tip { font-size: 12px; color: #B0A6A4; margin-top: 6px; text-align: center; }

/* 联系猴哥 */
.contact-card { background: #fff; border-radius: 12px; padding: 18px 16px; margin-top: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.06); text-align: center; }
.contact-card .ct { font-size: 16px; font-weight: 700; color: #B01F24; margin-bottom: 8px; }
.contact-card .cb { font-size: 13px; color: #666; margin-bottom: 10px; }
.contact-card .tel { font-size: 15px; font-weight: 700; color: #2471A3; margin-bottom: 6px; }
.contact-card .tel a { color: #2471A3; }
.contact-card .qr-box { margin: 8px auto 6px; width: 190px; height: 190px; border: 1px solid #EFE3E1; border-radius: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #FAF6F5; }
.contact-card .qr-box img { width: 100%; height: 100%; object-fit: contain; }
.contact-card .qr-empty { font-size: 13px; color: #B0A6A4; line-height: 1.8; }
.contact-card .tip { font-size: 12px; color: #A1877F; line-height: 1.7; margin-top: 8px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; align-items: center; justify-content: center; z-index: 99; padding: 24px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 26px 20px; max-width: 400px; width: 100%; text-align: center; animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(.9); opacity: .4; } to { transform: scale(1); opacity: 1; } }
.modal .ok-ico { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%; background: #E3F6E5; color: #1E8449; font-size: 30px; line-height: 54px; font-weight: 700; }
.modal .mt { font-size: 15px; line-height: 1.8; color: #333; text-align: left; }
.modal .btns { display: flex; gap: 10px; margin-top: 18px; }
.modal .btns .btn-main { margin-top: 0; flex: 1; font-size: 15px; padding: 11px; letter-spacing: 1px; }
.modal .btns .btn-light { flex: 1; text-align: center; }

/* 通知 */
.notice-item { background: #fff; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.notice-item .nt { font-size: 14px; font-weight: 700; color: #B01F24; margin-bottom: 4px; }
.notice-item .nb { font-size: 13px; color: #555; line-height: 1.7; word-break: break-all; }
.notice-item .tm { font-size: 12px; color: #B0A6A4; margin-top: 4px; }
.notice-bar { background: #FFF8E7; border: 1px solid #F2E3B3; color: #8A6D1A; font-size: 13px; border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; line-height: 1.6; }
.notice-bar b { color: #B01F24; }

/* ===== 管理端 ===== */
body.admin { background: #F0F3F6; }
.anav { background: #263445; color: #fff; position: sticky; top: 0; z-index: 30; }
.anav .in { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; height: 52px; }
.anav .logo { font-size: 16px; font-weight: 700; margin-right: 28px; color: #F5C518; }
.anav a { color: #DDE4EC; font-size: 14px; margin-right: 22px; padding: 6px 0; }
.anav a.on, .anav a:hover { color: #fff; border-bottom: 2px solid #F5C518; }
.anav .sp { flex: 1; }
.awrap { max-width: 1180px; margin: 18px auto; padding: 0 16px 40px; }
.acard { background: #fff; border-radius: 10px; padding: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.05); margin-bottom: 16px; }
.acard h3 { font-size: 15px; color: #263445; margin-bottom: 14px; padding-left: 10px; border-left: 3px solid #263445; }
.asearch { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.asearch input[type=text] { padding: 9px 12px; border: 1px solid #D5DBE1; border-radius: 6px; font-size: 14px; width: 220px; outline: none; }
.asearch select { padding: 9px 10px; border: 1px solid #D5DBE1; border-radius: 6px; font-size: 14px; background: #fff; }
.abtn { background: #263445; color: #fff; border: none; border-radius: 6px; padding: 9px 20px; font-size: 14px; cursor: pointer; }
.abtn.green { background: #1E8449; }
.abtn.red { background: #C0392B; }
.abtn.gray { background: #7F8C8D; }
.abtn.sm { padding: 5px 12px; font-size: 13px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { background: #F4F6F9; color: #4A5A6A; font-weight: 600; padding: 10px 8px; text-align: left; border-bottom: 1px solid #E4E9EF; white-space: nowrap; }
.tbl td { padding: 10px 8px; border-bottom: 1px solid #EEF1F4; vertical-align: top; }
.tbl tr:hover td { background: #FAFBFC; }
.tbl a.did { color: #26619C; font-weight: 700; }
.tbl .thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; border: 1px solid #E4E9EF; cursor: pointer; }
.muted { color: #97A3AE; font-size: 12px; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { padding: 7px 13px; border-radius: 6px; font-size: 13px; background: #fff; border: 1px solid #D5DBE1; color: #263445; }
.pager span.cur { background: #263445; color: #fff; border-color: #263445; }
.stat-line { font-size: 13px; color: #7B8794; margin: 4px 0 12px; }
/* H5 悬浮按钮「联系猴哥」：点击滚动到底部联系卡片/二维码 */
.contact-fab { position: fixed; right: 14px; bottom: 78px; z-index: 90; width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #B01F24, #E05A76); color: #fff; font-size: 13px; font-weight: 700; text-align: center; line-height: 1.25; display: flex; align-items: center; justify-content: center; text-decoration: none; box-shadow: 0 3px 10px rgba(176,31,36,.35); border: 2px solid rgba(255,255,255,.55); }
.contact-fab:active { transform: scale(.94); }
html { scroll-behavior: smooth; }
/* 批量操作条（台账） */
.batch-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #F4F8FC; border: 1px solid #C9D8E8; border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; }
.batch-bar label { font-size: 13px; color: #4A5A6A; }
.batch-bar select { padding: 7px 10px; border: 1px solid #D5DBE1; border-radius: 6px; font-size: 13px; background: #fff; }
.batch-bar .bcnt { font-size: 13px; font-weight: 700; color: #B01F24; }
.batch-bar .bclear { font-size: 12px; color: #7F8C8D; text-decoration: underline; cursor: pointer; background: none; border: none; }
.tbl .row-check { width: 16px; height: 16px; cursor: pointer; }
.tbl th.check-col, .tbl td.check-col { width: 34px; text-align: center; padding-left: 4px; padding-right: 4px; }
/* 今日供货统计卡片 */
.today-stats { background: #FFF7F9; border: 1px solid #F3C6D4; border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; }
.today-stats .ts-title { font-size: 14px; font-weight: 700; color: #A81E44; margin-bottom: 10px; }
.today-stats .ts-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.today-stats .ts-item { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #F3C6D4; border-radius: 18px; padding: 5px 12px; text-decoration: none; }
.today-stats .ts-item:hover { background: #A81E44; border-color: #A81E44; }
.today-stats .ts-name { font-size: 13px; color: #7F1D3D; font-weight: 600; }
.today-stats .ts-num { font-size: 12px; color: #fff; background: #E05A76; border-radius: 10px; padding: 1px 8px; }
.today-stats .ts-item:hover .ts-name { color: #fff; }
.today-stats .ts-item:hover .ts-num { background: #fff; color: #A81E44; }
.today-stats .ts-range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.today-stats .ts-range input[type=date] { padding: 5px 8px; border: 1px solid #F3C6D4; border-radius: 6px; font-size: 13px; background: #fff; color: #7F1D3D; }
.today-stats .ts-lab { font-size: 12.5px; color: #A05A72; }
.today-stats .ts-quick { font-size: 12px; color: #A81E44; background: #fff; border: 1px solid #F3C6D4; border-radius: 12px; padding: 3px 10px; text-decoration: none; white-space: nowrap; }
.today-stats .ts-quick:hover { background: #A81E44; color: #fff; border-color: #A81E44; }
.today-stats .ts-quick.cur { background: #A81E44; color: #fff; border-color: #A81E44; }
/* 供货人统计卡：当前筛选的人高亮 + 台账顶部红字提示（2026-10-28） */
.today-stats .ts-item.cur { background: #A81E44; border-color: #A81E44; box-shadow: 0 2px 6px rgba(168,30,68,.25); }
.today-stats .ts-item.cur .ts-name { color: #fff; }
.today-stats .ts-item.cur .ts-num { background: #fff; color: #A81E44; }
.stat-line b.only-user { color: #B01F24; font-weight: 700; }
/* 台账复制能力 */
.copy-cell { cursor: pointer; color: #26619C; text-decoration: underline dotted; }
.copy-cell:hover { color: #B01F24; }
.copy-btn { border: 1px solid #C9D4DE; background: #fff; color: #26619C; padding: 4px 12px; border-radius: 5px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.copy-btn:hover { background: #26619C; color: #fff; border-color: #26619C; }
.copy-btn.copied { background: #1E8449; border-color: #1E8449; color: #fff; }
.copy-btn.fail { background: #C0392B; border-color: #C0392B; color: #fff; }
#copy-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: rgba(38, 52, 69, .94); color: #fff; font-size: 13px; padding: 9px 18px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 999; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
#copy-toast.show { opacity: 1; }
.aform .field { max-width: 520px; }
.aform .field label { color: #4A5A6A; }
.okmsg { background: #E3F6E5; color: #1E8449; font-size: 13px; padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.aimg { max-width: 320px; border-radius: 8px; border: 1px solid #E4E9EF; }
.uprow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.uprow input[type=file] { font-size: 13px; }
.qrprev { width: 170px; height: 170px; border: 1px solid #E4E9EF; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin: 8px 0; color: #97A3AE; font-size: 12px; overflow: hidden; }
.login-box { max-width: 380px; margin: 90px auto; }

/* 今日行情 */
.hq-cta { display:block;background:linear-gradient(135deg,#a81e44,#e05a76);color:#fff;text-align:center;font-size:15px;font-weight:700;padding:12px;border-radius:10px;margin-bottom:14px;letter-spacing:1px;box-shadow:0 2px 8px rgba(168,30,68,.25); }
.hq-banner { display:block;background:#fde8ed;border:1px solid #f3d7de;color:#7f1d3d;font-size:13px;text-align:center;padding:9px;border-radius:8px;margin-bottom:14px;font-weight:600; }
.hq-frame-wrap { background:#fff;border-radius:12px;overflow:hidden;box-shadow:0 1px 4px rgba(0,0,0,.06);margin-bottom:6px; }

/* 移动端适配：手机上后台表格转为卡片式直排展示，导航可滑动，页面不破界 */
@media (max-width: 760px) {
  .anav .in { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .awrap { padding-left: 10px; padding-right: 10px; }
  .asearch input[type=text] { width: 160px; }
  .tbl, .tbl tbody { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { display: block; background: #fff; border: 1px solid #E4E9EF; border-radius: 8px; margin-bottom: 10px; padding: 4px 10px; }
  .tbl td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 2px; border-bottom: 1px dashed #EEF1F4; font-size: 13.5px; word-break: break-all; min-width: 0; }
  .tbl td:last-child { border-bottom: none; }
  .tbl td::before { content: attr(data-label); color: #97A3AE; font-size: 12px; flex-shrink: 0; min-width: 58px; word-break: keep-all; }
  .tbl td > * { text-align: right; min-width: 0; word-break: break-all; }

  /* 手机端：卡片复选框放大好点，选中卡片高亮，作废卡片标红 */
  .tbl td.check-col > * { transform: scale(1.7); transform-origin: right center; }
  /* 修复（2026-10-28）：勾选列不沿用桌面34px窄宽，防止复选框被flex挤压成0宽而点不到 */
  .tbl td.check-col { width: auto; }
  .tbl td.check-col .row-check { flex-shrink: 0; }
  .tbl tr.selected { background: #FFF7E0; border-color: #F5A623; }
  .tbl tr.selected td::before { color: #B26A00; }
  .tbl tr.void-row { background: #FFF5F5; border-color: #E57373; }
  .tbl tr.void-row .did { color: #C62828; }
  .tbl tr.void-row td::before { color: #C62828; }
}

/* 桌面端：批量勾选行高亮 + 作废行标红 + 红色作废徽章（2026-10-28 后台优化） */
.tbl tr.selected td { background: #FFF7E0; }
.tbl tr.void-row td { background: #FFF5F5; }
.tbl tr.void-row .did { color: #C62828; }
.badge.b-red { background: #FDECEA; color: #C62828; border: 1px solid #F5B7B1; }
