/*!
 * custom-theme.css — 语丝哲ERP UI 美化主题
 * 加载于 app.css / chunk-vendors.css 之后，覆盖默认样式。
 * 设计：现代 SaaS 风格 — 宝蓝主色、渐变侧栏、圆角卡片、柔和阴影。
 */

:root {
  --kc-primary: #2563eb;
  --kc-primary-hover: #3b82f6;
  --kc-primary-active: #1d4ed8;
  --kc-primary-soft: #eff4ff;
  --kc-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  --kc-sider-bg: linear-gradient(180deg, #101c33 0%, #0b1526 100%);
  --kc-sider-logo: rgba(255, 255, 255, 0.04);
  --kc-text: #1f2937;
  --kc-text-sub: #64748b;
  --kc-border: #e5e9f2;
  --kc-bg: #f4f6fa;
  --kc-radius-lg: 12px;
  --kc-radius: 8px;
  --kc-radius-sm: 6px;
  --kc-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --kc-shadow: 0 4px 16px rgba(16, 24, 40, 0.08);
  --kc-shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);
}

/* ========== 全局字体 ========== */
html body,
body .ant-btn,
body .ant-input,
body .ant-table,
body .ant-menu,
body .ant-modal,
body .ant-select,
body .ant-card {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Helvetica Neue", Arial,
    sans-serif !important;
}

/* ========== 页面背景 ========== */
.layout,
.ant-layout {
  background: var(--kc-bg) !important;
}

/* ========== 链接 / 主色 ========== */
a { color: var(--kc-primary); }
a:hover { color: var(--kc-primary-hover); }

.ant-btn-primary:not([disabled]),
.ant-btn-primary:not([disabled]):hover,
.ant-btn-primary:not([disabled]):focus {
  background: var(--kc-gradient) !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.32) !important;
}
.ant-btn-primary:not([disabled]):hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.ant-btn {
  border-radius: var(--kc-radius-sm) !important;
  transition: all 0.2s ease !important;
}
.ant-btn:not(.ant-btn-primary):not(.ant-btn-danger):not(.ant-btn-link):hover {
  color: var(--kc-primary) !important;
  border-color: var(--kc-primary) !important;
}
.ant-btn-danger:not([disabled]) {
  border-radius: var(--kc-radius-sm) !important;
}
.ant-btn-link { color: var(--kc-primary) !important; }

/* ========== 顶栏 ========== */
.top-nav-header,
.top-nav-header-index,
.ant-layout-header.header-index-wide,
.header-index-wide {
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.08) !important;
}
.top-nav-header-index.dark {
  background: var(--kc-sider-bg) !important;
}
.top-nav-header-index .trigger:hover {
  background: rgba(37, 99, 235, 0.06) !important;
  color: var(--kc-primary);
}
/* 顶部横向菜单选中 */
.top-nav-header-index .ant-menu-horizontal > .ant-menu-item-selected,
.top-nav-header-index .ant-menu-horizontal > .ant-menu-item-active {
  border-bottom-color: var(--kc-primary) !important;
}

/* ========== 侧边栏 ========== */
.sider,
.sider .ant-layout-sider,
.ant-layout-sider.sider {
  background: var(--kc-sider-bg) !important;
  box-shadow: 2px 0 8px rgba(11, 21, 38, 0.25) !important;
}
.sider .logo,
.sider.light .logo {
  background: var(--kc-sider-logo) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sider .ant-menu-dark,
.sider .ant-menu-dark .ant-menu-sub {
  background: transparent !important;
}
.sider .ant-menu-dark .ant-menu-item,
.sider .ant-menu-dark .ant-menu-submenu-title {
  margin: 2px 8px !important;
  width: calc(100% - 16px) !important;
  border-radius: var(--kc-radius-sm) !important;
  transition: all 0.2s ease;
}
.sider .ant-menu-dark .ant-menu-item:hover,
.sider .ant-menu-dark .ant-menu-submenu-title:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}
.sider .ant-menu-dark .ant-menu-item-selected,
.sider .ant-menu-dark .ant-menu-item-selected:hover {
  background: var(--kc-gradient) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}
.sider .ant-menu-dark .ant-menu-item-selected::after {
  display: none !important;
}
.sider .ant-menu-dark .ant-menu-submenu-selected > .ant-menu-submenu-title {
  color: #dbe6ff !important;
}
.sider .ant-layout-sider-trigger {
  background: rgba(0, 0, 0, 0.35) !important;
}

/* ========== 多页签 ========== */
.ant-tabs-bar {
  border-bottom-color: var(--kc-border) !important;
  margin-bottom: 12px !important;
}
.ant-tabs-nav .ant-tabs-tab {
  border-radius: var(--kc-radius-sm) var(--kc-radius-sm) 0 0 !important;
  transition: all 0.2s ease;
}
.ant-tabs-nav .ant-tabs-tab:hover {
  color: var(--kc-primary) !important;
}
.ant-tabs-nav .ant-tabs-tab-active {
  color: var(--kc-primary) !important;
  font-weight: 600;
}
.ant-tabs-ink-bar {
  background: var(--kc-primary) !important;
  height: 2.5px !important;
  border-radius: 2px;
}

/* ========== 卡片 / 内容容器 ========== */
.ant-card {
  border-radius: var(--kc-radius) !important;
  border-color: var(--kc-border) !important;
  box-shadow: var(--kc-shadow-sm) !important;
  transition: box-shadow 0.25s ease;
}
.ant-card:hover {
  box-shadow: var(--kc-shadow) !important;
}
.ant-card-head {
  border-bottom-color: var(--kc-border) !important;
  font-weight: 600;
}
.table-page-search-wrapper {
  background: #fff;
  border-radius: var(--kc-radius);
  box-shadow: var(--kc-shadow-sm);
}

/* ========== 表格 ========== */
.ant-table-wrapper .ant-table {
  border-radius: var(--kc-radius) !important;
}
.ant-table-thead > tr > th {
  background: #f6f8fc !important;
  color: #475569 !important;
  font-weight: 600 !important;
  border-bottom: 1px solid var(--kc-border) !important;
}
.ant-table-thead > tr:first-child > th:first-child {
  border-top-left-radius: var(--kc-radius) !important;
}
.ant-table-thead > tr:first-child > th:last-child {
  border-top-right-radius: var(--kc-radius) !important;
}
.ant-table-tbody > tr > td {
  border-bottom-color: #f0f2f7 !important;
}
.ant-table-tbody > tr:nth-child(even) > td {
  background: #fafbfd;
}
.ant-table-tbody > tr:hover > td,
.ant-table-tbody > tr.ant-table-row-hover > td {
  background: var(--kc-primary-soft) !important;
}
.ant-table-thead > tr > th .ant-table-column-sorter .ant-table-column-sorter-inner-full {
  color: #b6c2d6;
}
/* 表格操作链接 */
.ant-table-tbody a {
  color: var(--kc-primary);
}

/* ========== 表单控件 ========== */
.ant-input,
.ant-select-selection,
.ant-input-number,
.ant-calendar-picker-input {
  border-radius: var(--kc-radius-sm) !important;
}
.ant-input:hover,
.ant-select-selection:hover,
.ant-input-number:hover {
  border-color: var(--kc-primary-hover) !important;
}
.ant-input:focus,
.ant-input-focused,
.ant-select-focused .ant-select-selection,
.ant-input-number-focused {
  border-color: var(--kc-primary) !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12) !important;
}
.ant-checkbox-checked .ant-checkbox-inner,
.ant-checkbox-indeterminate .ant-checkbox-inner::after {
  background-color: var(--kc-primary) !important;
  border-color: var(--kc-primary) !important;
}
.ant-checkbox-indeterminate .ant-checkbox-inner {
  border-color: var(--kc-primary) !important;
}
.ant-checkbox-wrapper:hover .ant-checkbox-inner,
.ant-checkbox:hover .ant-checkbox-inner {
  border-color: var(--kc-primary) !important;
}
.ant-radio-checked .ant-radio-inner {
  border-color: var(--kc-primary) !important;
}
.ant-radio-inner::after {
  background-color: var(--kc-primary) !important;
}
.ant-switch-checked {
  background: var(--kc-primary) !important;
}
.ant-calendar-selected-day .ant-calendar-date,
.ant-calendar-month-panel-selected-cell .ant-calendar-month-panel-month,
.ant-calendar-year-panel-selected-cell .ant-calendar-year-panel-year {
  background: var(--kc-primary) !important;
}
.ant-calendar-today .ant-calendar-date {
  color: var(--kc-primary) !important;
  border-color: var(--kc-primary) !important;
}
.ant-select-dropdown-menu-item-selected,
.ant-select-dropdown-menu-item-active {
  background: var(--kc-primary-soft) !important;
  color: var(--kc-primary) !important;
}

/* ========== 弹窗 ========== */
.ant-modal-content {
  border-radius: var(--kc-radius-lg) !important;
  overflow: hidden;
  box-shadow: var(--kc-shadow-lg) !important;
}
.ant-modal-header {
  border-bottom: 1px solid var(--kc-border) !important;
}
.ant-modal-title {
  font-weight: 600 !important;
}
.ant-modal-footer {
  border-top: 1px solid var(--kc-border) !important;
}
.ant-modal-confirm-body .ant-modal-confirm-title {
  font-weight: 600;
}
.ant-drawer-content {
  border-radius: 0 !important;
}

/* ========== 分页 ========== */
.ant-pagination-item,
.ant-pagination-prev .ant-pagination-item-link,
.ant-pagination-next .ant-pagination-item-link {
  border-radius: var(--kc-radius-sm) !important;
}
.ant-pagination-item-active {
  background: var(--kc-gradient) !important;
  border-color: transparent !important;
}
.ant-pagination-item-active a {
  color: #fff !important;
}
.ant-pagination-item:hover a {
  color: var(--kc-primary) !important;
}

/* ========== 消息 / 通知 / 下拉 ========== */
.ant-message-notice-content,
.ant-notification-notice,
.ant-dropdown-menu,
.ant-select-dropdown {
  border-radius: var(--kc-radius) !important;
  box-shadow: var(--kc-shadow) !important;
}
.ant-tag {
  border-radius: 4px !important;
}
.ant-spin {
  color: var(--kc-primary) !important;
}
.ant-progress-bg {
  background: var(--kc-gradient) !important;
}
.ant-tooltip-inner {
  border-radius: var(--kc-radius-sm) !important;
}

/* ========== 登录页 ========== */
.user-layout-wrapper {
  background: linear-gradient(135deg, #0b1526 0%, #14274e 45%, #1d4ed8 100%) !important;
  position: fixed;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  left: 0 !important;
  top: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden;
}
.user-layout-wrapper::before {
  content: "";
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.35) 0%, transparent 70%);
  top: -180px;
  right: -120px;
  pointer-events: none;
}
.user-layout-wrapper::after {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.28) 0%, transparent 70%);
  bottom: -160px;
  left: -100px;
  pointer-events: none;
}
.user-layout-wrapper .container {
  float: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6vw;
  height: auto !important;
  width: auto !important;
  max-width: 96vw;
}
.user-layout-wrapper .container .poster-img {
  float: none !important;
  height: auto !important;
  max-height: 62vh;
}
.user-layout-wrapper .container .poster-img img {
  max-height: 62vh;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.35));
  border-radius: 16px;
}
.user-layout-wrapper .container .right-form {
  float: none !important;
  margin-top: 0 !important;
  width: 380px !important;
  max-width: 92vw;
  height: auto !important;
  min-height: 480px;
  padding: 36px 38px 28px !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 24px 64px rgba(2, 8, 23, 0.45) !important;
  position: relative;
  z-index: 2;
}
.user-layout-wrapper .right-form .top .header {
  margin-top: 8px !important;
  margin-bottom: 24px !important;
}
.user-layout-login .ant-input,
.user-layout-login .ant-input-affix-wrapper .ant-input {
  height: 42px !important;
  border-radius: var(--kc-radius-sm) !important;
  background: #f8fafc;
}
.user-layout-login .ant-input:focus {
  background: #fff;
}
.user-layout-login button.login-button,
.user-layout-login .login-button {
  height: 44px !important;
  border-radius: var(--kc-radius-sm) !important;
  background: var(--kc-gradient) !important;
  border: none !important;
  font-weight: 600 !important;
  letter-spacing: 4px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.38) !important;
  transition: all 0.2s ease !important;
}
.user-layout-login button.login-button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45) !important;
}
.login-copyright,
.login-copyright a {
  color: rgba(255, 255, 255, 0.65) !important;
}
.user-layout-wrapper .login-copyright {
  position: relative;
  z-index: 2;
}
/* 移动端登录 */
.user-layout-wrapper.mobile {
  left: 0 !important;
  top: 0 !important;
}
.user-layout-wrapper.mobile .container .main {
  max-width: 92vw !important;
}

/* ========== 滚动条（增强） ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #c9d2e0;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ========== 仪表盘统计卡片 ========== */
.ant-card .ant-statistic-title {
  color: var(--kc-text-sub) !important;
}
.number-info .number-info-title {
  color: var(--kc-text-sub) !important;
}

/* ========== 加载动画颜色 ========== */
#loader {
  border-top-color: var(--kc-primary) !important;
}
#loader:before {
  border-top-color: #3b82f6 !important;
}
#loader:after {
  border-top-color: #93c5fd !important;
}
#loader-wrapper .load_title {
  color: #64748b !important;
}

/* ========== 顶栏官网链接（按需求移除） ========== */
.user-wrapper .action:has(> a[href*="gyjerp.com"]),
.user-wrapper a[href*="gyjerp.com"] {
  display: none !important;
}

/* ========== 打印工具栏按钮（条码打印） ========== */
.kc-print-btn.ant-btn {
  color: var(--kc-primary) !important;
  border-color: var(--kc-primary) !important;
  background: var(--kc-primary-soft) !important;
  font-weight: 500;
}
.kc-print-btn.ant-btn:hover {
  background: #dfe9ff !important;
  transform: translateY(-1px);
}

/* ========== 修复：单据弹窗内下拉弹层挂在 .ant-modal 下（antd 原生 .ant-modal 为
   pointer-events:none，仅 .ant-modal-content 恢复 auto），导致弹层继承 none、
   选项"看得到点不到"。对挂在 modal 下的弹层容器恢复指针事件。 ========== */
.ant-modal > div:not(.ant-modal-content) {
  pointer-events: auto;
}
