:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --text: #1a1f2b;
  --muted: #5b6475;
  --line: #e3e7ef;
  --primary: #034480;   /* 로고의 파란색 */
  --primary-dark: #02305a;
  --ok-bg: #e8f7ee; --ok: #1d7a43;
  --err-bg: #fdecec; --err: #b42318;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  word-break: keep-all;
  /* 내용이 짧은 페이지에서도 footer가 화면 아래에 붙도록 */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--primary); }
/* 키보드 이동 시 현재 위치 표시 */
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; }
.container { width: min(1100px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); }
.muted { color: var(--muted); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.logo { display: flex; align-items: center; position: relative; z-index: 2; }
/* ToyKON 링크봇: 로고 뒤에서 굴러 나와 합체하는 꼬마 로봇 (assets/js/linkbot.js) */
.header-inner { position: relative; }
.nav { position: relative; z-index: 2; }
.linkbot { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.lb-link { stroke: #231f20; stroke-width: 5; stroke-linecap: round; }
.lb-mid { stroke: var(--primary); }
.lb-pin { fill: #fff; }
.lb-helmet { fill: #231f20; }
.lb-ear { fill: #9aa0aa; }
.lb-face { fill: #000; }
.lb-led { fill: #fff; }
.lb-ledline { fill: none; stroke: #fff; stroke-width: .85; stroke-linecap: round; stroke-linejoin: round; }
.lb-head .ex { display: none; }
.lb-head.e-normal .ex-normal, .lb-head.e-happy .ex-happy, .lb-head.e-wow .ex-wow, .lb-head.e-scan .ex-scan { display: inline; }
.lb-bar.on .lb-pin { fill: #7fd3ff; }
.lb-wave { fill: none; stroke: #3aa0ff; stroke-width: 1.2; stroke-linecap: round; }
.lb-beam { fill: #3aa0ff; fill-opacity: .16; }
.lb-flash { fill: none; stroke: #3aa0ff; stroke-width: 1.5; }
@media (max-width: 560px), (prefers-reduced-motion: reduce) { .linkbot { display: none; } }
.logo img { height: 36px; width: auto; display: block; }
.tag { font-size: .75rem; font-weight: 600; color: var(--muted); background: var(--bg-alt); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; vertical-align: middle; }
.nav { display: flex; gap: 20px; flex-wrap: wrap; }
.nav a { color: var(--text); text-decoration: none; font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--primary); }

/* Hero */
.hero { padding: 96px 0 80px; background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 60%); }
.eyebrow { color: var(--primary); font-weight: 700; letter-spacing: .08em; margin: 0 0 8px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.25; margin: 0 0 16px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 600px; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero-img { width: 100%; height: auto; border-radius: 24px; box-shadow: 0 20px 50px rgba(3, 30, 70, .25); }

/* Gallery */
.gallery-title { margin: 36px 0 14px; font-size: 1.2rem; }
.gallery { display: grid; gap: 16px; }
.gallery figure { margin: 0; background: var(--bg-alt); border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; height: auto; display: block; }
.gallery figcaption { padding: 10px 14px; font-size: .9rem; color: var(--muted); }
.gallery-toykon { grid-template-columns: repeat(3, 1fr); }
.gallery-toykon .wide { grid-column: 1 / -1; }
.gallery-toykon figure:not(.wide) img { aspect-ratio: 3 / 4; object-fit: contain; background: #fff; }
.gallery-poses { grid-template-columns: 1fr; }

/* Buttons */
.btn { display: inline-block; padding: 12px 22px; border-radius: 999px; border: 0; background: var(--primary); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); }
.btn-ghost:hover { background: #eef2ff; }

/* Sections */
.section { padding: 72px 0; }
.section.alt { background: var(--bg-alt); }
.section[id] { scroll-margin-top: 16px; }   /* 메뉴로 이동했을 때 제목이 고정 헤더에 가리지 않도록 */
.section h1, .section h2 { font-size: 1.9rem; margin: 0 0 20px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 28px 0 0; }
.facts div { background: var(--bg-alt); border-radius: var(--radius); padding: 16px; }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 4px 0 0; font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card h3 { margin: 0 0 8px; }

/* Footer */
.site-footer { background: #11151f; color: #aab1c0; padding: 40px 0; font-size: .92rem; }
.site-footer p { margin: 4px 0; }
.site-footer strong { color: #fff; }
.copy { margin-top: 12px !important; color: #8a93a5; } /* 대비 5.9:1 (AA 통과) */

/* Guestbook */
.flash { padding: 12px 16px; border-radius: 8px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--err-bg); color: var(--err); }
.gb-form { display: grid; gap: 14px; background: var(--bg-alt); padding: 20px; border-radius: var(--radius); margin: 24px 0; }
.gb-form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.gb-form label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.gb-form small { color: var(--muted); font-weight: 400; }
.gb-form input, .gb-form textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; }
.gb-form textarea { resize: vertical; }
.gb-form .btn { justify-self: end; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.count { margin-bottom: 8px; }
.gb-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.gb-item, .gb-empty { padding: 18px 4px; border-bottom: 1px solid var(--line); }
.gb-empty { color: var(--muted); text-align: center; }
.gb-meta { display: flex; justify-content: space-between; gap: 12px; }
.gb-meta time { color: var(--muted); font-size: .88rem; }
.gb-msg { margin: 6px 0 0; white-space: normal; overflow-wrap: anywhere; }
.gb-delete { margin-top: 6px; font-size: .88rem; }
.gb-delete summary { cursor: pointer; color: var(--muted); }
.gb-delete form { display: flex; gap: 8px; margin-top: 8px; }
.gb-delete input { padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.gb-delete button { padding: 6px 12px; border: 0; border-radius: 6px; background: var(--err); color: #fff; cursor: pointer; font: inherit; }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; padding: 6px 10px; text-align: center; border-radius: 6px; text-decoration: none; }
.pager a { color: var(--text); border: 1px solid var(--line); }
.pager .current { background: var(--primary); color: #fff; }

/* Contact */
.map { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map img { display: block; width: 100%; height: auto; }
.contact-info { display: grid; gap: 10px; margin: 20px 0; }
.contact-info div { display: grid; grid-template-columns: 72px 1fr; gap: 12px; }
.contact-info dt { color: var(--muted); font-weight: 600; }
.contact-info dd { margin: 0; }

/* Notices */
.notice-strip { border-bottom: 1px solid var(--line); background: #fff; }
.notice-strip .container { display: flex; align-items: flex-start; gap: 20px; padding: 18px 0; }
.notice-strip .label { color: var(--primary); white-space: nowrap; }
.notice-strip ul { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.notice-strip li { display: flex; justify-content: space-between; gap: 12px; }
.notice-strip li .muted { white-space: nowrap; flex-shrink: 0; }
.notice-strip li a { flex: 1; min-width: 0; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-strip li a:hover { color: var(--primary); }
.notice-strip .more { white-space: nowrap; text-decoration: none; font-size: .92rem; }
.eyebrow a { text-decoration: none; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.title-row h1 { margin: 0; }
.search { display: flex; gap: 8px; margin: 20px 0; }
.search input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.search button { padding: 10px 18px; border: 0; border-radius: 8px; background: var(--text); color: #fff; font: inherit; cursor: pointer; }
.notice-list { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--text); }
.notice-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.notice-list li.pinned { background: var(--bg-alt); }
.notice-list a { color: var(--text); text-decoration: none; display: flex; gap: 8px; align-items: center; min-width: 0; }
.notice-list a:hover .t { color: var(--primary); text-decoration: underline; }
.notice-list .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-list .d { white-space: nowrap; font-size: .9rem; }
.pin { display: inline-block; font-size: .75rem; font-weight: 700; color: #fff; background: var(--primary); border-radius: 4px; padding: 1px 7px; vertical-align: middle; flex-shrink: 0; }
/* Board (공지사항 목록) */
.board-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 20px 0 12px; }
.board-tools .search { margin: 0; }
.cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-tabs a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: .92rem; }
.cat-tabs a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.search select { padding: 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
.board { width: 100%; border-collapse: collapse; border-top: 2px solid var(--text); font-size: .95rem; }
.board th { background: var(--bg-alt); font-weight: 600; padding: 12px 8px; border-bottom: 1px solid #c9ced8; }
.board td { padding: 13px 8px; border-bottom: 1px solid var(--line); text-align: center; color: var(--muted); }
.board td.c-title { text-align: left; color: var(--text); }
.board td.c-title a { color: var(--text); text-decoration: none; }
.board td.c-title a:hover { color: var(--primary); text-decoration: underline; }
.board tr.pinned td { background: #f3f6fb; }
.board tr.pinned td.c-title a { font-weight: 600; }
.board .c-no { width: 64px; } .board .c-cat { width: 84px; } .board .c-author { width: 160px; }
.board .c-date { width: 104px; } .board .c-views { width: 56px; }
.clip { margin-left: 4px; font-size: .9em; }
.board td.c-author, .board td.c-date { white-space: nowrap; }
.pager { min-height: 1px; }

/* Board (공지사항 상세) */
.nv-head { border-top: 2px solid var(--text); border-bottom: 1px solid var(--line); padding: 18px 4px; }
.nv-head h1 { font-size: 1.35rem; margin: 0; }
.nv-head .cat { color: var(--primary); }
.nv-meta { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0; padding: 12px 4px; background: var(--bg-alt); border-bottom: 1px solid var(--line); font-size: .93rem; }
.nv-meta div { display: flex; gap: 10px; }
.nv-meta dt { font-weight: 600; }
.nv-meta dd { margin: 0; color: var(--muted); }
.notice-body { padding: 24px 4px 32px; }
.nv-files { list-style: none; margin: 0 0 24px; padding: 14px 16px; background: var(--bg-alt); border-radius: 8px; display: grid; gap: 6px; }
.files-edit { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: grid; gap: 6px; }
.files-edit legend { font-weight: 600; font-size: .95rem; padding: 0 4px; }
.gb-form select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; }

/* Admin */
.admin-strip { background: #11151f; color: #cfd5e1; font-size: .88rem; }
.admin-strip .container { display: flex; align-items: center; gap: 16px; padding: 6px 0; }
.admin-strip strong { color: #ffd166; }
.admin-strip a { color: #fff; }
.admin-strip form { margin: 0 0 0 auto; }
.admin-strip button { background: none; border: 1px solid #556; color: #cfd5e1; border-radius: 6px; padding: 2px 10px; font: inherit; cursor: pointer; }
.edit-link { font-size: .8rem; font-weight: 600; color: #b26b00; background: #fff4dc; border: 1px solid #f1d39a; border-radius: 6px; padding: 1px 8px; text-decoration: none; vertical-align: middle; letter-spacing: 0; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.admin-tabs a { padding: 6px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .92rem; background: var(--bg-alt); }
.admin-tabs a.on { background: var(--text); color: #fff; }
.admin-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 20px 0; }
.admin-menu a { display: grid; gap: 4px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); background: #fff; }
.admin-menu a:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(3, 68, 128, .1); }
.admin-menu span { color: var(--muted); font-size: .88rem; }
.admin-form { max-width: 960px; }
.admin-form .rows { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 10px; background: #fff; }
.admin-form .rows legend { font-weight: 700; padding: 0 6px; }
.row-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-line > input[type=text] { flex: 1 1 180px; width: auto; }
.row-line .ord { width: 64px; flex: 0 0 64px; }
.row-line .tag-in { flex: 0 1 160px; }
.row-line select { width: auto; }
.card-edit { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.img-field { display: grid; gap: 8px; }
.thumb { width: 120px; height: 90px; object-fit: contain; background: var(--bg-alt); border: 1px solid var(--line); border-radius: 8px; }
.thumb.wide { width: 240px; height: auto; }
.thumb.empty { display: grid; place-items: center; color: var(--muted); font-size: .85rem; }
.img-row { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.img-row-fields { flex: 1; display: grid; gap: 6px; }
.group-edit.new { border-style: dashed; background: #fafcff; }
.form-actions.sticky { position: sticky; bottom: 0; background: var(--bg-alt); padding: 12px 0; margin: 0; }
.about-files { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.about-files li { display: flex; gap: 8px; align-items: center; }

@media (max-width: 700px) {
  .board .c-cat, .board .c-author, .board .c-views { display: none; }
  .board .c-no { width: 48px; } .board .c-date { width: 84px; font-size: .85rem; }
}

.notice-view h1 { font-size: 1.35rem; }
.notice-meta { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.notice-body { padding: 20px 0 32px; overflow-wrap: anywhere; }
.notice-nav { display: grid; gap: 6px; border-top: 1px solid var(--line); padding: 16px 0; margin-bottom: 16px; }
.notice-nav a { color: var(--text); text-decoration: none; }
.admin-bar, .form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 16px; }
.admin-bar form { margin: 0; }
.btn-danger { background: var(--err); }
.btn-danger:hover { background: #8f1c13; }
.gb-form .check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.gb-form .check input { width: auto; }
.inline-form { margin-top: 24px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; }
.site-footer a { color: #aab1c0; }

/* UP 버튼 (inc/footer.php) */
.to-top { position: fixed; bottom: 24px; z-index: 20; display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px 10px 14px;
          border-radius: 999px; background: var(--primary); color: #fff; font-weight: 700; font-size: .9rem; letter-spacing: .06em;
          text-decoration: none; box-shadow: 0 6px 18px rgba(3, 30, 70, .25);
          opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s, background .2s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--primary-dark); }
.to-top svg { width: 16px; height: 16px; }
.to-top-left { left: 20px; }
.to-top-right { right: 20px; }
@media (max-width: 560px) {
  .to-top { width: 48px; height: 48px; padding: 0; flex-direction: column; justify-content: center; gap: 0; font-size: .7rem; bottom: 16px; }
  .to-top svg { width: 15px; height: 15px; }
  .to-top-left { left: 12px; }
  .to-top-right { right: 12px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .to-top { transition: none; } }

@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-img { max-width: 420px; margin-inline: auto; }
  .gallery-toykon { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .header-inner { height: auto; padding: 10px 0 0; flex-direction: column; align-items: stretch; gap: 0; }
  .logo img { height: 30px; }
  /* 메뉴: 한 줄 가로 스크롤. 오른쪽 끝을 흐리게 해서 메뉴가 더 있다는 것을 알린다 */
  .nav { flex-wrap: nowrap; gap: 0; overflow-x: auto; scrollbar-width: none; margin-inline: -8px; padding-right: 28px;
         -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
                 mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex-shrink: 0; white-space: nowrap; padding: 10px 8px; font-size: .95rem; }
  .hero { padding: 48px 0 56px; }
  /* 공지 띠: 첫 줄에 '공지사항 / 전체보기', 아래에 목록 */
  .notice-strip .container { flex-wrap: wrap; gap: 6px 12px; }
  .notice-strip ul { order: 2; flex-basis: 100%; }
  .notice-strip .more { margin-left: auto; padding: 4px 0; }
  .section[id] { scroll-margin-top: 40px; }
  /* 공지사항 목록: 검색창을 한 줄 전체로 */
  .board-tools .search { width: 100%; }
}
