/* ===== 공통 부품 ===== */

/* 아이콘 — Lucide 한 세트. 기본 20px·선 2, 표현형 타일은 포인트 면 위 */
.ico { width: 20px; height: 20px; stroke-width: 2; flex: none; vertical-align: middle; }
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 28px; height: 28px; }
.ico-tile { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: var(--r-16); background: var(--c-milk-2); color: var(--c-berry); flex: none; }
.ico-tile .ico { width: 30px; height: 30px; }
.ico-tile.sm { width: 44px; height: 44px; border-radius: var(--r-lg); box-shadow: none; }
.ico-tile.sm .ico { width: 22px; height: 22px; }
.ico-tile.soft { background: var(--c-milk); color: var(--c-muted); }

/* 헤더 */
.site-header { position: sticky; top: 0; z-index: calc(var(--z-sticky) + 10); background: var(--c-white); border-bottom: 1px solid var(--c-line); }
.site-header .wrap { display: flex; align-items: center; height: var(--header-h); gap: var(--s-6); }
.logo { display: inline-flex; align-items: center; gap: .22em; font-family: var(--f-logo); font-weight: 600; font-size: var(--t-xl); letter-spacing: 0; color: var(--c-logo); white-space: nowrap; }
.logo-symbol { width: auto; height: 1.3em; flex: none; }
.main-nav { display: flex; gap: var(--s-1); }
.main-nav a { position: relative; display: inline-flex; align-items: center; gap: var(--px-6); height: 40px; padding: 0 var(--s-3); border-radius: var(--r-btn); font-size: var(--t-15); font-weight: 700; color: var(--c-plum-2); transition: color var(--m-fast), background var(--m-fast); }
.main-nav a .ico { width: 18px; height: 18px; color: var(--c-muted); }
.main-nav a .nav-ico { flex: none; width: 20px; height: 20px; }
.main-nav a:hover { color: var(--c-ink); background: var(--c-milk); }
.main-nav a[aria-current="page"] { color: var(--c-berry); }
.main-nav a[aria-current="page"] .ico { color: var(--c-berry); }
.main-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -12px; height: 2px; background: var(--c-pink); }
/* 헤더 검색 — 알약 입력칸 + 둥근 검색 버튼 */
.header-search { display: flex; align-items: center; gap: var(--s-2); width: 260px; height: 40px; padding: 0 var(--px-5) 0 var(--px-14); border: 1px solid var(--c-line-2); border-radius: var(--r-pill); background: var(--c-white); }
.header-search:focus-within { border-color: var(--c-accent); }
.header-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: var(--t-sm); }
.header-search input::placeholder { color: var(--c-placeholder); }
.header-search button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--c-accent); color: var(--c-white); cursor: pointer; }
.header-search button .ico { width: 16px; height: 16px; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
.icon-btn { position: relative; width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; border: 0; background: var(--a-gray-10); color: var(--c-muted); cursor: pointer; transition: transform var(--m-fast) var(--ease-press), background var(--m-fast); }
.icon-btn:hover { background: var(--a-gray-20); color: var(--c-ink); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--c-pink); border: 2px solid var(--c-white); }
.icon-btn.plain { background: transparent; }
/* 헤더 프로필 메뉴 */
.profile-menu { position: relative; }
.profile-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; border-radius: 50%; cursor: pointer; }
.profile-btn .avatar.sm { width: 40px; height: 40px; border-width: 2px; font-size: var(--t-md); transition: transform var(--m-fast) var(--ease), box-shadow var(--m-fast) var(--ease); }
.profile-btn:hover .avatar, .profile-btn[aria-expanded="true"] .avatar { box-shadow: 0 0 0 3px var(--c-milk); }
.profile-btn.is-current .avatar { background: var(--c-pink); }
.dropdown-panel, .profile-panel { position: absolute; right: 0; top: calc(100% + 10px); background: var(--c-white); border: var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-3); padding: var(--s-2); z-index: calc(var(--z-modal) + 1); transform-origin: top right; animation: popIn var(--m-fast) var(--ease); }
.profile-panel { width: 240px; }
/* 공용 더보기 메뉴(menu 컨트롤러): 버튼을 .dropdown-menu로 감싸고 패널에 .dropdown-panel, 항목에 .dropdown-item */
.dropdown-menu { position: relative; display: inline-flex; }
.dropdown-panel { width: max-content; min-width: 168px; max-width: calc(100vw - var(--s-8)); }
.dropdown-panel form { margin: 0; padding: 0; border: 0; }
.dropdown-item { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 44px; padding: 0 var(--s-3); border-radius: var(--r-sm); font-weight: 700; color: var(--c-ink); background: none; border: 0; cursor: pointer; font-size: var(--t-md); text-align: left; white-space: nowrap; }
.dropdown-item:hover { background: var(--c-milk); }

@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.profile-links { list-style: none; margin: 0; padding: 0; }
.profile-panel-head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border-bottom: var(--border-soft); margin-bottom: var(--s-1); }
.profile-links a { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 44px; padding: 0 var(--s-3); border-radius: var(--r-sm); font-weight: 700; color: var(--c-ink); background: none; border: 0; cursor: pointer; font-size: var(--t-md); }
.profile-logout { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 44px; padding: 0 var(--s-3); border-radius: var(--r-sm); font-weight: 700; color: var(--c-muted); background: none; border: 0; cursor: pointer; font-size: var(--t-md); }
.profile-links a:hover, .profile-logout:hover { background: var(--c-milk); }
.profile-panel form { border-top: var(--border-soft); margin-top: var(--s-1); padding-top: var(--s-1); }
.icon-btn.plain:hover { box-shadow: none; background: var(--c-milk); transform: none; }
.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--c-milk-2); color: var(--c-berry); font-weight: 700; border: 0; flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: var(--t-sm); border-width: 1.5px; }
.avatar.xl { width: 96px; height: 96px; font-size: var(--t-3xl); }
.avatar.has-img { overflow: hidden; background: var(--c-white); }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.anon { background: var(--c-plum); color: var(--c-pink); }

/* 서브 앱바 (모바일 상세 화면) */
.subbar { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-4) 0; }
.subbar h1 { font-family: var(--f-display); font-weight: 700; font-size: var(--t-3xl); }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 48px; padding: 0 var(--px-22); border-radius: var(--r-btn); font-weight: 600; font-size: var(--t-md); border: 0; cursor: pointer; background: var(--c-milk); color: var(--c-ink); text-align: center; transition: transform var(--m-base) var(--ease-press), background var(--m-fast); white-space: nowrap; }
.btn:hover { background: var(--c-hover-gray); }
.btn:active { transform: scale(.96); transition-duration: var(--m-fast); }
.btn-primary { background: var(--c-accent); color: var(--c-white); }
.btn-primary:hover { background: var(--c-accent-2); }
.btn-outline { background: var(--c-white); box-shadow: inset 0 0 0 1px var(--c-line-2); }
.btn-outline:hover { background: var(--c-surface-2); }
.btn-dark { background: var(--c-plum); color: var(--c-white); }
.btn-dark:hover { background: var(--c-plum-2); }
.btn-danger { background: var(--c-danger); color: var(--c-white); }
.btn-danger:hover { background: var(--c-danger-2); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--c-milk); box-shadow: none; transform: none; }
.btn-sm { min-height: 40px; padding: 0 var(--px-14); font-size: var(--t-sm); border-radius: var(--r-btn); }
.btn-xs { min-height: 32px; padding: 0 var(--px-10); font-size: var(--t-xs); border-radius: var(--r-sm); }
.btn-pill { border-radius: var(--r-pill); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-group { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.link { color: var(--c-berry); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.alert .link, .notice-box .link, .soft-box .link { color: inherit; }
/* 밑줄 없는 링크: 색과 굵기로 링크임을 보이고 마우스를 올리면 밑줄 */
.link-soft { color: var(--c-berry); font-weight: 600; text-decoration: none; }
.link-soft:hover, .link-soft:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.notice-box .link-soft, .alert .link-soft, .soft-box .link-soft { color: var(--c-plum); font-weight: 700; } /* 색 상자 위에서는 핑크 글자 대비가 모자라 상자 글자색 + 밑줄로 */
.more-link { display: inline-flex; align-items: center; gap: var(--px-2); font-weight: 600; font-size: var(--t-sm); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); color: var(--c-muted); transition: background var(--m-fast), color var(--m-fast); }
.more-link:hover { background: var(--c-milk); color: var(--c-ink); }

/* 폼 */
.field { display: flex; flex-direction: column; gap: var(--px-6); }
.field + .field { margin-top: var(--s-5); }
.label { font-weight: 600; font-size: var(--t-sm); color: var(--c-muted); }
.label .req { color: var(--c-berry); margin-left: var(--px-2); }
.hint { font-size: var(--t-xs); color: var(--c-muted); }
.input, .select, .textarea { width: 100%; padding: var(--s-3) var(--px-14); border: var(--border); border-radius: var(--r-sm); background: var(--c-white); color: var(--c-ink); appearance: none; -webkit-appearance: none; transition: border-color var(--m-fast), box-shadow var(--m-fast); }
.input, .select { min-height: 48px; }
.textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--c-placeholder); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-milk-2); }
.input[disabled], .select[disabled], .textarea[disabled] { background: var(--c-milk); color: var(--c-muted); cursor: not-allowed; }
.select-wrap { position: relative; }
.select-wrap .ico { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--c-plum); }
.select { padding-right: var(--px-44); cursor: pointer; }
.input-wrap { position: relative; display: flex; }
.input-wrap .input { padding-right: var(--px-52); }
/* 입력칸 안 아이콘 버튼(비밀번호 눈 등): 동그란 배경 없이 아이콘만, 입력칸 높이와 상관없이 세로 가운데 */
.input-wrap .icon-btn { position: absolute; right: 2px; top: 0; bottom: 0; margin: auto 0; border: 0; width: 44px; height: 44px; background: transparent; border-radius: var(--r-sm); }
.input-wrap .icon-btn:hover { box-shadow: none; transform: none; background: transparent; color: var(--c-ink); }
.icon-btn > span[data-password-target] { display: inline-flex; align-items: center; justify-content: center; }
.icon-btn > span[data-password-target][hidden] { display: none; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--c-danger); } /* 입력 오류 테두리 — 위의 :focus 규칙보다 뒤에 있어 포커스 중에도 빨강 유지 */
.field-error { display: flex; align-items: center; gap: var(--s-1); color: var(--c-danger); font-size: var(--t-sm); font-weight: 700; }
.field-error .ico { width: 16px; height: 16px; }
.counter { font-size: var(--t-xs); color: var(--c-muted); text-align: right; }

/* 체크박스·라디오·토글 — 기본 모양 대신 직접 그림, 누를 영역 44px */
.check, .radio { display: flex; align-items: center; gap: var(--px-10); min-height: 44px; cursor: pointer; }
.check input, .radio input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; margin: 0; border: 2px solid var(--c-toggle-off); background: var(--c-white); display: grid; place-items: center; flex: none; cursor: pointer; transition: background var(--m-fast); }
.check input { border-radius: var(--r-sm); }
.radio input { border-radius: 50%; }
.check input:checked, .radio input:checked { background: var(--c-accent); border-color: var(--c-accent); }
.check input:checked::after { content: ""; width: 12px; height: 7px; border-left: 2.5px solid var(--c-white); border-bottom: 2.5px solid var(--c-white); transform: translateY(-2px) rotate(-45deg); }
.radio input:checked::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c-white); }
.check input:hover, .radio input:hover { border-color: var(--c-accent); }
.check input:focus-visible, .radio input:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.check input:disabled, .radio input:disabled { opacity: .4; cursor: not-allowed; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 56px; cursor: pointer; }
.toggle input { appearance: none; -webkit-appearance: none; width: 52px; height: 30px; border-radius: var(--r-pill); border: 0; background: var(--c-toggle-off); position: relative; margin: 0; flex: none; cursor: pointer; transition: background var(--m-base) var(--ease); }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--c-white); box-shadow: 0 1px 3px var(--a-navy-20); transition: transform var(--m-base) var(--ease-press); }
.toggle input:checked { background: var(--c-accent); }
.toggle input:checked::after { transform: translateX(22px); }
.option-cards { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.option-card { position: relative; }
.option-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.option-card span { display: flex; align-items: center; justify-content: center; gap: var(--px-6); min-height: 48px; padding: var(--s-2) var(--s-3); border: var(--border); border-radius: var(--r-sm); background: var(--c-white); font-weight: 700; text-align: center; transition: background var(--m-fast), box-shadow var(--m-fast); }
.option-card input:checked + span { background: var(--c-milk-2); border-color: var(--c-accent); color: var(--c-berry); }
.option-card input:focus-visible + span { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.file-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2); min-height: 140px; padding: var(--s-6); border: 1px dashed var(--c-line); border-radius: var(--r-md); background: var(--c-milk); text-align: center; cursor: pointer; position: relative; }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop:focus-within { border-color: var(--c-accent); }

/* 칩 */
.chips { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: var(--px-6); scrollbar-width: none; }
.chip { display: inline-flex; align-items: center; gap: var(--px-6); min-height: 36px; padding: 0 var(--s-3); border-radius: var(--r-sm); border: 0; background: var(--c-chip); color: var(--c-chip-ink); font-weight: 500; font-size: var(--t-sm); cursor: pointer; white-space: nowrap; transition: transform var(--m-base) var(--ease-press), background var(--m-fast), color var(--m-fast); }
.chip:hover { background: var(--c-chip-hover); color: var(--c-ink); }
.chip:active { transform: scale(.95); transition-duration: var(--m-fast); }
.chip[aria-pressed="true"], .chip[aria-current="page"], .chip.is-active { background: var(--c-plum-2); color: var(--c-white); font-weight: 700; }
.chip .x { margin-left: var(--px-2); }

/* 탭 */
/* 탭 — 밑줄형(선택은 진한 굵은 글자 + 2px 밑줄) */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--c-line-2); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--px-6); min-height: 44px; padding: 0 var(--px-14); border: 0; border-radius: 0; background: transparent; font-size: var(--t-md); font-weight: 500; color: var(--c-muted); cursor: pointer; white-space: nowrap; transition: color var(--m-fast); }
.tab:hover { color: var(--c-ink); }
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--c-ink); font-weight: 700; }
.tab[aria-selected="true"]::after, .tab[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--c-ink); }
.tab .count { font-size: var(--t-xs); }
.tabs.full { display: flex; width: 100%; }
.tabs.full .tab { flex: 1; padding: 0 var(--s-2); }
.underline-tabs { display: flex; gap: var(--s-6); border-bottom: var(--border-soft); overflow-x: auto; }
.underline-tabs a { padding: var(--s-3) var(--px-2); font-weight: 700; color: var(--c-muted); border-bottom: 3px solid transparent; white-space: nowrap; border-bottom-width: 2px; margin-bottom: calc(-1 * var(--px-1)); }
.underline-tabs a[aria-current="page"] { color: var(--c-ink); border-bottom-color: var(--c-ink); }

/* 배지 */
.badge { display: inline-flex; align-items: center; gap: var(--s-1); height: 26px; padding: 0 var(--px-10); border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 600; background: var(--c-milk); color: var(--c-muted); white-space: nowrap; }
.badge .ico { width: 14px; height: 14px; }
.badge-anon { background: var(--c-milk-2); color: var(--c-berry); }
.badge-dark { background: var(--c-plum); color: var(--c-white); }
.badge-curator { background: var(--c-chip); color: var(--c-chip-ink); } /* 운영진 큐레이터 계정 표시 */
.badge-example { background: var(--c-white); border: 1px solid var(--c-line-2); color: var(--c-muted); } /* 오픈 준비 중 운영진이 올린 예시 콘텐츠 */
.example-note { margin: var(--s-3) 0 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--c-milk); color: var(--c-muted); font-size: var(--t-sm); line-height: 1.6; }
.res-thumb .badge-example { left: auto; right: 10px; } /* 자료 카드: 가격 뱃지(왼쪽)와 겹치지 않게 오른쪽 */
.badge-line { background: var(--c-white); border: 1px solid var(--c-line); }
.badge-paid { background: var(--c-plum); color: var(--c-white); }
.badge-free { background: var(--c-chip); color: var(--c-chip-ink); }
.badge-success { background: var(--c-success-bg); color: var(--c-success); }
.badge-warn { background: var(--c-warn-bg); color: var(--c-warn); }
.badge-danger { background: var(--c-danger-bg); color: var(--c-danger); }
.badge-info { background: var(--c-info-bg); color: var(--c-muted); }
.badge-test { background: var(--c-warn-bg); color: var(--c-warn); border: 1.5px dashed var(--c-warn); }

/* 카드 */
.card { background: var(--c-white); border: var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-2); }
.card-pad { padding: var(--s-6); }
.card-link { display: block; transition: transform var(--m-base) var(--ease-press), box-shadow var(--m-base) var(--ease), background var(--m-fast); }
.card-link:hover { transform: none; box-shadow: var(--shadow-3); border-color: var(--c-line-2); }
.panel { background: var(--c-white); border: var(--border); border-radius: var(--r-md); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: var(--border); }
.panel-title { font-weight: 700; font-size: var(--t-lg); letter-spacing: -.02em; }
.panel-body { padding: var(--s-5); }
.soft-box { background: var(--c-milk); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--s-5); }
.notice-box { display: flex; gap: var(--s-3); align-items: flex-start; background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--s-4); font-size: var(--t-sm); }

/* 게시글 카드 */
.post-card { display: flex; flex-direction: column; gap: var(--px-10); padding: var(--s-6); background: var(--c-white); border: var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-2); transition: transform var(--m-base) var(--ease-press), box-shadow var(--m-base) var(--ease), background var(--m-fast); }
.post-card:hover { transform: none; box-shadow: var(--shadow-3); border-color: var(--c-line-2); }
.post-card .title { font-size: var(--t-md); font-weight: 700; line-height: 1.45; letter-spacing: -.02em; }
.post-card .excerpt { color: var(--c-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-row { display: flex; flex-direction: column; gap: var(--px-6); padding: var(--s-5) var(--s-5); border-bottom: var(--border-soft); transition: background var(--m-fast); }
.post-row:hover { background: var(--c-surface-2); }
.post-row .title { font-weight: 700; font-size: var(--t-md); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); font-size: var(--t-sm); color: var(--c-muted); }
.meta-i { display: inline-flex; align-items: center; gap: var(--s-1); font-weight: 700; font-variant-numeric: tabular-nums; }
.meta-i .ico { width: 16px; height: 16px; }
.board-tag { display: inline-block; padding: var(--px-2) var(--s-2); border-radius: var(--r-pill); background: var(--c-milk-2); color: var(--c-berry); font-weight: 600; font-size: var(--t-xs); }
.board-tag.anon { background: var(--c-plum); color: var(--c-white); }

/* 사진·자료 카드 */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-6); }
.res-card { display: flex; flex-direction: column; background: var(--c-white); border: var(--border); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-2); transition: transform var(--m-base) var(--ease-press), box-shadow var(--m-base) var(--ease), background var(--m-fast); }
.res-card:hover { transform: none; box-shadow: var(--shadow-3); border-color: var(--c-line-2); }
.res-thumb { position: relative; aspect-ratio: 1 / 1; background: var(--c-milk); border-bottom: var(--border); overflow: hidden; } /* 자료 카드 틀: 정사각형·배경 #f8f9fa(--c-milk) */
.res-thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform var(--m-slow) var(--ease); } /* 포스터·가로형: 자르지 않고 전체 */
.res-thumb img.thumb-cover-top { object-fit: cover; object-position: top; } /* 세로 문서: 위쪽 기준으로 틀을 꽉 채움 */

.res-thumb .badge { position: absolute; top: 10px; left: 10px; }
.res-body { display: flex; flex-direction: column; gap: var(--px-6); padding: var(--px-14) var(--s-4) var(--s-4); flex: 1; }
.res-title { font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.photo-card { display: block; background: var(--c-white); border: var(--border); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-2); transition: transform var(--m-base) var(--ease-press), box-shadow var(--m-base) var(--ease), background var(--m-fast); }
.photo-card:hover { transform: none; box-shadow: var(--shadow-3); border-color: var(--c-line-2); }
.photo-card .thumb { aspect-ratio: 1 / 1; overflow: hidden; border-bottom: var(--border); background: var(--c-milk); }
.photo-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--m-slow) var(--ease); }

.photo-card .body { padding: var(--px-14) var(--s-4) var(--s-4); }
.skeleton-thumb { width: 100%; height: 100%; display: grid; place-items: center; color: var(--c-muted); font-size: var(--t-sm); }

/* 섹션 머리 */
.section { padding-top: var(--s-10); }
.section-head { display: flex; align-items: center; gap: var(--s-4); margin-bottom: var(--s-6); flex-wrap: wrap; }
.section-title { font-family: var(--f-display); font-weight: 700; font-size: var(--t-lg); line-height: 1.3; letter-spacing: -.03em; }
.section-head .more-link { margin-left: auto; }
/* 페이지 머리 — 짙은 회색 띠 배너. .wrap 안에 있어도 ::before 로 화면 끝까지 칠한다(body overflow-x: clip) */
.page-head { position: relative; isolation: isolate; padding: var(--px-26) 0; margin-bottom: var(--s-8); color: var(--c-white); }
/* 머리 띠 배경 = 연한 글래스모피즘(시안 패턴 17 = 패턴 6을 바탕색과 반씩 섞음): 유리 카드와 핑크·자두 빛 방울. 추상 무늬라 띠 크기에 맞춰 채운다.
   옅은 덮개로 흰 글자·테두리 버튼 대비를 지키고, 좁은 화면은 글자와 겹치므로 덮개를 더 진하게 */
.page-head::before { content: ""; position: absolute; z-index: var(--z-behind); top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%); background: linear-gradient(90deg, var(--a-dark-62), var(--a-dark-42)), url("/assets/heads/pattern-glass-soft-d3ce2e56.webp") center / cover no-repeat, var(--c-dark); }

@media (max-width: 720px) { .page-head::before { background: linear-gradient(var(--a-dark-74), var(--a-dark-74)), url("/assets/heads/pattern-glass-soft-d3ce2e56.webp") 70% center / cover no-repeat, var(--c-dark); } }
.page-head .page-title, .page-head h1 { color: var(--c-white); }
.page-head .page-desc, .page-head .muted, .page-head p { color: var(--c-banner-ink); }
.page-head .link, .page-head a:not(.btn) { color: var(--c-white); }
/* 배너 안에 놓인 흰 면(검색칸·카드)은 배너 글자색을 물려받지 않는다 */
.page-head :is(.c-search-box, .card, .panel, .notice-box) :is(a, .link) { color: inherit; }
.page-head :is(.c-search-box, .card, .panel, .notice-box) { color: var(--c-ink); }
.page-head .btn-outline { background: transparent; color: var(--c-white); box-shadow: inset 0 0 0 1px var(--a-white-50); }
.page-head .btn-outline:hover { background: var(--a-white-10); }
.page-title { font-family: var(--f-display); font-weight: 700; font-size: var(--t-2xl); line-height: 1.3; letter-spacing: -.02em; }
.page-desc { margin-top: var(--s-1); font-size: var(--t-15); color: var(--c-muted); }
.band { background: var(--c-white); }

/* 목록·표 */
.list { list-style: none; }
.list > li + li { border-top: var(--border-soft); }
.list-item { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); }
.list-item.link { color: inherit; font-weight: inherit; text-decoration: none; transition: background var(--m-fast); }
.list-item.link:hover { background: var(--c-surface-2); }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: var(--px-10) var(--s-4); }
.dl dt { color: var(--c-muted); font-size: var(--t-sm); }
.dl dd { margin: 0; font-weight: 700; }
.table-wrap { overflow-x: auto; border: var(--border); border-radius: var(--r-md); background: var(--c-white); }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table th { text-align: left; padding: var(--s-3) var(--px-14); background: var(--c-surface-2); border-bottom: var(--border); font-weight: 600; color: var(--c-muted); white-space: nowrap; }
.table td { padding: var(--s-3) var(--px-14); border-bottom: var(--border-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--c-surface-2); }
.table .actions { display: flex; gap: var(--px-6); justify-content: flex-end; white-space: nowrap; }

/* 페이지 이동·더보기 */
.load-more { display: flex; justify-content: center; padding: var(--s-6) 0; }
.pagination { display: flex; justify-content: center; gap: var(--px-6); padding: var(--s-6) 0; flex-wrap: wrap; }
.pagination a { display: inline-grid; place-items: center; min-width: 44px; height: auto; min-height: 44px; padding: 0 var(--px-10); border-radius: var(--r-sm); border: 0; background: transparent; color: var(--c-muted); font-weight: 600; font-size: var(--t-sm); }
.pagination span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 var(--px-10); border-radius: var(--r-sm); border: 0; background: transparent; color: var(--c-muted); font-weight: 600; font-size: var(--t-sm); }
.pagination a:hover { background: var(--c-milk); }
.pagination [aria-current="page"] { background: var(--c-plum-2); color: var(--c-white); }
.pagination .disabled { opacity: .35; }

/* ===== 상태 화면 ===== */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-3); padding: var(--s-12) var(--s-6); background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--r-md); }
.empty h2, .empty h3 { font-family: var(--f-display); font-weight: 700; font-size: var(--t-lg); }
.empty p { color: var(--c-muted); max-width: 32em; }
.empty .btn { margin-top: var(--s-2); }
.error-box { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-4) var(--s-5); background: var(--c-danger-bg); border: 0; border-radius: var(--r-md); color: var(--c-danger-ink); }
.error-box .ico { color: var(--c-danger); margin-top: var(--px-2); }
.alert { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-radius: var(--r-md); border: 0; background: var(--c-milk); font-weight: 600; }
.alert-success { background: var(--c-success-bg); color: var(--c-success-ink); }
.alert-warn { background: var(--c-warn-bg); color: var(--c-warn-ink); }
.alert-danger { background: var(--c-danger-bg); color: var(--c-danger-ink); }
.status-page { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--s-4); padding: var(--s-16) var(--gutter); }
.status-page .ico-tile { width: 88px; height: 88px; border-radius: var(--r-26); }
.status-page .ico-tile .ico { width: 44px; height: 44px; }
.status-page h1 { font-family: var(--f-display); font-weight: 700; font-size: var(--t-3xl); }
.status-page p { color: var(--c-muted); max-width: 30em; }
.skel { background: linear-gradient(90deg, var(--c-milk) 25%, var(--c-milk-2) 37%, var(--c-milk) 63%); background-size: 400% 100%; animation: skel 1.4s ease infinite; border-radius: var(--r-sm); }
.skel-line { height: 14px; margin: var(--s-2) 0; }
.skel-card { height: 160px; border-radius: var(--r-md); }

@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* 토스트 (성공 알림) */
.toasts { position: fixed; z-index: var(--z-toast); top: calc(var(--header-h) + 12px); right: 16px; display: flex; flex-direction: column; gap: var(--s-2); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--px-10); min-width: 240px; max-width: 360px; padding: var(--px-14) var(--px-18); background: var(--a-charcoal-96); color: var(--c-white); border-radius: var(--r-md); box-shadow: var(--shadow-3); font-weight: 600; animation: toastIn var(--m-base) var(--ease-press); }
.toast.is-leaving { animation: toastOut var(--m-base) var(--ease) forwards; }
.toast-success .ico { color: var(--c-success-soft); }
.toast-alert .ico { color: var(--c-alert-soft); }
/* 여러 줄 안내 토스트(가입 입력 오류) — 제목 + 문장 목록 + 닫기 */
.toast-list { align-items: flex-start; max-width: 420px; font-weight: 500; }
.toast-list .toast-body { flex: 1; min-width: 0; font-size: var(--t-sm); line-height: 1.6; }
.toast-list .toast-title { margin: 0; font-weight: 700; }
.toast-list ul { margin: var(--s-1) 0 0; padding-left: 1.1em; }
.toast-close { flex: none; display: inline-flex; padding: var(--s-1); border: 0; background: none; color: inherit; cursor: pointer; border-radius: var(--r-sm); }
.toast-close:hover { background: var(--a-white-12); }
.toast-close:focus-visible { outline: 2px solid var(--c-white); outline-offset: 2px; }

@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

/* 모달 */
.modal { border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: 0; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); color: var(--c-ink); }
.modal::backdrop { background: var(--a-deep-50); }
.modal[open] { animation: modalIn var(--m-base) var(--ease); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-6) var(--s-6) var(--s-2); }
.modal-title { font-family: var(--f-display); font-weight: 700; font-size: var(--t-xl); }
.modal-body { padding: var(--s-6); overflow-y: auto; }
.modal-foot { display: flex; gap: var(--s-2); justify-content: flex-end; padding: var(--s-4) var(--s-6) var(--s-6); flex-wrap: wrap; }
.sheet-page { max-width: 560px; margin: var(--s-10) auto; }

@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

/* 마퀴 띠 */
.marquee { background: var(--c-plum); color: var(--c-white); overflow: hidden; }
.marquee-track { display: flex; width: max-content; animation: slide 38s linear infinite; }
.marquee-group { display: flex; align-items: center; gap: var(--px-28); padding: var(--s-4); font-family: var(--f-display); font-weight: 700; font-size: var(--t-20); letter-spacing: -.02em; white-space: nowrap; }
.marquee-group svg { color: var(--c-pink); width: 18px; height: 18px; }

@keyframes slide { to { transform: translateX(-50%); } }

/* 푸터 */
/* 본문 끝 여백은 main이 한 번만 준다. 딸기우유 띠로 끝나는 화면(로그인·가입 등)은 푸터와 바로 이어지게 0 */
#main { padding-bottom: var(--s-12); }
#main:has(> :last-child:is(.auth-page)) { padding-bottom: 0; }
.site-footer { background: var(--c-white); border-top: 1px solid var(--c-line); color: var(--c-muted); padding: var(--s-10) 0; font-size: var(--t-sm); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: var(--s-8); flex-wrap: wrap; align-items: flex-end; }
.site-footer .logo { font-size: var(--t-26); display: flex; margin-bottom: var(--s-2); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--px-22); font-weight: 600; }
.footer-links a:hover { color: var(--c-ink); }
/* 공식 SNS 채널 아이콘(푸터): 44px 터치 영역, 글자색을 따르는 단색 아이콘 */
.footer-social { display: flex; flex-wrap: wrap; gap: var(--s-1); margin-top: var(--s-3); margin-left: calc(var(--s-3) * -1); }
.footer-social-link { display: inline-grid; place-items: center; width: var(--px-44); height: var(--px-44); border-radius: var(--r-pill); color: var(--c-muted); }
.footer-social-link:hover { color: var(--c-ink); background: var(--c-milk); }
.footer-social-link:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.footer-social-link .ico-social { width: 22px; height: 22px; }

/* 모바일 하단 4탭 + 글쓰기 버튼 */
.tabbar { display: none; }
.fab { position: fixed; right: 28px; bottom: 28px; z-index: calc(var(--z-fixed) + 1); display: inline-flex; align-items: center; gap: var(--s-2); height: 48px; padding: 0 var(--px-22); border-radius: var(--r-pill); background: var(--c-accent); color: var(--c-white); font-weight: 700; box-shadow: 0 6px 18px var(--a-accent-32); transition: transform var(--m-base) var(--ease-press), background var(--m-fast); }
.fab:hover { background: var(--c-accent-2); }
.fab .ico { width: 20px; height: 20px; }
/* 721px 이상: 우하단 글쓰기(48+28)·챗봇(60+88)이 맨 아래 사업자 정보를 덮지 않게 푸터 아래를 비운다 */
@media (min-width: 721px) { .site-footer { padding-bottom: calc(var(--px-120) + var(--px-44)); } }

/* 스크롤 등장 */

/* 반응형 */
/* 메뉴가 5개(홈·커뮤니티·자료실·블로그·소개)가 되어, 좁은 PC 폭(1025~1120px)에서는 검색칸과 여백을 줄여 한 줄에 맞춘다 */
@media (min-width: 1025px) and (max-width: 1120px) {
  .site-header .wrap { gap: var(--s-4); }
  .main-nav a { padding: 0 var(--px-9); }
  .main-nav a[aria-current="page"]::after { left: 9px; right: 9px; }
  .header-search { width: 190px; }
}

@media (max-width: 1024px) {
  .main-nav { display: none; }
  .header-search { display: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .site-header .wrap { gap: var(--s-3); }
  .header-actions .header-login, .header-actions .header-signup, .header-actions .profile-menu { display: none; } /* 하단 탭 My Sundae가 입구라 아바타·로그인·회원가입은 숨김 */
  .header-actions .icon-btn { width: 44px; height: 44px; }
  .header-actions .icon-btn .dot { top: 10px; right: 11px; }
  .logo { font-size: var(--t-24); }
  .site-footer .logo { font-size: var(--t-30); }
  .site-header .logo { font-size: var(--t-21); min-height: 44px; }
  .header-actions { gap: var(--px-6); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { gap: var(--s-3); }
  .section-title { font-size: var(--t-lg); }
  .page-head { padding: var(--s-5) 0; margin-bottom: var(--s-5); }
  .page-title { font-size: var(--t-xl); }
  .card-pad, .panel-body { padding: var(--s-4); }
  .post-card { padding: var(--s-4); box-shadow: var(--shadow-2); }
  .res-card, .photo-card { box-shadow: var(--shadow-2); }
  .res-body, .photo-card .body { padding: var(--px-10) var(--s-3) var(--s-3); }
  .dl { grid-template-columns: 1fr; gap: var(--px-2); }
  .dl dd { margin-bottom: var(--px-10); }
  .tab { padding: 0 var(--px-14); }
  .marquee-group { font-size: var(--t-19); padding: var(--px-10); gap: var(--s-5); }
  .toasts { left: 16px; right: 16px; }
  .toast { max-width: none; }
  .modal { width: calc(100vw - 16px); }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-fixed); background: var(--c-white); border-top: 1px solid var(--c-line-2); padding: var(--s-1) var(--s-1) calc(var(--s-1) + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: var(--px-2); padding: var(--px-6) 0; font-size: var(--t-xs); font-weight: 600; color: var(--c-muted); border-radius: var(--r-md); transition: transform var(--m-base) var(--ease-press), color var(--m-fast); }
.tabbar a:active { transform: scale(.92); }
  .tabbar a[aria-current="page"] { color: var(--c-berry); font-weight: 700; }
  .tabbar .ico { width: 22px; height: 22px; }
  /* 아이콘이 늘 컬러라 선택 안 된 탭은 살짝 흐리게, 지금 탭만 또렷하게 */
  .tabbar .nav-ico { width: 22px; height: 22px; opacity: .55; transition: opacity var(--m-fast); }
  .tabbar a[aria-current="page"] .nav-ico { opacity: 1; }
  .fab { right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); width: 56px; height: 56px; padding: 0; justify-content: center; }
  .fab .fab-text { display: none; }
  .fab:active { transform: scale(.92); }
  .fab .ico { width: 26px; height: 26px; }
  body.has-tabbar { padding-bottom: 0; }
  /* 맨 아래 스크롤 시 사업자 정보가 탭바(80)·글쓰기(56)·챗봇(56+간격)에 가리지 않게: 약 220px + 안전 영역 */
  .site-footer { padding-bottom: calc(var(--px-120) + var(--px-100) + env(safe-area-inset-bottom)); }
}

/* 푸터 사업자 정보 — 항목 사이 세로줄, 좁으면 항목 단위로 줄바꿈 */
.footer-biz { flex-basis: 100%; margin: 0; padding-top: var(--s-4); border-top: var(--border); font-size: var(--t-xs); line-height: 1.7; color: var(--c-muted); }
.footer-biz span { display: inline-block; }
.footer-biz span + span::before { content: "|"; margin: 0 var(--s-2); opacity: .5; }

@media (max-width: 720px) {
  .footer-biz span { display: block; }
  .footer-biz span + span::before { content: none; }
}

/* 누름 모션 — 카드·목록을 누르면 살짝 작아졌다가 튕기며 돌아온다(토스처럼 손끝 반응) */
.card-link:active, .post-card:active, .res-card:active, .photo-card:active, .c-row:active, .home-banner:active, .icon-btn:active { transform: scale(.98); transition-duration: var(--m-fast); }

/* 헤더 검색 아이콘은 PC 검색칸이 숨는 폭에서만 */
.header-search-icon { display: none; }

@media (max-width: 1024px) { .header-search-icon { display: inline-grid; } }

/* 나눔 단계 안내 페이지 */
.levels-faq dt { margin: 0; }
.levels-faq dd { margin: var(--s-1) 0 var(--s-4); } /* 브라우저 기본 dd 왼쪽 여백(40px)을 없앤다 */
.levels-faq dd:last-child { margin-bottom: 0; }
/* 선데 4단계 */
.levels-sundaes { list-style: none; margin: 0 0 var(--s-6); padding: var(--s-4) 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-3); }
.levels-sundae { display: flex; flex-direction: column; align-items: center; gap: var(--px-6); text-align: center; }
.levels-sundae .sundae-art { width: 100%; height: auto; max-width: 120px; } /* 소개 페이지와 같은 크기·선명도 */
.levels-sundae-name { font-weight: 700; font-size: var(--t-sm); }
.levels-me-body { display: flex; align-items: center; gap: var(--s-4); }
.levels-me-body .sundae-art { flex: none; }
.table .sundae-art { width: 32px; height: 32px; flex: none; }

@media (max-width: 720px) {
    .levels-sundaes { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-4) var(--s-2); }
  .levels-sundae { flex: 0 0 calc(33.333% - var(--s-2)); }
  .levels-sundae .sundae-art { max-width: 96px; }
  .levels-me-body .sundae-art { width: 96px; height: auto; }
}

/* 나눔 단계 뱃지(작은 선데 + 이름): 옅은 배경에 묻히지 않게 흰 바탕·테두리 */
.level-badge { background: var(--c-white); border: 1px solid var(--c-line-2); color: var(--c-ink); text-decoration: none; padding: 0 var(--px-10) 0 var(--px-6); gap: var(--s-1); min-height: 30px; height: auto; }
.level-badge:hover { border-color: var(--c-accent); }
/* 요소끼리 달라붙지 않게 세로 여백을 확보 */
.rd-author .grow { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.rd-author .grow > p { margin: 0; }
.rd-author .grow > p.row { flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.ms-level { margin-top: var(--s-4); }
.ms-level-head { display: flex; align-items: center; gap: var(--s-3); }
.ms-level-head .sundae-art { flex: none; }
.ms-level-text { min-width: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.ms-level-text > p { margin: 0; }

/* ==== 관리자 CSS(40-admin·41-admin-pages)에서 옮긴 공개 화면 공용 규칙 ====
   로그인·가입 카드, 뒤로가기 링크, 표(수준·개인정보), 페이지 번호 비활성, 버튼 줄 안의 폼, 정의 목록, 비활성 선택 카드.
   관리자 전용 CSS는 관리자 화면만 싣도록 분리했다(AssetLoadingHelper). 같은 선택자가 20번 위쪽에도 있어 순서는 그대로 뒤에 둔다 */
.back-link { display: inline-flex; align-items: center; gap: var(--s-1); font-size: var(--t-sm); font-weight: 700; color: var(--c-muted); margin-bottom: var(--s-2); }
.auth-card { width: min(440px, 100%); background: var(--c-white); border: var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-3); padding: var(--s-8); }
.pagination span.disabled { min-height: 44px; min-width: 44px; height: auto; opacity: 1; color: var(--c-muted); border-color: var(--c-line); }
.table td .title-cell { display: flex; flex-direction: column; gap: var(--px-2); min-width: 200px; }
.table td .title-cell a { font-weight: 700; }
.table td .title-cell a:hover { text-decoration: underline; }
.table .actions .btn, .table .actions form { flex: none; }
.table .num, .table .t-right { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .thumb-cell { display: flex; align-items: center; gap: var(--s-3); min-width: 220px; }
.table .thumb-cell img, .table .thumb-cell .skeleton-thumb { width: 44px; height: 56px; object-fit: contain; background: var(--c-milk); border-radius: var(--r-btn); border: 1px solid var(--c-line); flex: none; font-size: 0; }
.btn-group form { display: inline-flex; }
.actions form { display: inline-flex; }
.panel-body .dl dd { word-break: break-all; }
.option-card input:disabled + span { opacity: .45; cursor: not-allowed; background: var(--c-milk); }

@media (max-width: 720px) {
  .auth-card { padding: var(--s-6); box-shadow: var(--shadow-2); }
  .dl { grid-template-columns: 1fr; gap: var(--px-2); }
  .dl dd { margin-bottom: var(--s-2); }
}
