/* 定柔科技 ERP - 自定义样式 */
/* Header & Footer 使用 Tailwind CSS 工具类，此文件用于额外自定义样式 */

@import url('/app.notification.css');
@import url('/app.login-dialog.css');
@import url('/app.home-v2.css');

/* 通用：移除移动端点击灰色高亮 */
.no-tap-highlight {
  -webkit-tap-highlight-color: transparent;
}

/* iconfont */
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}

/* 导航链接 - 胶囊形 */
.nav-link {
  display: inline-block;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #323843;
  line-height: 22px;
  transition:
    color 0.2s,
    background-color 0.2s,
    box-shadow 0.2s;
}

.nav-link:hover {
  color: #3b82f6;
}

/* 导航选中样式 - 浅蓝背景 + 蓝色光晕 */
.nav-link--active {
  background-color: #eef5ff;
  color: #3b82f6 !important;
  font-weight: 500;
  border-radius: 8px;
}

.nav-link--button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-nav-entry,
.mobile-nav-entry {
  display: flex;
}

.header-nav-item {
  position: relative;
}

.header-nav-item__arrow {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.header-nav-item--active > .nav-link {
  background-color: #fff;
  color: #3b82f6;
  font-weight: 500;
  border-radius: 8px;
}

.header-nav-item--has-children:hover .header-nav-item__arrow,
.header-nav-item--has-children:focus-within .header-nav-item__arrow,
.header-nav-item--active .header-nav-item__arrow {
  transform: rotate(180deg);
}

.header-submenu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  min-width: 208px;
  padding: 10px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 25px rgba(58, 77, 131, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-6px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
  z-index: 1001;
}

.header-submenu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.header-nav-item--has-children:hover .header-submenu,
.header-nav-item--has-children:focus-within .header-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.header-submenu__item {
  display: block;
  width: 100%;
  padding: 6px 16px;
  border-radius: 8px;
  color: #323843;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.header-submenu__item + .header-submenu__item {
  margin-top: 8px;
}

.header-submenu__item:hover,
.header-submenu__item--active {
  background: #eef5ff;
  color: #3b82f6;
}

.mobile-nav-group {
  display: flex;
  flex-direction: column;
}

.mobile-nav-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.mobile-nav-toggle__arrow {
  margin-left: 8px;
  color: #707a91;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.mobile-nav-group.is-open .mobile-nav-toggle__arrow {
  transform: rotate(180deg);
}

.mobile-submenu {
  display: none;
  padding: 6px 0 0 24px;
}

.mobile-nav-group.is-open .mobile-submenu {
  display: block;
}

.mobile-submenu__item {
  display: block;
  padding: 8px 16px;
  color: #5d697a;
  font-size: 14px;
  line-height: 22px;
  text-decoration: none;
  border-radius: 8px;
}

.mobile-submenu__item + .mobile-submenu__item {
  margin-top: 4px;
}

.mobile-submenu__item--active {
  background: #eef5ff;
  color: #3b82f6;
  font-weight: 500;
}

.header-search-entry {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 190px;
  height: 40px;
  padding: 0 14px 0 10px;
  border: 1px solid #cfd8e3;
  border-radius: 9999px;
  background: #fff;
  color: #707a91;
  font-size: 14px;
  line-height: 22px;
  text-decoration: none;
  box-sizing: border-box;
  margin: 0;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.header-search-entry:hover {
  background: #fff;
  border-color: #bfcadb;
  color: #5d697a;
  box-shadow: 0 6px 18px rgba(58, 77, 131, 0.08);
}

.header-search-entry__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
}

.header-search-entry__input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #323843;
  font: inherit;
  line-height: 22px;
}

.header-search-entry__input::placeholder {
  color: #707a91;
}

/* 右侧按钮 - 胶囊形 */
.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 9999px;
  transition:
    opacity 0.2s,
    box-shadow 0.2s;
}

.header-btn:hover {
  opacity: 0.95;
}

/* 会员权益 - 黄橙到粉紫渐变 */
.header-btn--member {
  color: #693c1b;
  background: linear-gradient(84deg, #fff9bf 0%, #ffe6da 65%, #fddbff 100%);
  box-shadow: 0 2px 8px rgba(249, 131, 255, 0.3);
}

.header-btn--member:hover {
  box-shadow: 0 4px 12px rgba(249, 131, 255, 0.4);
  background: linear-gradient(84deg, #fff48e 0%, #ffd4c1 65%, #fcbcff 100%);
}

.header-btn--member:active {
  box-shadow: 0 4px 12px rgba(249, 131, 255, 0.4);
  background: linear-gradient(84deg, #fff48e 0%, #ffd4c1 65%, #fcbcff 100%);
}

.header-btn__icon {
  width: 18px;
  height: 18px;
}

/* 立即登录 - 白底灰边 */
.header-btn--login {
  color: #4b5563;
  background: #fff;
  border: 1px solid #e5e7eb;
}

.header-btn--login:hover {
  color: #111827;
  border-color: #d1d5db;
}

.header-btn--workbench {
  color: #4b5563;
  background: #fff;
  border: 1px solid #e5e7eb;
}

.header-btn--workbench:hover {
  color: #111827;
  border-color: #d1d5db;
}

/* 登录后：用户头像 + 下拉 */
.header-user {
  position: relative;
}

.header-user__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #374151;
  cursor: pointer;
  line-height: 0;
  transition: opacity 0.2s ease;
}

.header-user__trigger:hover {
  opacity: 0.92;
}

.header-user__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #d2d9e0;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.header-user__dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 208px;
  padding: 10px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 25px rgba(58, 77, 131, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity 0.2s,
    transform 0.2s,
    visibility 0.2s;
  z-index: 1000;
}

.header-user.is-open .header-user__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header-user__dropdown-title {
  padding: 8px 16px;
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

.header-user__dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 16px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #323843;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
  box-sizing: border-box;
}

.header-user__dropdown-item
  + .header-user__dropdown-item:not(.header-user__dropdown-item--logout) {
  margin-top: 8px;
}

.header-user__dropdown-item:hover,
.header-user__dropdown-item--active {
  background: #eef5ff;
  color: #3b82f6;
}

.header-user__dropdown-item--logout {
  align-self: flex-start;
  justify-content: center;
  margin-top: 12px;
  width: auto;
  padding: 8px 14px;
  border: 1px solid #cfd8ea;
  background: #fff;
  color: #4b5563;
  font-weight: 500;
}

.header-user__dropdown-item--logout:hover {
  background: #fff;
  border-color: #9db7f8;
  color: #3b82f6;
}

.header-user__dropdown-item--logout .header-user__dropdown-icon {
  flex-shrink: 0;
}

/* homepage */
.home-warapper {
  position: relative;
  isolation: isolate;
  /* 创建新堆叠上下文，避免背景层影响子元素 cursor */
  min-height: 2406px;
}

.home-warapper::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url('/assets/images/home-bg-1.png');
  background-repeat: no-repeat;
  background-size: cover;
}

/* ========== Homepage Accordion Item (复用样式) ========== */
.accordion-item {
  width: 100%;
  padding: 0 4px;
  transition: all 0.3s;
}

.accordion-item__active {
  padding: 16px;
}

.accordion-item__header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.accordion-item__left {
  display: flex;
  align-items: center;
  gap: 12px;
  /* 对应 gap-3 */
}

.accordion-item__iconWrap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.accordion-item__arrowWrap {
  width: 24px;
  height: 24px;
  position: relative;
}

.accordion-item__content {
  max-height: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  /* 约等于 rounded-xl */
  transition: all 0.3s;
}

.accordion-item__desc {
  color: rgb(63 63 70);
  /* text-zinc-700 */
  font-size: 16px;
  line-height: 24px;
  margin: 16px 0;
  /* mb-4 */
}

.accordion-item__bullets {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  /* gap-3 */
}

.accordion-item__bullet {
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  /* gap-2 */
}

.accordion-item__bulletIconWrap {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.accordion-item__bulletText {
  color: rgb(63 63 70);
  /* text-zinc-700 */
  font-size: 16px;
  line-height: 20px;
}

.\!grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.\!grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* homepage */
.homepage-sub-title {
  background: linear-gradient(90deg, #323843, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Homepage Hero Tab 选中态 - 渐变文字和边框 */
.homepage-tab__active {
  background: linear-gradient(
    90deg,
    #0f77fe,
    #1170fe,
    #1369fe,
    #1662fe,
    #185cfe,
    #1a55fe,
    #1c4ffe,
    #1f49fe,
    #2143ff,
    #233dff,
    #2537ff,
    #2831ff,
    #2a2cff,
    #322cff,
    #3b2eff,
    #4531ff,
    #4e33ff
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.homepage-tab__active-border {
  background: linear-gradient(
    90deg,
    #0f77fe,
    #1170fe,
    #1369fe,
    #1662fe,
    #185cfe,
    #1a55fe,
    #1c4ffe,
    #1f49fe,
    #2143ff,
    #233dff,
    #2537ff,
    #2831ff,
    #2a2cff,
    #322cff,
    #3b2eff,
    #4531ff,
    #4e33ff
  );
}

.price_card_btn--disabled {
  cursor: not-allowed;
}

.factory-join-top_text {
  background: linear-gradient(
    90deg,
    #6028fe,
    #5129fe,
    #4329fe,
    #352aff,
    #2a2eff,
    #2b3dff,
    #2b4cff,
    #2c5bff,
    #2c6aff,
    #2d79ff,
    #2d87ff,
    #2e96ff
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

button.primary,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px;
  background-color: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 80px;
  font-family: 'PingFang SC', sans-serif;
  font-size: 14px;
  /* font-weight: 500; */
  cursor: pointer;
  /* box-shadow: 0px 15px 20px 0px rgba(67, 108, 230, 0.3); */
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

button.primary:hover,
.btn-primary:hover {
  background-color: #59a4ff;
}

button.primary:active,
.btn-primary:active {
  background-color: #1461e1;
}

.header-auth-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 40px;
  padding: 0 20px;
  background-color: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 80px;
  font-family: 'PingFang SC', sans-serif;
  font-size: 14px;
  line-height: 22px;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.header-auth-entry:active {
  background-color: #1461e1;
}

.header-auth-entry__action {
  padding: 2px 6px;
  margin: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.5;
  cursor: pointer;
  border-radius: 80px;
  transition:
    color 0.2s ease;
}

.header-auth-entry__action:hover {
  color: rgba(255, 255, 255, 0.84);
}

.header-auth-entry__action:active {
  color: rgba(255, 255, 255, 0.72);
}

.header-auth-entry__divider {
  color: inherit;
  line-height: 1;
  margin: 0 4px;
  opacity: 0.7;
  user-select: none;
}

button.default,
.btn-default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px;
  background-color: #ffffff;
  color: #5d697a;
  border: 1px solid #d2d9e0;
  border-radius: 80px;
  font-family: 'PingFang SC', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

button.default:hover,
.btn-default:hover {
  background-color: #eef5ff;
  border-color: #3b82f6;
  color: #3b82f6;
}

button.default:active,
.btn-default:active {
  background-color: #eef5ff;
  border-color: #1461e1;
  color: #1461e1;
}

.btn-lg {
  padding: 12px 32px;
  font-size: 16px;
}

button.primary.disabled,
button.primary.loading,
.btn-primary.disabled,
.btn-primary.loading {
  background-color: #8ec1ff;
  color: white;
}

button.loading,
.btn-primary.loading {
  position: relative;
  pointer-events: none;
}

button.loading::before,
.btn-primary.loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: button-spinner 1s linear infinite;
}

@media (max-width: 1023px) {
  header[role='banner'] > div {
    min-height: 56px;
    padding: 11px 8px !important;
  }

  #mobile-menu-button {
    width: 24px;
    height: 24px;
    margin-right: 8px !important;
  }

  header[role='banner'] a[href='/'] img {
    width: 90px;
    height: 24px;
    object-fit: contain;
  }

  header[role='banner'] button.default,
  header[role='banner'] button.primary,
  header[role='banner'] .btn-primary,
  header[role='banner'] .header-auth-entry,
  header[role='banner'] .default,
  header[role='banner'] .primary {
    min-height: 34px;
    padding: 6px 16px;
    font-size: 14px;
    line-height: 22px;
    white-space: nowrap;
  }
}

@keyframes button-spinner {
  to {
    transform: rotate(360deg);
  }
}
