/* ==========================================================================
   牛马运输专线 · 面试资料页
   依赖 ../assets/styles.css 中的变量与基础组件
   ========================================================================== */

.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.materials-hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(54px, 7vw, 96px) clamp(40px, 5.5vw, 72px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 62% 95% at 88% -12%, var(--accent-soft) 0%, transparent 62%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
}

.materials-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 82%);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 82%);
}

.materials-hero .shell {
  position: relative;
  z-index: 1;
}

.materials-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(42px, 6.4vw, 78px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.materials-dot {
  color: var(--accent);
}

.materials-lede {
  max-width: 620px;
  margin: 0 0 34px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.8;
}

.materials-stats {
  display: flex;
  flex-wrap: wrap;
  max-width: 620px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.materials-stats > div {
  flex: 1 1 0;
  min-width: 120px;
  padding: 16px 20px;
}

.materials-stats > div + div {
  border-left: 1px solid var(--line);
}

.materials-stats dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.materials-stats dd {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Library
   -------------------------------------------------------------------------- */

.materials-section {
  padding-block: clamp(38px, 5vw, 64px) clamp(56px, 7vw, 90px);
}

.materials-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.materials-toolbar .select-field select {
  max-width: 260px;
}

.material-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 20px;
}

.material-filters button {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition:
    color 0.16s ease,
    border-color 0.16s ease,
    background-color 0.16s ease;
}

.material-filters button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.material-filters button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.material-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.material-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.material-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.material-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.material-kind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
}

.material-kind--pdf {
  color: var(--accent);
  background: var(--accent-soft);
}

.material-kind--video {
  color: var(--blue);
  background: var(--blue-soft);
}

.material-size {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.material-module {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.material-card__title {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.material-card__note {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.material-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.material-date {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.material-open {
  flex: none;
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */

.material-empty {
  display: grid;
  justify-items: center;
  padding: 56px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.material-empty__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.material-empty__mark .icon {
  width: 20px;
  height: 20px;
}

.material-empty h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.material-empty p {
  max-width: 40em;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Preview dialog
   -------------------------------------------------------------------------- */

.material-dialog {
  width: min(1080px, calc(100vw - 40px));
  max-width: 1080px;
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

.material-dialog::backdrop {
  background: rgba(9, 11, 14, 0.62);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.material-dialog__inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
}

.material-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.material-dialog__kicker {
  margin: 0 0 3px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.material-dialog__head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.material-dialog__head .icon-button {
  flex: none;
}

.material-preview {
  display: flex;
  min-height: 280px;
  height: min(68vh, 760px);
  background: var(--bg-alt);
}

.material-preview iframe,
.material-preview video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0b0d10;
}

.material-preview video {
  object-fit: contain;
}

.material-dialog__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.material-dialog__meta {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.material-dialog__actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.material-dialog__actions .button {
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 920px) {
  .material-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .materials-lede {
    margin-bottom: 26px;
  }
}

@media (max-width: 640px) {
  .materials-hero {
    padding-block: 44px 34px;
  }

  .materials-hero h1 {
    font-size: clamp(38px, 12vw, 56px);
  }

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

  .materials-stats > div {
    min-width: 0;
    padding: 12px 14px;
  }

  .materials-stats > div + div {
    border-left: 0;
  }

  .materials-stats > div:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .materials-stats > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .materials-stats dd {
    font-size: 17px;
  }

  .materials-toolbar {
    width: 100%;
  }

  .materials-toolbar .select-field {
    flex: 1;
    min-width: 0;
  }

  .materials-toolbar .select-field select {
    width: 100%;
    max-width: none;
  }

  .materials-toolbar .search-field {
    flex: 1;
    min-width: 0;
    width: auto;
  }

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

  .material-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .material-dialog__inner {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
  }

  .material-preview {
    flex: 1;
    min-height: 0;
    height: auto;
  }

  .material-dialog__foot {
    align-items: stretch;
    flex-direction: column;
  }

  .material-dialog__actions {
    margin-left: 0;
  }

  .material-dialog__actions .button {
    flex: 1;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .material-card,
  .material-filters button {
    transition: none;
  }

  .material-card:hover {
    transform: none;
  }
}
