/* ====================================================================
   site-v2 共用基底樣式 — Reset、字型、通用元件
   ==================================================================== */

/* ── Reset & Base ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── 通用徽章(badge) ── */
.badge { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 0.75em; font-weight: bold; margin-left: 4px; }
.badge-gold { background-color: #fef3c7; color: #d97706; border: 1px solid #fcd34d; }
.badge-red { background-color: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.badge-green { background-color: #d1fae5; color: #059669; border: 1px solid #6ee7b7; }
.badge-office { background-color: #e0e7ff; color: #4338ca; border: 1px solid #c7d2fe; }
.badge-store { background-color: #f3e8ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.badge-blue { background-color: #dbeafe; color: #2563eb; border: 1px solid #93c5fd; }
.badge-gray { background-color: #f3f4f6; color: #6b7280; border: 1px solid #d1d5db; }

/* ── Loading spinner ── */
.loader {
  border: 3px solid #f3f3f3;
  border-radius: 50%;
  border-top: 3px solid #3498db;
  width: 20px; height: 20px;
  animation: spin 2s linear infinite;
  display: inline-block;
}
.loader-lg { width: 32px; height: 32px; border-width: 4px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ── 標籤按鈕(分頁切換) ── */
.tab-btn {
  padding: 0.75rem 1rem;
  color: #4b5563;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  background: none;
  border-top: none; border-left: none; border-right: none;
}
.tab-btn:hover { color: #2563eb; background-color: #eff6ff; }
.tab-btn.active { border-bottom: 2px solid #2563eb; color: #2563eb; font-weight: bold; background-color: #eff6ff; }

/* ── 統計卡片 ── */
.stat-box {
  background: white;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
  transition: transform 0.2s;
}
.stat-box:hover { transform: translateY(-1px); }
.stat-label { font-size: 0.75rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 1.5rem; font-weight: 700; margin-top: 4px; }

/* ── 表格通用 ── */
table.sortable th { cursor: pointer; user-select: none; }
table.sortable th:hover { background-color: #e5e7eb; }
.sort-icon { display: inline-block; width: 1em; text-align: center; font-size: 0.8em; margin-left: 4px; color: #9ca3af; }
.th-active .sort-icon { color: #2563eb; font-weight: bold; }

/* ── 按鈕通用 ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  transition: all 0.15s;
}
.btn:hover { background: #f9fafb; border-color: #9ca3af; }
.btn-primary { background: #2563eb; color: white; border-color: #2563eb; }
.btn-primary:hover { background: #1d4ed8; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
