:root {
  --page-bg: #f8f8f8;
  --panel: #fff;
  --text: #000;
  --muted: #626262;
  --accent: #b04141;
  --shadow: 0 0 10px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  font-size: 10px;
}

body {
  margin: 8px;
  min-height: 100%;
  background: var(--page-bg);
  color: var(--text);
  font-family: Roboto, Arial, "Microsoft YaHei", sans-serif;
  font-size: 14.5px;
  font-weight: 300;
  line-height: 1.42857143;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.page-wrapper {
  min-height: 100%;
  overflow: hidden;
}

.container {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 0.1%;
}

header {
  position: relative;
  padding: 10px 0;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.header-wrapper {
  display: flex;
  align-items: center;
  min-height: 42px;
}

.site-logo {
  display: block;
  width: 200px;
  height: 42px;
  line-height: 42px;
  text-align: center;
}

.site-logo h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
}

.engine-types {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 5px;
  margin: 8px;
}

.source-grid a {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 4px 2px;
  border-radius: 5px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 16px;
  line-height: 22px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

.source-grid a:hover {
  background: rgba(176, 65, 65, 0.75);
  color: #fff;
}

.recommend-section {
  margin-top: 96px;
}

.recommend-section h2,
.friend-section h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  line-height: 28px;
  text-align: center;
}

.site-search {
  display: flex;
  width: min(500px, calc(100% - 32px));
  height: 48px;
  margin: 28px auto 30px;
  gap: 10px;
}

.site-search input {
  min-width: 0;
  flex: 1;
  padding: 0 18px;
  border: 1px solid #e2e2e2;
  border-radius: 24px;
  background: #fff;
  color: #555;
  font-size: 16px;
  outline: 0;
}

.site-search button {
  width: 92px;
  border: 1px solid #e2e2e2;
  border-radius: 24px;
  background: #fff;
  color: #222;
  font-size: 16px;
  cursor: pointer;
}

.tag-panel {
  margin: 8px;
  padding: 12px;
  border: 1px solid #ddd;
  background: #fff;
  box-shadow: var(--shadow);
}

.tag-panel h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 7px;
}

.tag-list a {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 3px 8px;
  border: 1px solid #ddd;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.18);
  color: #333;
  font-size: 16px;
  line-height: 20px;
  white-space: nowrap;
}

.section-main {
  margin-top: 16px;
}

.video-section h2 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 400;
}

.video-grid {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -6px;
}

.main-card {
  width: 25%;
  margin-bottom: 20px;
  padding: 0 0.5%;
}

.video-unit {
  display: block;
  overflow: hidden;
  padding-bottom: 1px;
  border-radius: 3px;
  background: #fff;
  box-shadow: var(--shadow);
}

.video-pic {
  display: block;
  height: 203px;
  margin-bottom: 4px;
  background: #eee;
  overflow: hidden;
}

.video-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-caption {
  display: block;
  height: 32px;
  overflow: hidden;
  padding: 0 10px;
  font-size: 14.5px;
  line-height: 16px;
}

.video-unit:hover {
  background: var(--accent);
  color: #fff;
}

.footer-content {
  margin-top: 12px;
}

.friend-section {
  padding-top: 8px;
}

.source-grid-friends .dynamic-flink {
  display: flex;
}

.tag-panel-bottom {
  margin-top: 32px;
}

footer {
  margin-top: 10px;
  padding: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.footer-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 110px;
}

.footer-logo {
  display: block;
  margin-bottom: 22px;
}

.footer-copywriting {
  font-size: 14px;
  line-height: 14px;
  text-align: center;
}

.footer-copywriting p {
  margin: 0 0 10px;
}

.pagination,
.play-lines div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.pagination {
  margin: 22px 0;
}

.pagination a,
.play-lines a {
  padding: 7px 11px;
  border-radius: 4px;
  background: #fff;
  box-shadow: var(--shadow);
  color: #333;
}

.detail-panel {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  padding: 18px 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.detail-cover {
  width: 280px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.detail-info h2,
.player-main h2,
.playlist h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.detail-content {
  line-height: 1.7;
}

.play-lines section {
  margin: 12px 0;
}

.play-lines h3 {
  margin: 6px 0;
  font-size: 16px;
  font-weight: 400;
}

.player-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(270px, 1fr);
  gap: 12px;
  padding: 18px 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.player-box {
  aspect-ratio: 16 / 9;
  background: #000;
}

.player-box iframe,
.player-box video {
  width: 100% !important;
  height: 100% !important;
}

.playlist {
  max-height: 620px;
  padding: 12px;
  background: #f8f8f8;
  overflow: auto;
}

body > .mac-flinks {
  display: none !important;
}

@media (max-width: 1400px) {
  .source-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .video-pic { height: 176px; }
}

@media (max-width: 1200px) {
  .source-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .video-pic { height: 150px; }
}

@media (max-width: 1000px) {
  .source-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .video-pic { height: 123px; }
}

@media (max-width: 750px) {
  .source-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .recommend-section { margin-top: 34px; }
  .site-search { margin: 22px auto; }
  .detail-panel { grid-template-columns: 120px minmax(0, 1fr); gap: 10px; padding: 10px 6px; }
  .detail-cover { width: 120px; }
  .player-layout { grid-template-columns: 1fr; padding: 10px 6px; }
  .playlist { max-height: none; }
}

@media (max-width: 470px) {
  .source-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 400px) {
  header { padding: 8px 0; }
  .source-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .source-grid a { font-size: 14px; line-height: 22px; }
  .recommend-section { margin-top: 22px; }
  .site-search { height: 44px; margin: 20px auto; }
  .site-search input { font-size: 14px; padding: 0 12px; }
  .site-search button { width: 72px; font-size: 14px; }
  .tag-panel { padding: 10px; }
  .tag-list { gap: 4px 5px; }
  .tag-list a { min-height: 26px; padding: 2px 6px; font-size: 14px; }
  .main-card { width: 50%; margin-bottom: 18px; padding: 0 3px; }
  .video-pic { height: auto; min-height: 103px; aspect-ratio: 16 / 9; }
  .video-caption { font-size: 13px; }
  .tag-panel-bottom { margin-top: 22px; }
  footer { margin-top: 0; }
  .footer-logo { margin-bottom: 16px; }
}
