/* Ozon 选品助手 桌面软件 Demo 样式 —— 质朴电商风 */
:root {
  --c-bg: #f6f7f5;
  --c-card: #ffffff;
  --c-line: #e6e8e3;
  --c-text: #1f2a26;
  --c-muted: #7b8479;
  --c-mute: #7b8479;           /* alias */
  --c-primary: #2f7a5a;       /* 墨绿 */
  --c-primary-d: #235e44;
  --c-primary-l: #e8f3ee;
  --c-primary-light: #e8f3ee;  /* alias */
  --c-warn: #c47a1d;
  --c-danger: #b3422f;
  --c-accent: #f1ead8;        /* 米色高亮 */
  --r: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 13px;
  line-height: 1.55;
}
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== 整体布局 ========== */
.app { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
.sidebar {
  background: #fbfbf8;
  border-right: 1px solid var(--c-line);
  padding: 16px 0;
}
.brand {
  padding: 0 18px 14px;
  border-bottom: 1px solid var(--c-line);
  margin-bottom: 12px;
}
.brand-name {
  font-size: 15px; font-weight: 600; color: var(--c-primary-d);
  letter-spacing: 0.4px;
}
.brand-sub { color: var(--c-muted); font-size: 11px; margin-top: 2px; }
.nav { list-style: none; margin: 0; padding: 0; }
.nav-group { padding: 12px 18px 4px; color: var(--c-muted); font-size: 11px; letter-spacing: 0.5px; }
.nav li a {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 18px; color: var(--c-text);
}
.nav li a:hover { background: #f1f1ec; text-decoration: none; }
.nav li.active a { background: var(--c-primary-l); color: var(--c-primary-d); border-left: 3px solid var(--c-primary); padding-left: 15px; }
.nav-icon { width: 14px; text-align: center; opacity: 0.7; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 48px; background: #fff; border-bottom: 1px solid var(--c-line);
  display: flex; align-items: center; padding: 0 18px; gap: 16px;
}
.crumbs { font-size: 12px; color: var(--c-muted); }
.crumbs strong { color: var(--c-text); font-weight: 500; }
.topbar .right { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px; background: #f1f1ec; border-radius: 100px; font-size: 12px;
}
.avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--c-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; }

.content { padding: 18px 22px; flex: 1; }

/* ========== 通用组件 ========== */
.card {
  background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--r); padding: 18px 20px; margin-bottom: 14px;
}
.card-head { display: flex; align-items: center; margin-bottom: 12px; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 0 14px; height: 32px; border: 1px solid var(--c-line);
  background: #fff; border-radius: var(--r);
  font-size: 12px; cursor: pointer; color: var(--c-text);
  white-space: nowrap; flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: #f6f6f1; }
.btn { text-decoration: none; }
.btn-primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-d); }
.btn-warn { background: #fff; color: var(--c-warn); border-color: #e3c995; }
.btn-danger { background: #fff; color: var(--c-danger); border-color: #e2b4ab; }
.btn-sm { padding: 0 9px; height: 26px; font-size: 11px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--c-primary); }

.input, select {
  width: 100%; padding: 0 10px; height: 32px; line-height: 32px;
  border: 1px solid var(--c-line);
  border-radius: var(--r); font-size: 12px; background: #fff; color: var(--c-text);
  font-family: inherit;
}
select {
  -webkit-appearance: none;
  appearance: none;
  padding: 0 28px 0 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%237b8479' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
}
textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--c-line);
  border-radius: var(--r); font-size: 12px; background: #fff; color: var(--c-text);
  font-family: inherit; resize: vertical;
}
.input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-primary); }
label { font-size: 12px; color: var(--c-muted); display: block; margin-bottom: 5px; }

/* ===== 表单行：底对齐，label 顶，控件底 ===== */
.field {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}
.field > label { flex-shrink: 0; }
.field > .input, .field > select, .field > textarea { flex: 1; }

.row { display: flex; gap: 14px; align-items: flex-end; }
.row > .field { flex: 1; margin-bottom: 0; }

.tag {
  display: inline-block; padding: 1px 8px; font-size: 11px;
  border-radius: 100px; background: var(--c-primary-l); color: var(--c-primary-d);
}
.tag-warn { background: #fcf1de; color: var(--c-warn); }
.tag-danger { background: #fbe9e3; color: var(--c-danger); }
.tag-mute { background: #ececeb; color: var(--c-muted); }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; padding: 9px 10px; background: #f7f7f3; color: var(--c-muted); font-weight: 500; border-bottom: 1px solid var(--c-line); }
td { padding: 9px 10px; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
tr:hover td { background: #fafaf7; }

.thumb { width: 44px; height: 44px; border-radius: 4px; object-fit: cover; background: #ececeb; }

.kv { display: grid; grid-template-columns: 100px 1fr; gap: 6px 14px; font-size: 12px; }
.kv .k { color: var(--c-muted); }

/* 横向数据卡片 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat {
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--r);
  padding: 14px 16px;
}
.stat .lbl { color: var(--c-muted); font-size: 12px; }
.stat .val { font-size: 22px; font-weight: 600; margin: 4px 0 2px; color: var(--c-primary-d); }
.stat .delta { font-size: 11px; color: var(--c-muted); }
.stat .delta.up { color: var(--c-primary); }
.stat .delta.down { color: var(--c-danger); }

/* 步骤条 */
.steps { display: flex; align-items: center; gap: 0; margin-bottom: 16px; }
.step { display: flex; align-items: center; flex: 1; }
.step .dot {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--c-line); background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 11px;
  color: var(--c-muted);
}
.step .lbl { margin-left: 8px; font-size: 12px; color: var(--c-muted); }
.step .bar { flex: 1; height: 1px; background: var(--c-line); margin: 0 10px; }
.step.done .dot { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.step.done .lbl { color: var(--c-text); }
.step.active .dot { border-color: var(--c-primary); color: var(--c-primary); }
.step.active .lbl { color: var(--c-primary-d); font-weight: 600; }

/* 复选 / 开关 */
.switch { display: inline-block; width: 32px; height: 18px; background: #d6dad2; border-radius: 100px; position: relative; cursor: pointer; vertical-align: middle; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: #fff; border-radius: 50%; transition: .2s; }
.switch.on { background: var(--c-primary); }
.switch.on::after { left: 16px; }

/* 网格商品卡 */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.product-card { background: #fff; border: 1px solid var(--c-line); border-radius: var(--r); overflow: hidden; }
.product-card .pimg { height: 160px; background: #ededea; }
.product-card .pimg img { width: 100%; height: 100%; object-fit: cover; }
.product-card .pbody { padding: 10px 12px; }
.product-card .ptitle { font-size: 12px; line-height: 1.4; height: 33px; overflow: hidden; }
.product-card .pmeta { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--c-muted); }
.product-card .pprice { color: var(--c-primary-d); font-weight: 600; font-size: 13px; }
.product-card .pchk { padding: 0 12px 10px; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--c-muted); }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #f3f5f1 0%, #e8efe9 100%); }
.login-card { display: grid; grid-template-columns: 320px 360px; background: #fff; border-radius: 8px; box-shadow: 0 4px 30px rgba(0,0,0,0.05); overflow: hidden; }
.login-side { background: var(--c-primary); color: #fff; padding: 36px 28px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; letter-spacing: 1px; }
.login-side .slogan { font-size: 13px; opacity: 0.9; line-height: 1.7; }
.login-side ul { list-style: none; padding: 0; margin: 24px 0 0; font-size: 12px; opacity: 0.85; }
.login-side li { padding: 4px 0; }
.login-side .foot { font-size: 11px; opacity: 0.7; }
.login-form { padding: 36px 32px; }
.login-form h2 { margin: 0 0 4px; font-size: 18px; }
.login-form .sub { color: var(--c-muted); font-size: 12px; margin-bottom: 22px; }
.login-form .field input { padding: 9px 12px; font-size: 13px; }
.login-form .btn-primary { width: 100%; justify-content: center; padding: 9px; font-size: 13px; }
.login-form .row-mini { display: flex; justify-content: space-between; font-size: 11px; margin: 8px 0 16px; color: var(--c-muted); }

/* 双栏布局 */
.split { display: grid; grid-template-columns: 1fr 360px; gap: 14px; }

/* 操作侧栏 */
.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 8px 14px; background: #fff; border: 1px solid var(--c-line);
  border-radius: var(--r); margin-bottom: 12px;
}
.toolbar .grow { flex: 1; }
.toolbar .btn, .toolbar .btn-sm { height: 32px; font-size: 12px; padding: 0 12px; }

/* 角标 */
.badge { display: inline-block; padding: 0 6px; font-size: 10px; background: var(--c-danger); color: #fff; border-radius: 100px; }

/* 空白边距 */
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.muted { color: var(--c-muted); }
.small { font-size: 11px; }
.big { font-size: 16px; }
.right { text-align: right; }
.center { text-align: center; }
hr.line { border: 0; border-top: 1px solid var(--c-line); margin: 14px 0; }

/* 水印预览 */
.wm-preview { position: relative; width: 100%; aspect-ratio: 1; background: #ececeb; border: 1px solid var(--c-line); border-radius: var(--r); overflow: hidden; }
.wm-preview img { width: 100%; height: 100%; object-fit: cover; }
.wm-mark {
  position: absolute; padding: 4px 8px; font-size: 11px;
  background: rgba(255,255,255,0.6); border-radius: 3px; color: #333;
}
.wm-mark.tl { top: 8px; left: 8px; }
.wm-mark.tr { top: 8px; right: 8px; }
.wm-mark.bl { bottom: 8px; left: 8px; }
.wm-mark.br { bottom: 8px; right: 8px; }

/* 占位图，用 CSS 渐变模拟 */
.ph {
  background: linear-gradient(135deg, #ddd 0%, #c8c8c8 100%);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.6); font-size: 11px;
}
.ph-1 { background: linear-gradient(135deg, #b8c5b0 0%, #7b8c70 100%); }
.ph-2 { background: linear-gradient(135deg, #d8c4a4 0%, #b29973 100%); }
.ph-3 { background: linear-gradient(135deg, #b0bfc5 0%, #6f8993 100%); }
.ph-4 { background: linear-gradient(135deg, #c8b4ba 0%, #9b7782 100%); }
.ph-5 { background: linear-gradient(135deg, #c5c1a8 0%, #999176 100%); }
.ph-6 { background: linear-gradient(135deg, #aabfc8 0%, #7088a0 100%); }
.ph-7 { background: linear-gradient(135deg, #b8c0b8 0%, #6f7a6f 100%); }
.ph-8 { background: linear-gradient(135deg, #d4c0a4 0%, #a08c70 100%); }

/* 拖拽列表 */
.sortable { display: flex; gap: 8px; flex-wrap: wrap; }
.sortable .item {
  width: 90px; height: 90px; border: 1px dashed var(--c-line); border-radius: var(--r);
  background: #fff; position: relative; cursor: grab;
}
.sortable .item .num {
  position: absolute; top: 4px; left: 4px; width: 18px; height: 18px;
  background: var(--c-primary); color: #fff; border-radius: 50%;
  font-size: 11px; display: flex; align-items: center; justify-content: center;
}
.sortable .item .x {
  position: absolute; top: 4px; right: 4px; width: 16px; height: 16px;
  background: rgba(0,0,0,0.4); color: #fff; border-radius: 50%;
  font-size: 10px; display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.sortable .item.add { border-style: dashed; color: var(--c-muted); display: flex; align-items: center; justify-content: center; font-size: 22px; }

/* 列表带勾 */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 6px 0; border-bottom: 1px dashed var(--c-line); display: flex; align-items: center; gap: 8px; font-size: 12px; }
.checklist li:last-child { border: 0; }
.checklist li .ok { color: var(--c-primary); }
.checklist li .err { color: var(--c-danger); }

/* 进度条 */
.bar-progress { height: 6px; min-width: 100px; width: 100%; background: #ececeb; border-radius: 100px; overflow: hidden; display:inline-block; vertical-align: middle; }
.bar-progress > div { height: 100%; background: var(--c-primary); }

/* 水印设置块 */
.wm-block { background:#f9fbf8; border:1px solid var(--c-line); border-radius:var(--r); padding:12px 14px; margin-bottom:12px; }
.wm-block-head { display:flex; align-items:center; gap:4px; }
.wm-type-btn {
  display:inline-flex; align-items:center; padding:3px 12px; font-size:12px;
  border:1px solid var(--c-line); border-radius:100px; cursor:pointer;
  color:var(--c-muted); background:#fff; user-select:none;
  transition: background .15s, color .15s, border-color .15s;
}
.wm-type-btn.active { background:var(--c-primary); color:#fff; border-color:var(--c-primary); }

/* 标签页 */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--c-line); margin-bottom: 14px; }
.tabs a { padding: 8px 18px; color: var(--c-muted); font-size: 12px; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--c-text); text-decoration: none; }
.tabs a.active { color: var(--c-primary-d); border-color: var(--c-primary); font-weight: 500; }

/* 收纳行 */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
