/* Zhongzhuan brand layer.
   Keep New API's native light/dark theme intact; only add precise polish. */
:root {
  --zz-accent: #13c8b6;
  --zz-accent-2: #2f7cf6;
  --zz-accent-3: #7561ff;
  --zz-radius: 8px;
  --zz-line-soft: color-mix(in srgb, currentColor 14%, transparent);
  --zz-line-strong: color-mix(in srgb, #13c8b6 36%, transparent);
  --zz-surface-soft: color-mix(in srgb, currentColor 5%, transparent);
  --zz-surface-active: color-mix(in srgb, #13c8b6 14%, transparent);
}

html,
body,
#root {
  letter-spacing: 0 !important;
}

body,
button,
input,
textarea,
select {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif !important;
  letter-spacing: 0 !important;
}

/* Brand */
img[src="/logo.png"],
img[src*="/logo.png"],
img[src*="logo.png"] {
  border-radius: 50% !important;
  object-fit: cover !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 18%, transparent) !important;
}

a[href="/"] img,
header img[src*="logo"],
nav img[src*="logo"] {
  width: 34px;
  height: 34px;
}

/* Top navigation: cleaner and flatter, without changing theme colors. */
header,
.ant-layout-header,
.semi-layout-header {
  border-bottom: 1px solid var(--zz-line-soft) !important;
  box-shadow: none !important;
  backdrop-filter: saturate(130%) blur(10px);
}

header a,
nav a,
.ant-menu-horizontal .ant-menu-item,
.semi-navigation-horizontal .semi-navigation-item {
  border-radius: var(--zz-radius) !important;
  font-weight: 700 !important;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease !important;
}

header a:hover,
nav a:hover,
.ant-menu-horizontal .ant-menu-item:hover,
.semi-navigation-horizontal .semi-navigation-item:hover {
  background: var(--zz-surface-soft) !important;
}

/* Sidebar: single selected pill, no rectangle-inside-rectangle effect. */
aside,
.ant-layout-sider,
.semi-layout-sider,
[class*="Sider"],
[class*="Sidebar"] {
  border-right: 1px solid var(--zz-line-soft) !important;
  box-shadow: none !important;
}

.ant-layout-sider::before,
.ant-layout-sider::after,
.semi-layout-sider::before,
.semi-layout-sider::after,
aside::before,
aside::after {
  box-shadow: none !important;
  filter: none !important;
}

.ant-menu,
.semi-navigation-list {
  background: transparent !important;
}

.ant-menu-item,
.ant-menu-submenu-title,
.semi-navigation-item {
  min-height: 36px !important;
  margin: 3px 10px !important;
  padding-inline: 14px !important;
  border: 1px solid transparent !important;
  border-radius: var(--zz-radius) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.ant-menu-item::after,
.ant-menu-submenu-title::after,
.semi-navigation-item::after {
  display: none !important;
}

.ant-menu-item .ant-menu-title-content,
.ant-menu-submenu-title .ant-menu-title-content,
.semi-navigation-item-text,
.semi-navigation-item-icon {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.ant-menu-item:hover,
.ant-menu-submenu-title:hover,
.semi-navigation-item:hover {
  background: var(--zz-surface-soft) !important;
  border-color: var(--zz-line-soft) !important;
}

.ant-menu-item-selected,
.ant-menu-submenu-selected > .ant-menu-submenu-title,
.semi-navigation-item-selected {
  background: var(--zz-surface-active) !important;
  border-color: var(--zz-line-strong) !important;
  color: var(--zz-accent-2) !important;
  box-shadow: none !important;
}

/* The sidebar collapse button was picking up the old glowing primary button style. */
aside button,
.ant-layout-sider button,
.semi-layout-sider button,
[class*="collapse"],
[class*="Collapse"] {
  box-shadow: none !important;
  filter: none !important;
  text-shadow: none !important;
}

aside .ant-btn-primary,
.ant-layout-sider .ant-btn-primary,
.semi-layout-sider .semi-button-primary,
aside .semi-button-primary {
  background: transparent !important;
  border-color: var(--zz-line-soft) !important;
  color: inherit !important;
}

/* Controls: modest polish only, no theme token override. */
button,
.ant-btn,
.semi-button,
[role="button"] {
  border-radius: var(--zz-radius) !important;
  letter-spacing: 0 !important;
  box-shadow: none;
}

.ant-btn-primary,
.semi-button-primary,
button[type="submit"] {
  border-color: transparent !important;
  background: linear-gradient(100deg, var(--zz-accent), var(--zz-accent-2) 58%, var(--zz-accent-3)) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--zz-accent-2) 22%, transparent) !important;
}

.ant-btn-primary:hover,
.semi-button-primary:hover,
button[type="submit"]:hover {
  filter: saturate(1.08) brightness(1.03);
}

input,
textarea,
.ant-input,
.ant-input-affix-wrapper,
.ant-select-selector,
.ant-picker,
.semi-input,
.semi-input-wrapper,
.semi-select-selection {
  border-radius: var(--zz-radius) !important;
  box-shadow: none !important;
}

.ant-input-affix-wrapper-focused,
.ant-select-focused .ant-select-selector,
.semi-input-wrapper-focus {
  border-color: var(--zz-accent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--zz-accent) 18%, transparent) !important;
}

/* Dropdowns and popovers should follow the current theme, but stay readable. */
.ant-select-dropdown,
.ant-dropdown,
.ant-popover-inner,
.semi-select-option-list,
.semi-dropdown,
.semi-popover-wrapper {
  border-radius: var(--zz-radius) !important;
  box-shadow: 0 14px 38px color-mix(in srgb, #000 18%, transparent) !important;
}

.ant-select-item,
.ant-dropdown-menu-item,
.semi-select-option,
.semi-dropdown-item {
  border-radius: 6px !important;
}

.ant-select-item-option-active,
.ant-dropdown-menu-item-active,
.semi-select-option-focused,
.semi-dropdown-item:hover {
  background: var(--zz-surface-soft) !important;
}

.ant-select-item-option-selected,
.semi-select-option-selected {
  background: var(--zz-surface-active) !important;
  color: inherit !important;
}

/* Cards and tables: keep New API colors, tighten only borders/radius. */
.ant-card,
.semi-card,
.ant-table-wrapper,
.semi-table-container,
.ant-modal-content,
.semi-modal-content {
  border-radius: var(--zz-radius) !important;
  border-color: var(--zz-line-soft) !important;
}

.ant-table-thead > tr > th,
.semi-table-thead > .semi-table-row > .semi-table-row-head {
  font-weight: 700 !important;
}

.ant-alert,
.semi-alert,
.semi-banner {
  border-radius: var(--zz-radius) !important;
}

.ant-tag,
.semi-tag,
.ant-badge,
.semi-badge {
  border-radius: 999px !important;
}

/* Dark-mode-only depth. This intentionally does not affect light mode. */
html[theme-mode="dark"] body,
html[data-theme="dark"] body,
body[theme-mode="dark"],
body[data-theme="dark"],
body.dark {
  background-image:
    radial-gradient(circle at 18% -10%, rgba(19,200,182,.12), transparent 24%),
    radial-gradient(circle at 82% -8%, rgba(117,97,255,.14), transparent 26%) !important;
  background-attachment: fixed !important;
}

html[theme-mode="dark"] header,
html[data-theme="dark"] header,
body[theme-mode="dark"] header,
body[data-theme="dark"] header,
body.dark header,
html[theme-mode="dark"] .ant-layout-header,
html[data-theme="dark"] .ant-layout-header,
body[theme-mode="dark"] .ant-layout-header,
body[data-theme="dark"] .ant-layout-header,
body.dark .ant-layout-header {
  background: color-mix(in srgb, #050812 82%, transparent) !important;
}

html[theme-mode="dark"] .ant-card,
html[data-theme="dark"] .ant-card,
body[theme-mode="dark"] .ant-card,
body[data-theme="dark"] .ant-card,
body.dark .ant-card,
html[theme-mode="dark"] .semi-card,
html[data-theme="dark"] .semi-card,
body[theme-mode="dark"] .semi-card,
body[data-theme="dark"] .semi-card,
body.dark .semi-card {
  box-shadow: 0 12px 36px rgba(0,0,0,.24) !important;
}

/* Mobile compactness. */
@media (max-width: 720px) {
  .ant-menu-item,
  .ant-menu-submenu-title,
  .semi-navigation-item {
    margin-inline: 6px !important;
  }
}

/* Final sidebar cleanup: nested utility backgrounds inside menu rows should not create a second rectangle. */
aside .ant-menu-item > *,
aside .ant-menu-submenu-title > *,
aside .semi-navigation-item > *,
.ant-layout-sider .ant-menu-item > *,
.ant-layout-sider .ant-menu-submenu-title > *,
.semi-layout-sider .semi-navigation-item > * {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

aside .ant-menu-item-selected > *,
aside .semi-navigation-item-selected > *,
.ant-layout-sider .ant-menu-item-selected > *,
.semi-layout-sider .semi-navigation-item-selected > * {
  color: inherit !important;
}

/* Keep the collapse area quiet in both themes. */
aside [class*="bottom"],
aside [class*="Bottom"],
.ant-layout-sider [class*="bottom"],
.semi-layout-sider [class*="bottom"] {
  box-shadow: none !important;
  filter: none !important;
}

/* Sidebar selected row should render as one complete pill. */
aside .semi-navigation-list,
aside .ant-menu,
.ant-layout-sider .ant-menu,
.semi-layout-sider .semi-navigation-list {
  overflow: visible !important;
  padding-right: 8px !important;
}

aside .semi-navigation-item,
aside .ant-menu-item,
aside .ant-menu-submenu-title,
.ant-layout-sider .ant-menu-item,
.ant-layout-sider .ant-menu-submenu-title,
.semi-layout-sider .semi-navigation-item {
  width: calc(100% - 20px) !important;
  max-width: calc(100% - 20px) !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

aside .semi-navigation-item-selected,
aside .ant-menu-item-selected,
.ant-layout-sider .ant-menu-item-selected,
.semi-layout-sider .semi-navigation-item-selected {
  background-clip: padding-box !important;
  outline: 1px solid var(--zz-line-strong) !important;
  outline-offset: -1px !important;
  border-color: transparent !important;
}

aside .semi-navigation-item-selected > *,
aside .ant-menu-item-selected > *,
.ant-layout-sider .ant-menu-item-selected > *,
.semi-layout-sider .semi-navigation-item-selected > * {
  width: auto !important;
  min-width: 0 !important;
  overflow: visible !important;
}

/* Chat submenu: show complete readable labels and keep the entries clickable. */
aside .semi-navigation-item-text,
aside .ant-menu-title-content,
.ant-layout-sider .ant-menu-title-content,
.semi-layout-sider .semi-navigation-item-text {
  min-width: 0 !important;
  max-width: none !important;
}

aside .semi-navigation-sub,
aside .semi-navigation-sub-wrap,
aside .ant-menu-sub,
.ant-layout-sider .ant-menu-sub,
.semi-layout-sider .semi-navigation-sub {
  width: 100% !important;
  max-width: 100% !important;
  overflow: visible !important;
}

aside .semi-navigation-sub .semi-navigation-item,
aside .ant-menu-sub .ant-menu-item,
.ant-layout-sider .ant-menu-sub .ant-menu-item,
.semi-layout-sider .semi-navigation-sub .semi-navigation-item {
  width: calc(100% - 20px) !important;
  max-width: calc(100% - 20px) !important;
  min-height: 34px !important;
  padding-left: 44px !important;
  padding-right: 10px !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

aside .semi-navigation-sub .semi-navigation-item-text,
aside .ant-menu-sub .ant-menu-title-content,
.ant-layout-sider .ant-menu-sub .ant-menu-title-content,
.semi-layout-sider .semi-navigation-sub .semi-navigation-item-text {
  display: block !important;
  width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Give the chat submenu action button the same full-row behavior. */
aside .semi-navigation-sub button,
aside .ant-menu-sub button,
.ant-layout-sider .ant-menu-sub button,
.semi-layout-sider .semi-navigation-sub button {
  width: calc(100% - 64px) !important;
  min-height: 34px !important;
  margin-left: 44px !important;
  justify-content: center !important;
  pointer-events: auto !important;
}

/* Recharge page shop hint. */
.zz-shop-recharge-tip {
  display: flex !important;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--zz-accent) 34%, transparent);
  border-radius: var(--zz-radius);
  color: var(--semi-color-text-0, #172033);
  background:
    linear-gradient(0deg, color-mix(in srgb, var(--zz-accent) 8%, transparent), color-mix(in srgb, var(--zz-accent) 8%, transparent)),
    var(--semi-color-bg-1, #ffffff);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--zz-accent-2) 9%, transparent);
}

.zz-shop-recharge-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  background: var(--zz-accent-2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}

.zz-shop-recharge-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.zz-shop-recharge-title {
  color: var(--semi-color-text-0, #172033);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
}

.zz-shop-recharge-desc {
  margin-top: 2px;
  color: var(--semi-color-text-2, #5f6878);
  font-size: 13px;
  line-height: 1.55;
}

.zz-shop-recharge-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  flex: 0 0 auto;
  padding: 0 13px;
  border: 1px solid color-mix(in srgb, var(--zz-accent-2) 68%, transparent);
  border-radius: var(--zz-radius);
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
  background: var(--zz-accent-2);
  box-shadow: none;
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
}

.zz-shop-recharge-link:hover,
.zz-shop-recharge-link:focus-visible {
  color: #ffffff !important;
  filter: brightness(1.06);
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--zz-accent-2) 22%, transparent);
}

html[theme-mode="dark"] .zz-shop-recharge-tip,
body[theme-mode="dark"] .zz-shop-recharge-tip,
.dark .zz-shop-recharge-tip {
  color: var(--semi-color-text-0, #f4f7fb);
  background:
    linear-gradient(0deg, color-mix(in srgb, var(--zz-accent) 12%, transparent), color-mix(in srgb, var(--zz-accent) 12%, transparent)),
    var(--semi-color-bg-1, #151923);
  border-color: color-mix(in srgb, var(--zz-accent) 42%, transparent);
}

html[theme-mode="dark"] .zz-shop-recharge-title,
body[theme-mode="dark"] .zz-shop-recharge-title,
.dark .zz-shop-recharge-title {
  color: var(--semi-color-text-0, #f4f7fb);
}

html[theme-mode="dark"] .zz-shop-recharge-desc,
body[theme-mode="dark"] .zz-shop-recharge-desc,
.dark .zz-shop-recharge-desc {
  color: var(--semi-color-text-2, #b7c0cf);
}

/* Persistent QQ community footer. */
body {
  padding-bottom: max(58px, env(safe-area-inset-bottom)) !important;
}

html.zz-qq-footer-hidden body {
  padding-bottom: env(safe-area-inset-bottom) !important;
}

.zz-qq-footer {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 2147483000;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: min(calc(100vw - 28px), 720px);
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  color: #fff !important;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  background:
    linear-gradient(100deg, #ff3d8b 0%, #ff9d2f 28%, #19d5bd 58%, #4477ff 100%);
  box-shadow:
    0 14px 34px rgba(38, 73, 135, .28),
    0 0 0 4px color-mix(in srgb, #19d5bd 16%, transparent);
  backdrop-filter: blur(14px) saturate(150%);
  cursor: default;
  user-select: text;
  animation: zzFooterPop .42s cubic-bezier(.2,.9,.2,1) both;
}

.zz-qq-footer-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.zz-qq-footer::before {
  content: "QQ";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #17324d;
  font-size: 12px;
  font-weight: 1000;
  background: rgba(255, 255, 255, .88);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.5);
}

.zz-qq-footer strong {
  color: #fff36b;
  font-weight: 1000;
  text-shadow: 0 1px 8px rgba(0,0,0,.22);
}

.zz-qq-footer-close {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, .46) !important;
  border-radius: 50% !important;
  color: #fff !important;
  background: rgba(17, 30, 52, .25) !important;
  box-shadow: none !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  user-select: none !important;
}

.zz-qq-footer-close:hover,
.zz-qq-footer-close:focus-visible {
  background: rgba(17, 30, 52, .42) !important;
  border-color: rgba(255, 255, 255, .72) !important;
  outline: none !important;
}

.zz-qq-footer-close:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .32) !important;
}

.zz-qq-footer:hover {
  filter: saturate(1.08) brightness(1.03);
  box-shadow:
    0 16px 42px rgba(38, 73, 135, .34),
    0 0 0 5px color-mix(in srgb, #ff3d8b 15%, transparent);
}

@keyframes zzFooterPop {
  from { opacity: 0; transform: translate(-50%, 10px) scale(.98); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@media (max-width: 640px) {
  body {
    padding-bottom: max(76px, env(safe-area-inset-bottom)) !important;
  }

  .zz-qq-footer {
    bottom: 10px;
    width: calc(100vw - 20px);
    min-height: 48px;
    padding: 9px 10px 9px 12px;
    font-size: 14px;
    white-space: normal;
  }

  .zz-qq-footer-text {
    flex: 1 1 auto;
  }

  .zz-shop-recharge-tip {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 12px;
  }

  .zz-shop-recharge-copy {
    flex: 1 1 calc(100% - 56px);
  }

  .zz-shop-recharge-link {
    width: 100%;
    min-height: 38px;
  }
}

.zz-affiliate-rebate-comment {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, #13c8b6 28%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, #13c8b6 8%, transparent);
  color: inherit;
  font-size: 13px;
  line-height: 1.65;
}

.zz-affiliate-rebate-setting {
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, #13c8b6 28%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, #13c8b6 7%, transparent);
}

.zz-affiliate-rebate-setting-head,
.zz-affiliate-rebate-setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zz-affiliate-rebate-setting-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.zz-affiliate-rebate-setting-head p,
.zz-affiliate-rebate-setting-note,
.zz-affiliate-rebate-setting-status {
  margin: 4px 0 0;
  color: color-mix(in srgb, currentColor 66%, transparent);
  font-size: 13px;
  line-height: 1.55;
}

.zz-affiliate-rebate-setting-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #2f7cf6 12%, transparent);
  font-size: 12px;
  font-weight: 700;
}

.zz-affiliate-rebate-setting-row input {
  width: 120px;
}

.zz-affiliate-rebate-setting-row button {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: linear-gradient(100deg, var(--zz-accent), var(--zz-accent-2));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.zz-affiliate-rebate-setting-status.is-ok {
  color: #0f9f6e;
}

.zz-affiliate-rebate-setting-status.is-error {
  color: #d64545;
}
