/* ===== Etsy 商品 ERP · 奶油暖色 + 墨绿 ===== */
:root {
  --bg: #f6f4ee;
  --card: #fffdf8;
  --border: #e7e1d3;
  --text: #2c2a24;
  --muted: #8b8577;
  --green: #33604a;
  --green-dark: #264c39;
  --green-soft: #e6efe7;
  --amber: #b7791f;
  --amber-soft: #fdf3e0;
  --orange: #c05621;
  --orange-soft: #fdeee2;
  --yellow: #97700a;
  --yellow-soft: #fbf4d9;
  --red: #b03a2e;
  --red-soft: #fbe9e6;
  --gray-soft: #eeece5;
  --shadow: 0 1px 3px rgba(60, 50, 30, .07), 0 6px 20px rgba(60, 50, 30, .05);
  --radius: 14px;
  --serif: "Songti SC", "Noto Serif SC", "STSong", serif;
  --sans: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; }

/* ---- 顶栏 ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 0 28px; height: 58px;
  background: rgba(255, 253, 248, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { font-family: var(--serif); font-weight: 700; font-size: 17px; cursor: pointer; letter-spacing: .5px; }
.brand-logo { margin-right: 2px; }
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a {
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  color: var(--muted); font-weight: 500; user-select: none;
}
.topnav a:hover { background: var(--gray-soft); color: var(--text); }
.topnav a.active { background: var(--green); color: #fff; }

/* ---- 布局 ---- */
.view { display: flex; min-height: calc(100vh - 58px); }
.sidebar {
  width: 220px; flex-shrink: 0; padding: 24px 16px;
  border-right: 1px solid var(--border);
}
.side-title { font-size: 12px; color: var(--muted); font-weight: 600; margin: 6px 8px 10px; letter-spacing: 1px; }
.side-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
  color: var(--text); margin-bottom: 2px;
}
.side-item:hover { background: var(--gray-soft); }
.side-item.active { background: var(--green-soft); color: var(--green-dark); font-weight: 600; }
.side-item .ico { width: 18px; text-align: center; }
.side-item .cnt { margin-left: auto; font-size: 12px; color: var(--muted); }
.side-item.active .cnt { color: var(--green-dark); }
.content { flex: 1; padding: 26px 32px 60px; max-width: 1280px; }
.content-full { max-width: none; }
.page-head { margin-bottom: 16px; }
.page-head h1 { font-family: var(--serif); font-size: 24px; font-weight: 700; }
.page-head .sub { color: var(--muted); margin-top: 4px; }

/* ---- 工具栏 ---- */
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; }
.input {
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); padding: 9px 12px; font-size: 14px; color: var(--text);
  outline: none; font-family: var(--sans);
}
.input:focus { border-color: var(--green); }
.search { flex: 1; max-width: 460px; }

/* ---- 卡片网格 ---- */
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.pcard {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: transform .15s, box-shadow .15s; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.pcard:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(60,50,30,.1), 0 14px 34px rgba(60,50,30,.1); }
.pcard-img { position: relative; aspect-ratio: 1 / .82; background: #f1eee6; }
.pcard-img img, .pcard-img .ph { width: 100%; height: 100%; object-fit: cover; display: flex; align-items: center; justify-content: center; }
.ph-emoji { font-size: 44px; }
.ph-name { position: absolute; bottom: 8px; left: 10px; right: 10px; font-size: 12px; color: rgba(255,255,255,.92); text-shadow: 0 1px 4px rgba(0,0,0,.35); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.img-count { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.45); color: #fff; font-size: 11px; border-radius: 999px; padding: 2px 8px; }
.pcard-body { padding: 12px 14px 13px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.pcard-name { font-weight: 600; font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; min-height: 2.7em; }
.pcard-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcard-sku { font-size: 12px; color: var(--muted); }
.pcard-price { font-weight: 700; color: var(--green-dark); font-size: 15px; white-space: nowrap; }
.pcard-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.pcard-src { font-size: 12px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---- 状态徽章 ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-catalog { background: var(--gray-soft); color: #6b6659; }
.st-draft { background: var(--amber-soft); color: var(--amber); }
.st-review { background: var(--orange-soft); color: var(--orange); }
.st-ready { background: var(--yellow-soft); color: var(--yellow); }
.st-listed { background: var(--green-soft); color: var(--green-dark); }
.st-archived { background: var(--gray-soft); color: var(--muted); }

/* ---- 按钮 ---- */
.btn {
  border: none; border-radius: 10px; padding: 9px 16px; font-size: 14px;
  cursor: pointer; font-weight: 600; font-family: var(--sans);
  transition: filter .12s; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { filter: brightness(1.06); }
.btn-primary { background: var(--green); color: #fff; }
.btn-ghost { background: var(--gray-soft); color: var(--text); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-warn { background: var(--orange-soft); color: var(--orange); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.row-btns { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.row-btns.right { justify-content: flex-end; }

/* ---- 空态 / 提示 ---- */
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.flow-hint { margin-top: 26px; color: var(--muted); font-size: 13px; background: var(--card); border: 1px dashed var(--border); border-radius: 12px; padding: 12px 16px; }

/* ---- 弹窗 ---- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; }
.modal-mask { position: fixed; inset: 0; background: rgba(40, 34, 22, .42); }
.modal-body {
  position: relative; background: var(--card); border-radius: 18px;
  width: 100%; max-width: 560px; padding: 26px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: pop .18s ease;
}
.modal-lg { max-width: 860px; }
.modal-sm { max-width: 420px; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-body h3 { font-family: var(--serif); font-size: 19px; margin-bottom: 6px; }

/* ---- 商品详情 ---- */
.pd-head { display: flex; gap: 22px; }
.pd-img { width: 230px; height: 190px; border-radius: 12px; overflow: hidden; flex-shrink: 0; background: #f1eee6; }
.pd-img img, .pd-img .ph { width: 100%; height: 100%; object-fit: cover; }
.pd-info { flex: 1; min-width: 0; }
.pd-sku { color: var(--muted); font-size: 12px; letter-spacing: .5px; }
.pd-title { font-family: var(--serif); font-size: 22px; font-weight: 700; margin: 4px 0 8px; }
.pd-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; }
.pd-grid dt { color: var(--muted); white-space: nowrap; }
.pd-grid dd { white-space: pre-line; }
.pd-actions { display: flex; gap: 10px; margin-top: 16px; }
.section { margin-top: 20px; }
.section h4 { font-size: 14px; margin-bottom: 10px; color: var(--green-dark); }
.kv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kv-table th, .kv-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.kv-table th { color: var(--muted); font-weight: 500; width: 110px; white-space: nowrap; }
.kv-table td { white-space: pre-line; }
.price-block { background: var(--green-soft); border-radius: 10px; padding: 10px 14px; white-space: pre-line; line-height: 1.7; }

/* ---- 表单 ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 14px; }
.form-item { display: flex; flex-direction: column; gap: 5px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.form-item textarea { resize: vertical; min-height: 64px; font-family: var(--sans); }
.checklist { background: var(--amber-soft); border-radius: 12px; padding: 12px 16px; font-size: 13px; line-height: 1.9; grid-column: 1 / -1; }
.checklist b { color: var(--amber); }

/* ---- 图片上传 ---- */
.img-row { display: flex; gap: 10px; flex-wrap: wrap; }
.img-thumb { position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #f1eee6; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.img-del { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 11px; line-height: 20px; }
.img-add {
  width: 92px; height: 92px; border-radius: 10px; border: 1.5px dashed var(--border);
  background: #faf8f2; color: var(--muted); cursor: pointer; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.img-add:hover { border-color: var(--green); color: var(--green); }

/* ---- 看板 tabs ---- */
.board-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.btab { padding: 8px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); cursor: pointer; font-size: 13.5px; color: var(--muted); }
.btab.active { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btab .cnt { margin-left: 4px; font-size: 12px; }

/* ---- 历史时间线 ---- */
.timeline { font-size: 12.5px; color: var(--muted); line-height: 2; }
.timeline b { color: var(--text); font-weight: 600; }

/* ---- 数据页 ---- */
.data-card { margin-bottom: 18px; padding: 20px 24px; }
.data-card h3 { margin-bottom: 6px; }

/* ---- toast ---- */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #33302a; color: #fff; padding: 11px 22px; border-radius: 999px;
  font-size: 14px; z-index: 200; box-shadow: 0 8px 30px rgba(0,0,0,.25);
  animation: pop .2s ease;
}
