/* ===== 기본 컨테이너 ===== */
.container { max-width: 1400px; margin: 24px auto; padding: 0 12px; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.05); padding: 16px; margin-bottom: 16px;
}
.card-title { margin: 0 0 8px; font-size: 18px; font-weight: 800; }
.card-body { color: #374151; line-height: 1.6; }

.list { margin: 0; padding-left: 18px; }

/* ===== 그리드 ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.grid .example { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.grid .example h3 { margin: 0 0 6px; font-size: 15px; }
.grid .example p { margin: 0; color: #4b5563; font-size: 14px; }

/* ===== 모형 입력 카드 반응형 ===== */
#modelInputGrid { display: grid; gap: 20px; }
#modelInputGrid { grid-template-columns: 1fr; }
@media (min-width: 680px) { #modelInputGrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px){ #modelInputGrid { grid-template-columns: repeat(3, 1fr); } }

#modelInputGrid .example {
  min-height: 260px; padding: 24px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
#modelInputGrid .example h3 { font-size: 18px; margin-bottom: 10px; }

/* ===== 위젯 ===== */
.example { padding: 10px; background: #fff; border: 1px solid var(--line, #e9ecef); border-radius: 10px; }
.score-widget { max-width: 420px; margin: 8px 0; }

/* 입력칸 (세련된 스타일) */
.score-input {
  width: 100%; padding: 10px 12px;
  border: 1px solid #d1d5db; border-radius: 10px;
  font-size: 14px; transition: all 0.2s ease;
}
.score-input:focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.2);
}

/* 단계 입력칸 */
.step-inputs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.step-inputs .step { height: 36px; padding: 6px 8px; border: 1px solid #d0d7de; border-radius: 8px; }

/* 답변 리스트 (깔끔한 카드 스타일) */
.answer-list {
  list-style: none; padding: 8px 10px; margin: 8px 0;
  min-height: 40px;
  background: #f9fafb; border: 1px solid #e5e7eb;
  border-radius: 10px;
}
.answer-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 4px; font-size: 14px;
}
.answer-list .del { cursor: pointer; border: none; background: transparent; font-size: 16px; }

/* 버튼 영역 간격 유지 */
.score-actions{ display:flex; gap:10px; margin-top:10px; }

/* 기본 버튼: pill + 아이콘 공간 + 살짝 입체감 */
.btn{
  appearance:none; border:none; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:10px 16px 10px 14px;            /* 왼쪽 살짝 여유 */
  border-radius:999px; font-weight:700; font-size:14px;
  box-shadow:0 1px 0 rgba(0,0,0,.04);
  transition: transform .06s, box-shadow .2s, filter .2s;
}
.btn:focus{ outline:none; box-shadow:0 0 0 3px rgba(59,130,246,.18); }
.btn:hover{ filter:brightness(1.03); box-shadow:0 4px 12px rgba(0,0,0,.08); }
.btn:active{ transform:translateY(1px); }

/* ✅ 확인: 파랑 그라데이션 + 체크 이모지 */
.btn.primary{
  background:linear-gradient(180deg,#60a5fa,#3b82f6);
  color:#fff;
}
.btn.primary::before{ content:"✅"; font-size:16px; line-height:1; }

/* ✖️ 모두 지우기: 코랄 그라데이션 + 빗자루 이모지 */
.btn.danger{
  background:linear-gradient(180deg,#fda4af,#f43f5e);
  color:#fff;
}
.btn.danger::before{ content:"👋"; font-size:16px; line-height:1; }

/* 🌟 정답 공개: 보라색 그라데이션 + 전구 이모지 */
.btn.reveal {
  background: linear-gradient(180deg, #a78bfa, #7c3aed);
  color: #fff;
}
.btn.reveal::before {
  content: "💡";   /* 전구 이모지 */
  font-size: 16px;
  line-height: 1;
}

/* 채점 결과 */
.result-area { margin-top: 8px; font-weight: 600; }

/* ====== 내체표 테이블 스타일 ====== */
.curriculum-table-container {
  margin: 16px 0;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.curriculum-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 800px; /* 최소 너비 설정 */
}

.curriculum-table th {
  background: linear-gradient(180deg, #f8fafc, #e2e8f0);
  padding: 10px 6px;
  text-align: center;
  font-weight: 700;
  color: #374151;
  border-bottom: 2px solid #d1d5db;
  border-right: 1px solid #d1d5db;
  white-space: nowrap;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.curriculum-table th:first-child {
  background: linear-gradient(180deg, #fef3c7, #fbbf24);
  color: #92400e;
  font-weight: 800;
  min-width: 100px;
}

.curriculum-table td {
  padding: 2px;
  border: 1px solid #e5e7eb;
  position: relative;
  vertical-align: top;
}

.curriculum-table td:first-child {
  background: #fffbeb;
  font-weight: 600;
  color: #92400e;
  text-align: center;
  min-width: 100px;
  border-right: 2px solid #d97706;
}

.curriculum-table .category-cell {
  background: #fffbeb !important;
  font-weight: 600;
  color: #92400e;
  text-align: center;
  padding: 8px 4px;
  border-right: 2px solid #d97706;
}

.curriculum-table .empty-cell {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}

/* 고정 텍스트 셀 (학년 구분, 내용요소 등) */
.curriculum-table .fixed-text-cell {
  background: #f1f5f9;
  font-weight: 600;
  color: #475569;
  text-align: center;
  padding: 8px 4px;
  border: 1px solid #cbd5e1;
}

/* 주요 영역 셀 (주황색) */
.curriculum-table .major-area-cell {
  background: linear-gradient(180deg, #fed7aa, #fb923c) !important;
  font-weight: 700;
  color: #9a3412;
  text-align: center;
  padding: 8px 4px;
  border: 2px solid #ea580c;
  font-size: 13px;
}

/* 실과 대영역 제목 셀 (< >로 둘러싸인 것들) */
.curriculum-table .practical-major-title {
  background: linear-gradient(180deg, #fed7aa, #fb923c) !important;
  font-weight: 700;
  color: #9a3412;
  text-align: center;
  padding: 10px 8px;
  border: 2px solid #ea580c;
  font-size: 14px;
  colspan: 2; /* 두 열에 걸쳐 표시 */
}

/* 실과 과목 전용 스타일 조정 */
.curriculum-table.practical-table .curriculum-input {
  min-width: 120px; /* 입력창 길이 늘림 */
}

.curriculum-table.practical-table .category-cell {
  max-width: 80px; /* 범주 셀 크기 조정 */
  font-size: 12px;
}

.curriculum-input {
  width: 100%;
  min-width: 70px;
  height: 32px;
  padding: 4px 6px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 11px;
  transition: all 0.2s ease;
  background: #fff;
  text-align: center;
}

.curriculum-input:empty,
.curriculum-input[value=""] {
  background: #f9fafb;
  border-style: dashed;
  border-color: #d1d5db;
}

.curriculum-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.curriculum-input::placeholder {
  color: #9ca3af;
  font-size: 12px;
}

/* 정답/오답 셀 색상 */
.curriculum-input.correct-cell {
  background-color: #dcfce7;
  border-color: #16a34a;
  color: #15803d;
}

.curriculum-input.wrong-cell {
  background-color: #fef2f2;
  border-color: #dc2626;
  color: #dc2626;
}

/* 정답 공개 시 스타일 - 셀 내부에 맞는 툴팁 */
.answer-tooltip {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: scale(0.85);
  }
  to { 
    opacity: 1; 
    transform: scale(1);
  }
}

/* 반응형 테이블 */
@media (max-width: 768px) {
  .curriculum-input {
    min-width: 60px;
    height: 32px;
    font-size: 12px;
    padding: 4px 6px;
  }
  
  .curriculum-table th {
    padding: 8px 4px;
    font-size: 12px;
  }
  
  .answer-tooltip {
    font-size: 9px !important;
    padding: 1px 2px !important;
    line-height: 1.1 !important;
  }
}
.correct { color: #16a34a; }
.wrong   { color: #dc2626; }

@media (max-width: 480px) {
  .step-inputs { grid-template-columns: repeat(2, 1fr); }
}

/* 입력칸을 한 줄씩 배치 */
.example .fields{
  display: grid; grid-template-columns: 1fr; gap: 8px;
}
.example .field{ width: 100%; }
.example .field .score-input{ display: block; width: 100%; }

/* ===== 모형이름 세부페이지(capacity&type=model) 전용 버튼 사이즈 축소 ===== */
.modelname-mode .score-actions { gap: 8px; flex-wrap: wrap; }
.modelname-mode .btn {
  padding: 6px 10px 6px 10px;   /* 🔹 더 작게 */
  font-size: 13px;              /* 🔹 글자도 살짝 줄임 */
  border-radius: 10px;          /* 🔹 박스형에 더 맞게 */
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
}
.modelname-mode .btn::before { font-size: 14px; } /* 아이콘도 소폭 축소 */
