:root {
  color-scheme: light;
  --ink: #352e2d;
  --muted: #9b918d;
  --canvas: #fffaf5;
  --shadow: 0 9px 21px rgba(111, 86, 75, .065);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #fff9f3 0, #fffdfb 240px, #fffaf7 100%);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, select { font: inherit; }
:focus-visible { outline: 3px solid #a987e6; outline-offset: 3px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell { max-width: 1080px; min-height: 100vh; margin: 0 auto; padding: 0 24px 64px; }
.page-header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  min-height: 100px;
  gap: 12px;
}
.page-header h1 { margin: 0; text-align: center; font-size: 26px; font-weight: 800; letter-spacing: .02em; }
.back-link {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: #eee3ff;
  color: #65539a;
  transition: background .2s, transform .2s;
}
.back-link span { position: relative; top: -3px; font-size: 42px; font-family: Arial, sans-serif; font-weight: 300; line-height: 1; }
.back-link:hover { background: #e2d3ff; transform: translateX(-2px); }

.resource-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  min-height: 158px;
  padding: 29px 32px;
  border-radius: 28px;
  background: linear-gradient(105deg, #ffe1e9 0%, #ffe9e4 56%, #fff1cc 100%);
  box-shadow: var(--shadow);
}
.resource-intro h2 { margin: 0; font-size: clamp(21px, 2.5vw, 29px); line-height: 1.35; font-weight: 800; }
.resource-intro p { margin: 12px 0 0; color: #9d8786; font-size: 15px; }
.free-badge {
  flex: none;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .84);
  color: #dd6487;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .11em;
}
.exam-switch { display: flex; justify-content: flex-end; align-items: center; gap: 9px; margin: 18px 2px 14px; color: #a2928e; font-size: 13px; }
.exam-switch select {
  max-width: 180px;
  min-height: 36px;
  padding: 6px 29px 6px 13px;
  border: 1px solid #eadbd5;
  border-radius: 999px;
  color: #735e61;
  background: #fffdfb;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.resource-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.resource-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  min-height: 104px;
  padding: 19px 20px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.resource-card:hover { transform: translateY(-3px); box-shadow: 0 14px 26px rgba(111, 86, 75, .12); }
.resource-card.tone-rose { background: #ffe0e9; color: #825263; }
.resource-card.tone-lavender { background: #eae1ff; color: #665587; }
.resource-card.tone-mint { background: #d9f2e5; color: #446e59; }
.resource-card.tone-butter { background: #fff0c6; color: #806a39; }
.resource-card.tone-sky { background: #dceeff; color: #4a6e8d; }
.resource-card.tone-peach { background: #ffe4d6; color: #815c4c; }
.resource-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .76);
  font-size: 16px;
  font-weight: 800;
}
.resource-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 6px; }
.resource-copy strong { font-size: 17px; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.resource-copy small { color: currentColor; opacity: .65; font-size: 12px; font-weight: 500; line-height: 1.4; }
.resource-chevron { flex: none; margin-left: auto; font-family: Arial, sans-serif; font-size: 34px; font-weight: 300; line-height: 1; }

.detail-view { max-width: 780px; margin: 17px auto 0; }
.file-list { display: grid; gap: 14px; }
.file-card {
  display: flex;
  align-items: center;
  gap: 19px;
  min-width: 0;
  min-height: 104px;
  padding: 21px 24px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(91, 75, 67, .065);
  transition: transform .2s, box-shadow .2s;
}
.file-card:hover { transform: translateY(-2px); box-shadow: 0 13px 28px rgba(91, 75, 67, .11); }
.file-card-unavailable { color: #8c8480; }
.file-card-unavailable:hover { transform: none; box-shadow: 0 8px 24px rgba(91, 75, 67, .065); }
.file-card-unavailable .pdf-icon { background: linear-gradient(135deg, #aaa4a0, #89837f); box-shadow: none; }
.pdf-icon {
  position: relative;
  display: grid;
  place-items: end center;
  flex: none;
  width: 34px;
  height: 41px;
  padding-bottom: 7px;
  border-radius: 3px;
  background: linear-gradient(135deg, #ff895b, #ef644a);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: -.01em;
  box-shadow: 0 3px 7px rgba(235, 112, 75, .17);
}
.pdf-icon::after { content: ""; position: absolute; top: 0; right: 0; border-width: 0 0 9px 9px; border-style: solid; border-color: transparent transparent #ffd5bf transparent; }
.file-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 5px; }
.file-copy strong { font-size: 17px; font-weight: 750; line-height: 1.4; overflow-wrap: anywhere; }
.file-copy small { color: var(--muted); font-size: 13px; }
.file-chevron { flex: none; margin-left: 8px; color: #8b7da3; font-family: Arial, sans-serif; font-size: 37px; font-weight: 300; line-height: 1; }

.page-status, .load-error { max-width: 780px; margin: 20px auto; padding: 17px 19px; border-radius: 16px; font-size: 14px; line-height: 1.5; }
.page-status { color: #8c7e77; background: #fff; }
.load-error { color: #9c5260; background: #fff0f2; }

@media (max-width: 700px) {
  .page-shell { padding: 0 14px 44px; }
  .page-header { min-height: 90px; grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 8px; }
  .page-header h1 { font-size: 21px; }
  .back-link { width: 40px; height: 40px; border-radius: 13px; }
  .back-link span { font-size: 37px; }
  .resource-intro { min-height: 105px; padding: 21px 19px; border-radius: 21px; gap: 7px; }
  .resource-intro h2 { font-size: 18px; }
  .resource-intro p { margin-top: 7px; font-size: 12px; }
  .free-badge { padding: 7px 10px; font-size: 11px; }
  .exam-switch { margin: 13px 1px; font-size: 11px; }
  .exam-switch select { min-height: 30px; padding: 4px 22px 4px 9px; font-size: 11px; }
  .resource-list { grid-template-columns: 1fr; gap: 10px; }
  .resource-card { min-height: 78px; padding: 14px 15px; gap: 11px; border-radius: 19px; }
  .resource-mark { width: 36px; height: 36px; border-radius: 12px; font-size: 13px; }
  .resource-copy { gap: 3px; }
  .resource-copy strong { font-size: 14px; }
  .resource-copy small { font-size: 11px; }
  .resource-chevron { font-size: 30px; }
  .detail-view { margin-top: 15px; }
  .file-list { gap: 10px; }
  .file-card { min-height: 76px; padding: 15px 16px; gap: 13px; border-radius: 18px; }
  .pdf-icon { width: 28px; height: 35px; padding-bottom: 6px; font-size: 8px; }
  .file-copy strong { font-size: 13px; }
  .file-copy small { font-size: 11px; }
  .file-chevron { margin-left: 0; font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .resource-card, .file-card, .back-link { transition: none; }
}
