/* =====================================================================
 * AHA MEDI · GD WEB 심사용 히어로 모션그래픽 (gd/gdweb.css)
 * - page.php의 $ach_gd = true 일 때만 불러온다. false로 바꾸면 원래 사이트 그대로.
 * - 원래 히어로 이미지는 처음 화면부터 숨김 (JS를 기다리면 예전 이미지가 잠깐 보여서 2026-10-20 변경)
 * ===================================================================== */
html:not(.gd-off) { --gd-sky: #9DBBF2; --gd-blue: #2D5BC4; --gd-navy: #0A1B3D; --gd-ease: cubic-bezier(.22, 1, .36, 1); }

/* ---------- 02. 히어로 모션그래픽: 병원 관리 컨트롤룸 ---------- */
html:not(.gd-off) .ach-hero-media video, html:not(.gd-off) .ach-hero-media img, html:not(.gd-off) .ach-hero-media .ach-media { opacity: 0 !important; }
html:not(.gd-off) .ach-hero-media { background: radial-gradient(70% 80% at 72% 40%, #1E4BA8 0%, rgba(30, 75, 168, 0) 70%), radial-gradient(50% 60% at 15% 90%, #12357E 0%, rgba(18, 53, 126, 0) 70%), linear-gradient(160deg, #0D2557 0%, #0A1B3D 100%); }
.gd-stage { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.gd-net { position: absolute; inset: 0; width: 100%; height: 100%; }
.gd-floor { position: absolute; left: -20%; right: -20%; bottom: -10%; height: 55%; overflow: hidden; transform: perspective(700px) rotateX(68deg); transform-origin: 50% 100%; -webkit-mask: linear-gradient(0deg, #000 10%, transparent 85%); mask: linear-gradient(0deg, #000 10%, transparent 85%); }
.gd-floor::before { content: ''; position: absolute; left: 0; right: 0; top: -64px; bottom: 0; background-image: linear-gradient(rgba(157, 187, 242, .16) 1px, transparent 1px), linear-gradient(90deg, rgba(157, 187, 242, .16) 1px, transparent 1px); background-size: 64px 64px; will-change: transform; animation: gdFloor 6s linear infinite; }
@keyframes gdFloor { from { transform: translateY(0); } to { transform: translateY(64px); } }
.gd-scan { position: absolute; left: 0; right: 0; top: 0; height: 30%; background: linear-gradient(180deg, rgba(157, 187, 242, 0), rgba(157, 187, 242, .07), rgba(157, 187, 242, 0)); animation: gdScan 7s linear infinite; }
@keyframes gdScan { from { transform: translateY(-100%); } to { transform: translateY(400%); } }

.gd-box { position: absolute; width: 820px; height: 600px; right: 3.5%; top: 50%; transform-origin: 100% 50%; transform: translateY(-50%) scale(var(--gd-s, 1)); }
.gd-scene { position: absolute; inset: 0; perspective: 1600px; }
.gd-rig { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(calc(8deg + var(--gd-ry, 0) * 1deg)) rotateY(calc(-14deg + var(--gd-rx, 0) * 1deg)); transition: transform .1s linear; }
.gd-l { position: absolute; transform-style: preserve-3d; transform: translate3d(calc(var(--gd-mx, 0) * var(--d, 0) * 1px), calc(var(--gd-my, 0) * var(--d, 0) * 1px), calc(var(--z, 0) * 1px)); }
.gd-float { animation: gdBob 6s ease-in-out infinite; animation-delay: var(--bd, 0s); }
@keyframes gdBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.gd-glass { border-radius: 18px; background: linear-gradient(160deg, rgba(52, 96, 196, .62), rgba(13, 37, 87, .78)); box-shadow: inset 0 0 0 1px rgba(157, 187, 242, .28), 0 40px 80px -30px rgba(2, 8, 24, .7); color: #fff; font-family: 'Pretendard Variable', Pretendard, sans-serif; letter-spacing: -.01em; overflow: hidden; }
.gd-glass.is-white { background: rgba(255, 255, 255, .94); color: #0B1630; box-shadow: 0 40px 80px -30px rgba(2, 8, 24, .7); }

@media (min-width: 761px) {
  html:not(.gd-off) .ach-hero-shade { background: linear-gradient(90deg, rgba(10, 27, 61, .92) 0%, rgba(10, 27, 61, .6) 32%, rgba(10, 27, 61, 0) 54%), linear-gradient(0deg, rgba(10, 27, 61, .5) 0%, rgba(10, 27, 61, 0) 30%); }
}
/* 궤도 */
.gd-orbit { left: 0; top: 0; width: 820px; height: 600px; }
.gd-orbit-ring { position: absolute; left: 50%; top: 52%; width: 760px; height: 250px; margin: -125px 0 0 -380px; border-radius: 50%; border: 1px solid rgba(157, 187, 242, .26); }
.gd-orbit-ring.r2 { width: 600px; height: 190px; margin: -95px 0 0 -300px; border-style: dashed; border-color: rgba(157, 187, 242, .18); animation: gdSpin 40s linear infinite; }
@keyframes gdSpin { to { transform: rotate(360deg); } }
.gd-node { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 999px; background: rgba(13, 37, 87, .82); box-shadow: inset 0 0 0 1px rgba(157, 187, 242, .4); font: 600 15px/1 'Pretendard Variable', Pretendard, sans-serif; color: #E4ECFB; white-space: nowrap; will-change: transform, opacity; }
.gd-node i { width: 8px; height: 8px; border-radius: 50%; background: #9DBBF2; box-shadow: 0 0 0 4px rgba(157, 187, 242, .2); }

/* 메인 관리자 패널 */
.gd-main { left: 175px; top: 150px; width: 500px; height: 320px; }
.gd-main .gd-glass { width: 100%; height: 100%; display: flex; flex-direction: column; }
.gd-mh { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px; border-bottom: 1px solid rgba(157, 187, 242, .2); font-size: 14px; font-weight: 700; }
.gd-mh u { width: 9px; height: 9px; border-radius: 50%; background: rgba(157, 187, 242, .5); }
.gd-mh u + u { background: rgba(157, 187, 242, .35); } .gd-mh u + u + u { background: rgba(157, 187, 242, .22); margin-right: 8px; }
.gd-live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(91, 224, 162, .14); color: #8EF0C2; font-size: 11px; letter-spacing: .12em; }
.gd-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #5BE0A2; animation: gdPulse 1.6s ease-in-out infinite; }
@keyframes gdPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(91, 224, 162, .6); } 50% { box-shadow: 0 0 0 6px rgba(91, 224, 162, 0); } }
.gd-mb { flex: 1; display: flex; min-height: 0; }
.gd-side { position: relative; flex: none; width: 64px; padding: 14px 0; display: flex; flex-direction: column; align-items: center; gap: 12px; border-right: 1px solid rgba(157, 187, 242, .16); }
.gd-side b { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 9px; background: rgba(157, 187, 242, .14); }
.gd-side .gd-sel { position: absolute; left: 12px; top: 10px; width: 40px; height: 36px; border-radius: 11px; background: #2D5BC4; box-shadow: 0 10px 20px -8px rgba(45, 91, 196, .9); animation: gdSel 9s var(--gd-ease) infinite; }
@keyframes gdSel { 0%, 14% { transform: translateY(0); } 18%, 31% { transform: translateY(40px); } 35%, 48% { transform: translateY(80px); } 52%, 65% { transform: translateY(120px); } 69%, 82% { transform: translateY(160px); } 86%, 100% { transform: translateY(0); } }
.gd-mc { flex: 1; padding: 16px 20px; display: grid; grid-template-rows: auto 1fr; gap: 14px; min-width: 0; }
.gd-today { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.gd-today small { display: block; font-size: 12px; color: rgba(228, 236, 251, .7); }
.gd-today strong { display: block; margin-top: 4px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.gd-clock { font-size: 13px; font-weight: 600; color: #CFDDF8; font-variant-numeric: tabular-nums; }
.gd-track { grid-column: 1 / -1; height: 1px; background: rgba(157, 187, 242, .25); position: relative; }
.gd-track i { position: absolute; left: 0; top: -1px; height: 3px; border-radius: 2px; width: 62%; background: linear-gradient(90deg, #2D5BC4, #9DBBF2); animation: gdTrack 9s var(--gd-ease) infinite; }
@keyframes gdTrack { 0% { width: 8%; } 60% { width: 72%; } 100% { width: 8%; } }
.gd-widgets { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; min-height: 0; }
.gd-w { position: relative; padding: 12px 14px; border-radius: 12px; background: rgba(10, 27, 61, .35); box-shadow: inset 0 0 0 1px rgba(157, 187, 242, .14); min-height: 0; }
.gd-w > small { display: block; font-size: 12px; color: rgba(228, 236, 251, .72); }
.gd-bars { position: absolute; left: 14px; right: 14px; bottom: 12px; top: 36px; display: flex; align-items: flex-end; gap: 7px; }
.gd-bars i { flex: 1; height: var(--h, 40%); border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #9DBBF2, #2D5BC4); transition: height 1.1s var(--gd-ease); }
.gd-bars i:nth-child(odd) { background: linear-gradient(180deg, rgba(157, 187, 242, .7), rgba(45, 91, 196, .5)); }
.gd-line { position: absolute; left: 8px; right: 8px; bottom: 6px; top: 34px; width: calc(100% - 16px); height: calc(100% - 40px); overflow: visible; }
.gd-line path { fill: none; stroke: #9DBBF2; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: gdDraw 4.5s var(--gd-ease) infinite; }
.gd-line path.fill { stroke: none; fill: url(#gdLineFill); stroke-dasharray: none; animation: gdFade 4.5s ease infinite; }
.gd-line circle { fill: #fff; animation: gdFade 4.5s ease infinite; }
@keyframes gdDraw { 0% { stroke-dashoffset: 400; } 45%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -400; } }
@keyframes gdFade { 0%, 20% { opacity: 0; } 45%, 85% { opacity: 1; } 100% { opacity: 0; } }

/* 떠 있는 카드들 */
.gd-card { padding: 16px 18px; }
.gd-card-t { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.gd-card-t svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: #9DBBF2; }
.is-white .gd-card-t svg { color: #2D5BC4; }
.gd-c1 { left: 10px; top: 70px; width: 250px; }
.gd-c1 .gd-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.gd-chip { padding: 6px 12px; border-radius: 8px; background: #E7EDF8; color: #2D5BC4; font-size: 13px; font-weight: 700; }
.gd-tg { position: relative; width: 44px; height: 24px; border-radius: 999px; background: #C9D3E4; transition: background-color .3s; }
.gd-tg::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(10, 27, 61, .25); transition: transform .35s var(--gd-ease); }
.gd-c1.is-on .gd-tg { background: #2D5BC4; }
.gd-c1.is-on .gd-tg::after { transform: translateX(20px); }
.gd-ok { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; font-weight: 600; color: #4F5B74; opacity: 0; transform: translateY(4px); transition: opacity .35s, transform .35s var(--gd-ease); }
.gd-ok::before { content: ''; width: 14px; height: 14px; border-radius: 50%; background: #5BE0A2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A1B3D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 10px no-repeat; }
.gd-c1.is-on .gd-ok { opacity: 1; transform: none; }
.gd-c2 { left: 540px; top: 372px; width: 280px; }
.gd-ai-b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #6A9BF4, #2D5BC4); color: #fff; font-size: 10px; font-weight: 800; }
.gd-q { margin: 12px 0 0 auto; width: max-content; max-width: 90%; padding: 8px 12px; border-radius: 12px 12px 4px 12px; background: #2D5BC4; font-size: 13px; font-weight: 600; }
.gd-a { margin-top: 8px; min-height: 52px; padding: 9px 12px; border-radius: 12px 12px 12px 4px; background: rgba(255, 255, 255, .92); color: #0B1630; font-size: 13px; line-height: 1.5; }
.gd-a .gd-caret { display: inline-block; width: 1px; height: 13px; margin-left: 2px; vertical-align: -2px; background: #2D5BC4; animation: gdBlink .8s steps(1) infinite; }
@keyframes gdBlink { 50% { opacity: 0; } }
.gd-c3 { left: 0; top: 410px; width: 260px; }
.gd-fee { margin-top: 10px; display: grid; gap: 6px; }
.gd-fee div { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 8px; font-size: 13px; background: #F3F6FB; transition: background-color .4s, color .4s; }
.gd-fee div b { font-weight: 700; font-variant-numeric: tabular-nums; }
.gd-fee div.is-hl { background: #2D5BC4; color: #fff; }
.gd-toasts { left: 470px; top: -6px; width: 340px; height: 140px; }
.gd-toast { position: absolute; right: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: 11px 16px 11px 12px; border-radius: 14px; background: rgba(13, 37, 87, .9); box-shadow: inset 0 0 0 1px rgba(157, 187, 242, .3), 0 20px 40px -20px rgba(0, 0, 0, .6); font: 600 14px/1.3 'Pretendard Variable', Pretendard, sans-serif; color: #fff; white-space: nowrap; transition: transform .7s var(--gd-ease), opacity .7s; }
.gd-toast em { font-style: normal; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #2D5BC4; font-size: 12px; }
.gd-toast small { display: block; font-size: 11px; font-weight: 500; color: rgba(207, 221, 248, .75); }

/* ---------- 03. 히어로 슬로건 회전 ---------- */
html:not(.gd-off) .ach-hero-title .gd-rot { display: inline-block; transition: translate .5s var(--gd-ease), opacity .4s ease, filter .4s ease; }
html:not(.gd-off) .ach-hero-title .gd-rot.is-out { translate: 0 -.45em; opacity: 0; filter: blur(6px); }
html:not(.gd-off) .ach-hero-title .gd-rot.is-in { translate: 0 .45em; opacity: 0; filter: blur(6px); transition: none; }

/* ---------- 모바일: 관리자 화면(그래프) + 휴진 공지 · AI 챗봇 카드, 글자가 읽히는 크기 ---------- */
@media (max-width: 760px) {
  .gd-box { width: 440px; height: 392px; right: auto; left: 50%; top: auto; bottom: clamp(14px, calc(100% - 680px), 32px); transform-origin: 50% 100%; transform: translateX(-50%) scale(var(--gd-s, .8)); }
  .gd-scene { perspective: none; }
  .gd-rig, .gd-l { transform: none !important; }
  .gd-orbit, .gd-c3, .gd-toasts, .gd-floor, .gd-scan { display: none; }
  .gd-main { left: 0; top: 66px; width: 440px; height: 214px; }
  .gd-mh { font-size: 15px; }
  .gd-today small, .gd-w > small { font-size: 13px; }
  .gd-c1 { left: 236px; top: 0; width: 204px; }
  .gd-c1 .gd-ok { display: none; }
  .gd-c2 { left: 224px; top: 206px; width: 216px; }
  .gd-card { padding: 14px 16px; }
  .gd-card-t { font-size: 16px; }
  .gd-card-t svg { width: 19px; height: 19px; }
  .gd-chip { font-size: 14px; }
  .gd-q, .gd-a { font-size: 14px; }
  .gd-a { min-height: 44px; }
  .gd-ai-b { width: 24px; height: 24px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .gd-floor::before, .gd-scan, .gd-float, .gd-orbit-ring.r2, .gd-side .gd-sel, .gd-track i, .gd-line path, .gd-line circle { animation: none !important; }
  .gd-line path { stroke-dashoffset: 0; }
}
