* {
  margin: 0;
  padding: 0;
}

body {
  background-color: #f1f2f3;
}

.container {
  box-sizing: border-box;
  width: 100%;
  max-width: 1560px;
  min-width: 1240px;
  margin: 20px auto;
  color: #333;
}

.container *{
  box-sizing: border-box;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
}

header h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

header p{
  font-size: 1.1rem;
  opacity: 0.9;
}

.settings {
  display: flex;
  align-items: center;
  gap: 20px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 15px;
}

.setting-item label {
  font-weight: 600;
  font-size: 1.15rem;
  color: #2c3e50;
}

select {
  padding: 10px 18px;
  border: 1px solid #dce4ec;
  border-radius: 8px;
  background-color: white;
  font-size: 1.05rem;
  cursor: pointer;
  min-width: 160px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.courses-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.courses-header {
  padding:15px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  /* 5列 */
  font-weight: 600;
  color: #2c3e50;
}

.course-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  /* 5列 */
  padding: 18px 20px;
  border-bottom: 1px solid #f1f2f3;
  transition: background-color 0.2s;
}

.courses-list {
  max-height: 400px;
  overflow-y: auto;
}

.course-row:hover {
  background-color: #f9fbfd;
}

.course-row input {
  min-width: 240px;
  padding: 8px 15px;
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s;
  background: #fbfcfd;
}

.course-row input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.btn {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.btn:active {
  transform: translateY(0);
}

.handle{
  display: flex;
  align-items: center;
}

.btn-delete {
  background-color: #e74c3c;
  font-size: 14px;
  padding: 6px 24px;
}

.btn-success {
  background-color: #2ecc71;
}

.btn-warning {
  background-color: #f39c12;
}

.btn-example{
  background-color: #59a6b6;
}

.btn-copy{
  background-color: #9b59b6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-left: 15px;
}

.result-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  padding: 30px;
  display: none;
}

.result-header {
  font-size: 22px;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  color: #2c3e50;
}

.algorithms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.algorithm {
  background: linear-gradient(to bottom right, #f8f9fa, #eef2f7);
  border-radius: 10px;
  padding: 15px;
  border-left: 5px solid #3498db;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s;
}

.algorithm h3 {
  margin-bottom: 15px;
  color: #2c3e50;
  font-size: 18px;
}

.algorithm p {
  font-size: 2.2rem;
  font-weight: 700;
  color: #2980b9;
  text-align: center;
  margin-top: 10px;
}

.instructions {
  flex: 1;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  padding: 20px;
}

.instructions h2 {
  font-size: 22px;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  color: #2c3e50;
}

.instructions-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
}

.instructions-section p{
  margin-top: 15px;
  opacity: 0.9;
}

.instructions-section h3 {
  margin-bottom: 15px;
  color: #2980b9;
  display: flex;
  align-items: center;
  font-size: 18px;
}

.instructions-section ul {
  padding-left: 25px;
}

.instructions-section li {
  margin-top: 12px;
  line-height: 1.7;
}

.algorithms-container {
  max-height: 780px;
  overflow-y: auto;
  padding-right: 10px;
}

.algorithms-table {
  width: 100%;
  border-collapse: collapse;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.algorithms-table th {
  background: linear-gradient(to bottom, #3498db, #2980b9);
  color: white;
  padding: 15px;
  text-align: center;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.algorithms-table td {
  padding: 15px;
  border: 1px solid #e1e5e9;
  text-align: center;
}

.algorithms-table tr:nth-child(even) {
  background-color: #f9fbfd;
}

.algorithms-table tr:hover {
  background-color: #f1f8ff;
}

.box-warp{
  display: flex;
  gap: 25px;
}

.card {
  flex: 1;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  padding: 20px;
}

.card h2 {
  font-size: 22px;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  color: #2c3e50;
}

.footer {
  grid-column: 1 / -1;
  text-align: center;
  color: #7f8c8d;
  font-size: 1rem;
  margin-top: 25px;
}

.highlight {
  background-color: #fffde7;
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.weight-input {
  display: none;
}

.weight-header {
  display: none;
}

.input-error {
  border: 1px solid #e74c3c !important;
  background-color: #ffebee !important;
}

.error-message {
  color: #e74c3c;
  font-size: 0.85rem;
  margin-top: 5px;
  display: none;
}

.course-row .input-container {
  position: relative;
}

/* 添加 Notice 样式 */
.notice-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.notice {
  background-color: #3498db;
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  max-width: 500px;
  text-align: center;
}

.notice.show {
  opacity: 1;
  transform: translateY(0);
}

.notice.success {
  background-color: #2ecc71;
}

.notice.warning {
  background-color: #f39c12;
}

.notice.error {
  background-color: #e74c3c;
}
