:root {
  color-scheme: light;
  --ink: #162138;
  --muted: #53627a;
  --line: #e3e8f2;
  --blue: #244fe2;
  --blue-dark: #163cc6;
  --surface: #fff;
  --page: #f7f8fc;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Hiragino Sans GB", system-ui, sans-serif;
  line-height: 1.55;
  background-color: var(--page);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #7ca3ff;
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
}
.icon svg { display: block; width: 100%; height: 100%; }
.shell { width: min(1200px, calc(100% - 80px)); margin-inline: auto; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 72px; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 11px; width: max-content; font-size: 1.19rem; font-weight: 750; letter-spacing: -.025em; }
.top-nav { display: flex; justify-content: center; align-self: stretch; gap: 37px; }
.nav-link { display: grid; place-items: center; position: relative; min-width: 54px; font-weight: 600; font-size: .9375rem; color: var(--muted); white-space: nowrap; }
.nav-link:hover, .nav-link.is-current { color: var(--blue); }
.nav-link.is-current::after { content: ""; position: absolute; height: 2px; background: var(--blue); border-radius: 2px 2px 0 0; inset: auto 6px -1px; }
.favorite-link {
  display: inline-flex;
  justify-self: end;
  align-items: center;
  gap: 7px;
  color: #344565;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
}
.favorite-link .icon { width: 17px; height: 17px; }
.favorite-link:hover, .favorite-link[aria-pressed="true"] { border-color: #becdff; color: var(--blue); background: #f3f6ff; }
.favorite-count { padding-inline: 5px; min-width: 19px; border-radius: 20px; background: #e6edff; color: var(--blue-dark); text-align: center; font-size: .75rem; }

.page { padding-top: 31px; padding-bottom: 62px; }
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 308px;
  overflow: hidden;
  align-items: center;
  border-radius: 20px;
  background: linear-gradient(109deg, #163abf 1%, #1c47d4 43%, #2858df 100%);
  color: white;
}
.hero-grid {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(circle, #c7d8ff 1px, transparent 1.5px) 0 0 / 19px 19px;
  opacity: .22;
  mask-image: linear-gradient(90deg, transparent 31%, black 100%);
}
.hero-image {
  position: absolute;
  z-index: -1;
  width: min(52%, 602px);
  height: auto;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  mask-image: radial-gradient(ellipse 49% 46% at 51% 50%, black 60%, transparent 100%);
}
.hero-content { position: relative; padding: 36px 0 39px 58px; max-width: 65%; }
.hero-kicker { display: flex; align-items: center; gap: 8px; color: #e0e9ff; font-size: .875rem; font-weight: 600; letter-spacing: .085em; }
.hero-kicker .icon { width: 17px; height: 17px; }
.hero h1 { font-size: clamp(2.05rem, 4.12vw, 3.55rem); font-weight: 780; line-height: 1.2; margin-top: 11px; letter-spacing: -.047em; }
.hero-description { margin-top: 15px; font-size: 1rem; color: #e4edff; letter-spacing: .015em; }
.search {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 5px 5px 5px 15px;
  width: min(100%, 491px);
  margin-top: 25px;
  min-height: 53px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 6px 20px #0d2e9b4a;
}
.search-icon { color: #65758f; }
.search input { flex: 1; width: 0; min-width: 0; min-height: 36px; padding: 0; font-size: 1rem; color: var(--ink); background: transparent; border: 0; }
.search input::placeholder { color: #65738b; opacity: 1; font-size: .875rem; }
.search input:focus-visible { outline: 0; }
.search:focus-within { outline: 2px solid #adcbff; outline-offset: 3px; }
.search button, .action-primary {
  flex: none;
  appearance: none;
  border: 1px solid transparent;
  background: var(--blue);
  color: #fff;
  font-size: .9375rem;
  font-weight: 680;
  border-radius: 7px;
  padding: 9px 18px;
}
.search button:hover, .action-primary:hover { background: var(--blue-dark); }

.categories { margin-top: 24px; }
.category-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.category-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: #34425c;
  padding: 12px 13px;
  min-height: 63px;
  border-radius: 11px;
  font-size: .9375rem;
  font-weight: 650;
  white-space: nowrap;
  text-align: left;
  transition: border-color .18s, background-color .18s, color .18s;
}
.category-button:hover { border-color: #aec1ff; }
.category-button[aria-pressed="true"] { border-color: #a5baff; color: var(--blue-dark); background: #edf2ff; }
.category-symbol { width: 34px; height: 34px; border-radius: 8px; }
.tone-blue { color: #244fda; background: #e9efff; }
.tone-indigo { color: #4d45b5; background: #eeedff; }
.tone-violet { color: #7041b9; background: #f2ebfc; }
.tone-green { color: #15775c; background: #e8f7ef; }
.tone-amber { color: #9c5811; background: #fff2de; }
.tone-rose { color: #a23162; background: #fcecf3; }
.tone-cyan { color: #14758a; background: #e6f6fa; }
.category-symbol svg { width: 18px; height: 18px; }

.catalog { margin-top: 35px; scroll-margin-top: 18px; }
.catalog-header { display: flex; align-items: end; justify-content: space-between; gap: 13px; margin-bottom: 17px; }
.catalog-header h2 { font-size: clamp(1.44rem, 2.4vw, 1.82rem); font-weight: 760; line-height: 1.25; letter-spacing: -.035em; }
.catalog-count { margin-top: 5px; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.sort { position: relative; flex: none; }
.sort select {
  appearance: none;
  background: white;
  border: 1px solid var(--line);
  color: #364562;
  border-radius: 8px;
  padding: 8px 34px 8px 12px;
  font-size: .875rem;
}
.sort .icon { position: absolute; pointer-events: none; width: 15px; height: 15px; top: 50%; right: 10px; transform: translateY(-50%); color: #53627a; }
.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.resource-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  min-height: 242px;
  padding: 18px 18px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  transition: border-color .18s, box-shadow .18s;
}
.resource-card:hover { border-color: #c4d2fa; box-shadow: 0 4px 14px #202c5510; }
.card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.card-top .category-symbol { width: 31px; height: 31px; }
.card-category { color: #4a5b77; font-size: .8125rem; font-weight: 650; }
.bookmark {
  display: grid;
  place-items: center;
  margin-left: auto;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #5c6f8c;
  width: 33px;
  height: 33px;
}
.bookmark .icon { width: 19px; height: 19px; }
.bookmark:hover, .bookmark[aria-pressed="true"] { color: var(--blue); background: #edf2ff; }
.bookmark[aria-pressed="true"] svg { fill: #d6e2ff; }
.card-title { font-size: 1.125rem; font-weight: 730; line-height: 1.4; letter-spacing: -.025em; overflow-wrap: anywhere; }
.card-description { color: var(--muted); font-size: .9375rem; margin-top: 6px; margin-bottom: 12px; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag { max-width: 100%; color: #53627a; background: #f0f3f9; border-radius: 5px; font-size: .8125rem; padding: 3px 7px; overflow-wrap: anywhere; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 9px; border-top: 1px solid #eef1f6; padding-top: 11px; margin-top: auto; }
.card-meta { display: flex; align-items: center; gap: 6px; font-size: .8125rem; color: #56657e; min-width: 0; overflow-wrap: anywhere; }
.card-meta .icon { width: 16px; height: 16px; }
.detail-button { border: 1px solid #e3ebff; border-radius: 7px; background: #edf2ff; color: var(--blue-dark); padding: 5px 11px; font-size: .875rem; font-weight: 680; flex: none; }
.detail-button:hover { border-color: #b6c9ff; color: #1034be; background: #e5edff; }
.empty-state { text-align: center; padding: 44px 22px; background: white; border: 1px dashed #c3cdeb; border-radius: 12px; }
.empty-state .category-symbol { width: 44px; height: 44px; margin-bottom: 10px; }
.empty-state h3 { font-size: 1.125rem; }
.empty-state p { color: var(--muted); margin: 6px 0 15px; }

.site-footer { border-top: 1px solid var(--line); background: white; color: #52617a; }
.footer-inner { display: flex; min-height: 80px; align-items: center; justify-content: space-between; gap: 12px; }
.footer-brand { font-size: .9375rem; color: var(--ink); gap: 8px; }
.footer-inner p { font-size: .875rem; }

.resource-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: calc(100% - 44px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
  color: var(--ink);
  box-shadow: 0 26px 72px #10245363;
  overflow: auto;
}
.resource-dialog::backdrop { background: #101c42a0; }
.dialog-body { padding: 26px; }
.dialog-top { display: flex; align-items: center; gap: 9px; }
.dialog-close { width: 36px; height: 36px; }
.dialog-body h2 { margin: 12px 0 6px; font-size: clamp(1.35rem, 5vw, 1.7rem); overflow-wrap: anywhere; }
.dialog-description { color: var(--muted); }
.dialog-body .tags { margin: 13px 0 19px; }
.detail-list { background: #f6f8fd; padding: 15px; border-radius: 10px; }
.detail-list h3 { margin-bottom: 7px; font-size: 1rem; }
.detail-list ul { margin: 0; padding-left: 22px; color: #36475f; }
.detail-list li + li { margin-top: 4px; }
.detail-list p { color: var(--muted); }
.access-note { display: flex; align-items: center; gap: 8px; color: #57657d; font-size: .875rem; margin-top: 15px; }
.passcode { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; color: #455673; }
.passcode code { background: #edf2ff; color: var(--blue-dark); padding: 3px 8px; border-radius: 4px; font-weight: 650; overflow-wrap: anywhere; }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 18px; }
.action-secondary { display: inline-flex; align-items: center; gap: 6px; background: white; border: 1px solid #dce4f4; color: #344765; border-radius: 7px; padding: 9px 13px; font-size: .875rem; font-weight: 650; }
.action-secondary:hover { color: var(--blue); border-color: #b6c9ff; }
.action-secondary .icon { width: 17px; height: 17px; }
.action-primary { display: inline-flex; align-items: center; gap: 8px; }
.share-fallback { display: grid; gap: 5px; margin-top: 12px; color: #455673; font-size: .875rem; }
.share-fallback input { min-width: 0; padding: 7px 9px; border: 1px solid #dce4f4; border-radius: 7px; }
.toast { position: fixed; z-index: 2; max-width: calc(100% - 24px); bottom: 20px; left: 50%; transform: translateX(-50%); border-radius: 9px; color: white; background: #1b2c51; padding: 9px 16px; box-shadow: 0 6px 20px #172a4140; font-size: .875rem; text-align: center; pointer-events: none; }
.resource-dialog .toast { position: static; width: fit-content; max-width: 100%; transform: none; margin-top: 12px; box-shadow: none; }

@media (max-width: 1040px) {
  .shell { width: calc(100% - 52px); }
  .hero-content { padding-left: 40px; }
  .category-grid { gap: 8px; }
  .category-button { gap: 7px; padding-inline: 9px; }
}
@media (max-width: 790px) {
  .shell { width: calc(100% - 36px); }
  .hero { min-height: 270px; }
  .hero-content { padding-left: 25px; max-width: 71%; }
  .hero-image { width: 54%; right: -3%; }
  .hero-description { max-width: 25em; }
  .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 28px); }
  .header-inner { display: flex; justify-content: space-between; min-height: 60px; gap: 8px; }
  .brand { gap: 7px; font-size: 1rem; }
  .brand img { width: 32px; height: 32px; }
  .top-nav { display: none; }
  .favorite-link { padding: 6px 8px; }
  .page { padding-top: 14px; padding-bottom: 35px; }
  .hero { min-height: 0; border-radius: 15px; }
  .hero-content { width: 100%; max-width: none; padding: 21px 14px 17px; }
  .hero-image { width: 64%; right: -18%; top: 35%; opacity: .23; }
  .hero h1 { font-size: clamp(1.65rem, 6.8vw, 2.35rem); margin-top: 7px; }
  .hero-description { margin-top: 10px; font-size: .875rem; }
  .search { margin-top: 17px; gap: 7px; padding-left: 9px; }
  .search button { padding-inline: 9px; }
  .categories { margin-top: 14px; }
  .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .category-button { justify-content: center; flex-direction: column; min-height: 65px; padding: 5px 2px; gap: 2px; font-size: .8125rem; }
  .category-symbol { width: 29px; height: 29px; }
  .catalog { margin-top: 24px; }
  .resource-grid { grid-template-columns: 1fr; }
  .resource-card { min-height: 0; padding: 14px; }
  .footer-inner { padding-block: 12px; flex-wrap: wrap; min-height: 58px; }
  .footer-brand img { width: 25px; height: 25px; }
  .dialog-body { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
