/* 造映 · 计费网关皮肤 */
:root {
  --zy-ink: #0c2230;
  --zy-ink-soft: #17384a;
  --zy-mist: #d7e4ec;
  --zy-mist-2: #eaf1f5;
  --zy-gold: #a9844f;
  --zy-gold-soft: rgba(169, 132, 79, 0.28);
  --zy-line: rgba(12, 34, 48, 0.14);
  --zy-text: #122734;
  --zy-muted: #5b7382;
  --zy-panel: rgba(255, 252, 247, 0.78);
  --zy-font: 'Outfit', 'PingFang SC', 'Noto Sans SC', sans-serif;
  --zy-display: 'Instrument Serif', 'Songti SC', Georgia, serif;
  --background: 205 30% 94%;
  --foreground: 200 42% 12%;
  --primary: 200 58% 16%;
  --primary-foreground: 40 30% 96%;
  --muted-foreground: 200 16% 42%;
  --border: 200 18% 82%;
  --ring: 200 40% 28%;
}

html.zy-skinned,
html.zy-skinned body,
html.font-inter.zy-skinned,
html.font-inter.zy-skinned body {
  font-family: var(--zy-font) !important;
  color: var(--zy-text) !important;
  letter-spacing: 0.01em;
}

html.zy-skinned body {
  min-height: 100vh;
}

/* 氛围层由 JS 插入，比 ::before 更稳 */
.zy-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(1100px 720px at 8% -8%, rgba(169, 132, 79, 0.34), transparent 58%),
    radial-gradient(980px 680px at 96% 4%, rgba(23, 56, 74, 0.28), transparent 52%),
    radial-gradient(820px 520px at 50% 110%, rgba(12, 34, 48, 0.16), transparent 58%),
    linear-gradient(158deg, #f4f8fa 0%, #dce8ef 46%, #c8d7e2 100%);
}
.zy-ambient::before {
  content: '';
  position: absolute;
  inset: -10%;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(12, 34, 48, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12, 34, 48, 0.055) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at 50% 42%, #000 28%, transparent 76%);
  animation: zy-grid-drift 28s linear infinite;
}
.zy-ambient::after {
  content: '';
  position: absolute;
  width: 42vmin;
  height: 42vmin;
  left: 58%;
  top: 18%;
  border-radius: 50%;
  border: 1px solid rgba(169, 132, 79, 0.22);
  box-shadow:
    0 0 0 28px rgba(169, 132, 79, 0.04),
    0 0 0 64px rgba(12, 34, 48, 0.03);
  animation: zy-orb 12s ease-in-out infinite alternate;
}

@keyframes zy-grid-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-26px, -18px, 0); }
}
@keyframes zy-orb {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.7; }
  to { transform: translate3d(-4%, 6%, 0) scale(1.08); opacity: 1; }
}
@keyframes zy-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* 不要用 body > div：会误伤 .zy-ambient */
html.zy-skinned #root,
html.zy-skinned body > div.notranslate,
html.zy-skinned body > div#root {
  position: relative;
  z-index: 1;
  background: transparent !important;
}
html.zy-skinned,
html.zy-skinned body,
html.font-inter.zy-skinned,
html.font-inter.zy-skinned body {
  background:
    radial-gradient(1100px 720px at 8% -8%, rgba(169, 132, 79, 0.34), transparent 58%),
    radial-gradient(980px 680px at 96% 4%, rgba(23, 56, 74, 0.28), transparent 52%),
    radial-gradient(820px 520px at 50% 110%, rgba(12, 34, 48, 0.16), transparent 58%),
    linear-gradient(158deg, #f4f8fa 0%, #dce8ef 46%, #c8d7e2 100%) !important;
  background-attachment: fixed !important;
}
html.zy-skinned .relative.grid.h-svh,
html.zy-skinned .notranslate,
html.zy-skinned [class*='bg-background'] {
  background: transparent !important;
  background-color: transparent !important;
}
html.zy-skinned .zy-ambient {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 0 !important;
  pointer-events: none !important;
  background: transparent !important; /* 主氛围改画在 html/body，避免再被盖住 */
}

/* —— 登录页 —— */
html.zy-skinned .relative.grid.h-svh {
  animation: zy-fade-up 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

html.zy-skinned .absolute.top-4.left-4,
html.zy-skinned .absolute.top-4.left-4.z-10 {
  gap: 10px !important;
  align-items: center !important;
}
html.zy-skinned .absolute.top-4.left-4 .text-xl,
html.zy-skinned .absolute.top-4.left-4 [class*='text-xl'],
html.zy-skinned .absolute.top-4.left-4 a {
  font-family: var(--zy-display) !important;
  font-size: 1.6rem !important;
  font-weight: 400 !important;
  letter-spacing: 0.05em !important;
  color: var(--zy-ink) !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

/* 登录卡片：只打登录容器，不误伤按钮 */
html.zy-skinned .zy-login-card,
html.zy-skinned .mx-auto.flex.w-full.flex-col.justify-center.space-y-2 {
  background: var(--zy-panel) !important;
  backdrop-filter: blur(22px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.78) !important;
  border-radius: 22px !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 30px 70px -34px rgba(12, 34, 48, 0.42) !important;
  padding: 2.4rem 2.1rem !important;
  position: relative;
  overflow: hidden;
  animation: zy-fade-up 0.85s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

html.zy-skinned .zy-login-card::before,
html.zy-skinned .mx-auto.flex.w-full.flex-col.justify-center.space-y-2::before {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--zy-gold), transparent);
  opacity: 0.95;
}

html.zy-skinned .zy-login-card [class*='text-2xl'],
html.zy-skinned .mx-auto.flex.w-full.flex-col.justify-center [class*='text-2xl'] {
  font-family: var(--zy-display) !important;
  font-size: 2.25rem !important;
  font-weight: 400 !important;
  letter-spacing: 0.07em !important;
  color: var(--zy-ink) !important;
  text-align: left !important;
}

html.zy-skinned input[type='text'],
html.zy-skinned input[type='email'],
html.zy-skinned input[type='password'],
html.zy-skinned .border-input {
  height: 2.75rem !important;
  border-radius: 11px !important;
  border-color: var(--zy-line) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: var(--zy-text) !important;
  box-shadow: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}
html.zy-skinned input:focus-visible,
html.zy-skinned .border-input:focus-visible {
  border-color: var(--zy-ink-soft) !important;
  box-shadow: 0 0 0 3px var(--zy-gold-soft) !important;
}

/* 主按钮：提高优先级，避开卡片误匹配 */
html.zy-skinned button[class*='bg-primary'],
html.zy-skinned button.bg-primary,
html.zy-skinned .zy-login-card button[type='submit'],
html.zy-skinned .mx-auto.flex.w-full.flex-col.justify-center button[class*='w-full'] {
  background: linear-gradient(180deg, #21485c 0%, var(--zy-ink) 100%) !important;
  color: #f6f0e6 !important;
  border: 0 !important;
  border-radius: 11px !important;
  min-height: 2.85rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.1em !important;
  opacity: 1 !important;
  box-shadow: 0 14px 28px -16px rgba(12, 34, 48, 0.65) !important;
  transition: transform 0.18s ease, filter 0.18s ease !important;
}
html.zy-skinned button[class*='bg-primary']:hover,
html.zy-skinned .zy-login-card button[type='submit']:hover,
html.zy-skinned .mx-auto.flex.w-full.flex-col.justify-center button[class*='w-full']:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
html.zy-skinned button[class*='bg-primary']:disabled,
html.zy-skinned .zy-login-card button[type='submit']:disabled {
  background: linear-gradient(180deg, #3a5d6e 0%, #243f4d 100%) !important;
  color: rgba(246, 240, 230, 0.72) !important;
  opacity: 1 !important;
  filter: none;
  transform: none;
  cursor: pointer;
}

html.zy-skinned a.text-muted-foreground,
html.zy-skinned .text-muted-foreground {
  color: var(--zy-muted) !important;
}
html.zy-skinned a.text-muted-foreground:hover {
  color: var(--zy-gold) !important;
}

/* —— 控制台 —— */
html.zy-skinned aside,
html.zy-skinned [data-sidebar],
html.zy-skinned .bg-sidebar {
  background: linear-gradient(180deg, #102937 0%, #0b1f2a 100%) !important;
  border-right: 1px solid rgba(169, 132, 79, 0.2) !important;
  color: #d7e3ea !important;
}
html.zy-skinned aside a:hover,
html.zy-skinned [data-sidebar] a:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-radius: 8px !important;
}
html.zy-skinned .bg-card {
  border-color: var(--zy-line) !important;
  background: rgba(255, 255, 255, 0.86) !important;
  backdrop-filter: blur(8px);
}
html.zy-skinned header,
html.zy-skinned [class*='sticky'][class*='top-0'] {
  backdrop-filter: blur(12px);
  background: rgba(234, 241, 245, 0.86) !important;
  border-bottom-color: var(--zy-line) !important;
}
html.zy-skinned table tr:hover td {
  background: rgba(169, 132, 79, 0.07) !important;
}

.zy-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background:
    linear-gradient(135deg, rgba(169, 132, 79, 0.45), transparent 52%),
    linear-gradient(160deg, #1c4256, #0c2230);
  box-shadow: 0 0 0 1px rgba(169, 132, 79, 0.4);
  flex-shrink: 0;
}
.zy-login-kicker {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--zy-font);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--zy-gold);
}

@media (max-width: 640px) {
  html.zy-skinned .zy-login-card,
  html.zy-skinned .mx-auto.flex.w-full.flex-col.justify-center.space-y-2 {
    margin: 0 12px !important;
    padding: 1.55rem 1.15rem !important;
  }
  .zy-ambient::after { display: none; }
}
