:root {
  --page-bg: #f5f7fa;
  --panel-bg: #ffffff;
  --text: #172033;
  --muted: #687386;
  --line: #e2e7ee;
  --line-strong: #cfd6df;
  --primary: #2457d6;
  --primary-hover: #1d49b8;
  --primary-soft: #eef3ff;
  --container: 1680px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--page-bg);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.container {
  width: min(var(--container), calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  padding: 24px 0;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.brand-block h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: .2px;
}
.brand-block p {
  margin: 7px 0 0;
  color: var(--muted);
}
.brand-block p strong {
  color: var(--text);
  font-weight: 700;
}
.download-all-button {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 226px;
  padding: 12px 18px;
  border: 1px solid #1e4fc7;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(36, 87, 214, .16);
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.download-all-button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgba(36, 87, 214, .2);
}
.download-all-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 7px;
  background: rgba(255,255,255,.14);
}
.download-all-icon svg { width: 22px; height: 22px; }
.download-all-copy { display: flex; flex-direction: column; line-height: 1.35; }
.download-all-copy strong { font-size: 15px; }
.download-all-copy small { margin-top: 2px; color: rgba(255,255,255,.76); font-size: 12px; }

main.container { padding: 24px 0 42px; }
.controls {
  margin-bottom: 18px;
  padding: 20px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.search-row {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 210px 150px;
  gap: 16px;
  align-items: end;
}
.search-box label,
.field-box {
  display: block;
  color: #4b5668;
  font-weight: 600;
}
.input-wrap {
  position: relative;
  display: flex;
  margin-top: 7px;
}
.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  display: grid;
  place-items: center;
  color: #8b95a5;
  transform: translateY(-50%);
  pointer-events: none;
}
.search-icon svg { width: 18px; height: 18px; }
input[type="search"],
select,
.page-jump input {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  outline: none;
}
input[type="search"] {
  height: 42px;
  padding: 0 72px 0 42px;
  border-radius: 7px;
}
input[type="search"]:focus,
select:focus,
.page-jump input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(36, 87, 214, .1);
}
#clearSearch {
  position: absolute;
  right: 7px;
  top: 50%;
  height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  background: #eef1f5;
  color: #5f6a7a;
  transform: translateY(-50%);
}
.field-box select {
  display: block;
  height: 42px;
  margin-top: 7px;
  padding: 0 34px 0 12px;
  border-radius: 7px;
}

.alphabet-wrap {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 7px;
  margin-top: 20px;
}
.alphabet-filters {
  display: grid;
  grid-template-columns: repeat(27, minmax(30px, 1fr));
  gap: 7px;
}
.alphabet-button {
  min-width: 0;
  height: 34px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: #536075;
  font-weight: 600;
}
.alphabet-button:hover:not(:disabled) {
  border-color: #8da4de;
  color: var(--primary);
  background: #f8faff;
}
.alphabet-button.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}
.alphabet-button:disabled {
  cursor: default;
  color: #c2c8d1;
  background: #f7f8fa;
}
.active-filter {
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid #edf0f4;
  color: var(--muted);
}
.active-filter button {
  margin-left: 9px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-weight: 600;
}

.resource-section {
  overflow: hidden;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.list-head,
.resource-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px 82px 116px 92px;
  gap: 16px;
  align-items: center;
}
.list-head {
  padding: 12px 20px;
  background: #f7f8fa;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.resource-row {
  min-height: 68px;
  padding: 11px 20px;
  border-bottom: 1px solid #edf0f4;
}
.resource-row:last-child { border-bottom: 0; }
.resource-row:hover { background: #fafbfc; }
.resource-main {
  min-width: 0;
  display: flex;
  gap: 12px;
  align-items: center;
}
.file-mark {
  flex: 0 0 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #dae3f8;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}
.resource-info { min-width: 0; }
.resource-info h2 {
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.resource-filename {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.resource-version,
.resource-format,
.resource-size {
  overflow: hidden;
  color: #566175;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.resource-format { color: var(--muted); font-weight: 600; }
.resource-size { font-variant-numeric: tabular-nums; }
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #bfd0f7;
  border-radius: 6px;
  background: #f3f6ff;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.download-button:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.empty-state {
  padding: 64px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-state button {
  height: 36px;
  padding: 0 15px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: #fff;
  color: var(--primary);
}

.pagination-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  gap: 18px;
  align-items: center;
  padding: 17px 20px;
  border-top: 1px solid var(--line);
  background: #fbfcfd;
}
.page-summary {
  color: var(--muted);
  font-size: 13px;
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: #526074;
  font-weight: 600;
}
.pagination button:hover:not(:disabled):not(.active) {
  border-color: #8da4de;
  color: var(--primary);
  background: #f7f9ff;
}
.pagination button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.pagination button:disabled { cursor: default; opacity: .4; }
.page-ellipsis { padding: 0 2px; color: #9aa3b2; }
.page-jump {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}
.page-jump input {
  width: 62px;
  height: 36px;
  padding: 0 8px;
  border-radius: 6px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.page-jump button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
}
.page-jump button:hover { background: var(--primary-hover); }
.page-jump button svg { width: 17px; height: 17px; }

@media (max-width: 1180px) {
  .alphabet-wrap { overflow-x: auto; padding-bottom: 4px; }
  .alphabet-filters { min-width: 940px; }
  .list-head,
  .resource-row { grid-template-columns: minmax(0, 1fr) 165px 70px 96px 82px; }
  .pagination-bar { grid-template-columns: 1fr; }
  .page-summary,
  .page-jump { justify-content: center; text-align: center; }
}

@media (max-width: 760px) {
  .container { width: min(100% - 24px, var(--container)); }
  .site-header { padding: 18px 0; }
  .header-inner { align-items: stretch; flex-direction: column; gap: 16px; }
  .brand-block h1 { font-size: 23px; }
  .download-all-button { width: 100%; min-width: 0; }
  main.container { padding-top: 14px; }
  .controls { padding: 14px; }
  .search-row { grid-template-columns: 1fr; }
  .list-head { display: none; }
  .resource-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 14px;
  }
  .resource-main { grid-column: 1 / -1; }
  .resource-version { grid-column: 1 / -1; padding-left: 50px; }
  .resource-format,
  .resource-size { padding-left: 50px; }
  .download-button { grid-column: 2; grid-row: 2 / span 3; align-self: center; }
  .pagination-bar { padding: 15px 12px; }
  .pagination button { min-width: 34px; padding: 0 8px; }
}
