/* =========================================================
   LISIS — 연구실적 지식그래프 (professor.html)
   style.css 의 디자인 토큰(--ink, --line …)을 그대로 씁니다.
   ========================================================= */
.rg-section .section-head { margin-bottom: clamp(28px, 4vw, 44px); }

.rg-root {
  /* 키워드 종류별 색 — 세 가지뿐이며 종류에 고정됩니다 (필터를 바꿔도 색은 그대로) */
  --rg-sport:  #2a78d6;
  --rg-method: #eb6834;
  --rg-theme:  #1baf7a;
  --rg-work:   #8690a8;
  --rg-edge:   #c5ccdb;
  position: relative;
}

/* 번역기가 읽어 갈 수 있도록 문서 안에 두되 화면에는 보이지 않는 낱말 모음 */
.rg-vocab { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- 필터 (그래프 위 한 줄) ---------- */
.rg-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin-bottom: 18px; }
.rg-fgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rg-fgroup > .rg-flabel { font-size: .82rem; font-weight: 600; color: var(--muted); margin-right: 4px; }
.rg-fbtn {
  font-size: .86rem; line-height: 1; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--slate);
  transition: border-color .2s, color .2s, background .2s;
}
.rg-fbtn:hover { border-color: var(--ink); color: var(--ink); }
.rg-fbtn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- 카드 ---------- */
.rg-card {
  display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(300px, 1fr);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.rg-stage { min-width: 0; border-right: 1px solid var(--line); }

.rg-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  font-size: .84rem; color: var(--slate);
}
.rg-key { display: inline-flex; align-items: center; gap: 7px; }
.rg-key i, .rg-chip i, .rg-badge i, .rg-panel h4 i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.rg-key.work i { width: 7px; height: 7px; background: var(--rg-work); }
.k-sport i  { background: var(--rg-sport); }
.k-method i { background: var(--rg-method); }
.k-theme i  { background: var(--rg-theme); }
.rg-note { margin-left: auto; color: var(--muted); }

/* ---------- 그래프 ---------- */
.rg-canvas { position: relative; overflow: hidden; -webkit-user-select: none; user-select: none; }
.rg-svg { display: block; }

.rg-edge { stroke: var(--rg-edge); stroke-width: 1; opacity: .6; transition: opacity .2s; }
.rg-work { cursor: pointer; transition: opacity .2s; }
.rg-work .hit { fill: transparent; }
.rg-work .dot { fill: var(--rg-work); stroke: #fff; stroke-width: 1.5; }

/* 키워드는 HTML 단추입니다 (번역·키보드 조작이 되도록). 크기 0 인 기준점에서 원과 이름이 뻗어 나옵니다. */
.rg-nodes { position: absolute; inset: 0; pointer-events: none; }
.rg-concept {
  position: absolute; width: 0; height: 0; padding: 0; overflow: visible;
  pointer-events: none; transition: opacity .2s;
}
.rg-concept:focus-visible { outline: none; }
.rg-concept .node {
  position: absolute; left: calc(-1 * var(--r)); top: calc(-1 * var(--r));
  width: calc(2 * var(--r)); height: calc(2 * var(--r)); border-radius: 50%;
  box-shadow: 0 0 0 2px #fff; pointer-events: auto; cursor: pointer;
}
.rg-concept.k-sport .node  { background: var(--rg-sport); }
.rg-concept.k-method .node { background: var(--rg-method); }
.rg-concept.k-theme .node  { background: var(--rg-theme); }
.rg-concept.sel .node, .rg-concept:focus-visible .node { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.rg-concept .lbl {
  /* 이름표 자리는 전체 건수 기준(--r0)으로 고정 — 필터로 원이 작아져도 글자는 움직이지 않는다 */
  position: absolute; left: 0; top: calc(var(--r0) + 3px); transform: translateX(-50%);
  white-space: nowrap; pointer-events: auto; cursor: pointer;
  font-family: var(--f-body); font-size: 12.5px; line-height: 17px; font-weight: 600; letter-spacing: 0;
  color: var(--ink);
  text-shadow: 0 0 2px #fff, 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff,
               0 2px 0 #fff, 0 -2px 0 #fff, 2px 0 0 #fff, -2px 0 0 #fff;
}
.rg-concept .lbl .n { margin-left: 4px; font-weight: 500; color: var(--muted); }

/* 선택·호버 시: 관련 없는 것을 흐리게 */
.rg-canvas.is-focus .rg-edge { opacity: .1; }
.rg-canvas.is-focus .rg-edge.on { opacity: .9; stroke: #8a94ad; }
.rg-canvas.is-focus .rg-edge.pri { stroke: var(--ink-2); }
.rg-canvas.is-focus .rg-work { opacity: .16; }
.rg-canvas.is-focus .rg-work.on { opacity: 1; }
.rg-canvas.is-focus .rg-work.on .dot { fill: var(--ink); }
.rg-canvas.is-focus .rg-concept { opacity: .2; }
.rg-canvas.is-focus .rg-concept.on { opacity: 1; }
.rg-canvas .rg-work.sel .dot { fill: var(--ink); stroke: var(--ink); stroke-width: 3; }

/* 필터에서 빠진 것 */
.rg-canvas .rg-edge.off { display: none; }
.rg-canvas .rg-work.off { opacity: .1; pointer-events: none; }
.rg-canvas .rg-concept.off { opacity: .22; }

/* ---------- 툴팁 ---------- */
.rg-tip {
  display: none; position: absolute; z-index: 5; pointer-events: none;
  max-width: 290px; padding: 9px 12px; border-radius: 10px;
  background: var(--ink); color: #fff; font-size: .82rem; line-height: 1.45;
  box-shadow: var(--shadow);
}
.rg-tip .k { display: block; font-size: .72rem; color: rgba(255, 255, 255, .7); }
.rg-tip strong { display: block; font-weight: 600; }

/* ---------- 오른쪽 패널 ---------- */
.rg-panel { padding: 22px; max-height: var(--rg-h, 760px); overflow-y: auto; min-width: 0; }
.rg-panel h3 { font-family: var(--f-display); font-size: 1.22rem; line-height: 1.3; letter-spacing: -.01em; color: var(--ink); }
.rg-panel h3.rg-wtitle { font-family: var(--f-body); font-size: 1.02rem; line-height: 1.45; font-weight: 600; margin-top: 4px; }
.rg-panel h4 {
  display: flex; align-items: center; gap: 7px; margin: 20px 0 9px;
  font-size: .8rem; font-weight: 600; color: var(--muted);
}
.rg-panel h4 b { font-weight: 600; }
.rg-sum { margin-top: 6px; color: var(--slate); font-size: .93rem; }
.rg-sum b { color: var(--ink); font-family: var(--f-display); font-size: 1.5rem; font-weight: 600; margin-left: 4px; }
.rg-types { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: .86rem; color: var(--slate); }
.rg-types b { color: var(--ink); font-weight: 600; margin-left: 3px; }
.rg-hint { margin-top: 20px; font-size: .84rem; color: var(--muted); }
.rg-empty { margin-top: 14px; font-size: .9rem; color: var(--muted); }

.rg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rg-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  font-size: .84rem; line-height: 1.3; text-align: left;
  transition: border-color .2s, background .2s;
}
.rg-chip:hover { border-color: var(--ink); background: var(--bg-soft); }
.rg-chip b { font-weight: 600; color: var(--muted); }
.rg-chip.sm { padding: 2px 8px; font-size: .76rem; gap: 5px; }
.rg-chip.sm i { width: 7px; height: 7px; }

.rg-back { display: inline-flex; gap: 6px; font-size: .84rem; font-weight: 600; color: var(--blue); margin-bottom: 14px; }
.rg-back:hover { text-decoration: underline; }
.rg-badge { display: flex; align-items: center; gap: 7px; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }

.rg-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.rg-list li:first-child { border-top: 0; padding-top: 2px; }
.rg-meta { font-family: var(--f-display); font-size: .78rem; color: var(--muted); }
.rg-title { margin: 3px 0 7px; font-size: .93rem; line-height: 1.45; color: var(--ink); }
.rg-title a, .rg-link, .rg-table td a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.rg-link { display: inline-block; margin-top: 10px; font-size: .88rem; }

/* ---------- 전체 목록 (표) ---------- */
.rg-table { margin-top: 18px; }
.rg-table summary { cursor: pointer; font-weight: 600; font-size: .93rem; color: var(--blue); padding: 6px 0; }
.rg-table-wrap { margin-top: 10px; overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.rg-table table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.rg-table th, .rg-table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.rg-table tbody tr:last-child td { border-bottom: 0; }
.rg-table th { font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap; background: var(--bg-soft); }
.rg-table td:nth-child(1), .rg-table td:nth-child(2) { white-space: nowrap; color: var(--slate); font-variant-numeric: tabular-nums; }
.rg-table td:nth-child(3) { min-width: 280px; color: var(--ink); }
.rg-table td:nth-child(4) { color: var(--slate); min-width: 160px; }

.rg-source { margin-top: 14px; font-size: .82rem; color: var(--muted); }

/* ---------- 좁은 화면: 패널을 그래프 아래로 ---------- */
@media (max-width: 980px) {
  .rg-card { grid-template-columns: minmax(0, 1fr); }
  .rg-stage { border-right: 0; border-bottom: 1px solid var(--line); }
  .rg-panel { max-height: none; }
  .rg-note { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .rg-edge, .rg-work, .rg-concept, .rg-chip, .rg-fbtn { transition: none; }
}
