/**
 * 全局样式
 * @file global.css
 * @description 全局CSS样式定义
 */

/* 重置样式 */
* {
  box-sizing: border-box;
}

/* 强制重置所有元素的默认样式 */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 确保body和html没有默认空白 */
html {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
  font-size: 14px !important;
  line-height: 1.5715 !important;
}

body {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
  position: relative !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif !important;
  color: #262626 !important;
  background-color: #f0f2f5 !important;
}

/* 确保#app容器没有空白 */
#app {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
  position: relative !important;
}

/* 强制修复Ant Design菜单空白问题 */
.ant-menu,
.ant-menu-root,
.ant-menu-vertical,
.ant-menu-inline {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

.ant-menu-item,
.ant-menu-submenu-title {
  margin: 0 !important;
  padding: 0 16px !important;
}

.ant-menu-item:first-child,
.ant-menu-submenu:first-child .ant-menu-submenu-title {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 确保侧边栏菜单从顶部开始 */
.ant-layout-sider .ant-menu,
.ant-layout-sider .ant-menu-root,
.ant-layout-sider .ant-menu-vertical,
.ant-layout-sider .ant-menu-inline {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

/* 强制移除菜单容器的所有空白 */
.ant-menu > li:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.ant-menu .ant-menu-item:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 针对侧边栏的特殊处理 */
.ant-layout-sider .ant-menu > li:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.ant-layout-sider .ant-menu .ant-menu-item:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* 最终强制重置 - 确保没有任何空白 */
.ant-layout-sider {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: #001529 !important;
}

.ant-layout-sider .ant-menu {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
  height: 100% !important;
}

.ant-layout-sider .ant-menu ul {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

.ant-layout-sider .ant-menu li {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

.ant-layout-sider .ant-menu li:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: none !important;
}

/* 强制重置菜单项样式 */
.ant-layout-sider .ant-menu-item {
  margin: 0 !important;
  padding: 0 16px !important;
  height: 48px !important;
  line-height: 48px !important;
  border: none !important;
}

.ant-layout-sider .ant-menu-item:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: none !important;
}

.ant-layout-sider .ant-menu-submenu-title {
  margin: 0 !important;
  padding: 0 16px !important;
  height: 48px !important;
  line-height: 48px !important;
  border: none !important;
}

/* 确保头部完全显示 */
.ant-layout-header {
  padding: 0 !important;
  margin: 0 !important;
  line-height: 64px !important;
  height: 64px !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1001 !important;
  width: 100vw !important;
  box-sizing: border-box !important;
}

/* 强制重置所有可能的头部样式 */
.ant-layout-header * {
  box-sizing: border-box !important;
}

/* 确保头部内容不被截断 */
.ant-layout-header .logo,
.ant-layout-header .user-info {
  line-height: 64px !important;
  height: 64px !important;
  display: flex !important;
  align-items: center !important;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  font-size: 14px;
  line-height: 1.5715;
  color: #262626;
  background-color: #f0f2f5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  height: 100%;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 链接样式 */
a {
  color: #1890ff;
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: #40a9ff;
}

a:active {
  color: #096dd9;
}

/* 按钮样式增强 */
.ant-btn {
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s;
}

.ant-btn-primary {
  background: #1890ff;
  border-color: #1890ff;
}

.ant-btn-primary:hover {
  background: #40a9ff;
  border-color: #40a9ff;
}

.ant-btn-primary:active {
  background: #096dd9;
  border-color: #096dd9;
}

/* 输入框样式增强 */
.ant-input,
.ant-input-password,
.ant-select-selector {
  border-radius: 6px;
  transition: all 0.3s;
}

.ant-input:focus,
.ant-input-password:focus,
.ant-select-focused .ant-select-selector {
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 卡片样式增强 */
.ant-card {
  border-radius: 8px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
  transition: all 0.3s;
}

.ant-card:hover {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02), 0 4px 8px 0 rgba(0, 0, 0, 0.05);
}

/* 表格样式增强 */
.ant-table {
  border-radius: 8px;
  overflow: hidden;
}

.ant-table-thead > tr > th {
  background: #fafafa;
  font-weight: 600;
  color: #262626;
  border-bottom: 1px solid #f0f0f0;
}

.ant-table-tbody > tr:hover > td {
  background: #f5f5f5;
}

/* 模态框样式增强 */
.ant-modal {
  border-radius: 8px;
}

.ant-modal-content {
  border-radius: 8px;
  overflow: hidden;
}

.ant-modal-header {
  border-bottom: 1px solid #f0f0f0;
  padding: 16px 24px;
}

.ant-modal-body {
  padding: 24px;
}

.ant-modal-footer {
  border-top: 1px solid #f0f0f0;
  padding: 10px 16px;
}

/* 抽屉样式增强 */
.ant-drawer-content {
  border-radius: 8px 0 0 8px;
}

.ant-drawer-header {
  border-bottom: 1px solid #f0f0f0;
  padding: 16px 24px;
}

.ant-drawer-body {
  padding: 24px;
}

/* 页面布局样式 */
.page-container {
  padding: 24px;
  background: #f0f2f5;
  min-height: calc(100vh - 64px);
}

.page-header {
  background: #fff;
  padding: 16px 24px;
  margin-bottom: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
}

.page-content {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
}

/* 搜索区域样式 */
.search-area {
  background: #fff;
  padding: 16px 24px;
  margin-bottom: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
}

.search-form {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.search-form .ant-form-item {
  margin-bottom: 0;
}

.search-buttons {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* 操作按钮样式 */
.action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.action-buttons .ant-btn {
  border-radius: 6px;
}

/* 状态标签样式 */
.status-tag {
  border-radius: 4px;
  font-weight: 500;
}

.status-active {
  background: #f6ffed;
  color: #52c41a;
  border-color: #b7eb8f;
}

.status-inactive {
  background: #fff2e8;
  color: #fa8c16;
  border-color: #ffd591;
}

.status-suspended {
  background: #fff1f0;
  color: #ff4d4f;
  border-color: #ffccc7;
}

.status-locked {
  background: #f5f5f5;
  color: #8c8c8c;
  border-color: #d9d9d9;
}

/* 金额显示样式 */
.amount-text {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-weight: 600;
}

.amount-positive {
  color: #52c41a;
}

.amount-negative {
  color: #ff4d4f;
}

.amount-zero {
  color: #8c8c8c;
}

/* 加载状态样式 */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.loading-text {
  margin-left: 12px;
  color: #8c8c8c;
}

/* 空状态样式 */
.empty-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  color: #8c8c8c;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: #d9d9d9;
}

.empty-text {
  font-size: 16px;
  margin-bottom: 8px;
}

.empty-description {
  font-size: 14px;
  color: #8c8c8c;
}

/* 响应式样式 */
@media (max-width: 768px) {
  .page-container {
    padding: 12px;
  }
  
  .page-header {
    padding: 12px 16px;
    margin-bottom: 12px;
  }
  
  .page-content {
    padding: 16px;
  }
  
  .search-area {
    padding: 12px 16px;
    margin-bottom: 12px;
  }
  
  .search-form {
    flex-direction: column;
    gap: 12px;
  }
  
  .search-buttons {
    margin-left: 0;
    width: 100%;
  }
  
  .search-buttons .ant-btn {
    flex: 1;
  }
}

/* 打印样式 */
@media print {
  .no-print {
    display: none !important;
  }
  
  .page-container {
    padding: 0;
    background: #fff;
  }
  
  .page-header,
  .page-content {
    box-shadow: none;
    border: 1px solid #d9d9d9;
  }
}

/* 动画效果 */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.slide-enter-active,
.slide-leave-active {
  transition: transform 0.3s ease;
}

.slide-enter-from {
  transform: translateX(-100%);
}

.slide-leave-to {
  transform: translateX(100%);
}

/* 工具类 */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.ml-0 { margin-left: 0; }
.ml-8 { margin-left: 8px; }
.ml-16 { margin-left: 16px; }
.ml-24 { margin-left: 24px; }

.mr-0 { margin-right: 0; }
.mr-8 { margin-right: 8px; }
.mr-16 { margin-right: 16px; }
.mr-24 { margin-right: 24px; }

.p-0 { padding: 0; }
.p-8 { padding: 8px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-1 {
  flex: 1;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}