: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;
}

.fd-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);
}

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

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

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

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

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

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

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

.filter-panel {
  padding: 12px;
  margin-top: 12px;
}

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

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

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

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

.chip {
  border: 1px solid #d9e3f7;
  background: #f8fbff;
  color: #4f5c7a;
  font-size: 13px;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

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

.layout {
  margin-top: 14px;
  display: block;
}

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

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

.toolbar strong {
  color: #1c2f61;
}

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

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

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

.factory-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.factory-card {
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 120px 1fr 250px;
  gap: 18px;
  align-items: start;
  transform: translateY(0);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.fd-top-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: -4px;
}

.fd-top-actions-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.fd-top-btn {
  border: 1px solid #dde4f5;
  background: #fff;
  color: #5f6b86;
  border-radius: 999px;
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  line-height: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fd-top-btn:hover {
  border-color: #b9c8ec;
  color: #2e4f9f;
  background: #f7faff;
}

.fd-top-btn.is-active {
  border-color: #f4c76b;
  color: #9a6a05;
  background: #fff7df;
}

.fd-btn-ico {
  font-size: 12px;
  line-height: 1;
}

.factory-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 22px rgba(22, 42, 84, 0.1);
}

.fd-left {
  display: flex;
  align-items: flex-start;
  min-height: 120px;
}

.logo {
  width: 104px;
  height: 74px;
  border-radius: 10px;
  background: #f4f5f8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #575d6d;
  font-weight: 800;
  font-size: 20px;
}

.fd-center h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.fd-desc {
  margin: 12px 0 0;
  color: #6f7481;
  font-size: 13px;
  line-height: 1.35;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fd-socials {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fd-social {
  width: 25px;
  height: 25px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: lowercase;
}

.fd-social.muted {
  background: #eceef2;
  color: #d4d7de;
}

.fd-social.active {
  background: #1677c6;
  color: #fff;
}

.fd-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-height: 120px;
}

.fd-badge {
  padding: 3px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff9a5d, #ff6d5d);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.fd-facts {
  width: 100%;
  max-width: 240px;
}

.fd-facts div {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.fd-facts span {
  color: #5e6472;
  font-size: 12px;
}

.fd-facts b {
  margin: 0;
  text-align: right;
  color: #2c303a;
  font-size: 12px;
  font-weight: 500;
}

.btn {
  border-radius: 999px;
  padding: 0 28px;
  height: 42px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  min-width: 154px;
}

.btn.ghost-yellow {
  border: 1px solid #e3d963;
  color: #d1c83f;
  background: #fff;
}

.pager-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

.pg-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #dbe5fb;
  border-radius: 10px;
  background: #fff;
  color: #425074;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pg-btn:hover:not(:disabled) {
  border-color: #9fbfff;
  color: #2158d3;
  box-shadow: 0 4px 12px rgba(33, 88, 211, 0.12);
}

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

.pg-btn.active {
  border-color: #2e6ef3;
  background: linear-gradient(135deg, #2f72f6, #1f5fdb);
  color: #fff;
  box-shadow: 0 6px 14px rgba(35, 89, 213, 0.24);
}

.pg-arrow {
  font-weight: 700;
}

.pg-ellipsis {
  color: #8c97b5;
  padding: 0 2px;
  user-select: none;
}

.pg-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}

.pg-jump-label {
  color: #6f778b;
  font-size: 12px;
}

.pg-jump input {
  width: 62px;
  height: 34px;
  border: 1px solid #dbe5fb;
  border-radius: 10px;
  padding: 0 10px;
  text-align: center;
  color: #334165;
  background: #fff;
  outline: none;
}

.pg-jump input:focus {
  border-color: #8fb5ff;
  box-shadow: 0 0 0 3px rgba(47, 114, 246, 0.12);
}

.pg-confirm {
  min-width: 52px;
}

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

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

  .factory-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .fd-top-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: 0;
  }

  .fd-right {
    align-items: flex-start;
  }

  .fd-facts div {
    grid-template-columns: 88px 1fr;
  }

  .fd-facts b {
    text-align: left;
  }

  .fd-center h3 {
    font-size: 26px;
  }

  .fd-desc {
    font-size: 16px;
  }

  .btn {
    font-size: 16px;
  }
}

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

  .pager-bar {
    gap: 10px;
    padding: 12px 10px;
  }

  .pg-jump {
    width: auto;
    max-width: 100%;
    justify-content: center;
    margin-left: 0;
    flex-direction: row;
    flex-wrap: nowrap;
  }
}

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

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

  .hero-card,
  .filter-panel,
  .toolbar {
    padding-left: 14px;
    padding-right: 14px;
  }

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

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

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

  .factory-card {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px 12px;
    padding: 16px 14px;
    align-items: start;
  }

  .toolbar,
  .sort,
  .fd-top-actions,
  .fd-top-actions-right {
    flex-direction: column;
    align-items: flex-start;
  }

  .pager-bar {
    justify-content: center;
  }

  .fd-top-actions {
    grid-column: 1 / -1;
    gap: 10px;
    margin-bottom: 0;
  }

  .fd-badge {
    align-self: flex-start;
    padding: 5px 12px;
    font-size: 11px;
  }

  .fd-top-actions-right {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .fd-top-btn {
    justify-content: center;
    min-width: 0;
    min-height: 38px;
    height: auto;
    padding: 8px 6px;
    border-radius: 12px;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
  }

  .fd-left {
    min-height: 0;
  }

  .logo {
    width: 88px;
    height: 88px;
    border-radius: 16px;
    font-size: 18px;
  }

  .fd-center {
    min-width: 0;
    padding-top: 2px;
  }

  .pg-jump {
    display: inline-grid;
    grid-template-columns: auto 62px auto auto;
    align-items: center;
    gap: 8px;
  }

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

  .pg-jump input,
  .pg-confirm {
    width: auto;
  }

  .fd-cover {
    width: 100%;
    max-width: none;
  }

  .fd-center h3 {
    font-size: 19px;
    line-height: 1.35;
  }

  .fd-desc {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.55;
  }

  .fd-socials {
    margin-top: 10px;
    gap: 6px;
  }

  .fd-social {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 14px;
  }

  .fd-right {
    grid-column: 1 / -1;
    max-width: none;
    gap: 12px;
  }

  .fd-facts {
    max-width: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .fd-facts div {
    grid-template-columns: 1fr;
    gap: 4px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fbff, #f3f7fd);
    border: 1px solid #e7edf8;
  }

  .fd-facts span {
    font-size: 11px;
  }

  .fd-facts b {
    text-align: left;
    font-size: 13px;
    font-weight: 700;
  }

  .btn {
    width: 100%;
    min-width: 0;
    min-height: 46px;
  }

  .btn.ghost-yellow {
    border-color: #ead873;
    color: #9d8300;
    background: linear-gradient(180deg, #fffef4, #fff8d9);
  }
}

@media (max-width: 420px) {
  .factory-card {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .fd-top-actions-right {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fd-top-btn:first-child {
    grid-column: 1 / -1;
  }

  .logo {
    width: 76px;
    height: 76px;
    border-radius: 14px;
  }

  .fd-center h3 {
    font-size: 18px;
  }

  .fd-facts {
    grid-template-columns: 1fr;
  }
}
