/* 하나루 위키 · 벚꽃 × 단풍 (A안: 먼지 낀 벚꽃 × 벽돌 단풍) */
:root {
  --bg: #FAF7F5;
  --surface: #F1EBE8;
  --panel: #F3EDEA;
  --white: #FFFFFF;
  --line: #E6DDDA;
  --line-strong: #DCD2CE;
  --ink: #2A2522;
  --sub: #6F6662;
  --placeholder: #ABA19C;

  --sakura-50: #F1E2E1;
  --sakura-200: #E7C7CA;
  --sakura-300: #D7A9AE;
  --sakura-400: #C98E97;
  --sakura-600: #8E4E5A;
  --sakura-700: #723D48;

  --maple-50: #F8EDE6;
  --maple-100: #F4E4DA;
  --maple-200: #E9CDBD;
  --maple-500: #B5603C;
  --maple-600: #9C4628;

  --sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --serif: 'Noto Serif KR', 'Nanum Myeongjo', serif;
  --radius: 16px;
  --pill: 999px;

  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.6; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--sakura-600); outline-offset: 2px; }
::selection { background: var(--sakura-200); }
svg { flex: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.honeypot { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }

/* 공통 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 20px; border-radius: var(--pill); border: 1px solid transparent; font-size: 15px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: var(--sakura-600); color: var(--white); }
.btn.primary:hover { background: var(--sakura-700); }
.btn.primary:disabled { opacity: .6; cursor: progress; }
.btn.outline { background: transparent; border-color: var(--line-strong); color: var(--ink); font-weight: 500; }
.btn.outline:hover { background: var(--surface); }
.btn.danger { background: transparent; border-color: var(--maple-200); color: var(--maple-600); font-weight: 500; }
.btn.danger:hover { background: var(--maple-50); }
.btn.block { width: 100%; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--surface); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.text-link { border: 0; background: none; padding: 6px 0; color: var(--sakura-600); font-size: 13px; font-weight: 600; }
.text-link:hover { color: var(--sakura-700); }

/* 머리말 */
.signature { height: 3px; background: linear-gradient(90deg, var(--sakura-300) 0%, var(--sakura-400) 40%, var(--maple-500) 100%); }
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-inner { max-width: 1168px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 4px 0; color: var(--ink); }
.brand-mark { width: 28px; height: 28px; }
.brand-mark .sakura { fill: var(--sakura-400); }
.brand-mark .maple { fill: var(--maple-500); }
.brand-mark .heart { fill: var(--bg); }
.brand span { font-family: var(--serif); font-weight: 700; font-size: 20px; letter-spacing: -.3px; }
.main-nav { display: flex; gap: 4px; }
.main-nav button { height: 44px; padding: 0 16px; border: 0; border-radius: var(--pill); background: transparent; font-size: 15px; font-weight: 500; color: var(--ink); }
.main-nav button:hover { background: var(--surface); }
.main-nav button.active { background: var(--sakura-50); color: var(--sakura-600); font-weight: 700; }
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: var(--pill); background: var(--surface); flex: 1 1 200px; max-width: 300px; min-width: 140px; color: var(--sub); }
.search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 14px; color: var(--ink); }
.search input::placeholder { color: var(--sub); }
.search:focus-within { box-shadow: 0 0 0 2px var(--sakura-300); }

.page { min-height: 70vh; }
.container { max-width: 1168px; margin: 0 auto; padding: 0 24px; }

/* 홈 */
.hero { padding: 40px 0 32px; }
.recent-panel { background: var(--panel); border-radius: 20px; padding: 18px 20px 10px; }
#recent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); column-gap: 32px; }
#recent-list .recent-row { width: calc(100% + 16px); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.recent-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 8px; margin: 0 -8px; border: 0; border-radius: 10px; background: transparent; text-align: left; color: var(--ink); width: calc(100% + 16px); }
.recent-row:hover { background: var(--bg); }
.recent-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sakura-400); }
.recent-row:nth-child(even) .dot { background: var(--maple-500); }
.recent-row .name { flex: 1 1 0; min-width: 0; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-row time { font-size: 13px; color: var(--sub); }
.recent-empty { font-size: 14px; color: var(--sub); padding: 10px 0 12px; margin: 0; }

.index-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-top: 32px; border-top: 1px solid var(--line); }
.index-head h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.4px; }
.index-head p { margin: 0; font-size: 14px; color: var(--sub); }
.alphabet { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 32px; }
.alphabet button { min-width: 44px; height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--pill); background: var(--white); font-size: 15px; font-weight: 500; color: var(--ink); }
.alphabet button:hover { border-color: var(--sakura-300); }
.alphabet button.dim { color: var(--placeholder); background: transparent; }
.alphabet button.active { background: var(--sakura-600); border-color: var(--sakura-600); color: var(--white); font-weight: 700; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 40px 24px; padding-bottom: 96px; }
.card { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.thumb { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); background: var(--sakura-50); color: var(--sakura-600); display: flex; align-items: center; justify-content: center; padding: 18px; overflow: hidden; transition: transform .2s ease; }
.card:nth-child(even) .thumb { background: var(--maple-100); color: var(--maple-600); }
@media (hover: hover) { .card:hover .thumb { transform: translateY(-3px); } }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb-title { font-family: var(--serif); font-weight: 700; line-height: 1.3; text-align: center; word-break: keep-all; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card h3 { margin: 16px 0 6px; font-size: 18px; font-weight: 700; letter-spacing: -.3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card:hover h3 { color: var(--sakura-600); }
.card .summary { margin: 0; font-size: 14px; line-height: 1.6; color: var(--sub); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin: 8px 0 0; font-size: 13px; color: var(--sub); }
.empty { grid-column: 1 / -1; text-align: center; padding: 56px 16px; border-radius: 20px; background: var(--panel); font-size: 15px; color: var(--sub); }

/* 문서 */
.article-layout { display: flex; flex-wrap: wrap; gap: 64px; align-items: flex-start; padding: 48px 0 96px; }
.article { flex: 999 1 560px; min-width: 0; max-width: 720px; }
.article.narrow { margin: 0 auto; padding: 48px 0 96px; }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--sub); }
.crumb button { border: 0; background: none; padding: 8px 0; color: var(--sub); }
.crumb button:hover { color: var(--sakura-600); }
.crumb svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.article h1, .about-title { margin: 16px 0 0; font-family: var(--serif); font-size: 44px; font-weight: 700; letter-spacing: -1px; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere; }
.article-summary { margin: 14px 0 0; font-size: 19px; line-height: 1.65; color: var(--sub); }
.article-summary:empty { display: none; }
.byline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 28px 0 8px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.avatars { display: flex; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--bg); background: var(--sakura-50); color: var(--sakura-600); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.avatar + .avatar { margin-left: -10px; }
.avatar:nth-child(even) { background: var(--maple-100); color: var(--maple-600); }
.byline-text { flex: 1 1 200px; display: flex; flex-direction: column; font-size: 14px; line-height: 1.5; }
.byline-text span { color: var(--sub); }
.article-buttons { display: flex; gap: 8px; }
.article-aside { flex: 1 1 220px; min-width: 0; position: sticky; top: 24px; padding-top: 88px; }
.article-aside h2 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--sub); }
.article-aside ol { list-style: none; margin: 0; padding: 0; }
.article-aside a { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; color: var(--ink); text-decoration: none; }
.article-aside a::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); flex: none; }
.article-aside a:hover { color: var(--sakura-600); }
.article-aside a:hover::before { background: var(--sakura-600); }
.article-aside .toc-h3 a { padding-left: 16px; font-size: 14px; }

/* 본문(문서·미리보기·에디터 공통) */
.article-body { font-size: 17px; line-height: 1.8; overflow-wrap: anywhere; padding-top: 16px; }
.article-body > :first-child { margin-top: 0; }
.article-body p { margin: .45em 0; }
.article-body h1 { font-size: 28px; line-height: 1.35; margin: 1.4em 0 .5em; font-weight: 700; letter-spacing: -.5px; }
.article-body h2 { font-size: 23px; line-height: 1.4; margin: 1.4em 0 .5em; font-weight: 700; letter-spacing: -.4px; }
.article-body h3 { font-size: 19px; line-height: 1.5; margin: 1.2em 0 .4em; font-weight: 700; }
.article-body a { color: var(--sakura-600); text-decoration: underline; text-decoration-color: var(--sakura-300); text-underline-offset: 3px; }
.article-body a:hover { color: var(--sakura-700); text-decoration-color: currentColor; }
.article-body a.wiki-link { text-decoration-style: solid; font-weight: 500; }
.article-body a.wiki-link.missing { color: var(--maple-600); text-decoration-style: dashed; text-decoration-color: var(--maple-200); }
.article-body strong, .article-body b { font-weight: 700; }
.article-body em, .article-body i { font-style: italic; font-synthesis: style; }
.article-body blockquote { position: relative; margin: 1.4em 0; padding: 22px 28px 22px 56px; border-radius: var(--radius); background: var(--panel); }
.article-body blockquote::before { content: '\201C'; position: absolute; left: 20px; top: 8px; font-family: var(--serif); font-size: 48px; line-height: 1; color: var(--maple-500); }
.article-body blockquote p { margin: 0; }
.article-body figure { margin: 1.6em 0; text-align: center; }
.article-body img { display: block; max-width: 100%; max-height: 640px; width: auto; height: auto; margin: 0 auto; border-radius: 12px; }
.article-body figcaption { font-size: 14px; color: var(--sub); margin-top: 10px; }
.article-body hr { border: 0; height: 1px; background: var(--line-strong); margin: 2em 0; }
.article-body ul, .article-body ol { padding-left: 1.5em; margin: .5em 0; }
.article-body li { margin: .2em 0; }
.article-body code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; background: var(--surface); padding: 1px 6px; border-radius: 6px; }
.article-body :is(p, h1, h2, h3, blockquote, li, figure).align-center { text-align: center; }
.article-body :is(p, h1, h2, h3, blockquote, li, figure).align-right { text-align: right; }
.article-body :is(p, h1, h2, h3, blockquote, li, figure).align-left { text-align: left; }
/* 예전 방식(글자 단위)으로 저장된 문서도 깨지지 않게 남겨 둔 규칙 */
.article-body span.align-left { display: block; text-align: left; }
.article-body span.align-center { display: block; text-align: center; }
.article-body span.align-right { display: block; text-align: right; }
.article-body .inline-h1 { font-size: 28px; line-height: 1.35; font-weight: 700; }
.article-body .inline-h2 { font-size: 23px; line-height: 1.4; font-weight: 700; }
.article-body .inline-h3 { font-size: 19px; line-height: 1.5; font-weight: 700; }
.article-body .inline-body { font-size: 1em; font-weight: 400; }

/* 가리기 */
.spoiler { background: var(--ink); color: var(--ink); border-radius: 4px; padding: 0 4px; cursor: pointer; transition: background .15s, color .15s; }
.spoiler:hover, .spoiler.revealed { background: var(--surface); color: var(--ink); }
.rich-editor .spoiler { background: var(--ink); color: var(--white); }

/* 투표 */
.poll-block { margin: 1.6em 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--white); }
.poll-block > strong { display: block; font-size: 18px; margin-bottom: 14px; }
.poll-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.poll-option { --pct: 0%; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--white); text-align: left; font-size: 15px; font-weight: 500; color: var(--ink); overflow: hidden; }
@media (hover: hover) { .poll-option:not(:disabled):hover { border-color: var(--sakura-400); background: var(--sakura-50); } }
.poll-option:not(:disabled):active { border-color: var(--sakura-400); background: var(--sakura-50); }
.poll-option:disabled { cursor: default; opacity: 1; }
.poll-option.show-result { border-color: transparent; background: linear-gradient(90deg, var(--maple-200) var(--pct), var(--surface) var(--pct)); }
.poll-option.show-result.selected { background: linear-gradient(90deg, var(--sakura-200) var(--pct), var(--surface) var(--pct)); font-weight: 700; }
.poll-option.show-result::after { content: attr(data-pct); font-weight: 700; }
.poll-option.selected::before { content: '내 선택'; order: 2; margin-left: auto; font-size: 12px; font-weight: 700; color: var(--sakura-600); background: var(--white); padding: 2px 8px; border-radius: var(--pill); }
.poll-option.selected.show-result::after { order: 3; }
.poll-block small { display: block; color: var(--sub); font-size: 13px; }
.rich-editor .poll-option { pointer-events: none; }

/* 댓글 */
.comments { margin-top: 72px; padding-top: 32px; border-top: 1px solid var(--line); }
.comments h2 { margin: 0; font-size: 20px; font-weight: 700; }
.comments h2 span { color: var(--maple-600); }
.comment-form { margin-top: 20px; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 16px; background: var(--white); display: flex; flex-direction: column; gap: 12px; }
.comment-form:focus-within { border-color: var(--sakura-300); }
.comment-form textarea { width: 100%; border: 0; outline: none; resize: vertical; font-size: 16px; line-height: 1.6; background: transparent; }
.comment-fields { display: flex; gap: 8px; flex-wrap: wrap; }
.comment-fields input { height: 44px; flex: 1 1 150px; min-width: 0; padding: 0 14px; border: 0; border-radius: 10px; background: var(--surface); font-size: 14px; outline: none; }
.comment-fields input:focus { box-shadow: 0 0 0 2px var(--sakura-300); }
.comment-form .form-status:empty { display: none; }
.comment { display: flex; gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.comment .avatar { width: 40px; height: 40px; flex: none; border: 0; }
.comment:nth-child(even) .avatar { background: var(--maple-100); color: var(--maple-600); }
.comment-body { flex: 1 1 0; min-width: 0; }
.comment-head { display: flex; gap: 8px; align-items: baseline; }
.comment-head strong { font-size: 15px; }
.comment-head time { font-size: 13px; color: var(--sub); }
.comment p { margin: 6px 0 0; font-size: 15px; line-height: 1.7; white-space: pre-wrap; }
.delete-comment { margin-left: auto; border: 0; background: none; color: var(--maple-600); font-size: 13px; padding: 4px 8px; border-radius: 8px; }
.delete-comment:hover { background: var(--maple-50); }

/* 에디터 */
.editor-form { min-height: 100vh; }
.editor-topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--bg); }
.editor-crumb { font-size: 15px; color: var(--sub); }
.editor-crumb strong { color: var(--ink); font-weight: 600; }
.spacer { flex: 1 1 0; }
.toolbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px; padding: 6px 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.tool-button { height: 40px; min-width: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 500; }
.tool-button:hover { background: var(--surface); }
.tool-button.active { background: var(--sakura-50); color: var(--sakura-600); }
.icon-button { width: 40px; padding: 0; }
.icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button b { font-size: 18px; font-weight: 800; line-height: 1; }
.italic-icon i { font-family: Georgia, 'Times New Roman', serif; font-size: 20px; font-weight: 700; font-style: italic; line-height: 1; }
.tool-sep { width: 1px; height: 22px; background: var(--line-strong); margin: 0 6px; }
.color-tool { position: relative; flex-direction: column; gap: 2px; cursor: pointer; }
.color-letter { font-size: 17px; font-weight: 700; line-height: 1; }
.color-bar { width: 18px; height: 3px; border-radius: 2px; background: var(--maple-600); }
.color-tool input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.tool-dropdown { position: relative; display: inline-flex; }
.dropdown-trigger { min-width: 84px; justify-content: space-between; }
.icon-dropdown { min-width: 0; width: auto; padding: 0 8px; gap: 4px; }
.icon-dropdown svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.chevron { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.tool-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 150px; padding: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(42, 37, 34, .12); z-index: 20; }
.tool-menu button { display: block; width: 100%; border: 0; border-radius: 8px; background: transparent; text-align: left; padding: 10px 12px; font-size: 14px; white-space: nowrap; }
.tool-menu button:hover { background: var(--sakura-50); color: var(--sakura-600); }
.tool-menu .menu-h1 { font-size: 20px; font-weight: 700; }
.tool-menu .menu-h2 { font-size: 17px; font-weight: 700; }
.tool-menu .menu-h3 { font-size: 15px; font-weight: 700; }

.editor-layout { display: flex; flex-wrap: wrap; align-items: stretch; }
.editor-main { flex: 999 1 560px; min-width: 0; padding: 48px 24px 96px; }
.editor-main > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.title-input, .summary-input { display: block; width: 100%; border: 0; outline: none; padding: 0; background: transparent; }
.title-input { font-family: var(--serif); font-size: 40px; font-weight: 700; letter-spacing: -.8px; line-height: 1.3; }
.summary-input { margin-top: 12px; font-size: 18px; color: var(--sub); }
.title-input::placeholder, .summary-input::placeholder { color: var(--placeholder); }
.editor-divider { height: 1px; background: var(--line); margin-top: 24px; margin-bottom: 8px; }
.editor-body-wrap { position: relative; }
.rich-editor { min-height: 360px; padding: 16px 0 24px; outline: none; }
.rich-editor:empty::before { content: attr(data-placeholder); color: var(--placeholder); }
.editor-hint { font-size: 13px; color: var(--sub); margin-top: 8px; }
.editor-hint code { background: var(--surface); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.link-suggest { position: absolute; z-index: 15; min-width: 220px; max-width: 320px; padding: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(42, 37, 34, .14); }
.link-suggest::before { content: '문서 연결'; display: block; padding: 4px 10px 6px; font-size: 12px; font-weight: 700; color: var(--sub); }
.link-suggest button { display: block; width: 100%; border: 0; border-radius: 8px; background: transparent; text-align: left; padding: 9px 10px; font-size: 14px; }
.link-suggest button:hover, .link-suggest button.on { background: var(--sakura-50); color: var(--sakura-600); }
.editor-side { flex: 1 1 300px; max-width: 380px; min-width: 0; padding: 32px 28px 48px; border-left: 1px solid var(--line); background: var(--panel); }
.editor-side h2 { margin: 0 0 24px; font-size: 17px; font-weight: 700; }
.field { margin-bottom: 24px; }
.field label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.field label small { font-weight: 500; color: var(--sub); margin-left: 4px; }
.field input, dialog input { display: block; width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--white); font-size: 15px; outline: none; }
.field input:focus, dialog input:focus { border-color: var(--sakura-400); box-shadow: 0 0 0 3px var(--sakura-50); }
.help { margin: 8px 0; font-size: 13px; line-height: 1.6; color: var(--sub); }
.form-status { margin: 12px 0 0; min-height: 20px; font-size: 14px; line-height: 1.6; color: var(--maple-600); }

/* 미리보기 */
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 24px; padding: 12px 12px 12px 20px; border-radius: var(--radius); background: var(--maple-50); font-size: 14px; font-weight: 600; color: var(--maple-600); }

/* 바닥글 */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); }
.footer-inner { max-width: 1168px; margin: 0 auto; padding: 28px 24px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; font-size: 13px; color: var(--sub); }
.footer-inner strong { color: var(--ink); }
.footer-inner button { border: 0; background: none; color: var(--sub); font-size: 13px; padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; }

/* 관리자 창 */
dialog { width: min(420px, calc(100vw - 32px)); border: 0; border-radius: 20px; background: var(--bg); color: var(--ink); padding: 24px 28px; box-shadow: 0 24px 64px rgba(42, 37, 34, .25); }
dialog::backdrop { background: rgba(42, 37, 34, .45); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.dialog-head button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; font-size: 24px; }
.dialog-head button:hover { background: var(--surface); }
dialog p { font-size: 14px; line-height: 1.6; color: var(--sub); }
dialog label { display: block; font-size: 14px; font-weight: 700; margin: 16px 0 8px; }
dialog .btn { margin-top: 18px; }

@media (max-width: 900px) {
  .article-aside { display: none; }
  .editor-side { max-width: none; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .header-inner { gap: 8px 12px; padding: 10px 16px; }
  .brand span { font-size: 18px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; }
  .main-nav button { padding: 0 12px; font-size: 14px; }
  .search { order: 4; flex: 1 1 100%; max-width: none; margin-left: 0; }
  #new-document { margin-left: auto; height: 40px; padding: 0 14px; }
  .container { padding: 0 16px; }
  .hero { padding: 20px 0 24px; }
  .alphabet { flex-wrap: nowrap; overflow-x: auto; margin: 16px -16px 24px; padding: 0 16px 4px; scrollbar-width: none; }
  .alphabet button { flex: none; height: 40px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
  .card h3 { font-size: 16px; margin-top: 10px; }
  .card .summary { font-size: 13px; }
  .card .meta { display: none; }
  .article-layout { padding: 28px 0 64px; }
  .article h1, .about-title { font-size: 32px; }
  .article-summary { font-size: 17px; }
  .byline-text { flex: 1 1 0; min-width: 0; }
  .article-buttons .btn { padding: 0 14px; }
  .editor-topbar { padding: 8px 12px; }
  .editor-crumb { display: none; }
  .toolbar { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding: 4px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .toolbar::-webkit-scrollbar { display: none; }
  .tool-button, .tool-dropdown { flex: none; }
  .tool-sep { margin: 0 2px; }
  /* iOS는 16px보다 작은 입력칸을 누르면 화면을 확대하므로 입력 글자를 16px로 맞춘다. */
  .search input, .comment-fields input, .field input, dialog input, .summary-input { font-size: 16px; }
  .editor-main { padding: 28px 16px 48px; }
  .title-input { font-size: 30px; }
  .editor-side { padding: 24px 16px 40px; }
}

/* 글자색 메뉴: 벚꽃·단풍 기본 색 + 다른 색 고르기 */
.color-menu { width: 248px; padding: 12px; }
.color-menu-title { margin: 0 0 8px 4px; font-size: 13px; font-weight: 700; color: var(--sub); }
.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.tool-menu .swatches button { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 8px; font-size: 13px; }
.swatches span { width: 16px; height: 16px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(42, 37, 34, .12); }
.swatches [data-color="#2A2522"] span { background: #2A2522; }
.swatches [data-color="#8E4E5A"] span { background: #8E4E5A; }
.swatches [data-color="#C98E97"] span { background: #C98E97; }
.swatches [data-color="#9C4628"] span { background: #9C4628; }
.swatches [data-color="#B5603C"] span { background: #B5603C; }
.swatches [data-color="#6F6662"] span { background: #6F6662; }
.custom-color { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 10px 8px 4px; border-top: 1px solid var(--line); font-size: 13px; color: var(--sub); cursor: pointer; }
.custom-color input { width: 32px; height: 28px; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: none; cursor: pointer; }
.color-tool.dropdown-trigger { min-width: 40px; width: 40px; padding: 0; justify-content: center; }

/* ---------- 커뮤니티 기능 ---------- */
.muted { color: var(--sub); }
.btn.small { height: 36px; padding: 0 14px; font-size: 13px; }
.user-link { border: 0; background: none; padding: 0; color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.user-link:hover { color: var(--sakura-600); text-decoration-color: currentColor; }
.muted-link { color: var(--sub); font-weight: 500; }
.field select, dialog select, dialog textarea, .admin-notice textarea, .reply-form textarea { display: block; width: 100%; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--white); font-size: 15px; outline: none; }
.field select, dialog select { height: 48px; }
.field select:focus, dialog select:focus, dialog textarea:focus, .admin-notice textarea:focus, .reply-form textarea:focus { border-color: var(--sakura-400); box-shadow: 0 0 0 3px var(--sakura-50); }

.notice { display: flex; gap: 12px; align-items: baseline; margin: 0 0 16px; padding: 14px 18px; border-radius: var(--radius); background: var(--maple-50); color: var(--ink); font-size: 15px; line-height: 1.6; }
.notice strong { flex: none; color: var(--maple-600); font-size: 13px; }
.recent-row.type-guest .dot { background: var(--sakura-200); }
.recent-row.type-comment .dot { background: var(--sakura-300); }

.index-head .spacer { flex: 1 1 0; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--pill); background: var(--white); font-size: 14px; font-weight: 500; }
.chip-btn:hover { border-color: var(--sakura-300); color: var(--sakura-600); }
.chip-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip-btn span { color: var(--maple-600); font-weight: 700; }
.categories, .filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }
.categories button, .filter-chips button { height: 36px; padding: 0 14px; border: 0; border-radius: var(--pill); background: var(--surface); font-size: 14px; font-weight: 500; color: var(--ink); }
.categories button.active, .filter-chips button.active { background: var(--maple-100); color: var(--maple-600); font-weight: 700; }
.categories + .alphabet { margin-top: 12px; }
.category-chip { display: inline-flex; margin-top: 14px; padding: 4px 12px; border-radius: var(--pill); background: var(--maple-50); color: var(--maple-600); font-size: 13px; font-weight: 700; }
.category-chip + h1 { margin-top: 8px; }

.doc-tabs { display: flex; align-items: center; gap: 4px; margin: 8px 0 0; border-bottom: 1px solid var(--line); }
.doc-tabs button { height: 44px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; font-size: 15px; font-weight: 500; color: var(--sub); margin-bottom: -1px; }
.doc-tabs button.active { color: var(--ink); font-weight: 700; border-bottom-color: var(--sakura-600); }
.doc-tabs button:hover { color: var(--ink); }
.doc-tabs .spacer { flex: 1 1 0; }
.doc-tabs .report-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.report-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.byline { margin-bottom: 0; }
.byline-text strong { font-weight: 500; }

.backlinks { margin-top: 48px; padding: 20px; border-radius: var(--radius); background: var(--panel); }
.backlinks h2 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.link-list { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-pill { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: var(--pill); background: var(--white); border: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none; }
.doc-pill:hover { border-color: var(--sakura-300); color: var(--sakura-600); }

.reply-to { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--sakura-600); font-weight: 600; }
.comment-head { flex-wrap: wrap; }
.comment-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.comment-actions .text-link { padding: 4px 0; }
.comment.reply { margin-left: 52px; padding-top: 14px; }
.comment.reply .avatar { width: 32px; height: 32px; font-size: 13px; }

.footnotes { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.7; color: var(--sub); }
.footnotes ol { margin: 0; padding-left: 0; list-style: none; }
.footnotes li { margin: 4px 0; }
.footnotes a, .fn-ref a { color: var(--sakura-600); text-decoration: none; font-weight: 600; }
.fn-ref { font-size: .75em; line-height: 0; margin-left: 1px; }

/* 공통 페이지(역사·최근 바뀜·방명록·기여·관리자) */
.page-narrow { max-width: 760px; margin: 0 auto; padding: 40px 0 96px; }
.page-title { margin: 12px 0 0; font-family: var(--serif); font-size: 34px; font-weight: 700; letter-spacing: -.6px; line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }
.page-title small { font-family: var(--sans); font-size: 18px; font-weight: 600; color: var(--sub); letter-spacing: 0; }
.page-lead { margin: 10px 0 28px; font-size: 15px; line-height: 1.7; color: var(--sub); }
.section-title { margin: 36px 0 12px; font-size: 18px; font-weight: 700; }
.section-title span { color: var(--maple-600); }
.more-row { display: flex; justify-content: center; margin-top: 24px; }
.page-narrow .empty { list-style: none; }

.history-list, .activity-list, .wanted-list, .admin-list { list-style: none; margin: 0; padding: 0; }
.history-row, .admin-list li { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 0; border-bottom: 1px solid var(--line); }
.history-main, .admin-list li > div:first-child { flex: 1 1 260px; min-width: 0; }
.history-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; font-size: 14px; }
.history-top time { color: var(--sub); }
.history-note, .activity-note { margin: 6px 0 0; font-size: 14px; color: var(--ink); }
.history-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-list p { margin: 4px 0; font-size: 14px; }
.admin-list time { font-size: 13px; color: var(--sub); }
.delta { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: var(--pill); font-variant-numeric: tabular-nums; }
.delta.plus { background: var(--sakura-50); color: var(--sakura-600); }
.delta.minus { background: var(--maple-50); color: var(--maple-600); }
.delta.zero { background: var(--surface); color: var(--sub); }
.badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: var(--pill); background: var(--ink); color: var(--white); }
.badge.soft { background: var(--surface); color: var(--sub); }

.revision-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.revision-head .page-lead { margin-bottom: 0; }
.segmented { display: inline-flex; gap: 4px; margin: 24px 0 12px; padding: 4px; border-radius: var(--pill); background: var(--surface); }
.segmented button { height: 36px; padding: 0 16px; border: 0; border-radius: var(--pill); background: none; font-size: 14px; font-weight: 500; color: var(--sub); }
.segmented button[aria-selected="true"] { background: var(--white); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(42, 37, 34, .12); }
.segmented button:disabled { opacity: .45; cursor: not-allowed; }
.revision-body { border-top: 1px solid var(--line); margin-top: 8px; }
.diff-legend { display: flex; gap: 12px; margin: 0; font-size: 13px; }
ins { text-decoration: none; background: var(--sakura-200); color: var(--ink); border-radius: 3px; padding: 0 2px; }
del { text-decoration: line-through; text-decoration-color: var(--maple-600); background: var(--maple-100); color: var(--maple-600); border-radius: 3px; padding: 0 2px; }
.diff-same { color: var(--sub); }
.diff-skip { text-align: center; font-size: 13px; color: var(--placeholder); }
.diff-changed, .diff-add, .diff-del { padding: 6px 10px; border-radius: 10px; background: var(--white); border: 1px solid var(--line); }

.activity-row { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.type-chip { flex: none; align-self: flex-start; min-width: 56px; text-align: center; margin-top: 2px; padding: 3px 8px; border-radius: var(--pill); font-size: 12px; font-weight: 700; background: var(--surface); color: var(--sub); }
.type-create .type-chip { background: var(--sakura-50); color: var(--sakura-600); }
.type-edit .type-chip, .type-restore .type-chip { background: var(--maple-50); color: var(--maple-600); }
.type-delete .type-chip { background: var(--ink); color: var(--white); }
.activity-main { flex: 1 1 0; min-width: 0; }
.activity-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; }
.activity-top a { color: var(--ink); font-weight: 700; text-decoration: none; }
.activity-top a:hover { color: var(--sakura-600); }
.activity-sub { display: flex; gap: 10px; align-items: baseline; margin-top: 4px; font-size: 14px; }
.activity-sub time { color: var(--sub); font-size: 13px; }
.activity-main .text-link { margin-top: 2px; }

.guest-form { margin-top: 24px; }
.guest-list { margin-top: 8px; }
.admin-reply { margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: var(--sakura-50); }
.admin-reply strong { font-size: 12px; color: var(--sakura-600); }
.admin-reply p { margin: 4px 0 0; }
.reply-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; margin-top: 10px; }

.wanted-list li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.wanted-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.wanted-head strong { font-size: 17px; color: var(--maple-600); }
.wanted-head .btn { margin-left: auto; }
.admin-notice { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }

@media (max-width: 640px) {
  .index-head .spacer { display: none; }
  .chip-btn { height: 36px; font-size: 13px; }
  .categories { flex-wrap: nowrap; overflow-x: auto; margin: 16px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
  .categories button { flex: none; }
  .page-narrow { padding: 24px 0 64px; }
  .page-title { font-size: 27px; }
  .comment.reply { margin-left: 28px; }
  .doc-tabs button { padding: 0 10px; font-size: 14px; }
  .history-actions { width: 100%; }
}
.user-link .trip { display: inline-block; margin-left: 3px; font-size: 1.05em; line-height: 1; vertical-align: -1px; text-decoration: none; }

/* 관리자: 분류 관리 */
.category-editor { margin-top: 8px; }
.category-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.category-row { display: flex; align-items: center; gap: 8px; }
.category-row input { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--white); font-size: 16px; outline: none; }
.category-row input:focus { border-color: var(--sakura-400); box-shadow: 0 0 0 3px var(--sakura-50); }
.category-row .muted { flex: none; width: 64px; font-size: 13px; text-align: right; }
.small-icon { width: 40px; height: 40px; font-size: 18px; color: var(--sub); flex: none; }
.small-icon:disabled { opacity: .3; cursor: default; }
.category-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
@media (max-width: 640px) { .category-row .muted { display: none; } .small-icon { width: 36px; } }
.admin-notice .category-actions { width: 100%; margin-top: 0; }
.admin-notice .muted { font-size: 13px; }
.page-narrow li.empty { display: block; padding: 24px 16px; text-align: center; }
.form-hint { margin: 0; font-size: 13px; line-height: 1.6; color: var(--sub); }
.form-hint strong { color: var(--sakura-600); font-weight: 700; margin-right: 2px; }
dialog .form-hint { margin-top: 6px; }
.type-guest .type-chip, .type-guest-reply .type-chip { background: var(--sakura-50); color: var(--sakura-600); }

/* 방명록 답글·수정 */
.guest-thread { border-bottom: 1px solid var(--line); }
.guest-thread > .comment { border-bottom: 0; }
.guest-thread > .comment.reply { padding-top: 0; padding-bottom: 16px; }
.inline-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--white); }
.inline-form textarea { width: 100%; border: 0; outline: none; resize: vertical; font-size: 16px; line-height: 1.6; background: transparent; }
.inline-form .comment-fields input { flex: 1 1 120px; }
.inline-form .form-status:empty { display: none; }
.guest-no { flex: none; min-width: 32px; padding: 1px 8px; border-radius: 999px; background: var(--surface); color: var(--sub); font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.guest-no::before { content: 'No.'; margin-right: 2px; font-weight: 600; }
.ask-list-rows { display: grid; gap: 8px; }
.ask-list-row { display: flex; gap: 6px; align-items: center; }
.ask-list-row input { flex: 1; min-width: 0; }
.ask-list-remove { flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--sub); font-size: 20px; cursor: pointer; }
.ask-list-remove:hover { background: var(--surface); color: var(--sakura-600); }
.ask-list-add { width: 100%; height: 44px; margin-top: 8px; border: 1px dashed var(--line-strong); border-radius: 12px; background: none; color: var(--sakura-600); font-size: 14px; font-weight: 700; cursor: pointer; }
.ask-list-add:hover { border-color: var(--sakura-400); background: var(--sakura-50); }
.ask-list [hidden] { display: none; }

/* 소개: 다른 안내 화면과 같은 제목 크기, 간결한 본문 위계 */
#about-view .article-body { font-size: 15px; line-height: 1.75; }
#about-view .about-title { font-size: 34px; line-height: 1.3; letter-spacing: -.6px; margin: 12px 0 24px; }
#about-view .article-body h2 { font-size: 19px; line-height: 1.4; margin: 28px 0 10px; }
#about-view .article-body p { margin: 8px 0; }

/* 긴 닉네임은 이름만 줄이고 이모지와 작업 버튼은 유지 */
.comment-head { flex-wrap: wrap; align-items: center; }
.comment-head .user-link { display: inline-flex; align-items: center; flex: 1 1 0; min-width: 0; text-align: left; }
.comment-head .user-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-head .trip { flex: none; }
.comment-head time, .comment-head .guest-no { flex: none; white-space: nowrap; }
.comment-actions { flex: none; flex-wrap: wrap; }
.comment-actions button { white-space: nowrap; }
.inline-form { min-width: 0; max-width: 100%; }
.inline-form .comment-fields { min-width: 0; }
.inline-form textarea, .reply-form textarea { min-width: 0; box-sizing: border-box; }
@media (max-width: 640px) {
  #about-view .about-title { font-size: 27px; margin-bottom: 20px; }
  #about-view .article-body h2 { font-size: 18px; }
  .comment-head .comment-actions { flex-basis: 100%; margin-left: 0; gap: 12px; }
  .comment-head .user-link { font-size: 14px; }
  .inline-form .comment-fields input { flex-basis: 100%; }
}
/* 좁은 화면: 닉네임·비밀번호는 한 줄씩, 하나루 코드는 등록 버튼과 한 줄 */
@media (max-width: 640px) {
  .comment-form .comment-fields input { flex-basis: 100%; }
  .comment-form .comment-fields input:last-of-type { flex: 1 1 0; }
}
