:root {
  --xuefu-bg: #0d1611;
  --xuefu-surface: #192820;
  --xuefu-surface-strong: #26392e;
  --xuefu-ink: #efe8dc;
  --xuefu-muted: #bdb4a5;
  --xuefu-line: #3d5e4c;
  --xuefu-accent: #c7816a;
  --xuefu-jade: #9ab5a3;
  --workspace-panel-bg: #192820;
  color-scheme: dark;
}

html,
body {
  background: var(--xuefu-bg) !important;
  color: var(--xuefu-ink) !important;
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif !important;
}

body {
  background-image:
    radial-gradient(circle at 12% 0%, rgba(130, 163, 142, 0.11), transparent 30%),
    linear-gradient(145deg, #0d1611, #182820 55%, #201b17) !important;
}

.panel {
  border-color: rgba(146, 178, 156, 0.3) !important;
  border-radius: 10px !important;
  background: rgba(25, 40, 32, 0.97) !important;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2) !important;
  backdrop-filter: none !important;
}

/* The host page already provides the Naming Studio title. Keep the embedded
   workspace focused on its status and naming controls without a duplicate
   product masthead. */
header.panel {
  display: none !important;
}

/* Company naming is not part of the current internal workflow. */
button[title="公司起名"],
button[title="公司名分析"] {
  display: none !important;
}

/* The embedded page is already the dedicated workspace; remove its
   transient readiness strip so the first visible block is the useful result. */
.mx-auto.flex.max-w-\[1500px\] > div:nth-child(2) {
  display: none !important;
}

.bg-white,
.bg-white\/80,
.bg-\[\#faf8f3\],
.bg-\[\#fbf8f1\] {
  background-color: #203128 !important;
}

.bg-\[\#efefef\],
.bg-\[\#f2efe8\],
.bg-\[\#f3efe6\],
.bg-\[\#f4eedf\],
.bg-\[\#f5f1e8\],
.bg-\[\#f6f2e5\],
.bg-\[\#f7f3e8\],
.bg-\[\#f8f4eb\],
.bg-\[\#f8f6ef\],
.bg-brand-50,
.bg-brand-50\/70,
.bg-sand\/55 {
  background-color: #15221b !important;
}

.bg-gradient-to-r {
  background-image: linear-gradient(90deg, #192820, #26392e, #192820) !important;
}

.border-stone-200,
.border-stone-300,
.border-stone-400,
.border-brand-100,
.border-brand-200,
.border-brand-500 {
  border-color: rgba(146, 178, 156, 0.38) !important;
}

.text-ink,
.text-ink\/60,
.text-ink\/65,
.text-ink\/70,
.text-ink\/75,
.text-ink\/80,
.text-ink\/85,
.text-ink\/90,
.text-brand-700,
.text-brand-800,
.text-brand-900 {
  color: var(--xuefu-ink) !important;
}

.text-ink\/60,
.text-ink\/65,
.text-ink\/70,
.text-ink\/75 {
  color: var(--xuefu-muted) !important;
}

.text-brand-700,
.text-brand-800,
.text-brand-900 {
  color: var(--xuefu-accent) !important;
}

button,
input,
select,
textarea {
  border-radius: 8px !important;
}

button {
  min-height: 38px;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease !important;
}

button:hover {
  border-color: var(--xuefu-accent) !important;
  background-color: #2b4034 !important;
  color: #fff7ec !important;
}

input,
select,
textarea {
  border-color: rgba(154, 181, 163, 0.56) !important;
  background: #0e1812 !important;
  color: var(--xuefu-ink) !important;
}

input::placeholder,
textarea::placeholder {
  color: #8f978f !important;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(199, 129, 106, 0.38) !important;
  outline-offset: 2px !important;
}

.bg-brand-700 {
  background-color: #9f5b48 !important;
}

.bg-brand-100 {
  background-color: rgba(199, 129, 106, 0.11) !important;
}

.hover\:bg-white:hover,
.hover\:bg-brand-50:hover,
.hover\:bg-brand-100:hover {
  background-color: #2b4034 !important;
}

img[alt="福本堂标志"] {
  border-radius: 9px;
  border-color: rgba(199, 129, 106, 0.48) !important;
  filter: saturate(0.72) sepia(0.08);
}

/* 内嵌工作台：保留菜单与快捷入口，压缩重复的产品抬头，优先露出资料填写区。 */
header.panel > div:nth-child(2) {
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

header.panel > div:nth-child(2) .text-3xl {
  font-size: 1.5rem !important;
  line-height: 1.8rem !important;
}

header.panel > div:nth-child(2) .mt-2 {
  margin-top: 0.25rem !important;
}

header.panel > div:nth-child(2) .py-4 {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

/* 工作流先收集资料，再呈现五格与细项解释。 */
[data-naming-priority="analysis"],
[data-naming-priority="birth"] {
  border-color: rgba(199, 129, 106, 0.58) !important;
  background: #1b2922 !important;
}

[data-naming-priority="analysis"] {
  min-height: 0 !important;
  order: -2;
}

[data-naming-priority="birth"] {
  order: -1;
}

/* 未选择字义／数理条目时，不为结果区预留空白。 */
[data-naming-empty-result] {
  min-height: 0 !important;
}

[data-naming-priority="birth"]::before {
  content: "出生资料";
  display: block;
  margin-bottom: 0.5rem;
  color: var(--xuefu-ink);
  font-size: 13px;
  font-weight: 600;
}

/* 桌面保留可扫读的三列，避免原五列工作台过度拥挤。 */
.grid.items-stretch.gap-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch !important;
}

[data-naming-priority="analysis"] > .h-\[412px\] {
  height: 156px !important;
  min-height: 0 !important;
}

[data-naming-priority="birth"] > .grid {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 0.5rem !important;
}

@media (min-width: 1180px) {
  .grid.items-stretch.gap-2 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  html,
  body,
  #root {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .min-h-screen {
    padding: 8px !important;
  }

  input:not([type="radio"]):not([type="checkbox"]),
  select,
  textarea {
    min-height: 44px !important;
  }

  .grid.items-stretch.gap-2 {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.75rem !important;
  }

  [data-naming-priority="analysis"] > .h-\[412px\] {
    height: auto !important;
    max-height: 10rem;
  }

  [data-naming-priority="birth"] > .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  [data-naming-priority="birth"] > .grid > :last-child {
    grid-column: span 2;
  }

  button {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
