/* ============================================================
   staff.harroldkid.com 内容区样式
   复用 admin (harroldkid-console) 的 Light commerce cockpit 设计 token
   组件：workspace / 卡片 / 按钮 / 表格 / 浮窗 / 商品网格
   ============================================================ */

/* ---- 设计 token（与 admin styles.css :root 一致）---- */
:root {
  color-scheme: light;
  --hk-ui-bg: #f4f6fa;
  --hk-ui-panel: #ffffff;
  --hk-ui-panel-soft: #f8fafc;
  --hk-ui-ink: #111827;
  --hk-ui-text: #27313f;
  --hk-ui-muted: #667085;
  --hk-ui-faint: #98a2b3;
  --hk-ui-line: #e5e7ef;
  --hk-ui-line-strong: #d0d5dd;
  --hk-ui-green: #16a36a;
  --hk-ui-red: #e25544;
  --hk-ui-blue: #4f7cff;
  --hk-ui-brass: #e5a900;
  --hk-ui-orange: #f97316;
  --hk-ui-shadow: 0 18px 44px rgba(15, 23, 42, 0.10);
  --hk-ui-shadow-sm: 0 12px 28px rgba(18, 31, 46, 0.06);
  /* 别名 */
  --bg: var(--hk-ui-bg);
  --panel: var(--hk-ui-panel);
  --ink: var(--hk-ui-ink);
  --muted: var(--hk-ui-muted);
  --line: var(--hk-ui-line);
  --accent: var(--hk-ui-blue);
  --accent-strong: #2f5cff;
  --shadow: var(--hk-ui-shadow);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(17, 24, 39, 0.028) 1px, transparent 1px),
    linear-gradient(135deg, #fbfcff 0%, #f4f6fa 56%, #eef3ff 100%);
  background-size: 48px 48px, 48px 48px, auto;
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- workspace 内容容器（复用 admin .workspace 规范）---- */
.workspace {
  width: min(1440px, calc(100% - clamp(24px, 4vw, 56px)));
  margin: 22px auto 42px;
}

/* ---- 页面标题区 ---- */
.page-head { margin-bottom: 22px; }
.page-head .eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.page-head h1 {
  font-size: 28px;
  line-height: 1.16;
  font-weight: 850;
  color: var(--ink);
  margin-bottom: 6px;
}
.page-head p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ---- 工具条 ---- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--hk-ui-shadow-sm);
}
.toolbar .spacer { flex: 1; }
.toolbar .count { color: var(--muted); font-size: 13px; }
.toolbar .count b { color: var(--ink); font-size: 15px; font-weight: 850; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.08s;
  font-family: inherit;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:disabled {
  background: #c3cbdb;
  color: #ffffff;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: var(--hk-ui-red);
  color: #ffffff;
}

/* ---- 商品网格 ---- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
  box-shadow: var(--hk-ui-shadow-sm);
}
.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--hk-ui-shadow);
}
.product-card.selected {
  border-color: var(--hk-ui-green);
  box-shadow: 0 0 0 2px rgba(22, 163, 106, 0.18), var(--hk-ui-shadow);
}

.product-thumb {
  width: 100%;
  aspect-ratio: 1;
  background: var(--hk-ui-panel-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-thumb .ph {
  color: var(--hk-ui-faint);
  font-size: 13px;
}
.product-thumb .badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 9px;
  border-radius: 5px;
  background: rgba(17, 24, 39, 0.7);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}
.product-thumb .badge.warn { background: rgba(249, 115, 22, 0.92); }

.product-body {
  padding: 13px 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.product-name {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--ink);
}
.product-id {
  color: var(--hk-ui-faint);
  font-weight: 600;
  font-size: 11px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.product-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--hk-ui-panel-soft);
  color: var(--muted);
  font-weight: 700;
}
.tag.ip { background: rgba(79, 124, 255, 0.12); color: var(--accent); }
.tag.collab { background: rgba(229, 169, 0, 0.14); color: #a07900; }

.product-desc {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
  background: var(--hk-ui-panel-soft);
}
.cbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  flex: 1;
  color: var(--ink);
}
.cbox input {
  width: 17px;
  height: 17px;
  accent-color: var(--hk-ui-green);
  cursor: pointer;
}

/* ---- 空状态 ---- */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}
.empty-state .ico {
  font-size: 44px;
  margin-bottom: 12px;
  opacity: 0.7;
}
.empty-state .hint { font-size: 13px; margin-top: 4px; }

/* ---- 旋转图标 ---- */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: sp 0.7s linear infinite;
  vertical-align: -2px;
}
@keyframes sp { to { transform: rotate(360deg); } }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--hk-ui-shadow);
  z-index: 80;
  display: none;
}
.toast.show { display: block; }

/* ---- 生成弹窗 ---- */
.gen-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 70;
  padding: 20px;
}
.gen-modal.show { display: flex; }
.gen-box {
  background: var(--panel);
  border-radius: 14px;
  padding: 30px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: var(--hk-ui-shadow);
}
.gen-box h3 { font-size: 18px; margin-bottom: 8px; }
.gen-box .msg { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.gen-prog {
  height: 6px;
  background: var(--hk-ui-panel-soft);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 18px;
}
.gen-prog i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.3s;
}
.gen-done { display: none; }
.gen-done.show { display: block; }
.gen-done .ok { color: var(--hk-ui-green); font-weight: 800; margin-bottom: 12px; }
.dl-btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 8px;
  background: var(--hk-ui-green);
  color: #06281a;
  font-weight: 800;
  text-decoration: none;
  margin: 4px;
  font-size: 13px;
}
.dl-btn.alt { background: var(--accent); color: #ffffff; }

/* ============================================================
   右侧可关闭浮窗
   ============================================================ */
.staff-float {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 320px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--hk-ui-shadow);
  z-index: 60;
  overflow: hidden;
  transition: transform 0.2s, opacity 0.2s;
}
.staff-float.hidden {
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  pointer-events: none;
}
.staff-float-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--ink);
  color: #ffffff;
}
.staff-float-head .title { font-size: 13px; font-weight: 800; flex: 1; }
.staff-float-head .close {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.staff-float-head .close:hover { background: rgba(255, 255, 255, 0.3); }
.staff-float-body {
  padding: 14px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--hk-ui-text);
}
.staff-float-body .tip { color: var(--muted); margin-top: 8px; font-size: 12px; }
.staff-float-body .shortcut {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--hk-ui-panel-soft);
  font-family: ui-monospace, monospace;
  font-size: 11px;
}

/* 浮窗收起后的小气泡按钮 */
.staff-float-bubble {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--hk-ui-shadow);
  z-index: 60;
  display: none;
}
.staff-float-bubble.show { display: block; }
.staff-float-bubble:hover { background: var(--accent); }

/* ---- 登录页 ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--panel);
  padding: 40px 36px;
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  border: 1px solid var(--line);
  box-shadow: var(--hk-ui-shadow);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.login-logo::before {
  content: "H";
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--ink);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}
.login-logo b { font-size: 19px; font-weight: 900; }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.login-card input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid var(--hk-ui-line-strong);
  background: var(--hk-ui-panel-soft);
  color: var(--ink);
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
  font-family: inherit;
}
.login-card input:focus { border-color: var(--accent); background: var(--panel); }
.login-err { color: var(--hk-ui-red); font-size: 13px; margin-bottom: 10px; text-align: center; }
