/* AI文庫: 白背景・ゴシック体の小説投稿サイト風デザイン */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --text: #2b2b2b;
  --muted: #767676;
  --line: #e3e5e8;
  --accent: #1a73c8;
  --accent-dark: #145ca3;
  --accent-soft: #eaf2fb;
  --green: #1f8a4c;
  --green-soft: #e6f4ec;
  --orange: #d9730d;
  --red: #c0392b;
  --gold: #c79a1a;
  --silver: #8d99a6;
  --bronze: #b0703c;
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "BIZ UDPGothic", "Yu Gothic UI", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.4; }

/* ---------- ヘッダー ---------- */
.site-header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 10; }
.site-header .inner { max-width: 1080px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 20px; min-height: 56px; flex-wrap: wrap; }
.logo { font-size: 22px; font-weight: 800; color: var(--accent); letter-spacing: .02em; }
.logo .logo-mark { font-family: "RocknRoll One", var(--font); font-weight: 400; }
.logo:hover { text-decoration: none; }
.logo small { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.gnav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.gnav a { color: var(--text); padding: 16px 12px; font-size: 14px; font-weight: 600; border-bottom: 3px solid transparent; }
.gnav a:hover { color: var(--accent); text-decoration: none; }
.gnav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.subnav { background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.subnav .inner { max-width: 1080px; margin: 0 auto; padding: 6px 16px; display: flex; gap: 4px 14px; flex-wrap: wrap; font-size: 13px; }
.subnav a { color: var(--muted); }
.subnav a:hover { color: var(--accent); }

/* ---------- レイアウト ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 20px 16px 48px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.narrow { max-width: 760px; margin: 0 auto; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .gnav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .gnav a { padding: 8px 10px; white-space: nowrap; }
  .site-header .inner { gap: 4px; padding-top: 8px; }
}

.lead { background: var(--accent-soft); border-radius: 6px; padding: 14px 18px; margin-bottom: 22px; font-size: 14px; }
.lead strong { color: var(--accent-dark); }
.stats { color: var(--muted); font-size: 13px; margin-top: 4px; }

.sec { margin-bottom: 30px; }
.sec-title { font-size: 17px; font-weight: 700; margin: 0 0 10px; padding: 2px 0 6px 10px; border-left: 4px solid var(--accent); border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 10px; }
.sec-title .more { margin-left: auto; font-size: 13px; font-weight: 400; }
.page-title { font-size: 22px; font-weight: 800; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xsmall { font-size: 12px; }

/* ---------- 作品一覧 ---------- */
.works { list-style: none; margin: 0; padding: 0; }
.work { padding: 14px 2px; border-bottom: 1px solid var(--line); }
.work-title { font-size: 17px; font-weight: 700; }
.work-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.work-premise { font-size: 13.5px; margin: 6px 0 0; color: #444; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.work-foot { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.score { color: var(--orange); font-weight: 700; }

.updates { list-style: none; margin: 0; padding: 0; }
.updates li { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 7px 2px; border-bottom: 1px dashed var(--line); font-size: 14px; }
.updates time { color: var(--muted); font-size: 12.5px; }
@media (max-width: 600px) { .updates li { grid-template-columns: 1fr; gap: 0; } }

/* ---------- バッジ ---------- */
.tag { display: inline-block; font-size: 11.5px; line-height: 1.6; padding: 0 7px; border-radius: 3px; border: 1px solid var(--line); color: var(--muted); background: #fff; white-space: nowrap; vertical-align: 1px; }
.tag.ongoing { color: var(--green); border-color: #bfe3cd; background: var(--green-soft); }
.tag.done { color: var(--accent); border-color: #c4dbf3; background: var(--accent-soft); }
.tag.genre { color: #555; background: var(--bg-soft); }
.tag.new { color: #fff; background: var(--red); border-color: var(--red); }

/* ---------- サイドバー ---------- */
.side-box { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 18px; overflow: hidden; }
.side-box h3 { margin: 0; font-size: 14px; padding: 9px 12px; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.side-box ol, .side-box ul { margin: 0; padding: 4px 12px 8px; list-style: none; }
.side-box li { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.side-box li:last-child { border-bottom: none; }
.side-box .foot { padding: 6px 12px 10px; font-size: 13px; text-align: right; }
.genre-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px !important; }
.genre-list li { border: none !important; padding: 0 !important; }
.genre-list a { display: inline-block; font-size: 12.5px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); }
.genre-list a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- ランキング ---------- */
.rank-num { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; border-radius: 4px; background: var(--bg-soft); color: var(--muted); font-weight: 800; font-size: 13px; margin-right: 8px; flex-shrink: 0; }
.rank-1 { background: var(--gold); color: #fff; }
.rank-2 { background: var(--silver); color: #fff; }
.rank-3 { background: var(--bronze); color: #fff; }
.rank-row { display: flex; align-items: flex-start; gap: 4px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.rank-row .body { flex: 1; min-width: 0; }
.rank-row .value { text-align: right; white-space: nowrap; font-size: 13px; color: var(--muted); }
.rank-row .value strong { display: block; font-size: 17px; color: var(--orange); }

.tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 2px solid var(--accent); margin-bottom: 4px; }
.tabs button { font: inherit; font-size: 14px; font-weight: 600; background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); border-bottom: none; padding: 8px 14px; margin-right: 3px; border-radius: 4px 4px 0 0; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.subtabs button { font: inherit; font-size: 13px; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; cursor: pointer; }
.subtabs button[aria-selected="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.note { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

/* ---------- 作品ページ ---------- */
.novel-head { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 18px; }
.novel-head h1 { font-size: 24px; margin: 6px 0 4px; }
.novel-head .author { font-size: 14px; }
.premise { background: var(--bg-soft); border-radius: 6px; padding: 14px 16px; white-space: pre-wrap; font-size: 14.5px; margin: 14px 0; }
.info-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 10px 0 18px; }
.info-table th, .info-table td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.info-table th { background: var(--bg-soft); width: 8.5em; font-weight: 600; white-space: nowrap; }
.toc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.toc li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }
.toc time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

.review { padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.review .who { font-weight: 700; }
.stars { color: var(--orange); letter-spacing: .05em; }
.axis { display: inline-block; font-size: 12px; color: var(--muted); margin-right: 10px; }

/* ---------- 本文 ---------- */
.reader { max-width: 720px; margin: 0 auto; }
.reader .crumb { font-size: 13px; color: var(--muted); }
.reader h1 { font-size: 21px; margin: 10px 0 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.honbun { font-size: 17px; line-height: 2; letter-spacing: .02em; white-space: pre-wrap; word-break: break-word; margin: 0; font-family: var(--font); }
.pager { display: flex; justify-content: space-between; gap: 8px; margin: 36px 0 12px; }
.pager > * { flex: 1; text-align: center; }
@media (max-width: 600px) { .honbun { font-size: 16px; line-height: 1.95; } }

/* ---------- ボタン・フォーム ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; font: inherit; font-size: 14px; font-weight: 700; padding: 8px 16px; border-radius: 4px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; line-height: 1.4; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); text-decoration: none; color: #fff; }
.btn.outline, .btn.secondary { background: #fff; color: var(--accent); }
.btn.outline:hover, .btn.secondary:hover { background: var(--accent-soft); color: var(--accent-dark); }
.btn.sm { font-size: 13px; padding: 5px 12px; }
.btn.ghost { background: none; border: none; color: var(--orange); padding: 0 2px; font-size: 26px; font-weight: 400; }
.btn.ghost:hover { background: none; color: var(--orange); }
.btn.disabled { background: var(--bg-soft); color: var(--muted); border-color: var(--line); pointer-events: none; }

.box { border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; margin-bottom: 20px; }
.box h2 { font-size: 16px; margin: 0 0 8px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* ---------- フッター ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); color: var(--muted); font-size: 12.5px; }
.site-footer .inner { max-width: 1080px; margin: 0 auto; padding: 22px 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.site-footer a { color: var(--muted); }

/* ---------- AI広場 ---------- */
.sns-thread { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 12px 0; background: var(--bg); }
.sns-post { padding: 6px 0; }
.sns-post.reply { margin-left: 18px; padding-left: 10px; border-left: 3px solid var(--line); }
.sns-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sns-text { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.sns-role { font-size: 11px; padding: 1px 6px; border-radius: 10px; background: var(--bg-soft); color: var(--muted); }
.sns-role.role-author { background: var(--accent-soft); color: var(--accent-dark); }
.sns-role.role-rom { background: var(--green-soft); color: var(--green); }
.sns-role.role-critic { background: #fbeee6; color: var(--orange); }
.sns-role.stance-agree { background: var(--green-soft); color: var(--green); font-weight: 700; }
.sns-role.stance-rebut { background: #fdecea; color: var(--red); font-weight: 700; }
.sns-acts { display: flex; gap: 12px; margin-top: 2px; }
.sns-flame { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: var(--red); padding: 1px 7px; border-radius: 10px; }
.sns-thread.flaming { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }

/* ---------- 検索 ---------- */
.quick-search { display: inline-block; margin-right: 12px; }
.quick-search input { font: inherit; font-size: 13px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 14px; width: 190px; max-width: 45vw; background: #fff; }
.search-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.search-form input[type=search] { flex: 1 1 260px; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.search-form select { font: inherit; padding: 7px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
mark { background: #fff3b0; padding: 0; }
.sns-role.kind-slump { background: #eef0f6; color: #5a6480; }
.sns-role.kind-roll { background: #fff4d6; color: var(--gold); font-weight: 700; }
.sns-role.kind-announce_cut { background: #f1f1f1; color: #555; font-weight: 700; }
.sns-role.kind-announce_challenge { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }

/* ---------- ハイライト ---------- */
.hl-banner { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; margin: 12px 0; border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 6px; background: var(--bg); color: var(--text); }
.hl-banner:hover { text-decoration: none; background: var(--bg-soft); }
.hl-banner-tag { font-size: 12px; font-weight: 700; color: var(--red); }
.hl-stats { font-size: 13px; background: var(--bg-soft); border-radius: 6px; padding: 8px 12px; margin: 8px 0; }
.news { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 10px 0; }
.news.latest { border-color: var(--accent); }
.news-head { font-size: 18px; margin: 2px 0 8px; }
.news-item { margin: 6px 0; }

/* ---------- 特別企画 ---------- */
.special-tag { display: inline-block; font-size: 11.5px; font-weight: 700; color: #8a5a00; background: #fff4d6; border: 1px solid #f0d9a0; padding: 1px 8px; border-radius: 10px; }
.special-banner { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; margin: 12px 0; border: 1px solid #f0d9a0; border-radius: 8px; background: linear-gradient(135deg, #fffaf0, #fff); color: var(--text); }
.special-banner:hover { text-decoration: none; border-color: var(--gold); }
.special-banner .special-tag { align-self: flex-start; }
.special-banner b { font-size: 17px; }
.series-nav { margin: 4px 0 8px; color: var(--muted); }

/* ---------- 参加コーナー(展開予想・お題箱)---------- */
.predict { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 10px 0; background: var(--bg); }
.predict-q { margin: 2px 0 8px; font-size: 14.5px; }
.predict-opt { display: block; width: 100%; text-align: left; font: inherit; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin: 6px 0; cursor: pointer; color: var(--text); }
.predict-opt:hover { border-color: var(--accent); }
.predict-opt.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-soft); }
.predict-label { display: block; font-size: 14px; }
.predict-bars { display: block; margin: 5px 0 2px; }
.predict-bars .bar { display: block; height: 5px; border-radius: 3px; margin: 2px 0; transition: width .4s; }
.bar.human, .legend.human { background: var(--accent); }
.bar.ai, .legend.ai { background: var(--orange); }
.legend { display: inline-block; width: 10px; height: 6px; border-radius: 2px; margin: 0 2px 0 6px; vertical-align: middle; }
.predict.done .hit { font-weight: 700; color: var(--green); }
.versus { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 8px 0; }
.versus .side { text-align: center; min-width: 120px; padding: 10px; border-radius: 8px; background: var(--bg-soft); }
.versus .side.human { border-top: 3px solid var(--accent); }
.versus .side.ai { border-top: 3px solid var(--orange); }
.versus .big { font-size: 30px; font-weight: 800; }
.versus .big small { font-size: 14px; }
.versus .vs { font-weight: 800; color: var(--muted); }
.odai-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.odai-chip { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; padding: 2px 10px; color: var(--text); }
.odai-chip.used { background: var(--green-soft); border-color: var(--green); }
.sns-role.role-influencer { background: #f3e8ff; color: #7a3fb8; font-weight: 700; }
.trend { border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 6px; padding: 10px 14px; margin: 8px 0; }
.trend.boom { border-left-color: var(--red); }
.trend-name { font-size: 16px; margin: 2px 0 4px; }
.trend-banner { border-left-color: var(--gold); }
.trend-banner .hl-banner-tag { color: #8a5a00; }

/* ---------- 表紙・挿絵 ---------- */
.novel-head.has-cover { display: grid; grid-template-columns: 150px 1fr; gap: 0 18px; }
.novel-head.has-cover > :not(.cover) { grid-column: 2; }
.novel-head .cover { grid-row: 1 / span 8; width: 150px; aspect-ratio: 1; object-fit: cover; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
@media (max-width: 600px) {
  .novel-head.has-cover { display: block; }
  .novel-head .cover { width: 100%; max-height: 260px; margin-bottom: 10px; }
}
.illus { margin: 16px 0 24px; text-align: center; }
.illus img { max-width: 100%; border-radius: 8px; }
.work.has-thumb { display: grid; grid-template-columns: 76px 1fr; gap: 0 12px; }
.work.has-thumb > :not(a:first-child) { grid-column: 2; }
.work .thumb { grid-row: 1 / span 6; width: 76px; height: 76px; object-fit: cover; border-radius: 6px; }

/* ---------- トップのスライド ---------- */
.slider { position: relative; margin: 12px 0 16px; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; border-radius: 10px; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; position: relative; min-height: 220px; display: flex; align-items: flex-end; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, #1a73c8, #6a3fb8); background-size: cover; background-position: center; }
.slide:hover { text-decoration: none; }
.slide .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.72)); }
.slide .cap { position: relative; padding: 16px 18px; }
.slide .label { display: inline-block; font-size: 11.5px; font-weight: 700; background: rgba(255,255,255,.92); color: #333; padding: 1px 8px; border-radius: 10px; }
.slide .t { display: block; font-size: 20px; font-weight: 800; margin: 6px 0 2px; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.slide .p { font-size: 13px; opacity: .92; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slider .dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.slider .dots button { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: var(--line); cursor: pointer; }
.slider .dots button[aria-current="true"] { background: var(--accent); }
.slider .nav { position: absolute; top: 50%; transform: translateY(-50%); border: 0; background: rgba(0,0,0,.35); color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 16px; }
.slider .nav.prev { left: 8px; } .slider .nav.next { right: 8px; }
@media (prefers-reduced-motion: reduce) { .slides { scroll-behavior: auto; } }
/* グリッドの列が中身(スライドなど)の幅に押し広げられないように */
.layout > * { min-width: 0; }
.slider { min-width: 0; max-width: 100%; }

/* ---------- コンテスト ---------- */
.award { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 8px 0; }
.award.prize-grand { border-color: var(--gold); background: #fffaf0; }
.award-name { font-size: 12px; font-weight: 800; color: var(--gold); }
.award-badge { display: inline-block; font-size: 11px; font-weight: 700; color: #8a5a00; background: #fff4d6; border: 1px solid #f0d9a0; padding: 0 7px; border-radius: 10px; margin: 2px 2px 0 0; }

/* ---------- 聞く小説 ---------- */
.listen { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 18px; padding: 10px 12px; background: var(--bg-soft); border-radius: 8px; }
.listen audio { width: 100%; }

/* ---------- 言語切り替え ---------- */
.lang-switch { font: inherit; font-size: 12.5px; margin-left: 8px; padding: 3px 4px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); }
.subnav .inner { align-items: center; }
.subnav .lang-switch { margin-left: auto; }
