/* =========================================================
   가방 현장용어 사전 - 공통 디자인 기준 (학습 화면·관리자 화면 공용)
   색·글꼴·모서리·헤더·버튼은 이 파일 한 곳에서만 정의합니다.

   모서리 규칙: 입력창·버튼 10px / 패널·카드 14px / 번호 핀·배지만 원형
   강조색: 코발트 블루 1가지 (사진 속 올리브·갈색 가방과 대비되는 색)
   레이어: 헤더 20 / 모바일 시트·하단 바 30 / 알림 50 / 대화상자는 브라우저 top-layer
   ========================================================= */

@font-face {
    font-family: "Pretendard";
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    src: url("../fonts/Pretendard-Regular.subset.woff2") format("woff2");
}

@font-face {
    font-family: "Pretendard";
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    src: url("../fonts/Pretendard-SemiBold.subset.woff2") format("woff2");
}

@font-face {
    font-family: "Pretendard";
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    src: url("../fonts/Pretendard-Bold.subset.woff2") format("woff2");
}

:root {
    --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "Noto Sans KR", system-ui, sans-serif;

    --bg: #f4f5f7;
    --surface: #fcfcfd;
    --surface-2: #eceef2;
    --line: #dde0e6;
    --line-strong: #c3c8d1;
    --text: #16181d;
    --text-muted: #5b616e;

    --accent: #2a52c9;
    --accent-hover: #2246b0;
    --accent-ink: #2a52c9;
    --accent-soft: #e8eefc;
    --accent-text: #2244a8;
    --accent-ring: rgb(42 82 201 / 0.22);
    --on-accent: #fcfcfd;

    --danger: #b42318;
    --danger-soft: #fdecea;
    --danger-strong: #b42318;
    --danger-strong-hover: #9a1d13;
    --success: #1f7a4d;
    --mask: #cfd4dd;

    /* 사진 위 요소는 테마와 무관하게 같은 색을 씁니다 */
    --pin: #2a52c9;
    --pin-ring: #fcfcfd;
    --tip-bg: rgb(17 19 24 / 0.92);
    --tip-text: #f4f5f7;

    --shadow-sm: 0 1px 2px rgb(22 24 29 / 0.06);
    --shadow-lg: 0 16px 40px -12px rgb(22 24 29 / 0.22);
    --shadow-sheet: 0 -12px 32px -12px rgb(22 24 29 / 0.24);

    --r-ctl: 10px;
    --r-box: 14px;

    --header-h: 64px;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111318;
        --surface: #1a1d23;
        --surface-2: #23272f;
        --line: #2c3039;
        --line-strong: #3d424d;
        --text: #e9ebef;
        --text-muted: #a3a9b5;

        --accent: #3d66dc;
        --accent-hover: #4a72e6;
        --accent-ink: #8aa8ff;
        --accent-soft: #1e2947;
        --accent-text: #b8c9ff;
        --accent-ring: rgb(138 168 255 / 0.28);
        --on-accent: #fcfcfd;

        --danger: #ff9b8f;
        --danger-soft: #3a1d1b;
        --danger-strong: #c8382b;
        --danger-strong-hover: #d8473a;
        --success: #6fd3a0;
        --mask: #3a3f4a;

        --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
        --shadow-lg: 0 16px 40px -12px rgb(0 0 0 / 0.6);
        --shadow-sheet: 0 -12px 32px -12px rgb(0 0 0 / 0.6);
        color-scheme: dark;
    }
}

/* ---------- 기본 ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    word-break: keep-all;
    overflow-wrap: anywhere;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, ul, dl, dd {
    margin: 0;
}

ol, ul {
    padding: 0;
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
}

button {
    font: inherit;
    color: inherit;
}

.icon {
    width: 1.25em;
    height: 1.25em;
    flex: none;
    fill: currentColor;
}

:focus-visible {
    outline: 3px solid var(--accent-ink);
    outline-offset: 2px;
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 40;
    padding: 10px 14px;
    border-radius: var(--r-ctl);
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
}

.count {
    margin-left: 4px;
    color: var(--text-muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.num-badge {
    width: 26px;
    height: 26px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--r-ctl);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.15s var(--ease);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--accent);
    color: var(--on-accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: var(--r-ctl);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.icon-btn:hover {
    background: var(--surface-2);
    color: var(--text);
}

.btn-secondary {
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--surface-2);
}

.btn-danger {
    background: var(--danger-strong);
    color: #fcfcfd;
}

.btn-danger:hover {
    background: var(--danger-strong-hover);
}

.btn-ghost-danger {
    background: transparent;
    color: var(--danger);
}

.btn-ghost-danger:hover {
    background: var(--danger-soft);
}

.btn:disabled {
    opacity: 0.55;
    cursor: default;
    transform: none;
}

/* 로딩 자리표시 (최종 모양과 같은 틀) */
.sk {
    display: block;
    border-radius: 6px;
    background: var(--surface-2);
}

.sk-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.sk-dot {
    width: 26px;
    height: 26px;
    flex: none;
    border-radius: 50%;
}

.sk-lines {
    flex: 1;
    display: grid;
    gap: 8px;
}

.sk-line {
    height: 12px;
}

/* ---------- 헤더 ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    max-width: 1320px;
    height: var(--header-h);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: var(--r-ctl);
    background: var(--accent);
    color: var(--on-accent);
}

.brand-mark .icon {
    width: 20px;
    height: 20px;
}

.brand-name {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.top-link {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: none;
    padding: 8px 10px;
    border-radius: var(--r-ctl);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.top-link:hover {
    background: var(--surface-2);
    color: var(--text);
}

button.top-link {
    border: 0;
    background: transparent;
    cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 959.98px) {
    html {
        scroll-padding-top: 16px;
    }

    .topbar {
        position: static;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background: var(--bg);
    }

    .topbar-inner {
        height: auto;
        flex-wrap: wrap;
        gap: 10px 12px;
        padding: 12px 16px;
    }

}

@media (max-width: 560px) {
    .brand-name {
        font-size: 16px;
    }
}
