/* Logo 尺寸 180x60 */
img[alt="Logo"] {
  width: 180px !important;
  height: auto !important;
  max-height: 60px !important;
  object-fit: contain !important;
}

/* 隐藏 logo 旁边的文字 */
span.max-w-\[12rem\].truncate,
span.truncate.font-semibold,
div:has(img[alt="Logo"]) + span,
a:has(img[alt="Logo"]) span:not(:has(img)) {
  display: none !important;
}

/* 导航栏去线 */
header nav {
  box-shadow: none !important;
  border-bottom: none !important;
}

header div[class*="ring"],
header div[class*="shadow"] {
  --tw-ring-shadow: 0 0 #0000 !important;
  --tw-shadow: 0 0 #0000 !important;
  box-shadow: none !important;
}


/* Hide text nodes that can sit next to the logo image in the React logo link. */
a:has(img[alt="Logo"]),
button:has(img[alt="Logo"]),
div:has(> img[alt="Logo"]):has(+ span) {
  font-size: 0 !important;
}

a:has(img[alt="Logo"]) img,
button:has(img[alt="Logo"]) img,
div:has(> img[alt="Logo"]) img {
  font-size: initial !important;
}


/* Robust logo text suppression: match by image source, not translated alt text. */
a:has(img[src*="/logo.png"]),
button:has(img[src*="/logo.png"]),
[data-sidebar="menu-button"]:has(img[src*="/logo.png"]),
[data-slot="sidebar-menu-button"]:has(img[src*="/logo.png"]) {
  font-size: 0 !important;
  line-height: 0 !important;
}

a:has(img[src*="/logo.png"]) > :not(:has(img)):not(img),
button:has(img[src*="/logo.png"]) > :not(:has(img)):not(img),
[data-sidebar="menu-button"]:has(img[src*="/logo.png"]) > :not(:has(img)):not(img),
[data-slot="sidebar-menu-button"]:has(img[src*="/logo.png"]) > :not(:has(img)):not(img) {
  display: none !important;
}

a:has(img[src*="/logo.png"]) img,
button:has(img[src*="/logo.png"]) img,
[data-sidebar="menu-button"]:has(img[src*="/logo.png"]) img,
[data-slot="sidebar-menu-button"]:has(img[src*="/logo.png"]) img {
  font-size: initial !important;
  line-height: normal !important;
  display: block !important;
}


/* Restore TokModel wordmark size after hiding the adjacent text label. */
a:has(img[src*="/logo.png"]) > div:has(> img[src*="/logo.png"]),
button:has(img[src*="/logo.png"]) > div:has(> img[src*="/logo.png"]),
[data-sidebar="menu-button"]:has(img[src*="/logo.png"]) > div:has(> img[src*="/logo.png"]),
[data-slot="sidebar-menu-button"]:has(img[src*="/logo.png"]) > div:has(> img[src*="/logo.png"]) {
  width: clamp(120px, 13vw, 156px) !important;
  height: clamp(40px, 4.4vw, 48px) !important;
  aspect-ratio: 3 / 1 !important;
  flex-shrink: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

a:has(img[src*="/logo.png"]) img,
button:has(img[src*="/logo.png"]) img,
[data-sidebar="menu-button"]:has(img[src*="/logo.png"]) img,
[data-slot="sidebar-menu-button"]:has(img[src*="/logo.png"]) img {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain !important;
  border-radius: 0 !important;
}

@media (max-width: 640px) {
  a:has(img[src*="/logo.png"]) > div:has(> img[src*="/logo.png"]),
  button:has(img[src*="/logo.png"]) > div:has(> img[src*="/logo.png"]),
  [data-sidebar="menu-button"]:has(img[src*="/logo.png"]) > div:has(> img[src*="/logo.png"]),
  [data-slot="sidebar-menu-button"]:has(img[src*="/logo.png"]) > div:has(> img[src*="/logo.png"]) {
    width: 120px !important;
    height: 40px !important;
  }
}


/* TokModel typography polish: system fonts only, no extra network cost. */
:root {
  --tm-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --tm-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--tm-sans) !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html:lang(zh),
html:lang(zh-CN),
html:lang(zh-Hans) {
  line-height: 1.62;
}

code,
pre,
kbd,
samp,
.font-mono,
[class*="font-mono"] {
  font-family: var(--tm-mono) !important;
}

:is(table, th, td, input[type="number"], [class*="font-mono"], [data-slot*="table"], .tabular-nums) {
  font-variant-numeric: tabular-nums;
}

:is(h1, h2, h3, h4, h5, h6) {
  letter-spacing: 0 !important;
}


/* Simplify legal pages to avoid overlapping interactive nav layers. */
body.tm-legal-page header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

body.tm-legal-page header nav {
  justify-content: space-between !important;
}

body.tm-legal-page header nav > div {
  display: none !important;
}

body.tm-legal-page .tm-legal-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid hsl(var(--border, 214 32% 91%));
  border-radius: 999px;
  padding: 0 12px;
  color: hsl(var(--muted-foreground, 215 16% 47%));
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
