/* --- 모던 미니멀 테마 --- */
:root {
    --miru-teal: #32C7C7;  
    --miru-red: #8D2222;   
    --bg-color: #F8F9FA;   
    --card-bg: #FFFFFF;    
    --text-main: #2C3E50;  
    --text-muted: #8391A2; 
    --border-light: #E9ECEF;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
}

html { scroll-behavior: smooth; }

/* 'Miru Sans', 'Miru IPA', 'Miru Title'은 fonts/fonts.css에 정의된 글꼴 묶음입니다. */
body { font-family: 'Miru Sans', sans-serif; margin: 0; padding: 20px 10px; background-color: var(--bg-color); color: var(--text-main); line-height: 1.6; }
/* 입력칸과 버튼은 기본으로 페이지 글꼴을 물려받지 않으므로 직접 맞춥니다. */
button, input, select, textarea { font-family: inherit; }
/* 경기천년제목('Miru Title')은 화면마다 하나 있는 큰 제목에만 씁니다. 탭 버튼, 작은 소제목, 안내 문구는 Noto입니다.
   그 글꼴에 없는 글자(한자, é ñ ç 등)는 Noto로 넘어갑니다. */
.page-title, .view-title, .appendix-title, .info-tab-title, .info-section-title { font-family: 'Miru Title', 'Miru Sans', sans-serif; }
.container { max-width: 1050px; margin: 0 auto; background: var(--card-bg); padding: 40px; border-radius: 16px; box-shadow: var(--shadow-soft); position: relative; }

.top-bar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-light); margin-bottom: 30px; padding-bottom: 20px; }
nav { display: flex; gap: 8px; }
/* 탭 왼쪽의 로고. 누르면 첫 화면(소개, 문법서 등)으로 갑니다. 첫 화면에 따로 탭이 없으므로,
   어떤 탭도 선택되지 않은 상태가 곧 첫 화면입니다. 그림은 <img>가 아닌 배경이라, 우클릭·길게
   눌러도 이미지로 열리거나 저장 메뉴가 뜨지 않습니다(우클릭 메뉴는 script.js가 막습니다). */
.top-bar-start { display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-logo { width: 36px; height: 36px; flex-shrink: 0; padding: 0; border: none; border-radius: 8px; background: url('logo.png') center / contain no-repeat; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
nav button { padding: 10px 22px; border: none; background: transparent; cursor: pointer; border-radius: 8px; font-weight: 600; font-size: 0.95em; color: var(--text-muted); transition: all 0.2s ease; }
nav button:hover { background: #F1F3F5; color: var(--text-main); }
nav button.active { background: var(--miru-teal); color: white; box-shadow: 0 4px 10px rgba(50, 199, 199, 0.2); }

.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- 미루어 탭 3단 레이아웃 --- */
.info-tab-header { margin-bottom: 35px; }
.info-tab-title { font-size: 2.2em; margin: 0 0 5px; color: var(--text-main); }
.info-tab-description { color: var(--text-muted); margin: 0; font-size: 1.1em; }
.info-layout { display: flex; gap: 25px; align-items: flex-start; }
.info-toc { width: 180px; flex-shrink: 0; background: var(--card-bg); border: 1px solid var(--border-light); border-radius: 8px; padding: 20px; position: sticky; top: 20px; }
.toc-list { list-style: none; padding: 0; margin: 0; font-size: 0.95em; }
.toc-list > li { margin-bottom: 8px; }
.toc-list > li > a { text-decoration: none; color: var(--text-main); transition: color 0.2s; font-weight: 600; cursor: pointer; display: block; padding: 4px 0; }
.toc-list > li > a:hover { color: var(--miru-teal); }
.toc-list > li > a.active { color: var(--miru-teal); }
.toc-sublist { list-style: none; padding-left: 15px; margin-top: 5px; margin-bottom: 10px; font-size: 0.95em; border-left: 2px solid var(--border-light); display: none; }
.toc-sublist li { margin-bottom: 6px; }
.toc-sublist a { font-weight: 400; color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.toc-sublist a:hover { color: var(--miru-teal); font-weight: 600; }
.info-main { flex: 1; min-width: 0; background: #F8F9FA; padding: 30px; border-radius: 12px; }
.info-section { display: none; animation: fadeIn 0.3s ease; }
.info-section.active { display: block; }
.info-side { width: 300px; flex-shrink: 0; position: sticky; top: 20px; }
.info-side.is-hidden { display: none; }
.info-side-stack { display: flex; flex-direction: column; gap: 18px; }
.info-status-item { color: var(--text-muted); font-size: 0.95em; }
.info-status-box { color: var(--text-muted); background: white; border: 1px dashed var(--border-light); border-radius: 10px; padding: 18px 20px; }
.info-status-error { color: var(--miru-red); border-color: rgba(141, 34, 34, 0.25); background: rgba(141, 34, 34, 0.04); }
.info-section-title { color: var(--text-main); font-size: 1.5em; border-bottom: 1px solid var(--border-light); padding-bottom: 10px; margin-top: 0; margin-bottom: 15px; }
.info-subheading { color: var(--text-main); margin-top: 30px; margin-bottom: 15px; }
.info-body-text { color: var(--text-main); margin-bottom: 20px; }
.info-body-text:last-child { margin-bottom: 0; }
.info-main ul,
.info-main ol { color: var(--text-main); margin: 0 0 20px; padding-left: 22px; }
.info-main li + li { margin-top: 6px; }
.info-inline-code { font-family: monospace; background: rgba(44, 62, 80, 0.08); padding: 0.12em 0.35em; border-radius: 4px; font-size: 0.92em; }
.info-reference-block { margin: 24px 0; }
.info-side .info-reference-block { margin: 0; }
.info-reference-missing { color: var(--miru-red); background: rgba(141, 34, 34, 0.06); border: 1px dashed rgba(141, 34, 34, 0.25); border-radius: 10px; padding: 14px 16px; margin: 24px 0; }

.miru-table { width: 100%; border-collapse: collapse; font-size: 0.95em; margin-bottom: 15px; }
.miru-table th, .miru-table td { border-bottom: 1px solid var(--border-light); padding: 12px 10px; text-align: left; }
.miru-table tr:last-child th, .miru-table tr:last-child td { border-bottom: none; }

/* 학술용 표 스타일 */
.academic-table { width: 100%; border-collapse: collapse; margin-bottom: 25px; color: black; text-align: center; font-size: 1em; border-top: 3px double black; border-bottom: 3px double black; }
.academic-table caption { text-align: left; font-weight: bold; margin-bottom: 8px; color: black; }
.academic-table th, .academic-table td { padding: 8px 12px; }
.academic-table thead th { border-bottom: 1px solid black; font-weight: normal; }
.v-line { border-right: 1px solid black; }
.academic-example { width: 100%; border-collapse: collapse; margin-bottom: 20px; color: black; }
.academic-example td { padding: 4px 15px 4px 0; vertical-align: top; }

/* 사전/예문 스타일 */
.sentence-card { padding: 20px; border: 1px solid var(--border-light); border-radius: 12px; margin-bottom: 15px; position: relative; background: var(--card-bg); transition: border-color 0.2s; cursor: pointer; }
.sentence-card:hover { border-color: var(--miru-teal); }
.sentence-en { font-size: 1.2em; font-weight: 700; color: var(--text-main); margin-bottom: 6px; cursor: pointer; }
.sentence-ko { font-size: 0.95em; color: var(--text-muted); cursor: pointer; }

#sentence-detail-view, #tag-search-view, #tag-result-view { display: none; padding: 30px; background: #F8F9FA; border-radius: 12px; }
.back-btn { padding: 8px 16px; background: white; color: var(--text-main); border: 1px solid var(--border-light); border-radius: 6px; cursor: pointer; margin-bottom: 25px; font-weight: 600; box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: all 0.2s; }
.back-btn:hover { border-color: var(--text-muted); }

/* 태그 관련 CSS */
.tag-btn { background: #F1F3F5; color: var(--text-main); padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border-light); cursor: pointer; font-size: 0.95em; transition: all 0.2s; font-weight: 500; }
.tag-btn:hover { background: var(--miru-teal); color: white; border-color: var(--miru-teal); }
.detail-tag-text { color: var(--miru-teal); cursor: pointer; font-weight: 600; transition: color 0.2s; }
.detail-tag-text:hover { color: var(--miru-red); text-decoration: underline; }

.detail-en { font-size: 1.6em; font-weight: 700; line-height: 1.6; margin-bottom: 8px; }
.interlinear { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 15px; }
/* 단어 앞 문장 부호(« 등)는 따로 한 칸에 두어, 주석이 단어 첫 글자부터 시작하게 합니다. */
.interlinear-column { display: grid; grid-template-columns: auto auto; justify-content: start; }
.interlinear-lead { grid-column: 1; grid-row: 1; line-height: 1.4; }
.interlinear-word { grid-column: 2; grid-row: 1; line-height: 1.4; }
.interlinear-gloss { grid-column: 2; grid-row: 2; font-size: 0.6em; font-weight: 400; color: var(--miru-teal); min-height: 1.2em; }
/* 주석 글자는 드래그로 선택되지 않습니다(복사하면 문장만 들어가도록 script.js가 따로 처리합니다). */
.interlinear-gloss { user-select: none; -webkit-user-select: none; }
/* 주석을 끄면 단어들이 일반 문장처럼 이어집니다. */
.detail-en.gloss-off .interlinear { display: block; }
.detail-en.gloss-off .interlinear-column,
.detail-en.gloss-off .interlinear-lead,
.detail-en.gloss-off .interlinear-word { display: inline; }
.detail-en.gloss-off .interlinear-gloss { display: none; }
/* 형태소 경계(-, =)와 영형태(Ø)는 행간 주석을 켰을 때만 보입니다. */
.detail-en.gloss-off .morph-mark { display: none; }
.morph-mark { user-select: none; -webkit-user-select: none; }
/* 예문 상세 위쪽 줄: 왼쪽 "목록으로", 오른쪽 "행간 주석"(켜짐·꺼짐은 색으로만 보입니다). */
.detail-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 25px; }
.detail-toolbar .back-btn { margin-bottom: 0; }
.gloss-toggle { padding: 8px 16px; background: white; color: var(--text-muted); border: 1px solid var(--border-light); border-radius: 6px; cursor: pointer; font-weight: 600; transition: all 0.2s; }
.gloss-toggle:hover { border-color: var(--text-muted); }
.gloss-toggle[aria-pressed="true"] { background: var(--miru-teal); border-color: var(--miru-teal); color: white; }
/* 주석 줄의 문법 약어(PFV, 1SG 등)는 라이프치히 규칙대로 작은 대문자로 씁니다. */
.gloss-abbr { font-variant-caps: all-small-caps; letter-spacing: 0.03em; }
.related-sense-title { font-size: 0.9em; font-weight: 600; color: var(--text-muted); margin: 14px 0 8px; }
.info-pdf-frame { width: 100%; height: 75vh; border: 1px solid var(--border-light); border-radius: 8px; background: white; }
.info-pdf-actions { margin-bottom: 12px; }
.detail-ko { font-size: 1.15em; color: var(--text-muted); border-top: 1px solid var(--border-light); padding-top: 15px; }
.clickable-word { cursor: pointer; transition: color 0.2s; border-bottom: 1px dashed transparent; }
.clickable-word.registered:hover { color: var(--miru-teal); border-bottom: 1px dashed var(--miru-teal); }
.clickable-word.unregistered:hover { color: var(--miru-red); border-bottom: 1px dashed var(--miru-red); }

.vocab-container { display: flex; gap: 30px; margin-top: 20px; }
.vocab-left { width: 38%; border-right: 1px solid var(--border-light); padding-right: 20px; display: flex; flex-direction: column; }
.search-mode-container { display: flex; gap: 15px; margin-bottom: 15px; font-size: 0.9em; color: var(--text-muted); }
.search-mode-container label { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.search-mode-container input[type="radio"] { accent-color: var(--miru-teal); }
.search-box { width: 80%; max-width: 280px; padding: 12px 15px; margin-bottom: 15px; border: 1px solid var(--border-light); border-radius: 8px; font-size: 0.95em; background: #F8F9FA; transition: all 0.2s; }
.search-box:focus { border-color: var(--miru-teal); background: white; outline: none; box-shadow: 0 0 0 3px rgba(50, 199, 199, 0.1); }
/* 검색창과 지우기 버튼을 감싸는 칸. 크기는 예전 검색창과 같습니다(80% + 안쪽 여백, 최대 312px). */
.search-field { position: relative; display: inline-block; width: calc(80% + 32px); max-width: 312px; margin-bottom: 15px; vertical-align: middle; }
.search-field .search-box { display: block; width: 100%; max-width: none; box-sizing: border-box; margin-bottom: 0; }
.search-row { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.search-row .search-field { margin-bottom: 0; }
/* 지우기(×)는 터치 기기에서, 글자가 있을 때만 나타납니다. */
.search-clear { display: none; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; padding: 0; border: none; border-radius: 50%; background: transparent; color: var(--text-muted); font-size: 1.3em; line-height: 1; cursor: pointer; align-items: center; justify-content: center; user-select: none; -webkit-user-select: none; }
@media (hover: none) and (pointer: coarse) {
    .search-box:not(:placeholder-shown) { padding-right: 44px; }
    .search-box:not(:placeholder-shown) + .search-clear { display: flex; }
}
/* "?" 특수 문자 입력 버튼(PC 전용)과 그 메모 */
.input-help-btn { width: 24px; height: 24px; padding: 0; flex-shrink: 0; border: 1px solid var(--border-light); border-radius: 50%; background: white; color: var(--text-muted); font-weight: 700; font-size: 0.8em; line-height: 1; cursor: pointer; user-select: none; -webkit-user-select: none; transition: all 0.2s; }
.input-help-btn:hover { border-color: var(--text-muted); color: var(--text-main); }
.input-help-btn[aria-expanded="true"] { background: var(--miru-teal); border-color: var(--miru-teal); color: white; }
@media (hover: none) and (pointer: coarse) {
    .input-help-btn { display: none; }
}
.input-help { position: absolute; z-index: 100; background: white; color: var(--text-main); border: 1px solid var(--border-light); border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); padding: 16px 20px; }
.input-help[hidden] { display: none; }
.input-help-title { font-weight: 700; margin-bottom: 4px; }
/* "글자"와 "문장 부호"는 좌우 두 칸으로 놓습니다. */
.input-help-columns { display: flex; gap: 28px; align-items: flex-start; }
.input-help-group { font-size: 0.8em; font-weight: 600; color: var(--text-muted); margin: 10px 0 6px; }
.input-help-grid { display: grid; grid-template-columns: auto auto auto 18px auto auto auto; align-items: center; gap: 6px; }
.input-help kbd { font-family: monospace; font-size: 0.9em; background: #F1F3F5; border: 1px solid var(--border-light); border-radius: 4px; padding: 1px 6px; text-align: center; }
.input-help-arrow { color: var(--text-muted); font-size: 0.85em; }
.input-help-out { font-size: 1.1em; }
/* 미루어 탭의 약어 목록 */
.abbreviation-table th { width: 1%; white-space: nowrap; font-weight: 400; }
.abbreviation-word { color: var(--text-muted); }
.vocab-list { flex-grow: 1; max-height: 440px; overflow-y: auto; padding-right: 10px; scrollbar-width: thin; scrollbar-color: var(--miru-teal) transparent; overflow-anchor: none; }
.vocab-list::-webkit-scrollbar { width: 6px; }
.vocab-list::-webkit-scrollbar-thumb { background-color: var(--miru-teal); border-radius: 4px; }
.vocab-list::-webkit-scrollbar-thumb:hover { background-color: var(--miru-red); }
.vocab-item-wrapper { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.vocab-item { flex-grow: 1; padding: 12px 15px; cursor: pointer; border-radius: 8px; transition: background 0.2s; color: var(--text-main); font-weight: 500; }
.vocab-item:hover { background: #F1F3F5; }
.vocab-item.selected { background: rgba(50, 199, 199, 0.08); font-weight: 700; color: var(--miru-teal); }
.vocab-details { width: 62%; padding-left: 10px; }
/* 휴대폰에서 단어 상세를 볼 때만 나타납니다(아래 휴대폰 화면 규칙). */
.vocab-back-btn { display: none; }
.vocab-details h3 { font-size: 2.2em; color: var(--text-main); margin-bottom: 25px; display: flex; align-items: baseline; gap: 12px; }
.toggle-btn { padding: 6px 12px; font-size: 0.85em; background: white; border: 1px solid var(--border-light); border-radius: 6px; cursor: pointer; float: right; color: var(--text-muted); font-weight: 600; }
.toggle-btn:hover { background: #F8F9FA; border-color: var(--text-muted); }
.meaning-list { list-style: none; padding: 0; margin: 0; }
.pos-badge { font-size: 0.8em; background: #F1F3F5; color: var(--text-muted); padding: 4px 10px; border-radius: 6px; margin-right: 12px; vertical-align: middle; font-weight: 600; letter-spacing: 0.5px; }
.etym-container { font-size: 0.95em; color: var(--text-muted); margin-bottom: 25px; padding: 15px; background: #F8F9FA; border-radius: 8px; }
.etym-link { color: var(--text-main); font-weight: 600; cursor: pointer; border-bottom: 1px solid var(--border-light); transition: all 0.2s; padding-bottom: 1px; }
.etym-link:hover { color: var(--miru-teal); border-bottom-color: var(--miru-teal); }
.etym-none { color: inherit; }

#tooltip { display: none; position: absolute; background: white; color: var(--text-main); padding: 20px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); z-index: 100; width: 300px; border: 1px solid var(--border-light); }
.tooltip-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 15px; border-bottom: 1px solid var(--border-light); padding-bottom: 12px; }
#tooltip-word { font-size: 1.4em; font-weight: 700; color: var(--miru-teal); }
#tooltip .word-relations { display: none !important; }
#tooltip-forms { font-size: 0.9em; color: var(--text-muted); }
#tooltip-meaning { margin-bottom: 20px; font-size: 0.95em; }
#tooltip button { width: 100%; padding: 12px; background: #F1F3F5; color: var(--text-main); border: none; border-radius: 8px; cursor: pointer; font-weight: 600; transition: background 0.2s; }
#tooltip button:hover { background: var(--miru-teal); color: white; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #DDE2E5; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #C1C9D0; }

@media (max-width: 980px) {
    .info-layout { flex-direction: column; }
    /* 폭 100%에 안쪽 여백이 더해져 오른쪽으로 삐져나오지 않게 합니다. */
    .info-toc,
    .info-side { width: 100%; position: static; box-sizing: border-box; }
    /* 세로로 쌓일 때는 오른쪽 칸(소개의 미루어 표)을 본문보다 먼저, 목차 바로 아래에 둡니다. */
    .info-toc { order: 0; }
    .info-side { order: 1; }
    .info-main { order: 2; }
}

/* --- 휴대폰 화면 --- */
@media (max-width: 600px) {
    body { padding: 10px 8px; }
    .container { padding: 18px 16px; border-radius: 12px; }

    .top-bar { margin-bottom: 20px; padding-bottom: 12px; }
    .top-bar-start { gap: 8px; }
    .site-logo { width: 32px; height: 32px; }
    nav { gap: 4px; }
    /* 탭 이름이 한 글자씩 세로로 쌓이지 않게 합니다. */
    nav button { padding: 10px 14px; white-space: nowrap; }

    .page-title { font-size: 1.35em; }
    .pagination-btn { min-height: 40px; min-width: 40px; }

    /* 사전: 목록과 상세 중 하나만 보여 줍니다. 단어를 고르면 script.js가 .is-detail을 붙입니다. */
    .vocab-container { flex-direction: column; gap: 16px; }
    .vocab-left { width: auto; border-right: none; padding-right: 0; }
    .vocab-details { width: auto; padding-left: 0; }
    .vocab-container.is-detail .vocab-left,
    .vocab-container:not(.is-detail) .vocab-details { display: none; }
    .vocab-container.is-detail .vocab-back-btn { display: block; align-self: flex-start; margin-bottom: 0; }
    .vocab-details h3 { font-size: 1.8em; flex-wrap: wrap; gap: 4px 12px; margin-top: 0; }
    /* 목록이 화면 아래쪽까지 차도록 합니다(위쪽 탭·제목·검색창 몫을 뺀 높이). */
    .vocab-list { max-height: max(240px, calc(100vh - 300px)); max-height: max(240px, calc(100svh - 300px)); }
    .search-mode-container { gap: 20px; }
    .search-mode-container label { white-space: nowrap; padding: 6px 0; }
    .search-mode-container input[type="radio"] { width: 18px; height: 18px; margin: 0; }
    /* 16px보다 작으면 iPhone이 입력칸을 누를 때 화면을 확대합니다. */
    .search-box { width: 100%; max-width: none; box-sizing: border-box; font-size: 16px; }
    .search-field { width: 100%; max-width: none; }
    .search-row .search-field { flex: 1; }

    .info-main { padding: 18px 16px; }
    .info-tab-title { font-size: 1.8em; }

    #sentence-detail-view, #tag-search-view, #tag-result-view { padding: 18px 16px; }
    /* 이 두 화면은 여백이 HTML에 직접 적혀 있어 !important로 덮습니다. */
    #pos-search-view, #pos-result-view { padding: 18px 16px !important; }
    /* 예문은 읽기 쉽게 조금 작고 덜 굵게, 주석을 켰을 때 단어 사이도 좁게 합니다. */
    .detail-en { font-size: 1.25em; font-weight: 600; line-height: 1.7; }
    .interlinear { gap: 6px 14px; }
    .detail-ko { font-size: 1.05em; }
    .detail-toolbar { margin-bottom: 18px; }
}

/* 부록(X-SAMPA 입력)은 휴대폰·태블릿의 화면 키보드에서 스페이스 변환이 되지 않으므로,
   마우스 없이 터치로만 쓰는 기기에서는 탭을 숨깁니다. script.js의 isTouchOnly와 같은 조건입니다. */
@media (hover: none) and (pointer: coarse) {
    #btn-appendix { display: none; }
}

#tooltip button { width: 100%; padding: 12px; background: #F1F3F5; color: var(--text-main); border: none; border-radius: 8px; cursor: pointer; font-weight: 600; transition: background 0.2s; }
#tooltip button:hover { background: var(--miru-teal); color: white; }

/* 서버에서 내용을 받지 못했을 때 그 자리에 넣는 문구 */
.load-error { color: var(--miru-red); padding: 10px 0; margin: 0; font-size: 0.95em; }
#tooltip .load-error { padding: 0; font-size: 0.9em; }

/* 서버의 응답이 늦을 때(2초 넘게) 그 자리에 넣는 문구 */
.load-notice { color: var(--text-muted); padding: 10px 0; margin: 0; font-size: 0.95em; }
#tooltip .load-notice { padding: 0; font-size: 0.9em; }

/* 링크한 단어·예문·뜻이 (더는) 없을 때 그 자리에 넣는 문구 */
.not-found { color: var(--text-muted); padding: 10px 0; margin: 0; font-size: 0.95em; }

/* IPA가 나오는 모든 칸(.ipa)은 Noto Serif입니다.
   Noto Serif에 없는 기호(↗ ↘)만 'Miru Sans'로 넘어갑니다. */
.ipa { font-family: 'Miru IPA', 'Miru Sans', serif; }

/* --- 부록 탭 --- */
.appendix-title { margin: 0 0 20px; }
/* 가로를 꽉 채우고 가로:세로 3:1을 유지합니다. 크기 조절은 비율이 깨지지 않게 막습니다. */
.xsampa-frame { position: relative; width: 100%; aspect-ratio: 3 / 1; }
/* 입력칸(.xsampa-in)은 글자를 투명하게 받기만 하고, 그 아래 표시층(.xsampa-view)이 허용 문자만 그립니다.
   그래서 한글 입력기로 조합 중인 글자도 화면에 나타나지 않습니다.
   커서가 글자와 맞도록 두 층의 글꼴·여백·줄 간격은 반드시 같아야 합니다. */
.xsampa-view, .xsampa-in { position: absolute; top: 0; left: 0; width: 100%; height: 100%; margin: 0; box-sizing: border-box; padding: 16px 18px; border: 1px solid transparent; border-radius: 8px; font-family: 'Miru IPA', 'Miru Sans', serif; font-size: 1.4em; line-height: 1.6; letter-spacing: normal; white-space: pre-wrap; overflow-wrap: break-word; overflow-y: auto; scrollbar-width: none; }
.xsampa-view::-webkit-scrollbar, .xsampa-in::-webkit-scrollbar { display: none; }
.xsampa-view { overflow: hidden; background: #F8F9FA; border-color: var(--border-light); color: var(--text-main); pointer-events: none; transition: all 0.2s; }
.xsampa-in { display: block; background: transparent; color: transparent; caret-color: var(--text-main); resize: none; outline: none; }
/* 조합 중에는 입력칸 층 전체를 투명하게 해서, 브라우저가 그리는 조합 표시(밑줄·바탕)까지 보이지 않게 합니다. */
.xsampa-in.is-composing { caret-color: transparent; opacity: 0; }
.xsampa-in::selection { color: transparent; background: rgba(50, 199, 199, 0.25); }
.xsampa-frame:focus-within .xsampa-view { background: white; border-color: var(--miru-teal); box-shadow: 0 0 0 3px rgba(50, 199, 199, 0.1); }

.hoverable-card { background: white; border: 1px solid var(--border-light); border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.hoverable-card:hover { border-color: var(--miru-teal); box-shadow: 0 2px 8px rgba(50,199,199,0.1); }

.list-item-hover { transition: background 0.2s; border-radius: 8px; }
.list-item-hover:hover { background-color: #F1F3F5; }

.pagination-btn { padding: 5px 10px; border: 1px solid var(--border-light); background: white; border-radius: 6px; color: var(--text-main); transition: background 0.2s; cursor: pointer; }
.pagination-btn:hover { background-color: #F1F3F5; }
.pagination-btn:disabled { background: #f9f9f9; border-color: #eee; color: #ccc; cursor: not-allowed; }
.pagination-btn.active { border-color: var(--miru-teal); background: var(--miru-teal); color: white; font-weight: bold; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #DDE2E5; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #C1C9D0; }
