/* =========================================================
   学员作品展示 · 单横排胶片轮播
   ========================================================= */

#student-works {
  --swx-blue: var(--blue, #0b63e5);
  --swx-blue-dark: var(--blue-dark, #0a4cb0);
  --swx-blue-deep: var(--blue-deep, #0a2540);
  --swx-soft: var(--blue-light, #e8f1ff);
  --swx-ink: var(--text, #1f2d3d);
  --swx-muted: var(--text-sub, #5b6b7f);
  --swx-border: var(--border, #e3eaf3);
  --swx-page: var(--white, #fff);
  position: relative;
  overflow: hidden;
  padding: 52px 0 64px;
  background: var(--swx-page);
}

#student-works *,
#student-works *::before,
#student-works *::after,
.swx-dialog *,
.swx-dialog *::before,
.swx-dialog *::after {
  box-sizing: border-box;
}

#student-works svg,
.swx-dialog svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

#student-works button,
.swx-dialog button {
  font: inherit;
}

#student-works .swx-icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

#student-works .swx-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

#student-works .swx-shell {
  min-width: 0;
}

#student-works .swx-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}

#student-works .swx-eyebrow {
  margin: 0 0 6px;
  color: var(--swx-blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

#student-works h2 {
  margin: 0;
  color: var(--swx-blue-deep);
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

#student-works .swx-intro {
  margin: 10px 0 0;
  color: var(--swx-muted);
  font-size: 15px;
  line-height: 1.75;
}

#student-works .swx-controls {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

#student-works .swx-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid #cfe0f5;
  border-radius: 12px;
  background: #fff;
  color: var(--swx-blue);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

#student-works .swx-nav svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

#student-works .swx-nav:hover:not(:disabled) {
  border-color: var(--swx-blue);
  background: var(--swx-soft);
  transform: translateY(-2px);
}

#student-works .swx-nav:disabled {
  opacity: 0.32;
  cursor: default;
}

#student-works .swx-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 46px;
  margin-left: 4px;
  padding: 0 16px;
  border: 1px solid #cfe0f5;
  border-radius: 12px;
  background: var(--swx-soft);
  color: var(--swx-blue);
  font-size: 13px;
  font-weight: 620;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

#student-works .swx-more:hover {
  border-color: var(--swx-blue);
  background: #fff;
  transform: translateY(-2px);
}

#student-works .swx-nav:focus-visible,
#student-works .swx-card:focus-visible,
#student-works .swx-more:focus-visible {
  outline: 3px solid rgba(11, 99, 229, 0.3);
  outline-offset: 3px;
}

#student-works .swx-count {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  min-width: 62px;
  color: #8a9aae;
  font-family: "DIN Alternate", "Avenir Next Condensed", "PingFang SC", sans-serif;
  font-size: 12px;
  font-weight: 700;
}

#student-works .swx-count strong {
  margin-right: 4px;
  color: var(--swx-blue);
  font-size: 18px;
}

#student-works .swx-cylinder-stage {
  --swx-card-width: 300px;
  --swx-card-height: 300px;
  --swx-media-height: 190px;
  --swx-radius: 600px;
  position: relative;
  height: 500px;
  overflow: hidden;
  border: 1px solid #dce8f5;
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 50% 46%, #fff 0%, #f3f8ff 42%, #e8f1fb 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 20px 46px rgba(10, 70, 159, 0.1);
  perspective: 5000px;
  perspective-origin: 50% 45%;
  cursor: default;
  touch-action: pan-y;
  user-select: none;
  isolation: isolate;
}

#student-works .swx-cylinder-stage::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  background: linear-gradient(90deg, rgba(238, 245, 254, 0.38), transparent 8%, transparent 92%, rgba(238, 245, 254, 0.38));
  pointer-events: none;
}

#student-works .swx-cylinder-glow {
  position: absolute;
  z-index: 0;
  top: 46%;
  left: 50%;
  width: min(760px, 72%);
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(87, 157, 240, 0.18) 0%, rgba(87, 157, 240, 0.05) 48%, transparent 72%);
  filter: blur(14px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#student-works .swx-cylinder-ring {
  position: absolute;
  z-index: 1;
  top: 47%;
  left: 50%;
  width: 0;
  height: 0;
  transform:
    translateZ(calc(var(--swx-radius) * -1))
    rotateY(var(--swx-ring-rotation, 0deg));
  transform-style: preserve-3d;
  will-change: transform;
}

#student-works .swx-cylinder-floor {
  position: absolute;
  z-index: 0;
  right: 10%;
  bottom: 30px;
  left: 10%;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(10, 55, 106, 0.2), transparent 68%);
  filter: blur(10px);
  pointer-events: none;
}

#student-works .swx-card {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--swx-card-width);
  height: var(--swx-card-height);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px 8px 0;
  margin-top: calc(var(--swx-card-height) / -2);
  margin-left: calc(var(--swx-card-width) / -2);
  border: 1px solid #d9e6f5;
  border-radius: 14px;
  background: #fff;
  color: #fff;
  text-align: left;
  cursor: pointer;
  backface-visibility: visible;
  box-shadow: 0 14px 34px rgba(10, 37, 64, 0.24);
  transform: rotateY(var(--swx-card-angle)) translateZ(var(--swx-radius));
  transform-origin: center;
  transform-style: preserve-3d;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, filter 0.12s linear, opacity 0.14s linear;
  will-change: transform, filter, opacity;
}

#student-works .swx-card::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
  border: 1px solid rgba(126, 177, 236, 0.18);
  border-radius: inherit;
  background:
    radial-gradient(circle at 74% 20%, rgba(73, 144, 231, 0.2), transparent 32%),
    linear-gradient(145deg, #0d3155 0%, #071b32 100%);
  box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.2);
  backface-visibility: hidden;
  transform: rotateY(180deg) translateZ(1px);
  pointer-events: none;
}

#student-works .swx-card:hover,
#student-works .swx-card:focus-visible,
#student-works .swx-card.is-active {
  border-color: #91c2ff;
  box-shadow: 0 18px 42px rgba(31, 129, 236, 0.32);
}

#student-works .swx-card.is-back {
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 10px 28px rgba(10, 37, 64, 0.22);
  cursor: default;
}

#student-works .swx-card.is-back .swx-card-caption,
#student-works .swx-card.is-back .swx-card-expand {
  opacity: 0;
}

#student-works .swx-card img {
  display: block;
  width: 100%;
  height: var(--swx-media-height);
  flex: 0 0 auto;
  border-radius: 9px;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.12s ease;
}

#student-works .swx-card-caption {
  position: static;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 11px 8px 12px;
  color: var(--swx-ink);
  text-align: left;
  opacity: 1;
  transform: none;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s ease;
}

#student-works .swx-card-caption.is-dragging {
  cursor: grabbing;
}

#student-works .swx-card-caption strong {
  overflow: hidden;
  color: #111;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#student-works .swx-card-caption small {
  margin-top: 3px;
  color: #111;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.45;
}

#student-works .swx-card-caption::after {
  content: attr(data-swx-desc);
  display: -webkit-box;
  overflow: hidden;
  margin-top: 7px;
  color: #111;
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#student-works .swx-card-expand {
  display: none;
}

#student-works .swx-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 16px;
}

#student-works .swx-progress {
  position: relative;
  flex: 1;
  max-width: 320px;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: #dfeaf7;
}

#student-works .swx-progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--swx-blue), #73adf3);
  transform: scaleX(0.08333);
  transform-origin: left;
  transition: transform 0.32s ease;
}

#student-works .swx-footer > p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--swx-muted);
  font-size: 11px;
}

#student-works .swx-footer i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--swx-blue);
}

/* 图片详情弹框 */
dialog.swx-dialog {
  width: fit-content;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  margin: auto;
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}

dialog.swx-dialog::backdrop {
  background: rgba(3, 16, 31, 0.82);
  backdrop-filter: blur(7px);
}

.swx-dialog-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  animation: swx-dialog-in 0.25s ease both;
}

.swx-dialog-close {
  position: absolute;
  z-index: 4;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(5, 23, 43, 0.78);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.swx-dialog-close:hover {
  background: rgba(11, 47, 84, 0.94);
  transform: rotate(4deg);
}

.swx-dialog-close svg {
  width: 18px;
  height: 18px;
}

.swx-dialog-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swx-dialog-nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(5, 23, 43, 0.78);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(6px);
}

.swx-dialog-prev {
  left: 10px;
}

.swx-dialog-next {
  right: 10px;
}

.swx-dialog-nav:hover:not(:disabled) {
  background: rgba(11, 47, 84, 0.94);
  transform: translateY(-50%) scale(1.05);
}

.swx-dialog-nav:disabled {
  opacity: 0.28;
  cursor: default;
}

.swx-dialog-nav svg {
  width: 19px;
  height: 19px;
}

.swx-dialog-close:focus-visible,
.swx-dialog-nav:focus-visible {
  outline: 3px solid #71adf4;
  outline-offset: 3px;
}

.swx-dialog-media {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100vw - 80px);
  max-height: calc(100vh - 80px);
  overflow: hidden;
  border-radius: 10px;
  background: transparent;
}

.swx-dialog-media img {
  display: block;
  width: min(900px, calc(100vw - 80px));
  height: auto;
  max-height: calc(100vh - 80px);
  max-width: 100%;
  margin: 0;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

.swx-dialog-footer {
  display: none;
}

body.swx-dialog-open {
  overflow: hidden;
}

@keyframes swx-dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  #student-works {
    padding: 40px 0 48px;
  }

  #student-works .swx-card {
    flex-basis: clamp(250px, 42vw, 340px);
  }

  .swx-dialog-shell {
    padding: 18px;
  }

  .swx-dialog-footer {
    padding-right: 48px;
  }
}

@media (max-width: 600px) {
  #student-works {
    padding: 30px 0 38px;
  }

  #student-works .swx-container {
    padding: 0 12px;
  }

  #student-works .swx-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
  }

  #student-works h2 {
    font-size: 29px;
  }

  #student-works .swx-intro {
    font-size: 13px;
  }

  #student-works .swx-controls {
    align-self: stretch;
    justify-content: flex-end;
  }

  #student-works .swx-cylinder-stage {
    height: 390px;
    border-radius: 15px;
    perspective: 3000px;
  }

  #student-works .swx-cylinder-glow {
    width: 94%;
    height: 180px;
  }

  #student-works .swx-card {
    border-width: 3px;
  }

  #student-works .swx-card-caption {
    padding: 9px 7px 11px;
  }

  #student-works .swx-card-caption strong {
    overflow: visible;
    font-size: 13px;
    line-height: 1.35;
    text-overflow: clip;
    white-space: normal;
  }

  #student-works .swx-card-caption small {
    margin-top: 2px;
    font-size: 9px;
    line-height: 1.35;
  }

  #student-works .swx-card-caption::after {
    display: block;
    overflow: visible;
    margin-top: 5px;
    font-size: 9.5px;
    line-height: 1.5;
    -webkit-line-clamp: unset;
  }

  #student-works .swx-footer {
    align-items: flex-start;
    flex-direction: column-reverse;
    gap: 10px;
    margin-top: 13px;
  }

  #student-works .swx-progress {
    width: 100%;
    max-width: none;
  }

  dialog.swx-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .swx-dialog-shell {
    padding: 0;
  }

  .swx-dialog-stage {
    display: flex;
  }

  .swx-dialog-nav {
    width: 44px;
    height: 44px;
  }

  .swx-dialog-prev {
    left: 6px;
  }

  .swx-dialog-next {
    right: 6px;
  }

  .swx-dialog-media {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 48px);
  }

  .swx-dialog-media img {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 48px);
  }

  .swx-dialog-close {
    top: 9px;
    right: 9px;
  }

  .swx-dialog-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 14px 45px 1px;
  }

  .swx-dialog-footer h3 {
    font-size: 17px;
  }

  .swx-dialog-hint {
    gap: 8px;
  }

  .swx-dialog-hint span + span::before {
    margin-right: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #student-works *,
  #student-works *::before,
  #student-works *::after,
  .swx-dialog *,
  .swx-dialog *::before,
  .swx-dialog *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
