:root {
  --bg: #151317;
  --surface: #1d1a20;
  --surface-2: #252128;
  --line: #2f2a33;
  --line-2: #3d3742;
  --text: #f2eff4;
  --text-2: #d3cdd8;
  --muted: #aaa3b1;
  --faint: #8f8896;
  --accent: #f28aaa;
  --accent-2: #ffb6cb;
  --on-accent: #1a0e14;
  --avg: #6a6470;
  --sale: #ffc56b;
  --on-sale: #2b1a00;
  --free: #6fd6c4;
  --on-free: #08231f;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}
a { color: var(--accent-2); }
a:hover { color: #ffd6e3; }
img { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.4; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.fine { margin: 8px 0 0; font-size: 12px; color: var(--faint); }
.empty { margin: 0; padding: 16px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* ヘッダー・フッター */
.site-header { background: #121014; border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 12px; padding-bottom: 12px; }
.logo { font-weight: 700; font-size: 19px; color: var(--text); text-decoration: none; letter-spacing: 0.04em; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; }
.site-nav a { color: var(--text-2); text-decoration: none; }
.pr { font-size: 12px; color: var(--muted); padding-top: 8px; }
.site-footer { background: #121014; border-top: 1px solid var(--line); margin-top: 48px; }
.site-footer .wrap { padding-top: 28px; padding-bottom: 40px; font-size: 13px; color: var(--muted); }
.site-footer p { margin: 0 0 6px; }

main.wrap { display: flex; flex-direction: column; gap: 40px; padding-top: 12px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }

/* 見出し */
.page-title { margin: 0; font-size: 22px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; margin-bottom: 10px; }
.sec-head h2 { margin: 0; font-size: 18px; padding-left: 10px; border-left: 3px solid var(--accent); line-height: 1.3; }
.sec-head .more { font-size: 13px; text-decoration: none; }
.sec-head .more::after { content: " ›"; }
.sec-note { margin: -4px 0 10px; font-size: 12px; color: var(--muted); }
.sec-head .sec-note { margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: 40px 32px; }
.row > * { flex: 1 1 420px; min-width: 0; }

/* 小さな部品 */
.tag { display: inline-block; padding: 0 7px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--text-2); font-size: 12px; line-height: 1.8; text-decoration: none; }
a.tag:hover { border-color: var(--accent); color: var(--text); }
/* タイトル・紹介文・レビューから出した言葉（タグと見分けがつくよう、枠を点線に） */
.tag.word { border-style: dashed; color: var(--accent-2); }
.badge { display: inline-block; padding: 0 6px; border-radius: 3px; font-size: 11px; font-weight: 700; line-height: 1.6; }
.badge.sale { background: var(--sale); color: var(--on-sale); }
.badge.free { background: var(--free); color: var(--on-free); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 700; font-family: inherit; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.ghost { background: transparent; }

/* プロフィール */
.profile { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.profile h1 { margin: 0; font-size: 28px; letter-spacing: 0.02em; }
.profile-tags { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.profile-tags .label { font-size: 12px; color: var(--muted); margin-right: 2px; }
.links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.links a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--text); font-size: 13px; text-decoration: none; }
.links a::after { content: "↗"; margin-left: 4px; font-size: 11px; color: var(--faint); }
.links a:hover { border-color: var(--accent); }
.now-strip { margin: 4px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.now-strip > div { padding: 8px 14px; border-top: 1px solid var(--line); }
.now-strip > div:nth-child(-n+2) { border-top: 0; }
.now-strip > div:nth-child(2n) { border-left: 1px solid var(--line); }
.now-strip dt { font-size: 11px; color: var(--muted); }
.now-strip dd { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.4; }
.now-strip dd small { font-size: 12px; font-weight: 400; margin-left: 2px; }
.now-strip dd.text { font-size: 15px; line-height: 1.9; }
.now-strip a { color: var(--accent-2); text-decoration: none; }
@media (min-width: 640px) {
  .now-strip { display: flex; }
  .now-strip > div { flex: 1; border-top: 0; border-left: 1px solid var(--line); }
  .now-strip > div:first-child { border-left: 0; }
}
.updated { margin: 0; font-size: 12px; color: var(--faint); }

/* 作品リスト：1つの枠の中に、線で区切って並べる */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list > li { border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
@media (min-width: 760px) {
  .list.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list.grid-2 > li:nth-child(2) { border-top: 0; }
  .list.grid-2 > li:nth-child(2n) { border-left: 1px solid var(--line); }
  .list.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .list.grid-3 > li:nth-child(-n+3) { border-top: 0; }
  .list.grid-3 > li + li:not(:nth-child(3n+1)) { border-left: 1px solid var(--line); }
}
.item { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px; }
.item:hover, .db-row:hover, .actor-card:hover { background: var(--surface-2); }
.stretch { color: var(--text); text-decoration: none; }
.stretch::after { content: ""; position: absolute; inset: 0; }
.stretch:focus-visible { outline: none; }
.stretch:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; }
.thumb { flex: none; align-self: flex-start; width: clamp(84px, 24vw, 120px); aspect-ratio: 4 / 3; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }  /* 公式画像は切り抜かない（DLsite の規約：縦横比を保った拡大縮小のみ） */
.thumb.sm { width: clamp(64px, 18vw, 88px); }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.item-title { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin: 0; font-size: 12px; color: var(--muted); }
.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.extra { margin: 0; font-size: 13px; font-weight: 700; color: var(--accent-2); }
.soon { color: var(--sale) !important; }
.now-strip dd .soon { margin-left: 6px; font-size: 12px; font-weight: 700; }
.price-line { margin: 2px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; font-size: 12px; color: var(--muted); }
.price-line .was { text-decoration: line-through; text-decoration-color: var(--faint); }
.price-line .arrow { color: var(--faint); }
.price-line .now { font-size: 15px; font-weight: 700; color: var(--text); }
.price-line .badge { align-self: center; }
.price-line .until { color: var(--sale); }
.rank-no { width: 22px; flex: none; text-align: center; font-size: 18px; font-weight: 700; color: var(--muted); align-self: center; font-variant-numeric: tabular-nums; }
.rank:nth-child(-n+3) .rank-no { color: var(--accent); }

/* ほかの声優より多いもの：タブ */
.tabs { display: flex; gap: 0; margin-bottom: 8px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs [role="tab"] { flex: none; min-height: 40px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font-size: 13px; font-family: inherit; cursor: pointer; white-space: nowrap; }
.tabs [role="tab"][aria-selected="true"] { color: var(--text); font-weight: 700; border-bottom-color: var(--accent); }
.tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tab-panel[hidden] { display: none; }

/* ほかの声優より多いジャンル */
.genre-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.genre-table th, .genre-table td { padding: 8px 12px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.genre-table thead th { border-top: 0; font-size: 11px; font-weight: 400; color: var(--muted); }
.genre-table tbody th { width: 34%; font-size: 13px; font-weight: 600; }
.genre-table th, .genre-table td { padding-top: 6px; padding-bottom: 6px; }
.genre-table .r { text-align: right; }
.genre-table .ratio { font-weight: 700; color: var(--accent); white-space: nowrap; }
.bar { height: 8px; border-radius: 2px; background: var(--surface-2); }
.bar span { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.bar.avg { height: 5px; margin-top: 3px; }
.bar.avg span { background: var(--avg); }
.pct { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }

/* 作品データベース */
.controls { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.control-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.field label { font-size: 11px; color: var(--muted); }
select { width: 100%; height: 40px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 36px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-size: 13px; font-family: inherit; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.db-count { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.db-row { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; }
.db-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.db-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tags-inline { display: flex; align-items: center; gap: 6px; font-size: 12px; min-width: 0; }
.tags-inline:empty { display: none; }
.tags-inline .cast { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-sm { flex: none; padding: 0 6px; border-radius: 3px; background: var(--surface-2); color: var(--text-2); font-size: 11px; }
/* スマホ：評価・販売数・価格を1行に。高評価率・レビューは、その順に並べているときだけ出す */
.metrics { margin: 0; display: flex; flex-wrap: wrap; gap: 0 12px; }
.metrics > div { display: flex; align-items: baseline; gap: 4px; }
.metrics > div.opt { display: none; }
.metrics > div.opt.on { display: flex; }
.metrics dt { font-size: 11px; color: var(--muted); white-space: nowrap; }
.metrics dd { margin: 0; font-size: 13px; font-weight: 700; white-space: nowrap; }
.metrics > div.plain dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.metrics .on dd { color: var(--accent); }
@media (min-width: 760px) {
  .db-main { flex-direction: row; align-items: center; gap: 16px; }
  .db-info { flex: 1 1 auto; }
  .metrics { flex: 0 0 400px; display: grid; grid-template-columns: 0.9fr 0.9fr 0.9fr 0.9fr 1.3fr; gap: 8px; }
  .metrics > div, .metrics > div.opt { display: block; }
  .metrics > div.plain dt { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .metrics dd { font-size: 14px; }
}
.db-more { display: flex; justify-content: center; margin-top: 14px; }
.db-more .btn[hidden] { display: none; }

/* 次の節目：最近の達成 */
.achieved { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.achieved li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 8px 14px; border: 1px solid var(--accent); border-radius: var(--radius); background: rgba(242, 138, 170, 0.08); }
.achieved .date { font-size: 12px; color: var(--accent-2); font-weight: 700; }
.achieved .text { flex: 1 1 200px; font-size: 14px; font-weight: 700; }
.achieved .share { margin-left: auto; font-size: 12px; color: var(--faint); text-decoration: none; }
.achieved .share:hover { color: var(--text); }

/* 次の節目 */
.milestones { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.milestones li { padding: 12px 16px; border-top: 1px solid var(--line); margin-top: -1px; }
.milestones .ms-text { margin: 0; font-size: 14px; }
.milestones .ms-text b { font-weight: 700; }
.milestones .ms-text .left { color: var(--accent); }
.milestones .main .ms-text { font-size: 16px; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); margin-top: 6px; }
.progress span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.ms-foot { margin: 4px 0 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 12px; color: var(--muted); }
.ms-foot .share { margin-left: auto; color: var(--faint); text-decoration: none; }
.ms-foot .share:hover { color: var(--text); }

/* 活動データ */
.row.act { gap: 24px; margin-top: 20px; align-items: flex-start; }
.row.act > * { flex: 1 1 300px; }
.facts-table { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.facts-table > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 7px 14px; border-top: 1px solid var(--line); }
.facts-table > div:first-child { border-top: 0; }
.facts-table dt { flex: none; font-size: 13px; color: var(--muted); }
.facts-table dd { margin: 0; min-width: 0; text-align: right; font-size: 14px; font-weight: 600; }
.facts-table .sub { display: block; font-size: 11px; font-weight: 400; color: var(--faint); }
.facts-table .sub.rank { color: var(--accent-2); font-weight: 700; }
.facts-table dd a { color: var(--text); }
.facts-table dt .sub { display: block; }
@media (min-width: 760px) {
  .facts-table { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts-table > div:nth-child(2) { border-top: 0; }
  .facts-table > div:nth-child(2n) { border-left: 1px solid var(--line); }
  .facts-table > div.wide { grid-column: 1 / -1; border-left: 0; }
}
.chart { margin: 0; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.chart figcaption { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.cols { display: flex; align-items: flex-end; gap: 3px; height: 190px; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.col .n { font-size: 10px; font-weight: 700; }
.col .b { width: 100%; max-width: 28px; border-radius: 2px 2px 0 0; background: var(--avg); }
.col .b.now { background: var(--accent); }
.col .y { font-size: 10px; color: var(--muted); }
.sub-head { margin: 0 0 8px; font-size: 14px; color: var(--text-2); }
.ranking { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ranking li { display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.ranking li:first-child { border-top: 0; }
.ranking .no { width: 16px; flex: none; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.ranking .n { margin-left: auto; flex: none; font-size: 12px; color: var(--muted); }
.ranking a { color: var(--text); }
.ranking a[target="_blank"]::after { content: " ↗"; font-size: 11px; color: var(--faint); }

/* 作風が近い声優 */
.related { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 8px; }
.related a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.related a:hover { border-color: var(--accent); }
.related .name { font-weight: 700; }
.related .tags { font-size: 12px; color: var(--text-2); }
.related .score { font-size: 12px; color: var(--muted); }

/* トップページ */
.intro { margin: 6px 0 4px; color: var(--text-2); font-size: 14px; }
.actor-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 8px; }
.actor-card { position: relative; display: flex; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ac-thumb { position: relative; flex: none; align-self: flex-start; width: 104px; aspect-ratio: 4 / 3; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.ac-thumb img { width: 100%; height: 100%; object-fit: contain; }
.ac-cap { position: absolute; left: 0; bottom: 0; padding: 0 5px; background: rgba(0, 0, 0, 0.72); color: #fff; font-size: 10px; border-top-right-radius: 4px; }
.ac-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ac-body h2 { margin: 0; font-size: 17px; }
.ac-tags { margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.ac-tags .tag { font-size: 11px; line-height: 1.7; }
.ac-latest { margin: 0; font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-latest .date { color: var(--accent-2); margin-right: 6px; }
.ac-now { margin: 0; display: flex; flex-wrap: wrap; gap: 0 10px; font-size: 12px; color: var(--muted); }
.ac-now span { white-space: nowrap; }
.ac-now b { color: var(--text); font-size: 14px; }

/* 年齢確認 */
.age-gate { position: fixed; inset: 0; z-index: 10; background: rgba(10, 9, 13, 0.96); display: flex; align-items: center; justify-content: center; padding: 16px; }
.age-gate[hidden] { display: none; }
.age-box { max-width: 420px; width: 100%; padding: 28px 24px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.age-box h2 { margin: 0 0 8px; font-size: 20px; }
.age-box .muted { color: var(--muted); }
.age-box .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
