:root {
  --ink: #111432;
  --muted: #687087;
  --line: #d9deec;
  --paper: #ffffff;
  --page: #eef1fa;
  --panel: #f8f9fd;
  --accent: #6660d8;
  --accent-deep: #29256e;
  --mint: #dff3ec;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: 1.65;
}

button,
input { font: inherit; }

button { cursor: pointer; }

a { color: inherit; text-decoration: none; }

h1,
h2 {
  margin: 0;
  font-family: "DengXian", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-synthesis: none;
}

.library-topbar {
  padding: 10px 0 0;
}

.library-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, 100%);
  min-height: 62px;
  margin: 0 auto;
  padding: 7px 12px 7px 18px;
  background: rgba(255, 255, 255, .84);
  border: 1px solid rgba(255, 255, 255, .96);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(57, 65, 131, .09);
}

.library-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.library-brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 38px;
  height: 38px;
  background: linear-gradient(145deg, #7467f3, #91d7ed);
  border: 1px solid #fff;
  border-radius: 50%;
}

.library-brand-mark span {
  width: 4px;
  height: 14px;
  background: #fff;
  border-radius: 999px;
}

.library-brand strong,
.library-brand small { display: block; }

.library-brand strong { font-size: 15px; }

.library-brand small {
  color: var(--muted);
  font-size: 10px;
}

.library-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.library-nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: #5f667d;
  border-radius: 999px;
  font-size: 13px;
}

.library-nav-links a:hover,
.library-nav-links a:focus-visible {
  color: var(--accent-deep);
  background: #f1f2f9;
}

.library-main {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 74px 0 88px;
}

.library-home-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.library-home-return {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  color: var(--accent-deep);
  background: rgba(95, 91, 255, 0.07);
  border: 1px solid rgba(95, 91, 255, 0.2);
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(44, 42, 116, 0.06);
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.library-home-return::before,
.library-home-return::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(95, 91, 255, 0.46));
  transform: translateY(-50%);
}

.library-home-return::before { left: -52px; }
.library-home-return::after {
  right: -52px;
  transform: translateY(-50%) rotate(180deg);
}

.library-home-return:hover,
.library-home-return:focus-visible {
  color: #fff;
  background: #292d70;
  border-color: #292d70;
}

.library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .6fr);
  gap: 64px;
  align-items: end;
  margin-bottom: 42px;
}

.library-eyebrow {
  margin: 0 0 12px;
  color: #5260b4;
  font-size: 12px;
  font-weight: 800;
}

.library-hero h1 {
  font-size: clamp(48px, 6vw, 78px);
  font-weight: 700;
  line-height: 1.02;
}

.library-hero-copy {
  color: var(--muted);
  font-size: 14px;
}

.library-hero-copy p { margin: 8px 0; }

.library-hero-copy strong {
  color: var(--accent-deep);
  font-size: 28px;
}

.library-content-results {
  margin: 0 0 32px;
  padding: 20px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid #d8deef;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(52, 60, 123, .08);
}

.library-content-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  color: #667089;
  font-size: 12px;
}

.library-content-heading strong {
  color: #32385d;
  font-size: 16px;
}

.library-content-result-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.library-content-result {
  display: block;
  min-width: 0;
  padding: 15px 16px;
  color: #343a5d;
  background: #fff;
  border: 1px solid #e0e4ef;
  border-radius: 6px;
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.library-content-result:hover,
.library-content-result:focus-visible {
  background: #f5f6fc;
  border-color: #8d8ae6;
  transform: translateY(-1px);
}

.library-content-result em,
.library-content-result strong,
.library-content-result small {
  display: block;
}

.library-content-result em {
  margin-bottom: 4px;
  color: #6660d8;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.library-content-result strong {
  overflow: hidden;
  color: #252a58;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-content-result small {
  margin-top: 5px;
  overflow: hidden;
  color: #7c8298;
  font-size: 11px;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-workspace {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid #d8deef;
  border-radius: 8px;
  box-shadow: 0 30px 70px rgba(52, 60, 123, .12);
}

.library-workspace-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 20px;
  color: #667089;
  background: #f8f9fd;
  border-bottom: 1px solid #e0e4ef;
  font-size: 12px;
}

.library-workspace-bar strong {
  color: #32385d;
  font-size: 13px;
}

.library-workspace-body {
  display: grid;
  grid-template-columns: 210px 340px minmax(0, 1fr);
  min-height: 680px;
}

.library-sidebar {
  padding: 24px 14px;
  background: #f7f8fc;
  border-right: 1px solid #e0e4ef;
}

.library-sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 22px;
}

.library-sidebar-title > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.library-sidebar > p {
  margin: 0 10px 8px;
  color: #8a90a5;
  font-size: 10px;
  font-weight: 800;
}

.library-filter-list {
  display: grid;
  gap: 4px;
}

.library-filter-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: #646b82;
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-align: left;
}

.library-filter-list button:hover,
.library-filter-list button.is-active {
  color: #252a58;
  background: #e7e9f3;
  font-weight: 700;
}

.library-filter-list button span {
  color: #9298ad;
  font-size: 10px;
}

.library-sidebar .library-sidebar-note {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid #e0e4ef;
  font-weight: 400;
  line-height: 1.8;
}

.library-list-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid #e0e4ef;
}

.library-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 16px 8px 0;
}

.library-filters label {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.library-filters label > span {
  color: var(--muted);
  font-size: 12px;
}

.library-filters select {
  width: 100%;
  min-height: 42px;
  padding: 0 34px 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}

.library-filters select:focus-visible {
  outline: 3px solid rgba(102, 96, 216, .18);
  border-color: var(--accent);
}

.library-filters button {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  color: var(--accent-deep);
  background: transparent;
  border: 1px solid #cfd4e8;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
}

.library-filters button:hover,
.library-filters button:focus-visible {
  color: #fff;
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.library-list-heading {
  display: flex;
  justify-content: space-between;
  padding: 16px 16px 11px;
  color: #83899f;
  font-size: 11px;
}

.library-results {
  min-height: 0;
  max-height: 610px;
  overflow-y: auto;
}

.library-tool {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 11px 14px;
  color: #343a5d;
  background: #fff;
  border: 0;
  border-top: 1px solid #edf0f5;
  text-align: left;
}

.library-tool:hover,
.library-tool.is-active { background: #f0f2f8; }

.library-tool.is-active { box-shadow: inset 3px 0 0 var(--accent); }

.library-tool img {
  width: 44px;
  height: 44px;
  padding: 6px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e0e3ec;
  border-radius: 8px;
}

.library-tool strong,
.library-tool small { display: block; }

.library-tool strong {
  margin-bottom: 3px;
  font-size: 13px;
}

.library-tool small {
  overflow: hidden;
  color: #7c8298;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-tool > span,
.library-tool > b {
  position: relative;
  top: 2px;
}

.library-tool b {
  color: #6268ba;
  font-size: 11px;
}

.library-empty {
  margin: 0;
  padding: 34px 18px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.library-detail {
  min-width: 0;
  max-height: 680px;
  padding: 34px;
  overflow-y: auto;
  background: #fcfcfe;
}

.library-detail-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.library-detail-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 15px;
}

.library-detail-identity img {
  width: 64px;
  height: 64px;
  padding: 8px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e0e3ec;
  border-radius: 8px;
}

.library-detail h2 {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  line-height: 1.1;
}

.library-detail-identity p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.library-detail-score {
  color: var(--accent);
  font-size: 13px;
  white-space: nowrap;
}

.library-detail-description {
  margin: 28px 0 22px;
  color: #5d647d;
  font-size: 15px;
  line-height: 1.85;
}

.library-detail-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  margin: 20px 0;
}

.library-detail-tags span {
  padding: 5px 9px;
  color: #555da2;
  background: #eef0fb;
  border-radius: 999px;
  font-size: 10px;
}

.library-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #dfe3ef;
  border-left: 1px solid #dfe3ef;
}

.library-detail-grid > div {
  min-height: 112px;
  padding: 18px;
  border-right: 1px solid #dfe3ef;
  border-bottom: 1px solid #dfe3ef;
}

.library-detail-grid span,
.library-detail-grid strong { display: block; }

.library-detail-grid span {
  margin-bottom: 10px;
  color: #858ba1;
  font-size: 10px;
}

.library-detail-grid strong {
  font-size: 13px;
  line-height: 1.65;
}

.library-detail-extra {
  margin-top: 22px;
}

.library-detail-extra details {
  border: 1px solid #dfe3ef;
  border-radius: 6px;
}

.library-detail-extra details + details { margin-top: 8px; }

.library-detail-extra summary {
  padding: 13px 15px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.library-detail-extra p {
  margin: 0;
  padding: 0 15px 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-line;
}

.library-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}

.library-detail-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 15px;
  color: #343873;
  background: #fff;
  border: 1px solid #d8dcea;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.library-detail-actions a.primary {
  color: #fff;
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.library-verification {
  margin: 14px 0 0;
  color: #858ba1;
  font-size: 11px;
}

.library-footer {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 34px max(24px, calc((100% - 1180px) / 2));
  color: #c7cad7;
  background: #0c0f26;
  font-size: 11px;
}

.library-footer nav {
  display: flex;
  justify-content: center;
  gap: 18px;
}

@media (max-width: 980px) {
  .library-workspace-body {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .library-detail {
    grid-column: 1 / -1;
    max-height: none;
    border-top: 1px solid #e0e4ef;
  }

  .library-footer {
    grid-template-columns: 1fr auto;
  }

  .library-footer nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .library-home-return::before,
  .library-home-return::after { width: 24px; }

  .library-home-return::before { left: -38px; }
  .library-home-return::after { right: -38px; }

  .library-topbar { padding: 10px; }

  .library-nav {
    display: block;
    padding: 12px;
  }

  .library-nav-links {
    margin-top: 10px;
    overflow-x: auto;
  }

  .library-nav-links a { flex: 0 0 auto; }

  .library-main {
    width: min(100% - 20px, 1320px);
    padding: 48px 0 60px;
  }

  .library-hero {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .library-hero h1 { font-size: 42px; }

  .library-content-result-list { grid-template-columns: 1fr; }

  .library-workspace-body {
    display: block;
    min-height: 0;
  }

  .library-workspace-bar {
    align-items: flex-start;
    gap: 8px;
    flex-direction: column;
    padding-block: 12px;
  }

  .library-sidebar {
    border-right: 0;
    border-bottom: 1px solid #e0e4ef;
  }

  .library-sidebar-title,
  .library-sidebar > p { display: none; }

  .library-filter-list {
    display: flex;
    overflow-x: auto;
  }

  .library-filter-list button {
    flex: 0 0 auto;
    width: auto;
    gap: 12px;
    border: 1px solid #e0e4ef;
  }

  .library-list-panel { border-right: 0; }

  .library-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-inline: 0;
  }

  .library-filters button { grid-column: 1 / -1; }

  .library-results { max-height: 460px; }

  .library-detail {
    max-height: none;
    padding: 26px 16px;
  }

  .library-detail-grid { grid-template-columns: 1fr; }

  .library-footer {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .library-footer nav {
    grid-column: auto;
    grid-row: auto;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .library-filters { grid-template-columns: 1fr; }
  .library-filters button { grid-column: auto; }
}

.download-safety-note { display: grid; gap: 8px; margin-top: 14px; padding: 12px 14px; color: #5c5870; background: #fff8e8; border: 1px solid #f1d99b; border-radius: 14px; font-size: 12px; line-height: 1.65; }
.download-safety-note p { margin: 0; }
.download-safety-note a { color: #6652c7; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.download-confirm-dialog { width: min(520px, calc(100% - 32px)); padding: 0; background: transparent; border: 0; }
.download-confirm-dialog::backdrop { background: rgba(17, 20, 50, .48); backdrop-filter: blur(4px); }
.download-confirm-card { display: grid; gap: 10px; padding: 26px; color: #171936; background: #fff; border: 1px solid #d9dce8; border-radius: 22px; box-shadow: 0 24px 70px rgba(17, 20, 50, .25); }
.download-confirm-card h2, .download-confirm-card p { margin: 0; }
.download-confirm-card p { line-height: 1.75; }
.download-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.download-confirm-actions button { min-height: 42px; padding: 0 16px; border: 1px solid #d9dce8; border-radius: 999px; cursor: pointer; font-weight: 800; }
.download-confirm-actions button.primary { color: #fff; background: #25215f; border-color: #25215f; }
