/**
 * twigspike theme — Bilibili 桌面站复刻
 */
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: url("../img/bg-pattern.png");
  background-size: 480px 480px;
  background-repeat: repeat;
  color: var(--text);
  font: 14px / 1.5 var(--font);
  min-height: 100dvh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; cursor: pointer; }
button { cursor: pointer; font: inherit; }
a:focus-visible,
button:focus-visible,
.fitem:focus-visible,
.pg a:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
img { max-width: 100%; display: block; }
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 8px;
  width: 100%;
}
main, .layout, .rail, .bili-top { min-width: 0; max-width: 100%; }

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
  background: var(--pink);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}
.skip-link:focus { left: 8px; top: 8px; }

/* ========== 顶栏（B站白底） ========== */
.hd {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.hd .wrap {
  position: relative;
}
.hd-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--nav-h);
  padding: 8px 0;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 200px;
  line-height: 0;
  border-radius: var(--radius-sm);
  transition: opacity var(--dur) var(--ease);
}
.brand:hover { opacity: 0.88; }
.brand:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}
.brand__logo {
  display: block;
  height: 42px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
}
.brand__text {
  font-weight: 800;
  font-size: 22px;
  color: var(--pink);
  letter-spacing: 0.02em;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}
.nav a {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav a:hover,
.nav a.on {
  color: var(--pink);
  background: var(--pink-soft);
}
.nav a:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.hd-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.hd-right > a {
  min-height: 36px;
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.hd-right > a:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.sbox {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  overflow: hidden;
  width: min(320px, 42vw);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.sbox:focus-within {
  background: #fff;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-soft);
}
.sbox input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  color: var(--text);
  padding: 10px 14px;
  outline: none;
  font-size: 13px;
  min-height: 40px;
}
.sbox button {
  background: var(--pink);
  border: 0;
  color: #fff;
  padding: 0 18px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur) var(--ease), filter var(--dur) var(--ease);
}
.sbox button:hover { background: var(--pink-hover); }
.sbox button:active { filter: brightness(0.95); }
.sbox button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
.nav-lang { color: var(--muted); padding: 6px; }
.nav-lang:hover { color: var(--pink); }
.hd-right > a:hover { color: var(--pink); background: var(--pink-soft); }

/* 语言下拉 */
.lang-dd {
  position: relative;
  flex: 0 0 auto;
}
.lang-dd__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  min-width: 44px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.lang-dd__btn:hover { border-color: var(--pink); color: var(--pink); }
.lang-dd__btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.lang-dd__btn[aria-expanded="true"] {
  border-color: var(--pink);
  color: var(--pink);
  box-shadow: 0 0 0 3px var(--pink-soft);
}
.lang-dd__caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
  transition: transform var(--dur) var(--ease);
}
.lang-dd__btn[aria-expanded="true"] .lang-dd__caret {
  transform: rotate(180deg);
}
.lang-dd__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 60;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  min-width: 132px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
.lang-dd__menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 10px 14px;
  min-height: 40px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.lang-dd__menu button:hover,
.lang-dd__menu button:focus-visible {
  background: var(--pink-soft);
  color: var(--pink);
  outline: none;
}

.hd-sub {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 0 0 10px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.hd-sub a {
  color: var(--muted);
  font-size: 13px;
  padding: 6px 10px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.hd-sub a:hover {
  color: var(--pink);
  background: var(--pink-soft);
}
.hd-sub a:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.hd-sub a.on,
.hd-sub a[aria-current="page"] {
  color: var(--pink);
  background: var(--pink-soft);
  font-weight: 600;
}

.hd-menu {
  display: none;
  position: relative;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  flex: 0 0 auto;
}
.hd-menu__bar {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 20px;
  height: 2px;
  margin-left: -10px;
  margin-top: -1px;
  background: currentColor;
  border-radius: 1px;
  transform-origin: center center;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.hd-menu__bar:nth-child(1) {
  transform: translateY(-7px);
}
.hd-menu__bar:nth-child(2) {
  transform: translateY(0);
}
.hd-menu__bar:nth-child(3) {
  transform: translateY(7px);
}
.hd-menu[aria-expanded="true"] .hd-menu__bar:nth-child(1) {
  transform: translateY(0) rotate(45deg);
}
.hd-menu[aria-expanded="true"] .hd-menu__bar:nth-child(2) {
  opacity: 0;
  transform: translateY(0);
}
.hd-menu[aria-expanded="true"] .hd-menu__bar:nth-child(3) {
  transform: translateY(0) rotate(-45deg);
}

@media (max-width: 960px) {
  .hd-main {
    flex-wrap: nowrap;
    gap: 8px;
    min-height: 56px;
  }
  .hd-menu { display: inline-flex; }
  .brand__logo { height: 36px; max-width: 140px; }
  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--space-4) 12px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    max-height: min(70vh, 420px);
    overflow-y: auto;
    z-index: 60;
  }
  body.hd-nav-open .nav { display: flex; }
  .nav a {
    min-height: 44px;
    padding: 10px 12px;
  }
  .hd-right { gap: 6px; }
  .hd-right .sbox { max-width: 140px; }
  .hd-sub {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    gap: 2px;
    padding-bottom: 8px;
  }
  .hd-sub::-webkit-scrollbar { display: none; }
  .hd-sub a {
    flex: 0 0 auto;
    min-height: 36px;
    white-space: nowrap;
  }
}
@media (max-width: 480px) {
  .hd-right .sbox { max-width: 110px; }
  .lang-dd__btn { padding-left: 8px; padding-right: 8px; }
}

/* ========== 版心 ========== */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 280px);
  gap: 20px;
  padding: 16px 0 0;
}
.layout.solo,
.layout.home { grid-template-columns: minmax(0, 1fr); }
.layout:has(> .side-aside),
.layout.with-sidebar { grid-template-columns: minmax(0, 1fr) minmax(0, 280px); }
@media (max-width: 960px) {
  .layout,
  .layout:has(> .side-aside),
  .layout.with-sidebar { grid-template-columns: minmax(0, 1fr); }
  .side.side-aside { display: none; }
}

/* ========== 首页：轮播 + 排行 ========== */
.bili-top {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  margin-bottom: 24px;
  align-items: stretch;
}
@media (max-width: 960px) {
  .bili-top { grid-template-columns: 1fr; }
}

.bili-banner {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  min-height: 220px;
}
.bili-banner__slides {
  position: relative;
  width: 100%;
  height: 100%;
}
.bili-banner__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}
.bili-banner__slide.is-on {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}
.bili-banner__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bili-banner__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 16px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  z-index: 2;
}
.bili-banner__dots {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  display: flex;
  gap: 6px;
}
.bili-banner__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}
.bili-banner__dot.is-on {
  background: var(--pink);
  width: 16px;
  border-radius: 4px;
}

.bili-rank {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 12px 14px 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.bili-rank__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 700;
  flex: 0 0 auto;
}
.bili-rank__head a {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.bili-rank__head a:hover { color: var(--pink); }
.bili-rank ol {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
}
.bili-rank li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.bili-rank li:last-child { border-bottom: 0; }
.bili-rank__n {
  flex: 0 0 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  border-radius: 2px;
  color: #fff;
  background: var(--rank-n);
}
.bili-rank li:nth-child(1) .bili-rank__n { background: var(--rank-1); }
.bili-rank li:nth-child(2) .bili-rank__n { background: var(--rank-2); }
.bili-rank li:nth-child(3) .bili-rank__n { background: var(--rank-3); color: #333; }
.bili-rank a {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.bili-rank a:hover { color: var(--pink); }
.bili-rank em {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}

/* ========== 分区标题 ========== */
.sec,
.rail__head,
.bili-sec__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}
.sec .more,
.rail__head .more,
.bili-sec__head .more {
  margin-left: auto;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.sec .more:hover,
.rail__head .more:hover,
.bili-sec__head .more:hover {
  color: var(--pink);
  background: var(--pink-soft);
}
.sec .more:focus-visible,
.rail__head .more:focus-visible,
.bili-sec__head .more:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.sec small { color: var(--muted); font-weight: 400; font-size: 13px; }

.bili-sec { margin-bottom: 32px; }

/* ========== 投稿卡 16:9 ========== */
.grid,
.bili-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px 12px;
}
@media (max-width: 1100px) {
  .grid, .bili-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 800px) {
  .grid, .bili-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .grid, .bili-grid { grid-template-columns: repeat(2, 1fr); }
}

.card {
  background: transparent;
  border: 0;
  min-width: 0;
}
.card .pic {
  display: block;
  position: relative;
  aspect-ratio: var(--cover-ratio);
  background-color: #e7e7e7;
  background-image: url("../img/cover-placeholder.png");
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: box-shadow var(--dur) var(--ease);
}
.card .pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.22s ease, opacity var(--dur) var(--ease);
}
/* 懒载中：半透明，露出下方占位底图 */
.card .pic img[src*="loading.png"],
.card .pic img[src^="data:image/gif"] {
  opacity: 0.35;
  object-fit: cover;
}
.card__play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background: url("../svg/play-btn.svg") center / contain no-repeat;
  box-shadow: 0 4px 14px rgba(251, 114, 153, 0.45);
  opacity: 0;
  transform: scale(0.86);
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
@media (prefers-reduced-motion: no-preference) {
  .card:hover .pic img { transform: scale(1.04); }
  .card:hover .pic {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  }
  .card:hover .card__play {
    opacity: 1;
    transform: scale(1);
  }
}
@media (hover: none) {
  .card__play {
    opacity: 0.92;
    transform: scale(1);
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    right: 8px;
    left: auto;
    top: auto;
    bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }
}
.card .rk {
  position: absolute;
  left: 6px;
  top: 6px;
  min-width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  padding: 0 5px;
  background: var(--pink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 2px;
  z-index: 2;
}
.card .rk.is-1 { background: var(--rank-1); }
.card .rk.is-2 { background: var(--rank-2); }
.card .rk.is-3 { background: var(--rank-3); color: #333; }
.card .rm {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 2px;
  z-index: 2;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .sc {
  position: absolute;
  left: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 2px;
  z-index: 2;
}
.card .t {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  color: var(--text);
}
.card .t a {
  color: inherit;
  transition: color var(--dur) var(--ease);
}
.card .t a:hover { color: var(--pink); }
.card .t a:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 2px;
}
.card .m {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .mac_ulog { display: none; }

/* 横向轨（少用，保留兼容） */
.rail { margin: 0 0 24px; min-width: 0; }
.rail__track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.rail__item {
  flex: 0 0 200px;
  width: 200px;
  scroll-snap-align: start;
}

/* ========== 侧栏 / 筛选 / 分页 ========== */
.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.panel h3 { margin: 0 0 10px; font-size: 15px; }
.rank { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rank li {
  counter-increment: r;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.rank li:last-child { border-bottom: 0; }
.rank li::before {
  content: counter(r);
  flex: 0 0 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 2px;
  background: var(--rank-n);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.rank li:nth-child(1)::before { background: var(--rank-1); }
.rank li:nth-child(2)::before { background: var(--rank-2); }
.rank li:nth-child(3)::before { background: var(--rank-3); color: #333; }
.rank li a { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank li a:hover { color: var(--pink); }
.rank li em { color: var(--muted); font-style: normal; font-size: 12px; }
.taglist { display: flex; flex-wrap: wrap; gap: 8px; }
.taglist a {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 13px;
  color: var(--muted);
}
.taglist a:hover,
.taglist a.on { color: var(--pink); background: var(--pink-soft); }

.filters {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 4px 14px;
  margin-bottom: 16px;
}
.frow {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
/* 筛选页由 bili.css 接管单行布局，避免标签与选项折行 */
.filters .frow {
  flex-wrap: nowrap;
  align-items: center;
}
.frow:last-child { border-bottom: 0; }
.frow > span:first-child {
  flex: 0 0 48px;
  color: var(--muted);
  font-size: 13px;
  padding-top: 4px;
}
.fitem {
  font-size: 13px;
  color: var(--text);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
}
.fitem:hover { color: var(--pink); }
.fitem.on { background: var(--pink); color: #fff; }

/* 旧 .pg 类名保留兼容，实际样式由 .bili-paging 接管 */
.pg.bili-paging {
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* ========== 详情 / 选集 / 表单 ========== */
.dt {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
}
.dt-pic { flex: 0 0 200px; }
.dt-pic img {
  width: 200px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  background: #eee;
}
.dt-body { flex: 1; min-width: 260px; }
.dt-body h1 { margin: 0 0 8px; font-size: 22px; }
.dt-body dl {
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  font-size: 13px;
}
.dt-body dt { color: var(--muted); }
.dt-body dd { margin: 0; }
.dt-act { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 20px;
  background: var(--pink);
  color: #fff;
  border: 0;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:hover {
  background: var(--pink-hover);
  color: #fff;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.btn.ghost {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn.ghost:hover {
  border-color: var(--pink);
  color: var(--pink);
  background: var(--pink-soft);
}
.btn--play::before {
  content: "";
  width: 0;
  height: 0;
  flex: 0 0 auto;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #fff;
  margin-right: 2px;
}
.btn--play {
  min-height: 44px;
  padding: 0 24px;
  box-shadow: 0 4px 12px rgba(251, 114, 153, 0.35);
}
.btn--play:hover {
  color: #fff;
  background: var(--pink-hover);
  box-shadow: 0 6px 16px rgba(251, 114, 153, 0.45);
}
.mac_ulog {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.dt-act .mac_ulog { display: inline-flex; }
.mac_ulog.is_fav {
  background: var(--pink-soft);
  border-color: var(--pink);
  color: var(--pink);
}
.digg_link { color: var(--muted); font-size: 13px; margin-right: 8px; }
.digg_link:hover { color: var(--pink); }
.prose {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 16px;
  font-size: 14px;
  line-height: 1.8;
}

/* 选集样式以 player.css 为准，避免双份冲突 */

.mac-ep-nav { display: flex; gap: 8px; margin: 12px 0; }
.mac-ep-nav a {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text);
}
.mac-ep-nav a:hover { color: var(--pink); border-color: var(--pink); }
.mac-gate {
  background: #fff;
  border: 1px solid var(--pink);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}
.mac-gate a { color: var(--pink); margin: 0 8px; }

.rows {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.row {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: 0; }
.row-fig { flex: 0 0 120px; }
.row-fig img {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #eee;
}
.row-b { flex: 1; min-width: 0; }
.row-b h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.row-b h4 a:hover { color: var(--pink); }
.row-b p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.row-b .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

.form {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  max-width: 420px;
}
.form input,
.form textarea {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 10px 12px;
  min-height: 40px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.form textarea { min-height: 90px; resize: vertical; }
.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--pink);
  background: #fff;
}
.form button {
  background: var(--pink);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 22px;
  min-height: 40px;
  font-weight: 600;
}
.mac-comments { margin-top: 12px; }
.mac-comments > div {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.mac-comments img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee url("../img/avatar-placeholder.png") center / cover no-repeat;
}
.mac-comments p { margin: 4px 0 0; font-size: 13px; line-height: 1.55; }

/* ---- 评论区（B站风组件 comment_block.twig） ---- */
/* 评论区样式已迁至 asset/css/components/comment.css */
.mac-crumb a:hover { color: var(--pink); }
.mac-crumb span { margin: 0 6px; }
.mac-empty { color: var(--muted); text-align: center; padding: 32px 0; }
.ad {
  display: block;
  margin-bottom: 14px;
  border-radius: var(--radius);
  overflow: hidden;
}
.ad img { width: 100%; }

/* 播放器外壳：细节见 player.css */
.mac-player {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* ========== 页脚 ========== */
.ft {
  margin-top: 40px;
  padding: 28px 0 24px;
  background: #fff;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}
.ft-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}
@media (max-width: 800px) {
  .ft-grid { grid-template-columns: 1fr 1fr; }
}
.ft-brand {
  font-weight: 800;
  font-size: 18px;
  color: var(--pink);
  margin-bottom: 6px;
}
.ft-brand--logo {
  display: inline-block;
  line-height: 0;
}
.ft-brand--logo img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}
.ft-desc { margin: 0; line-height: 1.6; }
.ft h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text);
}
.ft .fl { display: flex; flex-direction: column; gap: 6px; }
.ft .fl a:hover { color: var(--pink); }
.ft-copy {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-size: 12px;
}
.mac-toast {
  position: fixed;
  left: 50%;
  top: calc(var(--nav-h, 56px) + 12px);
  bottom: auto !important;
  z-index: 99999;
  max-width: min(92vw, 420px);
  margin: 0;
  padding: 10px 18px;
  border-radius: var(--radius-lg);
  background: rgba(24, 25, 28, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  transform: translateX(-50%) translateY(-14px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  transition:
    opacity 0.28s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.mac-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}
.mac-toast[hidden] { display: none !important; }
@media (max-width: 768px) {
  .mac-toast {
    top: calc(var(--nav-h, 56px) + 8px);
    max-width: min(94vw, 360px);
    font-size: 13px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mac-toast { transition: none; }
}

/* 旧 hero 类隐藏残留（若有） */
.hero { display: none !important; }

/* ---- 详情标签 / 简介 ---- */
.dt-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.dt-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  color: var(--muted);
  font-size: 12px;
}
.dt-tag--score {
  background: var(--pink-soft);
  color: var(--pink);
  font-weight: 700;
}
.dt-blurb {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.dt-body a:not(.btn):hover { color: var(--pink); }
.form--wide { max-width: none; }

/* ---- 登录/注册面板 ---- */
.auth-panel {
  max-width: 420px;
  margin: 40px auto 60px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 28px 22px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.auth-panel__title {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
}
.form--auth {
  background: transparent;
  border: 0;
  padding: 0;
  max-width: none;
  box-shadow: none;
}
.auth-panel__links {
  display: flex;
  justify-content: space-between;
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.auth-panel__links a:hover { color: var(--pink); }

/* ---- 登录卡片（弹窗 + 独立页） ---- */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
.auth-modal[hidden] { display: none !important; }
.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 20, 0.58);
  backdrop-filter: blur(4px);
}
.auth-modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  animation: auth-modal-in 0.24s ease-out;
}
.auth-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 38%) 1fr;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.22);
  min-height: 420px;
}
.auth-card--page {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
}
.auth-card--wide.auth-card--page { max-width: 860px; }
.auth-card--recovery { min-height: 0; }
.auth-modal__dialog--wide { max-width: 860px; }
.auth-card__visual {
  position: relative;
  min-height: 100%;
  background: linear-gradient(145deg, #ffc9da 0%, #fb7299 48%, #6ec5f0 100%);
}
.auth-card__art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.auth-card__visual-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 10, 14, 0.08) 0%, rgba(8, 10, 14, 0.55) 100%),
    linear-gradient(135deg, rgba(251, 114, 153, 0.35) 0%, transparent 55%);
  pointer-events: none;
}
.auth-card__brand {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 24px;
  color: #fff;
}
.auth-card__logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  padding: 8px;
  box-sizing: border-box;
  backdrop-filter: blur(6px);
}
.auth-card__welcome {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.02em;
}
.auth-card__hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
}
.auth-card__body {
  position: relative;
  padding: 32px 32px 26px;
  display: flex;
  flex-direction: column;
}
.auth-card__body--scroll {
  max-height: min(90vh, 760px);
  overflow-y: auto;
}
.auth-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}
.auth-steps__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.auth-steps__item.is-on { color: var(--pink); }
.auth-steps__num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.auth-steps__item.is-on .auth-steps__num {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
}
.auth-steps__line {
  width: 36px;
  height: 1px;
  background: var(--border);
}
.auth-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.auth-modal__close:hover {
  background: #eceef0;
  color: var(--text);
}
.auth-modal__close:active { transform: scale(0.96); }
.auth-card__head { margin-bottom: 22px; }
.auth-card__head--compact { margin-bottom: 12px; }
.auth-card__title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
}
.auth-card__sub {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.auth-form { margin: 0; }
.auth-form--dense .auth-field { margin-bottom: 8px; }
.auth-form--dense .auth-field__label {
  margin-bottom: 4px;
  font-size: 12px;
}
.auth-form--dense .auth-field__input {
  min-height: 38px;
  padding: 7px 12px;
  font-size: 13px;
}
.auth-form--dense .auth-captcha__img { height: 38px; }
.auth-form--dense .auth-form__submit {
  margin-top: 4px;
  min-height: 40px;
  font-size: 14px;
}
.auth-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}
.auth-form__row .auth-field { margin-bottom: 8px; }
.auth-field--full { grid-column: 1 / -1; }
.auth-recovery__tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface2);
}
.auth-recovery__tab {
  flex: 1;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.auth-recovery__tab:hover { color: var(--text2); }
.auth-recovery__tab.is-on {
  background: #fff;
  color: var(--pink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.auth-recovery__panel[hidden] { display: none !important; }
.auth-steps--compact { margin-bottom: 12px; }
.auth-steps--compact .auth-steps__num {
  width: 20px;
  height: 20px;
  font-size: 10px;
}
.auth-steps--compact .auth-steps__text { font-size: 11px; }
.auth-field {
  display: block;
  margin-bottom: 14px;
}
.auth-field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
}
.auth-field__input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.auth-field__input::placeholder { color: #b8bcc2; }
.auth-field__input:focus {
  outline: none;
  border-color: var(--pink);
  background: #fff;
  box-shadow: 0 0 0 3px var(--pink-soft);
}
.auth-field--captcha .auth-captcha {
  display: flex;
  gap: 10px;
  align-items: center;
}
.auth-captcha__img {
  flex: 0 0 auto;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: #fff;
}
.auth-form__submit {
  width: 100%;
  margin-top: 6px;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #fb7299 0%, #ff8fab 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.auth-form__submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 24px var(--accent-glow);
}
.auth-form__submit:active { transform: scale(0.98); }
.auth-form__submit:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}
.auth-card__foot {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
}
.auth-card__link {
  color: var(--text2);
  font-weight: 500;
  transition: color 0.15s ease;
}
.auth-card__link:hover { color: var(--pink); }
.auth-card__sep { color: var(--border); user-select: none; }
body.has-auth-modal { overflow: hidden; }

/* 分享弹层样式已迁至 asset/css/components/share-sheet.css（components/share_sheet.twig） */

.page-auth {
  background: linear-gradient(160deg, #f6f7f8 0%, #eef1f5 55%, #fde8ef 100%);
}
.auth-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
@keyframes auth-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 640px) {
  .auth-modal { padding: 12px; }
  .auth-modal__dialog { max-width: 420px; }
  .auth-modal__dialog--wide { max-width: 420px; }
  .auth-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .auth-card__visual {
    min-height: 0;
    height: auto;
  }
  .auth-card--recovery .auth-card__visual { min-height: 0; }
  .auth-card__art { opacity: 0.45; }
  .auth-card__brand {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 12px 16px;
  }
  .auth-card__logo {
    width: 32px;
    height: 32px;
    padding: 6px;
    border-radius: 8px;
  }
  .auth-card__welcome { font-size: 16px; }
  .auth-card__hint { display: none; }
  .auth-card__body { padding: 16px 16px 18px; }
  .auth-card__head { margin-bottom: 14px; }
  .auth-card__head--compact { margin-bottom: 8px; }
  .auth-card__title { font-size: 20px; }
  .auth-card__sub { margin-top: 4px; font-size: 12px; }
  .auth-field { margin-bottom: 10px; }
  .auth-field__label { margin-bottom: 4px; font-size: 12px; }
  .auth-field__input {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 8px;
  }
  .auth-captcha__img { height: 40px; }
  .auth-form__submit {
    min-height: 40px;
    margin-top: 2px;
    font-size: 14px;
    border-radius: 8px;
  }
  .auth-card__foot { padding-top: 12px; font-size: 12px; }
  .auth-recovery__tabs { margin-bottom: 10px; }
  .auth-form__row { grid-template-columns: 1fr; }
  .auth-shell {
    align-items: flex-start;
    padding: 12px;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
  }
}
@media (prefers-reduced-motion: reduce) {
  .auth-modal__dialog { animation: none; }
  .auth-form__submit:active { transform: none; }
}

/* ---- 状态页 / 空态 ---- */
.status-page {
  text-align: center;
  padding: 48px 20px 72px;
  background: #fff;
  border-radius: var(--radius-lg);
  margin: 20px 0 40px;
}
.status-page__art {
  width: 200px;
  height: auto;
  margin: 0 auto 12px;
  display: block;
}
.status-page__code {
  font-size: 56px;
  font-weight: 800;
  color: var(--pink);
  line-height: 1;
}
.status-page__msg {
  margin: 12px 0 6px;
  font-size: 18px;
  border: 0;
  padding: 0;
}
.status-page__sub { color: var(--muted); margin: 0; }
.status-page__act {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.mac-empty--art {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 16px;
  background: #fff;
  border-radius: var(--radius-lg);
}
.mac-empty--art img { width: 140px; height: auto; opacity: 0.95; }
.search-kw {
  color: var(--pink);
  font-style: normal;
  font-weight: 700;
  margin: 0 4px;
}

/* ---- 卡片变体：演员头像 / 漫画竖版 ---- */
.card--avatar .pic {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background-image: url("../img/avatar-placeholder.png");
  background-color: #eee;
}
.card--avatar .card__play { display: none; }
.card--avatar .t,
.card--avatar .m { text-align: center; }
.card--poster .pic {
  aspect-ratio: 3 / 4;
  background-image: url("../img/cover-placeholder.png");
}

/* 分区标题左侧粉条 */
.sec::before,
.bili-sec__head::before {
  content: "";
  width: 4px;
  height: 1em;
  border-radius: 2px;
  background: var(--pink);
  flex: 0 0 auto;
}
