:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #1c2733;
  --ink2: #5b6b7c;
  --line: #e4e9ef;
  --accent: #0a6cff;
  --accent2: #ff8a00;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(16, 42, 67, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* hidden 属性兜底：防止任何带 display 的类（如 .modal）覆盖 UA 的 [hidden]{display:none} */
[hidden] { display: none !important; }
body { font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif; background: var(--bg); color: var(--ink); min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: min(1200px, 94%); margin: 0 auto; }

/* ---- 顶栏 ---- */
.topbar { background: linear-gradient(120deg, #0d1f3c, #12305e); color: #fff; position: sticky; top: 0; z-index: 10; box-shadow: var(--shadow); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), #00c2ff); display: grid; place-items: center; font-weight: 800; font-size: 14px; letter-spacing: .5px; }
.brand-zh { font-size: 18px; font-weight: 700; }
.brand-en { font-size: 11px; opacity: .65; letter-spacing: 1px; }
.topbar-tools { display: flex; gap: 10px; align-items: center; flex: 1; max-width: 520px; min-width: 240px; }
.search { flex: 1; height: 40px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.12); border-radius: 10px; padding: 0 14px; color: #fff; outline: none; font-size: 14px; }
.search::placeholder { color: rgba(255,255,255,.55); }
.search:focus { border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.18); }
.lang-btn { height: 40px; padding: 0 14px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; border-radius: 10px; cursor: pointer; font-size: 13px; }
.lang-btn:hover { background: rgba(255,255,255,.14); }

/* ---- 元信息条 ---- */
.meta-bar { display: flex; justify-content: space-between; gap: 12px; padding: 18px 2px 4px; color: var(--ink2); font-size: 13px; flex-wrap: wrap; }

/* ---- 卡片网格 ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; padding: 14px 0 40px; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; cursor: pointer; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(16, 42, 67, .14); }
.card-img { height: 170px; background: #fff; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.noimg { color: #9aa3ad; font-size: 13px; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-model { font-weight: 700; font-size: 14px; line-height: 1.35; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.card-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.chip { font-size: 11px; color: var(--ink2); background: var(--bg); border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; }
.card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.stock-badge { font-size: 12px; font-weight: 700; color: #0a7a3d; background: #e7f6ec; padding: 3px 9px; border-radius: 999px; }
.detail-link { font-size: 12px; color: var(--accent); }

.empty { text-align: center; color: var(--ink2); padding: 60px 0 80px; font-size: 15px; }

/* ---- 页脚 ---- */
.foot { margin-top: auto; background: #fff; border-top: 1px solid var(--line); color: var(--ink2); font-size: 13px; padding: 18px 0; }

/* ---- 详情弹层 ---- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal-mask { position: absolute; inset: 0; background: rgba(10, 22, 38, .55); backdrop-filter: blur(2px); }
.modal-card { position: relative; background: #fff; border-radius: 18px; width: min(1120px, 100%); max-height: 92vh; overflow: auto; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.modal-close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--bg); color: var(--ink2); font-size: 20px; cursor: pointer; z-index: 2; }
.modal-close:hover { background: var(--line); }
.modal-gallery { background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 22px; border-right: 1px solid var(--line); min-height: 380px; }
.modal-gallery img { max-width: 100%; max-height: min(72vh, 680px); object-fit: contain; cursor: zoom-in; }
/* 全屏看图 */
#lightbox { position: fixed; inset: 0; z-index: 99; background: rgba(8, 14, 26, .92); display: grid; place-items: center; cursor: zoom-out; padding: 24px; }
#lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mg-nav { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.mg-nav button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 18px; cursor: pointer; }
.mg-nav button:hover { background: var(--bg); }
.mg-dots { display: flex; gap: 6px; }
.mg-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); cursor: pointer; }
.mg-dots i.on { background: var(--accent); }
.modal-info { padding: 26px 26px 22px; }
.modal-info h2 { font-size: 18px; line-height: 1.4; word-break: break-all; margin-bottom: 12px; }
.m-stock { display: inline-block; font-weight: 700; color: #0a7a3d; background: #e7f6ec; padding: 4px 12px; border-radius: 999px; font-size: 13px; margin-bottom: 16px; }
.m-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.m-table th { text-align: left; color: var(--ink2); font-weight: 600; width: 42%; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.m-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); word-break: break-all; }

/* ---- 手机 ---- */
@media (max-width: 760px) {
  .modal-card { grid-template-columns: 1fr; }
  .modal-gallery { border-right: none; border-bottom: 1px solid var(--line); min-height: 0; }
  .modal-gallery img { max-height: 300px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card-img { height: 130px; }
}
