*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system,BlinkMacSystemFont,Helvetica Neue,Helvetica,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,sans-serif;
  text-autospace: normal;
  font-size: 14px;
  color: #111;
  background: #fff;
}

/* ── HEADER ── */
header {
  position: sticky; top: 0; z-index: 100;
  background: #fff; border-bottom: 1px solid #e5e5e5;
  display: flex; align-items: center;
  padding: 0 16px; height: 48px;
}
.header-left  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.header-right { flex-shrink: 0; display: flex; align-items: center; gap: 16px; }
.header-guide {
  font-size: 14px; font-weight: 600; color: #b30000;
  text-decoration: none; white-space: nowrap;
}
.header-guide:hover { text-decoration: underline; }
.feedback-btn {
  font-size: 14px; color: #1a6fd4; text-decoration: none; white-space: nowrap;
  padding: 0 4px;
}
.feedback-btn:hover { color: #0d4fa0; text-decoration: underline; }
.logo {
  font-size: 18px; font-weight: 700; letter-spacing: 0.5px;
  color: #111; text-decoration: none; white-space: nowrap;
}
.search-box {
  width: 200px; min-width: 80px; flex-shrink: 1; height: 30px;
  border: 1px solid #d0d0d0; border-radius: 6px;
  padding: 0 10px; font-size: 13px; outline: none; background: #fff;
}
.search-box:focus { border-color: #888; }
.search-box::placeholder { color: #aaa; }

/* ── LAYOUT ── */
.layout { display: flex; height: calc(100vh - 48px); }

/* ── SIDEBAR ── */
aside {
  width: 272px; min-width: 272px;
  border-right: 1px solid #e5e5e5;
  overflow-y: auto; overflow-x: hidden;
  padding: 12px 14px 32px;
}

.sort-row { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }

.sort-btn {
  height: 30px; padding: 0 12px;
  border: 1px solid #c8c8c8; border-radius: 6px;
  background: #fff; font-size: 12px; color: #111; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.sort-btn:hover { background: #f0f0f0; }
.sort-btn.active { background: #111; color: #fff; border-color: #111; }
.reset-inline-btn {
  height: 22px; padding: 0 10px;
  border: none; border-radius: 11px;
  background: #b30000; color: #fff;
  font-size: 11px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.reset-inline-btn:hover { background: #900; }

.filter-section { margin-bottom: 14px; }
.filter-title { font-size: 13px; font-weight: 600; color: #111; margin-bottom: 8px; }
.btn-group { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }

.tag-btn {
  height: 28px; padding: 0 10px;
  border: 1px solid #c8c8c8; border-radius: 6px;
  background: #fff; font-size: 12px; color: #111; cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s;
}
.tag-btn:hover { border-color: #888; }
.tag-btn.active { background: #111; color: #fff; border-color: #111; }

.input-row { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.num-input {
  height: 28px; width: 110px;
  border: 1px solid #d0d0d0; border-radius: 6px;
  padding: 0 8px; font-size: 12px; color: #111; outline: none;
  -moz-appearance: textfield;
}
.num-input::-webkit-inner-spin-button,
.num-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.num-input::placeholder { color: #aaa; }
.num-input:focus { border-color: #888; }

/* ── MAIN ── */
main {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 14px 10px 32px;
}

.result-bar {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 6px; margin-bottom: 10px; padding: 0 4px;
}
.result-count { font-size: 12px; color: #888; white-space: nowrap; }

.active-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 3px;
  height: 22px; padding: 0 8px 0 10px;
  background: #111; color: #fff;
  border-radius: 11px; font-size: 11px; white-space: nowrap;
}
.chip-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,0.2); border: none;
  color: #fff; font-size: 12px; line-height: 1;
  cursor: pointer; padding: 0; flex-shrink: 0;
}
.chip-close:hover { background: rgba(255,255,255,0.4); }

/* ── CARD GRID: 4列 ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

/* 响应式：随内容区宽度缩列 */
@media (max-width: 1200px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px)  { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .card-grid { grid-template-columns: repeat(1, 1fr); } }

/* ── CARD ── */
.case-card {
  display: block; text-decoration: none; color: inherit;
  padding: 10px 8px 14px; cursor: pointer;
  transition: background .12s; position: relative;
}
.case-card:hover { background: #fafafa; }

.case-img {
  width: 100%; aspect-ratio: 1/1;
  border-radius: 4px; overflow: hidden;
  background: #f3f3f3; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.case-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.placeholder {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 100%;
}
.ph-abbr { font-family: "SimSun", "宋体", serif; font-size: 22px; font-weight: 600; color: #bbb; text-align: center; max-width: 90%; line-height: 1.4; word-break: break-word; }


.card-meta {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 4px; gap: 4px;
}
.jiegou-tag {
  display: inline-flex; align-items: center;
  height: 20px; padding: 0 7px;
  border-radius: 4px; font-size: 11px; font-weight: 500; white-space: nowrap;
}
.tag-全塔机箱   { background: #222;    color: #fff; }
.tag-中塔机箱   { background: #778ca3; color: #fff; }
.tag-ITX机箱    { background: #20bf6b; color: #fff; }
.tag-A4机箱     { background: #4b7bec; color: #fff; }
.tag-NAS机箱    { background: #fd9644; color: #fff; }
.tag-竖立机箱   { background: #a55eea; color: #fff; }
.tag-开放式机箱 { background: #f7b731; color: #111; }
.tag-其它机箱   { background: #0fb9b1; color: #fff; }

.vol-text { font-size: 12px; color: #555; white-space: nowrap; }
.vol-text b { font-weight: 600; color: #111; }
.case-name { font-size: 13px; font-weight: 600; margin-bottom: 3px; line-height: 1.3; }
.spec-row  { font-size: 11px; color: #666; margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.spec-row > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spec-price { color: #b30000; font-weight: 600; white-space: nowrap; flex-shrink: 0; }

.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 7px; }
.meta-date { font-size: 11px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-status { font-size: 11px; font-weight: 600; white-space: nowrap; flex-shrink: 0; padding: 1px 6px; border-radius: 3px; }
.status-在售 { color: #20bf6b; background: #e8f9ef; }
.status-预售 { color: #f7b731; background: #fef5e0; }
.status-停售 { color: #888; background: #f0f0f0; }

.bar-row { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.bar-label { font-size: 11px; color: #888; width: 56px; flex-shrink: 0; white-space: nowrap; }
.bar-track { flex: 1; height: 4px; background: #e8e8e8; border-radius: 2px; overflow: hidden; }
.bar-fill  { height: 100%; background: #111; border-radius: 2px; }
.bar-val   { font-size: 11px; color: #555; width: 36px; text-align: right; flex-shrink: 0; }

/* ── 无限滚动 sentinel ── */
#sentinel { height: 40px; display: flex; align-items: center; justify-content: center; }
.spinner {
  width: 20px; height: 20px;
  border: 2px solid #e0e0e0; border-top-color: #888;
  border-radius: 50%; animation: spin .7s linear infinite;
  display: none;
}
.spinner.show { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.no-results {
  padding: 60px 0; text-align: center;
  color: #aaa; font-size: 14px; grid-column: 1/-1;
}

/* ── 响应式侧边栏 ── */
@media (max-width: 700px) {
  aside { width: 220px; min-width: 220px; }
}
@media (max-width: 520px) {
  .layout { flex-direction: column; height: auto; }
  aside {
    width: 100%; min-width: unset; height: auto;
    border-right: none; border-bottom: 1px solid #e5e5e5;
    max-height: 280px;
  }
  main { height: auto; }
}
