/* 海豚智能解析 - 公共样式 */
:root {
  --primary: #3d7cf0;
  --primary-dark: #2f66d8;
  --primary-light: #eaf2ff;
  --success: #14ab6a;
  --danger: #ef4d4d;
  --warning: #f0a02a;
  --text: #1f2a44;
  --text-2: #5a6884;
  --text-3: #93a0b8;
  --border: #e2e9f4;
  --bg: #eef5ff;
  --white: #fff;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(70, 116, 190, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 16px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--text-2); font-size: 13px; transition: .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { background: #fff; border-color: #f3c9c9; color: var(--danger); }
.btn-danger:hover { background: #fff2f2; border-color: var(--danger); color: var(--danger); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 42px; padding: 0 24px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* 表单 */
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; color: var(--text-2); font-size: 13px; }
.field label .req { color: var(--danger); margin-right: 3px; }
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--border);
  border-radius: 6px; background: #fff; color: var(--text); outline: none; transition: .15s;
}
.textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(75,92,246,.1); }
.input::placeholder, .textarea::placeholder { color: #b6bdcc; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > .field { flex: 1; min-width: 140px; }

/* 卡片 */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { padding: 15px 18px; border-bottom: 1px solid var(--border); font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: 18px; }

/* 表格 */
.table-wrap { width: 100%; overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl th { background: #fafbfe; color: var(--text-2); font-weight: 500; }
.tbl tr:hover td { background: #fafbff; }
.tbl td.wrap { white-space: normal; word-break: break-all; min-width: 180px; }
.tbl .mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; }

/* 标签 */
.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; line-height: 18px; }
.tag-green { background: #e8f8ef; color: var(--success); }
.tag-red { background: #feecec; color: var(--danger); }
.tag-gray { background: #f0f2f7; color: var(--text-3); }
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-orange { background: #fff4e3; color: var(--warning); }

/* 提示 */
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap-flex { flex-wrap: wrap; }
.spacer { flex: 1; }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(20,25,40,.42); display: none; align-items: center; justify-content: center; z-index: 900; }
/* 商品详情大面板 z-index=3000，编辑备注等弹窗必须叠在它之上 */
.mask.show { display: flex; z-index: 5000; }
.modal { width: min(560px, 92vw); max-height: 86vh; overflow: auto; background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.modal-close { border: 0; background: none; font-size: 20px; color: var(--text-3); line-height: 1; }

/* Toast */
/* 层级要高于所有弹层（详情面板 3000 / 图片预览 4000），否则提示会被盖住 */
#toastBox { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 6000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 20px; border-radius: 8px; background: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.16); font-size: 13px; border-left: 4px solid var(--primary); animation: toastIn .2s ease; }
.toast.ok { border-left-color: var(--success); }
.toast.err { border-left-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* 空状态 / 加载 */
.empty { padding: 48px 20px; text-align: center; color: var(--text-3); }
.empty .ico { font-size: 34px; display: block; margin-bottom: 10px; opacity: .5; }
.loading { padding: 40px; text-align: center; color: var(--text-3); }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 0 2px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.pager .btn { height: 28px; padding: 0 10px; font-size: 12px; }
.pager-size { display: inline-flex; align-items: center; gap: 5px; margin-right: 4px; }
.pager-size-sel { height: 28px; padding: 0 22px 0 8px; font-size: 12px; color: var(--text); background: #fff;
  border: 1px solid var(--border); border-radius: 7px; cursor: pointer; outline: none;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238a93a8' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center; }
.pager-size-sel:hover { border-color: #c3cbdd; }
.pager-size-sel:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(75,92,246,.12); }

/* 管理后台：采集记录同款分页（每页X条 + 数字页码 + 跳转 + 共X条） */
.pager-host { border-top: 1px solid var(--border); }
.admin-cl-pager { display: flex; align-items: center; gap: 10px; padding: 12px 18px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; line-height: 1; }
.admin-cl-pager .spacer { flex: 1; min-width: 0; }
.admin-cl-pager .cl-pg-nav { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.admin-cl-pager .cl-pg-btn { min-width: 27px; height: 27px; padding: 0 7px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text-2); font-size: 12px; cursor: pointer; }
.admin-cl-pager .cl-pg-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.admin-cl-pager .cl-pg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.admin-cl-pager .cl-pg-btn:disabled { opacity: .45; cursor: not-allowed; }
.admin-cl-pager .cl-pg-ell { color: var(--text-3); padding: 0 2px; }
.admin-cl-pager .cl-pg-jump { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; color: var(--text-3); line-height: 27px; }
.admin-cl-pager .cl-pg-input { width: 40px; height: 27px; border: 1px solid var(--border); border-radius: 6px; text-align: center; outline: none; font-size: 12px; line-height: 25px; padding: 0 2px; }
.admin-cl-pager .cl-pg-info { display: inline-flex; align-items: center; height: 27px; color: var(--text-3); }
.admin-cl-pager .cl-pg-label { display: inline-flex; align-items: center; height: 27px; color: var(--text-3); }
.admin-cl-pager .cl-pg-select { height: 27px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text-2); font-size: 12px; padding: 0 6px; outline: none; cursor: pointer; }

/* 悬浮确认框（关闭软件等）：居中卡片 + 轻遮罩 */
.at-float-mask {
  position: fixed; inset: 0; z-index: 7000; display: flex; align-items: center; justify-content: center;
  background: rgba(24, 34, 56, .28);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .16s ease;
}
.at-float-mask.show { opacity: 1; }
.at-float-card {
  width: min(360px, 86vw); padding: 22px 22px 18px; border-radius: 16px;
  background: #fff; border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 22px 56px rgba(23, 43, 84, .24), 0 0 0 1px rgba(203, 219, 243, .6);
  display: grid; grid-template-columns: 42px 1fr; column-gap: 14px; row-gap: 4px;
  transform: translateY(8px) scale(.98); transition: transform .18s cubic-bezier(.22,.9,.3,1.2);
}
.at-float-mask.show .at-float-card { transform: none; }
.at-float-ic {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  color: #f0871a; background: linear-gradient(150deg, #fff1dc, #ffe3bd);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9), 0 6px 14px rgba(240, 135, 26, .16);
}
.at-float-ic svg { width: 21px; height: 21px; }
.at-float-main { min-width: 0; padding-top: 1px; }
.at-float-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.5; }
.at-float-desc { margin-top: 6px; font-size: 12.5px; line-height: 1.7; color: var(--text-3); }
.at-float-btns { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.at-fbtn {
  height: 34px; min-width: 76px; padding: 0 16px; border-radius: 9px; font-size: 13px;
  border: 1px solid var(--border); background: #fff; color: var(--text-2);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s;
}
.at-fbtn:hover { border-color: #c6d3e8; color: var(--text); background: #f8fbff; }
.at-fbtn:active { transform: translateY(1px); }
.at-fbtn.primary {
  border-color: transparent; color: #fff; font-weight: 500;
  background: linear-gradient(135deg, #4b8bf6, #2f66d8);
  box-shadow: 0 4px 12px rgba(61, 124, 240, .28);
}
.at-fbtn.primary:hover { background: linear-gradient(135deg, #3f7fee, #2759c2); color: #fff; }
.at-fbtn.danger {
  border-color: transparent; color: #fff; font-weight: 500;
  background: linear-gradient(135deg, #f4614f, #dc3a2c);
  box-shadow: 0 4px 12px rgba(220, 58, 44, .26);
}
.at-fbtn.danger:hover { background: linear-gradient(135deg, #ea5342, #c92f22); color: #fff; }

/* 渐变绿确定按钮（创建仓库等） */
.btn.btn-green {
  background: linear-gradient(135deg, #3ed07f, #12a45e); border-color: #12a45e; color: #fff;
  box-shadow: 0 3px 10px rgba(18, 164, 94, .22);
}
.btn.btn-green:hover { background: linear-gradient(135deg, #37bf74, #0e8f52); border-color: #0e8f52; color: #fff; }
