:root {
  --bg: #101410;
  --panel: #1a211c;
  --line: rgba(232, 224, 204, 0.14);
  --ink: #f3efe4;
  --muted: #b7b1a2;
  --amber: #e2a23a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background:
    radial-gradient(900px 420px at 100% 0%, rgba(226, 162, 58, 0.16), transparent 50%),
    var(--bg);
  color: var(--ink);
}
button, input { font: inherit; color: inherit; }
a { color: #f0d7a2; }
.page { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 40px; }
.top { display: flex; gap: 20px; align-items: center; justify-content: space-between; }
.brand strong { display: block; font-size: 28px; letter-spacing: 0.14em; }
.brand small { color: var(--muted); }
.share { display: flex; flex: 1; max-width: 640px; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.share input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 12px 18px; outline: none; font-size: 16px; }
.share button { flex-shrink: 0; border: 0; background: var(--amber); color: #1b1408; padding: 0 18px; cursor: pointer; font-weight: 700; }
.message { color: #ffb4a8; }
.message[hidden] { display: none; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; margin-top: 22px; }
.stage-wrap, aside { min-width: 0; }
.frame {
  position: relative;
  background: #050705;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.frame.landscape, .frame.portrait { aspect-ratio: 16 / 9; }
.frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  transform: scale(1.34);
  transform-origin: center top;
}
.empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); }
.caption { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 12px; }
.caption h1 { margin: 0; min-width: 0; font-size: 20px; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere; }
.actions { display: flex; gap: 12px; align-items: center; flex-shrink: 0; }
#next {
  border: 0; background: var(--amber); color: #1b1408; border-radius: 999px;
  padding: 8px 16px; cursor: pointer; font-weight: 700;
}
#next:disabled { background: transparent; color: var(--muted); border: 1px solid var(--line); cursor: default; }
.side-head { display: flex; justify-content: space-between; align-items: baseline; }
.side-head h2 { margin: 0; font-size: 16px; }
#refresh {
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px;
}
#refresh:disabled { color: var(--muted); cursor: default; }
.similar-wrap { margin-top: 18px; }
.similar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.similar .empty-list { grid-column: 1 / -1; margin: 0; }
.similar .item { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px; }
.similar .item.portrait-card { grid-template-columns: 72px minmax(0, 1fr); }
.similar .thumb { height: 72px; border-radius: 8px; overflow: hidden; background: #050705; }
.similar .thumb.portrait { height: 112px; }
.similar .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.similar .meta { min-width: 0; }
.list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; max-height: 74vh; overflow: auto; }
.item {
  text-align: left; border: 1px solid var(--line); background: var(--panel); color: inherit;
  border-radius: 12px; padding: 12px; cursor: pointer;
}
.item.active { border-color: var(--amber); }
.item strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.45; }
.item span { color: var(--muted); font-size: 12px; }
footer { margin-top: 28px; color: var(--muted); font-size: 12px; line-height: 1.6; }
[hidden] { display: none !important; }
@media (max-width: 860px) {
  .page {
    width: calc(100% - 24px);
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }
  .top, .layout { display: flex; flex-direction: column; }
  .share { max-width: none; width: 100%; }
  .list { max-height: none; }
  .frame.portrait { width: 100%; max-height: none; }
  #next, #refresh, .share button, .item { min-height: 44px; }
}
@media (max-width: 640px) {
  .top { align-items: stretch; gap: 14px; }
  .brand strong { font-size: 22px; letter-spacing: 0.08em; }
  .brand small { display: block; margin-top: 4px; line-height: 1.45; }
  .share { flex-direction: column; border-radius: 16px; }
  .share input { width: 100%; padding: 14px 16px; }
  .share button { min-height: 48px; padding: 12px 16px; }
  .caption { flex-direction: column; align-items: stretch; }
  .actions, #next { width: 100%; }
  .layout { gap: 18px; margin-top: 16px; }
  .frame { border-radius: 14px; }
  .similar { grid-template-columns: 1fr; }
}
