:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --card-background: #fff;
    --border-radius: 16px;
    --transition: all 0.2s cubic-bezier(.4,0,.2,1);
  }
  
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    margin: 0;
  }
  
  .header {
    background: var(--card-background);
    box-shadow: 0 2px 4px rgba(0,0,0,0.07);
    padding: 2.5rem 0 1.2rem 0;
    text-align: center;
    margin-bottom: 2rem;
  }
  .header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
  }
  .logo-icon {
    font-size: 2.1rem;
    color: var(--primary-color);
  }
  .logo-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
  }
  
  .main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem 2.5rem 1.5rem;
    flex: 1;
  }
  
  .timetable-form-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px rgba(37,99,235,0.07);
    padding: 2.5rem 2rem 2rem 2rem;
    margin-bottom: 2.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .timetable-form-card h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
  }
  .form-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .form-row label {
    font-weight: 500;
    color: var(--secondary-color);
  }
  select, input[type="week"] {
    padding: 0.6rem 1.1rem;
    border: 1.5px solid #c7d2fe;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #f1f5ff;
    color: var(--text-color);
    transition: border 0.18s;
  }
  select:focus, input[type="week"]:focus {
    border: 1.5px solid var(--primary-color);
    outline: none;
  }
  .week-row {
    gap: 0.5rem;
  }
  .week-btn {
    background: #e8f0fe;
    color: var(--primary-color);
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0.5rem 1.1rem;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
  }
  .week-btn:hover {
    background: #dbeafe;
    color: #1e40af;
  }
  .search-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.7rem 2.2rem;
    margin-top: 1.2rem;
    cursor: pointer;
    transition: background 0.18s;
    box-shadow: 0 2px 8px rgba(37,99,235,0.08);
  }
  .search-btn:hover {
    background: var(--secondary-color);
  }
  
  .timetable-result-card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px rgba(37,99,235,0.07);
    padding: 2rem 1.5rem 2.5rem 1.5rem;
    margin-bottom: 2.5rem;
    text-align: center;
  }
  .timetable-result-card h3 {
    color: var(--primary-color);
    margin-bottom: 1.2rem;
  }
  .timetable-table-wrapper {
    overflow-x: auto;
  }
  .timetable-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
    font-size: 1.05rem;
  }
  .timetable-table th, .timetable-table td {
    padding: 0.85rem 0.7rem;
    border-bottom: 1.5px solid #e5e7eb;
    text-align: center;
  }
  .timetable-table th {
    background: #e8f0fe;
    color: var(--primary-color);
    font-weight: 700;
    border-bottom: 2px solid #c7d2fe;
  }
  .timetable-table tr:last-child td {
    border-bottom: none;
  }
  
  .footer {
    background: var(--card-background);
    box-shadow: 0 -2px 4px rgba(0,0,0,0.04);
    padding: 2rem 0 2.5rem 0;
    text-align: center;
    color: #64748b;
    font-size: 1.2rem;
    margin-top: 2rem;
    width: 100%;
  }
  
  @media (max-width: 600px) {
    .header-inner {
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 0.3rem;
      width: 100%;
    }
    .main-btn {
      width: calc(100vw - 4rem);
      max-width: 420px;
      min-width: 0;
      font-size: 1.1rem;
      padding: 0.9rem 0;
      border-radius: 10px;
      margin: 0 auto;
      display: block;
      text-align: center;
    }
    .mobile-main-btn-wrapper {
      display: none;
    }
    .header {
      position: fixed;
      width: 100%;
      top: 0;
      left: 0;
      z-index: 1000;
      padding-bottom: 1.5rem; /* 버튼 공간 확보 */
    }
    .main-content {
      padding-top: 120px; /* 헤더+버튼 높이만큼 */
    }
    .timetable-form-card, .timetable-result-card {
      padding: 1rem 0.3rem;
      margin-bottom: 1.2rem;
      width: 95vw;
      max-width: 420px;
      min-width: 0;
      box-sizing: border-box;
      margin-left: auto;
      margin-right: auto;
    }
    .selected-week-label {
      font-size: 1.05rem;
      margin-bottom: 1rem;
      margin-top: 1.2rem;
    }
    .form-row, .grade-class-row {
      flex-direction: column;
      align-items: stretch;
      gap: 0.5rem;
      margin-bottom: 1rem;
    }
    .form-row label, .grade-class-row label {
      text-align: left;
      width: 100%;
    }
    .timetable-table th, .timetable-table td {
      padding: 0.5rem 0.2rem;
      font-size: 0.95rem;
    }
    .timetable-table-wrapper {
      overflow-x: auto;
    }
    .logo-title {
      font-size: 1.1rem;
    }
    .timetable-table th, .timetable-table td {
      padding: 0.5rem 0.3rem;
      font-size: 0.97rem;
    }
    .bottom-main-btn-wrapper {
      position: static;
      width: 100%;
      background: none;
      box-shadow: none;
      padding: 0 0 1.2rem 0;
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }
  
  .week-picker-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.6rem 1.3rem;
    margin-right: 1rem;
    cursor: pointer;
    transition: background 0.18s;
    box-shadow: 0 1.5px 6px rgba(37,99,235,0.07);
    display: inline-block;
  }
  .week-picker-btn:hover {
    background: var(--secondary-color);
  }
  #weekPicker {
    display: none;
  }
  
  .form-row.week-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
  }
  .form-row.week-row label,
  .form-row.week-row select,
  .form-row.week-row .week-picker-btn,
  .form-row.week-row .week-label {
    font-size: 1.05rem;
    height: 2.6rem;
    line-height: 2.6rem;
    vertical-align: middle;
  }
  .form-row.week-row label {
    font-weight: 500;
    color: var(--secondary-color);
    margin-bottom: 0;
  }
  .form-row.week-row select {
    min-width: 90px;
    padding: 0 1.1rem;
    border: 1.5px solid #c7d2fe;
    border-radius: 8px;
    background: #f1f5ff;
    color: var(--text-color);
    transition: border 0.18s;
    height: 2.6rem;
  }
  .form-row.week-row .week-picker-btn {
    height: 2.6rem;
    padding: 0 1.3rem;
    margin-right: 0;
    margin-left: 0.2rem;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 1.5px 6px rgba(37,99,235,0.07);
  }
  .form-row.week-row .week-label {
    min-width: 120px;
    color: var(--primary-color);
    font-weight: 500;
    margin-left: 0.5rem;
    display: inline-block;
    text-align: left;
    height: 2.6rem;
    line-height: 2.6rem;
  }

@media (max-width: 700px) {
  .form-row.week-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
  }
  .form-row.week-row label,
  .form-row.week-row select,
  .form-row.week-row .week-picker-btn,
  .form-row.week-row .week-label {
    width: 100%;
    min-width: 0;
    text-align: left;
    height: 2.4rem;
    line-height: 2.4rem;
  }
  .form-row.week-row .week-label {
    margin-left: 0;
  }
}

.selected-week-label {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 2rem;
  text-align: center;
}
.form-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.5rem;
}
.form-col label {
  margin-bottom: 0.3rem;
  font-weight: 500;
  color: var(--secondary-color);
}
.form-col select {
  min-width: 120px;
  padding: 0.6rem 1.1rem;
  border: 1.5px solid #c7d2fe;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #f1f5ff;
  color: var(--text-color);
  transition: border 0.18s;
  margin-bottom: 0.5rem;
}
.form-col select:focus {
  border: 1.5px solid var(--primary-color);
  outline: none;
}
.week-picker-btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.7rem 2.2rem;
  cursor: pointer;
  transition: background 0.18s;
  box-shadow: 0 1.5px 6px rgba(37,99,235,0.07);
  margin-bottom: 0.5rem;
}
.week-picker-btn:hover {
  background: var(--secondary-color);
}
.calendar-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(30, 41, 59, 0.35);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.calendar-modal {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(37,99,235,0.18);
  padding: 2rem 1.5rem 1.2rem 1.5rem;
  min-width: 320px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
@media (max-width: 600px) {
  .selected-week-label {
    font-size: 1.05rem;
    margin-bottom: 1.2rem;
  }
  .form-col {
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  .week-picker-btn {
    padding: 0.6rem 1.1rem;
    font-size: 0.97rem;
  }
  .calendar-modal {
    min-width: 90vw;
    padding: 1.2rem 0.2rem 1rem 0.2rem;
  }
}

.grade-class-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  margin-bottom: 1.5rem;
  margin-right: 30px;
}
.grade-class-row label {
  font-weight: 500;
  color: var(--secondary-color);
  margin: 0 0.1rem;
  min-width: auto;
  text-align: right;
}
.grade-class-row label[for="class"] {
  margin-left: 2.2rem;
}
.grade-class-row select {
  min-width: 60px;
  padding: 0.6rem 1.1rem;
  border: 1.5px solid #c7d2fe;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #f1f5ff;
  color: var(--text-color);
  transition: border 0.18s;
  height: 2.6rem;
}
.grade-class-row select:focus {
  border: 1.5px solid var(--primary-color);
  outline: none;
}
@media (max-width: 600px) {
  .grade-class-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  .grade-class-row select {
    width: 100%;
    min-width: 0;
    height: 2.4rem;
  }
}

.calendar-confirm-btn {
  margin-top: 1.2rem;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.7rem 2.2rem;
  cursor: pointer;
  transition: background 0.18s;
  box-shadow: 0 1.5px 6px rgba(37,99,235,0.07);
  display: block;
}
.calendar-confirm-btn:hover {
  background: var(--secondary-color);
}

.main-btn {
  width: 100%;
  max-width: 420px;
  min-width: 0;
  font-size: 1.1rem;
  padding: 0.9rem 0;
  border-radius: 10px;
  margin: 0 auto;
  display: block;
  text-align: center;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  border: none;
  box-shadow: 0 1.5px 6px rgba(37,99,235,0.07);
}
.main-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-1px);
}

.bottom-main-btn-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0 auto;
  background: none;
  box-shadow: none;
  padding: 0 0 1.2rem 0;
}

.footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
} 