* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(900px 260px at 50% -140px, rgba(37, 99, 235, 0.1), transparent 70%),
    #f3f6fb;
  color: #1f2937;
}
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px;
}
.site-logo-link {
  display: inline-flex;
  align-items: center;
  margin: 0 0 10px;
  text-decoration: none;
}
.site-logo {
  display: block;
  height: 40px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(37, 99, 235, 0.2));
}
.head-search-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px 6px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.head-search-toggle .search-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}
.head-category-toggle {
  display: none;
  border: 0;
  background: transparent;
  padding: 4px;
  cursor: pointer;
}
.grid-icon {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
}
.top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.top h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.2px;
  display: none;
}
.back {
  text-decoration: none;
  font-size: 13px;
  color: #fff;
  background: #2563eb;
  border-radius: 999px;
  padding: 6px 10px;
}
.panel {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}
.info {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
}
.poster {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #eef1f6;
}
.meta p { margin: 8px 0; }
.meta span:first-child { color: #6b7280; margin-right: 4px; }
.meta-status { color: #ef4444; }
.meta-actions {
  margin-top: 14px;
  display: flex;
}
.play-now-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  height: 40px;
  border-radius: 6px;
  background: #58c8ef;
  color: #fff;
  text-decoration: none;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.5px;
  line-height: 1;
}
.search-panel[hidden] { display: none !important; }
.search-panel { margin-bottom: 12px; }
.search-row { display: flex; gap: 10px; }
.quick-search-status {
  margin: 8px 2px 0;
  min-height: 18px;
  font-size: 13px;
  color: #6b7280;
}
.head-category-nav {
  display: flex;
  gap: 16px;
  flex-wrap: nowrap;
  overflow: hidden;
  margin: 0;
  flex: 1 1 auto;
}
.head-category-nav .category-tab {
  border: 0;
  background: transparent;
  color: #4b5563;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 0;
}
.head-category-nav .category-tab.active { color: #22a8ff; font-weight: 600; }
.search-input {
  flex: 1;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}
.search-btn {
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #3f7eff 0%, #2563eb 100%);
  color: #fff;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
}
.ep-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ep-head h2 {
  margin: 0;
  font-size: 18px;
}
.episode-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.episode-btn {
  border: 1px solid #e6e9ee;
  border-radius: 4px;
  background: #f3f4f6;
  padding: 8px 6px;
  font-size: 12px;
  color: #4b5563;
  text-align: center;
  cursor: pointer;
  transition: all 0.16s ease;
}
.episode-btn:hover { border-color: #c7d2e3; background: #eceff3; color: #374151; }
.status { color: #6b7280; font-size: 13px; }
.site-footer { margin-top: 20px; padding-top: 12px; border-top: 1px solid #e5e7eb; font-size: 12px; color: #6b7280; text-align: center; line-height: 1.5; min-height: 1.2em; }
.pick-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.pick-modal[hidden] { display: none !important; }
.pick-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.pick-modal-dialog { position: relative; z-index: 1; width: min(440px, 100%); max-height: min(72vh, 520px); overflow: auto; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px 16px 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12); }
.pick-modal-title { margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.pick-modal-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pick-option { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.pick-option:hover { border-color: #93b4f7; background: #f8fafc; }
.pick-option-title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.pick-option-meta { font-size: 12px; color: #6b7280; line-height: 1.35; }
.pick-modal-cancel { width: 100%; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; color: #374151; padding: 10px; font-size: 14px; cursor: pointer; }
@media (max-width: 760px) {
  body {
    background: #ffffff;
  }
  .wrap {
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .top {
    flex-wrap: nowrap;
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid #eceff4;
    background: #fff;
    gap: 10px;
    align-items: center;
  }
  .site-logo-link { margin: 0; }
  .site-logo {
    height: 34px;
    filter: none;
  }
  .head-category-nav {
    display: flex;
    gap: 18px;
    width: auto;
    margin-top: 0;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }
  .head-category-nav::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
  }
  .head-category-nav .category-tab {
    font-size: 16px;
    flex: 0 0 auto;
  }
  .head-search-toggle { margin-left: 0; flex: 0 0 auto; }
  .search-panel {
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid #eceff4;
    background: #fff;
  }
  .panel {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 12px;
    background: #fff;
  }
  .info {
    grid-template-columns: 1fr 126px;
    gap: 10px;
    border-bottom: 1px solid #f1f3f7;
    align-items: start;
  }
  .poster {
    grid-column: 2;
    grid-row: 1;
    width: 126px;
    max-width: 126px;
    margin: 2px 0 0 auto;
    border-radius: 4px;
  }
  .meta {
    grid-column: 1;
    grid-row: 1;
  }
  .meta p {
    margin: 6px 0;
    font-size: 15px;
    color: #333;
    line-height: 1.6;
  }
  .meta p strong {
    font-size: inherit;
    font-weight: 700;
    line-height: 1.2;
    display: inline;
    margin-bottom: 0;
  }
  .meta-actions {
    margin-top: 12px;
  }
  .play-now-btn {
    min-width: 128px;
    height: 50px;
    font-size: 30px;
    border-radius: 8px;
  }
  .site-footer {
    margin-top: 0;
    border-top: 1px solid #f1f3f7;
    padding: 12px;
  }
}
