/* tc-encyclopedia — 테마 CSS 충돌을 피하려고 전부 tcenc- 접두사로 격리한다. */

.tcenc-archive,
.tcenc-single {
	max-width: 1080px;
	margin: 0 auto;
	padding: 48px 20px 80px;
	color: #1a1d21;
	line-height: 1.65;
}

.tcenc-single { max-width: 760px; }

/* ---------------------------------------------------------------- 목록 */

.tcenc-arc-head { margin-bottom: 32px; }
.tcenc-arc-head h1 { font-size: 2.25rem; margin: 0 0 6px; letter-spacing: -0.02em; }
.tcenc-arc-sub { color: #6b7280; margin: 0 0 20px; }

.tcenc-search {
	width: 100%;
	padding: 14px 18px;
	font-size: 1rem;
	border: 1px solid #d7dbe0;
	border-radius: 10px;
	background: #fff;
}
.tcenc-search:focus { outline: 2px solid #1a4fd6; outline-offset: 1px; border-color: transparent; }

.tcenc-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tcenc-chip {
	padding: 7px 14px;
	font-size: 0.875rem;
	border: 1px solid #d7dbe0;
	border-radius: 999px;
	background: #fff;
	color: #4b5563;
	cursor: pointer;
}
.tcenc-chip:hover { border-color: #1a4fd6; color: #1a4fd6; }
.tcenc-chip.is-active { background: #1a4fd6; border-color: #1a4fd6; color: #fff; }

/* 초성 / A–Z 인덱스 */
.tcenc-index {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 12px 0 20px;
	padding-top: 12px;
	border-top: 1px solid #eef0f2;
}
.tcenc-idx {
	min-width: 32px;
	padding: 5px 8px;
	font-size: .8125rem;
	font-weight: 600;
	border: 1px solid transparent;
	border-radius: 6px;
	background: transparent;
	color: #6b7280;
	cursor: pointer;
}
.tcenc-idx:hover { background: #eef2ff; color: #1a4fd6; }
.tcenc-idx.is-active { background: #1a4fd6; color: #fff; }

.tcenc-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 14px;
}

.tcenc-card {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 18px;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	background: #fff;
	text-decoration: none;
	color: inherit;
	transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tcenc-card:hover {
	border-color: #1a4fd6;
	box-shadow: 0 6px 20px rgba(26, 79, 214, .08);
	transform: translateY(-1px);
}
.tcenc-card-cat { font-size: .6875rem; color: #1a4fd6; font-weight: 600; letter-spacing: .02em; }
.tcenc-card-term { font-size: 1.0625rem; font-weight: 700; }
.tcenc-card-en { font-size: .8125rem; color: #9ca3af; }
.tcenc-card-def { font-size: .875rem; color: #6b7280; margin-top: 4px; }

.tcenc-empty { text-align: center; color: #9ca3af; padding: 48px 0; }

/* ---------------------------------------------------------------- 공통 블록 */

.tcenc-badge {
	display: inline-block;
	padding: 4px 10px;
	font-size: .75rem;
	font-weight: 600;
	color: #1a4fd6;
	background: #eef2ff;
	border-radius: 6px;
	margin-bottom: 10px;
}

.tcenc-crumb { font-size: .8125rem; color: #9ca3af; margin-bottom: 20px; }
.tcenc-crumb a { color: #6b7280; text-decoration: none; }
.tcenc-crumb a:hover { color: #1a4fd6; }
.tcenc-crumb span { margin: 0 6px; }

.tcenc-head h1 { font-size: 2rem; margin: 0 0 12px; letter-spacing: -0.02em; }

.tcenc-alt {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 4px 14px;
	margin: 0 0 16px;
	font-size: .875rem;
}
.tcenc-alt dt { color: #9ca3af; font-weight: 500; }
.tcenc-alt dd { margin: 0; color: #374151; }

/* 정의문 — 페이지의 첫 문단이자 AI가 뽑아가는 문장. 시각적으로도 최우선. */
.tcenc-def {
	font-size: 1.0625rem;
	font-weight: 500;
	line-height: 1.7;
	padding: 16px 18px;
	background: #f7f8fa;
	border-left: 3px solid #1a4fd6;
	border-radius: 0 8px 8px 0;
	margin: 0 0 28px;
}

.tcenc-sec { margin-bottom: 32px; }
.tcenc-sec h2 { font-size: 1.25rem; margin: 0 0 12px; letter-spacing: -0.01em; }

.tcenc-body h2 { margin-top: 28px; }
/* 원리/용도/주의사항 소제목 — 섹션 h2("주요 수치")와 동일 크기로 통일 */
.tcenc-body h3 { margin-top: 28px; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.tcenc-body p { margin: 0 0 14px; }

.tcenc-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.tcenc-table th, .tcenc-table td { padding: 10px 14px; border: 1px solid #e5e7eb; text-align: left; }
.tcenc-table th { background: #f7f8fa; font-weight: 600; width: 34%; color: #374151; }

.tcenc-spec, .tcenc-sources { margin: 0; padding-left: 20px; color: #374151; }
.tcenc-spec li, .tcenc-sources li { margin-bottom: 5px; }

.tcenc-faq {
	padding: 16px 0;
	border-bottom: 1px solid #eef0f2;
}
.tcenc-faq h3, .tcenc-faq h4 { font-size: 1rem; margin: 0 0 6px; color: #111827; }
.tcenc-faq p { margin: 0; color: #4b5563; }

.tcenc-review { font-size: .8125rem; color: #9ca3af; padding-top: 12px; border-top: 1px solid #eef0f2; }

.tcenc-related { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tcenc-related-card {
	display: block;
	padding: 12px 14px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	text-decoration: none;
	color: inherit;
	font-size: .875rem;
}
.tcenc-related-card:hover { border-color: #1a4fd6; }
.tcenc-related-card span { display: block; color: #9ca3af; font-size: .75rem; margin-top: 3px; }

.tcenc-autolink { color: #1a4fd6; text-decoration: none; border-bottom: 1px dotted #a5b4fc; }
.tcenc-autolink:hover { border-bottom-style: solid; }

.tcenc-back { margin-top: 40px; }
.tcenc-back a { color: #1a4fd6; text-decoration: none; font-weight: 500; }

/* ---------------------------------------------------------------- 모달 */

.tcenc-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 20, 30, .55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	z-index: 99999;
}
.tcenc-modal-overlay[hidden] { display: none; }

.tcenc-modal {
	position: relative;
	background: #fff;
	border-radius: 16px;
	max-width: 720px;
	width: 100%;
	max-height: 86vh;
	overflow-y: auto;
	padding: 40px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}

.tcenc-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 8px;
	background: #f3f4f6;
	font-size: 20px;
	line-height: 1;
	color: #6b7280;
	cursor: pointer;
}
.tcenc-modal-close:hover { background: #e5e7eb; }

.tcenc-modal h2 { font-size: 1.75rem; margin: 0 0 12px; letter-spacing: -0.02em; }
.tcenc-modal h3 { font-size: 1.125rem; margin: 26px 0 10px; }

.tcenc-loading { color: #9ca3af; padding: 40px 0; text-align: center; }

.tcenc-permalink { margin-top: 28px; padding-top: 16px; border-top: 1px solid #eef0f2; }
.tcenc-permalink a { color: #1a4fd6; text-decoration: none; font-size: .875rem; font-weight: 500; }

@media (max-width: 640px) {
	.tcenc-modal { padding: 28px 20px; border-radius: 12px; }
	.tcenc-archive, .tcenc-single { padding: 28px 16px 60px; }
	.tcenc-arc-head h1 { font-size: 1.75rem; }
}
