/* 화면 컴포넌트. 형태 규칙은 1안 시안 확정값을 따른다.
   그라디언트 · 블러 · 반투명 오버레이 없음. */

.app { padding-bottom: 92px; }   /* 고정 탭바 자리 */

/* -------------------------------- 상단 -------------------------------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 10px;
}
.logo { font-family: var(--font-display); font-size: 26px; letter-spacing: -0.5px; font-weight: 400; }
.logo span { color: var(--ketchup); }

.degree-badge {
  display: inline-flex; align-items: center; gap: 6px;
  border: var(--border-thin); border-radius: 999px;
  padding: 7px 13px; font-size: 12px; font-weight: 700;
  background: var(--white); color: var(--ink); text-decoration: none;
  min-height: 0;
}
.degree-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--yolk); border: var(--border-thin);
}

.greet { padding: 6px 20px 16px; font-size: 14px; color: var(--muted); font-weight: 500; }
.greet b { color: var(--ink); }

/* ---------------------- 학부 진입 그리드 (이 화면의 주인공) ---------------------- */

.faculty-grid {
  padding: 0 16px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.f-btn {
  position: relative; display: block; text-decoration: none; color: var(--ink);
  padding: 16px 14px 13px; text-align: left;
}
.f-code {
  display: inline-block; margin-bottom: 9px; padding: 3px 7px;
  border-radius: 6px; color: var(--white);
  font-size: 10px; font-weight: 800; letter-spacing: .08em;
}
.f-name { display: block; font-family: var(--font-display); font-size: 19px; line-height: 1.1; }
.f-sub { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.f-now {
  position: absolute; top: 12px; right: 12px;
  font-size: 10px; font-weight: 800; color: var(--ketchup);
}

/* -------------------------------- 검색 -------------------------------- */

.search {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 16px 0; padding: 10px 14px;
  border-radius: var(--radius-field);
}
.search-icon { font-size: 15px; }
.search-input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 14px; font-weight: 500; color: var(--ink);
  min-height: 24px; padding: 6px 0;
}
.search-input::placeholder { color: var(--muted); }

.search-results { padding: 12px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.search-status { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.search-hint { font-size: 12.5px; color: var(--muted); font-weight: 500; }

.paper-row {
  display: flex; flex-direction: column; gap: 4px;
  padding: 13px 14px; text-decoration: none; color: var(--ink);
}
.row-title { font-size: 14.5px; font-weight: 800; }
.row-spec { font-size: 12px; color: var(--ink); }
.row-meta { font-size: 11.5px; color: var(--muted); font-weight: 700; }

/* ---------------------------- 섹션 헤더 ---------------------------- */

.sec {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 24px 20px 10px;
}
.sec h2 { font-family: var(--font-display); font-size: 17px; font-weight: 400; }
.sec-more { font-size: 12px; font-weight: 700; color: var(--muted); text-decoration: none; }

/* ---------------------------- 논문 카드 ---------------------------- */

.paper-card { margin: 0 16px; overflow: hidden; padding: 0; }
.paper-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--yolk); border-bottom: var(--border);
}
.paper-head .tag { font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.paper-head .jjim-count { font-size: 12px; font-weight: 800; white-space: nowrap; }

.paper-body { display: block; padding: 14px; text-decoration: none; color: var(--ink); }
.paper-body h3 { font-size: 16.5px; font-weight: 800; letter-spacing: -0.2px; line-height: 1.3; }

.spec-list { margin-top: 9px; display: flex; flex-direction: column; gap: 6px; list-style: none; }
.spec-list li { display: flex; gap: 7px; align-items: baseline; font-size: 12.5px; line-height: 1.45; }
.spec-k {
  flex: none; padding: 1px 6px; border-radius: 6px;
  border: 1.5px solid var(--ketchup); color: var(--ketchup);
  font-size: 11px; font-weight: 800; white-space: nowrap;
}
.spec-k.alt { border-color: var(--muted); color: var(--muted); }
.spec-more { margin-top: 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); }

.paper-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 14px; border-top: var(--dash); font-size: 12px;
}
.archivist { font-weight: 700; }
.archivist em { font-style: normal; color: var(--muted); font-weight: 500; }

.jjim-btn {
  flex: none; padding: 9px 14px; min-height: 40px;
  border: var(--border); border-radius: 999px; background: var(--white);
  font-family: inherit; font-size: 12.5px; font-weight: 800; color: var(--ink);
  cursor: pointer; transition: transform .08s, background .08s;
}
.jjim-btn:active { transform: translate(1px, 1px); }
.jjim-btn.on { background: var(--yolk); }

/* ----------------------- 빈 상태 · 로딩 자리 ----------------------- */

.empty { margin: 0 16px; padding: 22px 16px; text-align: center; }
.empty-title { font-size: 14px; font-weight: 800; }
.empty-sub { margin-top: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }

.card-skeleton { margin: 0 16px; height: 178px; background: #F1ECE3; }

/* -------------------------------- 탭바 -------------------------------- */

.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 420px; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--paper); border-top: var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 9px 0 8px; min-height: 56px;
  text-decoration: none; color: var(--muted); font-weight: 700;
}
.tab-icon { font-size: 17px; }
.tab-label { font-size: 11px; }
.tab.on { color: var(--ink); }
.tab.on .tab-label { font-weight: 800; }

/* -------------------------------- 토스트 -------------------------------- */

.toast-host {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  width: 100%; max-width: 420px; padding: 0 16px; z-index: 30;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 14px; border: var(--border); border-radius: 14px;
  background: var(--ink); color: var(--paper);
  font-size: 13px; font-weight: 700;
  pointer-events: auto;
  opacity: 0; transform: translateY(8px); transition: opacity .18s, transform .18s;
}
.toast.in { opacity: 1; transform: translateY(0); }
.toast-action {
  flex: none; padding: 7px 12px; min-height: 36px;
  border: 1.5px solid var(--paper); border-radius: 999px;
  background: transparent; color: var(--paper);
  font-family: inherit; font-size: 12px; font-weight: 800; cursor: pointer;
}

/* ============================ 학부 목록 화면 ============================ */

.page-head {
  padding: 16px 20px 16px;
  border-bottom: 4px solid var(--ink);   /* 학부 색상이 인라인으로 덮어쓴다 */
}
.back {
  display: inline-block; font-size: 12.5px; font-weight: 800;
  color: var(--muted); text-decoration: none; min-height: 0; padding: 4px 0;
}
.page-head-main { margin-top: 10px; }
.page-title { font-family: var(--font-display); font-size: 26px; font-weight: 400; margin-top: 8px; }
.page-sub { margin-top: 4px; font-size: 12.5px; color: var(--muted); font-weight: 500; }

.chips {
  display: flex; gap: 7px; padding: 14px 16px 0;
  overflow-x: auto; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 13px; min-height: 36px;
  border: var(--border-thin); border-radius: 999px;
  background: var(--white); color: var(--ink); text-decoration: none;
  font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center;
}
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.sort { display: flex; gap: 6px; padding: 12px 16px 4px; }
.sort-btn {
  flex: 1; padding: 9px 0; min-height: 38px;
  border: var(--border-thin); border-radius: 10px;
  background: var(--white); color: var(--muted);
  font-family: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer;
}
.sort-btn.on { background: var(--yolk); color: var(--ink); border: var(--border); }

.list, .list-slot { display: flex; flex-direction: column; gap: 9px; padding: 10px 16px 0; }
.row-spec-k {
  display: inline-block; margin-right: 4px; padding: 1px 5px;
  border: 1.5px solid var(--ketchup); border-radius: 5px;
  color: var(--ketchup); font-size: 10.5px; font-weight: 800;
}
.row-skeleton { height: 74px; background: #F1ECE3; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 14px; }

/* ============================== 논문 상세 ============================== */

.detail-top { padding: 14px 20px 0; }
.detail { padding-bottom: 24px; }
.detail-head { padding: 12px 20px 16px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.detail-tags .f-code { margin-bottom: 0; text-decoration: none; }
.tag-chip {
  padding: 3px 8px; border: var(--border-thin); border-radius: 6px;
  font-size: 10.5px; font-weight: 800;
}
.detail-title {
  margin-top: 12px; font-size: 23px; font-weight: 800;
  line-height: 1.28; letter-spacing: -0.3px;
}
.detail-summary { margin-top: 8px; font-size: 13px; color: var(--muted); font-weight: 500; line-height: 1.6; }

/* 크레딧 — 원작과 아카이버를 시각적으로 분리 */
.credits { margin: 0 16px; padding: 4px 14px; }
.credit { display: flex; gap: 10px; align-items: baseline; padding: 11px 0; }
.credit + .credit { border-top: var(--dash); }
.credit-k {
  flex: none; min-width: 52px; padding: 2px 7px; border-radius: 6px;
  background: var(--ink); color: var(--paper);
  font-size: 10.5px; font-weight: 800; text-align: center;
}
.credit-k.alt { background: transparent; color: var(--muted); border: 1.5px solid var(--muted); }
.credit-v { font-size: 13px; font-weight: 700; }
.credit-v em { font-style: normal; color: var(--muted); font-weight: 500; }
.credit-link { color: var(--soda); text-decoration: underline; }

.block { padding: 26px 16px 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.block-title { font-family: var(--font-display); font-size: 18px; font-weight: 400; padding-left: 4px; }
.block-meta { font-size: 12px; font-weight: 800; color: var(--muted); }
.block-note { margin-top: 6px; padding-left: 4px; font-size: 12.5px; color: var(--muted); font-weight: 500; }

/* 스펙 — 이유가 본문이다 */
.spec-detail { list-style: none; margin-top: 12px; display: flex; flex-direction: column; gap: 9px; }
.spec-item { padding: 13px 14px; }
.spec-item-head { display: flex; gap: 8px; align-items: center; }
.spec-badge {
  flex: none; padding: 2px 8px; border-radius: 6px;
  background: var(--ketchup); color: var(--white);
  font-size: 10.5px; font-weight: 800;
}
.spec-badge.opt { background: transparent; color: var(--muted); border: 1.5px solid var(--muted); }
.spec-name { font-size: 14.5px; font-weight: 800; }
.spec-reason { margin-top: 8px; font-size: 13px; line-height: 1.6; }

/* 준비물 — 스펙 뒤. 제품명이 앞에 선다 */
.buy-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.buy-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 14px; text-decoration: none; color: var(--ink);
}
.buy-name { font-size: 13.5px; font-weight: 800; }
.buy-go {
  flex: none; padding: 5px 11px; border: var(--border-thin); border-radius: 999px;
  font-size: 11.5px; font-weight: 800; color: var(--muted);
}

.steps { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; padding-left: 4px; }
.step { display: flex; gap: 11px; align-items: flex-start; }
.step-no {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  border: var(--border-thin); background: var(--yolk);
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 800;
}
.step-text { font-size: 13.5px; line-height: 1.6; }
.step-tip { margin-top: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }

/* 재현 인증 */
.repro-grid {
  margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px;
}
.repro-cell {
  padding: 0; border: var(--border-thin); border-radius: 10px; overflow: hidden;
  background: #F1ECE3; aspect-ratio: 1; cursor: pointer; min-height: 0;
}
.repro-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.repro-cta {
  display: block; margin-top: 14px; padding: 14px; text-align: center;
  background: var(--white); text-decoration: none; color: var(--ink);
  font-size: 13.5px; font-weight: 800;
}

.checked-at {
  margin: 26px 20px 0; padding-top: 14px; border-top: var(--dash);
  font-size: 11.5px; color: var(--muted); font-weight: 600;
}

/* 하단 고정 액션바 */
.actionbar-slot { height: 84px; }
.actionbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 420px; z-index: 20;
  display: flex; gap: 9px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--paper); border-top: var(--border);
}
.action-jjim {
  flex: 1; padding: 14px; min-height: 50px;
  border: var(--border); border-radius: var(--radius-field); background: var(--yolk);
  font-family: inherit; font-size: 14px; font-weight: 800; color: var(--ink); cursor: pointer;
  box-shadow: var(--shadow);
}
.action-jjim.on { background: var(--white); }
.action-share {
  flex: none; padding: 14px 18px; min-height: 50px;
  border-radius: var(--radius-field);
  font-family: inherit; font-size: 14px; font-weight: 800; color: var(--ink); cursor: pointer;
}

/* 인증샷 확대 */
.sheet {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: var(--ink);
}
.sheet-inner { width: 100%; max-width: 360px; padding: 14px; }
.sheet-img { width: 100%; border-radius: 10px; border: var(--border-thin); display: block; }
.sheet-meta { margin-top: 11px; font-size: 13px; font-weight: 800; }
.sheet-comment { margin-top: 7px; font-size: 13px; line-height: 1.6; }
.sheet-changed { margin-top: 7px; font-size: 12px; color: var(--ketchup); font-weight: 700; }
.sheet-actions { display: flex; gap: 8px; margin-top: 14px; }
.sheet-report, .sheet-close {
  flex: 1; padding: 11px; min-height: 44px;
  border: var(--border-thin); border-radius: 10px; background: var(--white);
  font-family: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer;
}
.sheet-report { color: var(--ketchup); border-color: var(--ketchup); }
