/* ==========================================================================
   SWISS ARCHIVE GRID DESIGN SYSTEM (奇点网盘搜 · 瑞士极简档案风)
   Palette: Pure White #FFFFFF, Paper #F8FAFC, Carbon Ink #090D16,
            Slate Muted #475569, Criterion Vermilion #BE123C
   ========================================================================== */

body.swissArchivePage {
  background: #ffffff !important;
  color: #090d16 !important;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
}

body.swissArchivePage::before,
body.swissArchivePage::after,
body.swissArchivePage .headBg,
body.swissArchivePage .nebulaBackdrop,
body.swissArchivePage .headerKox {
  display: none !important;
}

body.swissArchivePage ::selection {
  background: #be123c;
  color: #ffffff;
}

body.swissArchivePage input,
body.swissArchivePage textarea {
  caret-color: #be123c;
}

body.swissArchivePage input::placeholder,
body.swissArchivePage textarea::placeholder {
  color: #475569 !important;
  opacity: 1 !important;
}

body.swissArchivePage :focus-visible {
  outline: 2px solid #be123c;
  outline-offset: 2px;
}

.sa-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   1. Top Header Bar (.sa-topbar)
   -------------------------------------------------------------------------- */
.sa-header-wrap {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid #090d16;
}

.sa-topbar {
  max-width: 1360px;
  margin: 0 auto;
  min-height: 68px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.sa-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #090d16 !important;
  text-decoration: none;
  padding-right: 24px;
  border-right: 1px solid #cbd5e1;
  flex-shrink: 0;
}

.sa-brand-mark {
  width: 26px;
  height: 26px;
  background: #be123c;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.sa-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-right: auto;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
}

.sa-nav a {
  color: #475569;
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.15s ease;
  cursor: pointer;
}

.sa-nav a:hover,
.sa-nav a.is-active {
  color: #090d16;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
  text-decoration-color: #be123c;
}

.sa-top-search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  border: 2px solid #090d16;
  background: #ffffff;
  padding: 4px;
  gap: 6px;
}

body.sa-is-home .sa-top-search {
  display: none;
}

.sa-top-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #090d16;
  background: transparent;
}

.sa-top-search button {
  border: none;
  background: #090d16;
  color: #ffffff;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.sa-top-search button:hover {
  background: #be123c;
}

.sa-status-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.sa-status-pill {
  font-size: 12px;
  color: #475569;
  padding-right: 14px;
  border-right: 1px solid #cbd5e1;
}

.sa-ghost-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #090d16;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.sa-ghost-btn:hover {
  border-color: #090d16;
  background: #f8fafc;
}

.sa-cinema-link {
  border: 1px solid #090d16;
  background: #090d16;
  color: #ffffff !important;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.sa-cinema-link:hover {
  background: #be123c;
  border-color: #be123c;
}

/* --------------------------------------------------------------------------
   2. Main Container & Homepage Asymmetric Swiss Hero
   -------------------------------------------------------------------------- */
.sa-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.sa-hero-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  border-bottom: 2px solid #090d16;
}

.sa-hero-left {
  padding: 36px 36px 32px 0;
  border-right: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.sa-h1 {
  font-size: 42px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: #090d16;
  margin: 0 0 12px;
}

.sa-sub {
  font-size: 15px;
  line-height: 1.65;
  color: #475569;
  max-width: 60ch;
  margin: 0 0 24px;
}

.sa-search-box {
  display: flex;
  align-items: center;
  border: 2px solid #090d16;
  background: #ffffff;
  padding: 6px;
  gap: 8px;
}

.sa-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 14px;
  font-size: 16px;
  color: #090d16;
  background: transparent;
}

.sa-search-input::placeholder {
  color: #475569;
}

.sa-search-scope {
  padding: 10px 14px;
  background: #f8fafc;
  border-left: 1px solid #e2e8f0;
  font-size: 12px;
  color: #475569;
  white-space: nowrap;
}

.sa-search-btn {
  border: none;
  background: #be123c;
  color: #ffffff;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.15s ease;
  flex-shrink: 0;
}

.sa-search-btn:hover {
  background: #9f1239;
}

.sa-hot-block {
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
}

.sa-hot-label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 12px;
}

.sa-hot-matrix {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 16px;
}

.sa-hot-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  color: #090d16;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 0;
  min-width: 0;
}

.sa-hot-item > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.sa-hot-item:hover {
  color: #be123c;
  text-decoration: underline;
}

.sa-hot-num {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  flex-shrink: 0;
}

.sa-hot-item.is-top .sa-hot-num {
  color: #be123c;
}

/* Right Hero Spotlight */
.sa-hero-right {
  padding: 28px 0 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sa-spotlight-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 700;
  color: #090d16;
}

.sa-spotlight-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 18px;
  flex: 1;
}

.sa-spotlight-poster {
  width: 140px;
  height: 196px;
  border: 1px solid #090d16;
  object-fit: cover;
  background: #e2e8f0;
}

.sa-spotlight-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sa-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.sa-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border: 1px solid #090d16;
  background: #ffffff;
  color: #090d16;
}

.sa-tag.is-red {
  background: #be123c;
  border-color: #be123c;
  color: #ffffff;
}

.sa-spotlight-title {
  font-size: 20px;
  font-weight: 700;
  color: #090d16;
  margin: 0 0 8px;
  line-height: 1.3;
}

.sa-spotlight-desc {
  font-size: 13px;
  color: #475569;
  line-height: 1.55;
  margin: 0;
}

.sa-spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
  margin-top: 14px;
}

.sa-btn-dark {
  background: #090d16;
  color: #ffffff !important;
  border: 1px solid #090d16;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sa-btn-dark:hover {
  background: #1e293b;
}

.sa-btn-red {
  background: #be123c;
  color: #ffffff !important;
  border: 1px solid #be123c;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sa-btn-red:hover {
  background: #9f1239;
}

/* --------------------------------------------------------------------------
   3. Homepage Category Bar & 6-Column Swiss Poster Grid
   -------------------------------------------------------------------------- */
.sa-cat-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 14px;
  border-bottom: 2px solid #090d16;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.sa-cat-filter-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.sa-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sa-cat-tab {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sa-cat-tab:hover {
  border-color: #090d16;
  color: #090d16;
}

.sa-cat-tab.is-active {
  border-color: #090d16;
  background: #090d16;
  color: #ffffff;
}

.sa-category-section {
  margin-bottom: 40px;
}

.sa-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #090d16;
  margin-bottom: 18px;
}

.sa-category-head h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sa-category-head h2::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 18px;
  background: #be123c;
}

.sa-poster-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.sa-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sa-card-media {
  position: relative;
  aspect-ratio: 2 / 2.85;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  overflow: hidden;
}

.sa-card-thumb {
  display: block;
  width: 100%;
  height: 100%;
}

.sa-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.sa-card-media:hover .sa-card-thumb img {
  transform: scale(1.03);
}

.sa-card-index {
  position: absolute;
  top: 0;
  left: 0;
  background: #090d16;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  pointer-events: none;
}

.sa-card-play {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: #be123c;
  color: #ffffff;
  border: none;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(9, 13, 22, 0.28);
}

.sa-card-play:hover {
  background: #9f1239;
}

.sa-card-play[aria-busy="true"] {
  opacity: 0.75;
  cursor: wait;
}

.sa-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #090d16;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sa-card-title:hover {
  color: #be123c;
}

.sa-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #475569;
  border-top: 1px solid #f1f5f9;
  padding-top: 6px;
}

/* --------------------------------------------------------------------------
   4. Search Inner Page (.sa-match-banner, .sa-inner-body, .sa-table)
   -------------------------------------------------------------------------- */
.sa-match-banner {
  margin: 24px 0 20px;
  border: 2px solid #090d16;
  background: #f8fafc;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}

.sa-match-poster {
  width: 72px;
  height: 100px;
  border: 1px solid #090d16;
  object-fit: cover;
  background: #090d16;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
}

.sa-match-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.sa-badge-red {
  background: #be123c;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
}

.sa-match-title {
  font-size: 22px;
  font-weight: 700;
  color: #090d16;
  margin: 0 0 6px;
}

.sa-match-desc {
  font-size: 13px;
  color: #475569;
  margin: 0;
}

.sa-match-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.sa-match-btn-row {
  display: flex;
  gap: 8px;
}

.sa-inner-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  padding-top: 16px;
  align-items: start;
}

.sa-facet-group {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  margin-bottom: 18px;
}

.sa-facet-head {
  background: #090d16;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sa-facet-row {
  width: 100%;
  border: none;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
  color: #090d16;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease;
}

.sa-facet-row:hover {
  background: #f8fafc;
}

.sa-facet-row.is-active {
  background: #fff1f2;
  color: #be123c;
  font-weight: 700;
}

.sa-status-card {
  padding: 14px;
  font-size: 12px;
  color: #475569;
  line-height: 1.6;
}

.sa-toolbar-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #090d16;
  border-bottom: none;
  font-size: 13px;
  gap: 12px;
  flex-wrap: wrap;
}

.sa-table {
  width: 100%;
  border: 1px solid #090d16;
  border-collapse: collapse;
  background: #ffffff;
}

.sa-table th {
  background: #f1f5f9;
  border-bottom: 2px solid #090d16;
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.sa-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
  vertical-align: middle;
}

.sa-table tr:hover td {
  background: #f8fafc;
}

.sa-disk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #090d16;
  white-space: nowrap;
}

.sa-disk-badge img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.sa-disk-0 { background: #eff6ff; color: #1d4ed8; border-color: #93c5fd; }
.sa-disk-1 { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }
.sa-disk-2 { background: #f0fdf4; color: #15803d; border-color: #86efac; }
.sa-disk-3 { background: #fff7ed; color: #c2410c; border-color: #fdba74; }
.sa-disk-4 { background: #f0f9ff; color: #0369a1; border-color: #7dd3fc; }

.sa-res-title {
  font-size: 15px;
  font-weight: 700;
  color: #090d16;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 4px;
  line-height: 1.4;
  cursor: pointer;
}

.sa-res-title:hover {
  color: #be123c;
  text-decoration: underline;
}

.sa-res-sub {
  font-size: 12px;
  color: #475569;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sa-valid-dot {
  color: #15803d;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.sa-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.sa-action-outline {
  border: 1px solid #090d16;
  background: #ffffff;
  color: #090d16;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.sa-action-outline:hover {
  background: #f1f5f9;
}

.sa-action-solid {
  border: 1px solid #090d16;
  background: #090d16;
  color: #ffffff;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.sa-action-solid:hover {
  background: #be123c;
  border-color: #be123c;
}

/* --------------------------------------------------------------------------
   5. Footer & Dialogs
   -------------------------------------------------------------------------- */
.sa-footer {
  border-top: 2px solid #090d16;
  background: #f8fafc;
  padding: 28px 24px;
  font-size: 13px;
  color: #334155 !important;
}

.sa-footer p,
.sa-footer span {
  color: #334155 !important;
}

.sa-footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.sa-footer a {
  color: #090d16 !important;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Element Plus Dialog overrides for Swiss Archive */
body.swissArchivePage .el-dialog {
  border-radius: 0 !important;
  border: 2px solid #090d16 !important;
  box-shadow: 0 16px 40px rgba(9, 13, 22, 0.18) !important;
}

body.swissArchivePage .dialogUrl .btn {
  border-radius: 0 !important;
  background: #090d16 !important;
  color: #ffffff !important;
  font-weight: 600;
}

body.swissArchivePage .dialogUrl .btn:hover {
  background: #be123c !important;
}

/* --------------------------------------------------------------------------
   6. Responsive Breakpoints (< 1024px & < 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .sa-hero-grid {
    grid-template-columns: 1fr;
  }
  .sa-hero-left {
    border-right: none;
    border-bottom: 1px solid #cbd5e1;
    padding: 28px 0;
  }
  .sa-hero-right {
    padding: 24px 0;
  }
  .sa-poster-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .sa-inner-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sa-topbar {
    flex-wrap: wrap;
    padding: 12px 16px;
  }
  .sa-nav,
  .sa-status-pill {
    display: none;
  }
  .sa-top-search {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
  .sa-container {
    padding: 0 16px 48px;
  }
  .sa-h1 {
    font-size: 28px;
  }
  .sa-search-scope {
    display: none;
  }
  .sa-hot-matrix {
    grid-template-columns: repeat(2, 1fr);
  }
  .sa-poster-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .sa-match-banner {
    grid-template-columns: 56px 1fr;
    gap: 12px 14px;
    padding: 16px;
  }
  .sa-match-poster {
    width: 56px;
    height: 78px;
    font-size: 20px;
  }
  .sa-match-actions {
    grid-column: 1 / -1;
    align-items: stretch;
  }
  .sa-match-btn-row {
    width: 100%;
  }
  .sa-match-btn-row .sa-btn-red {
    flex: 1;
    justify-content: center;
    white-space: nowrap;
    padding: 10px 14px !important;
    font-size: 13px !important;
  }
  .sa-inner-body aside .sa-facet-group:nth-of-type(n+4) {
    display: none;
  }
  .sa-table thead {
    display: none;
  }
  .sa-table, .sa-table tbody, .sa-table tr, .sa-table td {
    display: block;
    width: 100%;
  }
  .sa-table tr {
    border-bottom: 2px solid #090d16;
    padding: 12px 0;
  }
  .sa-table td {
    border: none;
    padding: 6px 14px;
  }
  .sa-row-actions {
    justify-content: flex-start;
    padding-top: 6px;
  }
}
