body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 0px;
    background: #FFFFFF;
    min-height: 100vh;
    line-height: 1.5;
}

.container { 
  max-width: 800px; 
  margin: 0 auto; 
  padding: 20px;  /* ✅ 保持 padding */
}

.header {
    background: white;
    padding: 2rem;  /* ← 統一縮排 */
    border-radius: 16px;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}


.user-input {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.quick-access {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #333333;
    border-radius: 12px;
    font-size: 16px;
    margin-bottom: 1rem;
    box-sizing: border-box;
}
.btn {
    background: #E62727;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    margin: 5px;
    transition: all 0.3s ease;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(230, 39, 39, 0.3);
}
h1 {
    color: #E62727;
    margin-bottom: 0.5rem;
}
h3 { color: #000000; margin-bottom: 1rem; }
p { color: #333333; }

/* ============================================
   Topbar - 與其他頁面一致
   ============================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #FFFFFF;
  border-bottom: 1px solid #E5E5E5;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.topbar-left,
.topbar-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.topbar-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #E62727;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-title i {
  font-size: 1.5rem;
}

.topbar-btn {
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  color: #000000;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
}

.topbar-btn:hover {
  background: rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #000000;
}

/* 主頁響應式設計 */
@media (max-width: 1024px) {
    .container {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0px;
    }

    .container {
        padding: 10px;
    }

/* ✅ 新增 topbar 響應式 */
  .topbar {
    padding: 0.75rem 1rem;
  }

  .topbar-left,
  .topbar-right {
    gap: 0.25rem;
  }

  .topbar-title span {
    display: none;  /* 小螢幕隱藏標題文字 */
  }

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

  .header,
  .user-input,
  .quick-access {
    padding: 1.5rem;
  }

  .quick-access > div:first-of-type {
    grid-template-columns: 1fr !important;
  }

  .quick-access > div:first-of-type > div {
    padding: 0.75rem !important;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 0.5rem;
  }

  .topbar-btn {
    font-size: 11px;
    padding: 4px 8px;
  }

  .topbar-title i {
    font-size: 1.2rem;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .header,
  .user-input,
  .quick-access {
    padding: 1rem;
  }

  .btn {
    width: 100%;
    margin-top: 0.5rem;
  }

  input {
    font-size: 14px;
    padding: 10px 12px;
  }

  .user-input > .form-group > div {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  .user-input > .form-group > div > input {
    margin-bottom: 0 !important;
  }
}

/* ============================================
   自定義通知系統 - Modal & Toast
   ============================================ */

/* Modal 背景遮罩 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Modal 主體 */
.modal {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 90vw;
  width: 500px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal {
  transform: scale(1);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #000000;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #666;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #E62727;
}

.modal-body {
  padding: 1.5rem;
  line-height: 1.6;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* Toast 通知 */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 300px;
  pointer-events: auto;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.hide {
  transform: translateX(100%);
  opacity: 0;
}

.toast-icon {
  font-size: 1.25rem;
  margin-top: 0.125rem;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.toast-message {
  color: #333333;
  font-size: 0.85rem;
  word-wrap: break-word;
}

.toast-close {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  flex-shrink: 0;
  font-size: 1rem;
}

.toast-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #E62727;
}

/* Toast 類型樣式 */
.toast.success {
  border-left: 4px solid #10B981;
}

.toast.success .toast-icon {
  color: #10B981;
}

.toast.error {
  border-left: 4px solid #E62727;
}

.toast.error .toast-icon {
  color: #E62727;
}

.toast.warning {
  border-left: 4px solid #F59E0B;
}

.toast.warning .toast-icon {
  color: #F59E0B;
}

.toast.info {
  border-left: 4px solid #3B82F6;
}

.toast.info .toast-icon {
  color: #3B82F6;
}

/* Modal 按鈕樣式 */
.modal-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.modal-btn-primary {
  background: #E62727;
  color: white;
  border: 2px solid #E62727;
}

.modal-btn-primary:hover {
  background: #d61e1e;
  border-color: #d61e1e;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(230, 39, 39, 0.3);
}

.modal-btn-secondary {
  background: rgba(0, 0, 0, 0.1);
  color: #000000;
  border: 2px solid rgba(0, 0, 0, 0.2);
}

.modal-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.modal-btn-danger {
  background: #E62727;
  color: white;
  border: 2px solid #E62727;
}

.modal-btn-danger:hover {
  background: #d61e1e;
  border-color: #d61e1e;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(230, 39, 39, 0.3);
}

.modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ============================================
   美化下拉選單
   ============================================ */

/* 自定義 Select 樣式 */
.custom-select {
  position: relative;
  display: inline-block;
  width: 100%;
}

.custom-select select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 12px 40px 12px 16px;
  border: 2px solid #333333;
  border-radius: 12px;
  font-size: 16px;
  background: white;
  color: #000000;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.custom-select select:focus {
  outline: none;
  border-color: #E62727;
  box-shadow: 0 0 0 3px rgba(230, 39, 39, 0.1);
}

.custom-select select:hover {
  border-color: #E62727;
}

.custom-select::after {
  content: '\f107';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #333333;
  pointer-events: none;
  transition: all 0.3s ease;
}

.custom-select:hover::after {
  color: #E62727;
}

.custom-select select:focus + .custom-select::after,
.custom-select select:focus ~ .custom-select::after {
  color: #E62727;
  transform: translateY(-50%) rotate(180deg);
}