/* 艺现铂金管理后台 · 全部样式（含响应式：电脑左侧导航 / 手机底部导航） */

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

:root {
  --primary: #c8a24b;       /* 铂金金 */
  --primary-dark: #a9853a;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #2b2f36;
  --text-light: #8a919c;
  --danger: #d9534f;
  --success: #3f9d63;
  --info: #3a7bd5;
  --warning: #d98b2b;
  --border: #e4e7ec;
  --radius: 10px;
}

html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.hidden { display: none !important; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
  line-height: 1.4;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { color: var(--danger); border-color: #f0c4c2; }
.btn-danger:hover { background: #fdf1f0; border-color: var(--danger); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; padding: 11px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 登录页 ---------- */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #2b2f36 0%, #4a4234 100%);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 14px;
  padding: 36px 30px 28px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.login-title { text-align: center; font-size: 24px; letter-spacing: 4px; color: var(--primary); }
.login-sub { text-align: center; color: var(--text-light); margin: 8px 0 26px; font-size: 13px; }
.login-error { color: var(--danger); margin-top: 12px; text-align: center; min-height: 18px; font-size: 13px; }

/* ---------- 表单 ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; color: var(--text-light); font-size: 13px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.field input:disabled { background: #f2f3f5; color: var(--text-light); }
.field.inline { display: flex; align-items: center; gap: 10px; }
.field.inline > span { margin: 0; white-space: nowrap; }
.field.inline > select { flex: 1; }
.field textarea { min-height: 70px; resize: vertical; }

/* ---------- 布局 ---------- */
.app-view { min-height: 100vh; }
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 200px;
  background: #23262c;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
  z-index: 20;
}
.brand { font-size: 19px; letter-spacing: 3px; color: var(--primary); padding: 0 10px 20px; border-bottom: 1px solid #35393f; }
.brand span { display: block; font-size: 12px; letter-spacing: 1px; color: var(--text-light); margin-top: 4px; }
.side-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; margin-top: 16px; }
.side-nav a {
  color: #cfd3da;
  text-decoration: none;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 15px;
}
.side-nav a:hover { background: #2f333a; color: #fff; }
.side-nav a.active { background: var(--primary); color: #fff; }
.sidebar .btn-ghost { color: #9aa0a9; border-color: #3c4048; }
.sidebar .btn-ghost:hover { color: #fff; border-color: var(--danger); }

.main { margin-left: 200px; padding: 26px 30px 50px; }
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.view-head h2 { font-size: 20px; }
.view-head h3 { font-size: 16px; }
.mobile-header { display: none; }

.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.loading { color: var(--text-light); padding: 20px 0; text-align: center; }
.empty { color: var(--text-light); padding: 30px 0; text-align: center; }
.error-text { color: var(--danger); padding: 20px 0; }
.hint { color: var(--text-light); font-size: 12px; margin-top: 6px; }

/* ---------- 分类管理 ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.cat-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.cat-cover { position: relative; aspect-ratio: 2.35 / 1; background: #eef0f3; }
.cat-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #b6bcc5; font-size: 13px;
}
.cat-count {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,.62); color: #fff;
  border-radius: 10px; padding: 2px 9px; font-size: 12px;
}
.cat-info { padding: 12px 14px 14px; }
.cat-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cat-subtitle { color: var(--text-light); font-size: 13px; margin-top: 4px; min-height: 18px; word-break: break-all; }
.cat-actions { display: flex; gap: 8px; margin-top: 12px; }
.tag {
  display: inline-block; font-size: 11px; padding: 1px 7px;
  border-radius: 4px; background: #eef0f3; color: var(--text-light);
}
.tag-system { background: #e7edf8; color: var(--info); }
.cover-preview {
  width: 100%; aspect-ratio: 2.35 / 1; border: 1px dashed var(--border);
  border-radius: 8px; overflow: hidden; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light); font-size: 13px; background: #fafbfc;
}
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 产品上传 ---------- */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px 16px;
  text-align: center;
  color: var(--text-light);
  cursor: pointer;
  transition: all .15s;
  position: relative;
  margin-top: 14px;
}
.upload-area:hover, .upload-area.dragover { border-color: var(--primary); background: #fbf8f1; color: var(--primary); }
.upload-area p:first-child { font-size: 15px; }
.upload-area input[type=file] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-queue { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.queue-item {
  display: flex; align-items: center; gap: 10px;
  background: #fafbfc; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; font-size: 13px;
}
.queue-item .q-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item .q-status { white-space: nowrap; }
.queue-item .q-status.ok { color: var(--success); }
.queue-item .q-status.fail { color: var(--danger); }
.progress { width: 110px; height: 6px; background: #e8eaee; border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); width: 0; transition: width .15s; }

.prod-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.prod-item {
  position: relative; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); background: #f2f3f5;
}
.prod-item img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: zoom-in;
}
.prod-check {
  position: absolute; left: 8px; top: 8px; width: 18px; height: 18px; z-index: 2;
}
.prod-item .p-idx {
  position: absolute; right: 6px; bottom: 6px;
  background: rgba(0,0,0,.55); color: #fff; font-size: 11px;
  border-radius: 4px; padding: 1px 6px;
}
.prod-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }

/* ---------- 订单管理 ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; background: #fff;
}
.filters input { width: 200px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td {
  padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data th { color: var(--text-light); font-weight: 500; font-size: 13px; background: #fafbfc; }
table.data tr:hover td { background: #fafbfc; }
.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px;
}
.st-待处理 { background: #fdf3e4; color: var(--warning); }
.st-已处理 { background: #e7edf8; color: var(--info); }
.st-已完成 { background: #e8f5ed; color: var(--success); }
.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; margin-top: 14px; color: var(--text-light); font-size: 13px; }

/* 订单详情 */
.order-meta p { margin-bottom: 8px; line-height: 1.6; word-break: break-all; }
.order-meta b { color: var(--text-light); font-weight: 500; margin-right: 4px; }
.status-btns { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.st-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.order-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 10px; }
.order-item { position: relative; border-radius: 8px; overflow: hidden; background: #f2f3f5; }
.order-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: zoom-in; }
.order-item .tag {
  position: absolute; left: 6px; top: 6px;
  background: rgba(0,0,0,.55); color: #fff; max-width: calc(100% - 12px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,22,26,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 16px;
}
.modal-box {
  background: #fff; border-radius: 12px; width: 100%; max-width: 520px;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 16px;
}
.modal-close { border: none; background: none; font-size: 22px; color: var(--text-light); cursor: pointer; line-height: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.confirm-text { line-height: 1.7; }

/* ---------- 大图 / 提示 ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.88);
  display: flex; align-items: center; justify-content: center; z-index: 200; cursor: zoom-out;
}
.lightbox img { max-width: 96vw; max-height: 96vh; object-fit: contain; }
.toast {
  position: fixed; left: 50%; top: 14%; transform: translateX(-50%);
  background: rgba(30,33,38,.92); color: #fff;
  padding: 10px 22px; border-radius: 8px; font-size: 14px; z-index: 300;
  max-width: 84vw; text-align: center;
}
.toast.error { background: rgba(217,83,79,.95); }

/* ---------- 响应式：手机 ---------- */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-header {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 15;
    background: #23262c; color: #fff;
    margin: -26px -16px 16px; padding: 12px 16px;
    font-size: 15px; letter-spacing: 1px;
  }
  .mobile-header .btn-ghost { color: #9aa0a9; border-color: #3c4048; }
  .mobile-header .btn-ghost:hover { color: #fff; }
  .main { margin-left: 0; padding: 26px 16px calc(76px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: #fff; border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a {
    text-align: center; padding: 10px 0 8px; color: var(--text-light);
    text-decoration: none; font-size: 12px; white-space: nowrap;
  }
  .bottom-nav a.active { color: var(--primary); font-weight: 600; }
  .cat-grid { grid-template-columns: 1fr; }
  .prod-list { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); }
  .filters input { width: 100%; }
  .filters { width: 100%; }
  .modal-box { max-width: 100%; }
  table.data th:nth-child(2), table.data td:nth-child(2) { display: none; } /* 手机隐藏订单号列 */
  table.data.acc th:nth-child(2), table.data.acc td:nth-child(2) { display: table-cell; } /* 账号表保留创建时间列 */
}

/* 桌面端隐藏底部导航 */
.bottom-nav { display: none; }
