/* 定義全站顏色與設計變數 (淺色模式) */
:root {
  /* 主色系：沉穩專業的科技藍 */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-active: #1d4ed8;
  
  /* 次要色/灰階 */
  --bg-main: #F1F1F3; /* 使用者指定的淺灰白底 */
  --bg-card: rgba(255, 255, 255, 0.85); /* 半透明白色，維持微玻璃質感 */
  --text-main: #1e293b; /* 深色文字 */
  --text-muted: #64748b; /* 灰色說明文字 */
  --border-color: rgba(0, 0, 0, 0.08); /* 淺色邊框 */
  
  /* 基礎設定 */
  --radius: 12px;
  --transition: 0.2s ease;
}

/* 全域樣式 */
body {
  margin: 0;
  /* 結合 Inter (英文/數字) 與 Noto Sans TC (中文) */
  font-family: 'Inter', 'Noto Sans TC', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  padding: 1rem;
  line-height: 1.6;
}

/* 主容器：確保響應式 */
.container {
  width: 100%;
  max-width: 768px; /* 稍微加寬適應資訊呈現 */
}

/* 標題設計 */
header h1 {
  text-align: center;
  margin-bottom: 2.5rem;
  font-weight: 700;
  font-size: 2rem;
  color: var(--text-main);
  letter-spacing: 1px;
}

header h1 i {
  color: var(--primary);
  margin-right: 0.5rem;
}

/* 卡片設計 - 淺色模式微玻璃質感 */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05); /* 陰影調整為淺色調 */
}

.card h2 {
  margin-top: 0;
  font-size: 1.25rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card h2 i {
  color: var(--primary);
}

/* 表單樣式 */
.input-group {
  margin-bottom: 1.25rem;
}

.input-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.input-group input {
  width: 100%;
  padding: 0.875rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: #ffffff;
  color: var(--text-main);
  box-sizing: border-box;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* 按鈕樣式 */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  width: 100%;
  padding: 0.875rem;
  background-color: var(--primary);
  color: white;
  font-size: 1rem;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-primary:active {
  background-color: var(--primary-active);
  transform: translateY(1px);
}

/* 列表樣式 */
.product-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.product-item {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.02);
  padding: 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  transition: all var(--transition);
}

.product-item:hover {
  background: rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.product-info {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.product-name {
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.product-details {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
}

.product-details span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* 小按鈕樣式 */
.action-buttons {
  display: flex;
  gap: 0.75rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-update {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}

.btn-update:hover {
  background-color: rgba(0, 0, 0, 0.08);
}

#loading-message {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
}

/* 響應式佈局 (Mobile First, 大螢幕調整) */
@media (min-width: 768px) {
  body {
    padding: 2rem;
  }
  
  .product-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .product-info {
    margin-bottom: 0;
  }
}

/* Auth Modal 樣式 */
.auth-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.auth-modal.active {
  display: flex;
}

.auth-modal-content {
  width: 90%;
  max-width: 400px;
  margin: 0;
}
