/* 智德新胜 ERP 网页版 - 墨绿 + 琥珀金 */
:root {
  --primary: #0d5c4d;
  --primary-light: #1a7a68;
  --primary-dark: #084539;
  --accent: #c9a227;
  --accent-light: #e8c547;
  --bg: #f0f4f3;
  --bg-card: #ffffff;
  --text: #1e2d2a;
  --text-muted: #6b7c78;
  --border: #d8e4e0;
  --danger: #d64545;
  --success: #2d9d6e;
  --nav-bg: linear-gradient(135deg, #084539 0%, #0d5c4d 50%, #126b5a 100%);
  --shadow: 0 4px 24px rgba(8, 69, 57, 0.12);
  --radius: 10px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }

.login-page { display: flex; min-height: 100vh; }

.login-hero {
  flex: 1.2;
  background: linear-gradient(160deg, #0a3d34 0%, #0d5c4d 40%, #1a6b5c 100%);
  color: #fff;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-hero::before {
  content: "";
  position: absolute;
  top: -20%; right: -10%;
  width: 60%; height: 80%;
  background: radial-gradient(ellipse, rgba(201, 162, 39, 0.15) 0%, transparent 70%);
}

.hero-brand {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 36px; position: relative; z-index: 1;
}

.hero-brand img {
  width: 72px; height: 72px; border-radius: 12px;
  background: #fff; padding: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.hero-brand h1 { font-size: 1.5rem; font-weight: 700; }
.hero-brand .short-name { font-size: 1.1rem; color: var(--accent-light); margin-top: 4px; }

.hero-intro { position: relative; z-index: 1; max-width: 520px; }
.hero-intro p { font-size: 0.95rem; line-height: 1.85; opacity: 0.92; margin-bottom: 16px; }

.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-tag {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 14px; border-radius: 20px; font-size: 0.82rem;
}

.login-panel {
  flex: 0.8; min-width: 400px;
  display: flex; align-items: center; justify-content: center;
  padding: 40px; background: var(--bg);
}

.login-card {
  width: 100%; max-width: 400px;
  background: var(--bg-card); border-radius: 16px;
  padding: 40px 36px; box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.login-card h2 { font-size: 1.5rem; margin-bottom: 8px; color: var(--primary-dark); }
.login-card .subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 8px; }
.form-group input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 8px; font-size: 0.95rem;
}
.form-group input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 92, 77, 0.15);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 20px; border: none; border-radius: 8px;
  font-size: 0.92rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff; width: 100%; padding: 13px; font-size: 1rem;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  transform: translateY(-1px);
}

.btn-secondary { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-accent { background: var(--accent); color: #1e2d2a; }

.login-actions { display: flex; gap: 12px; margin-top: 16px; }
.login-actions .btn { flex: 1; }
.login-error { color: var(--danger); font-size: 0.88rem; margin-top: 12px; min-height: 20px; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.top-nav {
  background: var(--nav-bg); color: #fff;
  display: flex; align-items: center;
  padding: 0 24px; height: 56px;
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.nav-brand { display: flex; align-items: center; gap: 10px; margin-right: 32px; font-weight: 700; }
.nav-brand img { width: 32px; height: 32px; border-radius: 6px; background: #fff; padding: 2px; }

.nav-menu { display: flex; align-items: center; gap: 4px; flex: 1; }

.nav-item {
  padding: 8px 16px; border-radius: 6px; cursor: pointer;
  font-size: 0.92rem; font-weight: 500; color: rgba(255,255,255,0.9);
  border: none; background: none;
  position: relative;
}
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,0.15); color: #fff; }
.nav-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #e63946;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.nav-item-wrap { position: relative; }
.nav-item-wrap.open .nav-dropdown { display: block; }

.nav-dropdown {
  position: absolute; top: 100%; left: 0; margin-top: 0;
  padding-top: 4px;
  background: transparent; border-radius: 0; box-shadow: none;
  min-width: 160px; display: none; z-index: 1001;
}
.nav-dropdown-inner {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; border: 1px solid var(--border);
}
.nav-item-wrap:hover .nav-dropdown { display: block; }
.nav-item-wrap.open .nav-dropdown { display: block; }
.nav-dropdown a { display: block; padding: 12px 18px; color: var(--text); border-bottom: 1px solid var(--border); }
.nav-dropdown a:last-child { border-bottom: none; }
.nav-dropdown a:hover { background: #f0faf7; color: var(--primary); }

.nav-user { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 0.88rem; }
.nav-user .logout-btn {
  background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; padding: 6px 14px; border-radius: 6px; cursor: pointer;
}

.main-content { flex: 1; padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-header h1 { font-size: 1.4rem; color: var(--primary-dark); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-header .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.list-count-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #2f6f66;
  background: #e8f5f2;
  border: 1px solid #b9ddd6;
  border-radius: 999px;
  padding: 2px 10px;
  line-height: 1.4;
}

.card { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; }
.card-body { padding: 18px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 20px;
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
}
.stat-card .value { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.stat-card .label { color: var(--text-muted); font-size: 0.88rem; }

.announce-item, .training-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.announce-item h4, .training-item h4 { font-size: 0.95rem; margin-bottom: 6px; }
.announce-item .pinned {
  background: var(--accent); color: #1e2d2a; font-size: 0.72rem;
  padding: 2px 8px; border-radius: 4px; margin-left: 8px;
}

.sales-table { width: 100%; border-collapse: collapse; }
.sales-table th, .sales-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.sales-table th { background: #f5faf8; font-weight: 600; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table th { background: #f5faf8; font-weight: 600; }

.order-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; }
.order-card-header {
  background: linear-gradient(90deg, #e8f5f1 0%, #f5faf8 100%);
  padding: 10px 16px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.85rem;
}
.order-card-body { display: grid; grid-template-columns: 140px 1fr 160px; gap: 16px; padding: 16px; }

.order-product-img img { width: 100px; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.order-product-img .source-btn {
  display: inline-block; margin-top: 8px; padding: 4px 14px;
  background: #ff6a00; color: #fff; border-radius: 4px; font-size: 0.78rem; border: none; cursor: pointer;
}
.order-product-img .source-btn.disabled { background: #ccc; cursor: not-allowed; }

/* 订单数据：智赢式紧凑表格 */
.orders-table-wrap { overflow-x: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.orders-table { margin: 0; }
.orders-table .order-row-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); flex-shrink: 0; }
.order-product-inline { display: flex; gap: 10px; align-items: flex-start; min-width: 200px; }
.order-row-title { font-weight: 600; font-size: 0.86rem; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-row-sub { font-size: 0.78rem; color: #6b7c78; margin-top: 2px; }
.order-id-cell .order-id { font-weight: 600; font-size: 0.85rem; }
.orders-table-footer { margin-top: 10px; font-size: 0.88rem; color: #6b7c78; }
.orders-table .btn-link { background: none; border: none; color: #ff6a00; cursor: pointer; font-size: 0.78rem; padding: 0 4px; }

/* 导入列表批量设置 */
.bulk-edit-layout { display: grid; grid-template-columns: 160px 1fr; gap: 20px; min-height: 220px; }
.bulk-edit-left label { display: block; margin-bottom: 10px; font-size: 0.9rem; cursor: pointer; }
.bulk-edit-right .bulk-section { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.bulk-edit-right h4 { margin: 0 0 10px; font-size: 0.95rem; }

/* 消息模块 */
.msg-product-ids { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.msg-id-chip { font-size: 0.75rem; color: #5a6b67; background: #f0f5f3; padding: 2px 6px; border-radius: 4px; }
.msg-id-chip .btn-copy-id { margin-left: 4px; background: none; border: none; color: var(--accent); cursor: pointer; font-size: 0.72rem; }
.msg-reply-box { margin-top: 10px; display: flex; gap: 8px; align-items: flex-end; }
.msg-reply-box textarea { flex: 1; min-width: 200px; padding: 8px; border: 1px solid #ddd; border-radius: 6px; font-family: inherit; resize: vertical; }

.rep-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.rep-level { font-size: 1.6rem; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rep-bar { display: flex; height: 8px; gap: 2px; margin-bottom: 16px; }
.rep-bar span { flex: 1; border-radius: 2px; }
.rep-bar .r1 { background: #f5a5a5; } .rep-bar .r2 { background: #f5c78a; }
.rep-bar .r3 { background: #f5e08a; } .rep-bar .r4 { background: #a8e0b8; } .rep-bar .r5 { background: #2d9d6e; }
.rep-metrics { display: flex; gap: 24px; flex-wrap: wrap; }

.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.img-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; position: relative; }
.img-card.selected { border-color: var(--primary); }
.img-card img { width: 100%; height: 140px; object-fit: cover; }
.img-card .img-info { padding: 8px 10px; font-size: 0.75rem; color: var(--text-muted); }
.img-card .img-check { position: absolute; top: 8px; left: 8px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; cursor: pointer; position: relative; }
.product-card .pc-check { padding: 8px; }
.product-card img { width: 100%; height: 160px; object-fit: cover; background: #e8f0ee; }
.product-card .pc-thumb-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #e8f0ee;
}
.product-card .pc-thumb-wrap .pc-thumb,
.product-card .pc-thumb-wrap img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.product-card .pc-saved-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(25, 135, 84, 0.95);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  pointer-events: none;
}
.product-card .pc-saved-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  color: #198754;
  font-size: 0.7rem;
  font-weight: 800;
}
.product-card .pc-body { padding: 12px; }
.product-card .pc-title { font-size: 0.88rem; font-weight: 600; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .pc-meta { font-size: 0.8rem; color: #6b7c78; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.product-card .pc-sites {
  display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px;
}
.product-card .pc-sites.is-saving { opacity: 0.55; pointer-events: none; }
.site-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--border); background: #f4f8f7;
  font-size: 0.72rem; color: #6b7c78; user-select: none;
}
.site-chip input { margin: 0; width: 12px; height: 12px; accent-color: var(--primary); cursor: pointer; }
.site-chip.is-on {
  background: #d4f0e4; border-color: #2a9d8f; color: #1a6b4a; font-weight: 600;
}
.site-check-row { margin-bottom: 12px; }
.site-check-label { font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.site-check-list { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.site-check-item {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0; font-weight: 500; cursor: pointer;
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: #f8fbfa;
}
.site-check-item input { accent-color: var(--primary); cursor: pointer; }
.site-check-item:has(input:checked) {
  background: #d4f0e4; border-color: #2a9d8f; color: #1a6b4a;
}
.site-check-hint { margin: 6px 0 10px; }
.site-price-off { opacity: 0.45; }
.product-card .pc-edit { margin-top: 8px; width: 100%; }
.product-card .pc-update { margin-top: 8px; width: 100%; }
.product-card .pc-dup { margin-top: 8px; width: 100%; }
.product-card.is-editing { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(42,157,143,.22); }

/* 智赢式：左侧列表 + 右侧编辑（底部保存栏固定可见） */
.split-edit-layout {
  display: flex; align-items: stretch; gap: 0;
  height: calc(100vh - 210px);
  min-height: 480px;
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: #fff;
}
.split-list {
  width: 36%; min-width: 260px; max-width: 400px;
  border-right: 1px solid var(--border);
  overflow-y: auto; padding: 12px; background: #f8fbfa;
}
.split-list .product-grid { grid-template-columns: 1fr; gap: 10px; }
.split-list .product-card img,
.split-list .product-card .pc-thumb-wrap .pc-thumb,
.split-list .product-card .pc-thumb-wrap img { height: 120px; }
.split-panel {
  flex: 1; min-width: 0; min-height: 0;
  overflow: hidden; background: #fff;
  display: flex; flex-direction: column;
}
.split-panel-empty {
  padding: 48px 24px; color: #6b7c78; text-align: center; font-size: 0.92rem;
}
.split-edit-inner {
  display: flex; flex-direction: column;
  height: 100%; min-height: 0; flex: 1;
}
.split-edit-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: #f4faf8; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.split-edit-header h2 { font-size: 1rem; color: var(--primary-dark); margin: 0; }
.split-edit-header-actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end;
}
.split-edit-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px;
}
.split-edit-footer {
  display: none; /* 操作按钮已移至顶部标题栏 */
}

.edit-modal { background: #fff; border-radius: 12px; width: min(920px, 96vw); max-height: 92vh; display: flex; flex-direction: column; }
.edit-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
.edit-modal-header h2 { font-size: 1.1rem; color: var(--primary-dark); margin: 0; flex: 1; min-width: 120px; }
.edit-modal-header-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.edit-modal-close { border: none; background: none; font-size: 1.6rem; cursor: pointer; color: #888; line-height: 1; }
.edit-modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.edit-modal-footer { display: none; }
.edit-form label { display: block; margin-bottom: 12px; font-size: 0.88rem; font-weight: 600; }
.edit-form input[type="text"], .edit-form input[type="number"], .edit-form textarea, .edit-form select {
  display: block; width: 100%; margin-top: 4px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px; font-weight: 400;
}
.edit-dims { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.edit-dims label { margin: 0; flex: 1; min-width: 100px; }
.edit-prices { display: flex; flex-wrap: wrap; gap: 12px; }
.edit-prices label { margin: 0; font-weight: 500; }
.edit-form fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.edit-form legend { padding: 0 6px; font-weight: 600; color: var(--primary); }
.source-link-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.source-link-row input[type="text"] {
  flex: 1; min-width: 0; margin: 0;
}
.source-links-box #btnAddSourceLink { margin-top: 4px; }
.edit-pic-fieldset {
  min-height: 140px;
  width: 100%;
  box-sizing: border-box;
}
.edit-pic-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
  justify-content: flex-start;
  width: 100%;
  min-height: 106px;
}
.edit-pic-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; font-size: 0.88rem; }
.edit-pic-toolbar label { font-weight: 400; margin: 0; }
.pic-hint { color: var(--text-muted); font-size: 0.82rem; }
.edit-pic-item { position: relative; width: 96px; height: 96px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; cursor: grab; }
.edit-pic-item.is-cover { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(45,125,110,0.25); }
.edit-pic-item.drag-over { outline: 2px dashed var(--primary); }
.edit-pic-item .pic-item-check { position: absolute; top: 4px; left: 4px; z-index: 2; }
.pic-cover-tag { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(45,125,110,0.85); color: #fff; font-size: 0.7rem; text-align: center; padding: 2px 0; z-index: 1; }
.pic-size-tag { position: absolute; bottom: 18px; left: 0; right: 0; background: rgba(0,0,0,0.55); color: #fff; font-size: 0.65rem; text-align: center; padding: 1px 0; z-index: 1; pointer-events: none; }
.edit-pic-item.is-cover .pic-size-tag { bottom: 18px; }
.edit-pic-item img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.edit-pic-del { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border: none; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff; cursor: pointer; z-index: 2; }
.edit-pic-add { width: 96px; height: 96px; border: 2px dashed var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); font-size: 0.85rem; box-sizing: border-box; }
.edit-pic-add input { display: none; }
.pic-crop-overlay {
  position: fixed; inset: 0; z-index: 12000;
  background: rgba(20, 30, 28, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.pic-crop-dialog {
  background: #fff; border-radius: 10px; max-width: 90vw; max-height: 90vh;
  display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  overflow: hidden;
}
.pic-crop-header {
  display: flex; align-items: baseline; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.pic-crop-stage {
  position: relative; margin: 16px; overflow: auto; max-height: 60vh;
  user-select: none; line-height: 0;
}
.pic-crop-img { display: block; max-width: none; }
.pic-crop-sel {
  position: absolute; border: 2px solid #2d7d6e; background: rgba(45,125,110,0.2);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.35); pointer-events: none;
}
.pic-crop-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--border);
}
.generate-progress-wrap { margin: 12px 0 16px; padding: 12px 16px; background: #f0f7f5; border-radius: 8px; border: 1px solid var(--border); }
.generate-progress-label { font-size: 0.88rem; color: var(--primary-dark); margin-bottom: 8px; }
.progress-bar { height: 8px; background: #dce8e4; border-radius: 4px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--primary); transition: width 0.4s ease; border-radius: 4px; }
.label-with-count { position: relative; }
.title-char-count { float: right; font-size: 0.82rem; color: #6b7c78; font-weight: 400; }
.title-char-count.over-limit { color: #d64545; font-weight: 600; }
.price-calc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px; }
.cat-field-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cat-field-row input[type=text] { flex: 1; min-width: 200px; }
.cat-picker-toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.cat-picker-status { font-size: 0.82rem; color: #6b7c78; margin-bottom: 6px; }
.cat-picker-path { padding: 8px 10px; background: #f0f7f5; border-radius: 6px; font-size: 0.88rem; margin-bottom: 10px; color: var(--primary-dark); }
.cat-picker-path-accent { color: #c1121f; background: #fff5f5; }
.cat-search-results-box { margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.cat-search-results-box legend { font-size: 0.82rem; color: #6b7c78; padding: 0 4px; }
.cat-recommend-item { display: flex; gap: 8px; align-items: flex-start; padding: 8px 4px; cursor: pointer; font-size: 0.88rem; }
.cat-recommend-item input { margin-top: 3px; }
.product-attrs-box { margin: 12px 0; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; background: #f8fbfa; }
.product-attrs-box legend { font-size: 0.88rem; font-weight: 600; color: var(--primary-dark); }
.product-attr-field { display: block; margin-bottom: 10px; font-size: 0.88rem; }
.product-attr-field .attr-input { display: block; width: 100%; max-width: 420px; margin-top: 4px; }
.attr-required { color: #c1121f; margin-right: 2px; }
.product-attrs-optional { margin-top: 8px; font-size: 0.85rem; }
.product-attrs-optional summary { cursor: pointer; color: #6b7c78; margin-bottom: 8px; }
.category-path-display { color: #c1121f !important; background: #fff8f8 !important; }
.cat-picker-columns { display: flex; gap: 8px; overflow-x: auto; min-height: 220px; max-height: 320px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.cat-col { min-width: 180px; max-width: 220px; overflow-y: auto; border-right: 1px solid var(--border); padding-right: 6px; }
.cat-col:last-child { border-right: none; }
.cat-item { display: block; width: 100%; text-align: left; border: none; background: transparent; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 0.85rem; }
.cat-item:hover, .cat-item.active { background: #e8f4f0; color: var(--primary-dark); }
.cat-picker-results { margin-top: 10px; max-height: 160px; overflow-y: auto; }
.cat-result-item { display: block; width: 100%; text-align: left; border: 1px solid var(--border); background: #fff; padding: 8px 10px; border-radius: 6px; margin-bottom: 6px; cursor: pointer; }
.cat-result-item:hover { border-color: var(--primary); }
.cat-result-path { font-size: 0.78rem; color: #6b7c78; margin-top: 4px; }
.uploaded-product-cell { display: flex; gap: 10px; align-items: center; min-width: 200px; }
.uploaded-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.uploaded-title { font-size: 0.88rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploaded-sub { font-size: 0.78rem; color: #6b7c78; }
.uploaded-site-id { font-size: 0.72rem; color: #6b7c78; margin-top: 2px; }
.uploaded-table td, .uploaded-table th { font-size: 0.85rem; vertical-align: middle; }
.uploaded-summary { font-size: 0.88rem; color: var(--primary); margin-right: 12px; }
.uploaded-list { display: flex; flex-direction: column; gap: 12px; }
.uploaded-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.uploaded-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.uploaded-card-title { font-weight: 600; font-size: 0.95rem; }
.uploaded-card-meta { font-size: 0.82rem; color: #4a5a56; margin-bottom: 10px; }
.uploaded-meta-row { margin-bottom: 4px; }
.uploaded-meta-label { color: #6b7c78; margin-right: 4px; }
.uploaded-meta-time { color: #6b7c78; }
.uploaded-gid { font-size: 0.82rem; background: #f4f8f7; padding: 2px 6px; border-radius: 4px; user-select: all; }
.uploaded-pending-hint { color: #e9c46a; margin-top: 4px; }
.uploaded-site-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0; border-top: 1px dashed var(--border); font-size: 0.85rem; }
.uploaded-site-row:first-child { border-top: none; }
.uploaded-site-label { min-width: 72px; font-weight: 500; }
.uploaded-site-status { min-width: 72px; }
.uploaded-site-status.status-success { color: #2a9d8f; }
.uploaded-site-status.status-error { color: #c1121f; }
.uploaded-site-status.status-pending { color: #e9c46a; }
.uploaded-site-price { min-width: 130px; }
.uploaded-site-id-wrap code { font-size: 0.78rem; background: #f4f8f7; padding: 1px 4px; border-radius: 3px; user-select: all; }
.uploaded-site-msg { color: #c1121f; font-size: 0.78rem; flex: 1 1 180px; min-width: 120px; max-width: 100%; }
.uploaded-site-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; flex: 0 0 auto; position: relative; z-index: 2; }
.img-hover-zoom { display: none; position: fixed; z-index: 10000; width: 300px; height: 300px; border: 2px solid var(--primary); border-radius: 8px; background: #fff; box-shadow: 0 8px 32px rgba(0,0,0,0.2); pointer-events: none; overflow: hidden; }
.img-hover-zoom img { width: 100%; height: 100%; object-fit: contain; }
.product-card .pc-thumb { cursor: zoom-in; }
.edit-error { color: var(--danger); font-size: 0.85rem; margin-top: 8px; }

.status-badge { padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.status-draft { background: #e8f0ee; color: #5a6e68; }
.status-success { background: #d4f0e4; color: #1a6b4a; }
.status-error { background: #fde8e8; color: #b33; }
.status-pending { background: #fff3cd; color: #8a6d1d; }

.site-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  background: #e8f0ee; color: #2d5a4a; font-size: 0.78rem; font-weight: 600;
}

.msg-item { display: flex; gap: 16px; padding: 16px; border-bottom: 1px solid var(--border); }
.msg-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex-shrink: 0; border: 1px solid var(--border); }
.msg-product { width: 88px; flex-shrink: 0; text-align: center; }
.msg-product-title {
  margin-top: 6px; font-size: 0.72rem; color: #4a5a56; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.reply-tabs { display: flex; gap: 8px; }
.reply-tab {
  border: 1px solid var(--border); background: #fff; padding: 6px 14px;
  border-radius: 6px; cursor: pointer; font-size: 0.88rem;
}
.reply-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.rep-sites-grid { display: flex; flex-wrap: wrap; gap: 16px; }

.products-layout { display: flex; gap: 16px; align-items: stretch; }
.folder-sidebar {
  width: 220px; flex-shrink: 0; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
  max-height: calc(100vh - 100px); overflow-y: auto;
}
.folder-side-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.folder-item {
  display: flex; justify-content: space-between; width: 100%; text-align: left;
  border: none; background: transparent; padding: 8px 10px; border-radius: 6px;
  cursor: pointer; font-size: 0.88rem; color: #334;
}
.folder-item:hover, .folder-item.active { background: #e8f4f0; color: var(--primary-dark); }
.folder-item span { color: #6b7c78; font-size: 0.8rem; }
.folder-row { display: flex; align-items: center; gap: 2px; }
.folder-more { border: none; background: transparent; cursor: pointer; color: #888; padding: 4px 6px; }
.products-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.products-main .split-edit-layout { flex: 1; height: calc(100vh - 250px); }

.edit-prices-with-listing { flex-direction: column; align-items: stretch; gap: 10px; }
.edit-price-site {
  display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end;
  padding-bottom: 8px; border-bottom: 1px dashed var(--border);
}
.listing-type-label { font-weight: 500; font-size: 0.82rem; }
.listing-type-select { min-width: 140px; }

.uploaded-card-title-wrap { display: flex; gap: 12px; align-items: center; min-width: 0; }
.uploaded-card-thumb {
  width: 64px; height: 64px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); flex-shrink: 0; background: #e8f0ee;
}

.site-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.site-product-card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column;
}
.site-product-card > img { width: 100%; height: 160px; object-fit: cover; background: #e8f0ee; }
.spc-body { padding: 12px 14px 14px; }
.spc-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.spc-meta { font-size: 0.8rem; color: #6b7c78; margin-bottom: 4px; }
.spc-price { margin: 8px 0; }
.spc-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .products-layout { flex-direction: column; }
  .folder-sidebar { width: 100%; position: static; max-height: none; }
}

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding: 14px 18px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px;
}
.filter-bar input, .filter-bar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; }

.admin-panel {
  background: #fffbf0; border: 1px dashed var(--accent);
  border-radius: var(--radius); padding: 16px; margin-top: 16px;
}
.admin-panel textarea {
  width: 100%; min-height: 80px; padding: 10px;
  border: 1px solid var(--border); border-radius: 6px; margin-bottom: 10px;
}

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.loading { text-align: center; padding: 40px; color: var(--text-muted); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; }
.pagination button { padding: 6px 14px; border: 1px solid var(--border); background: #fff; border-radius: 6px; cursor: pointer; }
.pagination button.active { background: var(--primary); color: #fff; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.modal { background: #fff; border-radius: 12px; padding: 24px; max-width: 480px; width: 90%; }

.placeholder-page { text-align: center; padding: 80px 20px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.inline-edit { display: flex; gap: 8px; align-items: center; }
.inline-edit input { flex: 1; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; }

.storage-usage { margin-bottom: 16px; }
.storage-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.storage-num { display: block; font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.storage-lbl { font-size: 0.82rem; color: var(--text-muted); }
.storage-bar { height: 10px; background: #e8f0ee; border-radius: 5px; overflow: hidden; }
.storage-bar span { display: block; height: 100%; background: var(--primary); border-radius: 5px; transition: width 0.3s; }
.storage-bar.warn span { background: #e8a317; }
.storage-bar.over span { background: var(--danger); }

.uploaded-site-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }

/* 全球产品（店小秘风格） */
.gp-filter { flex-wrap: wrap; gap: 10px; align-items: end; }
.gp-hint {
  margin: 0 0 10px; padding: 8px 12px; font-size: 0.84rem; color: #5a6a66;
  background: #f4faf8; border: 1px solid var(--border); border-radius: 8px;
}
.gp-table th, .gp-table td { vertical-align: top; }
.gp-thumb-cell { text-align: center; }
.gp-thumb {
  width: 64px; height: 64px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--border); display: block; margin: 0 auto 6px;
}
.gp-source-wrap { font-size: 0.75rem; max-width: 88px; margin: 0 auto; word-break: break-all; }
.gp-source-link { color: var(--primary); text-decoration: underline; cursor: pointer; }
.gp-source-empty { color: #9aa8a4; }
.gp-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.gp-sub { font-size: 0.78rem; color: #6b7c78; }
.gp-err-hint { color: #c1121f; font-size: 0.75rem; margin-top: 4px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-sites { display: flex; flex-wrap: wrap; gap: 6px; max-width: 280px; }
.uploaded-fail-banner {
  background: #fff5f5; border: 1px solid #f5c2c7; border-radius: 8px;
  padding: 10px 12px; margin: 8px 0 12px; color: #c1121f; font-size: 0.84rem;
}
.uploaded-fail-title { font-weight: 600; margin-bottom: 6px; }
.uploaded-fail-banner ul { margin: 0; padding-left: 18px; }
.uploaded-fail-banner li { margin-bottom: 4px; word-break: break-word; }
.uploaded-site-msg {
  color: #c1121f; font-size: 0.78rem; flex: 1 1 100%;
  margin-top: 4px; white-space: normal; word-break: break-word;
}

.gp-site-col, .gp-price-col { display: flex; flex-direction: column; gap: 4px; }
.gp-site-line, .gp-price-line {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.82rem; min-height: 22px;
}
.gp-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  flex: 0 0 auto;
}
.gp-dot-green { background: #2a9d8f; }
.gp-dot-gray { background: #9aa8a4; }
.gp-dot-yellow { background: #e9c46a; }
.gp-dot-muted { background: #dde5e2; }
.gp-time { font-size: 0.78rem; color: #6b7c78; white-space: nowrap; }
.gp-actions { display: flex; flex-direction: column; gap: 6px; }
.table-scroll { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: 10px; }

/* ERP 提示 */
.erp-toast-root { position: fixed; top: 72px; right: 20px; z-index: 12000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.erp-toast { min-width: 220px; max-width: 360px; padding: 12px 16px; border-radius: 8px; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,0.15); font-size: 0.9rem; opacity: 0; transform: translateX(12px); transition: all 0.25s ease; border-left: 4px solid var(--primary); pointer-events: auto; }
.erp-toast.show { opacity: 1; transform: translateX(0); }
.erp-toast-success { border-left-color: #2a9d8f; }
.erp-toast-error { border-left-color: #c1121f; }
.erp-toast-warn { border-left-color: #e9c46a; }
.erp-notify-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 11000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.erp-notify-box { background: #fff; border-radius: 12px; width: min(420px, 96vw); box-shadow: 0 12px 40px rgba(0,0,0,0.2); overflow: hidden; }
.erp-notify-header { padding: 14px 18px; font-weight: 600; font-size: 1rem; color: var(--primary-dark); border-bottom: 1px solid var(--border); background: #f4faf8; }
.erp-notify-body { padding: 18px; font-size: 0.92rem; line-height: 1.55; color: #333; max-height: 50vh; overflow-y: auto; }
.erp-notify-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.upload-error-box { margin-top: 12px; padding: 12px; background: #fff5f5; border: 1px solid #f5c2c2; border-radius: 8px; }
.upload-error-box strong { color: #c1121f; display: block; margin-bottom: 6px; }
.upload-error-summary { font-size: 0.88rem; color: #8b1a1a; white-space: pre-wrap; margin-bottom: 8px; }
.upload-error-detail { font-size: 0.75rem; color: #888; word-break: break-all; max-height: 80px; overflow-y: auto; }

/* Token / 余额 / 审核 */
.platinum-banner {
  background: linear-gradient(90deg, #1e3a5f 0%, #2c5282 50%, #1e3a5f 100%);
  color: #f6e05e;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  border: 1px solid #c9a227;
}
.token-packages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.token-pkg-card {
  padding: 24px 18px;
  text-align: center;
}
.token-pkg-amount { font-size: 1.4rem; font-weight: 700; color: var(--primary-dark); margin-bottom: 8px; }
.token-pkg-price { font-size: 1.6rem; font-weight: 700; color: var(--accent); margin-bottom: 16px; }
.warn-banner {
  background: #fff5f5;
  border: 1px solid #f5c2c2;
  color: #8b1a1a;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.hint-text { color: #6b7c78; font-size: 0.88rem; line-height: 1.6; }
.hint-text p { margin: 0 0 8px; }
.storage-num.neg { color: #c1121f; }
.audit-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.audit-tab {
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text);
}
.audit-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.audit-notify-box {
  margin: 12px 0;
  padding: 12px 14px;
  background: #fff8e8;
  border: 1px solid #f0d78c;
  border-radius: 8px;
}
.audit-notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.audit-notify-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.9rem;
  line-height: 1.6;
}
.audit-notify-list li { margin-bottom: 4px; }
.text-danger { color: #c1121f; font-weight: 600; }
.acct-type { padding: 4px 8px; border-radius: 4px; border: 1px solid var(--border); }

@media (max-width: 900px) {
  .grid-2, .home-stats { grid-template-columns: 1fr; }
  .token-packages { grid-template-columns: 1fr; }
  .login-page { flex-direction: column; }
}

.gp-actions { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.gp-actions .btn { width: 100%; font-size: 0.78rem; padding: 4px 8px; }

