#resultsSection {
  animation: fadeIn 0.5s ease;
  z-index: 2;
}

.results-title {
  color: white;
  margin: 1rem 0;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
}

.website-list {
  list-style: none;
  text-align: left;
}

.website-item {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  margin-bottom: 15px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.05),
    0 2px 8px rgba(102, 126, 234, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  border: 1px solid #e9ecef;
  position: relative;
}

.website-item.no-url {
  pointer-events: none;
}

/* 閃光 */
.website-item:not(.no-url)::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.4) 50%,
      transparent 100%);
  transition: left 0.8s ease;
  pointer-events: none;
  z-index: 1;
}

.website-item:not(.no-url):hover::after {
  left: 100%;
}

.website-item:not(.no-url):hover .website-title {
  color:#667eea;
}

/* 動畫樣式 */
@keyframes shake {

  0%,
  20%,
  40%,
  60%,
  80%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }
}

.website-item {
  animation: slideInUp 0.4s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.website-link {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  text-decoration: none;
  color: #333;
  position: relative;
  overflow: hidden;
}

.external-link-icon {
  position: absolute;
  width: 30px;
  height: 30px;
  right: 10px;
  top: 10px;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
  z-index: 10;
  /* 確保在最上層 */
}

.website-item:hover .external-link-icon {
  opacity: 1;
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 3px 6px rgba(102, 126, 234, 0.5));
}

.website-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  font-size: 1.5rem;
  padding-right: 45px;
  /* 為 external-link-icon 預留空間 */
}

.website-item:hover .website-info::before {
  opacity: 1;
}

.website-title {
  font-size: 1em;
  font-weight: bold;
  color: #2c3e50;
  position: relative;
  display: inline-block;
  word-wrap: break-word;
  /* 長文字自動換行 */
  overflow-wrap: break-word;
  /* 現代瀏覽器的換行 */
  hyphens: auto;
  /* 自動斷字 */
}

.website-item:hover .website-title::after {
  width: 100%;
}

.website-isbn {
  font-size: 14px;
  color: #7f8c8d;
  padding: 4px 0;
}

.website-isbn::before {
  font-size: 1em;
  content: 'ISBN：';
}

.website-description {
  font-size: 0.8em;
  line-height: 1.6;
  color: #7f8c8d;
  padding: 6px 10px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-radius: 6px;
  border-left: 3px solid #667eea;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.website-description .description-title {
  font-size: 0.9em;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 4px;
}

.website-url {
  font-size: 12px;
  color: #95a5a6;
  font-family: monospace;
  word-break: break-all;
}

.serial-info {
  background: rgba(242, 226, 250, 0.5);
  margin-bottom: 15px;
  border-radius: 12px;
  display: flex;
  gap: 0.2rem;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.05),
    0 2px 8px rgba(102, 126, 234, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  border: 1px solid #e9ecef;
  padding: 20px;
}

.serial-info-item {
  flex: 1;
  display: flex;
  justify-content: center;
  flex-direction: row;
  gap: 8px;
  padding: 0 10px;
}

.serial-info-item .label {
  font-size: 14px;
  color: #6c757d;
  font-weight: 500;
}

.serial-info-item .value {
  font-size: 16px;
  color: #2c3e50;
  font-weight: bold;
}

.course-image {
  width: 120px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.15),
    0 4px 10px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
  position: relative;
  transform: scale(1) rotate(0);
}

.course-image:error {
  opacity: 0.7;
}

#errorMessage.error {
  color: #000000ff;
  margin-top: 15px;
  font-size: 14px;
  background: #ffffff39;
  padding: 12px;
  border-radius: 8px;
  border-left: 4px solid #e74c3c;
  word-break: break-all;
}

#websiteList .website-item .website-error {
  text-align: left;
  color: rgb(54, 54, 215);
  font-size: 1em;
  padding: 12px 0;
}

#websiteList .website-item .website-error[data-url-status="early"] {
  color: #f39c12;
}

#websiteList .website-item .website-error[data-url-status="expired"] {
  color: #e74c3c;
}

.no-results {
  text-align: center;
  color: #7f8c8d;
  padding: 40px 20px;
  background: #f8f9fa41;
  border-radius: 12px;
  margin-top: 20px;
}


.glass-input.error {
  border-color: #e74c3c !important;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2) !important;
}

.glass-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 序號記憶功能樣式 */
.serial-memory-section {
  margin-top: 20px;
}

.remember-checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 15px 0;
  justify-content: center;
}

.remember-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #667eea;
}

.remember-label {
  color: hsla(0, 0%, 0%, 0.8);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.memory-info {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px;
  line-height: 1.5;
  margin-top: 1.5rem;
  font-size: 13px;
  color: hsla(0, 0%, 21%, 0.6);
  text-align: center;
  backdrop-filter: blur(10px);
}

.saved-serials-container {
  margin-top: 20px;
}

.saved-serials-header {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.3), rgba(118, 75, 162, 0.25));
  border: 1px solid rgba(102, 126, 234, 0.4);
  border-radius: 12px;
  padding: 12px 15px;
  transition: all 0.3s ease;
  backdrop-filter: blur(15px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
  position: relative;
  z-index: 1;
}

.saved-serials-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  cursor: pointer;
  padding: 5px;
  margin-right: 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.saved-serials-main:hover {
  background: rgba(255, 255, 255, 0.1);
}

.expand-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(102, 126, 234, 0.3);
}

.expand-button:hover {
  background: rgba(102, 126, 234, 0.3);
  border-color: rgba(102, 126, 234, 0.4);
  transform: scale(1.05);
}

.expand-text {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.last-serial-preview {
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Courier New', monospace;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.3s ease;
}

.last-serial-preview.show {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

/* mobile - 響應式設計 */
@media (max-width: 765px) {
  .saved-serials-header {
    padding: 10px 12px;
  }

  .saved-serials-main {
    gap: 6px;
    margin-right: 8px;
  }

  .saved-serials-title {
    font-size: 15px;
  }

  .saved-serials-title-text {
    width: 100%;
  }

  .last-serial-preview {
    font-size: 13px;
  }

  .expand-button {
    padding: 6px 8px;
  }

  .expand-text {
    font-size: 11px;
  }

  .expand-icon {
    font-size: 12px;
  }
}



.saved-serials-header.expanded {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: 1px solid rgba(102, 126, 234, 0.35);
  box-shadow:
    0 6px 20px rgba(102, 126, 234, 0.3),
    0 -2px 10px rgba(102, 126, 234, 0.15);
}

.saved-serials-title {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.95);
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  gap: 0.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.serial-count {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 500;
  margin-left: auto;
}

.expand-icon {
  color: rgba(102, 126, 234, 0.8);
  font-size: 14px;
  transition: transform 0.3s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.expand-icon.expanded {
  transform: rotate(180deg);
}

.saved-serials-content {
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  margin-top: 10px;
  opacity: 0;
  transform: translateY(-10px);
}

.saved-serials-content.expanded {
  max-height: 500px;
  opacity: 1;
  transform: translateY(0);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(128, 128, 128, 0.2));
  border: 1px solid rgba(102, 126, 234, 0.35);
  border-radius: 12px;
  padding: 15px;
  backdrop-filter: blur(20px);
  box-shadow:
    0 8px 32px rgba(102, 126, 234, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.saved-serial-item {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(128, 128, 128, 0.15));
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  box-shadow:
    0 2px 8px rgba(128, 128, 128, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.saved-serial-item:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(128, 128, 128, 0.25));
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-2px);
  box-shadow:
    0 4px 12px rgba(128, 128, 128, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.saved-serial-code {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.saved-serial-date {
  color: rgba(0, 0, 0, 0.35);
  font-size: 14px;
  font-weight: 500;
}

.saved-serial-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 14px 15px;
}

.delete-serial-btn {
  background: linear-gradient(135deg, rgba(220, 20, 60, 0.8), rgba(255, 69, 58, 0.7));
  border: 1px solid rgba(220, 20, 60, 0.9);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.95);
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
  margin: 8px;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 4px rgba(220, 20, 60, 0.3);
}

.delete-serial-btn:hover {
  background: linear-gradient(135deg, rgba(220, 20, 60, 0.9), rgba(255, 69, 58, 0.8));
  border-color: rgba(220, 20, 60, 1);
  transform: scale(1.05);
  box-shadow: 0 3px 6px rgba(220, 20, 60, 0.4);
}

.clear-history-btn {
  background: linear-gradient(135deg, rgba(220, 20, 60, 0.8), rgba(255, 69, 58, 0.7));
  border: 1px solid rgba(220, 20, 60, 0.9);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.95);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  width: 100%;
  backdrop-filter: blur(8px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow:
    0 2px 6px rgba(220, 20, 60, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.clear-history-btn:hover {
  background: linear-gradient(135deg, rgba(220, 20, 60, 0.9), rgba(255, 69, 58, 0.8));
  border-color: rgba(220, 20, 60, 1);
  color: rgba(255, 255, 255, 1);
  box-shadow:
    0 4px 10px rgba(220, 20, 60, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

@media (max-width: 768px) {
  .website-link {
    flex-direction: column;
  }
  .website-info {
    padding-right: 0;
  }
  .button {
    padding: 5px 10px;
  }
  .serial-info {
    flex-direction: column;
  }
}