<script setup lang="ts">
defineProps<{ productName?: string; environment?: string; automationStatus?: string }>()
const appVersion = import.meta.env.VITE_APP_VERSION ?? '0.1.0'
</script>
<template>
  <div class="ks-shell">
    <a class="ks-skip" href="#ks-main">본문으로 건너뛰기</a>
    <header class="ks-shell__header">
      <div><strong>{{ productName ?? 'K-ArtSell Aegis' }}</strong><small>{{ environment ?? 'IMPLEMENTATION_TEMPLATE' }}</small></div>
      <div class="ks-shell__boundary" role="status">{{ automationStatus ?? '투자자문형 · 자동주문/KIS 제출 OFF · 자동 모델승격 OFF' }}</div>
      <slot name="header-actions" />
    </header>
    <aside class="ks-shell__nav" aria-label="주요 메뉴"><slot name="navigation" /></aside>
    <main id="ks-main" class="ks-shell__main" tabindex="-1"><slot /></main>
    <footer class="ks-shell__footer"><slot name="footer" /></footer>
  </div>
</template>
<style scoped>
.ks-shell { height: 100vh; display: grid; grid-template-columns: var(--ks-sidebar-width) minmax(0, 1fr); grid-template-rows: auto 1fr auto; grid-template-areas: 'header header' 'nav main' 'footer footer'; }
.ks-shell__header { grid-area: header; display: flex; align-items: center; justify-content: space-between; gap: var(--ks-space-4); padding: var(--ks-space-3) var(--ks-space-6); color: var(--ks-color-text-on-dark); background: var(--ks-color-neutral-950); }
.ks-shell__header > div:first-child { display: grid; } .ks-shell__header small { color: #cbd5e1; }
.ks-shell__boundary { padding: var(--ks-space-2) var(--ks-space-3); border: 1px solid #fbbf24; border-radius: var(--ks-radius-sm); color: #fef3c7; }
.ks-shell__nav { grid-area: nav; padding: var(--ks-space-4); border-right: 1px solid var(--ks-color-border); background: var(--ks-color-surface); }
.ks-shell__main { grid-area: main; min-width: 0; padding: var(--ks-space-6); }
.ks-skip { position: fixed; left: var(--ks-space-2); top: -4rem; z-index: 1000; padding: var(--ks-space-2); background: var(--ks-color-surface); } .ks-skip:focus { top: var(--ks-space-2); }
@media (max-width: 1100px) { .ks-shell { grid-template-columns: 1fr; grid-template-areas: 'header' 'nav' 'main' 'footer'; } .ks-shell__header { align-items: flex-start; flex-direction: column; } .ks-shell__nav { border-right: 0; border-bottom: 1px solid var(--ks-color-neutral-200); } }
</style>
