* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", -apple-system, sans-serif;
  background: #f5f6f8;
  color: #333;
}

header {
  background: #1a1d24;
  color: #fff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.logo {
  height: 40px;
  max-width: 200px;
  object-fit: contain;
  display: block;
}
#search {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
}
.manual-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: #d32f2f;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s;
}
.manual-btn:hover {
  background: #b71c1c;
}

/* 电脑端布局 */
.layout {
  display: grid;
  grid-template-columns: 100px 160px 1fr 200px;
  gap: 16px;
  max-width: 1700px;
  margin: 16px auto;
  padding: 0 20px;
}
.brand-sidebar.hidden {
  display: none;
}
.layout.no-brand {
  grid-template-columns: 100px 1fr 200px;
}

.left-sidebar,
.brand-sidebar,
.right-sidebar {
  background: #fff;
  border-radius: 10px;
  padding: 12px 8px;
  height: fit-content;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
}
.sidebar-title {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.letters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.letters button {
  padding: 6px 0;
  border: 1px solid #eee;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
}
.letters button:hover { background: #f0f0f0; }
.letters button.active { background: #1a1d24; color: #fff; border-color: #1a1d24; }
.letters button.disabled { opacity: .3; cursor: default; }

.brands {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding-right: 4px;
}
.brands button {
  flex-shrink: 0;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid #eee;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  transition: all .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brands button:hover { background: #f0f0f0; }
.brands button.active { background: #1a1d24; color: #fff; border-color: #1a1d24; }

.countries {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding-right: 4px;
}
.countries button {
  flex-shrink: 0;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #eee;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  transition: all .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.countries button:hover { background: #f0f0f0; }
.countries button.active { background: #1a1d24; color: #fff; border-color: #1a1d24; }

.stats {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
}
.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.card {
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  transition: all .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  border: 1px solid #eee;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.1);
}
.card img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: #fafafa;
  border-radius: 6px;
}
.card .brand { font-size: 11px; color: #999; margin-top: 6px; }
.card .model {
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 24px 0;
  flex-wrap: wrap;
}
.pagination button {
  padding: 6px 12px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.pagination button:hover { background: #f0f0f0; }
.pagination button.active { background: #1a1d24; color: #fff; }

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.modal.open { display: flex; }
.modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  padding: 28px;
  position: relative;
}
.close {
  position: absolute;
  right: 20px;
  top: 16px;
  font-size: 28px;
  cursor: pointer;
  color: #999;
}
.close:hover { color: #000; }

.modal h2 { font-size: 22px; margin-bottom: 8px; padding-right: 40px; }
.modal .meta { color: #888; font-size: 14px; margin-bottom: 16px; }
.modal .desc {
  background: #f7f8fa;
  padding: 14px;
  border-radius: 8px;
  white-space: pre-wrap;
  line-height: 1.6;
  margin-bottom: 20px;
  font-size: 14px;
}
.modal .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.modal .gallery img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #fafafa;
  border-radius: 6px;
  cursor: pointer;
}
.modal video {
  width: 100%;
  max-height: 500px;
  border-radius: 8px;
  margin-bottom: 12px;
  background: #000;
}
.modal .pdf-btn {
  display: inline-block;
  padding: 10px 20px;
  background: #d32f2f;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  margin-right: 8px;
  margin-bottom: 8px;
  transition: background .15s;
}
.modal .pdf-btn:hover {
  background: #b71c1c;
}

/* ? 手机端适配 */
@media (max-width: 900px) {

  /* 顶栏 */
  header {
    padding: 8px 10px;
    gap: 6px;
    flex-wrap: wrap;
  }
  .logo { height: 28px; max-width: 120px; }
  .manual-btn {
    padding: 6px 12px;
    font-size: 12px;
    margin-left: auto;
  }
  #search {
    flex: 0 0 100%;
    min-width: 0;
    order: 3;
    padding: 8px 12px;
    font-size: 14px;
  }

  /* 主体：单列 */
  .layout {
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 8px;
  }

  /* ===== 字母面板（可折叠，order 1） ===== */
  .left-sidebar {
    order: 1;
    position: static;
    max-height: none;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
  }
  .left-sidebar .sidebar-title {
    cursor: pointer;
    padding: 10px 12px;
    margin: 0;
    font-size: 13px;
    color: #333;
    background: #f0f0f0;
    border-bottom: none;
    text-align: left;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .left-sidebar .sidebar-title::after {
    content: "?";
    font-size: 12px;
    color: #999;
    transition: transform .2s;
  }
  .left-sidebar.expanded .sidebar-title {
    background: #1a1d24;
    color: #fff;
  }
  .left-sidebar.expanded .sidebar-title::after {
    color: #fff;
    transform: rotate(90deg);
  }
  .left-sidebar .letters {
    display: none;
    padding: 8px;
  }
  .left-sidebar.expanded .letters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .left-sidebar .letters button {
    flex: 0 0 32px;
    padding: 6px 0;
    font-size: 13px;
  }

  /* ===== 国家面板（可折叠，order 2） ===== */
  .right-sidebar {
    order: 2;
    position: static;
    max-height: none;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
  }
  .right-sidebar .sidebar-title {
    cursor: pointer;
    padding: 10px 12px;
    margin: 0;
    font-size: 13px;
    color: #333;
    background: #f0f0f0;
    border-bottom: none;
    text-align: left;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .right-sidebar .sidebar-title::after {
    content: "?";
    font-size: 12px;
    color: #999;
    transition: transform .2s;
  }
  .right-sidebar.expanded .sidebar-title {
    background: #1a1d24;
    color: #fff;
  }
  .right-sidebar.expanded .sidebar-title::after {
    color: #fff;
    transform: rotate(90deg);
  }
  .right-sidebar .countries {
    display: none;
    padding: 8px;
    flex-direction: column;
    gap: 4px;
    max-height: 250px;
    overflow-y: auto;
  }
  .right-sidebar.expanded .countries {
    display: flex;
  }
  .right-sidebar .countries button {
    flex: 0 0 auto;
    min-height: 26px;
    padding: 5px 10px;
    font-size: 12px;
    text-align: left;
  }

  /* ===== 品牌栏（横向滚动，order 3） ===== */
  .brand-sidebar {
    order: 3;
    position: static;
    max-height: none;
    padding: 8px;
    border-radius: 8px;
  }
  .brands {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    max-height: none;
    padding-bottom: 4px;
  }
  .brands button {
    flex: 0 0 auto;
    min-height: 26px;
    padding: 5px 10px;
    font-size: 12px;
    white-space: nowrap;
  }

  /* ===== 相机列表（order 4） ===== */
  main {
    order: 4;
  }
  .list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }
  .card {
    padding: 3px;
    border-radius: 6px;
  }
  .card img {
    height: 60px;
    border-radius: 3px;
  }
  .card .brand { font-size: 9px; margin-top: 3px; line-height: 1.2; }
  .card .model {
    font-size: 10px;
    line-height: 1.2;
    -webkit-line-clamp: 2;
  }

  .stats {
    font-size: 13px;
    margin-bottom: 8px;
  }

  /* 分页 */
  .pagination {
    gap: 4px;
    margin: 16px 0;
  }
  .pagination button {
    padding: 5px 9px;
    font-size: 12px;
  }

  /* 弹窗 */
  .modal {
    padding: 0;
    align-items: flex-start;
  }
  .modal-content {
    border-radius: 0;
    padding: 16px;
    min-height: 100vh;
  }
  .close { right: 12px; top: 8px; }
  .modal h2 { font-size: 18px; padding-right: 30px; }
  .modal .meta { font-size: 12px; margin-bottom: 12px; }
  .modal .desc { font-size: 13px; padding: 10px; }
  .modal .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .modal .gallery img { height: 130px; }
  .modal video { max-height: 300px; }
  .modal .pdf-btn {
    padding: 8px 14px;
    font-size: 13px;
  }
}