/* ===== 设备备件速查目录 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F4F5F7;
  --card: #FFFFFF;
  --ink: #15181E;
  --ink2: #5A6070;
  --ink3: #8B92A3;
  --line: #E6E8EC;
  --line2: #F0F1F4;
  --blue: #1E4FD8;
  --blue-d: #1740B4;
  --blue-l: #EEF2FF;
  --orange: #FF5A1F;
  --orange-l: #FFF2EC;
  --green: #0F9960;
  --green-l: #E9F7F1;
  --amber: #B7791F;
  --amber-l: #FDF6E3;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .05), 0 0 0 1px rgba(20, 30, 60, .04);
}

html, body { height: 100%; }
body {
  font: 13px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 40px;
  overflow-x: hidden;
}
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 18px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-weight: 650; letter-spacing: -.01em; }

/* ===== 顶栏 ===== */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar .wrap {
  display: flex; align-items: center; gap: 22px;
  padding-top: 12px; padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(140deg, #2E5FE8, #1B3FB0);
  color: #fff; font-size: 17px; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(30, 79, 216, .3);
}
.brand-text h1 { font-size: 16px; line-height: 1.2; }
.brand-text p { font-size: 11.5px; color: var(--ink3); margin-top: 1px; }

.search-box {
  flex: 1; min-width: 0; position: relative; display: flex; align-items: center;
}
.search-box .s-icon {
  position: absolute; left: 11px; width: 16px; height: 16px;
  color: var(--ink3); pointer-events: none;
}
.search-box input {
  width: 100%; height: 38px; border: 1px solid var(--line);
  border-radius: 9px; padding: 0 34px 0 34px;
  background: #FAFBFC; outline: none;
  transition: .15s;
}
.search-box input:focus {
  border-color: var(--blue); background: #fff;
  box-shadow: 0 0 0 3px rgba(30, 79, 216, .09);
}
.clear-q {
  position: absolute; right: 8px; width: 22px; height: 22px;
  border: none; border-radius: 50%; background: var(--line);
  color: var(--ink2); cursor: pointer; font-size: 15px; line-height: 1;
}
.clear-q:hover { background: #D8DCE4; }

/* ===== 筛选工具条 ===== */
.toolbar {
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 63px; z-index: 25;
  box-shadow: 0 2px 6px rgba(20, 30, 60, .03);
}
.tl-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 6px 0;
  min-width: 0;
}
.tl-row + .tl-row { border-top: 1px dashed var(--line2); }
.tl-label {
  font-size: 11.5px; color: var(--ink3); flex-shrink: 0;
  width: 30px; letter-spacing: .04em;
  padding-top: 4px;
}
.chips {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 1px 0;
  flex: 1 1 auto; min-width: 0;
  row-gap: 5px;
}

.chip {
  border: 1px solid transparent; background: var(--line2); color: var(--ink2);
  padding: 3px 7px; border-radius: 20px; cursor: pointer;
  white-space: nowrap; font-size: 11.5px; transition: .13s;
}
.chip:hover { background: #E8EAEF; color: var(--ink); }
.chip.on {
  background: var(--blue-l); color: var(--blue-d);
  border-color: #C7D4FB; font-weight: 600;
}
.chip .n { opacity: .55; font-size: 10px; margin-left: 2px; }

/* ===== 统计条 ===== */
.statbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 14px 2px 10px;
}
#statText { font-size: 12.5px; color: var(--ink2); }
#statText b { color: var(--ink); font-weight: 650; }
.stat-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sw { display: flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; }
.sw input { accent-color: var(--blue); width: 14px; height: 14px; cursor: pointer; }
.sw span { font-size: 12.5px; color: var(--ink2); }
#sortBy {
  border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px;
  background: #fff; font-size: 12.5px; cursor: pointer; outline: none;
}
#sortBy:focus { border-color: var(--blue); }

/* ===== 商品网格 ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: 12px;
  align-items: start;
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .16s, transform .16s, border-color .16s;
}
.card:hover {
  box-shadow: 0 8px 22px rgba(20, 30, 60, .10);
  transform: translateY(-2px);
  border-color: #D3DAE8;
}
.card-img {
  position: relative; aspect-ratio: 1 / 1; background: #FAFBFC;
  border-bottom: 1px solid var(--line2);
  display: grid; place-items: center; overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.noimg { display: grid; place-items: center; gap: 6px; }
.noimg-char {
  width: 46px; height: 46px; border-radius: 13px;
  background: #EFF1F5; color: #AEB7C7;
  display: grid; place-items: center;
  font-size: 21px; font-weight: 650; letter-spacing: 0;
  line-height: 1;
}
.noimg span { font-size: 10px; letter-spacing: .07em; color: #C6CCD8; }

.badge-hot {
  position: absolute; top: 7px; left: 7px;
  background: var(--orange); color: #fff;
  font-size: 10px; font-weight: 600; padding: 2px 6px;
  border-radius: 5px; letter-spacing: .02em;
  box-shadow: 0 2px 5px rgba(255, 90, 31, .32);
}
.badge-link {
  position: absolute; top: 7px; right: 7px;
  background: rgba(15, 153, 96, .93); color: #fff;
  font-size: 10px; font-weight: 600; padding: 2px 6px;
  border-radius: 5px;
}

.card-body { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card-name {
  font-size: 13.5px; font-weight: 650; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 36px;
}
.card-name mark { background: #FFF3B8; color: inherit; padding: 0 1px; border-radius: 2px; }
.card-spec {
  font-size: 11.5px; color: var(--ink2); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 16px;
}
.card-spec:empty { display: none; }
.card-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag {
  font-size: 10.5px; padding: 1.5px 6px; border-radius: 4px;
  background: var(--line2); color: var(--ink2); white-space: nowrap;
}
.tag.cat { background: var(--blue-l); color: var(--blue-d); }

.btn-buy {
  margin-top: auto; display: flex; align-items: center; justify-content: center;
  gap: 5px; height: 31px; border-radius: 7px; border: none;
  background: var(--orange); color: #fff;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: .14s;
}
.btn-buy:hover { background: #E94E15; box-shadow: 0 3px 10px rgba(255, 90, 31, .3); }
.btn-buy svg { width: 13px; height: 13px; }
.btn-buy.ghost {
  background: #F2F3F6; color: var(--ink3); cursor: not-allowed;
  font-weight: 500;
}
.btn-buy.ghost:hover { background: #F2F3F6; box-shadow: none; }

/* 无直达链接时的「搜同款」两连按钮 */
.btn-row { margin-top: auto; display: flex; gap: 6px; }
.btn-row .btn-buy.alt {
  flex: 1 1 0; min-width: 0; margin-top: 0;
  background: #F2F3F6; color: var(--ink2); font-weight: 600; padding: 0 4px;
}
.btn-row .btn-buy.alt:hover { background: #E5E8EF; color: var(--ink1); box-shadow: none; }

/* ===== 空态 / 页脚 ===== */
.empty { text-align: center; padding: 70px 20px; color: var(--ink3); }
.empty-ico { font-size: 34px; margin-bottom: 10px; opacity: .5; }
.empty p { font-size: 14px; color: var(--ink2); font-weight: 600; }
.empty span { font-size: 12.5px; }

.foot {
  margin-top: 30px; padding: 16px 18px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 12.5px; color: var(--ink2);
}
.foot strong { color: var(--ink); }
.foot .muted { color: var(--ink3); font-size: 11.5px; margin-top: 5px; }

/* ===== toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px);
  background: rgba(21, 24, 30, .93); color: #fff;
  padding: 9px 18px; border-radius: 8px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .22s; z-index: 99;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ===== 后台 ===== */
.adm-top {
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.adm-top .wrap {
  display: flex; align-items: center; gap: 14px;
  padding-top: 11px; padding-bottom: 11px;
}
.adm-top .spacer { flex: 1; }
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink2);
  padding: 6px 13px; border-radius: 7px; cursor: pointer;
  font-size: 12.5px; transition: .13s; white-space: nowrap;
}
.btn:hover { border-color: #C9D0DE; color: var(--ink); background: #FAFBFC; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--blue-d); }
.btn.danger { color: #C0392B; }
.btn.danger:hover { background: #FDF0EE; border-color: #F0C4BC; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.ghost { color: var(--blue); border-color: #CBD9F5; background: #F5F8FF; }
.btn.ghost:hover { background: #EBF1FF; border-color: #A9C0F0; color: var(--blue-d); }

.login-wrap { max-width: 340px; margin: 90px auto; padding: 0 18px; }
.login-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 26px 24px; box-shadow: 0 4px 24px rgba(20, 30, 60, .06);
}
.login-card h2 { font-size: 17px; margin-bottom: 4px; }
.login-card p { font-size: 12.5px; color: var(--ink3); margin-bottom: 18px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--ink2); margin-bottom: 5px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; height: 36px; border: 1px solid var(--line);
  border-radius: 8px; padding: 0 11px; background: #FAFBFC;
  outline: none; transition: .15s;
}
.field textarea { height: auto; padding: 8px 11px; resize: vertical; min-height: 60px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue); background: #fff;
  box-shadow: 0 0 0 3px rgba(30, 79, 216, .09);
}
.err { color: #C0392B; font-size: 12.5px; margin-top: 8px; min-height: 17px; }

.adm-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 0 10px;
}
.adm-bar .grow { flex: 1; min-width: 190px; }
.adm-bar input[type=search] {
  width: 100%; height: 34px; border: 1px solid var(--line);
  border-radius: 8px; padding: 0 11px; outline: none; background: #fff;
}
.adm-bar input[type=search]:focus { border-color: var(--blue); }

.adm-tip {
  background: var(--amber-l); border: 1px solid #F0E0B8; color: #8A6413;
  border-radius: 8px; padding: 9px 13px; font-size: 12.5px; margin-bottom: 12px;
  display: flex; gap: 8px; align-items: flex-start;
}
.adm-tip b { color: #6B4E0C; }

table.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink3);
  background: #FAFBFC; padding: 9px 11px; border-bottom: 1px solid var(--line);
  white-space: nowrap; letter-spacing: .02em;
}
table.tbl td { padding: 8px 11px; border-bottom: 1px solid var(--line2); font-size: 12.5px; vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: #FCFCFD; }
.tbl-wrap { overflow-x: auto; }
.mini-img {
  width: 38px; height: 38px; border-radius: 6px; object-fit: contain;
  background: #FAFBFC; border: 1px solid var(--line2); display: block;
}
.mini-none {
  width: 38px; height: 38px; border-radius: 6px;
  background: #FAFBFC; border: 1px dashed #DDE1E8;
  display: grid; place-items: center; color: #C2C8D4; font-size: 15px;
}
.tbl .nm { font-weight: 600; }
.tbl .sp { color: var(--ink3); font-size: 11.5px; }
.link-yes { color: var(--green); font-weight: 600; font-size: 11.5px; }
.link-no { color: var(--ink3); font-size: 11.5px; }
.rowacts { display: flex; gap: 5px; white-space: nowrap; }
.tbl tbody tr.sel td { background: #F3F6FF; }
.tbl input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--blue); cursor: pointer; }
.bulkbar {
  position: sticky; top: 60px; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0 2px; padding: 8px 12px;
  background: #EEF2FF; border: 1px solid #C7D4FB; border-radius: 9px;
  font-size: 12.5px; color: #24437F;
}
.bulkbar b { color: #1740B4; }
.bulkbar .btn.sm { background: #fff; }
.bulkbar .btn.danger { background: #FDECEA; border-color: #F0C4BC; color: #A93226; font-weight: 600; }
.bulkbar .btn.danger:hover { background: #FBDDD8; }
.bulk-warn { color: #B7791F; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(18, 22, 32, .45);
  display: grid; place-items: center; z-index: 60; padding: 18px;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 460px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 18px 50px rgba(10, 20, 50, .25);
}
.modal-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: #fff; border-radius: 12px 12px 0 0;
}
.modal-h h3 { font-size: 15px; }
.modal-x { border: none; background: none; font-size: 21px; color: var(--ink3); cursor: pointer; line-height: 1; }
.modal-x:hover { color: var(--ink); }
.modal-b { padding: 16px 18px; }
.modal-f {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 13px 18px; border-top: 1px solid var(--line);
  position: sticky; bottom: 0; background: #fff; border-radius: 0 0 12px 12px;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.img-drop {
  border: 1.5px dashed #D3D9E4; border-radius: 9px; padding: 14px;
  text-align: center; cursor: pointer; transition: .15s; background: #FAFBFC;
}
.img-drop:hover { border-color: var(--blue); background: var(--blue-l); }
.img-drop img { max-width: 100%; max-height: 130px; border-radius: 6px; display: block; margin: 0 auto; }
.img-drop .hint { font-size: 11.5px; color: var(--ink3); }
.img-drop .hint b { color: var(--blue); }

/* 导入弹窗 */
.imp-note {
  background: #F7F9FC; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: 12px; color: var(--ink2); line-height: 1.7;
  margin-bottom: 12px;
}
.imp-note b { color: var(--ink); }
.imp-ok {
  margin-top: 12px; background: var(--green-l); border: 1px solid #BFE6D5;
  color: #0B6B45; border-radius: 8px; padding: 10px 12px;
  font-size: 12.5px; line-height: 1.75;
}
.imp-ok b { color: #0B6B45; }
.imp-err {
  margin-top: 12px; background: #FDECEA; border: 1px solid #F5C6C0;
  color: #A93226; border-radius: 8px; padding: 10px 12px; font-size: 12.5px;
}
.imp-warn { margin-top: 6px; font-size: 12px; color: var(--amber); }

/* ===== 响应式 ===== */
@media (max-width: 760px) {
  .topbar .wrap { flex-wrap: wrap; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .tl-row { align-items: center; padding: 7px 0; }
  .tl-label { padding-top: 0; }
  .chips {
    flex-wrap: nowrap; overflow-x: auto; padding: 2px 0;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .chips::-webkit-scrollbar { display: none; }
  .brand { flex: 1; }
  .brand-text h1 { font-size: 15px; }
  .brand-text p { display: none; }
  .search-box { flex-basis: 100%; order: 3; }
  .toolbar { top: 0; position: static; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 9px; }
  .wrap { padding: 0 12px; }
  .card-body { padding: 8px 9px 9px; gap: 4px; }
  .card-name { font-size: 12.5px; min-height: 33px; }
  .btn-buy { height: 29px; font-size: 12px; }
  .statbar { padding: 11px 2px 8px; }
  .foot { padding: 13px; }
  .grid2 { grid-template-columns: 1fr; }
}
