/**
 * 钲鹏机床ERP V100 - 智能功能样式
 */

/* ===== 侧边栏收藏星标 ===== */
.menu-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: all .2s;
  margin-left: auto;
  flex-shrink: 0;
  border-radius: 4px;
}
.menu-item:hover .menu-fav { opacity: 1; }
.menu-fav.faved { opacity: 1; color: #F59E0B; }
.menu-fav:hover { background: #FEF3C7; transform: scale(1.2); }

/* ===== 侧边栏快速入口 ===== */
.menu-item-quick {
  border-radius: 6px !important;
  margin: 1px 4px !important;
  background: #F8FAFC;
  font-size: 11px !important;
}
.menu-item-quick:hover {
  background: #EEF2FF !important;
}

/* ===== 侧边栏快速操作按钮 ===== */
.sidebar-quick-actions button:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.sidebar-quick-actions button:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

/* ===== 智能关联引导横幅 ===== */
.smart-flow-banner {
  animation: sfSlideDown .35s ease;
}
@keyframes sfSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 草稿横幅 ===== */
#smartDraftBanner {
  animation: sfFadeIn .3s ease;
}
@keyframes sfFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== 快速入口栏 ===== */
#smartQuickBar a:hover {
  background: #EEF2FF !important;
  color: #4F46E5 !important;
  transform: translateY(-1px);
}

/* ===== 智能告警提示 ===== */
.smart-alert {
  animation: sfAlertIn .3s ease;
}
@keyframes sfAlertIn {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 40px; }
}

/* ===== 对账结果表格 ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.data-table th, .data-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #E5E7EB;
  text-align: left;
}
.data-table th {
  background: #F9FAFB;
  font-weight: 600;
  color: #6B7280;
  font-size: 11px;
  text-transform: uppercase;
}
.data-table tr:hover td {
  background: #F9FAFB;
}

/* ===== 模态框增强 ===== */
.modal-container {
  max-height: 85vh;
  overflow-y: auto;
}

/* ===== 统计卡片 ===== */
.stat-card {
  flex: 1;
  min-width: 120px;
  padding: 14px;
  background: white;
  border-radius: 10px;
  border: 1px solid #E5E7EB;
  transition: all .2s;
}
.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  transform: translateY(-1px);
}

/* ===== 按钮增强 ===== */
.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #D1D5DB;
  background: white;
  color: #374151;
  transition: all .15s;
}
.btn-sm:hover {
  background: #F3F4F6;
}

/* ===== 知识库搜索高亮 ===== */
#kbSearchResults mark {
  background: #FEF3C7;
  color: #92400E;
  border-radius: 2px;
  padding: 0 2px;
}

/* ===== 移动端适配（#13） ===== */
@media (max-width: 768px) {
  .sidebar-quick-actions {
    padding: 4px 6px !important;
    gap: 3px !important;
  }
  .sidebar-quick-actions button {
    font-size: 10px !important;
    padding: 5px 3px !important;
  }

  #smartQuickBar {
    padding: 4px 6px !important;
    font-size: 10px !important;
  }
  #smartQuickBar a {
    font-size: 10px !important;
    padding: 2px 6px !important;
  }

  .smart-flow-banner > div > div:first-child {
    flex-direction: column;
    gap: 6px;
  }

  /* 移动端底部快捷栏 */
  #mobileSmartBar {
    position: fixed;
    bottom: 56px;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #E5E7EB;
    display: flex;
    padding: 6px 8px;
    gap: 4px;
    z-index: 98;
    box-shadow: 0 -2px 8px rgba(0,0,0,.06);
  }
  #mobileSmartBar button {
    flex: 1;
    padding: 8px 4px;
    border: none;
    border-radius: 8px;
    background: #F3F4F6;
    font-size: 10px;
    cursor: pointer;
    color: #374151;
    font-weight: 500;
  }
  #mobileSmartBar button:active {
    background: #E5E7EB;
  }
}

/* ===== 暗色主题适配 ===== */
@media (prefers-color-scheme: dark) {
  .smart-flow-banner > div {
    background: rgba(99, 102, 241, .15) !important;
    border-color: rgba(99, 102, 241, .3) !important;
    color: #A5B4FC !important;
  }
  #smartQuickBar {
    background: rgba(30, 41, 59, .8) !important;
    border-color: #334155 !important;
  }
  #smartQuickBar a {
    background: #334155 !important;
    color: #E2E8F0 !important;
  }
  #smartDraftBanner > div {
    background: rgba(5, 150, 105, .15) !important;
    border-color: rgba(5, 150, 105, .3) !important;
    color: #6EE7B7 !important;
  }
}
