* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #0f172a;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: #38bdf8;
}

p.subtitle {
  font-size: 0.95rem;
  color: #94a3b8;
  margin-bottom: 24px;
}

/* 시뮬레이터 메인 컨테이너 */
.simulator-container {
  background-color: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* SVG 캔버스 */
svg {
  background-color: #090d16;
  border-radius: 8px;
  border: 1px solid #1e293b;
}

text {
  font-family: inherit;
  user-select: none;
}

/* SVG 요소 스타일링 */
.substrate {
  fill: #38bdf8;
  fill-opacity: 0.12;
  stroke: #38bdf8;
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}

.waveguide {
  stroke: #f43f5e;
  stroke-width: 5;
  fill: none;
  stroke-linecap: round;
}

.electrode {
  fill: #fbbf24;
  stroke: #f59e0b;
  stroke-width: 1.5;
}

.wave-sample {
  fill: none;
  stroke: #f43f5e;
  stroke-width: 2;
}

/* SVG 텍스트 스타일 */
.label-substrate {
  fill: #38bdf8;
  font-size: 12px;
  font-weight: 600;
}

.label-electrode {
  fill: #0f172a;
  font-size: 10px;
  font-weight: bold;
}

.label-wave {
  fill: #f43f5e;
  font-size: 11px;
}

.label-sub {
  fill: #94a3b8;
  font-size: 11px;
}

.label-sub-sm {
  fill: #94a3b8;
  font-size: 10px;
}

/* 범례 (Legend) */
.legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  background-color: #0f172a;
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid #334155;
  font-size: 0.85rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-box {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.box-waveguide { background-color: #f43f5e; }
.box-electrode { background-color: #fbbf24; }
.box-substrate { 
  background-color: rgba(56, 189, 248, 0.2); 
  border: 1px solid #38bdf8; 
}

/* 컨트롤 패널 */
.control-panel {
  width: 100%;
  max-width: 800px;
  background-color: #0f172a;
  border: 1px dashed #334155;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}