:root {
  --ink: #171717;
  --muted: #62615d;
  --line: #dedbd2;
  --paper: #f7f5ef;
  --surface: #ffffff;
  --coal: #101414;
  --accent: #d64b2a;
  --accent-dark: #9b2f1b;
  --teal: #0f766e;
  --amber: #c9891a;
  --green: #4f6f42;
  --shadow: 0 10px 28px rgba(31, 29, 25, .08);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0 clamp(18px, 5vw, 64px);
  background: rgba(16, 20, 20, .96);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  white-space: nowrap;
}

.brand small {
  color: #b9b9b2;
  font-size: 12px;
  margin-top: 2px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 15px;
  color: #d8d7d0;
}

.top-nav a {
  padding: 8px 0;
}

.top-nav a:hover {
  color: #fff;
}

.nav-cta {
  padding: 9px 14px !important;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 7px;
}

.hero {
  min-height: 380px;
  display: grid;
  align-items: end;
  background:
    linear-gradient(90deg, rgba(16, 20, 20, .88), rgba(16, 20, 20, .52) 48%, rgba(16, 20, 20, .18)),
    url("/assets/training-hero.png") center / cover no-repeat;
  color: #fff;
  padding: 58px clamp(18px, 5vw, 64px) 34px;
}

.hero-inner {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  color: rgba(255, 255, 255, .72);
  font-size: 14px;
  margin-bottom: 18px;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.04;
  font-weight: 800;
}

.hero-copy {
  max-width: 680px;
  margin: 18px 0 28px;
  color: rgba(255, 255, 255, .82);
  font-size: clamp(16px, 2.2vw, 20px);
  line-height: 1.7;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 132px;
  gap: 10px;
  max-width: 850px;
}

.search-panel input,
.search-panel select,
.search-panel button,
.lead-form input,
.lead-form select,
.lead-form textarea {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 14px;
  outline: none;
}

.search-panel input:focus,
.search-panel select:focus,
.lead-form input:focus,
.lead-form select:focus,
.lead-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(214, 75, 42, .14);
}

.search-panel button,
.primary-btn {
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.search-panel button:hover,
.primary-btn:hover {
  background: var(--accent-dark);
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 38px clamp(18px, 5vw, 64px) 54px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.filters {
  position: sticky;
  top: 92px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.filters h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.filter-block {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

.filter-block label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.filter-block select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
}

.results-head h2 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3vw, 34px);
}

.results-head p {
  margin: 0;
  color: var(--muted);
}

.sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.sort select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: #fff;
}

.course-list {
  display: grid;
  gap: 14px;
}

.course-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.course-thumb {
  min-height: 160px;
  background: #dedbd2 center / cover no-repeat;
}

.course-body {
  padding: 18px 0;
  min-width: 0;
}

.course-body h3 {
  margin: 0 0 8px;
  font-size: 21px;
  line-height: 1.3;
}

.course-body p {
  margin: 0 0 13px;
  color: var(--muted);
  line-height: 1.6;
}

.partner-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin: 0 0 10px;
  color: #4a4740;
  font-size: 14px;
}

.partner-logo {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  object-fit: contain;
}

.partner-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--coal);
  color: #fff;
  font-weight: 800;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  background: #f1eee6;
  color: #44413b;
  font-size: 13px;
}

.course-meta {
  width: 160px;
  padding: 18px 18px 18px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
}

.course-meta strong {
  color: var(--ink);
  font-size: 16px;
}

.detail-link {
  margin-top: auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border-radius: 7px;
  color: #fff;
  background: var(--coal);
}

.detail-link:hover {
  background: var(--accent);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.pagination button {
  min-width: 40px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.pagination button.active {
  background: var(--coal);
  color: #fff;
  border-color: var(--coal);
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.section {
  border-top: 1px solid var(--line);
  padding-top: 42px;
  margin-top: 48px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
}

.section-head p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.topic {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  cursor: pointer;
}

.topic:hover {
  border-color: var(--accent);
}

.topic strong {
  display: block;
  margin-bottom: 8px;
}

.topic span {
  color: var(--muted);
  font-size: 14px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 700;
}

.faq-list p {
  color: var(--muted);
  line-height: 1.7;
}

.lead-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 30px;
  align-items: start;
  background: var(--coal);
  color: #fff;
  padding: clamp(24px, 4vw, 42px);
  border-radius: 8px;
}

.lead-band h2 {
  margin: 0 0 14px;
  font-size: clamp(26px, 4vw, 42px);
}

.lead-band p {
  color: rgba(255, 255, 255, .76);
  line-height: 1.8;
}

.lead-points {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  color: #e8e5dc;
}

.lead-form {
  display: grid;
  gap: 10px;
}

.lead-form input,
.lead-form select,
.lead-form textarea {
  width: 100%;
  background: #fff;
}

.lead-form textarea {
  min-height: 104px;
  padding-top: 12px;
  resize: vertical;
}

.form-status {
  min-height: 22px;
  color: #f4c36a;
  font-size: 14px;
}

.detail-hero {
  min-height: 360px;
  background:
    linear-gradient(90deg, rgba(16, 20, 20, .86), rgba(16, 20, 20, .44)),
    var(--detail-image) center / cover no-repeat;
  color: #fff;
  display: grid;
  align-items: end;
  padding: 60px clamp(18px, 5vw, 64px) 34px;
}

.detail-hero-inner {
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}

.detail-hero h1 {
  max-width: 800px;
  margin: 12px 0;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.08;
}

.detail-hero p {
  max-width: 760px;
  color: rgba(255, 255, 255, .82);
  line-height: 1.75;
  font-size: 18px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
}

.detail-main {
  display: grid;
  gap: 30px;
}

.detail-main h2,
.detail-aside h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.detail-main p,
.detail-main li,
.detail-aside p {
  color: var(--muted);
  line-height: 1.75;
}

.lesson-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.lesson-list li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}

.lesson-list span {
  color: var(--accent);
  font-weight: 800;
}

.detail-aside {
  position: sticky;
  top: 92px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.aside-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.aside-row:first-of-type {
  border-top: 0;
}

.back-link {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--accent);
  font-weight: 700;
}

.empty-state {
  min-height: 230px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(18px, 5vw, 64px);
  color: #d7d4cc;
  background: var(--coal);
}

.site-footer p {
  margin: 8px 0 0;
  color: #aaa79d;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

@media (max-width: 980px) {
  .search-panel,
  .catalog-layout,
  .lead-band,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .filters,
  .detail-aside {
    position: static;
  }

  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .course-card {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .course-meta {
    grid-column: 1 / -1;
    width: auto;
    align-items: flex-start;
    padding: 0 18px 18px;
  }
}

@media (max-width: 680px) {
  .site-header {
    height: auto;
    min-height: 68px;
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 12px;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
  }

  .hero {
    min-height: 430px;
    padding-top: 42px;
  }

  .topic-grid {
    grid-template-columns: 1fr;
  }

  .results-head,
  .section-head,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .course-card {
    grid-template-columns: 1fr;
  }

  .course-thumb {
    min-height: 190px;
  }

  .course-body {
    padding: 18px 18px 0;
  }

  .lead-band {
    padding: 22px;
  }
}
