/* 合丰皮革 · 管理后台样式 */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f4f5f7;
  color: #33383d;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
               "Microsoft YaHei", "PingFang SC", "Noto Sans", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a { color: #dd0000; text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: ui-monospace, Consolas, "Courier New", monospace; }

/* ---------------------------------------------------------- 顶栏 */
.topbar {
  background: #2b1a12;
  color: #fff;
  padding: .8rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}
.topbar .brand { font-weight: 700; letter-spacing: .1em; }
.topbar .brand small { font-weight: 400; opacity: .65; letter-spacing: 0; margin-left: .5rem; }
.topbar nav a { color: rgba(255,255,255,.85); margin-left: 1rem; font-size: .88rem; }
.topbar nav a:hover { color: #fff; }

/* ---------------------------------------------------------- 布局 */
.wrap { max-width: 68rem; margin: 0 auto; padding: 1.2rem; }
.page-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 1rem; color: #22262b; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head .page-title { margin: 0; }

.card {
  background: #fff;
  border: 1px solid #e4e6ea;
  border-radius: 8px;
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .8rem; }
.stat { background: #fff; border: 1px solid #e4e6ea; border-radius: 8px; padding: .9rem 1rem; }
.stat .n { font-size: 1.5rem; font-weight: 700; color: #22262b; }
.stat .l { font-size: .8rem; color: #8a9099; }

/* ---------------------------------------------------------- 消息条 */
.msg { border-radius: 6px; padding: .6rem .9rem; margin-bottom: 1rem; font-size: .9rem; }
.msg.ok  { background: #eefaf1; border: 1px solid #34a853; color: #1e7a37; }
.msg.err { background: #fdecec; border: 1px solid #dd0000; color: #bb0000; }

/* ---------------------------------------------------------- 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid #eceef1; vertical-align: middle; }
th { font-size: .8rem; color: #8a9099; font-weight: 600; background: #fafbfc; }
tbody tr:hover { background: #fafbfc; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- 按钮 */
.btn {
  display: inline-block;
  border: 1px solid #d5d8dd;
  background: #fff;
  color: #33383d;
  border-radius: 6px;
  padding: .35rem .8rem;
  font-size: .85rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.5;
}
.btn:hover { background: #f4f5f7; text-decoration: none; }
.btn.primary { background: #dd0000; border-color: #dd0000; color: #fff; }
.btn.primary:hover { background: #c00000; }
.btn.danger { color: #bb0000; border-color: #f0c4c4; }
.btn.danger:hover { background: #fdecec; }
.btn.sm { padding: .2rem .55rem; font-size: .78rem; }

.row-actions { display: flex; gap: .35rem; flex-wrap: wrap; }

/* ---------------------------------------------------------- 表单 */
label.field { display: block; margin-bottom: .9rem; }
label.field .k { display: block; font-size: .85rem; color: #5b626b; margin-bottom: .25rem; font-weight: 600; }
label.field .hint { font-weight: 400; color: #9aa0a8; }

input[type=text], input[type=password], input[type=number], textarea {
  width: 100%;
  padding: .5rem .65rem;
  border: 1px solid #d5d8dd;
  border-radius: 6px;
  font-size: .92rem;
  font-family: inherit;
  background: #fff;
}
input:focus, textarea:focus { outline: 2px solid rgba(221,0,0,.25); border-color: #dd0000; }
textarea { min-height: 5rem; resize: vertical; }

.form-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0 1.2rem; }
.form-actions { display: flex; gap: .6rem; align-items: center; padding-top: .4rem; border-top: 1px solid #eceef1; margin-top: 1rem; }

.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inline-form input[type=number] { width: 6rem; }

/* ---------------------------------------------------------- 提示块 */
.tip {
  background: #fffaf0;
  border: 1px solid #f0d9a8;
  color: #8a6a1e;
  border-radius: 6px;
  padding: .7rem .9rem;
  font-size: .85rem;
  margin-bottom: 1rem;
}
.tip code { background: rgba(0,0,0,.05); padding: .1rem .35rem; border-radius: 3px; }

/* ---------------------------------------------------------- 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.login-card { background: #fff; border: 1px solid #e4e6ea; border-radius: 8px; padding: 2rem 1.8rem; width: 100%; max-width: 22rem; }
.login-card h1 { font-size: 1.1rem; margin: 0 0 .3rem; color: #22262b; }
.login-card .sub { color: #8a9099; font-size: .85rem; margin: 0 0 1.4rem; }

/* ---------------------------------------------------------- 产品中心管理 */
.pc-admin {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 60rem) {
  .pc-admin { grid-template-columns: 1fr; }
}

.sec-title {
  font-size: .95rem;
  font-weight: 700;
  color: #22262b;
  margin: 0 0 .8rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid #eceef1;
}

.color-list { display: flex; flex-direction: column; gap: .4rem; }

.color-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .35rem .5rem;
  border: 1px solid #eceef1;
  border-radius: 6px;
  background: #fff;
}
.color-item:hover { background: #fafbfc; }

.color-edit {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.mini-swatch {
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, .12);
}

/* ---------------------------------------------------------- 码列表 */
.code-cell { display: flex; align-items: center; gap: .5rem; }
.qr-thumb { width: 34px; height: 34px; border: 1px solid #eceef1; border-radius: 4px; }
.badge { display: inline-block; font-size: .75rem; padding: .05rem .4rem; border-radius: 10px; background: #f0f1f3; color: #6b7178; }
.badge.warn { background: #fdecec; color: #bb0000; }

/* ---------------------------------------------------------- 打印页 */
.print-toolbar {
  background: #fff;
  border-bottom: 1px solid #e4e6ea;
  padding: .8rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
}
.print-sheet { padding: 1.2rem; }
.label-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.qr-label {
  border: 1px dashed #c9ccd1;
  border-radius: 6px;
  padding: .6rem .4rem;
  text-align: center;
  break-inside: avoid;
  page-break-inside: avoid;
}
.qr-label img { width: 100%; max-width: 150px; height: auto; display: block; margin: 0 auto .35rem; }
.qr-label .code { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; letter-spacing: .05em; color: #22262b; }
.qr-label .co { font-size: .68rem; color: #9aa0a8; }

@media print {
  body { background: #fff; }
  .print-toolbar { display: none; }
  .print-sheet { padding: 0; }
  .label-grid { grid-template-columns: repeat(3, 1fr); gap: 4mm; }
  .qr-label { border-color: #ddd; }
  @page { margin: 12mm; }
}
