/* =====================================================
   FreelinkWeb 后台管理系统 — 全局样式
   字体：auto smoothing，正文 400-500，标题 600-700
   ===================================================== */

:root {
  /* 导航栏 */
  --nav-bg: #0f172a;
  --nav-hover: #1e293b;
  --nav-active: #2563eb;
  --nav-text: #94a3b8;
  --nav-text-active: #ffffff;
  --nav-group: #475569;
  --nav-width: 220px;

  /* 内容区 */
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* 主色 */
  --primary: #2563eb;
  --primary-dark: #1e3a8a;
  --primary-soft: #eff6ff;

  /* 文字 */
  --text-main: #0f172a;
  --text-sub: #374151;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* 状态色 */
  --success: #10b981;
  --success-bg: #d1fae5;
  --success-text: #065f46;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --info: #3b82f6;
  --info-bg: #dbeafe;
  --info-text: #1e40af;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);

  /* 圆角 */
  --radius: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  /* 顶部栏 */
  --topbar-h: 64px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-size: var(--text-md);
  font-weight: var(--weight-normal);
  color: var(--text-main);
  background: var(--bg);
  line-height: var(--leading-normal);
  /* font-family / -webkit-font-smoothing / -moz-osx-font-smoothing 由 shared/base.css 提供 */
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }

/* ===== 布局框架 ===== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== 侧边导航栏 ===== */
.sidebar {
  width: var(--nav-width);
  min-height: 100vh;
  background: var(--nav-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
  text-decoration: none;
}

.sidebar-logo-icon {
  width: 30px; height: 30px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

.sidebar-logo-icon img {
  width: 30px; height: 30px;
  object-fit: contain;
  display: block;
}

.sidebar-logo-text {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  letter-spacing: 2.5px;
  line-height: 1;
}

.sidebar-group {
  padding: 4px 0;
}

/* 折叠标题行 */
.sidebar-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 36px;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
  border-radius: 0;
}

.sidebar-group-header:hover {
  background: rgba(255,255,255,.04);
}

.sidebar-group-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: #cbd5e1;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.group-arrow {
  width: 14px; height: 14px;
  color: #94a3b8;
  flex-shrink: 0;
  transition: transform .2s ease;
}

/* 子菜单折叠容器 */
.sidebar-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  padding: 0 10px;
}

.sidebar-group.open .sidebar-submenu {
  max-height: 560px;
}

.sidebar-group.open .group-arrow {
  transform: rotate(180deg);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--nav-text);
  font-weight: var(--weight-medium);
  font-size: var(--text-base);
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--nav-hover);
  color: #cbd5e1;
}

.nav-item.active {
  background: var(--nav-active);
  color: var(--nav-text-active);
}

.nav-item svg, .nav-item .nav-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: .9;
}

.nav-item .nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: var(--weight-medium);
  color: #64748b;
  background: #1e293b;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-base); font-weight: var(--weight-semibold); color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; overflow: hidden; }

.sidebar-username {
  font-size: var(--text-base); font-weight: var(--weight-semibold);
  color: #ffffff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar-role {
  font-size: var(--text-xs); color: #64748b;
}

/* ===== 主内容区 ===== */
.main-wrap {
  margin-left: var(--nav-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== 顶部栏 ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.topbar-left { display: flex; flex-direction: column; gap: 2px; }

.breadcrumb {
  font-size: var(--text-xs);
  color: var(--text-light);
}

.page-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text-main);
  line-height: 1.3;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 200px;
  height: 36px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-light);
  font-size: var(--text-base);
}

.search-box input {
  border: none; outline: none;
  background: transparent;
  width: 100%;
  font-size: var(--text-base);
  color: var(--text-main);
}

.search-box input::placeholder { color: var(--text-light); }

.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: background .15s;
}

.icon-btn:hover { background: var(--border-light); }

.icon-btn .badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--surface);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-main);
  position: relative;
  transition: background .15s;
}

.user-menu:hover { background: var(--border-light); }

.user-menu .avatar-sm {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: var(--weight-semibold); color: #fff;
  flex-shrink: 0;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  min-width: 160px;
  overflow: hidden;
  z-index: 200;
}

.dropdown-menu.show { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: var(--text-base);
  color: var(--text-sub);
  cursor: pointer;
  transition: background .15s;
}

.dropdown-item:hover { background: var(--bg); }

.dropdown-item.danger { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); }

/* ===== 内容区 ===== */
.content {
  flex: 1;
  padding: 24px;
}

/* ===== 卡片 ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.card-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-main);
}

/* ===== KPI 卡片 ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
}

.kpi-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: var(--weight-bold);
  color: var(--text-main);
  line-height: var(--leading-tight);
}

.kpi-trend {
  font-size: var(--text-xs);
  color: var(--success);
  margin-top: 4px;
}

/* ===== 操作栏 ===== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  height: 36px;
  border-radius: var(--radius);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: #1d4ed8; }

.btn-outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-sub);
}
.btn-outline:hover { background: var(--bg); }

.btn-danger {
  background: var(--danger-bg);
  border-color: #fecaca;
  color: var(--danger);
}
.btn-danger:hover { background: #fee2e2; }

.btn-success {
  background: var(--success-bg);
  border-color: #a7f3d0;
  color: var(--success-text);
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: var(--text-sm);
  border-radius: 6px;
}

.btn-icon {
  width: 28px; height: 28px;
  padding: 0;
  border-radius: 6px;
}

/* ===== Tab 筛选 ===== */
.tab-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: all .15s;
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.tab-btn:hover:not(.active) {
  background: var(--bg);
  color: var(--text-sub);
}

/* ===== Badge ===== */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-text);  }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-info    { background: var(--info-bg);    color: var(--info-text);    }
.badge-gray    { background: var(--border-light); color: var(--text-muted); }
.badge-primary { background: var(--primary-soft); color: var(--primary);    }

/* ===== 产品卡片网格 ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow .2s;
}

.product-card:hover { box-shadow: var(--shadow-md); }

.product-cover {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: var(--text-base);
}

.product-card-body { padding: 16px; }

.product-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}

.product-name {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--text-main);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-desc {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta {
  font-size: var(--text-xs);
  color: var(--text-light);
  margin-bottom: 12px;
}

.product-actions {
  display: flex;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

/* ===== 表格 ===== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

thead tr {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

td {
  padding: 14px 16px;
  font-size: var(--text-base);
  color: var(--text-sub);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: var(--bg); }

.td-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: visible;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-base); font-weight: var(--weight-semibold); color: #fff;
  flex-shrink: 0;
}

.user-info-cell { display: flex; flex-direction: column; gap: 2px; }
.user-name-cell { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--text-main); }
.user-email-cell { font-size: var(--text-sm); color: var(--text-muted); }

/* ===== 表单 ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-sub);
}

.form-control {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-main);
  font-size: var(--text-md);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  background: var(--surface);
}

.form-control::placeholder { color: var(--text-light); }

textarea.form-control {
  height: auto;
  min-height: 100px;
  padding: 10px 12px;
  resize: vertical;
}

select.form-control { cursor: pointer; }

.form-hint {
  font-size: var(--text-sm);
  color: var(--text-light);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== Toggle 开关 ===== */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.toggle {
  position: relative;
  width: 40px; height: 22px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 11px;
  transition: background .2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

.toggle-label {
  font-size: var(--text-base);
  color: var(--text-sub);
  font-weight: var(--weight-medium);
}

/* ===== TipTap 编辑器 ===== */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.editor-toolbar button {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  transition: background .15s, color .15s;
}

.editor-toolbar button:hover { background: var(--border-light); color: var(--text-main); }
.editor-toolbar button.active { background: var(--primary-soft); color: var(--primary); }

.editor-divider {
  width: 1px; height: 20px;
  background: var(--border);
  margin: 0 4px;
}

.editor-body {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  min-height: 320px;
  padding: 16px;
  background: var(--surface);
  color: var(--text-main);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  outline: none;
}

.editor-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: border-color .15s;
}

.editor-wrap:focus-within { border-color: var(--primary); }

.ProseMirror { outline: none; min-height: 300px; }
.ProseMirror p { margin-bottom: 8px; }
.ProseMirror h2 { font-size: var(--text-2xl); font-weight: var(--weight-bold); margin: 16px 0 8px; }
.ProseMirror h3 { font-size: var(--text-xl); font-weight: var(--weight-semibold); margin: 12px 0 6px; }
.ProseMirror ul, .ProseMirror ol { padding-left: 20px; margin-bottom: 8px; }
.ProseMirror blockquote {
  border-left: 3px solid var(--border);
  padding-left: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin: 8px 0;
}
.ProseMirror code {
  background: var(--bg);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: var(--text-base);
  font-family: var(--font-mono);
}
.ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  color: var(--text-light);
  pointer-events: none;
  float: left;
  height: 0;
}

/* ===== 子分类 combo-select ===== */
.subcat-combo { display: flex; flex-direction: column; }
.subcat-select-row { display: flex; gap: 6px; align-items: center; }
#subcatNewRow { display: none; gap: 6px; align-items: center; margin-top: 6px; }

/* ===== 飞书解析区 ===== */
.feishu-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feishu-row .form-control { flex: 1; height: 36px; margin: 0; }

/* ===== 右侧面板 ===== */
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 280px;
  flex-shrink: 0;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px;
}

.panel-title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-main);
  margin-bottom: 14px;
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.panel-row:last-child { margin-bottom: 0; }

.panel-row-label {
  font-size: var(--text-base);
  color: var(--text-muted);
  font-weight: var(--weight-medium);
}

/* ===== 时间线 ===== */
.timeline { display: flex; flex-direction: column; gap: 0; }

.timeline-item {
  display: flex;
  gap: 10px;
  padding-bottom: 14px;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item:last-child::before { display: none; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  z-index: 1;
}

.timeline-dot.success { background: var(--success); }

.timeline-content { flex: 1; }

.timeline-text {
  font-size: var(--text-sm);
  color: var(--text-sub);
  line-height: 1.5;
}

.timeline-time {
  font-size: var(--text-xs);
  color: var(--text-light);
  margin-top: 2px;
}

/* ===== 上传区 ===== */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color .15s;
  text-align: center;
}

.upload-zone:hover { border-color: var(--primary); }

.upload-zone input[type="file"] { display: none; }

.upload-icon { color: var(--text-light); }

.upload-hint {
  font-size: var(--text-sm);
  color: var(--text-light);
}

/* ===== 编辑布局（左内容区 + 右面板）===== */
.edit-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.edit-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* ===== 伙伴 Logo 网格 ===== */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.partner-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow .2s;
}

.partner-card:hover { box-shadow: var(--shadow-md); }

.partner-logo-wrap {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px;
}

.partner-logo-wrap img {
  max-width: 100%;
  max-height: 56px;
  object-fit: contain;
}

.partner-logo-placeholder {
  font-size: var(--text-base);
  color: var(--text-light);
  font-weight: var(--weight-medium);
}

.partner-card-body { padding: 12px; }
.partner-name { font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--text-main); margin-bottom: 4px; }
.partner-meta { font-size: var(--text-xs); color: var(--text-light); margin-bottom: 10px; }
.partner-actions { display: flex; gap: 6px; }

/* ===== 空状态 ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-light);
  text-align: center;
}

.empty-state-icon { font-size: 40px; opacity: .4; }
.empty-state-text { font-size: var(--text-md); color: var(--text-muted); }

/* ===== 登录页 ===== */
.login-page {
  display: flex;
  min-height: 100vh;
}

.login-left {
  width: 560px;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 64px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.login-left-deco {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.login-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}

.login-logo-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.login-logo-name {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.login-headline {
  font-size: 34px;
  font-weight: var(--weight-bold);
  color: #fff;
  line-height: 1.3;
  margin-bottom: 16px;
}

.login-sub {
  font-size: var(--text-lg);
  color: rgba(255,255,255,.65);
  line-height: var(--leading-relaxed);
  margin-bottom: 32px;
}

.login-features { display: flex; flex-direction: column; gap: 10px; }

.login-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-md);
  color: rgba(255,255,255,.75);
}

.login-feature-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--surface);
}

.login-form-wrap {
  width: 100%;
  max-width: 380px;
}

.login-title {
  font-size: 28px;
  font-weight: var(--weight-bold);
  color: var(--text-main);
  margin-bottom: 6px;
}

.login-title-sub {
  font-size: var(--text-md);
  color: var(--text-muted);
  margin-bottom: 32px;
}

.login-copyright {
  position: absolute;
  bottom: 24px;
  right: 40px;
  font-size: var(--text-sm);
  color: var(--text-light);
}

.login-alert {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: var(--text-base);
  margin-bottom: 16px;
  display: none;
}

.login-alert.show { display: block; }

/* ===== 敬请期待页 ===== */
.coming-soon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--topbar-h) - 48px);
}

.coming-soon-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px;
  text-align: center;
  max-width: 480px;
  width: 100%;
}

.coming-soon-icon {
  font-size: 48px;
  margin-bottom: 20px;
  opacity: .5;
}

.coming-soon-title {
  font-size: 22px;
  font-weight: var(--weight-bold);
  color: var(--text-main);
  margin-bottom: 8px;
}

.coming-soon-desc {
  font-size: var(--text-md);
  color: var(--text-muted);
  margin-bottom: 24px;
}

.coming-soon-features {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.coming-soon-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-base);
  color: var(--text-sub);
}

.coming-soon-feature-icon { color: var(--success); flex-shrink: 0; }

/* ===== Toast 提示 ===== */
.toast-wrap {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-main);
  min-width: 260px;
  animation: toastIn .25s ease;
}

.toast.success { border-color: #a7f3d0; background: #f0fdf4; color: var(--success-text); }
.toast.error   { border-color: #fecaca; background: #fff1f2; color: var(--danger-text); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===== Modal 弹窗 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-main);
}

.modal-body { padding: 20px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* ===== 图表占位 ===== */
.chart-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 240px;
  background: var(--bg);
  border-radius: var(--radius);
  color: var(--text-light);
  font-size: var(--text-base);
}

/* ===== 操作记录 ===== */
.log-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.log-item:last-child { border-bottom: none; }

.log-text {
  font-size: var(--text-sm);
  color: var(--text-sub);
  line-height: 1.5;
}

.log-time {
  font-size: var(--text-xs);
  color: var(--text-light);
  margin-top: 2px;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  :root { --nav-width: 60px; }
  .sidebar-logo-text,
  .sidebar-group-label,
  .nav-item span,
  .nav-item .nav-badge,
  .sidebar-user-info { display: none; }
  .sidebar-logo { justify-content: center; padding: 0; }
  .nav-item { justify-content: center; padding: 0; }
  .sidebar-footer { justify-content: center; padding: 12px 0; }
}

@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .partner-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .edit-layout { flex-direction: column; }
  .side-panel { width: 100%; }
  .login-left { display: none; }
}
