/* 漫画サイトの見た目。色は :root の変数だけで決める(ダークモードは下で上書き)。 */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #6b6a70;
  --line: #e3e0d8;
  --accent: #c2410c;
  --page-gap: 10px;
  --read-w: 760px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141417;
    --surface: #1e1e23;
    --text: #ececef;
    --muted: #9c9ba5;
    --line: #2f2f36;
    --accent: #fb8c4f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
a { color: inherit; }
img { max-width: 100%; }

/* ヘッダー・フッター */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner, .site-footer .inner {
  max-width: 1100px; margin: 0 auto; padding: 10px 16px;
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 17px; text-decoration: none; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.head-link { font-size: 13px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.head-link:hover { color: var(--text); }

.site-footer { border-top: 1px solid var(--line); margin-top: 48px; color: var(--muted); font-size: 13px; }
.site-footer .inner { padding: 24px 16px 40px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.ai-note { margin: 0; }
.copy { margin: 0; }

main { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* トップ(作品一覧) */
.hero { padding: 32px 0 6px; }
.hero h1 { font-size: clamp(24px, 5.2vw, 34px); line-height: 1.3; margin: 0 0 6px; letter-spacing: .02em; }
.hero p { margin: 0; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 22px 14px;
  margin-top: 24px;
}
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 28px 20px; }
}
.card { display: block; text-decoration: none; }
.card .thumb {
  aspect-ratio: 1275 / 1800;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card:hover .thumb { transform: translateY(-2px); box-shadow: 0 6px 18px rgb(0 0 0 / .12); }
.card h2 { font-size: 15px; line-height: 1.45; margin: 10px 0 2px; }
.card p { font-size: 12.5px; line-height: 1.55; margin: 0; color: var(--muted); }
.card .card-meta { margin-top: 4px; font-size: 11.5px; }

/* 作品ページ */
.reader { max-width: var(--read-w); }
.work-head { padding: 24px 0 16px; }
.work-head h1 { font-size: clamp(24px, 6vw, 32px); line-height: 1.3; margin: 0; }
.lead { margin: 6px 0 4px; }
.meta { margin: 0; font-size: 13px; color: var(--muted); }

.pages { display: flex; flex-direction: column; gap: var(--page-gap); margin: 0 -16px; }
.pages img { display: block; width: 100%; height: auto; background: #fff; }
@media (min-width: 792px) {
  .pages { margin: 0; }
  .pages img { border-radius: 3px; box-shadow: 0 1px 3px rgb(0 0 0 / .08), 0 8px 24px rgb(0 0 0 / .06); }
}

.end { text-align: center; letter-spacing: .5em; color: var(--muted); margin: 28px 0; }

.about-work {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
}
.about-work h2 { font-size: 15px; margin: 0 0 6px; }
.about-work p { margin: 0 0 6px; font-size: 14.5px; }

.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0 0; }
.pn {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface);
  text-decoration: none; min-width: 0;
}
.pn.newer { text-align: right; }
.pn.empty { visibility: hidden; }
.pn:hover { border-color: var(--accent); }
.pn-label { font-size: 12px; color: var(--muted); }
.pn-title { font-weight: 700; font-size: 14px; line-height: 1.45; }

/* 説明ページ(about・privacy・404) */
.doc { max-width: var(--read-w); padding-top: 24px; }
.doc h1 { font-size: clamp(22px, 5vw, 28px); line-height: 1.35; }
.doc h2 { font-size: 17px; margin-top: 28px; }
.doc a { color: var(--accent); }

/* 判定ボタン(作品ページ・JS が動くときだけ表示) */
.verdict {
  margin: 0 0 28px;
  padding: 18px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
}
.verdict h2 { font-size: 17px; margin: 0; }
.verdict-note { margin: 2px 0 14px; font-size: 13px; color: var(--muted); }
.verdict-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 600px) { .verdict-buttons { grid-template-columns: repeat(4, 1fr); } }
.verdict-buttons button {
  font: inherit; font-weight: 700; font-size: 15px;
  padding: 12px 6px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--text);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, transform .08s ease;
}
.verdict-buttons button:hover { border-color: var(--accent); }
.verdict-buttons button:active { transform: scale(.97); }
.verdict-buttons button.is-mine { border-color: var(--accent); background: var(--accent); color: #fff; }
.verdict-buttons button:disabled { opacity: .6; cursor: wait; }

.verdict-result { margin-top: 16px; text-align: left; font-size: 14px; }
.verdict-mine { margin: 0 0 10px; }
.verdict-mine strong { margin: 0 2px; }
.verdict-hint { display: block; color: var(--muted); font-size: 12.5px; }
.verdict-pending, .verdict-same { margin: 10px 0 0; color: var(--muted); }
.verdict-error { margin: 0; color: var(--accent); }
.verdict-bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 8.5em 1fr 3em; align-items: center; gap: 10px; }
.bar-label { font-size: 13px; white-space: nowrap; }
.bar { height: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--muted); border-radius: 999px; }
.bar-row.is-mine .bar-fill { background: var(--accent); }
.bar-row.is-mine .bar-label { font-weight: 700; }
.bar-num { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }

/* コメント欄(作品ページ・JS が動くときだけ表示) */
.comments {
  margin: 0 0 28px;
  padding: 18px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.comments h2 { font-size: 17px; margin: 0 0 10px; }
.comment-count { font-size: 14px; color: var(--muted); font-weight: 400; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment { padding: 10px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; padding-top: 0; }
.comment-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 12.5px; color: var(--muted); }
.comment-name { color: var(--text); font-weight: 700; }
.comment-body { margin: 4px 0 0; font-size: 14.5px; white-space: pre-wrap; }
.comment-empty { margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.comment-form { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.field { display: block; margin-bottom: 10px; }
.field span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%;
  font: inherit; font-size: 16px;   /* 16px 未満だと iPhone が入力時に拡大する */
  color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px;
}
.field textarea { resize: vertical; min-height: 5.5em; line-height: 1.6; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comment-len { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.comment-len.is-over { color: var(--accent); font-weight: 700; }
.form-row button {
  font: inherit; font-weight: 700;
  padding: 9px 26px;
  border: 0; border-radius: 999px;
  background: var(--accent); color: #fff;
  cursor: pointer;
}
.form-row button:disabled { opacity: .6; cursor: wait; }
.comment-msg { margin: 10px 0 0; font-size: 14px; min-height: 1em; }
.comment-msg:empty { display: none; }
.comment-msg.is-error { color: var(--accent); }
.comment-rules { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
