/* ============================================================
   layout.css — 頁面結構：頂部、輪播、工具列、分類、搜尋
   ============================================================ */

/* ─── 微信頂部列 ─── */
.wechat-bar {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid #eee;
}
.wechat-bar img { width: 60px; height: 60px; border-radius: 6px; }
.wechat-bar span { color: #4B5563; font-size: 14px; }

/* ─── 輪播 ─── */
.carousel-wrap { position: relative; overflow: hidden; background: #fff; }
.carousel-track { display: flex; transition: transform 0.4s ease; }
.carousel-slide { min-width: 100%; }
.carousel-slide-inner img { width: 100%; display: block; }
.carousel-notice {
  text-align: center;
  padding: 8px 16px;
  font-size: 12px;
  color: #6b7280;
  background: #fff;
  border-top: 1px solid #f3f4f6;
}

/* ─── 主內容區 ─── */
.main-content { max-width: 1200px; margin: 0 auto; padding: 16px; }

/* ─── AI 工具列 ─── */
.tool-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 16px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.tool-row-btn {
  padding: 6px 18px;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  transition: opacity 0.2s;
}
.tool-row-btn:hover { opacity: 0.85; }
.tool-row-btn-double {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.2;
  padding: 6px 18px;
}
.tool-row-btn-double .btn-main { font-size: 13px; }
.tool-row-btn-double .btn-sub { font-size: 11px; opacity: 0.85; font-weight: 400; }

/* ─── 用戶列 ─── */
.user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.user-info { display: flex; align-items: center; gap: 8px; }
.user-name { font-size: 14px; font-weight: 600; color: #1f2937; }
.user-role {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 500;
}
.user-role.admin { background: #fce7f3; color: #be185d; }
.user-role.vip { background: #d1fae5; color: #065f46; }
.user-role.promo { background: #fef3c7; color: #92400e; }
.user-actions { display: flex; gap: 8px; }
.user-action-btn {
  padding: 6px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: #374151;
}
.user-action-btn:hover { border-color: #10b981; color: #10b981; }
.user-action-btn.logout-btn {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}
.user-action-btn.logout-btn:hover { background: #fee2e2; }
.user-action-btn.admin-notif-btn { position: relative; }

/* ─── 登入提示列 ─── */
.login-prompt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.login-prompt span { font-size: 14px; color: #6b7280; }
.login-prompt-btn {
  padding: 6px 18px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}
.login-prompt-btn:hover { background: #059669; }

/* ─── 分類按鈕列 ─── */
.categories { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cat-btn {
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  color: #374151;
  transition: all 0.2s;
}
.cat-btn:hover { border-color: #10b981; color: #10b981; }
.cat-btn.active { background: #10b981; color: #fff; border-color: #10b981; }

/* ─── 子列（子分類 + 搜尋） ─── */
.sub-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.sub-tabs { display: flex; gap: 8px; }
.sub-tab {
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  color: #374151;
}
.sub-tab:hover { border-color: #10b981; color: #10b981; }
.sub-tab.active { background: #10b981; color: #fff; border-color: #10b981; }

/* ─── 搜尋框 ─── */
.search-box { display: flex; }
.search-input {
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 4px 0 0 4px;
  font-size: 13px;
  outline: none;
  width: 180px;
}
.search-btn {
  padding: 6px 14px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 13px;
}
.search-btn:hover { background: #059669; }

/* ─── 綁定列 ─── */
.bind-bar {
  display: none;
  justify-content: flex-end;
  padding: 8px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

/* ─── 管理員工具列 ─── */
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.admin-toolbar-btn {
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: #374151;
}
.admin-toolbar-btn:hover { border-color: #10b981; color: #10b981; }
.admin-toolbar-btn.add-btn {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}
.admin-toolbar-btn.add-btn:hover { background: #059669; }
.admin-toolbar-btn.active { background: #f59e0b; color: #fff; border-color: #f59e0b; }

/* ─── 管理員面板（收合式） ─── */
.admin-panel-collapsed {
  background: #fff;
  border-radius: 8px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}
.admin-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}
.admin-panel-header:hover { background: #f9fafb; }
.admin-panel-arrow { font-size: 12px; transition: transform 0.2s; }
.admin-panel-content { padding: 0 16px 16px; border-top: 1px solid #e5e7eb; }
.admin-section { margin-top: 12px; }
.admin-section h4 { font-size: 13px; margin-bottom: 8px; color: #374151; }
.admin-hint { font-size: 11px; color: #6b7280; margin-bottom: 8px; }
.admin-panel-content .admin-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-panel-content input[type="text"] {
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 13px;
}
.admin-panel-content select {
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 13px;
}
.admin-panel {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.admin-panel h3 { font-size: 16px; margin-bottom: 8px; }
.admin-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.admin-add-btn {
  padding: 6px 16px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.admin-add-btn:hover { background: #059669; }
.admin-msg { margin-top: 8px; font-size: 13px; }
.admin-user-list { margin-top: 12px; font-size: 13px; }

/* ─── 手機版 ─── */
@media (max-width: 640px) {
  .sub-bar { flex-direction: column; gap: 8px; }
  .search-input { width: 100%; }
  .search-box { width: 100%; }
  .admin-row { flex-direction: column; }
}
