/* makeetc 共通。記事はX記事に近い組み方（幅600px・本文17px・見出し太字）。Xのロゴ・名前は使わない */
:root {
  --fg: #0f1419; --mute: #536471; --line: #eff3f4; --bg: #fff; --accent: #1d9bf0;
  --warn: #fff4d6; --warnline: #f5c451; --ok: #00ba7c; --danger: #f4212e;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font-family: var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--mute); }

/* ---- 一覧 ---- */
.home main { max-width: 600px; margin: 0 auto; padding: 40px 20px; }
.home h1 { font-size: 28px; margin: 0 0 20px; }
.plist { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.plist li { padding: 16px 4px; border-bottom: 1px solid var(--line); font-size: 17px; }
.foot { margin-top: 32px; font-size: 14px; }

/* ---- 上のバー ---- */
.bar { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.bar .in { max-width: 600px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 10px; min-height: 53px; }
.bar .label { font-weight: 700; font-size: 17px; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bar .status { font-size: 12px; color: var(--mute); white-space: nowrap; }
.btn { appearance: none; border: 1px solid #cfd9de; background: #fff; color: var(--fg); font: 700 14px var(--font); padding: 7px 16px; border-radius: 9999px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f7f9f9; }
.btn.primary { background: var(--fg); color: #fff; border-color: var(--fg); }
.btn.primary:hover { background: #272c30; }
.btn.small { padding: 4px 12px; font-size: 13px; }
.btn.danger { color: var(--danger); border-color: #fdc9ce; }

/* ---- 記事 ---- */
.article { max-width: 600px; margin: 0 auto; padding: 0 16px 120px; }
.cover { margin: 12px 0 0; aspect-ratio: 5 / 2; border-radius: 16px; background: linear-gradient(135deg, #e8eef2, #cfd9de); display: flex; align-items: center; justify-content: center; color: var(--mute); font-size: 14px; }
.title { font-size: 31px; line-height: 1.25; font-weight: 800; margin: 20px 0 16px; letter-spacing: -.01em; word-break: break-word; }
.author { display: flex; align-items: center; gap: 10px; padding: 4px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #cfd9de; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: linear-gradient(135deg,#8ecdf8,#1d9bf0); }
.author .nm { font-weight: 700; font-size: 15px; }
.author .hd { color: var(--mute); font-size: 15px; }
.body { font-size: 17px; line-height: 1.75; word-break: break-word; }
.body p { margin: 0 0 20px; }
.body h2 { font-size: 25px; line-height: 1.3; font-weight: 800; margin: 40px 0 16px; }
.body ul { margin: 0 0 20px; padding-left: 1.3em; }
.body li { margin: 4px 0; }
.body .img { margin: 8px 0 24px; border: 1px dashed #cfd9de; border-radius: 16px; background: #f7f9f9; color: var(--mute); font-size: 14px; padding: 36px 16px; text-align: center; }
.body mark { background: var(--warn); border-bottom: 2px solid var(--warnline); padding: 0 2px; border-radius: 3px; }

/* 編集中 */
.ed-title { width: 100%; font: 800 31px/1.25 var(--font); border: 0; outline: none; padding: 0; margin: 20px 0 16px; color: var(--fg); resize: none; overflow: hidden; background: #fbfcfc; border-radius: 8px; }
.ed-body { width: 100%; font: 17px/1.75 var(--font); border: 0; outline: none; color: var(--fg); resize: none; overflow: hidden; min-height: 60vh; background: #fbfcfc; border-radius: 8px; padding: 4px; }
.hint { font-size: 12px; color: var(--mute); margin: 8px 0 0; line-height: 1.6; }

/* お知らせ帯 */
.notice { max-width: 600px; margin: 10px auto 0; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.6; display: none; }
.notice.show { display: block; }
.notice.warn { background: var(--warn); border: 1px solid var(--warnline); }
.notice.err { background: #fde8ea; border: 1px solid #f7a1a8; }
.notice .acts { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- 管理画面 ---- */
.admin main { max-width: 920px; margin: 0 auto; padding: 24px 16px 80px; }
.admin h1 { font-size: 24px; margin: 0 0 4px; }
.admin h2 { font-size: 18px; margin: 32px 0 10px; }
.card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 12px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1; min-width: 200px; }
input[type=text], input[type=password], select, textarea.in { font: 15px var(--font); padding: 9px 12px; border: 1px solid #cfd9de; border-radius: 10px; outline: none; }
input:focus, select:focus, textarea.in:focus { border-color: var(--accent); }
.pg-title { font-weight: 700; font-size: 16px; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 9999px; background: #eff3f4; color: var(--mute); }
.tag.pub { background: #e3f8ef; color: #00805a; }
.keys { margin-top: 10px; font-size: 13px; }
.keys .k { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.keys code { font-size: 12px; background: #f7f9f9; padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfd9de; border-radius: 9999px; cursor: pointer; transition: .15s; }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(20px); }
.hist { font-size: 13px; margin-top: 8px; }
.hist div { padding: 4px 0; border-top: 1px dashed var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.login { max-width: 360px; margin: 80px auto; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 9999px; font-size: 14px; display: none; z-index: 50; }
.toast.show { display: block; }

@media (max-width: 500px) {
  .title, .ed-title { font-size: 26px; }
  .body h2 { font-size: 22px; }
}
