* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  line-height: 1.6;
  color: #333333;
  background: #f5f5f5;
  font-size: 16px;
}

/* ============ 헤더 ============ */
.header {
  background: white;
  border-bottom: 1px solid #e0e0e0;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  font-weight: bold;
  font-size: 18px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-text {
  color: #333;
  font-weight: 600;
}

/* 탭 네비게이션 (헤더) */
.tab-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============ Intro 섹션 ============ */
.intro-section {
  background: white;
  padding: 48px 16px;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 24px;
}

.intro-title {
  font-size: 36px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 16px 0;
}

.intro-desc {
  font-size: 16px;
  color: #666;
  line-height: 1.6;
  margin: 0 0 8px 0;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.intro-desc:last-of-type {
  margin-bottom: 24px;
}

.intro-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #d0d0d0;
  max-width: 1200px;
  margin: 24px auto 0;
  padding: 0;
  justify-content: flex-start;
  align-items: flex-end;
}

.intro-tabs .tab-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  cursor: pointer;
  font-size: 14px;
  color: #999;
  font-weight: 400;
  margin-bottom: -1px;
  min-height: auto;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.intro-tabs .tab-btn:hover {
  color: #333;
}

.intro-tabs .tab-btn.active {
  background: white;
  border-color: #d0d0d0;
  border-bottom: 1px solid white;
  color: #333;
  font-weight: 600;
}

/* 헤더 탭 버튼 (기본 스타일) */
.tab-btn {
  padding: 8px 16px;
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  transition: all 0.2s ease;
  min-height: 36px;
  display: flex;
  align-items: center;
  font-weight: 500;
}

.tab-btn:hover {
  background: #f9f9f9;
  color: #333;
}

.tab-btn.active {
  background: #333;
  color: white;
  border-color: #333;
}

/* ============ 메인 콘텐츠 ============ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}

.section-header {
  margin-bottom: 24px;
}

.section-header h1 {
  font-size: 28px;
  margin: 0 0 8px 0;
  color: #1a1a1a;
  font-weight: 600;
}

.section-desc {
  color: #999;
  font-size: 14px;
  margin: 0;
}

/* ============ 필터 바 ============ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e0e0e0;
}

.filter-label {
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

.filter-btn {
  padding: 6px 12px;
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: #999;
  color: #333;
}

.filter-btn.active {
  background: #333;
  color: white;
  border-color: #333;
}

/* ============ 카드 그리드 ============ */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============ 카드 공통 스타일 ============ */
.project-card,
.info-card,
.file-card,
.resource-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 16px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.project-card:hover,
.info-card:hover,
.file-card:hover,
.resource-card:hover {
  border-color: #d0d0d0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* 프로젝트 카드 (번호 있음) */
.project-card {
  position: relative;
  padding-top: 24px;
}

.card-num {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 24px;
  font-weight: bold;
  color: #e0e0e0;
  z-index: 1;
}

.card-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: inline-block;
}

.project-card h3,
.info-card h3,
.resource-card h3 {
  font-size: 16px;
  margin: 8px 0 8px 0;
  color: #1a1a1a;
  font-weight: 600;
}

.project-card p,
.info-card p,
.resource-card p {
  font-size: 14px;
  color: #666;
  margin: 0 0 12px 0;
  line-height: 1.5;
}

/* 태그 */
.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  background: #f0f0f0;
  color: #666;
  font-size: 12px;
  border-radius: 3px;
  border: 1px solid #e0e0e0;
}

/* 메타 정보 */
.card-meta {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.meta-item {
  font-size: 12px;
  color: #999;
}

/* 직무 목록 */
.job-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.job-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: #f9f9f9;
  border-radius: 3px;
  border-left: 3px solid #22d3ee;
}

.job-item strong {
  font-size: 13px;
  color: #333;
}

.job-item span {
  font-size: 12px;
  color: #999;
}

/* 리소스 카드 */
.resource-icon {
  font-size: 32px;
  margin-bottom: 8px;
  display: inline-block;
}

.resource-link {
  display: inline-block;
  color: #22d3ee;
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px;
  transition: color 0.2s ease;
}

.resource-link:hover {
  color: #06b6d4;
  text-decoration: none;
}

/* ============ 탭 콘텐츠 ============ */
.tab-content {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============ 파일 관리 UI ============ */
.file-manager {
  margin-top: 12px;
}

.upload-section {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.file-input {
  flex: 1;
  min-width: 150px;
  padding: 8px 12px;
  background: white;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  color: #333;
  font-size: 13px;
}

.file-input:focus {
  outline: none;
  border-color: #22d3ee;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.1);
}

.upload-btn {
  padding: 8px 16px;
  background: #22d3ee;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.2s ease;
  min-height: 36px;
  white-space: nowrap;
  flex-shrink: 0;
}

.upload-btn:hover {
  background: #06b6d4;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  padding: 10px;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.file-name {
  color: #333;
  font-size: 13px;
  font-weight: 500;
  word-break: break-all;
  flex: 1;
}

.file-size {
  color: #999;
  font-size: 12px;
  white-space: nowrap;
}

.image-preview {
  max-width: 100%;
  max-height: 150px;
  border-radius: 4px;
  margin: 0;
  border: 1px solid #e0e0e0;
}

.file-actions {
  display: flex;
  gap: 6px;
}

.download-btn,
.delete-btn {
  flex: 1;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  font-size: 12px;
  transition: background 0.2s ease;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

.download-btn {
  background: #3b82f6;
  color: white;
}

.download-btn:hover {
  background: #2563eb;
}

.delete-btn {
  background: #ef4444;
  color: white;
}

.delete-btn:hover {
  background: #dc2626;
}

/* ============ 푸터 ============ */
.footer {
  max-width: 1200px;
  margin: 32px auto 0;
  padding: 24px 16px;
  color: #999;
  font-size: 13px;
  text-align: center;
  border-top: 1px solid #e0e0e0;
  background: white;
}

/* ============ 반응형 ============ */
@media (max-width: 640px) {
  .header-container {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .tab-nav {
    width: 100%;
    gap: 6px;
  }

  .intro-section {
    padding: 32px 16px;
  }

  .intro-title {
    font-size: 24px;
    margin-bottom: 12px;
  }

  .intro-desc {
    font-size: 14px;
  }

  .intro-desc:last-of-type {
    margin-bottom: 16px;
  }

  .intro-tabs {
    gap: 0;
    overflow-x: auto;
  }

  .intro-tabs .tab-btn {
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .tab-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .card-grid {
    gap: 12px;
  }

  .section-header h1 {
    font-size: 24px;
  }

  .project-card,
  .info-card,
  .file-card,
  .resource-card {
    padding: 12px;
  }

  .card-num {
    font-size: 20px;
    top: 8px;
    right: 8px;
  }

  .card-icon {
    font-size: 28px;
  }

  .upload-section {
    flex-wrap: wrap;
  }

  .file-input {
    width: 100%;
    min-width: unset;
    margin-bottom: 8px;
  }

  .upload-btn {
    width: 100%;
    padding: 10px 16px;
    min-height: 40px;
    font-size: 14px;
  }

  .download-btn,
  .delete-btn {
    min-height: 36px;
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* 접근성 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* 다크모드 지원 (향후) */
@media (prefers-color-scheme: dark) {
  body {
    background: #1a1a1a;
    color: #e5e7eb;
  }

  .header {
    background: #2a2a2a;
    border-bottom-color: #404040;
  }

  .logo-text {
    color: #e5e7eb;
  }

  .tab-btn {
    background: #2a2a2a;
    border-color: #404040;
    color: #ccc;
  }

  .tab-btn:hover {
    background: #3a3a3a;
  }

  .tab-btn.active {
    background: #22d3ee;
    color: #1a1a1a;
    border-color: #22d3ee;
  }

  .section-header h1 {
    color: #e5e7eb;
  }

  .section-desc {
    color: #999;
  }

  .filter-bar {
    border-bottom-color: #404040;
  }

  .filter-btn {
    background: #2a2a2a;
    border-color: #404040;
    color: #ccc;
  }

  .project-card,
  .info-card,
  .file-card,
  .resource-card {
    background: #2a2a2a;
    border-color: #404040;
  }

  .project-card h3,
  .info-card h3,
  .resource-card h3 {
    color: #e5e7eb;
  }

  .project-card p,
  .info-card p,
  .resource-card p {
    color: #bbb;
  }

  .tag {
    background: #3a3a3a;
    border-color: #404040;
    color: #bbb;
  }

  .job-item {
    background: #3a3a3a;
    border-left-color: #22d3ee;
  }

  .job-item strong {
    color: #e5e7eb;
  }

  .file-item {
    background: #3a3a3a;
    border-color: #404040;
  }

  .file-name {
    color: #e5e7eb;
  }

  .file-input {
    background: #2a2a2a;
    border-color: #404040;
    color: #e5e7eb;
  }

  .footer {
    background: #2a2a2a;
    border-top-color: #404040;
  }
}

/* ============ 로딩 상태 ============ */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 16px;
}

.loading-indicator p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e0e0e0;
  border-top-color: #22d3ee;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============ 메시지 ============ */
.error-message,
.success-message {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 14px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error-message {
  background: #fee;
  border: 1px solid #fcc;
  color: #c33;
}

.success-message {
  background: #efe;
  border: 1px solid #cfc;
  color: #3c3;
}

.error-close,
.success-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.error-close:hover,
.success-close:hover {
  opacity: 1;
}

/* ============ 파일 항목 개선 ============ */
.file-item {
  gap: 12px;
}

.file-header {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.file-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.file-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.file-size,
.file-date {
  display: inline-block;
}

.empty-state {
  text-align: center;
  color: #999;
  padding: 32px 16px;
  font-size: 14px;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .loading-indicator {
    background: #3a3a3a;
  }

  .loading-indicator p {
    color: #bbb;
  }

  .spinner {
    border-color: #404040;
    border-top-color: #22d3ee;
  }

  .error-message {
    background: #3a2222;
    border-color: #552222;
    color: #ff9999;
  }

  .success-message {
    background: #223a22;
    border-color: #225522;
    color: #99ff99;
  }

  .file-meta {
    color: #888;
  }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #999;
}

.modal-close:hover {
  color: #333;
}

/* Form Styles */
.lesson-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.form-group input[type="text"],
.form-group textarea {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
}

.form-group textarea {
  resize: vertical;
}

.form-group small {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.image-preview {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.image-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-primary {
  background-color: #4CAF50;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn-primary:hover {
  background-color: #45a049;
}

.btn-secondary {
  background-color: #ccc;
  color: #333;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn-secondary:hover {
  background-color: #bbb;
}

/* Lesson Card Styles */
.lesson-card {
  background: white;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  grid-column: 1 / -1;
}

.lesson-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.lesson-header h3 {
  margin: 0;
  font-size: 18px;
}

.lesson-actions {
  display: flex;
  gap: 8px;
}

.edit-btn, .delete-btn {
  padding: 6px 12px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.edit-btn {
  color: #2196F3;
  border-color: #2196F3;
}

.edit-btn:hover {
  background-color: #e3f2fd;
}

.delete-btn {
  color: #f44336;
  border-color: #f44336;
}

.delete-btn:hover {
  background-color: #ffebee;
}

.lesson-images {
  display: flex;
  gap: 10px;
  margin: 15px 0;
  flex-wrap: wrap;
}

.lesson-images img {
  max-width: 300px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lesson-content {
  line-height: 1.6;
  color: #555;
}

.lesson-content h2,
.lesson-content h3 {
  margin-top: 15px;
  margin-bottom: 10px;
}

.lesson-content ul,
.lesson-content ol {
  margin-left: 20px;
}

/* Additional Message Styles */
.error-message.modal-message,
.success-message.modal-message {
  padding: 15px 20px;
  border-radius: 6px;
  margin-bottom: 15px;
  animation: slideDown 0.3s ease-out;
}

.error-message.modal-message {
  background-color: #ffebee;
  color: #c62828;
  border-left: 4px solid #f44336;
}

.success-message.modal-message {
  background-color: #e8f5e9;
  color: #2e7d32;
  border-left: 4px solid #4CAF50;
}

.empty-message {
  text-align: center;
  color: #999;
  padding: 40px;
  grid-column: 1 / -1;
}

.btn-add-lesson {
  background-color: #4CAF50;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn-add-lesson:hover {
  background-color: #45a049;
}

.add-lesson-container {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
}

/* Lesson Container Styles */
.lessons-container {
  grid-column: 1 / -1;
  display: grid;
  gap: 15px;
  margin: 20px 0;
}

.project-card-container {
  /* Container for both project card and lessons */
}

.btn-view-lessons {
  background-color: #2196F3;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  margin-top: 10px;
}

.btn-view-lessons:hover {
  background-color: #0b7dda;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    padding: 20px;
  }

  .lesson-images img {
    max-width: 100%;
  }

  .lesson-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .lesson-actions {
    margin-top: 10px;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }
}

/* 학습내용 목록 뷰 스타일 */
.lesson-list-view {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lesson-list-title {
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  margin-bottom: 10px;
}

.lesson-list-title h3 {
  margin: 0;
  font-size: 24px;
}

.lesson-list-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
  margin-bottom: 15px;
}

.lesson-list-item {
  background: white;
  border: 2px solid #e3f2fd;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.lesson-list-item:hover {
  border-color: #2196F3;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
  transform: translateY(-2px);
}

.lesson-list-item-content {
  padding: 20px;
  cursor: pointer;
}

.lesson-list-item-content h4 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #333;
}

.lesson-list-item-preview {
  margin: 0;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

.lesson-list-add {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
}

/* 학습내용 상세 뷰 스타일 */
.lesson-detail-header {
  grid-column: 1 / -1;
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #2196F3;
}

.btn-back-to-list {
  background: none;
  border: none;
  color: #2196F3;
  cursor: pointer;
  font-size: 14px;
  padding: 8px 12px;
  margin: -8px -12px 10px -12px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.btn-back-to-list:hover {
  background-color: #e3f2fd;
}

.lesson-detail-header h2 {
  margin: 0;
  font-size: 28px;
  color: #333;
}

.lesson-detail-content {
  grid-column: 1 / -1;
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lesson-detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.lesson-detail-actions .edit-btn,
.lesson-detail-actions .delete-btn {
  flex: 1;
  padding: 12px 20px;
  font-size: 14px;
}

@media (max-width: 768px) {
  .lesson-list-items {
    grid-template-columns: 1fr;
  }

  .lesson-detail-header h2 {
    font-size: 20px;
  }

  .lesson-detail-content {
    padding: 15px;
  }

  .lesson-detail-actions {
    flex-direction: column;
  }

  .lesson-detail-actions .edit-btn,
  .lesson-detail-actions .delete-btn {
    width: 100%;
  }
}
/* 관리자 권한이 확인되기 전에는 변경 기능을 표시하지 않는다. */
[hidden], body:not(.admin-authenticated) .upload-section,
body:not(.admin-authenticated) .delete-btn, body:not(.admin-authenticated) .edit-btn,
body:not(.admin-authenticated) .btn-add-lesson { display: none !important; }
.admin-panel { margin-left: auto; padding: 8px; }
.admin-panel button { cursor: pointer; padding: 8px 12px; border-radius: 6px; }
#admin-dialog { border: 1px solid #ccc; border-radius: 12px; padding: 24px; width: min(90vw, 360px); }
#admin-dialog::backdrop { background: rgba(0, 0, 0, .45); }
#admin-login-form { display: grid; gap: 12px; }
#admin-password { min-width: 0; padding: 10px; }
#admin-login-error { color: #b42318; }

/* 자료 이미지는 미리보기 버튼을 누를 때만 표시한다. */
.file-actions { flex-wrap: wrap; }
.preview-btn {
  flex: 1;
  padding: 6px 12px;
  min-height: 32px;
  border: 1px solid #2563eb;
  border-radius: 4px;
  background: #fff;
  color: #1d4ed8;
  cursor: pointer;
  font-size: 12px;
}
.preview-btn:hover { background: #eff6ff; }
.preview-btn:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.file-preview { width: 100%; min-width: 0; }
.file-preview img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 8px auto 0;
  border-radius: 4px;
}
.preview-status { font-size: 13px; overflow-wrap: anywhere; }
.preview-status:empty { display: none; }

/* 기존 주메뉴 안에 표시하는 학과 홈페이지 */
.department-admin { display: none; }
body.admin-authenticated .department-admin:not([hidden]) { display: inline-flex; }
.department-hero { padding: clamp(28px, 5vw, 64px); background: #eaf3fc; border-top: 5px solid #3b82f6; border-radius: 12px; }
.department-eyebrow { color: #22578b; font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.department-hero h1 { font-size: clamp(22px, 3vw, 30px); margin: 8px 0; }
.department-hero h2 { font-size: clamp(28px, 4.5vw, 48px); line-height: 1.3; color: #153b63; margin: 18px 0; }
.department-hero > p:not(.department-eyebrow) { max-width: 650px; color: #43566b; }
.department-primary { display: inline-block; margin-top: 16px; padding: 12px 20px; background: #2563eb; color: white; border-radius: 6px; text-decoration: none; }
.department-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 20px 0; border-bottom: 1px solid #ddd; }
.department-nav a { color: #234d77; text-decoration: none; padding: 6px 0; }
.department-block { margin: 36px 0; padding: clamp(20px, 3vw, 32px); background: white; border: 1px solid #e0e0e0; border-radius: 10px; scroll-margin-top: 100px; }
.department-block h2 { margin: 0 0 14px; color: #213f60; font-size: 25px; }
.department-features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.department-features article { padding: 20px; background: #f6f8fb; border-radius: 6px; }
.department-features article > span { color: #3b82f6; font-weight: 700; }
.department-features h3 { margin: 8px 0; }
.department-features p { color: #586675; font-size: 14px; margin-bottom: 0; }
.department-learning-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.department-block button { padding: 8px 14px; border: 1px solid #bdd0e4; border-radius: 5px; color: #214f80; background: #f4f8fc; cursor: pointer; }
.department-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.department-section-heading .department-eyebrow { margin: 0 0 5px; }
.department-activity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.department-post { min-width: 0; padding: 18px 0; border-top: 1px solid #e5e7eb; overflow-wrap: anywhere; }
.department-post summary { cursor: pointer; font-weight: 600; }
.department-badge { display: inline-block; font-size: 12px; padding: 2px 8px; margin-right: 10px; background: #eaf3fc; color: #22578b; border-radius: 4px; }
.department-post time { display: block; color: #6b7280; font-size: 12px; margin: 8px 0; }
.department-post > img { width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: contain; background: #f5f7fa; border-radius: 5px; margin: 10px 0; }
.department-post-content img { max-width: 100%; height: auto; }
.department-post-content pre { overflow-x: auto; }
.department-post-content table { display: block; max-width: 100%; overflow-x: auto; }
.department-post-actions { gap: 8px; margin-top: 16px; }
.department-empty, .department-source { color: #667085; font-size: 14px; }
.department-source { margin-bottom: 32px; }
.department-source a { color: #22578b; }
.department-feedback:empty { display: none; }
#department-editor { width: min(680px, calc(100% - 32px)); max-height: 85vh; padding: 24px; border: 1px solid #ccc; border-radius: 12px; }
#department-editor::backdrop { background: rgba(0,0,0,.45); }
#department-editor form, #department-editor label { display: grid; gap: 8px; }
#department-editor form { gap: 16px; }
#department-editor input:not([type=checkbox]), #department-editor textarea, #department-editor select { width: 100%; min-width: 0; padding: 10px; border: 1px solid #aaa; border-radius: 4px; font: inherit; }
#department-editor label:has(input[type=checkbox]) { display: block; overflow-wrap: anywhere; }
#department-editor fieldset { border: 1px solid #ddd; min-width: 0; }
#department-editor-error { color: #b42318; }
.department-editor-actions { display: flex; gap: 12px; }
.department-editor-actions button { padding: 10px 20px; cursor: pointer; }
@media (max-width: 640px) {
  .department-features, .department-activity-grid { grid-template-columns: 1fr; }
  .department-section-heading { align-items: flex-start; }
  .department-hero { border-radius: 6px; }
  .intro-tabs { flex-wrap: wrap; }
}
