/* TokenHub — design per tokenhub网站设计方案.md */
:root {
  /* Light, minimal style to match openrouter */
  --th-bg: #ffffff;
  --th-surface: #f8fafc;
  --th-surface-2: #ffffff;
  --th-border: rgba(15, 23, 42, 0.12);
  --th-primary: #2563eb;
  --th-primary-hover: #1d4ed8;
  --th-accent: #38bdf8;
  --th-text: #0f172a;
  --th-muted: #475569;
  --th-success: #22c55e;
  --th-radius: 12px;
  --th-radius-sm: 8px;
  /* Use standard fonts to avoid weird stretched bold look */
  --th-font-display: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --th-font-body: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --th-max: 1120px;
  --th-header-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.th-site {
  margin: 0;
  min-height: 100vh;
  font-family: var(--th-font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--th-text);
  background: var(--th-bg);
  -webkit-font-smoothing: antialiased;
}

/* Typography: prevent descenders (g/y) being visually clipped */
h1, h2, h3 {
  line-height: 1.2;
  letter-spacing: -0.01em;
}

a {
  color: var(--th-accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.th-wrap {
  max-width: var(--th-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.th-console-shell {
  display: block;
}

.th-console-sidebar {
  position: fixed;
  top: var(--th-header-h);
  left: 0;
  bottom: 0;
  width: 248px;
  border-right: 1px solid var(--th-border);
  background: var(--th-surface-2);
  padding: 1rem 0.75rem;
  overflow-y: auto;
  z-index: 20;
}

.th-console-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.th-console-nav a,
.th-console-nav button {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: var(--th-radius-sm);
  padding: 0.55rem 0.65rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--th-muted);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}

.th-console-nav a:hover,
.th-console-nav button:hover {
  color: var(--th-text);
  background: rgba(37, 99, 235, 0.08);
}

.th-console-nav a.is-active {
  color: var(--th-primary);
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.22);
}

.th-console-nav button.is-active {
  color: var(--th-primary);
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.22);
}

.th-console-nav-group-title {
  margin: 0.85rem 0.65rem 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--th-muted);
}

/* Platform admin: grouped sidebar (L1 catalog + L2 items) */
.th-console-nav--grouped {
  gap: 0;
}

.th-console-nav--grouped .th-console-nav-standalone {
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--th-border);
}

.th-console-nav--grouped .th-console-nav-standalone button {
  font-size: 0.9375rem;
  font-weight: 600;
}

.th-console-nav--grouped .th-console-nav-group {
  margin-bottom: 0.65rem;
}

.th-console-nav--grouped .th-console-nav-group--footer {
  margin-top: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--th-border);
}

.th-console-nav--grouped .th-console-nav-group-title {
  margin: 0 0 0.4rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--th-text);
  line-height: 1.35;
}

.th-console-nav--grouped .th-console-nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-left: 0.35rem;
  padding-left: 0.85rem;
  border-left: 2px solid rgba(37, 99, 235, 0.2);
}

.th-console-nav--grouped .th-console-nav-group-items button,
.th-console-nav--grouped .th-console-nav-group-items a {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.45rem 0.55rem;
  color: var(--th-muted);
}

.th-console-nav--grouped .th-console-nav-group-items button:hover,
.th-console-nav--grouped .th-console-nav-group-items a:hover {
  color: var(--th-text);
}

.th-console-nav--grouped .th-console-nav-group-items button.is-active {
  color: var(--th-primary);
  font-weight: 600;
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.28);
}

.pa-panel {
  display: none;
}

.pa-panel.is-active {
  display: block;
}

.pa-embed-frame {
  width: 100%;
  min-height: calc(100vh - var(--th-header-h) - 10rem);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-sm);
  background: var(--th-surface);
}

#pa-embed-host.pa-panel.is-active {
  margin-top: 0;
}

#pa-embed-host .pa-embed-frame {
  min-height: calc(100vh - var(--th-header-h) - 11rem);
  border: none;
  border-radius: 0;
}

.pa-obs-frame {
  min-height: calc(100vh - var(--th-header-h) - 8rem);
}

/* iframe embed: platform-admin child pages — no site header / page hero */
html.th-embed-doc,
body.th-embed-page {
  background: var(--th-bg, #f8fafc);
}

body.th-embed-page #th-header-mount,
body.th-embed-page #th-footer-mount {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.th-embed-page .th-page-hero,
body.th-embed-page .th-page-hero-plain {
  display: none !important;
}

body.th-embed-page .th-models-filters > p:first-child,
body.th-embed-page .th-embed-chrome {
  display: none !important;
}

body.th-embed-page main {
  min-height: 0;
}

body.th-embed-page .th-section {
  padding-top: 0.75rem !important;
  padding-bottom: 1.25rem;
}

body.th-embed-page .th-models-main-head h1 {
  font-size: 1.125rem;
  margin: 0 0 0.5rem;
}

body.th-embed-page .th-embed-frame,
body.th-embed-page .pa-embed-frame {
  min-height: calc(100vh - 12rem);
}

.th-console-main {
  min-width: 0;
}

body.th-console-page main {
  padding-left: 248px;
}

body.th-console-page #pa-shell-root,
body.th-console-page #pa-shell-root *:not(button):not(input):not(select):not(textarea) {
  -webkit-user-select: text;
  user-select: text;
}

body.th-console-page #th-footer-mount {
  display: none;
}

.th-console-wrap {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 1.5rem 2rem;
}

body.th-console-page .th-page-hero {
  max-width: none;
  margin: 0;
  padding: 1.25rem 1.5rem 0.75rem;
}

body.th-console-page .th-page-hero h1,
body.th-console-page .th-page-hero p {
  margin-left: 0;
}

.th-console-hero-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

/* Header */
.th-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--th-header-h);
  border-bottom: 1px solid var(--th-border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
}

/* 全宽顶栏：品牌与操作按钮相对视口左右对齐（仅保留少量边距避免贴边裁切） */
.th-header-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 clamp(0.75rem, 2vw, 1.25rem);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.th-header-brand {
  flex-shrink: 0;
}

.th-hidden {
  display: none !important;
}

.th-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--th-font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--th-text);
  text-decoration: none;
}
.th-logo:hover {
  text-decoration: none;
  color: var(--th-accent);
}

.th-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 0;
}

.th-logo-mark svg {
  display: block;
}

.th-logo-mark img {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: block;
  object-fit: cover;
}

.th-nav {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  flex-wrap: wrap;
  min-width: 0;
}

.th-nav a {
  color: var(--th-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
}

@media (min-width: 960px) {
  .th-nav {
    display: flex;
  }
  .th-nav a {
    padding: 0.35rem 0.45rem;
    font-size: 0.8125rem;
  }
}
.th-nav a:hover,
.th-nav a.is-active {
  color: var(--th-text);
  background: rgba(37, 99, 235, 0.08);
  text-decoration: none;
}

.th-header-actions {
  flex-shrink: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.th-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  line-height: 1;
}

.th-lang-option {
  border: none;
  background: transparent;
  color: var(--th-muted);
  font: inherit;
  font-weight: 500;
  padding: 0;
  cursor: pointer;
}

.th-lang-option:hover {
  color: var(--th-text);
}

.th-lang-option.is-active {
  color: var(--th-primary);
  font-weight: 700;
}

.th-lang-sep {
  color: var(--th-border-strong, #94a3b8);
}

.th-lang-mobile {
  margin: 0.25rem 0;
}

.th-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--th-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.th-btn:hover {
  text-decoration: none;
}

.th-btn-ghost {
  background: transparent;
  color: var(--th-muted);
  border-color: var(--th-border);
}
.th-btn-ghost:hover {
  color: var(--th-text);
  border-color: var(--th-muted);
}

.th-btn-primary {
  background: var(--th-primary);
  color: #fff;
}
.th-btn-primary:hover {
  background: var(--th-primary-hover);
  color: #fff;
}

.th-btn-outline {
  background: transparent;
  color: var(--th-text);
  border-color: var(--th-border);
}
.th-btn-outline:hover {
  border-color: var(--th-primary);
  color: var(--th-accent);
}

.th-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-sm);
  background: var(--th-surface);
  color: var(--th-text);
  cursor: pointer;
}

@media (min-width: 960px) {
  .th-menu-toggle {
    display: none;
  }
}

.th-mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1.25rem 1rem;
  border-bottom: 1px solid var(--th-border);
  background: var(--th-bg);
}
.th-mobile-nav.is-open {
  display: flex;
}
.th-mobile-nav a {
  color: var(--th-muted);
  padding: 0.5rem 0;
  font-weight: 500;
}
.th-mobile-nav a.is-active {
  color: var(--th-accent);
}

body.th-rtl {
  direction: rtl;
}

body.th-rtl .th-header-inner,
body.th-rtl .th-header-actions {
  flex-direction: row-reverse;
}

/* Hero */
.th-hero {
  position: relative;
  padding: 4rem 0 3.5rem;
  overflow: hidden;
  background: #ffffff;
}
.th-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(124, 58, 237, 0.08), transparent);
  pointer-events: none;
}

.th-hero-inner {
  position: relative;
  max-width: var(--th-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.th-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--th-accent);
  margin-bottom: 1rem;
}

.th-hero h1 {
  font-family: var(--th-font-display);
  font-size: clamp(2rem, 4.5vw, 2.85rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  max-width: 18ch;
}

.th-lead {
  font-size: 1.125rem;
  color: var(--th-muted);
  max-width: 52ch;
  margin: 0 0 1.75rem;
}

.th-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.th-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  padding-top: 0;
  border-top: 0;
  margin-top: 2rem;
}

.th-meta-item strong {
  display: block;
  font-family: var(--th-font-display);
  font-size: 1.85rem;
  color: var(--th-text);
  line-height: 1.1;
}
.th-meta-item span {
  font-size: 0.95rem;
  color: var(--th-muted);
  line-height: 1.25;
}

.th-provider-wall {
  width: 100%;
  margin-top: 2.3rem;
}

.th-provider-wall-title {
  margin: 0 0 1.1rem;
  text-align: center;
  font-size: 1.02rem;
  font-weight: 500;
  color: #64748b;
}

.th-provider-grid {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  width: min(980px, 100%);
  margin: 0 auto;
}

.th-provider-row {
  display: flex;
  justify-content: center;
  gap: 1rem 1.15rem;
  flex-wrap: nowrap;
}

.th-provider-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  min-width: 96px;
  border-radius: 14px;
  border: 0;
  background: transparent;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.th-provider-item:hover {
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 8px 16px rgba(37, 99, 235, 0.18));
}

.th-provider-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  opacity: 1;
  transition: transform 0.16s ease;
  animation: th-provider-float 3.8s ease-in-out infinite;
}

.th-provider-item-more {
  border: 1px dashed rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.06);
}

.th-provider-more {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1d4ed8;
  letter-spacing: 0.01em;
}

@keyframes th-provider-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.th-provider-item:nth-child(2n) .th-provider-logo { animation-delay: .3s; }
.th-provider-item:nth-child(3n) .th-provider-logo { animation-delay: .6s; }
.th-provider-item:nth-child(5n) .th-provider-logo { animation-delay: .9s; }

/* Sections */
.th-section {
  padding: 3.5rem 0;
}
.th-section-alt {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.04), transparent);
  border-top: 1px solid var(--th-border);
  border-bottom: 1px solid var(--th-border);
}

.th-section-head {
  max-width: var(--th-max);
  margin: 0 auto 2rem;
  padding: 0 1.25rem;
}
.th-section-head h2 {
  font-family: var(--th-font-display);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
.th-section-head p {
  margin: 0;
  color: var(--th-muted);
  /* Let subtitles use more horizontal space; wrap only when truly needed */
  max-width: 86ch;
  white-space: normal;
  overflow-wrap: break-word;
}

/* Why TokenHub 2x2 illustrations */
.th-why-card .th-why-img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  display: block;
  margin: 0 0 1rem 0;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.04);
  border: 1px solid var(--th-border);
}

.th-why-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

/* Cards grid */
.th-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

/* Horizontal scroll row */
.th-scroll-row {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.25rem 0 1rem;
  /* Auto-scroll animation should not be affected by snap. */
  scroll-snap-type: none;
  scrollbar-width: none;
}
.th-scroll-row::-webkit-scrollbar {
  height: 0;
  width: 0;
  display: none;
}
.th-review-card {
  flex: 0 0 320px;
  scroll-snap-align: start;
}
.th-announcement-card {
  flex: 0 0 min(420px, 90vw);
  scroll-snap-align: start;
}
@media (min-width: 640px) {
  .th-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 900px) {
  .th-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .th-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .th-provider-row {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .th-provider-logo {
    animation: none;
  }
}

.th-card {
  background: var(--th-surface-2);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  padding: 1.35rem;
  transition: border-color 0.15s, transform 0.15s;
}
.th-card:hover {
  border-color: rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

.th-card h3 {
  font-family: var(--th-font-display);
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}
.th-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--th-muted);
}

.th-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--th-primary);
  display: grid;
  place-items: center;
  margin-bottom: 0.85rem;
  font-size: 1.1rem;
}

/* Model cards */
.th-model-card .th-tagline {
  font-size: 0.8rem;
  color: var(--th-muted);
  margin-bottom: 0.35rem;
}
.th-model-card .th-id {
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--th-accent);
}
.th-price {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--th-muted);
}
.th-price strong {
  color: var(--th-text);
}

/* Steps */
.th-steps {
  display: grid;
  gap: 1rem;
}
@media (min-width: 768px) {
  .th-steps {
    grid-template-columns: repeat(4, 1fr);
  }
}
.th-step {
  position: relative;
  padding: 1.25rem;
  background: var(--th-surface);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
}
.th-step h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.th-step p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--th-muted);
}

.th-link-inline {
  color: var(--th-primary);
  font-weight: 600;
  text-decoration: none;
}

.th-link-inline:hover {
  color: var(--th-primary-hover);
  text-decoration: underline;
}

/* Docs page links: unify to deep-blue style */
.th-site[data-page="docs"] main a {
  color: var(--th-primary);
  font-weight: 600;
  text-decoration: none;
}

.th-site[data-page="docs"] main a:hover {
  color: var(--th-primary-hover);
  text-decoration: underline;
}

/* Page hero small */
.th-page-hero {
  padding: 2.5rem 0 2rem;
}
.th-page-hero h1 {
  font-family: var(--th-font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin: 0 0 0.5rem;
  line-height: 1.15;
  font-weight: 800;
}
.th-page-hero p {
  margin: 0;
  color: var(--th-muted);
  max-width: none;
}
.th-page-hero-plain {
  padding-bottom: 0.5rem;
}

.th-models-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.25rem;
}

/* 模型目录页：容器左对齐，给右侧列表释放更多可用宽度 */
.th-wrap.th-models-layout {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  align-items: start;
}

.th-models-filters {
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  background: var(--th-surface);
  padding: 0.9rem 0.85rem;
  max-height: calc(100vh - var(--th-header-h) - 2rem);
  overflow-x: hidden;
  overflow-y: auto;
  position: sticky;
  top: calc(var(--th-header-h) + 0.8rem);
  align-self: start;
}

.th-model-filter-group + .th-model-filter-group {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--th-border);
}

.th-model-filter-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  margin: 0 0 0.5rem;
  padding: 0.15rem 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.th-model-filter-group-toggle:hover .th-model-filter-group-title {
  color: var(--th-text);
}

.th-model-filter-group-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--th-text);
}

.th-model-filter-group-chevron {
  flex-shrink: 0;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -0.15rem;
  opacity: 0.55;
  transition: transform 0.15s ease;
}

.th-model-filter-group.is-collapsed .th-model-filter-group-chevron {
  transform: rotate(-45deg);
  margin-top: 0.1rem;
}

.th-model-filter-group.is-collapsed .th-model-filter-list {
  display: none;
}

.th-model-filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.th-model-filter-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  color: var(--th-muted);
  cursor: pointer;
}

.th-filter-item-content {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.th-filter-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.th-filter-item-text {
  line-height: 1.1;
}

.th-model-filter-item:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--th-text);
}

.th-model-filter-item.is-active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--th-primary);
  border-color: rgba(37, 99, 235, 0.22);
  font-weight: 600;
}

.th-model-name-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.th-model-name-cell .th-filter-icon {
  width: 18px;
  height: 18px;
}

.th-provider-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.th-provider-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--th-text);
}

.th-provider-pill .th-filter-icon {
  width: 14px;
  height: 14px;
}

.th-provider-pill-text {
  line-height: 1.15;
}

/** Azure（模型目录）：药丸语义色 */
.th-provider-pill.th-provider-brand-azure {
  background: rgba(0, 120, 212, 0.11);
  border: 1px solid rgba(0, 120, 212, 0.35);
}

.th-table td .th-provider-list {
  max-width: 420px;
}

.th-models-toolbar {
  margin-bottom: 0.75rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.th-models-main-head h1 {
  margin: 0.55rem 0 0.75rem;
  font-family: var(--th-font-display);
  font-size: clamp(1.7rem, 2.8vw, 2.2rem);
  line-height: 1.15;
}

.th-model-search-input {
  width: 100%;
  max-width: 620px;
  flex: 1 1 420px;
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 999px;
  font-size: 1rem;
  border: 1px solid var(--th-border);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.th-model-toolbar-select {
  min-width: 170px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--th-border);
  background: #fff;
  color: var(--th-text);
  padding: 0 0.95rem;
  font-size: 0.92rem;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.th-model-toolbar-select:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.th-model-search-input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.th-enterprise-card .th-enterprise-subtitle {
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 0.7rem;
}

.th-enterprise-list {
  padding-left: 1.1rem;
  margin: 0.25rem 0 0;
}

.th-enterprise-list li {
  margin-bottom: 0.38rem;
}

/* 企业页首个方案章节压缩上下间距 */
.th-enterprise-quote-compact {
  padding: 1.75rem 0;
}


@media (max-width: 960px) {
  body.th-console-page main {
    padding-left: 0;
  }
  .th-console-wrap {
    padding: 0 1.25rem 1.5rem;
  }
  body.th-console-page .th-page-hero {
    padding: 1rem 1.25rem 0.6rem;
  }
  .th-console-hero-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .th-console-sidebar {
    position: static;
    width: auto;
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius);
    margin-bottom: 1rem;
  }
  .th-console-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .th-console-nav a,
  .th-console-nav button {
    width: auto;
    white-space: nowrap;
  }
  .th-console-nav--grouped {
    flex-direction: column;
    align-items: stretch;
  }
  .th-console-nav--grouped .th-console-nav-group-items button,
  .th-console-nav--grouped .th-console-nav-group-items a {
    width: 100%;
    white-space: normal;
  }
  .th-models-layout {
    grid-template-columns: 1fr;
  }
  .th-models-filters {
    position: static;
  }
  .th-model-search-input {
    max-width: none;
  }
  .th-model-toolbar-select {
    width: 100%;
    min-width: 0;
  }
}

/* Tables */
.th-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
}
.th-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.th-table th,
.th-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--th-border);
}
.th-table th {
  background: var(--th-surface);
  color: var(--th-muted);
  font-weight: 600;
}
.th-table tr:last-child td {
  border-bottom: none;
}

/* Forms */
.th-form {
  max-width: 480px;
}
.th-field {
  margin-bottom: 1rem;
}
.th-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--th-text, inherit);
  cursor: pointer;
  user-select: none;
  margin-bottom: 0;
}
.th-checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}
.th-auth-remember {
  margin-top: -0.25rem;
}
.th-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--th-muted);
  margin-bottom: 0.35rem;
}
.th-field input,
.th-field select,
.th-field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: var(--th-radius-sm);
  border: 1px solid var(--th-border);
  background: var(--th-surface);
  color: var(--th-text);
  font-family: inherit;
  font-size: 0.95rem;
}
.th-field textarea {
  min-height: 120px;
  resize: vertical;
}

.th-contact-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 980px) {
  .th-contact-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: start;
  }
}

.th-contact-heading {
  margin: 0 0 0.35rem;
  font-family: var(--th-font-display);
}

.th-contact-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.th-contact-link {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-sm);
  background: var(--th-surface-2);
  padding: 0.65rem 0.75rem;
  color: var(--th-text);
  text-decoration: none;
}

.th-contact-link:hover {
  text-decoration: none;
  border-color: rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.06);
}

.th-contact-link-static {
  cursor: default;
}

.th-contact-link-static:hover {
  border-color: var(--th-border);
  background: var(--th-surface-2);
}

.th-contact-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--th-primary);
  flex-shrink: 0;
}

.th-contact-icon svg {
  width: 19px;
  height: 19px;
}

.th-contact-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.th-contact-meta strong {
  line-height: 1.2;
}

.th-contact-meta small {
  color: var(--th-muted);
  line-height: 1.3;
  word-break: break-all;
}

.th-contact-form {
  max-width: none;
}

.th-contact-form .th-btn.is-loading {
  pointer-events: none;
  opacity: 0.9;
}

.th-contact-form .th-btn.is-loading::after {
  content: "";
  width: 0.85em;
  height: 0.85em;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-top-color: #ffffff;
  animation: th-spin 0.8s linear infinite;
}

.th-contact-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.th-contact-status {
  margin: 0.85rem 0 0;
  font-size: 0.875rem;
}

.th-contact-status.is-success {
  color: #166534;
  background: rgba(22, 101, 52, 0.1);
  border: 1px solid rgba(22, 101, 52, 0.25);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-weight: 600;
}

.th-contact-status.is-error {
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
  border: 1px solid rgba(185, 28, 28, 0.2);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-weight: 600;
}

@keyframes th-spin {
  to {
    transform: rotate(360deg);
  }
}

.th-pricing-plan-card {
  height: 100%;
}

.th-pricing-spec-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.th-pricing-spec-list li {
  margin: 0;
  padding: 0.62rem 0;
  border-top: 1px solid var(--th-border);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.th-pricing-spec-list li:first-child {
  border-top: 0;
  padding-top: 0.2rem;
}

.th-pricing-spec-list li span {
  font-size: 0.78rem;
  color: var(--th-muted);
}

.th-pricing-spec-list li strong {
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--th-text);
  line-height: 1.35;
}

/* Tabs */
.th-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--th-border);
  padding-bottom: 0.5rem;
}
.th-tabs a,
.th-tabs button {
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--th-muted);
  text-decoration: none;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.th-tabs a:hover,
.th-tabs a.is-active,
.th-tabs button:hover,
.th-tabs button.is-active {
  color: var(--th-text);
  background: rgba(37, 99, 235, 0.15);
}

.th-billing-panel[hidden] {
  display: none !important;
}

.th-doc-protocol-panel[hidden] {
  display: none !important;
}

.th-doc-protocol-meta {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.12);
  font-size: 0.9rem;
  line-height: 1.5;
}

.th-doc-protocol-meta code {
  font-size: 0.85em;
}

.th-badge--promo-available {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}
.th-badge--promo-locked {
  background: rgba(234, 179, 8, 0.14);
  color: #a16207;
}
.th-badge--promo-revoked,
.th-badge--promo-expired {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}
.th-badge--promo-depleted {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
}

/* Code */
.th-code {
  background: #0b1220;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-sm);
  padding: 1rem;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #e2e8f0;
}

/* Footer */
.th-footer {
  margin-top: 1.5rem;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--th-border);
  background: #f8fafc;
}

/* 首页：最后一节与页脚之间不再堆叠 margin/padding，避免大块空白 */
body[data-page="home"] .th-home-announcements {
  padding-bottom: 1.5rem;
}
body[data-page="home"] #th-footer-mount .th-footer {
  margin-top: 0;
}

.th-footer-grid {
  max-width: var(--th-max);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .th-footer-grid {
    grid-template-columns: 2fr repeat(3, 1fr);
  }
}

.th-footer-brand p {
  color: var(--th-muted);
  font-size: 0.9rem;
  max-width: 36ch;
  margin: 0.75rem 0 0;
}

.th-footer-col h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--th-muted);
  margin: 0 0 0.75rem;
}
.th-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.th-footer-col li {
  margin-bottom: 0.45rem;
}
.th-footer-col a {
  color: var(--th-muted);
  font-size: 0.875rem;
  text-decoration: none;
}
.th-footer-col a:hover {
  color: var(--th-accent);
}

.th-footer-bottom {
  max-width: var(--th-max);
  margin: 2rem auto 0;
  padding: 1.5rem 1.25rem 0;
  border-top: 1px solid var(--th-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--th-muted);
}

.th-footer-icp {
  max-width: var(--th-max);
  margin: 0.75rem auto 0;
  padding: 0 1.25rem 1.25rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--th-muted);
}

.th-footer-icp a {
  color: var(--th-muted);
  text-decoration: none;
}

.th-footer-icp a:hover {
  color: var(--th-text);
  text-decoration: underline;
}

html[data-th-domestic-site="1"] .th-lang,
html[data-th-domestic-site="1"] .th-lang-mobile {
  display: none !important;
}

/* Filters bar */
.th-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
}
.th-toolbar select {
  padding: 0.45rem 0.65rem;
  border-radius: var(--th-radius-sm);
  border: 1px solid var(--th-border);
  background: var(--th-surface);
  color: var(--th-text);
  font-family: inherit;
}

/* Chat mock */
.th-chat-layout {
  display: grid;
  gap: 1rem;
}
@media (min-width: 900px) {
  .th-chat-layout {
    grid-template-columns: 260px 1fr;
    min-height: 420px;
  }
}
.th-chat-sidebar {
  background: var(--th-surface);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  padding: 1rem;
}
.th-chat-main {
  background: var(--th-surface);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  display: flex;
  flex-direction: column;
  min-height: 360px;
}
.th-chat-placeholder {
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--th-muted);
  font-size: 0.9rem;
  padding: 2rem;
  text-align: center;
}

/* Dashboard */
.th-stat-row {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 2rem;
}
.th-stat {
  background: var(--th-surface);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  padding: 1rem;
}
.th-stat span {
  font-size: 0.75rem;
  color: var(--th-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.th-stat strong {
  display: block;
  font-size: 1.35rem;
  margin-top: 0.25rem;
  font-family: var(--th-font-display);
}

.th-stat-quick-action {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.th-btn-text {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.th-billing-tier-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.th-billing-tier-btn {
  position: relative;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-sm);
  background: #fff;
  color: var(--th-text);
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 0.65rem;
  min-height: 2.75rem;
  cursor: pointer;
  text-align: left;
}

.th-billing-tier-btn--promo {
  padding-right: 2.5rem;
}

.th-billing-tier-main {
  display: block;
  line-height: 1.2;
}

.th-billing-tier-bonus-badge {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  background: rgba(234, 88, 12, 0.14);
  color: #c2410c;
  border: 1px solid rgba(234, 88, 12, 0.28);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  pointer-events: none;
}

.th-billing-tier-btn.is-active .th-billing-tier-bonus-badge {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.35);
}

.th-billing-tier-btn.is-active {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.1);
  color: var(--th-primary);
}

.th-dashboard-metrics {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.th-stat.th-stat-wide {
  grid-column: 1 / -1;
}

.th-stat-value-break {
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
  font-size: 1.05rem;
}

.th-dashboard-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 720px) {
  .th-dashboard-metrics {
    grid-template-columns: 1fr;
  }
}

a.th-platform-admin-card {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
a.th-platform-admin-card:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  text-decoration: none;
}

.th-admin-group {
  margin-bottom: 1.25rem;
}

.th-admin-group h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.th-admin-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.th-card-subtitle {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
}

.th-admin-hint {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
}

.th-obs-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.th-obs-frame-wrap {
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  overflow: hidden;
  background: #fff;
}

.th-obs-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 250px);
  min-height: 760px;
  border: 0;
  background: #fff;
}

.th-obs-full {
  padding: 0 1rem 1.25rem;
}

.th-obs-full-inner {
  max-width: 1600px;
  margin: 0 auto;
}

/* 可观测 / 运维：从 Grafana 跳转后高亮目标行 */
tr.th-ops-focus {
  outline: 2px solid var(--th-primary);
  outline-offset: -2px;
  background: rgba(37, 99, 235, 0.08);
}

/* Platform admin — 运营活动 */
.th-ops-verify-bar {
  margin: 0.75rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: var(--th-radius-sm);
  border: 1px solid rgba(37, 99, 235, 0.2);
  background: rgba(37, 99, 235, 0.05);
}

.th-ops-verify-bar__hint {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--th-muted);
}

.th-ops-verify-bar .th-ops-verify-error {
  font-size: 0.8125rem;
  color: var(--th-danger, #c0392b);
  flex: 1 1 100%;
}

.th-ops-verify-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.th-ops-verify-inline .th-ops-verify-code {
  width: 7.5rem;
  max-width: 7.5rem;
  min-width: 0;
}

.th-ops-verify-inline .th-ops-verify-msg {
  font-size: 0.8125rem;
  color: var(--th-muted);
  flex: 1 1 100%;
}

.th-ops-verify-inline--compact {
  gap: 0.4rem;
}

.th-ops-verify-inline--compact .th-ops-verify-msg {
  flex: 0 1 auto;
}

.th-ops-form-actions .th-btn-primary:disabled,
.th-ops-form-actions .th-btn:disabled,
.th-toolbar .th-btn:disabled,
.th-table .th-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.th-ops-callout {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--th-radius-sm);
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: rgba(37, 99, 235, 0.06);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--th-text);
}

.th-ops-callout strong {
  font-weight: 600;
}

.th-ops-callout code {
  font-size: 0.8125rem;
}

.th-ops-layout {
  display: grid;
  gap: 1.25rem;
}

.th-ops-layout--stack {
  grid-template-columns: 1fr;
}

@media (min-width: 960px) {
  .th-ops-layout--split {
    grid-template-columns: minmax(280px, 360px) 1fr;
    align-items: start;
  }
}

.th-ops-card {
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.th-ops-card__head {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--th-border);
  background: #fafbfc;
}

.th-ops-card__head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--th-font-display, inherit);
}

.th-ops-card__sub {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--th-muted);
  line-height: 1.45;
}

.th-ops-card__body {
  padding: 1.15rem 1.2rem 1.25rem;
}

.th-ops-form-grid {
  display: grid;
  gap: 0.85rem 1rem;
}

@media (min-width: 640px) {
  .th-ops-form-grid--2 {
    grid-template-columns: 1fr 1fr;
  }
}

.th-ops-form-grid .th-field-span-2 {
  grid-column: 1 / -1;
}

.th-ops-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--th-border);
}

.th-ops-table-card .th-table-wrap {
  border: none;
  border-radius: 0;
}

.th-ops-table-card .th-table thead th {
  background: #f8fafc;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--th-muted);
  font-weight: 600;
}

.th-ops-pack-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.th-ops-pack-card {
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  padding: 1rem 1.05rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.th-ops-pack-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.th-ops-pack-card.is-selected {
  border-color: var(--th-primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.th-ops-pack-card__key {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--th-muted);
}

.th-ops-pack-card__title {
  margin: 0.25rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.th-ops-pack-card__meta {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: var(--th-muted);
  line-height: 1.4;
}

.th-ops-pack-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.th-ops-segment {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.th-ops-segment label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--th-border);
  border-radius: 999px;
  font-size: 0.8125rem;
  cursor: pointer;
  background: #fff;
}

.th-ops-segment label:has(input:checked) {
  border-color: var(--th-primary);
  background: rgba(37, 99, 235, 0.08);
  color: var(--th-primary);
  font-weight: 600;
}

.th-ops-segment input {
  margin: 0;
}

.th-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.th-badge--active {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.th-badge--draft {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

.th-badge--info {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
}

.th-ops-results {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--th-radius-sm);
  background: #f8fafc;
  border: 1px solid var(--th-border);
  font-size: 0.8125rem;
  white-space: pre-wrap;
  max-height: 240px;
  overflow: auto;
}

/* Tom Select：与 TokenHub 表单视觉对齐（主样式见 tom-select.default.min.css） */
/* 下拉挂在控件 wrapper 上，勿用 body，否则滚动/布局下易与输入框错位 */
.th-tom-field {
  max-width: 900px;
  position: relative;
}
.th-tom-field .ts-wrapper {
  font-family: inherit;
  position: relative;
}
.th-tom-field .ts-wrapper.dropdown-active {
  z-index: 60;
}
.th-tom-field .ts-wrapper.multi .ts-control {
  border-radius: var(--th-radius-sm);
  border-color: var(--th-border);
  padding: 0.35rem 0.55rem;
  min-height: 2.65rem;
  background: #fff;
}
.th-tom-field .ts-wrapper.multi.focus .ts-control {
  border-color: var(--th-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.th-tom-field .ts-dropdown {
  border-radius: var(--th-radius-sm);
  border-color: var(--th-border);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  z-index: 61;
  /* 长文案（含「当前绑定」）可读：避免 Tom Select 默认 [data-selectable]{overflow:hidden} 在部分布局下显得像被裁掉 */
  min-width: min(100%, 900px);
  max-width: min(100vw - 1.5rem, 900px);
}
.th-tom-field .ts-dropdown [data-selectable].option {
  overflow: visible;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
}
.th-tom-toolbar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.th-tom-toolbar .th-link-mini {
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--th-primary);
  cursor: pointer;
  text-decoration: none;
}
.th-tom-toolbar .th-link-mini:hover {
  text-decoration: underline;
}
.th-tom-toolbar .th-tom-toolbar-sep {
  color: var(--th-border);
  user-select: none;
}

/* Utilities */
.th-mt-0 {
  margin-top: 0;
}
.th-mb-1 {
  margin-bottom: 0.5rem;
}
.th-muted {
  color: var(--th-muted);
}
.th-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--th-success);
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--th-primary);
  outline-offset: 2px;
}

/* Model discount pricing */
.th-discount-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(234, 88, 12, 0.12);
  color: #c2410c;
  vertical-align: middle;
  margin-right: 0.35rem;
}
.th-catalog-price-cell {
  max-width: 200px;
  white-space: normal;
  vertical-align: top;
}

.th-catalog-prices {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.th-catalog-prices--single {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.th-catalog-price-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  line-height: 1.45;
}

.th-catalog-price-label {
  color: var(--th-muted);
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.th-detail-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 0;
}

.th-detail-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.th-detail-title-icon .th-filter-icon {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
}

/* 价格概览：无外层容器底色，卡片直接铺在页面白底上 */
.th-detail-price-summary {
  margin: 0 0 1.25rem;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.th-detail-price-summary-inner--cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.th-detail-price-summary-discount {
  line-height: 1.4;
}

.th-detail-price-cards {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.65rem;
}

.th-detail-price-card {
  flex: 1 1 7.5rem;
  min-width: 6.5rem;
  max-width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--th-radius, 8px);
  background: var(--th-bg, #ffffff);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: none;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}

.th-detail-price-card-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--th-muted, #64748b);
  white-space: nowrap;
}

.th-detail-price-card-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--th-text, #0f172a);
  line-height: 1.35;
}

.th-detail-price-card-value .th-price-now {
  font-size: inherit;
}

@media (max-width: 640px) {
  .th-detail-price-cards {
    flex-direction: column;
  }

  .th-detail-price-card {
    flex: 1 1 auto;
    width: 100%;
  }
}

.th-price-now {
  font-weight: 600;
  color: var(--th-text, #0f172a);
}
.th-price-was {
  margin-left: 0.35rem;
  font-size: 0.875em;
  color: var(--th-muted);
}
.th-model-discount-banner {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
}

/* Referrals page */
.th-referral-section {
  padding-top: 0;
}

.th-referral-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.th-referral-alert {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: var(--th-radius-sm);
  background: rgba(192, 57, 43, 0.08);
  color: #b91c1c;
  font-size: 0.9rem;
}

.th-referral-banner {
  padding: 1rem 1.15rem;
  border-radius: var(--th-radius);
  border: 1px solid rgba(230, 126, 34, 0.45);
  background: linear-gradient(135deg, rgba(255, 237, 213, 0.65), rgba(255, 255, 255, 0.9));
}

.th-referral-banner p {
  margin: 0.4rem 0 0;
  color: var(--th-muted);
  font-size: 0.9rem;
}

.th-referral-top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}

@media (max-width: 900px) {
  .th-referral-top-grid {
    grid-template-columns: 1fr;
  }
}

.th-referral-panel {
  background: var(--th-surface-2);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
  padding: 1.25rem 1.35rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.th-referral-panel__head {
  margin-bottom: 1rem;
}

.th-referral-panel__head--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.th-referral-panel__head h2,
.th-referral-panel__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.th-referral-panel__desc {
  margin: -0.35rem 0 1rem;
  font-size: 0.875rem;
  color: var(--th-muted);
}

.th-referral-copyline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--th-radius-sm);
  border: 1px solid var(--th-border);
  background: var(--th-surface);
}

.th-referral-copyline__label {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--th-muted);
  min-width: 2.5rem;
}

.th-referral-copyline__value {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 0.875rem;
  color: var(--th-text);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.15rem 0;
}

.th-referral-copyline__value--code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.th-referral-copyline__value:hover {
  color: var(--th-primary);
}

.th-referral-copyline__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--th-primary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.th-referral-copyline__icon:hover {
  background: rgba(37, 99, 235, 0.16);
}

.th-referral-stat-row {
  margin: 0 0 1.25rem;
}

.th-referral-stat-row .th-stat {
  background: var(--th-surface-2);
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius);
}

.th-referral-bound-view {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.th-referral-bound-view[hidden] {
  display: none !important;
}

.th-auth-ref-banner {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--th-text);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--th-radius-sm);
}

.th-auth-ref-banner[hidden] {
  display: none !important;
}

.th-referral-bound-email {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--th-radius-sm);
  background: var(--th-surface-2);
  border: 1px solid var(--th-border);
}

.th-referral-bound-email__label {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--th-muted);
}

.th-referral-bound-email__value {
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  word-break: break-all;
}

.th-referral-bind-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.th-referral-bind-input {
  flex: 1;
  min-width: 8rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-sm);
  font: inherit;
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
}

.th-referral-attribution {
  margin: 0.85rem 0 0;
  font-size: 0.875rem;
  color: var(--th-success, #15803d);
}

.th-referral-panel--how {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), var(--th-surface-2));
}

.th-referral-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
}

@media (min-width: 768px) {
  .th-referral-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

.th-referral-steps li {
  position: relative;
  margin: 0;
  padding: 0.75rem 0.85rem 0.75rem 2.35rem;
  border-radius: var(--th-radius-sm);
  border: 1px solid var(--th-border);
  background: var(--th-surface-2);
  font-size: 0.875rem;
  color: var(--th-muted);
  counter-increment: referral-step;
}

.th-referral-steps {
  counter-reset: referral-step;
}

.th-referral-steps li::before {
  content: counter(referral-step);
  position: absolute;
  left: 0.75rem;
  top: 0.72rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--th-primary);
  font-size: 0.75rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.th-referral-list-count {
  font-size: 0.8125rem;
  color: var(--th-muted);
  font-weight: 500;
}

.th-referral-empty {
  padding: 2rem 1rem;
  text-align: center;
  border: 1px dashed var(--th-border);
  border-radius: var(--th-radius-sm);
  background: var(--th-surface);
}

.th-referral-empty p {
  margin: 0;
  color: var(--th-muted);
  font-size: 0.9rem;
}

.th-referral-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--th-border);
  border-radius: var(--th-radius-sm);
}

.th-referral-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.th-referral-table th {
  text-align: left;
  padding: 0.65rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--th-muted);
  background: var(--th-surface);
  border-bottom: 1px solid var(--th-border);
}

.th-referral-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--th-border);
  vertical-align: top;
}

.th-referral-table tr:last-child td {
  border-bottom: none;
}

.th-referral-table__user {
  font-weight: 600;
  white-space: nowrap;
}

.th-referral-avatar {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.45rem;
  border-radius: 999px;
  background: var(--th-primary);
  vertical-align: middle;
  opacity: 0.55;
}

.th-referral-table__detail {
  color: var(--th-muted);
  line-height: 1.45;
  max-width: 28rem;
}

.th-referral-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.th-referral-badge--released {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.th-referral-badge--pending {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.th-referral-badge--invalid {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
}

.th-referral-badge--progress {
  background: rgba(37, 99, 235, 0.1);
  color: var(--th-primary);
}

.th-referral-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 0.875rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
}
