/* ============ ShopSync 全局样式（Shopify 风格） ============ */
:root {
  --ss-sidebar-bg: #1a1a1a;
  --ss-sidebar-hover: #303030;
  --ss-sidebar-active: #333;
  --ss-primary: #008060;
  --ss-bg: #f1f1f1;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; padding: 0; }
body { font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; background: var(--ss-bg); }

/* ---------- 登录页 ---------- */
.login-wrap {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #004c3f 0%, #008060 100%);
}
.login-card { width: 380px; padding: 40px 36px; background: #fff; border-radius: 12px; box-shadow: 0 8px 40px rgba(0,0,0,.25); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { margin: 0; font-size: 26px; color: #1a1a1a; }
.login-logo p { margin: 6px 0 0; color: #737373; font-size: 13px; }

/* ---------- 布局 ---------- */
.layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 220px; background: var(--ss-sidebar-bg); color: #e3e3e3; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar-logo { padding: 18px 20px; font-size: 18px; font-weight: 700; color: #fff; border-bottom: 1px solid #303030; }
.sidebar-logo span { color: #00d09c; }
.sidebar-menu { flex: 1; overflow-y: auto; padding: 10px 0; }

/* Element Plus 菜单深色主题微调 */
.sidebar-menu .el-menu { border-right: none; }
.sidebar-menu .el-menu-item,
.sidebar-menu .el-sub-menu__title { height: 44px; line-height: 44px; font-size: 14px; }
.sidebar-menu .el-menu-item:hover,
.sidebar-menu .el-sub-menu__title:hover { background: #303030 !important; color: #fff; }
.sidebar-menu .el-menu-item.is-active {
  background: #333 !important;
  color: #fff !important;
  font-weight: 600;
  border-left: 3px solid #00d09c;
}
.sidebar-menu .el-menu .el-menu-item { padding-left: 52px !important; min-width: auto; }
.sidebar-menu .el-sub-menu .el-icon { color: #8a8a8a; }
.sidebar-menu .el-menu-item .el-icon { color: #8a8a8a; }
.sidebar-menu .el-menu-item.is-active .el-icon { color: #00d09c; }
.sidebar-footer { padding: 14px 20px; border-top: 1px solid #303030; font-size: 12px; color: #8a8a8a; }
.sidebar-footer .user-name { color: #e3e3e3; font-size: 13px; }

.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid #e3e3e3; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; flex-shrink: 0; }
.topbar .page-title { font-size: 17px; font-weight: 600; color: #1a1a1a; }
.topbar .user-info { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #616161; }
.page-content { flex: 1; overflow-y: auto; padding: 20px 24px; }

/* ---------- 卡片 ---------- */
.ss-card { background: #fff; border: 1px solid #e3e3e3; border-radius: 8px; padding: 20px; margin-bottom: 16px; }
.ss-card-title { font-size: 15px; font-weight: 600; color: #1a1a1a; margin-bottom: 16px; }

/* ---------- 统计卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid #e3e3e3; border-radius: 8px; padding: 18px 20px; }
.stat-card .label { font-size: 13px; color: #6b7177; margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: #1a1a1a; }
.stat-card .sub { font-size: 12px; color: #8a8a8a; margin-top: 6px; }
.stat-card .value.green { color: var(--ss-primary); }
.stat-card .value.red { color: #d72c0d; }

/* ---------- 表格工具栏 ---------- */
.table-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.table-toolbar .filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- 状态标签 ---------- */
.sync-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.sync-badge.synced { background: #e0f5ea; color: #008060; }
.sync-badge.failed { background: #fde8e8; color: #d72c0d; }
.sync-badge.pending { background: #fff3e0; color: #b95000; }
.sync-badge.syncing { background: #e3f2fd; color: #026ac9; }
.sync-badge.unlinked { background: #f0f0f0; color: #737373; }

/* ---------- 变体编辑表 ---------- */
.variant-row { display: grid; grid-template-columns: 2fr 1.2fr 1fr 1fr 28px; gap: 8px; margin-bottom: 8px; align-items: center; }
.variant-row.header { font-size: 12px; color: #6b7177; font-weight: 600; }

/* ---------- 图片上传区 ---------- */
.image-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.image-item { width: 100px; height: 100px; border: 1px solid #e3e3e3; border-radius: 6px; position: relative; overflow: hidden; }
.image-item img { width: 100%; height: 100%; object-fit: cover; }
.image-item .remove-btn {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 12px; opacity: 0; transition: opacity .15s;
}
.image-item:hover .remove-btn { opacity: 1; }
.image-item .main-tag { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,128,96,.85); color: #fff; font-size: 11px; text-align: center; padding: 1px 0; }

/* ---------- 平台同步勾选 ---------- */
.platform-check-item {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 14px;
  border: 1px solid #e3e3e3; border-radius: 6px; margin-bottom: 8px; background: #fafafa;
}
.platform-check-item .p-info { display: flex; align-items: center; gap: 10px; }
.platform-type-tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.platform-type-tag.shopify { background: #e8f5e9; color: #2e7d32; }
.platform-type-tag.woocommerce { background: #ede7f6; color: #5e35b1; }

.form-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; border-top: 1px solid #eee; margin-top: 20px; }
