/* AIKey — black & gold refinement. The starfield remains interactive. */
:root, :host, .dark, [data-theme] {
  color-scheme: dark;
  --background: #10100f !important;
  --foreground: #f1f0e9 !important;
  --card: #191918 !important;
  --card-foreground: #f1f0e9 !important;
  --popover: #20201d !important;
  --popover-foreground: #f1f0e9 !important;
  --primary: #d6b95f !important;
  --primary-foreground: #17150d !important;
  --secondary: #292820 !important;
  --secondary-foreground: #eee9d8 !important;
  --muted: #252521 !important;
  --muted-foreground: #b3b1a6 !important;
  --accent: #302c1e !important;
  --accent-foreground: #f0d68a !important;
  --border: #393830 !important;
  --input: #746e5b !important;
  --ring: #e3c873 !important;
  --sidebar: #141412 !important;
  --sidebar-foreground: #e1dfd4 !important;
  --sidebar-primary: #d6b95f !important;
  --sidebar-primary-foreground: #17150d !important;
  --sidebar-accent: #312b1b !important;
  --sidebar-accent-foreground: #f0d68a !important;
  --sidebar-border: #393830 !important;
  --sidebar-ring: #e3c873 !important;
  --destructive: #f18d85 !important;
}
html, body { background: var(--background) !important; color: var(--foreground) !important; }
body { line-height: 1.6; -webkit-font-smoothing: antialiased; }
#root { position: relative; z-index: 1; }
#root > .min-h-svh { background: transparent !important; }
body::before { content: none !important; }
::selection { background: #d6b95f; color: #17150d; }
input, textarea { caret-color: #e3c873; }
:where(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--ring) !important;
  outline-offset: 3px;
}
:where(button, [role="button"]) {
  transition-property: background-color, border-color, color, box-shadow !important;
  transition-duration: 160ms !important;
  transition-timing-function: ease-out !important;
}
:where(button, [role="button"]):disabled,
:where(button, [role="button"])[aria-disabled="true"] {
  cursor: not-allowed; opacity: .5;
}
.bg-primary, .bg-primary\/90, [data-slot="button"].bg-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--primary-foreground) !important;
  font-weight: 650;
  box-shadow: none !important;
}
.bg-primary :where(span,svg), .text-primary-foreground { color: var(--primary-foreground) !important; }
.bg-primary:hover, .bg-primary\/90:hover { background: #e6cd83 !important; border-color: #e6cd83 !important; }
.bg-primary:active { background: #c5a94d !important; }
:where(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
  background: #151513 !important;
  border-color: var(--input) !important;
  color: var(--foreground) !important;
  border-radius: 9px;
}
:where(input, textarea)::placeholder { color: #b3b1a6 !important; opacity: 1; }
[aria-invalid="true"] { border-color: var(--destructive) !important; }
[data-slot="form-label"] { color: #e1dfd4; line-height: 1.4; }
:where(.text-muted-foreground, .text-foreground\/40, .text-foreground\/50, .text-foreground\/60) {
  color: var(--muted-foreground) !important;
}
:where(.bg-white,.bg-white\/95,.bg-white\/90,.bg-white\/85,.bg-white\/80) {
  background: var(--card) !important;
  border-color: var(--border) !important;
}
.bg-clip-text.text-transparent { background-image: none !important; color: var(--primary) !important; -webkit-text-fill-color: var(--primary); }
:where(h1,h2,h3) { text-wrap: balance; }
:where(.tabular-nums, [class*="statistic"], table) { font-variant-numeric: tabular-nums; }

/* Landing: keep its content, navigation and live protocol preview. */
header.pointer-events-none nav a { color: #dedbce; font-weight: 550; }
header.pointer-events-none nav a:hover { color: #f1d88e; }
header.pointer-events-none nav { min-height: 64px; }
header.pointer-events-none nav a.bg-primary { color: #17150d !important; }
section.relative.z-10:first-of-type h1 { letter-spacing: -.025em; line-height: 1.22; }
section.relative.z-10:first-of-type p { line-height: 1.85; max-width: 58ch; color: #c0bdb0; }
section.relative.z-10:first-of-type a[role="button"] { min-height: 46px; border-radius: 10px; }
section.relative.z-10:first-of-type .overflow-hidden.rounded-2xl.border {
  background: #171713 !important; border-color: #55503c !important;
  border-radius: 16px !important; box-shadow: none !important;
}
[class*="landing-animate"] { opacity: 1 !important; transform: none !important; }
section [aria-hidden][style*="radial-gradient"] { background: none !important; }

/* App: solid reading surfaces keep the stars behind the work. */
[data-slot="sidebar-wrapper"] { background: transparent !important; }
[data-slot="sidebar-inner"] { background: rgba(20,20,18,.96) !important; border-right: 1px solid var(--sidebar-border); }
[data-slot="sidebar-inset"] { background: rgba(16,16,15,.91) !important; box-shadow: none !important; border-radius: 16px !important; }
[data-slot="sidebar-group-label"] { color: #aaa797 !important; font-size: 12px; font-weight: 550; letter-spacing: .01em; }
[data-slot="sidebar-menu-button"] { min-height: 38px; border-radius: 8px; margin-block: 1px; }
[data-slot="sidebar-menu-button"][data-active="true"] { background: #312b1b !important; color: #f0d68a !important; font-weight: 650; }
[data-slot="sidebar-menu-button"]:hover { background: #25251e; }
[data-slot="sidebar-inset"] :where(div,section).rounded-2xl.border,
[data-slot="card"] {
  background: var(--card) !important;
  border-color: var(--border) !important;
  border-radius: 14px !important;
  box-shadow: none !important;
}
[data-slot="card"] { --tw-ring-color: var(--border); }
[data-slot="card-header"] { border-color: var(--border); }
[data-slot="card-content"] { line-height: 1.65; }
[data-slot="sidebar-inset"] :where(.shadow-xs,.shadow-sm) { box-shadow: none; }
[data-slot="sidebar-inset"] :where(input:not([type="checkbox"]):not([type="radio"]),textarea) { min-height: 40px; }
[data-slot="sidebar-inset"] [data-slot="button"]:where(:not(.size-8):not(.size-9):not(.size-7):not(.flex-col)) { min-height: 36px; }
[data-slot="sidebar-inset"] button[aria-label="支付宝"],
[data-slot="sidebar-inset"] button[aria-label="微信"] { min-height: 56px; border-radius: 10px; }
[data-slot="sidebar-inset"] button[aria-label="支付宝"]:hover,
[data-slot="sidebar-inset"] button[aria-label="微信"]:hover { border-color: var(--primary); background: #302b1d; }
[data-slot="sidebar-inset"] button.flex-col.text-left { border-radius: 10px; min-height: 80px; padding: 14px 16px; }
[data-slot="sidebar-inset"] button.flex-col.text-left.border-primary,
[data-slot="sidebar-inset"] button.flex-col.text-left.border-foreground { border-color: var(--primary) !important; background: #302b1d !important; }
[data-slot="sidebar-inset"] button.flex-col.text-left:hover { border-color: #9b884d; }
[data-slot="sidebar-inset"] :where(th,td) { padding-block: 13px; border-color: var(--border); }
[data-slot="sidebar-inset"] thead { background: #25251f; color: #d4d0bf; }
[data-slot="sidebar-inset"] tbody tr:hover { background: rgba(214,185,95,.06); }
[data-slot="sidebar-inset"] h2 { font-size: 20px; letter-spacing: -.015em; }
[data-slot="sidebar-inset"] h3 { line-height: 1.5; }
[data-slot="dialog-content"], [data-slot="sheet-content"], [data-slot="dropdown-menu-content"], [data-slot="popover-content"] {
  background: #20201d !important; color: var(--foreground); border-color: #575448;
}
[data-slot="dialog-content"], [data-slot="sheet-content"] { box-shadow: 0 16px 48px rgba(0,0,0,.4); }

/* Authentication: a readable form, with the original interactive sky around it. */
#root .h-svh:has(form) { background: transparent !important; height: auto; min-height: 100svh; }
#root .h-svh:has(form) > .container { position: relative; z-index: 1; padding-block: 100px 40px; }
#root .h-svh:has(form) > .container > div {
  max-width: 460px; padding: 40px; border: 1px solid #57503a;
  border-radius: 16px; background: rgba(25,25,22,.97);
}
#root .h-svh:has(form) h2 { font-size: 29px; line-height: 1.35; letter-spacing: -.02em; text-align: left; }
#root .h-svh:has(form) form { gap: 22px; }
#root .h-svh:has(form) input { min-height: 48px; padding-inline: 14px; font-size: 15px; }
#root .h-svh:has(form) button[type="submit"] { min-height: 48px; margin-top: 8px; border-radius: 9px; }
#root .h-svh:has(form) button[aria-label="Toggle password visibility"] { min-height: 32px; width: 32px; }
#root .h-svh:has(form) a[href="/sign-up"],
#root .h-svh:has(form) a[href="/sign-in"] { color: var(--primary); text-underline-offset: 4px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #5c5744; border-radius: 8px; border: 2px solid #161613; }
::-webkit-scrollbar-thumb:hover { background: #8a7a4a; }
@media (min-width: 1024px) {
  [data-slot="sidebar-inset"] #content { padding-inline: 24px; }
}
@media (max-width: 640px) {
  :where(button,[role="button"]) { touch-action: manipulation; }
  #root .h-svh:has(form) > .container { padding-inline: 20px; }
  #root .h-svh:has(form) > .container > div { padding: 28px 24px; }
  #root .h-svh:has(form) input { font-size: 16px; }
  [data-slot="sidebar-inset"] { border-radius: 0 !important; }
  [data-slot="sidebar-menu-button"] { min-height: 44px; }
  [data-slot="sidebar-inset"] h2 { font-size: 19px; }
  [data-slot="sidebar-inset"] [data-slot="button"]:where(:not(.size-8):not(.size-9):not(.size-7):not(.flex-col)) { min-height: 42px; }
  section.relative.z-10:first-of-type { padding-inline: 24px; padding-top: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
