:root {
  --ink: #202326;
  --muted: #667078;
  --line: #dfe3e6;
  --paper: #ffffff;
  --soft: #f4f6f5;
  --accent: #c84635;
  --accent-dark: #9f3328;
  --green: #2f6f59;
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 1.6;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.no-break { white-space: nowrap; }
button { letter-spacing: 0; }
.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; }

.site-header {
  width: 100%;
  height: 68px;
  padding: 0 max(24px, calc((100% - var(--max-width)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 4px;
  font-size: 17px;
}
.header-nav { display: flex; align-items: center; gap: 28px; font-size: 14px; }
.header-nav a:hover { color: var(--accent); }
.header-claim { padding: 9px 16px; color: #fff !important; background: var(--ink); border-radius: 4px; }

.overview-band { background: #eef1ef; border-bottom: 1px solid var(--line); }
.overview-inner {
  max-width: var(--max-width);
  min-height: 394px;
  margin: 0 auto;
  padding: 64px 0 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  align-items: center;
  gap: 68px;
}
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 13px; font-weight: 800; }
.overview-copy h1 { max-width: 760px; margin: 0; font-size: clamp(34px, 4vw, 52px); line-height: 1.18; letter-spacing: 0; }
.overview-copy > p:not(.eyebrow) { max-width: 680px; margin: 18px 0 28px; color: var(--muted); font-size: 17px; }
.hero-search { height: 52px; max-width: 680px; display: grid; grid-template-columns: 1fr 116px; background: #fff; border: 1px solid #bfc6c4; border-radius: 5px; overflow: hidden; }
.hero-search:focus-within { outline: 3px solid rgba(200, 70, 53, 0.16); border-color: var(--accent); }
.hero-search input { width: 100%; min-width: 0; padding: 0 18px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.hero-search button { border: 0; color: #fff; background: var(--accent); cursor: pointer; font-weight: 700; }
.hero-search button:hover { background: var(--accent-dark); }
.hot-searches { min-height: 31px; margin-top: 13px; display: flex; align-items: center; gap: 13px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.hot-searches button { padding: 0; border: 0; color: var(--ink); background: none; cursor: pointer; }
.hot-searches button:hover { color: var(--accent); }
.overview-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 10px 30px rgba(24, 32, 30, 0.08);
}
.overview-stats > div { min-height: 108px; padding: 22px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.overview-stats > div:nth-child(even) { border-right: 0; }
.overview-stats > div:nth-child(n+3) { border-bottom: 0; }
.overview-stats strong { font-size: 27px; line-height: 1.1; }
.overview-stats span { margin-top: 7px; color: var(--muted); font-size: 13px; }
.overview-stats .stat-primary strong { color: var(--accent); }

.category-band { background: #fff; }
.section-inner { width: min(calc(100% - 48px), var(--max-width)); margin: 0 auto; }
.category-band .section-inner { padding: 64px 0; }
.section-heading, .library-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-heading h2, .library-heading h2 { margin: 0; font-size: 28px; line-height: 1.25; letter-spacing: 0; }
.text-button { padding: 0 0 3px; border: 0; border-bottom: 1px solid var(--ink); color: var(--ink); background: none; cursor: pointer; }
.category-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.category-item {
  min-width: 0;
  min-height: 112px;
  padding: 20px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.category-item:hover, .category-item.is-active { background: #f6f7f6; box-shadow: inset 0 3px 0 var(--category-color); }
.category-emblem { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: var(--category-color); border-radius: 4px; font-weight: 800; }
.category-item strong, .category-item small { display: block; }
.category-item strong { overflow-wrap: anywhere; font-size: 15px; }
.category-item small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.category-arrow { color: #9da5a9; font-size: 18px; }

.library-section { scroll-margin-top: 68px; padding: 64px 0 76px; background: var(--soft); border-top: 1px solid var(--line); }
.library-heading p:not(.eyebrow) { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.library-controls { display: flex; gap: 10px; }
.library-controls select { min-width: 132px; height: 40px; padding: 0 32px 0 12px; border: 1px solid #cbd1d3; border-radius: 4px; color: var(--ink); background: #fff; }
.active-filter { margin-top: 18px; padding: 9px 12px; border-left: 3px solid var(--accent); background: #fff; color: var(--muted); font-size: 13px; }
.active-filter button { margin-left: 10px; padding: 0; border: 0; color: var(--accent); background: none; cursor: pointer; }
.resource-grid { margin-top: 28px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.resource-card {
  min-width: 0;
  min-height: 288px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-top: 3px solid var(--resource-color);
  border-radius: 5px;
  background: #fff;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.resource-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(30, 37, 35, 0.08); }
.resource-card-top, .resource-meta, .resource-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.resource-card-top { color: var(--muted); font-size: 12px; }
.resource-category { color: var(--resource-color); font-weight: 800; }
.resource-card h3 { margin: 16px 0 10px; font-size: 18px; line-height: 1.45; letter-spacing: 0; overflow-wrap: anywhere; }
.resource-card h3 a:hover { color: var(--accent); }
.resource-card > p { margin: 0; display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 13px; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.resource-meta { margin-top: auto; padding-top: 18px; color: #7a8389; font-size: 12px; }
.resource-actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid #edf0ef; }
.resource-actions a { font-size: 13px; font-weight: 700; }
.resource-actions a:last-child { color: var(--accent); }
.empty-state { grid-column: 1 / -1; padding: 64px 24px; text-align: center; border: 1px solid var(--line); background: #fff; }
.empty-state strong { font-size: 18px; }
.empty-state p { margin: 5px 0 0; color: var(--muted); }
.pagination { margin-top: 34px; display: flex; justify-content: center; align-items: center; gap: 6px; }
.pagination button, .pagination a { min-width: 38px; height: 38px; padding: 0 11px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #cdd3d5; border-radius: 3px; color: var(--ink); background: #fff; cursor: pointer; }
.pagination button.is-active, .pagination a.is-active { color: #fff; border-color: var(--ink); background: var(--ink); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination span { padding: 0 4px; color: var(--muted); }

.trust-band { border-top: 1px solid var(--line); background: #fff; }
.trust-grid { padding: 36px 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.trust-grid div { padding: 0 32px; border-right: 1px solid var(--line); }
.trust-grid div:first-child { padding-left: 0; }
.trust-grid div:last-child { padding-right: 0; border-right: 0; }
.trust-grid strong, .trust-grid span { display: block; }
.trust-grid strong { font-size: 15px; }
.trust-grid span { margin-top: 5px; color: var(--muted); font-size: 13px; }
.site-footer { min-height: 150px; padding: 38px max(24px, calc((100% - var(--max-width)) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; color: #cfd5d2; background: #222725; font-size: 13px; }
.site-footer p { margin: 10px 0 0; }
.footer-brand { color: #fff; }

/* Resource detail pages */
.compact-header { position: static; }
.back-link { color: var(--muted); font-size: 14px; }
.back-link:hover { color: var(--accent); }
.detail-body { background: var(--soft); }
.article-shell { width: min(calc(100% - 48px), 860px); margin: 0 auto; padding: 30px 0 72px; }
.breadcrumbs { margin-bottom: 18px; display: flex; gap: 8px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.breadcrumbs a:hover { color: var(--accent); }
.resource-article { padding: 48px 56px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.article-kicker { color: var(--resource-color); font-size: 13px; font-weight: 800; }
.resource-article h1 { margin: 12px 0 14px; font-size: 34px; line-height: 1.3; letter-spacing: 0; overflow-wrap: anywhere; }
.article-lead { margin: 0; color: var(--muted); font-size: 16px; }
.article-actions { margin: 30px 0 42px; padding: 20px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px 20px; border-top: 1px solid #d9e4df; border-bottom: 1px solid #d9e4df; background: #f2f6f4; color: var(--muted); font-size: 12px; }
.primary-button { min-width: 190px; min-height: 54px; padding: 0 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; color: #fff; background: var(--accent); font-size: 17px; font-weight: 800; }
.primary-button:hover { background: var(--accent-dark); }
.primary-button[aria-disabled="true"] { pointer-events: none; background: #8a9296; }
.article-download-meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.article-download-meta strong { color: var(--ink); font-size: 14px; }
.article-download-meta span { color: var(--muted); font-size: 12px; }
.extract-code { grid-column: 2; justify-self: start; padding: 4px 8px; border: 1px dashed #b8c0c3; color: var(--ink); background: #fff; font-size: 12px; }
.resource-actions a[aria-disabled="true"], .category-item[aria-disabled="true"] { pointer-events: none; color: var(--muted); cursor: default; }
.resource-article section { margin-top: 38px; }
.resource-article h2 { margin: 0 0 14px; font-size: 22px; letter-spacing: 0; }
.resource-article h3 { margin: 0 0 5px; font-size: 16px; letter-spacing: 0; }
.resource-article p, .resource-article li { color: #4f585e; }
.resource-article ol:not(.core-list) { padding-left: 22px; }
.resource-article ol:not(.core-list) li { margin: 8px 0; }
.core-list { padding: 0; list-style: none; }
.core-list li { padding: 16px 0; display: grid; grid-template-columns: 34px 1fr; gap: 14px; border-bottom: 1px solid #ecefee; }
.core-list li > strong { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 3px; color: #fff; background: var(--ink); font-size: 12px; }
.core-list p { margin: 0; font-size: 14px; }
.task-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.task-grid div { min-height: 112px; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.task-grid span { color: var(--accent); font-size: 12px; font-weight: 800; }
.task-grid p { margin: 6px 0 0; font-size: 14px; }
.article-note { margin-top: 42px; padding: 18px 20px; border-left: 3px solid var(--green); background: #f1f6f3; }
.article-note p { margin: 5px 0 0; font-size: 13px; }
.pdf-highlight-list { padding: 0; list-style: none; }
.pdf-highlight-list li { padding: 14px 0; display: grid; grid-template-columns: 150px 1fr; gap: 18px; border-bottom: 1px solid var(--line); }
.pdf-highlight-list strong { color: var(--ink); }
.pdf-highlight-list span { color: var(--muted); }
.resource-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 2px solid var(--ink); border-left: 1px solid var(--line); }
.resource-summary-grid div { min-height: 92px; padding: 16px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.resource-summary-grid strong { font-size: 24px; line-height: 1.1; }
.resource-summary-grid span { margin-top: 7px; color: var(--muted); font-size: 12px; }
.study-guide-list { padding: 0; list-style: none; border-top: 1px solid var(--line); }
.study-guide-list li { padding: 14px 0; display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; border-bottom: 1px solid var(--line); }
.study-guide-list strong { color: var(--accent); font-size: 12px; }
.study-guide-list p { margin: 0; font-size: 14px; }
.section-intro { max-width: 700px; margin: -6px 0 18px; color: var(--muted) !important; font-size: 14px; }
.sample-list { border-top: 2px solid var(--ink); }
.sample-row { padding: 22px 0; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 16px; border-bottom: 1px solid var(--line); }
.sample-index { width: 34px; height: 30px; display: grid; place-items: center; color: #fff; background: var(--resource-color, var(--accent)); font-size: 12px; font-weight: 800; }
.sample-content { min-width: 0; }
.sample-tag { display: block; margin-bottom: 5px; color: var(--resource-color, var(--accent)); font-size: 12px; font-weight: 800; }
.sample-content h3 { margin: 0 0 13px; font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.sample-content p { margin: 8px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.sample-content p strong { margin-right: 9px; color: var(--ink); font-size: 12px; }
.sample-answer { padding-top: 10px; border-top: 1px dashed #d7dcde; color: var(--ink) !important; }
.sample-analysis { color: var(--muted) !important; }
.sample-language .sample-content h3 { font-family: Arial, "Microsoft YaHei", sans-serif; }
.topic-index { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); list-style: none; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.topic-index li { min-height: 52px; padding: 13px 15px; display: flex; align-items: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; }
.topic-index li::before { content: ""; width: 6px; height: 6px; margin-right: 10px; flex: 0 0 6px; background: var(--resource-color, var(--accent)); }
.source-section { padding: 20px 0 2px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.source-section p { margin: 9px 0 16px; font-size: 14px; }
.detail-layout-1 .content-excerpt { margin-top: 30px; }
.detail-layout-2 .topic-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.detail-layout-2 .sample-list { border-top-color: var(--resource-color, var(--accent)); }
.detail-layout-3 .sample-row { grid-template-columns: 52px minmax(0, 1fr); }
.detail-layout-3 .sample-index { width: 42px; background: var(--ink); }
.section-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-title-row a { color: var(--accent); font-size: 13px; }
.related-list { border-top: 1px solid var(--line); }
.related-list > a { padding: 13px 0; display: flex; align-items: baseline; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.related-list > a:hover span { color: var(--accent); }
.related-list span { min-width: 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 700; }
.related-list small { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.related-list > p { margin: 12px 0; font-size: 14px; }
.pack-shell { width: min(calc(100% - 48px), var(--max-width)); min-height: calc(100vh - 218px); margin: 0 auto; padding: 62px 0 80px; }
.pack-shell h1 { margin: 0; font-size: 38px; letter-spacing: 0; }
.pack-lead { margin: 12px 0 30px; color: var(--muted); }
.pack-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.pack-grid a { min-height: 88px; padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.pack-grid a:hover { background: #f6f7f6; box-shadow: inset 3px 0 0 var(--accent); }
.pack-grid a > span:nth-child(2) { min-width: 0; flex: 1; }
.pack-grid .category-emblem { width: 42px; height: 42px; flex: 0 0 42px; color: #fff; font-size: 14px; }
.pack-grid strong, .pack-grid small { display: block; overflow-wrap: anywhere; }
.pack-grid strong { color: var(--ink); font-size: 16px; }
.pack-grid small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.pack-grid .category-arrow { flex: 0 0 auto; color: var(--muted); font-size: 16px; }
.category-directory-head { padding: 38px 0 42px; border-bottom: 1px solid var(--line); background: #fff; }
.category-directory-head .breadcrumbs { margin-bottom: 28px; }
.category-directory-head h1 { margin: 0; font-size: 38px; line-height: 1.25; letter-spacing: 0; }
.category-directory-head p:not(.eyebrow) { max-width: 780px; margin: 12px 0 0; color: var(--muted); }
.directory-summary { margin-top: 24px; display: flex; align-items: baseline; gap: 10px; }
.directory-summary strong { color: var(--accent); font-size: 28px; line-height: 1; }
.directory-summary span { color: var(--muted); font-size: 13px; }
.category-library { padding-top: 54px; }
.text-link { padding-bottom: 3px; border-bottom: 1px solid var(--ink); font-size: 14px; }
.text-link:hover { color: var(--accent); border-color: var(--accent); }
.directory-categories .section-inner { padding: 54px 0 70px; }

@media (max-width: 960px) {
  .overview-inner { width: min(calc(100% - 48px), var(--max-width)); grid-template-columns: 1fr; gap: 36px; }
  .overview-stats { grid-template-columns: repeat(4, 1fr); }
  .overview-stats > div { min-height: 90px; border-bottom: 0; }
  .overview-stats > div:nth-child(even) { border-right: 1px solid var(--line); }
  .overview-stats > div:last-child { border-right: 0; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .site-header { height: 60px; padding: 0 16px; }
  .header-nav a:not(.header-claim) { display: none; }
  .header-claim { padding: 8px 11px; }
  .overview-inner { width: auto; min-height: 0; padding: 42px 18px 34px; gap: 28px; }
  .overview-copy h1 { font-size: 34px; }
  .overview-copy > p:not(.eyebrow) { margin: 14px 0 22px; font-size: 15px; }
  .hero-search { grid-template-columns: minmax(0, 1fr) 86px; }
  .hero-search input { padding: 0 12px; font-size: 14px; }
  .hero-search button { font-size: 14px; }
  .overview-stats { grid-template-columns: 1fr 1fr; }
  .overview-stats > div, .overview-stats > div:nth-child(even) { min-height: 86px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .overview-stats > div:nth-child(even) { border-right: 0; }
  .overview-stats > div:nth-child(n+3) { border-bottom: 0; }
  .overview-stats strong { font-size: 23px; }
  .section-inner { width: calc(100% - 32px); }
  .category-band .section-inner, .library-section { padding-top: 42px; padding-bottom: 48px; }
  .section-heading, .library-heading { align-items: start; flex-direction: column; }
  .section-heading h2, .library-heading h2 { font-size: 24px; }
  .category-grid { margin-top: 22px; grid-template-columns: 1fr; }
  .category-item { min-height: 78px; }
  .library-controls { width: 100%; }
  .library-controls label { flex: 1; }
  .library-controls select { width: 100%; min-width: 0; }
  .resource-grid { grid-template-columns: 1fr; }
  .resource-card { min-height: 260px; }
  .pagination { flex-wrap: wrap; }
  .trust-grid { grid-template-columns: 1fr; padding: 16px 0; }
  .trust-grid div, .trust-grid div:first-child, .trust-grid div:last-child { padding: 18px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .trust-grid div:last-child { border-bottom: 0; }
  .site-footer { padding: 34px 18px; align-items: start; flex-direction: column; }
  .article-shell { width: calc(100% - 24px); padding: 18px 0 42px; }
  .resource-article { padding: 28px 20px; }
  .resource-article h1 { font-size: 27px; }
  .article-actions { grid-template-columns: 1fr; padding: 16px; }
  .primary-button { width: 100%; min-width: 0; }
  .extract-code { grid-column: 1; }
  .task-grid { grid-template-columns: 1fr; }
  .resource-summary-grid { grid-template-columns: 1fr 1fr; }
  .related-list > a { align-items: start; flex-direction: column; gap: 3px; }
  .pdf-highlight-list li { grid-template-columns: 1fr; gap: 4px; }
  .sample-row, .detail-layout-3 .sample-row { grid-template-columns: 32px minmax(0, 1fr); gap: 11px; padding: 18px 0; }
  .sample-index, .detail-layout-3 .sample-index { width: 30px; height: 28px; }
  .sample-content h3 { font-size: 15px; line-height: 1.65; }
  .sample-content p { font-size: 13px; }
  .topic-index, .detail-layout-2 .topic-index { grid-template-columns: 1fr; }
  .pack-shell { width: calc(100% - 32px); padding: 42px 0 56px; }
  .pack-shell h1 { font-size: 30px; }
  .pack-grid { grid-template-columns: 1fr; }
  .category-directory-head { padding: 26px 0 32px; }
  .category-directory-head h1 { font-size: 29px; }
  .category-library { padding-top: 42px; }
}
