/* 一般的な動画サイトの作り: 上に暗いヘッダー（切り替え・検索窓）、カテゴリの帯、件数と並び順の行、パッケージ画像の格子。
   スマホで広く使うため余白は最小。横に並びきらない帯は折り返さず横スクロール */
:root {
  --bg: #f4f4f4; --card: #fff; --fg: #222; --sub: #777; --line: #e3e3e3;
  --hd: #1d1d1f; --hd-fg: #f2f2f2; --accent: #e8431e; --new: #1971c2; --link: #0b62c4;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111; --card: #1e1e20; --fg: #eee; --sub: #9a9a9a; --line: #333; --hd: #000; --link: #6ab0ff; }
}
[v-cloak] { display: none; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 13px/1.45 system-ui, "Yu Gothic UI", sans-serif; }
button, select, input, textarea { font: inherit; color: inherit; }

/* ---- ヘッダー ---- */
.hd { position: sticky; top: 0; z-index: 10; background: var(--hd); color: var(--hd-fg); padding: 4px 6px; transition: transform .2s; }
.hd.hide { transform: translateY(-100%); }
.hd-row { display: flex; gap: 6px; align-items: center; }
.hd-row + .hd-row { margin-top: 4px; }
.q { flex: 1; min-width: 0; border: 0; border-radius: 4px; padding: 5px 8px; background: #fff; color: #222; }
.hd-space { flex: 1; min-width: 0; overflow: hidden; }
.updated { flex: none; font-size: 10px; line-height: 1.25; color: #aaa; white-space: nowrap; text-align: right; }
/* 2行目: 絞り込みのボタンを項目ごとに横一列（入りきらなければ横スクロール）。項目の間は細い縦線 */
.chips { overflow-x: auto; white-space: nowrap; scrollbar-width: none; gap: 4px; }
.chips::-webkit-scrollbar { display: none; }
.chips > span { flex: none; font-size: 11px; color: #aaa; }
.chips button { flex: none; background: #333; color: #ccc; border: 0; border-radius: 999px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.chips button.on { background: var(--accent); color: #fff; font-weight: 700; }
.chips .sep { flex: none; width: 1px; height: 16px; background: #555; margin: 0 2px; }
.icon { flex: none; width: 34px; height: 30px; padding: 0; border: 0; border-radius: 4px; background: #333; color: var(--hd-fg); font-size: 15px; font-weight: 700; cursor: pointer; }
.icon.fetch { background: var(--accent); color: #fff; font-weight: 700; }
.icon.on { background: var(--hd-fg); color: var(--hd); }
.icon:disabled { opacity: .7; }
.spinning { display: inline-block; animation: spin 1s linear infinite; }
.status { font-size: 11px; color: #ccc; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { display: flex; gap: 6px; align-items: center; margin-top: 3px; font-size: 11px; color: #ccc; }
.finishing { display: flex; gap: 5px; align-items: center; margin-top: 3px; font-size: 11px; color: #ffd8a8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spin { flex: none; width: 10px; height: 10px; border: 2px solid #ffd8a8; border-top-color: transparent; border-radius: 50%;
  animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pbar { flex: 1; height: 6px; background: #444; border-radius: 3px; overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--accent); transition: width .5s; }
.menu { position: absolute; right: 6px; top: 36px; background: var(--card); color: var(--fg); border: 1px solid var(--line);
  border-radius: 6px; box-shadow: 0 4px 16px #0004; display: flex; flex-direction: column; min-width: 180px; }
.menu a { color: inherit; text-decoration: none; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.menu a:last-child { border-bottom: 0; }

/* ---- カテゴリの帯・件数の行・絞り込み ---- */
main { max-width: 1400px; margin: auto; padding: 0 6px 24px; }
.cats { display: flex; gap: 4px; overflow-x: auto; white-space: nowrap;
  scrollbar-width: none; padding: 5px 0; border-bottom: 1px solid var(--line); }
.cats::-webkit-scrollbar { display: none; }
.cats button { flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.cats button b { font-weight: 400; color: var(--sub); margin-left: 3px; font-size: 11px; }
.cats button.on { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.cats button.on b { color: inherit; }
.cats .follow { border-color: #f5a400; }
.cats .mode { background: none; border-color: var(--accent); color: var(--accent); font-weight: 700; }
.empty { padding: 40px 0; color: var(--sub); text-align: center; }

/* ---- 作品の格子 ---- */
h2 { font-size: 14px; margin: 12px 0 5px; padding-left: 6px; border-left: 3px solid var(--accent); display: flex; gap: 8px; align-items: baseline; }
h2.open { cursor: pointer; } h2 i { font-style: normal; color: var(--sub); margin-left: auto; padding-right: 4px; }
h3 { font-size: 12px; margin: 8px 0 4px; color: var(--sub); display: flex; gap: 6px; align-items: baseline; }
h2 small, h3 small { font-weight: 400; color: var(--sub); font-size: 11px; }
/* 動画サイトの一覧と同じく、白地を縦横の細い線で区切った格子。お気に入りは画像左上の☆を押す */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); background: var(--card);
  border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.card { padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; color: inherit;
  text-decoration: none; display: flex; flex-direction: column; min-width: 0; }
.card.skip { opacity: .5; }
.thumb { position: relative; aspect-ratio: 3/2; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.newmark { position: absolute; top: 3px; right: 3px; font-size: 11px; font-weight: 700; color: #fff; border-radius: 3px; padding: 0 5px;
  line-height: 1.6; background: var(--new); }
.fav { position: absolute; top: 2px; left: 2px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: #0007; color: #fff;
  font-size: 18px; line-height: 30px; padding: 0; cursor: pointer; }
.fav.on { background: #fff; color: #f5a400; box-shadow: 0 0 0 1px #f5a400; }
.body { padding-top: 4px; display: flex; flex-direction: column; gap: 1px; }
.title { font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.actress { color: var(--link); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price { font-weight: 700; color: var(--accent); font-size: 13px; }
.meta { display: flex; gap: 5px; font-size: 10px; color: var(--sub); white-space: nowrap; overflow: hidden; }
.meta .site { border: 1px solid var(--line); border-radius: 3px; padding: 0 3px; }
.meta .maker { overflow: hidden; text-overflow: ellipsis; }
.kws { font-size: 10px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reason { font-size: 10px; color: var(--sub); border-top: 1px dashed var(--line); margin-top: 2px; padding-top: 2px; }
.more { display: block; width: 100%; margin: 6px 0; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 6px; cursor: pointer; }

/* ---- テーマ編集 ---- */
.editor { max-width: 760px; }
.ed-head { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.ed-head a { color: var(--link); text-decoration: none; }
.ed-head h1 { flex: 1; font-size: 15px; margin: 0; }
.save { background: var(--accent); color: #fff; border: 0; border-radius: 4px; padding: 5px 16px; font-weight: 700; cursor: pointer; }
.hint { color: var(--sub); font-size: 11px; margin: 2px 0 6px; }
.hint code { background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 0 3px; }
.err { color: #d00; font-weight: 700; } .ok { color: #2a8a2a; font-weight: 700; }
.theme { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 6px; margin-bottom: 6px; }
.t-head { display: flex; gap: 4px; margin-bottom: 4px; }
.t-head input { flex: 1; min-width: 0; font-weight: 700; padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); }
.t-head button, .hist button { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 1px 8px; cursor: pointer; font-size: 12px; }
.theme label { display: block; font-size: 11px; color: var(--sub); margin-top: 3px; }
.theme textarea { display: block; width: 100%; font-size: 13px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg); color: var(--fg); resize: vertical; }
.follow-names { font-size: 11px; color: var(--link); margin-top: 2px; }
.add { width: 100%; padding: 6px; background: none; border: 1px dashed var(--sub); border-radius: 6px; cursor: pointer; }
.editor h2 { margin-top: 18px; }
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { display: flex; gap: 6px; align-items: center; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.hist .names { flex: 1; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- スマホ: 2列。文字と余白をさらに詰める ---- */
@media (max-width: 640px) {
  main { padding: 0 3px 24px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 4px; }
  .body { padding-top: 3px; }
  .title { font-size: 11px; } .actress { font-size: 11px; } .price { font-size: 12px; }
}
