:root {
  --bg: #f3f5fa;
  --card: #ffffff;
  --text: #151826;
  --muted: #6f778b;
  --line: #e8ecf4;
  --blue: #1f6cff;
  --blue-dark: #144fd7;
  --orange: #ff8a21;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  width: 90%;
  margin: 0 auto;
}

.pc-main {
  padding: 18px 0 30px;
}

.crumb {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.crumb a {
  color: #4d5c83;
  text-decoration: none;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(32, 53, 90, 0.06);
}

.title-card {
  padding: 16px 18px;
  margin-bottom: 14px;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.title-row h1 {
  margin: 0;
  font-size: 26px;
}

.title-row p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.search-wrap-mini {
  min-width: 360px;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.search-wrap-mini input {
  flex: 1;
  border: 0;
  padding: 10px 12px;
  outline: none;
}

.search-wrap-mini button {
  border: 0;
  padding: 0 16px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.level-panel {
  padding: 12px;
  margin-bottom: 14px;
}

.row {
  display: grid;
  grid-template-columns: 98px 1fr;
  gap: 10px;
  padding: 8px 6px;
  align-items: start;
}

.row + .row {
  border-top: 1px dashed #e6ebf7;
}

.row-label {
  font-weight: 700;
  color: #334165;
  font-size: 14px;
  padding-top: 4px;
}

.row-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.options-wrap {
  flex: 1;
  min-width: 0;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.options.is-collapsed {
  max-height: 40px;
  overflow: hidden;
}

.pill {
  font-size: 13px;
  color: #4f5c7a;
  border: 1px solid #d9e3f7;
  background: #f8fbff;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill:hover {
  border-color: #9fc0ff;
  color: #2359d5;
}

.pill.active {
  border-color: #2e6ef3;
  background: #edf3ff;
  color: #174ccc;
  font-weight: 700;
}

.row-toggle {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  margin-top: 2px;
  border: 1px solid #d9e3f7;
  border-radius: 999px;
  background: #fff;
  color: #4f5c7a;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.row-toggle:hover {
  border-color: #9fc0ff;
  color: #2359d5;
  background: #f4f8ff;
}

.row-toggle[hidden] {
  display: none;
}

.row-toggle-icon {
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.2s ease;
}

.row-toggle.is-expanded .row-toggle-icon {
  transform: rotate(225deg) translateY(-1px);
}

.content-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 14px;
}

.side-box {
  padding: 14px;
}

.side-box h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-list li {
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: #425074;
  cursor: pointer;
}

.side-list li:hover {
  background: #f2f7ff;
  color: #1d54d3;
}

.side-list .active {
  background: #eaf2ff;
  color: #1950cd;
  font-weight: 700;
}

.products-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toolbar {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #5e6b8a;
}

.toolbar strong {
  color: #1c2f61;
}

.sort-links {
  display: flex;
  gap: 12px;
}

.sort-links a {
  text-decoration: none;
  color: #5e6b8a;
}

.sort-links .active {
  color: #2359d5;
  font-weight: 700;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.mobile-load-state,
.mobile-load-trigger {
  display: none;
}

.product {
  position: relative;
  overflow: hidden;
  padding: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.product:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(22, 42, 84, 0.14);
}

.product:active {
  transform: scale(0.98);
}

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 14px rgba(255, 138, 33, 0.22);
}

.thumb {
  margin: 0 0 10px;
  height: 168px;
  border-radius: 10px;
}

.thumb.blue {
  background: linear-gradient(145deg, #d7e7ff, #9ec2ff);
}

.thumb.yellow {
  background: linear-gradient(145deg, #ffe157, #ffbe21);
}

.thumb.gray {
  background: linear-gradient(145deg, #f1f3f7, #cfd6e4);
}

.product h4 {
  margin: 0;
  font-size: 13px;
  min-height: 52px;
  display: flex;
  align-items: center;
}

.product p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  min-height: 52px;
  display: flex;
  align-items: center;
}

.product strong {
  display: none;
}

.pager-bar {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  padding: 12px 10px;
  border: 1px solid #e8ecf4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(32, 53, 90, 0.04);
}

.pg-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 11px;
  border: 1px solid #dfe6f7;
  background: #fff;
  color: #4f5c7a;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.18s ease;
}

.pg-btn:hover:not(:disabled) {
  border-color: #a8c2ff;
  color: #1f6cff;
  background: #f3f7ff;
}

.pg-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pg-btn.active {
  border-color: #ff8a21;
  background: linear-gradient(145deg, #ff9d38, #ff7f1b);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(255, 138, 33, 0.28);
}

.pg-ellipsis {
  padding: 0 6px;
  color: #9aa3b8;
  user-select: none;
}

.pg-jump {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  color: #6f778b;
  font-size: 13px;
}

.pg-jump input {
  width: 62px;
  height: 36px;
  border: 1px solid #dfe6f7;
  border-radius: 8px;
  padding: 0 8px;
  outline: none;
  text-align: center;
  color: #364469;
}

.pg-jump input:focus {
  border-color: #ffb57c;
  box-shadow: 0 0 0 3px rgba(255, 138, 33, 0.12);
}

.pg-confirm {
  min-width: auto;
  padding: 0 14px;
}

@media (max-width: 1120px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-wrap-mini {
    min-width: 100%;
    width: 100%;
  }

  .content-layout {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .row-content {
    gap: 8px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-grid.is-mobile-waterfall {
    display: block;
    column-count: 2;
    column-gap: 10px;
  }

  .product-grid.is-mobile-waterfall > a,
  .product-grid.is-mobile-waterfall > p {
    display: block;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin: 0 0 10px;
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 24px);
  }

  .pc-main {
    padding: 14px 0 24px;
  }

  .title-card,
  .level-panel,
  .side-box,
  .toolbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .title-row {
    gap: 10px;
  }

  .title-row h1 {
    font-size: 22px;
  }

  .search-wrap-mini {
    min-width: 0;
    width: 100%;
    flex-direction: column;
  }

  .search-wrap-mini button {
    min-height: 42px;
  }

  .toolbar,
  .sort-links {
    flex-direction: column;
    align-items: flex-start;
  }

  .pager-bar {
    display: none;
  }

  .pg-jump {
    display: inline-grid;
    grid-template-columns: auto 62px auto auto;
    align-items: center;
    gap: 8px;
    width: auto;
    max-width: 100%;
    margin-left: 0;
    color: #6f778b;
    font-size: 13px;
  }

  .pg-jump-label {
    white-space: nowrap;
  }

  .pg-jump {
    justify-content: center;
  }

  .product {
    padding: 10px;
  }

  .thumb {
    margin: 8px 0;
    height: 132px;
  }

  .product h4 {
    min-height: 40px;
    font-size: 14px;
    line-height: 1.4;
    align-items: flex-start;
  }

  .product p {
    min-height: 38px;
    font-size: 12px;
    line-height: 1.5;
    align-items: flex-start;
  }

  .mobile-load-state {
    display: block;
    padding: 8px 6px 2px;
    text-align: center;
    color: #6f778b;
    font-size: 12px;
  }

  .mobile-load-trigger {
    display: block;
    width: 100%;
    height: 2px;
  }
}

@media (max-width: 420px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .product-grid.is-mobile-waterfall {
    column-gap: 8px;
  }

  .product-grid.is-mobile-waterfall > a,
  .product-grid.is-mobile-waterfall > p {
    margin-bottom: 8px;
  }

  .product {
    padding: 8px;
  }

  .thumb {
    height: 116px;
    border-radius: 8px;
  }

  .product h4 {
    min-height: 36px;
    font-size: 13px;
  }

  .product p {
    min-height: 34px;
    font-size: 11px;
  }

  .pager-bar {
    gap: 8px;
  }

  .pg-jump {
    grid-template-columns: auto 56px auto auto;
    gap: 6px;
  }

  .pg-jump input {
    width: 56px;
  }

  .pg-confirm {
    padding: 0 12px;
  }
}
