/*
 * 快步云体育品牌 UI 系统 v1.3
 * 只对显式 data-brand / data-brand-scope / kby-brand-* 生效。
 * 不重置业务页面结构，不依赖图片 Logo，不使用紫色或粉色。
 */

html[data-brand],
[data-brand-scope] {
  --kby-night: #020a1d;
  --kby-navy: #06132f;
  --kby-teal: #084868;
  --kby-sky: #78b8e8;
  --kby-gold: #e8a838;
  --kby-paper: #f3f5f8;
  --kby-surface: #ffffff;
  --kby-ink: #101b30;
  --kby-muted: #5f6e86;
  --kby-line: #d8e0ea;
  --kby-accent: var(--kby-teal);
  --kby-accent-strong: var(--kby-navy);
  --kby-accent-soft: rgba(8, 72, 104, 0.10);
  --kby-highlight: var(--kby-gold);
  --kby-on-accent: #ffffff;
  --kby-focus: var(--kby-sky);
  --kby-radius-sm: 3px;
  --kby-radius-md: 8px;
  --kby-shadow: 0 12px 30px rgba(2, 10, 29, 0.08);
  --kby-font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --kby-font-display: "Barlow Condensed", "Arial Narrow", "Noto Sans SC", "PingFang SC", sans-serif;
}

html[data-brand="flying-cup"],
[data-brand-scope="flying-cup"] {
  --kby-accent: #285888;
  --kby-accent-strong: #173d66;
  --kby-accent-soft: rgba(40, 88, 136, 0.11);
  --kby-highlight: #e8b848;
  --kby-focus: #285888;
}

html[data-brand="fgsl"],
[data-brand-scope="fgsl"] {
  --kby-accent: #206810;
  --kby-accent-strong: #174c0c;
  --kby-accent-soft: rgba(32, 104, 16, 0.10);
  --kby-highlight: #a0d038;
  --kby-focus: #206810;
}

html[data-brand] {
  color-scheme: light;
  font-family: var(--kby-font-sans);
  background: var(--kby-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html[data-brand] body {
  font-family: var(--kby-font-sans);
  font-variant-numeric: tabular-nums;
}

html[data-brand] :is(h1, h2, h3, .kby-brand-title) {
  text-wrap: balance;
}

html[data-brand] :is(p, li, .kby-brand-copy) {
  text-wrap: pretty;
}

html[data-brand] :is(button, input, select, textarea, [role="button"]) {
  font: inherit;
}

html[data-brand] :is(button, input, select, textarea, [role="button"], .kby-brand-action) {
  min-height: 44px !important;
}

/* inline text links ignore min-height; block/flex navigation links receive a 44px hit area. */
html[data-brand] a[href] {
  min-height: 44px;
}

html[data-brand] :is(button, a, input, select, textarea, [role="button"]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--kby-focus) 68%, white);
  outline-offset: 2px;
}

html[data-brand] :is(button, a, [role="button"]):active:not(:disabled) {
  scale: 0.96;
}

html[data-brand] :is(button, a, [role="button"]) {
  transition:
    color 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    scale 120ms ease;
}

.kby-brand-eyebrow {
  margin: 0;
  color: var(--kby-accent);
  font-family: var(--kby-font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: uppercase;
}

.kby-brand-lockup {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: inherit;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kby-brand-lockup small {
  color: var(--kby-muted);
  font-family: var(--kby-font-display);
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kby-brand-rule {
  border-block-start: 3px solid var(--kby-accent);
}

.kby-brand-panel {
  background: var(--kby-surface);
  border: 1px solid var(--kby-line);
  border-radius: var(--kby-radius-md);
  box-shadow: var(--kby-shadow);
}

.kby-brand-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--kby-accent);
  border-radius: var(--kby-radius-sm);
  background: var(--kby-accent);
  color: var(--kby-on-accent);
  font-weight: 750;
  text-decoration: none;
}

.kby-brand-action:hover {
  background: var(--kby-accent-strong);
  border-color: var(--kby-accent-strong);
}

/* 统一工作台条：高对比、单行、移动端不挤压业务内容。 */
html[data-brand] .kby-suite-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 44px !important;
  height: auto !important;
  padding: 0 18px !important;
  background: var(--kby-night) !important;
  border-bottom: 3px solid var(--kby-accent) !important;
  color: #ffffff !important;
  font-family: var(--kby-font-sans) !important;
}

html[data-brand] .kby-suite-bar :is(.kby-suite-home, .kby-auth-nav a) {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 44px !important;
  color: #dbe5f3 !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
}

html[data-brand] .kby-suite-bar :is(.kby-suite-home, .kby-auth-nav a):hover {
  color: #ffffff !important;
}

html[data-brand] .kby-suite-bar .kby-suite-mod {
  color: var(--kby-highlight) !important;
  font-family: var(--kby-font-display) !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  letter-spacing: 0.10em !important;
  line-height: 1.2 !important;
  text-transform: uppercase !important;
}

/* 周报、问卷等独立页可直接复用，且保证中绿色上不用白字。 */
html[data-brand="fgsl"] :is(button.primary, button.approve, .submit, .opt.on, .bool button.on, .nps button.on) {
  background: #206810 !important;
  border-color: #206810 !important;
  color: #ffffff !important;
}

html[data-brand="fgsl"] :is(a, .ctx a) {
  color: #206810;
}

html[data-brand="fgsl"] :is(input, select, textarea, button):focus-visible {
  outline-color: #206810;
}

@media (max-width: 540px) {
  html[data-brand] .kby-suite-bar {
    padding-inline: 12px !important;
  }

  html[data-brand] .kby-suite-bar .kby-suite-mod {
    max-width: 48vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-brand] *,
  html[data-brand] *::before,
  html[data-brand] *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  html[data-brand] .kby-suite-bar {
    display: none !important;
  }
}
