/* 참여자 홈페이지 틀(site) — 3차 목업의 mobile_web 틀 (ADR 0003·0004, W-27 의 참여자 틀).
   관리자 틀(shell.css)과 같은 팔레트를 쓴다. 모바일 기준 한 단이고, 넓은 화면에서는 가운데 정렬한다. */
:root {
  --site-primary: #1f3b63;
  --site-primary-soft: #e8eef7;
  --site-ink: #202b3b;
  --site-muted: #596779;
  --site-line: #dce2ea;
  --site-bg: #f4f6f9;
  --site-paper: #ffffff;
  --site-danger: #b42318;
  --site-danger-soft: #fdecea;
  --site-col: 560px;
  --site-tab-h: 64px;
}
* { box-sizing: border-box; }
body.site-body {
  margin: 0; min-height: 100vh; background: var(--site-bg); color: var(--site-ink);
  font-family: 'Pretendard', 'Noto Sans KR', system-ui, -apple-system, sans-serif; font-size: 15px; line-height: 1.55;
  word-break: keep-all; overflow-wrap: anywhere;
  padding-bottom: calc(var(--site-tab-h) + env(safe-area-inset-bottom));
}
.site-col { max-width: var(--site-col); margin: 0 auto; padding: 0 16px; }

/* 상단바 */
.site-top { background: var(--site-paper); border-bottom: 1px solid var(--site-line); }
.site-top .site-col { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.site-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--site-ink); min-width: 0; }
.site-brand-mark {
  flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--site-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px;
}
.site-brand-name { font-size: 13px; font-weight: 700; color: var(--site-primary); line-height: 1.3; word-break: keep-all; }
/* 로그인 체계가 둘이라(ADR 0003) 참여자 화면임을 상단에 표시한다 */
.site-kind { flex: none; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--site-primary-soft); color: var(--site-primary); }

/* 본문 */
.site-main { padding: 24px 0 32px; }
.site-title { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.site-lead { margin: 0 0 20px; color: var(--site-muted); font-size: 14px; }
.site-lead a, .site-dl a { color: var(--site-primary); }
.site-card { background: var(--site-paper); border: 1px solid var(--site-line); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.site-card h2 { font-size: 17px; margin: 0 0 14px; }
.site-card h2:not(:first-child) { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--site-line, #e3e8ee); }
.site-card h3 { font-size: 15px; margin: 16px 0 6px; }
.site-card h3 .site-help { display: block; font-weight: 400; margin-top: 2px; }
.site-notice { border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; background: var(--site-primary-soft); border: 1px solid #c9d6ea; font-size: 14px; }
.site-notice strong { display: block; margin-bottom: 4px; }
.site-notice ul { margin: 0; padding-left: 18px; }
.site-notice.is-danger { background: var(--site-danger-soft); border-color: #f4c7c3; color: var(--site-danger); }
.site-notice.is-ok { background: #e7f4ec; border-color: #b9dfc6; color: #17603a; }

/* 표 (동의 이력 등). 좁은 화면에서는 표만 가로로 밀린다 */
.site-table-wrap { overflow-x: auto; }
.site-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.site-table th, .site-table td { padding: 8px 6px; border-top: 1px solid var(--site-line); text-align: left; white-space: nowrap; }
.site-table th { color: var(--site-muted); font-weight: 600; border-top: 0; }

/* 입력 */
.site-field { margin-bottom: 16px; }
.site-field label, .site-field .site-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.site-field .site-req { color: var(--site-danger); margin-left: 2px; }
.site-input {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--site-line); border-radius: 8px;
  font: inherit; color: inherit; background: #fff;
}
.site-input:focus { outline: 2px solid var(--site-primary-soft); border-color: var(--site-primary); }
.site-help { margin-top: 6px; font-size: 12px; color: var(--site-muted); }
.site-choice { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.site-choice label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.site-readonly { font-size: 14px; }

/* 버튼 */
.site-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 18px; border-radius: 8px;
  font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid var(--site-line); background: var(--site-paper); color: var(--site-ink);
}
.site-btn.is-primary { background: var(--site-primary); border-color: var(--site-primary); color: #fff; }
.site-btn.is-block { width: 100%; }
.site-btn.is-planned { color: var(--site-muted); cursor: default; opacity: .6; }
.site-btn.is-danger { color: var(--site-danger); border-color: #f4c7c3; }
.site-links { display: flex; flex-wrap: wrap; gap: 8px; }
.site-links .site-btn { flex: 1 1 auto; height: 40px; font-size: 13px; }

/* 단계 표시 */
.site-steps { display: flex; flex-wrap: wrap; gap: 10px 16px; list-style: none; margin: 0; padding: 0; }
.site-steps li { flex: 0 1 auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--site-muted); }
.site-steps .site-step-no {
  flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--site-bg);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
.site-steps .is-current { color: var(--site-ink); font-weight: 600; }
.site-steps .is-current .site-step-no { background: var(--site-primary); color: #fff; }
.site-steps .is-done .site-step-no { background: var(--site-primary-soft); color: var(--site-primary); }

/* 정의 목록 */
.site-dl { margin: 0; }
.site-dl > div { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--site-line); font-size: 14px; }
.site-dl > div:first-child { border-top: 0; }
.site-dl dt { flex: 0 0 42%; color: var(--site-muted); }
.site-dl dd { margin: 0; }

/* 하단 탭 */
.site-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--site-paper); border-top: 1px solid var(--site-line);
  padding-bottom: env(safe-area-inset-bottom);
}
.site-tabs ul { display: flex; max-width: var(--site-col); margin: 0 auto; padding: 0; list-style: none; height: var(--site-tab-h); }
.site-tabs li { flex: 1; }
.site-tab {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; color: var(--site-muted); text-decoration: none;
}
.site-tab svg { width: 20px; height: 20px; }
.site-tab.is-active { color: var(--site-primary); font-weight: 600; }
.site-tab.is-planned { opacity: .45; cursor: default; }

.site-foot { padding: 8px 0 24px; font-size: 12px; color: var(--site-muted); }
.site-foot a { color: inherit; }

/* 게시글 목록(공지·소식 SCR-U02, 홈 SCR-U01): 한 줄에 구분 배지·제목, 아래 줄에 게시일·작성자 */
.site-posts { list-style: none; margin: 0; padding: 0; }
.site-posts li { border-top: 1px solid var(--site-line); }
.site-posts li:first-child { border-top: 0; }
.site-posts a { display: block; padding: 12px 0; text-decoration: none; color: var(--site-ink); }
.site-posts a:hover .site-post-title { text-decoration: underline; }
.site-post-title { font-size: 15px; font-weight: 600; }
.site-post-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 12px; color: var(--site-muted); }
.site-post-go { color: var(--site-primary); font-weight: 600; }
.site-badge { display: inline-block; padding: 1px 7px; margin-right: 6px; border-radius: 4px; font-size: 11px; font-weight: 600; vertical-align: 2px;
  background: var(--site-primary-soft); color: var(--site-primary); }
.site-badge.is-pin { background: var(--site-primary); color: #fff; }
.site-search { display: flex; flex-wrap: wrap; gap: 8px; }
.site-search .site-input { flex: 1 1 140px; width: auto; }
.site-search .site-btn { flex: none; }
.site-pager { display: flex; justify-content: center; gap: 4px; margin: 12px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.site-pager a, .site-pager span { padding: 0 8px; min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px;
  font-size: 13px; color: var(--site-ink); text-decoration: none; }
.site-pager .is-current { background: var(--site-primary); color: #fff; font-weight: 600; }
.site-pager .is-disabled { color: var(--site-line); }
.site-card .site-article-head h2 { border-top: 0; padding-top: 0; margin-top: 6px; }
.site-article-head h1, .site-article-head h2 { font-size: 19px; line-height: 1.4; margin: 6px 0 8px; }
.site-files { list-style: none; margin: 0; padding: 0; }
.site-files li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--site-line); font-size: 14px; }
.site-files li:first-child { border-top: 0; }
.site-files span { flex: 1; min-width: 0; word-break: break-all; }
.site-files small { color: var(--site-muted); }
/* 산공과제 제출서식 칸: 서식 이름 아래에 파일 칸 */
.site-slots li { display: block; }
.site-slots label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
input[type="file"] { max-width: 100%; }

/* 성과 공유 홈(SCR-U01): 지표 2열 격자, 우수사례 카드 */
.site-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0; padding: 0; list-style: none; }
.site-kpis li { background: var(--site-bg); border-radius: 8px; padding: 12px; }
.site-kpis span { display: block; font-size: 12px; color: var(--site-muted); }
.site-kpis b { display: block; font-size: 20px; color: var(--site-primary); margin-top: 2px; }
.site-kpis small { display: block; font-size: 11px; color: var(--site-muted); margin-top: 2px; }
.site-case { border-top: 1px solid var(--site-line); padding: 12px 0; }
.site-case:first-of-type { border-top: 0; padding-top: 0; }
.site-case h3 { font-size: 15px; margin: 0 0 4px; }
.site-case p { margin: 6px 0 0; font-size: 14px; }

/* 상단 가로 메뉴(넓은 화면 전용, site-tabbar mode 'top') — 좁은 화면에서는 하단 탭을 쓴다 */
.site-nav { display: none; }
.site-brand-full { display: none; }

/* 화면설계서 와이어프레임의 12칸 행 (tools/design-docs/wireframe/layouts.py 의 rows).
   좁은 화면에서는 칸이 위아래로 쌓이고, 넓은 화면에서는 c-N(12칸 중 N칸)으로 나란히 놓인다 */
.site-row > * { margin-bottom: 16px; }
.site-stack { display: flex; flex-direction: column; gap: 16px; }
/* 신청서 제출 칸: 좁은 화면에서는 맨 아래, 넓은 화면에서는 오른쪽 위에 붙는다(SCR-U05 ③ 「고정」) */
.site-stack > .site-submit { order: 99; }
.site-form2 > [data-types]:not([hidden]) { display: contents; }
.site-row .site-card, .site-stack .site-card { margin-bottom: 0; }
.site-row > .site-stack { margin-bottom: 16px; }

/* 반응형 표: 넓은 화면은 한 줄 한 건의 표, 좁은 화면은 한 건이 「항목: 값」 카드(td 의 data-label) */
.site-rtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.site-rtable th, .site-rtable td { padding: 10px 8px; border-top: 1px solid var(--site-line); text-align: left; vertical-align: middle; }
.site-rtable th { color: var(--site-muted); font-weight: 600; font-size: 13px; border-top: 0; background: var(--site-bg); white-space: nowrap; }
.site-rtable td.is-num, .site-rtable th.is-num { white-space: nowrap; }
.site-rtable td.is-act { text-align: right; white-space: nowrap; }
.site-rtable td.is-act .site-btn { height: 34px; padding: 0 12px; font-size: 13px; }
.site-rtable a.site-rtable-title { color: var(--site-ink); font-weight: 600; text-decoration: none; }
.site-rtable a.site-rtable-title:hover { text-decoration: underline; }
.site-rtable .is-empty td { color: var(--site-muted); text-align: center; padding: 20px 8px; }
@media (max-width: 1023px) {
  .site-rtable thead { display: none; }
  .site-rtable, .site-rtable tbody, .site-rtable tr, .site-rtable td { display: block; width: 100%; }
  .site-rtable tr { border-top: 1px solid var(--site-line); padding: 10px 0; }
  .site-rtable tr:first-child { border-top: 0; padding-top: 0; }
  .site-rtable td, .site-rtable td.is-num { display: flex; gap: 12px; border: 0; padding: 3px 0; font-size: 14px; white-space: normal; min-width: 0; }
  .site-rtable td > * { min-width: 0; }
  .site-rtable td::before { content: attr(data-label); flex: 0 0 38%; color: var(--site-muted); font-size: 13px; }
  .site-rtable td.is-act { text-align: left; padding-top: 8px; }
  .site-rtable td.is-act::before { content: none; }
  .site-rtable .is-empty td::before { content: none; }
}

/* 상태 배지(접수 중·마감·승인·반려 등) */
.site-badge.is-ok { background: #e7f4ec; color: #17603a; }
.site-badge.is-muted { background: var(--site-bg); color: var(--site-muted); }
.site-badge.is-danger { background: var(--site-danger-soft); color: var(--site-danger); }

/* 로그인 화면 탭(참여자 / 교수·학생·관리자) */
.site-segtabs { display: flex; margin-bottom: 16px; border: 1px solid var(--site-line); border-radius: 10px; background: var(--site-paper); padding: 4px; gap: 4px; }
.site-segtabs a { flex: 1; text-align: center; padding: 10px 8px; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--site-muted); text-decoration: none; }
.site-segtabs a.is-active { background: var(--site-primary); color: #fff; }

/* 글자 링크 묶음(로그인 보조 링크 등) */
.site-textlinks { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.site-textlinks a { color: var(--site-primary); }

/* ───────── 넓은 화면(PC) — COR-003·아-5 반응형. 배치는 화면설계서 PC 와이어프레임(인쇄 6~48쪽)을 따른다
   - 본문은 1120px 전체 폭. 로그인·비밀번호 재설정만 가운데 좁은 칸(narrow)
   - 하단 탭 대신 오른쪽 정렬 상단 메뉴, 로그인 입구는 참여자 / 교수·학생·관리자로 나눈다(ADR 0003, 사용자 결정 11/03)
   - 푸터는 위 구분선 + 왼쪽 기관명 · 오른쪽 링크 */
@media (min-width: 1024px) {
  :root { --site-col: 1120px; }
  body.site-body { padding-bottom: 0; }
  .site-tabs { display: none; }

  .site-top .site-col { height: 68px; gap: 24px; }
  .site-brand-mark { width: 36px; height: 36px; font-size: 12px; }
  .site-brand-name { display: none; }
  .site-brand-full { display: block; font-size: 15px; font-weight: 700; color: var(--site-primary); white-space: nowrap; }
  .site-kind { display: none; }
  .site-nav { display: flex; align-items: center; justify-content: flex-end; flex: 1; gap: 20px; min-width: 0; }
  .site-nav ul { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
  .site-nav ul a { display: block; padding: 22px 10px; font-size: 15px; font-weight: 600; color: var(--site-muted); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
  .site-nav ul a:hover { color: var(--site-ink); }
  .site-nav ul a.is-active { color: var(--site-primary); border-bottom-color: var(--site-primary); }
  .site-nav-login { display: flex; gap: 8px; flex: none; }
  .site-nav-login .site-btn { height: 36px; padding: 0 12px; font-size: 13px; white-space: nowrap; }

  .site-main { padding: 32px 0 48px; }
  .site-main.is-narrow > .site-col { max-width: 560px; }
  .site-title { font-size: 26px; }
  .site-card { padding: 22px 24px; }
  .site-dl dt { flex-basis: 34%; }

  .site-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
  .site-row > * { margin-bottom: 0; grid-column: span 12; }
  .site-row > .c-3 { grid-column: span 3; }
  .site-row > .c-4 { grid-column: span 4; }
  .site-row > .c-5 { grid-column: span 5; }
  .site-row > .c-6 { grid-column: span 6; }
  .site-row > .c-7 { grid-column: span 7; }
  .site-row > .c-8 { grid-column: span 8; }
  .site-row > .c-9 { grid-column: span 9; }
  .site-row > .c-skip-4 { grid-column: 5 / span 8; }
  .site-row > .c-skip-8 { grid-column: 9 / span 4; }
  .site-row > .site-stack { margin-bottom: 0; }
  .site-stack > .site-submit { order: 0; position: sticky; top: 16px; z-index: 5; }
  .site-form2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .site-form2 > .is-wide { grid-column: 1 / -1; }

  /* 홈: 성과지표 4칸 가로 카드 */
  .site-kpis.is-4 { grid-template-columns: repeat(4, 1fr); }
  .site-kpis.is-4 b { font-size: 24px; }
  .site-cases { display: grid; gap: 12px; }

  .site-foot { border-top: 1px solid var(--site-line); padding: 16px 0 32px; }
  .site-foot .site-col { display: flex; justify-content: space-between; gap: 16px; }
}

/* 비밀번호 조건 목록 (교수·학생 비밀번호 재설정·변경·회원가입) — 충족하면 is-ok */
.site-checks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; font-size: 12px; color: var(--site-muted); }
.site-checks li::before { content: "○"; margin-right: 6px; }
.site-checks li.is-ok { color: #17603a; }
.site-checks li.is-ok::before { content: "●"; }
.site-field-err { margin-top: 6px; font-size: 12px; color: var(--site-danger); }
.site-card details > summary { cursor: pointer; color: var(--site-primary); font-size: 14px; font-weight: 500; }
.site-card details[open] > summary { margin-bottom: 8px; }
.site-card details p { margin: 0 0 8px; line-height: 1.6; }
.site-card h2 + .site-field, .site-card h2 + details { margin-top: 0; }
.site-card .site-field + h2 { margin-top: 24px; }
.site-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 홈 대표 영역·성과지표 띠 (SCR-U01, 사용자 결정 11/03 — 사업 안내 카드 대신) */
.site-hero { background: var(--site-primary); color: #fff; border-radius: 14px; padding: 24px 20px; margin-bottom: 16px; }
.site-hero-kicker { margin: 0 0 6px; font-size: 13px; opacity: .8; }
.site-hero-title { margin: 0; font-size: 22px; line-height: 1.35; font-weight: 700; word-break: keep-all; }
.site-hero-lead { margin: 10px 0 0; font-size: 14px; line-height: 1.6; opacity: .9; word-break: keep-all; }
.site-hero-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.site-hero-act .site-btn { flex: 1 1 120px; background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.site-hero-act .site-btn.is-primary { background: #fff; border-color: #fff; color: var(--site-primary); }
.site-kpi-band .site-kpis b { font-size: 24px; }
.site-h2 { font-size: 18px; margin: 24px 0 12px; }
@media (min-width: 1024px) {
  .site-hero { padding: 40px 44px; }
  .site-hero-title { font-size: 30px; }
  .site-hero-lead { font-size: 15px; max-width: 720px; }
  .site-hero-act .site-btn { flex: none; min-width: 140px; height: 46px; font-size: 15px; }
  .site-kpi-band .site-kpis b { font-size: 30px; }
}

/* 처리방침 등 문서형 카드 (SCR-U12) */
.site-doc h3 { font-size: 15px; margin: 18px 0 8px; }
.site-doc p, .site-doc li { font-size: 14px; line-height: 1.7; }
.site-doc ul { margin: 0; padding-left: 20px; }
.site-doc .site-table-wrap { margin: 4px 0 8px; }
.site-todo { display: inline-block; padding: 0 6px; border-radius: 4px; background: #fff4d6; color: #7a5300; font-size: 12px; font-weight: 600; line-height: 1.7; }
.site-doc .site-table th, .site-doc .site-table td { white-space: normal; vertical-align: top; }
