/* =========================================================
   Revomart Trust Product Header — TUI-1
   Path: /trust/trust-header.css
   ========================================================= */

.th-header {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #e4e9ef;
  box-shadow: 0 1px 0 rgba(14, 26, 43, 0.03);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.trust-hidden {
  display: none !important;
}

.th-inner {
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.th-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.th-mark {
  width: 34px;
  height: 34px;
  border-radius: 0;
  background: none;
  color: transparent;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.th-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.th-brand-text strong {
  font-size: 14px;
  font-weight: 700;
  color: #0e1a2b;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.th-brand-text span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b8944f;
  line-height: 1.2;
}

.th-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 2px;
  min-width: 0;
}

.th-nav a,
.th-nav .th-nav-disabled {
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #5c6b7a;
  text-decoration: none;
  white-space: nowrap;
}

.th-nav a:hover {
  color: #0e1a2b;
  background: #f3f5f8;
}

.th-nav a.is-active {
  color: #0e1a2b;
  background: #f4efe4;
}

.th-nav a:focus-visible,
.th-brand:focus-visible,
.th-user a:focus-visible,
.th-menu-btn:focus-visible {
  outline: 2px solid rgba(138, 115, 64, 0.55);
  outline-offset: 2px;
}

.th-nav-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.th-nav-disabled em {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
  color: #8a7340;
}

.th-user {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.th-user-email {
  font-size: 12px;
  color: #5c6b7a;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.th-user a {
  font-size: 13px;
  font-weight: 700;
  color: #0e1a2b;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
}

.th-user a:hover {
  background: #f3f5f8;
}

.th-user a.is-active {
  color: #0e1a2b;
  background: #f4efe4;
}

.th-user a.th-cta {
  background: #0e1a2b;
  color: #fff;
}

.th-user a.th-cta:hover {
  background: #1a2b40;
}

/* Standardized Trust 我的账户 control. Beats generic nav hover/active. */
.th-header a.trust-account-nav,
.th-header a.trust-account-nav.is-active,
.th-nav a.trust-account-nav,
.th-nav a.trust-account-nav.is-active,
.th-nav a.trust-account-nav:hover,
.th-user a.trust-account-nav,
.th-user a.trust-account-nav.is-active,
.th-user a.trust-account-nav:hover {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #243044;
  color: #f4efe4;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.th-header a.trust-account-nav:hover,
.th-header a.trust-account-nav:focus-visible,
.th-nav a.trust-account-nav:hover,
.th-nav a.trust-account-nav:focus-visible,
.th-user a.trust-account-nav:hover,
.th-user a.trust-account-nav:focus-visible {
  background: #1a2433;
  color: #f4efe4;
}

.th-menu-btn {
  display: none;
  appearance: none;
  border: 1px solid #e4e9ef;
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #0e1a2b;
  cursor: pointer;
}

.th-panel {
  display: none;
}

@media (max-width: 980px) {
  .th-menu-btn {
    display: inline-flex;
  }

  .th-nav,
  .th-user {
    display: none;
  }

  .th-header.is-open .th-panel {
    display: block;
    border-top: 1px solid #e4e9ef;
    background: #fff;
    padding: 10px 16px 16px;
  }

  .th-panel .th-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin-bottom: 10px;
  }

  .th-panel .th-nav a,
  .th-panel .th-nav .th-nav-disabled {
    padding: 12px 10px;
  }

  .th-panel .th-user {
    display: flex;
    flex-wrap: wrap;
    margin-left: 0;
    padding-top: 8px;
    border-top: 1px solid #eef2f7;
  }

  .th-user-email {
    max-width: none;
    width: 100%;
  }

  .th-panel a.trust-account-nav,
  .th-panel a.trust-account-nav.is-active,
  .th-panel a.trust-account-nav:hover {
    background: #243044;
    color: #f4efe4;
  }

  .th-panel a.trust-account-nav:hover,
  .th-panel a.trust-account-nav:focus-visible {
    background: #1a2433;
    color: #f4efe4;
  }
}
