:root {
  color-scheme: light;
  --navy: #0b1f3a;
  --navy-2: #12345b;
  --blue: #1267e8;
  --blue-soft: #eaf2ff;
  --cyan: #1db5c9;
  --ink: #142033;
  --muted: #68758a;
  --line: #dfe5ee;
  --surface: #fff;
  --bg: #f5f7fa;
  --green: #16794b;
  --shadow: 0 16px 40px rgba(9, 30, 66, .08);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { min-height: 100vh; margin: 0; display: flex; flex-direction: column; color: var(--ink); background: var(--bg); font-family: Inter, "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif; }
main { flex: 1 0 auto; }
footer { flex: 0 0 auto; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.site-header { color: #fff; background: var(--navy); border-bottom: 1px solid rgba(255,255,255,.08); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg, var(--blue), var(--cyan)); font-size: 21px; font-weight: 800; box-shadow: 0 8px 20px rgba(18,103,232,.35); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: .08em; }
.brand small { margin-top: 2px; color: #9db0c9; font-size: 9px; letter-spacing: .18em; }
.header-inner nav { display: flex; align-items: center; gap: 28px; color: #c7d3e3; font-size: 14px; }
.header-inner nav a { padding: 25px 0; border-bottom: 2px solid transparent; }
.header-inner nav a:hover { color: #fff; border-color: var(--cyan); }

.hero { color: #fff; background: radial-gradient(circle at 78% 10%, rgba(29,181,201,.23), transparent 30%), linear-gradient(118deg, var(--navy) 0%, var(--navy-2) 100%); }
.hero-inner { min-height: 272px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 72px; padding-top: 40px; padding-bottom: 46px; }
.eyebrow { color: #75d8e5; font-size: 11px; font-weight: 700; letter-spacing: .22em; }
.hero h1 { margin: 12px 0 12px; font-size: clamp(30px, 4vw, 46px); line-height: 1.12; letter-spacing: -.03em; }
.hero p { max-width: 560px; margin: 0; color: #bdcce0; font-size: 16px; line-height: 1.8; }
.hero-search { padding: 24px; border: 1px solid rgba(255,255,255,.13); border-radius: 18px; background: rgba(255,255,255,.07); backdrop-filter: blur(8px); }
.hero-search label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 700; }
.search-box { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; border-radius: 11px; background: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.14); }
.search-box > span { color: var(--blue); font-size: 25px; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box kbd { padding: 4px 6px; border: 1px solid #d6dde8; border-bottom-width: 2px; border-radius: 5px; color: #758195; background: #f6f8fb; font-size: 9px; }
.hero-search small { display: block; margin-top: 9px; color: #9fb2ca; }

.content { padding-top: 28px; padding-bottom: 60px; }
.status-banner { margin-bottom: 18px; padding: 13px 16px; border: 1px solid #f3d7a1; border-radius: 9px; color: #73510b; background: #fff8e8; font-size: 14px; }
.toolbar-top { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; }
.breadcrumbs a:hover { color: var(--blue); }
.breadcrumbs .current { color: var(--ink); font-weight: 700; }
.breadcrumbs .sep { color: #aab4c2; }
.summary { color: var(--muted); font-size: 13px; }

.resource-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.panel-controls { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.filters { display: flex; gap: 6px; }
.filters button { padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.filters button:hover { color: var(--blue); background: var(--blue-soft); }
.filters button.active { color: #fff; background: var(--blue); box-shadow: 0 5px 12px rgba(18,103,232,.22); }
.sort-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.sort-control select { padding: 8px 30px 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; outline: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { padding: 12px 14px; color: #778397; background: #f7f9fc; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
td { padding: 16px 14px; border-top: 1px solid #edf0f4; vertical-align: middle; font-size: 13px; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #f9fbff; }
th:nth-child(1) { width: 31%; }
th:nth-child(2) { width: 14%; }
th:nth-child(3) { width: 9%; }
th:nth-child(4) { width: 13%; }
th:nth-child(5) { width: 22%; }
th:nth-child(6) { width: 11%; }
.file-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-icon { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-weight: 800; font-size: 13px; }
.file-icon.folder { color: #a46c00; background: #fff4d8; }
.file-name { display: block; overflow-wrap: anywhere; color: var(--ink); font-weight: 700; line-height: 1.45; }
.file-name:hover { color: var(--blue); }
.file-desc { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-block; margin: 2px 3px 2px 0; padding: 3px 7px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 700; }
.badge.stable { color: var(--green); background: #e8f7ef; }
.badge.beta { color: #9b5c00; background: #fff3d7; }
.muted { color: var(--muted); }
.md5 { display: flex; align-items: center; gap: 7px; }
.md5 code { overflow: hidden; color: #516077; font-family: Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.copy-btn { flex: none; padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #fff; cursor: pointer; }
.copy-btn:hover { color: var(--blue); border-color: #a9c8fa; }
.action-col, td:last-child { text-align: right; }
.download-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; border: 1px solid #bcd2f6; border-radius: 8px; color: var(--blue); background: #f4f8ff; font-weight: 700; }
.download-btn:hover { color: #fff; border-color: var(--blue); background: var(--blue); }
.empty-state { padding: 70px 20px; text-align: center; }
.empty-state > span { display: inline-grid; width: 56px; height: 56px; place-items: center; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-size: 28px; }
.empty-state h2 { margin: 15px 0 6px; font-size: 18px; }
.empty-state p { margin: 0; color: var(--muted); }

footer { color: #96a8be; background: #09182c; }
.footer-inner { min-height: 108px; display: flex; align-items: center; justify-content: space-between; gap: 30px; font-size: 12px; }
.footer-inner strong, .footer-inner span { display: block; }
.footer-inner strong { margin-bottom: 5px; color: #fff; font-size: 14px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; transform: translateY(20px); padding: 11px 16px; border-radius: 9px; color: #fff; background: #142033; box-shadow: 0 12px 30px rgba(0,0,0,.22); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .hero { padding: 16px 0; }
  th:nth-child(2), td:nth-child(2), th:nth-child(5), td:nth-child(5) { display: none; }
  th:nth-child(1) { width: 45%; }
  th:nth-child(3) { width: 14%; }
  th:nth-child(4) { width: 22%; }
  th:nth-child(6) { width: 19%; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 1180px); }
  .header-inner { min-height: 64px; }
  .header-inner nav { display: none; }
  .hero-inner { min-height: auto; padding-top: 34px; padding-bottom: 34px; }
  .hero-search { padding: 16px; }
  .toolbar-top, .panel-controls, .footer-inner { align-items: flex-start; flex-direction: column; }
  .toolbar-top { gap: 9px; }
  .panel-controls { gap: 14px; }
  .sort-control { width: 100%; justify-content: space-between; }
  table, thead, tbody, tr, td { display: block; }
  thead { display: none; }
  tbody tr { padding: 15px; border-top: 1px solid var(--line); }
  tbody tr:first-child { border-top: 0; }
  td { display: flex !important; align-items: center; justify-content: space-between; min-height: 34px; padding: 4px 0; border: 0; text-align: left !important; }
  td:first-child { display: block !important; padding-bottom: 10px; }
  td:nth-child(2)::before { content: "版本"; color: var(--muted); }
  td:nth-child(3)::before { content: "大小"; color: var(--muted); }
  td:nth-child(4)::before { content: "更新"; color: var(--muted); }
  td:nth-child(5) { display: none !important; }
  td:last-child { padding-top: 10px; }
  .download-btn { width: 100%; }
  .footer-inner { justify-content: center; padding: 25px 0; }
}

/* Complete responsive layout: preserve every resource field on smaller screens. */
.file-cell > div {
  min-width: 0;
  flex: 1;
}

.file-name,
.breadcrumbs a,
.breadcrumbs .current {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.md5 {
  min-width: 0;
  max-width: 100%;
}

.md5 code {
  min-width: 0;
}

.hero-search,
.search-box,
.breadcrumbs,
.resource-panel,
.panel-controls,
.table-wrap {
  min-width: 0;
  max-width: 100%;
}

.search-box input {
  width: 0;
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .toolbar-top,
  .panel-controls,
  .footer-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .filters {
    flex-wrap: wrap;
  }

  .sort-control {
    width: 100%;
    justify-content: space-between;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none !important;
  }

  tbody tr {
    padding: 16px;
    border-top: 1px solid var(--line);
  }

  tbody tr:first-child {
    border-top: 0;
  }

  td,
  td:nth-child(2),
  td:nth-child(3),
  td:nth-child(4),
  td:nth-child(5),
  td:nth-child(6) {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    min-height: 36px;
    padding: 6px 0;
    border: 0;
    text-align: left !important;
  }

  td:first-child {
    display: block !important;
    padding-bottom: 14px;
  }

  td:nth-child(2)::before {
    content: "版本 / 状态";
    flex: none;
    color: var(--muted);
  }

  td:nth-child(3)::before {
    content: "大小";
    flex: none;
    color: var(--muted);
  }

  td:nth-child(4)::before {
    content: "更新时间";
    flex: none;
    color: var(--muted);
  }

  td:nth-child(5)::before {
    content: "MD5";
    flex: none;
    color: var(--muted);
  }

  td:nth-child(5) .md5 {
    width: min(75%, 460px);
    justify-content: flex-end;
  }

  td:nth-child(5) .md5 code {
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: right;
  }

  td:last-child {
    padding-top: 12px;
  }

  .download-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .shell {
    width: calc(100% - 20px);
    max-width: calc(100% - 20px);
  }

  .hero h1 {
    font-size: 29px;
  }

  .hero-search {
    padding: 14px;
    overflow: hidden;
  }

  .breadcrumbs {
    width: 100%;
  }

  .breadcrumbs a,
  .breadcrumbs .current {
    min-width: 0;
    max-width: 100%;
  }

  .search-box kbd {
    display: none;
  }

  td:nth-child(5) {
    display: block !important;
  }

  td:nth-child(5)::before {
    display: block;
    margin-bottom: 7px;
  }

  td:nth-child(5) .md5 {
    width: 100%;
    justify-content: space-between;
  }

  td:nth-child(5) .md5 code {
    text-align: left;
  }
}
