/* ============================================
   服装周更工坊运营驾驶舱 - 全局样式
   ============================================ */

/* 跨页面平滑过渡（Chrome/Safari 支持，无支持的浏览器自动忽略） */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.18s; }

:root {
  /* 配色 - 淡粉红主题 */
  --bg: #fdf6f7;
  --surface: #ffffff;
  --surface-2: #fbeef0;
  --border: #f3dade;
  --border-strong: #e8c2c8;
  --text: #2a1d20;
  --text-2: #6b5256;
  --text-3: #9b8489;

  --brand: #d27a8c;
  --brand-2: #b85c70;
  --brand-soft: #fbe1e6;
  --accent: #c44a6b;
  --accent-soft: #fad6df;

  /* 状态色 - 红黄绿 */
  --green: #4f8c5a;
  --green-bg: #e6f0e7;
  --yellow: #c69822;
  --yellow-bg: #faf2da;
  --red: #b14a45;
  --red-bg: #f7e3e2;

  --shadow-sm: 0 1px 2px rgba(31, 29, 26, 0.04);
  --shadow: 0 2px 8px rgba(31, 29, 26, 0.06);
  --shadow-lg: 0 8px 24px rgba(31, 29, 26, 0.08);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

/* ============================================
   布局 - 侧边栏 + 主区
   ============================================ */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

.brand {
  padding: 0 24px 24px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.brand-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.5px;
}
.brand-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

.nav { padding: 8px 12px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: all 0.15s;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.nav-section {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 16px 12px 6px;
  font-weight: 600;
}

.main {
  flex: 1;
  /* 顶部留出固定顶栏（全局搜索/通知）的高度，避免页头按钮被遮挡 */
  padding: 60px 36px 28px;
  min-width: 0;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.page-sub {
  color: var(--text-2);
  font-size: 13px;
  margin-top: 4px;
}
.page-actions {
  display: flex;
  gap: 8px;
}

/* ============================================
   卡片
   ============================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title small {
  color: var(--text-3);
  font-weight: 400;
  font-size: 12px;
}

/* ============================================
   按钮
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn-primary {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-accent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ============================================
   状态徽章
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.badge-green { background: var(--green-bg); color: var(--green); border-color: transparent; }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); border-color: transparent; }
.badge-red { background: var(--red-bg); color: var(--red); border-color: transparent; }
.badge-brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--green); }
.dot.yellow { background: var(--yellow); }
.dot.red { background: var(--red); }

/* ============================================
   表格
   ============================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.table th {
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  font-size: 12.5px;
  white-space: nowrap;
}
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }

/* ============================================
   网格
   ============================================ */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* ============================================
   指标卡片（驾驶舱）
   ============================================ */
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.metric-label {
  color: var(--text-2);
  font-size: 12.5px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}
.metric-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.6px;
}
.metric-unit {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 400;
  margin-left: 4px;
}
.metric-foot {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }

/* ============================================
   款式卡（风格档案）
   ============================================ */
.style-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  cursor: pointer;
}
.style-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.style-thumb {
  height: 200px;
  background: linear-gradient(135deg, #d8d2c4, #ede7d8);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 48px;
  color: rgba(31,29,26,0.15);
}
.style-thumb-tag {
  position: absolute;
  top: 10px;
  left: 10px;
}
.style-thumb-no {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(31,29,26,0.5);
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
}
.style-body { padding: 14px 16px 16px; }
.style-name {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
}
.style-meta {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 8px;
}
.style-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.tag {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}

/* ============================================
   看板
   ============================================ */
.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 500px;
}
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 13px;
}
.kanban-col-head .count {
  background: var(--surface);
  color: var(--text-2);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  margin-bottom: 8px;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: all 0.15s;
}
.kanban-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.kanban-card.urgent {
  border-color: var(--red);
  background: var(--red-bg);
}
.kanban-card-no {
  font-family: monospace;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 4px;
}
.kanban-card-name { font-weight: 600; margin-bottom: 6px; }
.kanban-card-meta {
  font-size: 11.5px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================
   进度/状态条
   ============================================ */
.bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}
.bar-fill { height: 100%; background: var(--brand); border-radius: 3px; }
.bar-fill.green { background: var(--green); }
.bar-fill.yellow { background: var(--yellow); }
.bar-fill.red { background: var(--red); }

/* ============================================
   表单
   ============================================ */
.field {
  margin-bottom: 14px;
}
.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 5px;
}
.input, .select, .textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
}
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

/* 款式卡上的状态切换 select：紧凑高度，避免文字裁切 */
.card-status-select {
  padding: 4px 24px 4px 8px;
  font-size: 12.5px;
  height: 30px;
  line-height: 1.2;
  min-height: 30px;
  box-sizing: border-box;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
@media (max-width: 768px) {
  .card-status-select {
    height: 36px;
    min-height: 36px;
    font-size: 13px;
    padding: 6px 26px 6px 10px;
  }
}

/* ============================================
   提示框
   ============================================ */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  border-left: 3px solid;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.alert-info { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.alert-warn { background: var(--yellow-bg); border-color: var(--yellow); color: var(--yellow); }
.alert-error { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.alert-success { background: var(--green-bg); border-color: var(--green); color: var(--green); }

/* ============================================
   工具类
   ============================================ */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-2); }
.text-faint { color: var(--text-3); }
.text-right { text-align: right; }
.font-mono { font-family: monospace; font-size: 12px; }
.bold { font-weight: 600; }

/* ============================================
   响应式
   ============================================ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border);
    /* 顶部留出固定顶栏（搜索/通知/切换手机版）的空间，避免遮挡品牌与导航 */
    padding: 52px 14px 14px;
  }
  .app { flex-direction: column; }
  .nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .nav-item { flex: 0 0 auto; padding: 6px 10px; font-size: 12.5px; }
  .nav-section { display: none; }
  .brand { border-bottom: none; padding: 0 12px 12px; margin-bottom: 4px; }
  .main { padding: 18px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .page-title { font-size: 20px; }
}

/* ============================================
   补充样式 - SPA 渲染所需
   ============================================ */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.metric-card .metric-label { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.metric-card .metric-value { font-size: 26px; font-weight: 700; line-height: 1.2; color: var(--text); }
.metric-card .metric-sub { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 16px;
}
.style-id { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-chips > span {
  white-space: nowrap;
  flex-shrink: 0;
}
.filter-chips .chip {
  white-space: nowrap;
  flex-shrink: 0;
}
.chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--border-strong); }
.chip.on { background: var(--brand); color: white; border-color: var(--brand); }

.dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.green { background: var(--green); }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-bg); border-color: var(--red); }

@media print {
  .sidebar { display: none !important; }
  .main { padding: 0 !important; }
}

/* ============================================
   手机端深度适配（≤640px）
   ============================================ */
@media (max-width: 640px) {
  html, body { font-size: 15px; }

  /* 顶部导航：横向滚动条形 */
  .sidebar {
    position: sticky; top: 0; z-index: 50;
    /* 顶部留出固定顶栏的空间，避免品牌/导航被搜索框遮挡 */
    padding: 50px 12px 10px;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  }
  .brand { padding: 4px 4px 8px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
  .brand-logo { font-size: 16px; }
  .brand-sub { font-size: 10.5px; }
  .nav {
    display: flex; flex-wrap: nowrap; overflow-x: auto;
    gap: 6px; padding: 4px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item {
    flex: 0 0 auto;
    padding: 7px 12px;
    font-size: 13px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    margin: 0;
  }
  .nav-item.active { background: var(--brand); color: white; border-color: var(--brand); }
  .nav-icon { display: none; }
  .nav-section { display: none; }

  /* 主区域 */
  .main { padding: 14px 12px 60px; }
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
  }
  .page-title { font-size: 19px; }
  .page-sub { font-size: 12.5px; }
  .page-header > div:last-child {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 6px !important;
  }

  /* 按钮：增大触控目标 */
  .btn {
    padding: 10px 14px;
    font-size: 13.5px;
    min-height: 38px;
    justify-content: center;
  }
  .btn-sm { padding: 6px 10px; font-size: 12px; min-height: 32px; }

  /* 卡片 */
  .card { padding: 14px; border-radius: 12px; }
  .card-header { padding: 12px 14px; }

  /* 指标卡：两列 */
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .metric-card { padding: 10px 12px; border-radius: 10px; }
  .metric-card .metric-value { font-size: 20px; }
  .metric-card .metric-label { font-size: 11px; }
  .metric-card .metric-sub { font-size: 11px; }

  /* 表格：转成卡片列表（用 data-label 标注每个 td） */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td {
    display: block; width: 100%;
  }
  .table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    padding: 8px 12px;
  }
  .table tbody tr:hover { background: var(--surface); }
  .table td {
    padding: 6px 0;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
  }
  .table td:before {
    content: attr(data-label);
    color: var(--text-3);
    font-size: 11.5px;
    flex: 0 0 auto;
  }
  .table td[colspan] {
    display: block;
    text-align: center !important;
    padding: 24px 0 !important;
  }
  .table td[colspan]:before { content: ''; display: none; }
  /* 操作按钮一行 */
  .table td:last-child {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    margin-top: 4px;
  }

  /* 款式卡 */
  .style-grid { grid-template-columns: 1fr; padding: 12px; gap: 10px; }
  .style-thumb { height: 120px; font-size: 36px; }
  .style-body { padding: 12px; }

  /* 看板：竖向堆叠 */
  .kanban { grid-template-columns: 1fr; gap: 10px; }
  .kanban-col { min-height: auto; padding: 12px; }
  .kanban-col-head { font-size: 13.5px; }

  /* 表单 */
  .field-row { flex-direction: column; gap: 0; }
  .input, .select, .textarea {
    padding: 10px 12px; font-size: 14px;
    min-height: 40px;
  }
  .field-label { font-size: 12.5px; }

  /* 筛选 chip - 让其换行而不是水平滚动，避免标签被挤压 */
  .filter-chips {
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 4px;
    width: 100%;
  }
  .filter-chips > span {
    white-space: nowrap;
    flex-shrink: 0;
    width: auto;
  }
  .chip { flex: 0 0 auto; padding: 6px 12px; font-size: 12.5px; white-space: nowrap; }
  .card-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .card-header .filter-chips {
    margin-left: 0 !important;
  }

  /* 搜索框 */
  #search-input { max-width: 100% !important; margin: 8px 0 0 0 !important; width: 100%; }

  /* 模态框：底部弹出占满屏幕 */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: 16px 16px 0 0 !important;
    margin: 0 !important;
  }
  .modal-body { padding: 16px !important; }
  .modal-footer {
    position: sticky; bottom: 0;
    background: var(--surface);
    padding: 12px 16px !important;
    border-top: 1px solid var(--border);
  }

  /* Toast 顶部居中 */
  .toast { left: 16px !important; right: 16px !important; max-width: none !important; }

  /* 标签 chip 选择器 */
  .tag-pick { padding: 6px 12px !important; font-size: 13px !important; }
}

/* 平板尺寸（641-900px） */
@media (min-width: 641px) and (max-width: 900px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .style-grid { grid-template-columns: repeat(2, 1fr); }
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 20px 18px; }
}

/* ============================================
   登录用户卡 + 退出
   ============================================ */
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  margin: 8px 14px 14px; padding: 10px 12px;
  background: var(--brand-soft); border: 1px solid var(--brand);
  border-radius: 10px;
}
.sidebar-user-icon { font-size: 22px; flex-shrink: 0; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-weight: 600; font-size: 13.5px; color: var(--brand-2); }
.sidebar-user-role { font-size: 11px; color: var(--text-3); }
.sidebar-logout {
  background: none; border: 1px solid var(--brand); color: var(--brand-2);
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.sidebar-logout:hover { background: var(--brand); color: white; }

/* ============================================
   FAB 浮窗按钮（操作日志 + 聊天）
   ============================================ */
.fab {
  position: fixed; width: 50px; height: 50px; border-radius: 50%;
  border: none; background: var(--brand); color: white;
  font-size: 22px; cursor: pointer; box-shadow: 0 6px 20px rgba(196,74,107,0.35);
  z-index: 900; display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.fab:hover { transform: scale(1.06); box-shadow: 0 8px 24px rgba(196,74,107,0.5); }
.fab-audit { left: 24px; bottom: 24px; background: var(--text-2); }
.fab-chat { right: 24px; bottom: 24px; }
.fab-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--red); color: white; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 2px solid white;
}

/* ============================================
   侧边面板（操作日志/聊天通用）
   ============================================ */
.side-panel {
  position: fixed; top: 0; height: 100vh; width: 380px;
  background: white; box-shadow: 0 0 30px rgba(0,0,0,0.15);
  z-index: 950; display: flex; flex-direction: column;
  transition: transform 0.28s cubic-bezier(.2,.8,.2,1);
}
.side-panel-left { left: 0; transform: translateX(-100%); }
.side-panel-right { right: 0; transform: translateX(100%); }
.side-panel.open { transform: translateX(0); }
@media (max-width: 640px) {
  .side-panel { width: 92vw; }
}
.side-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: var(--brand-soft);
}
.side-panel-title { font-weight: 600; font-size: 14.5px; color: var(--brand-2); }
.side-panel-body { flex: 1; overflow-y: auto; }

/* 操作日志条目 */
.audit-row {
  padding: 12px 18px; border-bottom: 1px solid var(--border);
}
.audit-row-head {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--text-3); margin-bottom: 4px;
}
.audit-who { font-weight: 600; color: var(--brand-2); }
.audit-summary { font-size: 13px; color: var(--text); line-height: 1.5; }

/* 聊天面板 */
.chat-panel { display: flex; flex-direction: column; }
.chat-tabs {
  display: flex; gap: 4px; padding: 8px 10px; overflow-x: auto;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
  scrollbar-width: thin;
}
.chat-tab {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: white; cursor: pointer; font-size: 12px; white-space: nowrap;
  position: relative; flex-shrink: 0;
}
.chat-tab.on { background: var(--brand); color: white; border-color: var(--brand); }
.chat-tab-dot {
  display: inline-block; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--red); color: white;
  font-size: 10px; font-weight: 700; margin-left: 4px; vertical-align: middle;
  line-height: 16px;
}
.chat-body {
  flex: 1; overflow-y: auto; padding: 14px; background: #faf6f7;
}
.chat-msg { margin-bottom: 12px; max-width: 80%; }
.chat-msg-meta { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.chat-msg-bubble {
  background: white; padding: 8px 12px; border-radius: 14px 14px 14px 4px;
  font-size: 13.5px; line-height: 1.5; word-break: break-word;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.chat-msg.mine { margin-left: auto; }
.chat-msg.mine .chat-msg-meta { text-align: right; }
.chat-msg.mine .chat-msg-bubble {
  background: var(--brand); color: white;
  border-radius: 14px 14px 4px 14px;
}
.chat-input {
  display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--border);
}
.chat-input .input { flex: 1; }

/* 权限矩阵表 */
.perm-table th { text-align: center; }
.perm-table .perm-cb { transform: scale(1.2); cursor: pointer; }

/* 移动端适配 FAB 不被覆盖 */
@media (max-width: 640px) {
  .fab { width: 46px; height: 46px; font-size: 20px; }
  .fab-audit { left: 16px; bottom: 16px; }
  .fab-chat { right: 16px; bottom: 16px; }
}

/* ============================================
   操作日志：筛选 + 分组
   ============================================ */
.audit-filters {
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  padding: 8px 12px 6px;
}
.audit-filter-row {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px;
}
.audit-chip {
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: white; font-size: 11.5px; cursor: pointer; white-space: nowrap;
  transition: all 0.12s;
}
.audit-chip:hover { border-color: var(--brand); }
.audit-chip.on { background: var(--brand); color: white; border-color: var(--brand); }
.audit-summary-bar {
  display: flex; gap: 12px; padding: 4px 2px 0; font-size: 11.5px;
  color: var(--text-2); flex-wrap: wrap;
}
.audit-summary-bar strong { color: var(--brand-2); }

/* 按天分组 */
.audit-day-group { border-bottom: 1px solid var(--border); }
.audit-day-head {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 16px; background: #fcf3f5; border: none;
  cursor: pointer; text-align: left; font-size: 12.5px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0;
  z-index: 1;
}
.audit-day-head:hover { background: var(--brand-soft); }
.audit-day-arrow { color: var(--brand); font-size: 10px; width: 12px; }
.audit-day-label { font-weight: 600; color: var(--brand-2); flex: 1; }
.audit-day-count {
  background: white; color: var(--text-3); padding: 2px 8px;
  border-radius: 999px; font-size: 11px; border: 1px solid var(--border);
}
.audit-day-body { background: white; }

/* 日志条目 */
.audit-row {
  display: flex; gap: 10px;
  padding: 10px 14px 10px 16px;
  border-bottom: 1px solid var(--border);
}
.audit-row:last-child { border-bottom: none; }
.audit-row-time {
  font-family: Menlo, monospace; font-size: 11px; color: var(--text-3);
  padding-top: 2px; flex-shrink: 0; min-width: 56px;
}
.audit-row-content { flex: 1; min-width: 0; }
.audit-row-head { font-size: 11.5px; color: var(--text-3); margin-bottom: 2px; }
.audit-who { font-weight: 600; color: var(--brand-2); }
.audit-summary { font-size: 13px; color: var(--text); line-height: 1.5; word-break: break-word; }

/* ============================================
   聊天通知：FAB 抖动 + 弹幕卡片 + 静音按钮
   ============================================ */
@keyframes fabPulse {
  0%,100% { box-shadow: 0 6px 20px rgba(196,74,107,0.35); }
  50%     { box-shadow: 0 6px 24px rgba(196,74,107,0.7), 0 0 0 8px rgba(196,74,107,0.18); }
}
@keyframes fabShake {
  0%,100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-3px) rotate(-8deg); }
  40% { transform: translateX(3px) rotate(8deg); }
  60% { transform: translateX(-2px) rotate(-4deg); }
  80% { transform: translateX(2px) rotate(4deg); }
}
.fab.has-unread { animation: fabPulse 1.6s ease-in-out infinite; }
.fab.has-unread:hover { animation: fabShake 0.4s ease-in-out; }
.fab-badge {
  font-family: -apple-system,'PingFang SC',sans-serif;
  font-variant-numeric: tabular-nums;
}

/* 角落弹幕（聊天面板未开时） */
.chat-hint {
  position: fixed; right: 88px; bottom: 28px;
  background: white; border: 1px solid var(--brand);
  border-radius: 12px; padding: 10px 14px; max-width: 280px;
  box-shadow: 0 12px 28px rgba(196,74,107,0.25);
  z-index: 940; cursor: pointer;
  font-size: 13px;
}
.chat-hint:hover { border-color: var(--brand-2); }
.chat-hint-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; color: var(--brand-2); }
.chat-hint-body { color: var(--text); line-height: 1.45; }
@media (max-width: 640px) {
  .chat-hint { right: 16px; bottom: 70px; max-width: 70vw; }
}

/* 静音按钮 */
.chat-mute-btn {
  background: white; border: 1px solid var(--border);
  width: 28px; height: 28px; border-radius: 6px;
  cursor: pointer; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
}
.chat-mute-btn.muted { background: var(--surface-2); opacity: 0.65; color: var(--text-3); }
.chat-mute-btn:hover { border-color: var(--brand); color: var(--brand-2); }

/* ============== 线性 SVG 图标（淑女屋统一图标系统） ============== */
.icon { display: inline-block; vertical-align: -3px; }

/* 章节标题前的小图标 */
.card-title .ic,
.side-panel-title .ic {
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: 8px; color: var(--brand-2); vertical-align: middle;
}

/* 按钮内 SVG + 文字 */
.icon-btn { display: inline-flex; align-items: center; gap: 6px; }
.icon-btn svg { flex-shrink: 0; }

/* 侧边栏导航 */
.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; color: currentColor; }
.nav-icon svg { width: 18px; height: 18px; }
.sidebar-user-icon { display: flex; align-items: center; justify-content: center; color: var(--brand-2); }
.sidebar-user-icon svg { width: 22px; height: 22px; }
.sidebar-logout svg { width: 16px; height: 16px; }

/* 浮窗按钮里的图标居中 */
.fab svg { display: block; }
.fab-ic { display: inline-flex; align-items: center; justify-content: center; }

/* 操作日志筛选 chip */
.audit-chip .ic { display: inline-flex; vertical-align: -2px; margin-right: 4px; color: currentColor; }
.audit-who .ic { display: inline-flex; vertical-align: -2px; margin-right: 4px; color: var(--brand-2); }

/* 聊天 tab、消息、弹幕里的小图标 */
.chat-tab .ic { display: inline-flex; vertical-align: -2px; margin-right: 4px; color: currentColor; }
.chat-msg-meta .ic { display: inline-flex; vertical-align: -2px; margin-right: 4px; color: var(--text-3); }
.chat-msg.mine .chat-msg-meta .ic { color: var(--brand); }
.chat-hint-head .ic { display: inline-flex; align-items: center; color: var(--brand-2); }

/* 首页快捷入口 */
.ql-ic { display: inline-flex; align-items: center; justify-content: center; width: 32px; color: var(--brand-2); }

/* ============ AI 智能助手相关 ============ */
.ai-pick-card .card-header { display:flex; justify-content:space-between; align-items:center; }
.ai-pick-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff 0%, #fff8fa 100%);
  transition: all 0.15s;
}
.ai-pick-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(210, 122, 140, 0.08);
}
