/* 科润达供货商工作台 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root { --primary: #c81e1e; --green: #16a34a; --orange: #ea580c; --border: #e5e7eb; }
body { font: 14px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f4f5f7; color: #222; }
a { color: #2563eb; text-decoration: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 34px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; font-size: 13px; cursor: pointer; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.green { background: var(--green); color: #fff; }
.btn.ghost { background: #fff; border-color: #d1d5db; color: #444; }
.btn.big { width: 100%; height: 42px; font-size: 15px; }
.btn.sm { height: 28px; padding: 0 12px; font-size: 12px; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, #fee2e2 0, transparent 40%), radial-gradient(circle at 80% 80%, #fef3c7 0, transparent 40%), #f8f8f8; }
.login-card { width: 380px; background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.10); padding: 36px 34px; }
.login-logo { font-size: 24px; font-weight: 800; color: var(--primary); }
.login-logo span { color: #222; font-size: 18px; margin-left: 4px; }
.login-sub { color: #888; font-size: 13px; margin: 4px 0 24px; }
.login-card label { display: block; font-size: 13px; color: #555; margin: 14px 0 6px; }
.login-card input { width: 100%; height: 40px; border: 1px solid #d1d5db; border-radius: 8px; padding: 0 12px; font-size: 14px; }
.login-card input:focus { outline: none; border-color: var(--primary); }
.login-err { color: var(--primary); font-size: 12px; min-height: 18px; margin: 8px 0 4px; }
.login-tip { font-size: 12px; color: #999; margin-top: 14px; text-align: center; }

/* 顶栏 */
.topbar { height: 52px; background: #1c1c1e; color: #fff; display: flex; align-items: center; padding: 0 22px; position: sticky; top: 0; z-index: 20; }
.tb-brand { font-weight: 700; font-size: 16px; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 13px; }
.tb-right a { color: #bbb; }
.tb-right a:hover { color: #fff; }
.wrap { max-width: 1180px; margin: 18px auto; padding: 0 16px; }

/* 页签 */
.page-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.page-tabs a { padding: 10px 18px; color: #555; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; font-weight: 600; }
.page-tabs a.on { background: #fff; border-color: var(--border); color: var(--primary); position: relative; top: 1px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs a { padding: 8px 18px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: #444; font-size: 13px; cursor: pointer; }
.tabs a.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.tip-bar { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 12px; border-radius: 8px; padding: 8px 12px; margin: 12px 0; }
.product-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.product-toolbar input, .product-toolbar select { height: 32px; border: 1px solid #d1d5db; border-radius: 8px; padding: 0 10px; background: #fff; }
.product-toolbar input { min-width: 240px; }
.toolbar-spacer { flex: 1; min-width: 12px; }
.product-count { font-size: 12px; color: #999; }

/* 采购单卡片 */
.po-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.po-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.po-no { font-weight: 700; font-size: 15px; }
.po-time { color: #999; font-size: 12px; margin-left: auto; }
.po-meta { font-size: 12px; color: #666; margin-top: 6px; }
.po-note { color: var(--primary); font-size: 12px; margin-top: 4px; }
.po-req-box { margin-top: 10px; padding: 10px 12px; border: 1px solid #fed7aa; border-radius: 10px; background: #fff7ed; color: #7c2d12; font-size: 12px; line-height: 1.7; }
.po-req-box b { display: block; color: #c2410c; font-size: 13px; margin-bottom: 4px; }
.po-req-box span { display: inline-block; margin-right: 18px; }
.po-req-items { display: grid; gap: 4px; margin-top: 6px; }
.po-req-items em { font-style: normal; color: #9a3412; }
.po-card table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.po-card th { background: #fafafa; font-weight: 600; color: #666; }
.po-card th, .po-card td { border: 1px solid #f0f0f0; padding: 6px 8px; text-align: center; }
.po-card td.ta-l { text-align: left; }
.po-ops { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ship-info { font-size: 13px; color: #333; }
.ship-info b { color: var(--green); }
.ship-photo-link { margin-left: 8px; color: #2563eb; font-size: 12px; }
.ship-photo-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 42px; padding: 10px; border: 1px dashed #d1d5db; border-radius: 10px; background: #fafafa; }
.ship-photo-preview { display: inline-flex; align-items: center; gap: 10px; color: #2563eb; font-size: 12px; }
.ship-photo-preview img { width: 72px; height: 72px; object-fit: contain; border: 1px solid #eee; border-radius: 8px; background: #fff; }
.ship-photo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ship-photo-tip { color: #888; font-size: 12px; }
.req-note { display: inline-block; max-width: 260px; padding: 5px 8px; border: 1px solid #fed7aa; border-radius: 7px; background: #fff7ed; color: #9a3412; font-size: 12px; line-height: 1.45; white-space: normal; }
.item-req { margin-top: 4px; color: #c2410c; font-size: 12px; line-height: 1.45; white-space: normal; }

.tag { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.tag.todo { background: #fef2f2; color: #dc2626; }
.tag.preparing { background: #fff7ed; color: #c2410c; }
.tag.shipped { background: #ecfdf5; color: #047857; }
.empty { text-align: center; color: #999; padding: 60px 0; background: #fff; border: 1px dashed #ddd; border-radius: 12px; }

/* 商品管理 */
.product-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; font-size: 13px; }
.product-table th { background: #fafafa; color: #666; font-weight: 600; }
.product-table th, .product-table td { border-bottom: 1px solid #f0f0f0; padding: 8px 10px; text-align: left; vertical-align: middle; }
.product-table tr:last-child td { border-bottom: 0; }
.p-thumb { width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #eee; border-radius: 8px; background: #fff; overflow: hidden; color: #bbb; }
.p-thumb img { width: 100%; height: 100%; object-fit: contain; }
.p-name { font-weight: 600; color: #222; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-sub { color: #999; font-size: 12px; margin-top: 2px; }
.reject-note { display: inline-block; max-width: 520px; margin-top: 7px; padding: 6px 9px; border: 1px solid #fecaca; border-radius: 8px; background: #fef2f2; color: #991b1b; font-size: 12px; line-height: 1.55; white-space: normal; }
.reject-note b { margin-right: 4px; color: #dc2626; }
.modal-reject { display: block; max-width: none; margin: 0 0 12px; }
.p-price { font-weight: 700; color: #c2410c; }
.p-ops { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.p-ops a { font-size: 12px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; color: #666; font-size: 12px; }
.pager button { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 5px 12px; cursor: pointer; }
.pager button:disabled { color: #bbb; cursor: not-allowed; }
.tag.off { background: #fef2f2; color: #dc2626; }
.tag.on { background: #ecfdf5; color: #047857; }
.img-slots { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.img-slot { position: relative; width: 76px; height: 76px; border: 1px dashed #d1d5db; border-radius: 8px; background: #fafafa; display: flex; align-items: center; justify-content: center; color: #aaa; cursor: pointer; overflow: hidden; }
.img-slot img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.img-del { position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; line-height: 17px; text-align: center; background: var(--primary); color: #fff; border-radius: 50%; font-size: 11px; }
.main-img-mark { position: absolute; left: 0; bottom: 0; background: rgba(200,30,30,.86); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 0 6px 0 8px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { width: 460px; max-width: 94vw; background: #fff; border-radius: 14px; overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; font-weight: 700; border-bottom: 1px solid var(--border); }
.modal-head a { color: #999; font-size: 16px; }
.modal-body { padding: 18px; max-height: 65vh; overflow: auto; }
.modal-body label { display: block; font-size: 13px; color: #555; margin: 10px 0 4px; }
.modal-body input, .modal-body select, .modal-body textarea { width: 100%; height: 38px; border: 1px solid #d1d5db; border-radius: 8px; padding: 0 10px; font-size: 14px; background: #fff; }
.modal-body textarea { height: 70px; padding: 8px 10px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.form-grid .full { grid-column: 1 / -1; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.form-err { color: var(--primary); font-size: 12px; min-height: 16px; margin-top: 8px; }

/* 提示条 */
.toast { position: fixed; top: 66px; left: 50%; transform: translateX(-50%); background: #222; color: #fff; font-size: 13px; padding: 9px 18px; border-radius: 999px; z-index: 99; }

@media (max-width: 640px) {
  .po-card { padding: 12px; }
  .po-card th:nth-child(4), .po-card td:nth-child(4) { display: none; } /* 窄屏隐藏规格列 */
  .tb-brand { font-size: 14px; }
  .product-toolbar input { min-width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .product-table th:nth-child(4), .product-table td:nth-child(4),
  .product-table th:nth-child(6), .product-table td:nth-child(6) { display: none; }
}
