@charset "utf-8";
/*
Theme Name: MANGA-MILL v3
Theme URI: https://manga-mill.com
Description: えろまんがみる — 再構築版テーマ（コメント・広告なし）
Version: 3.9.0
Author: えろまんがみる
Author URI: https://manga-mill.com
*/

/* ══════════ Tokens ══════════ */
:root{
  --bg:#fff0d6;        /* ページ背景（クリーム） */
  --card:#fff8ec;      /* カード・タブなど、面として立たせる要素 */
  --surface:#f9edda;   /* 面の中のインセット（入力欄・チップ等） */
  --elevated:#f5e4c9;  /* フッターなど、さらに沈ませる面 */
  --border:#e6d5b8;      /* 通常の枠線（カード・テーブル等） */
  --border-tag:#f3c99a;  /* タグ・チップ類の枠線（淡いオレンジ） */
  --text-tag:#9a5b21;    /* タグ・チップ類の文字（オレンジ茶） */
  --accent:#f97316; --accent-hover:#fb923c; --accent-weak:#ffe2cb;
  --link:#1ba1e3; --link-hover:#31aae7;
  --hot:#ef4444; --doujin:#f87171; --manga:#84cc16;
  --text:#334155; --text-sub:#64748b; --text-muted:#94a3b8; --ink:#0f172a;
  --shadow:0 2px 8px rgba(0,0,0,.08);
  --header-h:48px; --bottom-h:56px; --max-w:1280px; --side-w:272px;
}

/* ══════════ Reset ══════════ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;border-radius:0}
html{font-size:15px;-webkit-text-size-adjust:100%;scroll-behavior:smooth;
  overflow-x:hidden;overflow-x:clip;max-width:100%}
body{font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN",Meiryo,sans-serif;
  background:var(--bg);color:var(--text);line-height:1.6;
  -webkit-tap-highlight-color:transparent;
  overflow-x:hidden;overflow-x:clip;max-width:100%;position:relative;
  padding-top:var(--header-h);
  padding-bottom:calc(var(--bottom-h) + 8px);}
a{color:var(--link);text-decoration:none;transition:color .15s}
a:hover{color:var(--link-hover)}
ul,ol,li{list-style:none}
img{max-width:100%;height:auto;display:block}
button{font:inherit;color:inherit;cursor:pointer;border:none;background:none}
input,textarea{font-family:inherit}
input[type=text],input[type=search],textarea{font-size:16px}
h1,h2,h3,h4{color:var(--ink);font-weight:700;line-height:1.35}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important;scroll-behavior:auto}}
.screen-reader-text{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip-link:focus{position:fixed;top:8px;left:8px;z-index:200;width:auto;height:auto;clip:auto;
  padding:8px 14px;background:var(--card);border:2px solid var(--accent);color:var(--ink)}

/* ══════════ Header ══════════ */
/* 全ページで常時表示。スクロールしても隠さない。 */
#header{
  position:fixed;top:0;left:0;right:0;z-index:100;height:var(--header-h);
  display:flex;align-items:center;justify-content:space-between;padding:0 12px;
  background:rgba(249,115,22,.97);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
}
#header .logo{min-width:0}
#header .logo img{height:28px;width:auto}
.menu-open{width:40px;height:40px;flex:0 0 auto;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px}
.menu-open i{display:block;width:20px;height:2px;background:#fff;transition:transform .2s,opacity .2s}

/* ── ハンバーガーメニュー ──
   .menu は body 直下に置き、hidden 属性で開閉する。
   表示中は html に is-menu-open を付けて背面のスクロールを止める。 */
.menu{position:fixed;inset:0;z-index:200}
.menu[hidden]{display:none}
.menu-backdrop{position:absolute;inset:0;width:100%;height:100%;
  background:rgba(15,23,42,.55);border:none;padding:0;cursor:pointer;
  opacity:0;transition:opacity .22s}
.menu.is-open .menu-backdrop{opacity:1}
.menu-panel{position:absolute;top:0;right:0;height:100%;width:min(320px,86vw);
  background:var(--card);box-shadow:-4px 0 18px rgba(0,0,0,.16);
  transform:translateX(100%);transition:transform .22s;overflow-y:auto;
  -webkit-overflow-scrolling:touch}
.menu.is-open .menu-panel{transform:none}
.menu-close{position:absolute;top:6px;right:8px;width:40px;height:40px;
  font-size:26px;line-height:1;color:var(--text-sub)}
.menu-close::before{content:"×"}
.menu-close:hover{color:var(--accent)}
.menu-inner{padding:52px 16px 24px}
.menu-list{margin-top:14px}
.menu-list a{display:block;padding:13px 6px;font-size:.9rem;font-weight:700;
  color:var(--ink);border-bottom:1px solid var(--border)}
.menu-list a:hover{color:var(--accent)}
html.is-menu-open,html.is-menu-open body{overflow:hidden}

/* ══════════ Search form ══════════ */
.search-form{display:flex;border:1px solid var(--border)}
.search-input{flex:1 1 auto;min-width:0;padding:9px 10px;border:none;background:var(--surface);color:var(--text)}
.search-button{padding:0 16px;background:var(--accent);color:#fff;font-size:.8rem;font-weight:700}
.search-button:hover{background:var(--accent-hover)}
.search--inline{flex:1 1 260px;max-width:420px}

/* ══════════ Layout ══════════ */
#content{max-width:var(--max-w);margin:0 auto;padding:0 12px;overflow-x:clip}
@media(min-width:1024px){
  #content{display:flex;align-items:flex-start;gap:26px}
  #main{flex:1 1 auto;min-width:0}
  #sidebar{flex:0 0 var(--side-w);width:var(--side-w);position:sticky;top:calc(var(--header-h) + 14px)}
}
.site-intro{padding:18px 2px 4px}
.site-intro h1{font-size:1.15rem}
.site-intro p{margin-top:5px;font-size:.8rem;color:var(--text-sub);line-height:1.55}

/* ══════════ Breadcrumb ══════════ */
.breadcrumb{padding:12px 2px 0}
.breadcrumb ol{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:.72rem;color:var(--text-muted)}
.breadcrumb li+li::before{content:"›";margin-right:6px}
.breadcrumb a{color:var(--text-sub)}
.breadcrumb a:hover{color:var(--accent)}

/* ══════════ Page head ══════════ */
.page-head{padding:14px 2px 0}
.page-head h1{font-size:1.24rem}
.page-head .lead{margin-top:7px;font-size:.8rem;color:var(--text-sub);line-height:1.6;max-width:72ch}
.term-description{margin-top:16px;padding:13px 14px;background:var(--surface);border-left:3px solid var(--accent)}
.term-description h2{font-size:.86rem;margin-bottom:6px}
.term-description p{font-size:.8rem;line-height:1.75;color:var(--text-sub)}
.term-description p+p{margin-top:7px}

/* ══════════ Section head ══════════ */
.section{margin-top:26px}
.section__head{display:flex;align-items:baseline;gap:10px;padding-bottom:9px;margin-bottom:14px;
  border-bottom:2px solid var(--border);position:relative}
.section__head::after{content:"";position:absolute;left:0;bottom:-2px;width:88px;height:2px;background:var(--accent)}
.section__head h2{font-size:1.08rem}
.section__count{font-size:.72rem;color:var(--text-muted);margin-left:auto}

/* ══════════ Toolbar ══════════ */
.toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:16px 0 14px;
  padding-bottom:9px;border-bottom:2px solid var(--border);position:relative}
.toolbar::after{content:"";position:absolute;left:0;bottom:-2px;width:88px;height:2px;background:var(--accent)}
.tabs{display:flex;flex-wrap:wrap;border:1px solid var(--border)}
.tabs a{padding:7px 14px;font-size:.76rem;font-weight:700;color:var(--text-sub);background:var(--card);border-right:1px solid var(--border)}
.tabs a:last-child{border-right:none}
.tabs a:hover{background:var(--accent-weak);color:var(--accent)}
.tabs a.is-active{background:var(--accent);color:#fff}
.result-count{margin-left:auto;font-size:.74rem;color:var(--text-muted);font-variant-numeric:tabular-nums}
.result-count b{color:var(--ink);font-size:.86rem}
.term-search{flex:1 1 240px;max-width:380px}
.term-search-input{width:100%;padding:9px 10px;border:1px solid var(--border);background:var(--surface)}

/* ══════════ Work grid：SP 1列 / PC 2列 ══════════ */
.work-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:9px;max-width:100%}
@media(min-width:768px){.work-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px}}

/* ══════════ Card ══════════ */
.card{display:flex;gap:11px;align-items:flex-start;background:var(--card);
  border:1px solid var(--border);padding:9px;height:100%;max-width:100%;overflow:hidden;
  transition:border-color .15s,box-shadow .15s}
.card:hover{border-color:#d8c1a0;box-shadow:var(--shadow)}
.card__thumb{flex:0 0 auto;width:100px;position:relative;overflow:hidden;display:block;background:var(--surface)}
@media(min-width:768px){.card__thumb{width:112px}}
.card__thumb img,.card__thumb .ph{width:100%;height:auto;aspect-ratio:182/257;object-fit:cover;display:block}
.card__thumb .ph{background:linear-gradient(150deg,#f7ead2,#efdcbc 60%,#f5e6cc)}

/* 順位オーバーレイ */
.rank-ov{position:absolute;top:0;left:0;z-index:2;min-width:26px;height:24px;padding:0 6px;
  display:flex;align-items:center;justify-content:center;
  background:rgba(15,23,42,.86);color:#fff;font-size:.82rem;font-weight:800;
  font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.rank-ov[data-r="1"]{background:var(--accent)}
.rank-ov[data-r="2"]{background:#8f9bab}
.rank-ov[data-r="3"]{background:#bd8347}

.card__body{flex:1 1 auto;min-width:0;display:flex;flex-direction:column}
.card__title{font-size:.84rem;font-weight:700;line-height:1.42;overflow-wrap:anywhere;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.card__title a{color:var(--ink)}
.card:hover .card__title a{color:var(--link)}
.card__circle{margin-top:5px;font-size:.73rem;color:var(--text-sub);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card__circle::before{content:"◆";margin-right:5px;color:var(--accent);font-size:.6rem;vertical-align:1px}
.card__circle a{color:inherit;font-weight:700}
.card__circle a:hover{color:var(--accent)}
.card__genres{margin-top:6px;display:flex;flex-wrap:wrap;gap:4px;overflow:hidden;max-height:44px}
.card__genres a{display:inline-block;padding:2px 7px;border:1px solid var(--border-tag);
  background:transparent;font-size:.72rem;line-height:1.5;color:var(--text-tag)}
.card__genres a:hover{border-color:var(--accent);background:var(--accent-weak);color:var(--accent)}
.card__genres .rest{color:var(--text-muted);border-color:var(--border);border-style:dashed}
.card__foot{margin-top:auto;padding-top:8px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.badge{font-size:.66rem;font-weight:700;color:#fff;padding:2px 7px;line-height:1.5}
.badge:hover{color:#fff;opacity:.85}
.badge--doujin{background:var(--doujin)}
.badge--manga{background:var(--manga)}
.stat{font-size:.7rem;color:var(--text-muted);display:inline-flex;align-items:center;gap:3px;font-variant-numeric:tabular-nums}
.stat--fav{color:var(--doujin)}
.stat--fav .simplefavorite-button{color:var(--doujin);cursor:pointer}

/* ══════════ More button ══════════ */
.more{margin-top:16px;display:flex;justify-content:center}
.more a{display:inline-flex;align-items:center;justify-content:center;min-width:280px;max-width:100%;
  padding:13px 26px;background:var(--accent);color:#fff;font-size:.86rem;font-weight:700;
  transition:background .15s,transform .1s}
.more a:hover{background:var(--accent-hover);color:#fff}
.more a:active{transform:translateY(1px)}

/* ══════════ Pagination ══════════ */
.pagination{margin-top:22px;display:flex;justify-content:center;flex-wrap:wrap;gap:5px}
.pagination .page-numbers{min-width:38px;height:38px;padding:0 10px;
  display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border);
  font-size:.8rem;font-weight:700;color:var(--text-sub);font-variant-numeric:tabular-nums;background:var(--card)}
.pagination a.page-numbers:hover{border-color:var(--accent);background:var(--accent-weak);color:var(--accent)}
.pagination .current{background:var(--accent);border-color:var(--accent);color:#fff}
.pagination .dots{border:none;background:none;color:var(--text-muted);min-width:20px;padding:0}

/* ══════════ Term list（目録） ══════════ */
.term-list{margin-top:4px}
.term-list li.notfound{width:100%;padding:20px 0;text-align:center;color:var(--text-muted);font-size:.8rem}

/* ══════════ Single ══════════ */
.article-header{padding:14px 2px 0}
.page-title{font-size:1.22rem;line-height:1.45}
.article-dates{margin-top:8px;display:flex;flex-wrap:wrap;gap:12px;font-size:.7rem;color:var(--text-muted)}
.content{margin-top:18px;font-size:.86rem;line-height:1.9}
.content p+p{margin-top:1em}
.book-meta{margin-top:16px;border:1px solid var(--border);background:var(--card)}
.book-meta dl{display:flex;flex-direction:column}
.book-meta dl>div{display:flex;border-bottom:1px solid var(--border)}
.book-meta dl>div:last-child{border-bottom:none}
.book-meta dt{flex:0 0 104px;padding:9px 11px;background:var(--surface);font-size:.74rem;font-weight:700;color:var(--text-sub)}
.book-meta dd{flex:1 1 auto;padding:9px 11px;font-size:.78rem;min-width:0;word-break:break-word}
@media(min-width:768px){.book-meta dt{flex-basis:132px}}
.content-meta{margin-top:14px;display:flex;align-items:center;gap:14px;font-size:.76rem;color:var(--text-muted)}
.favorite-button{display:inline-flex;align-items:center;gap:5px;color:var(--doujin);font-weight:700}

.purchase-buttons{margin-top:22px;display:flex;flex-direction:column;gap:14px;align-items:center}
@media(min-width:600px){.purchase-buttons{flex-direction:row;justify-content:center}}

/* 立体感のあるCTA。角丸を使わない方針なので、
   面取り（内側のハイライトと影）＋厚みぶんの落ち影で立体に見せる。
   押すと厚みぶん沈むので、触れることが直感的にわかる。 */
.purchase-button{
  --btn-face:#fb923c;
  --btn-face-end:#ef6a0c;
  --btn-edge:#b8420a;
  --btn-depth:6px;
  position:relative;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  width:min(420px,100%);min-height:60px;padding:13px 26px;
  color:#fff;text-align:center;
  background:linear-gradient(180deg,var(--btn-face) 0%,var(--btn-face-end) 100%);
  box-shadow:
    0 var(--btn-depth) 0 0 var(--btn-edge),          /* 厚み */
    0 calc(var(--btn-depth) + 6px) 12px rgba(120,53,15,.30), /* 落ち影 */
    inset 0 1px 0 rgba(255,255,255,.45),             /* 上面のハイライト */
    inset 0 -1px 0 rgba(0,0,0,.12);                  /* 下面の締め */
  text-shadow:0 1px 2px rgba(120,53,15,.45);
  transition:transform .08s ease-out, box-shadow .08s ease-out, filter .15s;
}
.purchase-button:hover{color:#fff;filter:brightness(1.05)}
.purchase-button:active{
  transform:translateY(var(--btn-depth));
  box-shadow:
    0 0 0 0 var(--btn-edge),
    0 2px 4px rgba(120,53,15,.25),
    inset 0 1px 0 rgba(255,255,255,.35),
    inset 0 -1px 0 rgba(0,0,0,.12);
}
.purchase-button__label{font-size:1rem;font-weight:800;letter-spacing:.02em;line-height:1.35}
.purchase-button__site{font-size:.7rem;font-weight:700;opacity:.92;
  padding:1px 8px;background:rgba(0,0,0,.18)}
.purchase-button.dlsite{--btn-face:#3aa5e0;--btn-face-end:#0d7ab8;--btn-edge:#075782}
.purchase-button.dlsite{text-shadow:0 1px 2px rgba(7,60,100,.45)}
@media(prefers-reduced-motion:reduce){
  .purchase-button:active{transform:none}
}

.gallery{margin-top:20px}
.gallery .image-list{display:flex;flex-direction:column;gap:6px}
.gallery .image img{width:100%;height:auto;aspect-ratio:182/257;object-fit:contain;background:var(--surface)}
.page-number{margin-top:12px;font-size:.76rem;color:var(--text-sub);text-align:center}

.article-footer{margin-top:24px}
.article-footer h2{font-size:.92rem;padding-bottom:8px;margin-bottom:10px;border-bottom:2px solid var(--border);position:relative}
.article-footer h2::after{content:"";position:absolute;left:0;bottom:-2px;width:70px;height:2px;background:var(--accent)}
.hashtag{display:flex;flex-wrap:wrap;gap:6px}
.hashtag a{display:inline-block;padding:5px 10px;border:1px solid var(--border-tag);background:transparent;font-size:.76rem;color:var(--text-tag)}
.hashtag a:hover{border-color:var(--accent);background:var(--accent-weak);color:var(--accent)}
.related-articles{margin-top:28px}

/* ══════════ Sidebar ══════════ */
#sidebar{margin-top:26px}
@media(min-width:1024px){#sidebar{margin-top:22px}}
.sidebar-content{margin-bottom:20px;border:1px solid var(--border);padding:12px;background:var(--card)}
.sidebar-content h3{font-size:.82rem;padding-bottom:7px;margin-bottom:10px;border-bottom:1px solid var(--border);position:relative}
.sidebar-content h3::after{content:"";position:absolute;left:0;bottom:-1px;width:48px;height:1px;background:var(--accent)}
.category-list li+li{margin-top:2px}
.category-list a{display:flex;justify-content:space-between;align-items:center;gap:8px;
  padding:7px 9px;background:var(--surface);font-size:.78rem;color:var(--text);font-weight:700}
.category-list a:hover{background:var(--accent-weak);color:var(--accent)}
.category-list .n{font-size:.7rem;color:var(--text-muted);font-weight:400;font-variant-numeric:tabular-nums}
.tag-cloud{display:flex;flex-wrap:wrap;gap:5px}
.tag-cloud a{display:inline-flex;align-items:baseline;gap:4px;padding:4px 8px;
  border:1px solid var(--border-tag);background:transparent;font-size:.72rem;color:var(--text-tag);line-height:1.5}
.tag-cloud a:hover{border-color:var(--accent);background:var(--accent-weak);color:var(--accent)}
.tag-cloud span{font-size:.64rem;color:var(--text-muted);font-variant-numeric:tabular-nums}
.tag-cloud a:hover span{color:var(--accent)}
.more-link{margin-top:10px;text-align:right}
.more-link a{font-size:.72rem;color:var(--text-sub)}
.more-link a:hover{color:var(--accent)}

/* ══════════ Footer ══════════ */
#footer{margin-top:38px;padding:20px 12px 26px;background:var(--elevated);border-top:1px solid var(--border)}
#footer .inner{max-width:var(--max-w);margin:0 auto}
#footer .disclaimer p{font-size:.68rem;color:var(--text-muted);line-height:1.7}
.footer-site-links{margin-bottom:18px}
.footer-site-links ul{display:flex;flex-wrap:wrap;gap:6px 14px}
.footer-site-links a{font-size:.72rem;color:var(--text-sub)}
.footer-navigation ul{display:flex;flex-wrap:wrap;gap:8px 16px;margin:14px 0}
.footer-navigation a{font-size:.74rem;color:var(--text-sub)}
#footer .copyright{font-size:.68rem;color:var(--text-muted)}

/* ══════════ Bottom nav / to top ══════════ */
.bottom-nav{position:fixed;bottom:0;left:0;right:0;z-index:99;height:var(--bottom-h);display:flex;
  background:rgba(255,250,240,.97);border-top:1px solid var(--border);
  backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.bottom-nav a{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:2px;font-size:.62rem;color:var(--text-muted)}
.bottom-nav a.is-active{color:var(--accent)}
.bottom-nav .ic{font-size:17px;line-height:1}
@media(min-width:768px){.bottom-nav{display:none}body{padding-bottom:0}}

.return-to-top{position:fixed;right:12px;bottom:calc(var(--bottom-h) + 12px);z-index:97;
  width:42px;height:42px;background:rgba(15,23,42,.72);opacity:0;pointer-events:none;transition:opacity .2s}
.return-to-top.is-visible{opacity:1;pointer-events:auto}
.return-to-top::before{content:"";display:block;width:11px;height:11px;margin:17px auto 0;
  border-left:2px solid #fff;border-top:2px solid #fff;transform:rotate(45deg)}
@media(min-width:768px){.return-to-top{bottom:16px}}

.not-found{margin:26px 0;padding:22px;background:var(--surface);text-align:center;font-size:.84rem;color:var(--text-sub)}
