/* ============================================================
   교사 연구소 포털 — 규격 v4 「햇살 든 유자」 (2026-10-15)

   정본: YUJA-DESIGN.md (프로젝트 루트 왕관유자_디자인시스템_v4.md)
   공용 CSS: https://crownyuja.co.kr/ds/v3/yuja.css + themes/teacher.css
             교사자료 = 네이비 원색(§9). 사다리 50·100·200 은 네이비 틴트,
             어두운 원색이라 주 버튼은 300 대신 원색 채움 + 흰 글자.
   형태·리듬: 토론 탐험대(student/discussion/v3.css v4 층)와 같은 집안.
             브랜드 유자는 상단바 유자 얼굴 그림에만 남는다.

   React 화면(index.html <script type="text/babel">)은 2026-10-15 정리로
   인라인 스타일 대신 tp- 클래스를 단다 → 이 파일이 모양을 전부 맡는다.
   새 이름은 tp- (yj- 는 DS 이름공간). 값은 토큰만, HEX 를 적지 않는다.
   ============================================================ */

/* ── 바탕: 캔버스 ── (가로 넘침은 페이지 <style> 의 body overflow-x 가 막는다.
   html 에 overflow 를 주면 body 가 스크롤 상자가 되어 상단바 sticky 가 풀린다) */
body {
    background: var(--yj-canvas);
    color: var(--yj-ink);
    font-family: var(--yj-font-ui);
    letter-spacing: -.01em;
}
body ::-webkit-scrollbar { width: 8px; height: 4px; }
body ::-webkit-scrollbar-thumb { background: var(--yj-line-strong); border-radius: var(--yj-r-xs); }

.tp-page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ── 상단바: 56 · 불투명 미색 · 아래 1px 선 · 위 빈틈 0 · 좌우 끝까지 ── */
.tp-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 56px;
    background: var(--yj-card);
    border-bottom: 1px solid var(--yj-line);
}
.tp-topbar__in {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--yj-s3);
    height: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 var(--yj-s5);
}
.tp-brand {
    display: flex;
    align-items: center;
    gap: var(--yj-s2);
    min-width: 0;
}
.tp-brand img {
    width: 28px;
    height: 28px;
    flex: none;
}
.tp-brand span {
    font-family: var(--yj-font-serif);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--yj-ink-deep);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── 제목 줄: 캔버스 위 · 라벨 / 세리프 제목 / 한 줄 설명 / 짧은 원색 막대 ── */
.tp-intro {
    max-width: 1040px;
    margin: 0 auto;
    padding: var(--yj-s7) var(--yj-s5) var(--yj-s5);
}
.tp-intro .yj-label { margin-bottom: var(--yj-s2); }
.tp-intro__desc {
    margin: var(--yj-s2) 0 0;
    font-size: var(--yj-t-body);
    line-height: var(--yj-lh-ui);
    color: var(--yj-ink);
}
.tp-intro::after {
    content: "";
    display: block;
    width: 32px;
    height: 3px;
    margin-top: var(--yj-s4);
    border-radius: var(--yj-r-full);
    background: var(--yj-yuja-500);
}

/* React 의 옛 큰 머리(캐릭터 + "온라인 교실")는 제목 줄이 맡는다 */
.header-section { display: none; }

/* ── 본문 ── */
.tp-main {
    flex: 1;
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 var(--yj-s5) var(--yj-s7);
}

/* 분류 머리 — 목록 머리: 100 아이콘 상자 + 세리프 20 + 아래 1px 선 */
.tp-section__head {
    display: flex;
    align-items: center;
    gap: var(--yj-s3);
    margin-bottom: var(--yj-s5);
    padding-bottom: var(--yj-s3);
    border-bottom: 1px solid var(--yj-line);
}
.tp-section__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--yj-r-sm);
    background: var(--yj-yuja-100);
    color: var(--yj-yuja-ink);
}
.tp-section__title {
    margin: 0;
    font-family: var(--yj-font-serif);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: -.03em;
    color: var(--yj-ink-deep);
}

/* 카드 격자 */
.tp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--yj-s5);
}

/* ── 도구 카드: 미색 · 1px 선 · 12 · 그림자 1 → hover 그림자 2 + 2px ── */
.tp-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--yj-s3);
    padding: var(--yj-s5);
    background: var(--yj-card);
    border: 1px solid var(--yj-line);
    border-radius: var(--yj-r-lg);
    box-shadow: var(--yj-sh-1);
    color: var(--yj-ink);
    text-decoration: none;
    transition: box-shadow var(--yj-m-mid) var(--yj-ease), transform var(--yj-m-mid) var(--yj-ease);
}
.tp-card:hover {
    box-shadow: var(--yj-sh-2);
    transform: translateY(-2px);
}
.tp-card:active { transform: scale(.98); }

/* 첫 줄: 배지 줄 + 링크 복사 */
.tp-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--yj-s2);
    min-height: 28px;
}

/* 배지 — 외곽선(쓰는 기기) · 유자 배지(AI 활용, 100 면 + 먹 글자) (§7-6) */
.tp-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tp-badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border: 1px solid var(--yj-line-strong);
    border-radius: var(--yj-r-full);
    color: var(--yj-sub);
    font-size: var(--yj-t-cap);
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
}
.tp-badge--yuja {
    border-color: transparent;
    background: var(--yj-yuja-100);
    color: var(--yj-ink-deep);
    font-weight: 600;
}

/* 링크 복사 — icon 버튼(보조 글자 → hover 먹), 누르는 칸 44 */
.tp-share {
    position: relative;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: -4px -6px -4px 0;
    border-radius: var(--yj-r-full);
    color: var(--yj-sub);
    transition: background-color var(--yj-m-fast) var(--yj-ease), color var(--yj-m-fast) var(--yj-ease);
}
.tp-share::before { content: ""; position: absolute; inset: -4px; }
.tp-share:hover {
    background: var(--yj-yuja-50);
    color: var(--yj-ink-deep);
}

/* 제목·설명 */
.tp-card__body { flex: 1; }
.tp-card__title {
    margin: 0 0 var(--yj-s2);
    font-family: var(--yj-font-serif);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: -.03em;
    color: var(--yj-ink-deep);
}
.tp-card__desc {
    margin: 0;
    font-size: var(--yj-t-small);
    line-height: 1.8;
    color: var(--yj-sub);
}

/* 카드 안 행동 하나 — 보조(100 면 + 유자 글자, 8 모서리) */
.tp-card__go {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    height: 36px;
    margin-top: var(--yj-s1);
    padding: 0 var(--yj-s4);
    border-radius: var(--yj-r-sm);
    background: var(--yj-yuja-100);
    color: var(--yj-yuja-ink);
    font-size: 14px;
    font-weight: 700;
    transition: background-color var(--yj-m-fast) var(--yj-ease);
}
.tp-card:hover .tp-card__go { background: var(--yj-yuja-200); color: var(--yj-ink-deep); }

/* 개발 중인 도구 — 흐린 막·블러·회색 필터 없이, 외곽선 배지 하나로 */
.tp-card.is-pending {
    box-shadow: none;
    pointer-events: none;
}
.tp-card__pending { align-self: flex-start; }

/* 링크 복사 알림 — 토스트(숲 + 흰 글자 + 그림자 2) */
.tp-toast {
    position: absolute;
    top: -14px;
    right: var(--yj-s4);
    z-index: 2;
    padding: 6px 12px;
    border-radius: var(--yj-r-sm);
    background: var(--yj-forest);
    color: var(--yj-on-forest);
    box-shadow: var(--yj-sh-2);
    font-size: var(--yj-t-cap);
    font-weight: 600;
    animation: tp-toast-in var(--yj-m-mid) var(--yj-ease);
}
@keyframes tp-toast-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

/* 불러오는 중 */
.tp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--yj-s4);
    min-height: 60dvh;
    color: var(--yj-sub);
    font-size: var(--yj-t-small);
    font-weight: 600;
}
.tp-loading p { margin: 0; }
.tp-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--yj-yuja-100);
    border-top-color: var(--yj-yuja-500);
    border-radius: var(--yj-r-full);
    animation: tp-spin 1s linear infinite;
}
@keyframes tp-spin { to { transform: rotate(360deg); } }

/* ── 푸터: 캔버스 위 한 줄 · 1px 위 선 · 보조 글자 ── */
.tp-footer {
    margin-top: auto;
    padding: var(--yj-s5);
    border-top: 1px solid var(--yj-line);
    background: var(--yj-canvas);
    color: var(--yj-sub);
    text-align: center;
}
.tp-footer p {
    margin: 0;
    font-size: var(--yj-t-cap);
    font-weight: 500;
}

/* ── 휴대폰 ── */
@media (max-width: 768px) {
    .tp-topbar__in { padding: 0 var(--yj-s4); }
    .tp-intro { padding: var(--yj-s6) var(--yj-s4) var(--yj-s4); }
    .tp-main { padding: 0 var(--yj-s4) var(--yj-s6); }
    .tp-card { padding: 20px; }
    .tp-grid {
        grid-template-columns: 1fr;
        gap: var(--yj-s4);
    }
    .tp-footer { padding: var(--yj-s4); }
}

/* 문의 메일 복사 툴팁 — 누른 자리 위(화면 위쪽이면 아래)에 잠깐 뜬다 */
.yj-copy-tip {
    position: fixed;
    z-index: 2000;
    transform: translate(-50%, -100%);
    padding: var(--yj-s2) var(--yj-s3);
    border-radius: var(--yj-r-sm);
    background: var(--yj-ink);
    color: var(--yj-on-ink);
    font-family: var(--yj-font-ui);
    font-size: var(--yj-t-small);
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: var(--yj-sh-toast);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--yj-m-fast) var(--yj-ease);
}
.yj-copy-tip.is-below { transform: translate(-50%, 0); }
.yj-copy-tip.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .yj-copy-tip { transition: none; }
}

/* 푸터 문의 — 누르면 메일 주소를 복사한다(index.html copyContactEmail) */
.tp-footer .tp-footer__links { margin-top: var(--yj-s2); }
.tp-footer__link {
    display: inline-flex;
    align-items: center;
    min-height: var(--yj-tap);
    padding: 0 var(--yj-s2);
    color: var(--yj-sub);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.tp-footer__link:hover { color: var(--yj-ink); }
.tp-footer__link:focus-visible { outline: 2px solid var(--yj-yuja-600); outline-offset: 2px; border-radius: var(--yj-r-xs); }
