/* admin/assets/css/styles.css  后台主题 */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft Yahei', sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  background: #f5f7fa;
  min-height: 100vh;
}
:root {
  --p: #ff5a4f;
  --p-2: #ffe4e2;
  --t1: #1a1a1a; --t2: #555; --t3: #999;
  --b: #ececec; --bg2: #f5f5f7;
}
.c-p { color: var(--p); }
.c-s { color: #17a571; }
.c-d { color: #fa3534; }
.c-3 { color: var(--t3); }
.fs-22 { font-size: 12px; }
.tc { text-align: center; }
.mt-16 { margin-top: 8px; }
.mt-24 { margin-top: 12px; }
.mt-32 { margin-top: 16px; }
.ml-16 { margin-left: 8px; }

/* ============ 登录 ============ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #ff8a47, #ff5a4f); }
.login-card {
  background: #fff; padding: 48px 32px;
  border-radius: 12px; width: 360px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.login-logo { font-size: 56px; text-align: center; }
.login-name { font-size: 18px; font-weight: bold; text-align: center; margin: 16px 0 24px; }
.login-input { width: 100%; padding: 12px; font-size: 14px; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 12px; }
.login-input:focus { outline: 0; border-color: var(--p); }
.login-btn { width: 100%; padding: 12px; background: var(--p); color: #fff; font-size: 14px; border: 0; border-radius: 8px; cursor: pointer; }
.login-btn:disabled { opacity: .5; }
.login-tip { font-size: 12px; text-align: center; margin-top: 12px; color: var(--t3); }

/* ============ 布局 ============ */
.layout { display: flex; height: 100vh; }

.sidebar {
  width: 220px; background: #1f1f2e; color: #fff;
  display: flex; flex-direction: column;
}
.brand { padding: 20px; font-size: 16px; font-weight: bold; text-align: center; border-bottom: 1px solid rgba(255,255,255,.1); }
.nav { list-style: none; padding: 16px 0; flex: 1; overflow-y: auto; }
.nav-item {
  padding: 12px 24px; cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .2s;
}
.nav-item:hover { background: rgba(255,255,255,.05); }
.nav-item.on { background: rgba(255,255,255,.1); border-left-color: var(--p); font-weight: bold; }

.main { flex: 1; overflow-y: auto; padding: 24px; }

.page-head { margin-bottom: 16px; }
.page-head h2 { font-size: 22px; }
.page-head .btn { padding: 8px 16px; font-size: 14px; }

.flex-b-c { display: flex; justify-content: space-between; align-items: center; }
.flex-c { display: flex; align-items: center; }
.gap-12 { gap: 8px; }

/* ============ 卡片 ============ */
.card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.card h3 { font-size: 16px; margin-bottom: 12px; }
.card-head { font-weight: bold; margin: 8px 0; }

/* ============ 统计卡 ============ */
.cards-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.stat-label { font-size: 12px; color: var(--t3); }
.stat-num { font-size: 28px; font-weight: bold; margin-top: 8px; }

/* ============ 筛选 ============ */
.filter-bar { margin-bottom: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  padding: 6px 16px;
  background: #fff; border: 1px solid var(--b); border-radius: 999px; cursor: pointer;
  font-size: 13px;
}
.filter-chip.on { background: var(--p-2); color: var(--p); border-color: var(--p); }

/* ============ 表格 ============ */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { background: #fafafa; padding: 12px; text-align: left; font-weight: 500; border-bottom: 1px solid var(--b); }
.tbl td { padding: 12px; border-bottom: 1px solid var(--b); }
.tbl tr:hover { background: #fafafa; }
.row-c { display: flex; align-items: center; gap: 12px; }
.row-img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: #eee; }
.row-actions { display: flex; gap: 6px; }
.link { color: var(--p); cursor: pointer; }
.empty { padding: 64px 0; }

/* ============ 按钮 ============ */
.btn-sm { padding: 4px 12px; background: #f5f5f7; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; font-size: 12px; }
.btn-sm:hover { background: #ececec; }
.btn-sm.btn-primary { background: var(--p); color: #fff; border-color: var(--p); }
.btn-sm.btn-primary:hover { background: #ff7a4f; }

.btn { padding: 8px 16px; background: #fff; border: 1px solid var(--b); border-radius: 6px; cursor: pointer; }
.btn-primary { background: var(--p); color: #fff; border-color: var(--p); }
.btn-primary:hover { background: #ff7a4f; }

input, select, textarea {
  padding: 8px 12px; border: 1px solid var(--b); border-radius: 6px; font-size: 14px;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--p); }

.input-sm { padding: 6px 12px; }

/* ============ 表单 ============ */
.form-row { margin-bottom: 12px; display: flex; align-items: center; gap: 16px; }
.form-row label { width: 160px; flex-shrink: 0; color: var(--t2); }
.form-row input, .form-row select, .form-row textarea { flex: 1; }
.form-row textarea { min-height: 80px; }

.stock-input { width: 80px; padding: 4px 8px; }

/* ============ 标签 ============ */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-act { background: var(--p-2); color: var(--p); }
.tag-hot { background: #fff7e6; color: #fa8c16; }
.tag-on { background: #d6f8d8; color: #17a571; }
.tag-off { background: #f0f0f0; color: #888; }
.tag-auto { background: #ffd6d6; color: #d35400; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; left: 0; right: 0; top: 0; bottom: 0;
  background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: #fff; border-radius: 12px; width: 480px;
  display: flex; flex-direction: column;
  max-height: 90vh;
}
.modal-lg { width: 720px; }
.modal-head { padding: 16px 24px; border-bottom: 1px solid var(--b); }
.modal-head h3 { font-size: 18px; }
.modal-close { font-size: 28px; cursor: pointer; color: var(--t3); }
.modal-body { padding: 24px; flex: 1; overflow-y: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--b); text-align: right; }
.modal-foot .btn { margin-left: 8px; }

.batch-textarea { width: 100%; min-height: 200px; font-family: monospace; font-size: 13px; }

/* ============ 图片上传 ============ */
.img-uploader {
  display: flex; flex-wrap: wrap; gap: 12px; padding: 8px 0;
}
.img-thumb {
  position: relative; width: 96px; height: 96px;
  border-radius: 8px; overflow: hidden; border: 1px solid var(--b);
  background: #f5f5f5;
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-del {
  position: absolute; right: 0; top: 0;
  width: 24px; height: 24px; line-height: 22px;
  background: rgba(0,0,0,.6); color: #fff;
  text-align: center; cursor: pointer; font-size: 16px;
}
.img-add {
  width: 96px; height: 96px;
  border: 1px dashed #ccc; border-radius: 8px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #999; cursor: pointer; background: #fafafa;
}
.img-add:hover { border-color: var(--p); color: var(--p); }
.img-add-plus { font-size: 28px; line-height: 1; }
.img-add-text { font-size: 11px; margin-top: 4px; }

.line { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed #eee; }
.line:last-child { border-bottom: 0; }

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.8); color: #fff;
  padding: 16px 24px; border-radius: 8px; font-size: 14px;
  z-index: 200;
  animation: fadeIn .2s;
}
.fade-enter-active, .fade-leave-active { transition: opacity .2s; }
.fade-enter, .fade-leave-to { opacity: 0; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============ bulk JSON 导入 ============ */
.bulk-json-textarea {
  width: 100%; min-height: 200px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px; line-height: 1.5;
  padding: 12px; border-radius: 6px; border: 1px solid var(--b);
  resize: vertical;
}
.mb-12 { margin-bottom: 12px; }
.mt-16 { margin-top: 16px; }
code {
  background: #f0f0f0; padding: 2px 6px; border-radius: 4px;
  font-size: 12px; color: #d6336c;
}
