:root {
  --bg: #071018;
  --panel: #101b25;
  --panel-2: #172635;
  --text: #f4fbff;
  --muted: #9eb0bf;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #ff8a3d;
  --accent-2: #2ee6d6;
  --danger: #ff5c5c;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 138, 61, 0.15), transparent 34rem),
    radial-gradient(circle at 88% 8%, rgba(46, 230, 214, 0.12), transparent 30rem),
    linear-gradient(180deg, #0f1a27 0%, var(--bg) 46rem);
}

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 24, 0.9);
  backdrop-filter: blur(18px);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
  display: grid;
  grid-template-columns: auto 1fr minmax(240px, 320px) auto;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand span:last-child {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(255, 138, 61, 0.1);
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #081112;
  background: var(--accent);
}

.main-nav {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
}

.main-nav a:hover {
  color: var(--text);
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.search-form input {
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  padding: 0 12px;
  outline: none;
}

.search-form input:focus {
  border-color: rgba(255, 138, 61, 0.72);
}

.search-form button,
.primary-btn,
.ghost-btn,
.tab {
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}

.search-form button,
.primary-btn {
  color: #071112;
  background: var(--accent);
  font-weight: 700;
}

.search-form button {
  height: 40px;
  padding: 0 16px;
}

.collect-time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px 56px;
}

.hero {
  position: relative;
  min-height: 500px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: end;
  gap: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 52px;
  background: #101b25;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 16, 24, 0.94) 0%, rgba(15, 26, 39, 0.72) 52%, rgba(15, 26, 39, 0.18) 100%);
  z-index: 1;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content,
.hero-panel {
  position: relative;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: 52px;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 560px;
  color: #c8d2dc;
  font-size: 18px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
}

.ghost-btn {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.hero-panel {
  align-self: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 27, 37, 0.84);
  padding: 20px;
}

.hero-panel span,
.hero-panel p {
  color: var(--muted);
}

.hero-panel strong {
  display: block;
  margin: 8px 0;
  font-size: 22px;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0 34px;
}

.quick-stats div,
.rank-box,
.guide-box,
.movie-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 27, 37, 0.92);
}

.quick-stats div {
  padding: 18px;
}

.quick-stats strong {
  display: block;
  font-size: 28px;
}

.quick-stats span {
  color: var(--muted);
}

.section-block {
  margin-top: 0;
}

.latest-update {
  margin-bottom: 34px;
}

.more-button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.more-button:hover {
  color: #071112;
  border-color: transparent;
  background: var(--accent-2);
}

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

.section-head h2,
.guide-box h2 {
  margin: 0;
  font-size: 30px;
}

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

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 16px;
}

.tab,
.category-tab {
  min-height: 36px;
  padding: 0 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.category-tab {
  min-height: 32px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
}

.tab.active,
.category-tab.active {
  color: #071112;
  background: var(--accent-2);
  border-color: transparent;
}

.card-grid,
.movie-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.card,
.movie-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 16px 34px -10px rgba(0, 0, 0, .6);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  z-index: 2;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.card:hover,
.movie-card:hover {
  transform: translateY(-8px);
  border-color: rgba(46, 230, 214, 0.5);
  box-shadow: 0 24px 46px -12px rgba(255, 138, 61, .22);
}

.type-sections {
  display: grid;
  gap: 30px;
  margin-top: 34px;
}

main > .type-sections:first-child {
  margin-top: 0;
}

.type-section {
  min-width: 0;
}

.type-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.type-section-head h3 {
  margin: 0;
  font-size: 24px;
}

.type-section-head h3 span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.type-section-head button,
.type-more {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.type-section-head button:hover,
.type-more:hover {
  color: #071112;
  border-color: transparent;
  background: var(--accent-2);
}

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

.type-page-head h1 {
  margin: 0;
  font-size: 30px;
}

.type-page-head span {
  color: var(--muted);
  font-size: 15px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.pager a,
.pager span,
.pager strong {
  min-width: 82px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
}

.pager a {
  color: var(--accent);
}

.pager strong {
  min-width: 110px;
  color: var(--text);
}

.type-grid {
  margin-bottom: 2px;
}

.cover-link,
.poster {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  background: #0b0f15;
}

.card-img,
.poster img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

.card-badge,
.score,
.tag {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.card-badge {
  z-index: 3;
  color: var(--accent-2);
  background: rgba(0, 0, 0, .78);
}

.score {
  left: 10px;
  color: #111;
  background: var(--accent-2);
}

.tag {
  right: 10px;
  color: #fff;
  background: rgba(10, 15, 22, 0.72);
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-body,
.movie-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 13px 12px 15px;
}

.card-body h3,
.movie-info h3 {
  width: 100%;
  min-height: 0;
  margin: 0 0 7px;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-body p,
.movie-info p {
  flex: 1;
  width: 100%;
  margin: 0 0 12px;
  color: var(--muted);
  overflow: hidden;
  font-size: 13px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-btn,
.card-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  border: 1.6px solid var(--accent);
  border-radius: 24px;
  padding: 8px 24px;
  color: var(--accent);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.card-btn:hover,
.card-play-btn:hover {
  color: #071112;
  background: var(--accent);
}

.detail-page {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 27, 37, 0.92);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
}

.detail-info h1 {
  max-width: none;
  margin-bottom: 14px;
  font-size: 32px;
}

.detail-info p {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.7;
}

.detail-info .desc {
  color: #c8d2dc;
}

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

.episode-links a {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.episode-links a.active,
.episode-links a:hover {
  color: #071112;
  border-color: transparent;
  background: var(--accent-2);
}

.player-page {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(16, 27, 37, 0.92);
}

.player-page h1 {
  max-width: none;
  margin-bottom: 14px;
  font-size: 28px;
}

.player-page h1 span {
  color: var(--accent-2);
  font-size: 18px;
}

.player-page video {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 520px;
  display: block;
  object-fit: contain;
  background: #000;
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 34px;
}

.rank-box,
.guide-box {
  padding: 22px;
}

.compact {
  margin-bottom: 10px;
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rank-list li {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.rank-list li:last-child {
  border-bottom: 0;
}

.rank-list b {
  color: var(--accent-2);
}

.rank-list span {
  color: var(--muted);
  font-size: 13px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recommend-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.recommend-item {
  width: 100%;
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.recommend-item:hover {
  border-color: rgba(46, 230, 214, 0.5);
  background: rgba(46, 230, 214, 0.08);
}

.recommend-item img {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
}

.recommend-item strong,
.recommend-item em {
  display: block;
}

.recommend-item strong {
  margin-bottom: 3px;
  font-size: 14px;
}

.recommend-item em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
}

.modal.open {
  display: flex;
}

.modal-card {
  position: relative;
  width: min(1320px, 100%);
  display: grid;
  grid-template-columns: minmax(760px, 2.4fr) minmax(260px, 0.7fr);
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px;
}

.modal-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 520px;
  object-fit: contain;
  background: #000;
  border-radius: var(--radius);
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.full {
  width: 100%;
  margin-top: 20px;
  border: 0;
}

.episode-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  margin-top: 16px;
}

.episode-list button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.episode-list button.active,
.episode-list button:hover {
  color: #071112;
  border-color: transparent;
  background: var(--accent-2);
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  padding: 28px 16px;
  background: #0b0f15;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .header-inner {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 10px;
    padding: 10px 12px;
  }

  .brand {
    min-width: 0;
  }

  .brand span:last-child {
    font-size: 20px;
    min-height: 36px;
    padding: 0 14px;
    white-space: nowrap;
  }

  .search-form {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .search-form input {
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .search-form button {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  .collect-time {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 12px;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 3;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 560px;
    padding: 34px;
  }

  h1 {
    font-size: 40px;
  }

  .quick-stats,
  .card-grid,
  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-section {
    grid-template-columns: 1fr;
  }

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

  .detail-page {
    grid-template-columns: 1fr;
  }

  .player-page video {
    min-height: auto;
  }

  .modal-card video {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  main {
    padding: 0 12px 42px;
  }

  .hero {
    min-height: 620px;
    padding: 26px 18px;
  }

  .hero::before {
    background: linear-gradient(180deg, rgba(13, 17, 23, 0.72), rgba(13, 17, 23, 0.98));
  }

  h1 {
    font-size: 32px;
  }

  .section-head {
    display: block;
  }

  .tabs {
    margin-top: 14px;
  }

  .category-tabs {
    max-height: 84px;
    overflow: auto;
  }

  .quick-stats {
    grid-template-columns: 1fr 1fr;
  }

  .card-grid,
  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .card-body,
  .movie-info {
    padding: 8px;
  }

  .card-body h3,
  .movie-info h3 {
    min-height: 36px;
    font-size: 13px;
  }

  .card-body p,
  .movie-info p {
    font-size: 11px;
  }

  .card-btn,
  .card-play-btn {
    min-height: 30px;
    padding: 0 8px;
  }

  .detail-page,
  .player-page {
    margin-top: 10px;
    padding: 12px;
  }

  .detail-info h1,
  .player-page h1 {
    font-size: 24px;
  }

  .score,
  .tag {
    top: 7px;
    padding: 3px 6px;
    font-size: 10px;
  }

  .modal-card {
    grid-template-columns: 1fr;
    max-height: 90vh;
    overflow: auto;
  }
}

body.layout-soma main {
  max-width: 1360px;
}

body.layout-soma .header-inner {
  grid-template-columns: auto auto minmax(340px, 1fr) auto;
}

body.layout-soma .latest-update .card-grid,
body.layout-soma .type-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

body.layout-soma .card-body {
  padding: 11px 10px 13px;
}

body.layout-soma .card-btn {
  min-height: 34px;
  padding: 7px 18px;
}

body.layout-soma .split-section {
  grid-template-columns: minmax(0, 1fr);
}

body.layout-soma .recommend-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 980px) {
  body.layout-soma .latest-update .card-grid,
  body.layout-soma .type-grid,
  body.layout-soma .recommend-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 20260625: keep homepage category sections visually aligned. */
body.layout-soma #typeSectionsTop,
body.layout-soma #typeSections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
  margin-top: 34px;
}

body.layout-soma .type-section {
  min-width: 0;
}

body.layout-soma .type-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

body.layout-soma .type-section-head {
  min-height: 38px;
}

@media (max-width: 980px) {
  body.layout-soma #typeSectionsTop,
  body.layout-soma #typeSections,
  body.layout-soma .type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.layout-soma .type-section {
    grid-column: 1 / -1;
  }
}
