/* ═══════════════════════════════════════════════════════════════
   workspace.css — 작업 공간형 화면 공통 (모의강화·도구모음, 2026-10-09)
   두 화면이 "= enc-…"로 서로 베껴 쓰던 같은 틀을 한 벌로: 머리말 서버 선택(.ws-server) · 작업 공간(.ws)
   · 좌우 분할(.ws-split: 목록 .ws-left / 패널 .ws-right) · 선택 목록(.ws-selector·.ws-search·.ws-item)
   · 패널(.ws-panel·.ws-setup·.ws-action·.ws-card-*) · 수량 버튼(.ws-qty-btn) · 실행 버튼(.ws-go)
   · 좁은 화면 요약 바(.ws-mobile-bar) · 리포트 카드(.ws-report-*). 992px 이하에서 세로로 쌓이고 목록은 접힌다.
   화면 CSS(enchant.css·tools.css)가 이 파일 뒤에 온다 — 화면만의 차이는 거기서 덮는다.
   ═══════════════════════════════════════════════════════════════ */

.ws {
  width: 100%;
  box-sizing: border-box;
  padding: 20px var(--page-pad-x);   /* 머리말·안내 띠와 같은 좌우 선 */
}
.ws-split {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  height: var(--ws-split-height, 650px);   /* 화면이 :root에서 바꾼다 (모의강화 700px) */
}
.ws-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  overflow: hidden;
}

.ws-head-controls {
  display: flex;
  align-items: center;
}

.ws-server {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-elevated);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-secondary);
}

.ws-server label {
  font-size: var(--fs-13);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ws-select {
  background-color: transparent;
  color: var(--text-primary);
  border: none;
  font-family: var(--font-ui);
  font-size: var(--fs-14);
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.ws-server-rate {
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  color: var(--color-up);
  font-weight: 600;
}

.ws-selector {
  background: var(--bg-surface);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.ws-search {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-secondary);
  gap: 10px;
}

.ws-search i {
  color: var(--text-muted);
}

.ws-item-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.ws-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px;
  gap: 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.ws-item:hover {
  background: var(--bg-hover);
}

.ws-item.active {
  background: var(--color-accent-bg);
  border-color: var(--color-accent);
}

.ws-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ws-item-name {
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.ws-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.ws-setup {
  flex: 0 0 auto;
}

.ws-action {
  flex: 1 1 0;
  position: relative;
  border-top: 1px solid var(--border-secondary);
  min-height: 0;
}

.ws-card-top {
  display: flex;
  align-items: center;
  gap: 24px;
}

.ws-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ws-card-name {
  font-size: var(--fs-24);
  font-weight: 700;
  color: var(--text-primary);
}

.ws-card-specs {
  font-size: var(--fs-14);
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.ws-card-cat {
  font-size: var(--fs-13);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-qty-btn {
  flex: 1;
  padding: 14px 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: var(--fs-13);
  font-weight: 600;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ws-qty-btn:hover {
  color: var(--text-secondary);
  background: var(--overlay-a02);
}

.ws-qty-btn.active {
  background: var(--color-accent-a10);
  color: var(--color-accent);
}

.ws-qty-divider {
  width: 1px;
  height: 24px;
  background: var(--border-secondary);
}

.ws-go::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--overlay-a15), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.ws-search:focus-within { box-shadow: inset 0 -2px 0 var(--color-accent); }   /* 입력의 outline을 없앤 대신 초점 표시 */
.ws-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--fs-14);
}
.ws-search input::placeholder { color: var(--text-muted); }

.ws-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-11);
  color: var(--text-muted);
}
.ws-item.active .ws-item-meta { color: var(--text-secondary); }   /* 선택된 카드(강조 배경) 위 — muted는 대비 4.4 */

.ws-card-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  padding: 8px;
  background: var(--bg-body);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg);
}
.ws-card-img img { width: 100%; height: 100%; object-fit: contain; }
.ws-card-img i { font-size: var(--fs-36); color: var(--color-accent); }

.ws-go {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: auto;
  padding: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent));
  color: #000;
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--glow-accent-sm);
  font-size: var(--fs-16);
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(.4, 0, .2, 1);
}
.ws-go:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--glow-accent); }
.ws-go:hover:not(:disabled)::before { opacity: 1; }
.ws-go:active:not(:disabled) { transform: translateY(0); box-shadow: var(--glow-accent-sm); }

.ws-mobile-bar { display: none; }

/* ── 992px 이하: 목록 위·패널 아래로 쌓고, 목록은 고른 뒤 접는다 (요약 바의 '변경'으로 펼침) ── */
@media (max-width: 992px) {
  .ws-split { grid-template-columns: minmax(0, 1fr); gap: 12px; height: auto; }
  .ws-left { gap: 12px; height: auto; overflow: visible; }
  .ws-right,
  .ws-panel { height: auto; }
  .ws-action { flex: 0 0 auto; min-height: auto; }
  .ws-selector {
    height: auto;
    max-height: 50vh;
    position: static;
    border-bottom: 1px solid var(--border-secondary);
  }
  .ws-selector.collapsed {
    max-height: 0;
    overflow: hidden;
    border: none;
    padding: 0;
    transition: max-height 0.3s ease;
  }
  .ws-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    cursor: pointer;
  }
  .ws-mobile-bar__info { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .ws-mobile-bar__info img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    background: var(--bg-body);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-sm);
  }
  .ws-mobile-bar__name { font-size: var(--fs-14); font-weight: 600; color: var(--text-primary); }
  .ws-mobile-bar__meta { font-size: var(--fs-11); color: var(--text-muted); }
  .ws-mobile-bar__change {
    flex-shrink: 0;
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--color-accent-a10);
    color: var(--color-accent);
    font-size: var(--fs-12);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
  }
}
/* 좁은 화면에서 접은 뒤 넓혀도 목록·요약 바가 원래대로 (모의강화 요약 바는 JS가 style로 연다) */
@media (min-width: 993px) {
  .ws-mobile-bar { display: none !important; }
  .ws-selector.collapsed { max-height: none !important; overflow: hidden !important; border: 1px solid var(--border-secondary) !important; }
}

@media (max-width: 600px) {
  .ws-head-controls { width: 100%; }
  .ws-server { width: 100%; justify-content: space-between; }
  .ws-card-img i { font-size: var(--fs-22); }
  .ws-qty-btn { padding: 12px 0; font-size: var(--fs-12); }
  .ws-go { padding: 14px; font-size: var(--fs-15); }

  .ws {
    padding: 12px var(--page-pad-x);
  }
  .ws-card-top {
    gap: 12px;
  }
  .ws-card-img {
    width: 48px;
    height: 48px;
    padding: 4px;
  }
  .ws-card-name {
    font-size: var(--fs-16);
  }
  .ws-card-specs {
    font-size: var(--fs-12);
  }
  .ws-card-cat {
    font-size: var(--fs-11);
  }
}


/* ═══ 리포트 카드 — 결과를 이미지로 저장하는 영수증 (.ws-report, 2026-10-09 두 화면 통합) ═══ */
.ws-report {
  background: var(--bg-surface);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-xl);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.ws-report-brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--overlay-a10);
}

.ws-report-export {
  background: var(--color-up-a10);
  color: var(--color-up);
  border: 1px solid var(--color-up-a30);
  padding: 8px 16px;
  border-radius: var(--radius-lg);
  font-size: var(--fs-13);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.ws-report-export:hover {
  background: var(--color-up-a20);
  transform: translateY(-1px);
}

.ws-report-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.ws-report-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ws-report-meta {
  font-size: var(--fs-13);
  color: var(--text-muted);
}

.ws-report-stats {
  display: flex;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  gap: 12px;
  margin-bottom: 24px;
}

.ws-report-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  background: var(--overlay-a02);
  border-radius: var(--radius-lg);
  border: 1px solid var(--overlay-a06);
}

.ws-report-label {
  font-size: var(--fs-12);
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ws-report-val.success {
  color: var(--color-up);
}

.ws-report-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--overlay-a10);
}

.ws-report-title {
  font-size: var(--fs-14);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ws-report-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
  font-size: var(--fs-13);
  color: var(--text-secondary);
}

.ws-report-result {
  margin-top: 12px;
  padding: 12px;
  background: var(--overlay-a02);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: var(--fs-13);
  font-weight: 700;
}

.ws-report-footer {
  text-align: center;
  font-size: var(--fs-12);
  color: var(--text-secondary);
  font-weight: 600;
  font-family: var(--font-mono);
  padding-top: 12px;
}

@media (max-width: 600px) {
  .ws-report-val {
    font-size: var(--fs-16);
  }
}

.ws-report-header { margin-bottom: 24px; }
.ws-report-brand-title { font-size: var(--fs-14); font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); }
.ws-report-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: var(--scrim-a40);
  border: 1px solid var(--overlay-a10);
  border-radius: var(--radius-lg);
}
.ws-report-name { font-size: var(--fs-18); font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); }
.ws-report-time {
  display: flex;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  background: var(--overlay-a02);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--text-muted);
}
.ws-report-val { font-family: var(--font-mono); font-size: var(--fs-18); font-weight: 700; color: var(--text-primary); }
.ws-report-val.maintain,
.ws-report-val.accent { color: var(--color-accent); }
.ws-report-val.destroy,
.ws-report-val.danger { color: var(--color-down); }
.ws-report-row strong,
.ws-report-num { font-family: var(--font-mono); color: var(--text-primary); }
.ws-report-row.is-spaced { margin-top: 6px; }

@media (max-width: 600px) {
  .ws-report { padding: 16px; border-radius: var(--radius-xl); }
  .ws-report-brand { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 14px; padding-bottom: 12px; }
  .ws-report-brand-title { font-size: var(--fs-12); }
  .ws-report-export { padding: 6px 10px; font-size: var(--fs-11); }
  .ws-report-header { margin-bottom: 16px; }
  .ws-report-profile { gap: 12px; margin-bottom: 12px; }
  .ws-report-img { width: 44px; height: 44px; }
  .ws-report-name { font-size: var(--fs-16); }
  .ws-report-meta { font-size: var(--fs-12); }
  .ws-report-time { flex-direction: column; gap: 4px; padding: 6px 10px; font-size: var(--fs-11); }
  .ws-report-stats { flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
  .ws-report-stat { flex: 1 1 calc(50% - 6px); min-width: calc(50% - 6px); padding: 8px; }
  .ws-report-label { font-size: var(--fs-11); }
  .ws-report-section { margin-bottom: 16px; padding-bottom: 16px; }
  .ws-report-title { font-size: var(--fs-13); margin-bottom: 8px; }
  .ws-report-row { font-size: var(--fs-12); margin-bottom: 6px; }
  .ws-report-result { font-size: var(--fs-12); }
}
