/* 生猪销售系统 管理端样式（深绿商务） */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", sans-serif; background: #f2f5fa; color: #1c2739; font-size: 14px; }
.hidden { display: none !important; }
.input { padding: 7px 10px; border: 1px solid #ccd6e4; border-radius: 6px; font-size: 14px; background: #fff; }
.btn { padding: 7px 16px; border: 1px solid #ccd6e4; border-radius: 6px; background: #fff; cursor: pointer; font-size: 14px; }
.btn:hover { border-color: #16325c; color: #16325c; }
.btn-primary { background: #16325c; border-color: #16325c; color: #fff; }
.btn-primary:hover { background: #12294a; color: #fff; }
.btn-ghost { border: none; background: transparent; color: #888; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { color: #c62828; border-color: #e0b4b4; }
.btn-block { width: 100%; }

/* ── 地图选点 ── */
.btn-map { padding: 8px 18px; border: 1px solid #16325c; border-radius: 6px; background: #eef3fa; color: #16325c; cursor: pointer; font-size: 14px; font-weight: bold; }
.btn-map:hover { background: #16325c; color: #fff; }
.map-coord-hint { margin-left: 10px; font-size: 12.5px; color: #2e7d32; }
#map-picker { cursor: crosshair; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f2440, #16325c); }
.login-box { background: #fff; border-radius: 12px; padding: 40px 36px; width: 360px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.login-logo { font-size: 48px; }
.login-box h1 { font-size: 22px; margin: 8px 0 2px; }
.login-sub { color: #888; margin-bottom: 24px; }
.login-box input { width: 100%; margin-bottom: 14px; padding: 10px 12px; border: 1px solid #ccd6e4; border-radius: 6px; }
.login-err { color: #c62828; font-size: 13px; min-height: 18px; margin-top: 8px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #12233f; color: #c9d6e8; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; }
.side-logo { padding: 20px 18px; font-size: 16px; font-weight: bold; color: #fff; border-bottom: 1px solid rgba(201,168,106,.35); display: flex; align-items: center; gap: 8px; }
.side-logo svg { flex-shrink: 0; }
#side-nav { flex: 1; padding-top: 8px; }
#side-nav a { display: flex; align-items: center; gap: 10px; padding: 13px 20px; cursor: pointer; color: #c9d6e8; text-decoration: none; }
#side-nav a svg { flex-shrink: 0; opacity: .85; }
#side-nav a:hover { background: rgba(255,255,255,.08); }
#side-nav a.active { background: #16325c; color: #fff; box-shadow: inset 3px 0 0 0 #c9a86a; }
.side-foot { padding: 16px 18px; border-top: 1px solid rgba(201,168,106,.35); display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.content { margin-left: 220px; flex: 1; padding: 24px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.toolbar h2 { font-size: 18px; padding-left: 12px; border-left: 4px solid #c9a86a; line-height: 1.3; }
.toolbar > div { display: flex; gap: 8px; }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid #edf0f5; text-align: left; font-size: 13px; }
.tbl th { background: #e9eff8; color: #12233f; font-weight: 600; white-space: nowrap; }
.tbl tr:hover td { background: #f7f9fc; }
.st { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.st-on_sale { background: #e8eef7; color: #16325c; }
.st-locked { background: #fff3e0; color: #e65100; }
.st-sold { background: #ede7f6; color: #5e35b1; }
.st-off, .st-draft { background: #eceff1; color: #78909c; }
.st-pending { background: #fff8e1; color: #f9a825; }
.st-approved { background: #e8eef7; color: #16325c; }
.st-rejected { background: #ffebee; color: #c62828; }
.st-released { background: #eceff1; color: #78909c; }

/* 表单卡片 */
.form-card { background: #fff; border-radius: 8px; padding: 24px; max-width: 560px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.form-card label { display: block; margin-bottom: 14px; font-size: 13px; color: #555; }
.form-card .input { width: 100%; margin-top: 4px; }
.ok-msg { color: #16325c; margin-top: 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 { background: #fff; border-radius: 10px; width: 680px; max-height: 88vh; display: flex; flex-direction: column; }
.modal h3 { padding: 16px 20px; border-bottom: 1px solid #edf0f5; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-body label { display: block; margin-bottom: 12px; font-size: 13px; color: #555; }
.modal-body .input { width: 100%; margin-top: 4px; }
.modal-body .chk { display: flex; align-items: center; gap: 6px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid #edf0f5; text-align: right; display: flex; gap: 10px; justify-content: flex-end; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.img-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.img-item { position: relative; width: 72px; height: 72px; border-radius: 6px; overflow: hidden; border: 2px solid #e0e0e0; }
.img-item.cover { border-color: #16325c; }
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-item .rm { position: absolute; top: 0; right: 0; background: rgba(0,0,0,.55); color: #fff; border: none; width: 20px; height: 20px; cursor: pointer; font-size: 11px; line-height: 20px; }
.img-item .tag { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(46,125,50,.85); color: #fff; font-size: 10px; text-align: center; }
.bn-thumb { width: 68px; height: 26px; object-fit: cover; border-radius: 4px; cursor: pointer; display: block; }

.hint { font-size: 12px; color: #8493a8; background: #f4f6fa; border-left: 3px solid #c9a86a; padding: 8px 12px; border-radius: 4px; margin-bottom: 12px; }
