/* ============================================================
   components.css — 卡片、標籤、分頁、綁定、通知、下載
   ============================================================ */

/* ─── 卡片網格 ─── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* ─── 卡片 ─── */
.card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.card-img { position: relative; aspect-ratio: 1/1; overflow: hidden; }
.card-img-inner { width: 100%; height: 100%; }

/* ─── 標籤 ─── */
.card-badge { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; }
.badge { padding: 2px 6px; border-radius: 3px; font-size: 10px; font-weight: 600; }
.badge-copy { background: #e0e7ff; color: #4338ca; }
.badge-new { background: #dcfce7; color: #166534; }
.badge-limit { background: #fef3c7; color: #92400e; }
.badge-hot { background: #fee2e2; color: #dc2626; }
.badge-vip { background: #e0e7ff; color: #4f46e5; }
.badge-recommend { background: #d1fae5; color: #059669; }
.badge-free { background: #dbeafe; color: #2563eb; }

/* ─── 卡片檔案標籤 ─── */
.card-files { padding: 6px 8px; display: flex; gap: 4px; }
.file-tag { padding: 2px 6px; background: #f3f4f6; border-radius: 3px; font-size: 10px; color: #6b7280; }
.file-tag.fla { background: #fef3c7; color: #92400e; }

/* ─── 卡片底部 ─── */
.card-footer {
  padding: 6px 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-name { font-size: 13px; color: #1f2937; font-weight: 500; }
.card-preview { font-size: 12px; color: #10b981; cursor: pointer; }
.card-preview:hover { text-decoration: underline; }

/* ─── 卡片管理員設定 ─── */
.card-settings-wrap { position: absolute; top: 8px; right: 8px; z-index: 5; }
.card-settings-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  background: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.card-settings-btn:hover { background: #fff; transform: rotate(30deg); transition: transform 0.2s; }
.card-settings-menu {
  position: absolute;
  top: 32px;
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  border: 1px solid #e5e7eb;
  overflow: hidden;
  z-index: 10;
  min-width: 100px;
}
.settings-menu-btn {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: none;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  color: #374151;
}
.settings-menu-btn:hover { background: #f3f4f6; }
.settings-menu-btn.delete { color: #ef4444; border-top: 1px solid #f3f4f6; }
.settings-menu-btn.delete:hover { background: #fef2f2; }
.settings-menu-section { padding: 8px 14px; border-bottom: 1px solid #f3f4f6; }
.settings-menu-label { font-size: 11px; color: #9ca3af; display: block; margin-bottom: 4px; }
.settings-menu-cat {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 13px;
  background: #f9fafb;
  cursor: pointer;
}
.settings-menu-cat:focus { outline: none; border-color: #3b82f6; }

/* ─── 卡片舊版操作按鈕（向後相容） ─── */
.card-admin-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.card-admin-btn {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  background: rgba(255,255,255,0.9);
}
.card-admin-btn:hover { background: #fff; }

/* ─── 下載鎖定層 ─── */
.download-lock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  padding: 12px;
  text-align: center;
  color: #fff;
}
.download-lock-icon { font-size: 20px; margin-bottom: 4px; }
.download-lock-text { font-size: 12px; margin-bottom: 6px; }
.download-lock-btn {
  padding: 4px 16px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.download-lock-btn:hover { background: #059669; }

/* ─── 下載區域（卡片內） ─── */
.download-area {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
.download-btn {
  padding: 6px 20px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}
.download-btn:hover { background: #059669; transform: scale(1.05); }
.download-btn:disabled { background: #9ca3af; cursor: not-allowed; transform: none; }
.download-count { font-size: 11px; color: #d1d5db; }

/* ─── 下載檔案列表（預覽內） ─── */
.download-files-list { margin-bottom: 8px; }
.download-files-list .dl-file-btn {
  display: block;
  padding: 8px 12px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 4px;
  text-align: center;
}
.download-files-list .dl-file-btn:hover { background: #059669; }
.download-files-list .dl-file-btn.disabled { background: #9ca3af; cursor: not-allowed; }

/* ─── 分頁 ─── */
.pagination-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 8px 0;
}
.page-total { font-size: 13px; color: #6b7280; }
.pagination-btns { display: flex; gap: 4px; }
.page-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.page-btn:hover { border-color: #10b981; color: #10b981; }
.page-btn.active { background: #10b981; color: #fff; border-color: #10b981; }
.page-btn.disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── 綁定項目 ─── */
.bind-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f9fafb;
  border-radius: 6px;
  margin-bottom: 8px;
}
.bind-item .bind-platform { font-weight: 600; color: #111827; }
.bind-item .bind-account { color: #6b7280; margin-left: 8px; font-size: 13px; }
.bind-item .bind-time { color: #9ca3af; font-size: 11px; margin-top: 2px; }
.bind-unbind-btn {
  padding: 4px 12px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}
.all-bind-user {
  padding: 10px 14px;
  background: #f9fafb;
  border-radius: 6px;
  margin-bottom: 8px;
}
.all-bind-user .bind-user-name { font-weight: 600; color: #111827; margin-bottom: 4px; }
.all-bind-user .bind-user-bindings { font-size: 12px; color: #6b7280; }

/* ─── 通知項目 ─── */
.notif-item { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; cursor: pointer; }
.notif-item.unread { background: #f0fdf4; }
.notif-item .notif-from { font-size: 13px; font-weight: 500; color: #1f2937; }
.notif-item .notif-msg { font-size: 12px; color: #6b7280; margin-top: 4px; }
.notif-item .notif-time { font-size: 11px; color: #9ca3af; margin-top: 4px; }

/* ─── 需求項目 ─── */
#requestPanel .request-item {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 8px;
}
#requestPanel .request-item .req-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#requestPanel .request-item .req-time { font-size: 11px; color: #9ca3af; }
#requestPanel .request-item .req-content { margin-top: 8px; font-size: 13px; color: #374151; }

/* ─── 編輯檔案項目 ─── */
.edit-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #f9fafb;
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 13px;
}
.edit-file-item .file-size { font-size: 11px; color: #9ca3af; }
.edit-file-item .remove-file {
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}

/* ─── 需求圖片預覽 ─── */
.request-img-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.request-img-preview .preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}
.request-img-preview .preview-item img { width: 100%; height: 100%; object-fit: cover; }
.request-img-preview .preview-item .remove-img {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.req-images { max-height: 200px; overflow-y: auto; }

/* ─── 手機版卡片 ─── */
@media (max-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-name { font-size: 12px; }
}
