/* 青码 CyanCode — brand layer, loaded AFTER each page's own stylesheet.
   The SAME file lives in aicos_server/static/brand/ (local console) and aicos_saas/static/brand/ (SaaS pages);
   tests/test_brand.py fails if the two copies drift. No CDN, no web fonts: everything renders offline.
   Brand colours (docs/brand-cyancode/README.txt): blue #1A5CFF → #2A9FE0 → cyan #2EC9C6, navy #0B1220, top-left → bottom-right. */

:root {
  --cc-blue: #1a5cff; --cc-mid: #2a9fe0; --cc-cyan: #2ec9c6; --cc-navy: #0b1220;
  --cc-grad: linear-gradient(135deg, #1a5cff 0%, #2a9fe0 55%, #2ec9c6 100%);
  --cc-grad-soft: linear-gradient(135deg, rgba(26, 92, 255, .10), rgba(46, 201, 198, .10));
  --bg: #f4f7fc; --surface: #ffffff; --surface-2: #f7f9fd; --ink: #0b1220; --ink-2: #334155; --muted: #64748b;
  --line: rgba(15, 23, 42, .08); --line-strong: rgba(15, 23, 42, .15);
  --accent: #1a5cff; --accent-2: #2ec9c6; --accent-soft: rgba(26, 92, 255, .08); --accent-ring: rgba(26, 92, 255, .26);
  --ok: #0f9488; --ok-soft: rgba(46, 201, 198, .14); --info: #1a5cff; --info-soft: rgba(26, 92, 255, .07);
  --warn: #b45309; --warn-soft: rgba(245, 158, 11, .10); --bad: #dc2626; --bad-soft: rgba(220, 38, 38, .08);
  --sh-1: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 1px rgba(15, 23, 42, .03);
  --sh-2: 0 2px 8px rgba(15, 23, 42, .05), 0 16px 40px -18px rgba(26, 92, 255, .22);
  --sh-3: 0 6px 16px rgba(15, 23, 42, .06), 0 28px 60px -22px rgba(26, 92, 255, .38);
  --cc-glass: rgba(255, 255, 255, .72); --cc-grid: rgba(26, 92, 255, .06);
  --cc-aurora-1: rgba(26, 92, 255, .13); --cc-aurora-2: rgba(46, 201, 198, .15);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans CN",
          "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #060a13; --surface: #0e1524; --surface-2: #121b2e; --ink: #e9eefb; --ink-2: #c3cde0; --muted: #8592ad;
    --line: rgba(148, 163, 184, .12); --line-strong: rgba(148, 163, 184, .22);
    --accent: #4d82ff; --accent-2: #3fe0d0; --accent-soft: rgba(77, 130, 255, .14); --accent-ring: rgba(77, 130, 255, .36);
    --ok: #3fe0d0; --ok-soft: rgba(63, 224, 208, .12); --info: #6f9bff; --info-soft: rgba(77, 130, 255, .12);
    --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .10); --bad: #ff6b6b; --bad-soft: rgba(255, 107, 107, .10);
    --sh-1: 0 1px 2px rgba(0, 0, 0, .5); --sh-2: 0 18px 40px -18px rgba(0, 0, 0, .8), 0 0 0 .5px rgba(77, 130, 255, .10);
    --sh-3: 0 28px 60px -22px rgba(0, 0, 0, .9), 0 0 40px -12px rgba(77, 130, 255, .35);
    --cc-glass: rgba(10, 15, 27, .66); --cc-grid: rgba(111, 155, 255, .07);
    --cc-aurora-1: rgba(26, 92, 255, .22); --cc-aurora-2: rgba(46, 201, 198, .16);
  }
}

/* ---------------------------------------------------------------- backdrop: aurora + fading tech grid */
body { background: var(--bg); }
.cc-backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.cc-backdrop::before { content: ""; position: absolute; inset: -20% -10% auto; height: 90vh;
  background: radial-gradient(48% 60% at 18% 20%, var(--cc-aurora-1), transparent 70%),
              radial-gradient(42% 55% at 86% 8%, var(--cc-aurora-2), transparent 70%);
  filter: blur(8px); animation: cc-drift 18s ease-in-out infinite alternate; }
.cc-backdrop::after { content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--cc-grid) 1px, transparent 1px), linear-gradient(90deg, var(--cc-grid) 1px, transparent 1px);
  background-size: 48px 48px; -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 20%, transparent 75%); }
@keyframes cc-drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(3%, 2%, 0) scale(1.06); } }

/* ---------------------------------------------------------------- brand mark (logo + wordmark) */
.brand { gap: 10px; }
.brand-logo { width: 28px; height: 28px; flex: none; display: block; border-radius: 8px;
  box-shadow: 0 6px 16px -6px rgba(26, 92, 255, .55); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.06); }
.brand-name { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; color: var(--ink); }
.brand-name em { font-style: normal; font-weight: 600; font-size: 13px; color: var(--muted); letter-spacing: .08em; }
.brand-name small { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 2px; }
.brand-mark { display: none; }

/* ---------------------------------------------------------------- top bar: frosted glass + sliding tab indicator */
.topbar { background: var(--cc-glass); border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; opacity: .55;
  background: linear-gradient(90deg, transparent, var(--cc-blue) 30%, var(--cc-cyan) 70%, transparent); }
.cc-tabs { position: relative; isolation: isolate; }
.cc-tabs .cc-ind { position: absolute; z-index: -1; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 999px; opacity: 0;
  background: var(--surface); box-shadow: var(--sh-1), 0 0 0 .5px var(--line), 0 6px 18px -8px rgba(26, 92, 255, .45);
  transition: transform .42s cubic-bezier(.2, .8, .2, 1), width .42s cubic-bezier(.2, .8, .2, 1), opacity .2s; }
.cc-tabs.cc-ready .cc-ind { opacity: 1; }
.cc-tabs.cc-ready > button.active { background: transparent !important; box-shadow: none !important; }
.cc-tabs .cc-sep { flex: none; width: 1px; margin: 6px 4px; background: var(--line-strong); }

/* ---------------------------------------------------------------- cards that float: lift, gradient hairline, pointer spotlight */
.panel, .card, .stat, .tile { position: relative; }
.panel::before, .card::before, .stat::before, .tile::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0;
  background: var(--cc-grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  transition: opacity .35s cubic-bezier(.2, .8, .2, 1); }
.panel::after, .card::after, .stat::after, .tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(26, 92, 255, .07), transparent 45%);
  transition: opacity .35s cubic-bezier(.2, .8, .2, 1); }
.panel:hover::before, .stat:hover::before, .tile:hover::before { opacity: .45; }
.card:hover::before { opacity: .7; }
.panel:hover::after, .card:hover::after, .stat:hover::after, .tile:hover::after { opacity: 1; }
.card:hover, .stat:hover, .tile:hover { transform: translateY(-4px); box-shadow: var(--sh-3); }
.panel:hover { box-shadow: var(--sh-2); }
.panel > *, .card > *, .stat > *, .tile > * { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- headings */
.hero h2, .page-head h2 { background: linear-gradient(180deg, var(--ink) 30%, color-mix(in srgb, var(--ink) 72%, var(--accent))); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px; border-radius: 999px; margin-bottom: 14px;
  background: var(--cc-grad-soft); box-shadow: inset 0 0 0 1px rgba(26, 92, 255, .14); color: var(--accent);
  -webkit-text-fill-color: currentColor; font-size: 12.5px; letter-spacing: .03em; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cc-grad);
  box-shadow: 0 0 0 3px rgba(46, 201, 198, .18); animation: cc-pulse 2.4s ease-in-out infinite; }
@keyframes cc-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(46, 201, 198, .18); } 50% { box-shadow: 0 0 0 6px rgba(46, 201, 198, 0); } }
.step { color: #fff; background: var(--cc-grad); box-shadow: 0 6px 14px -6px rgba(26, 92, 255, .6); }

/* ---------------------------------------------------------------- inputs */
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
::selection { background: rgba(46, 201, 198, .30); }

/* ---------------------------------------------------------------- spinner → the blinking logo */
.spinner { width: 46px; height: 46px; border: 0; border-radius: 13px; animation: cc-float 2.4s ease-in-out infinite;
  background: url("cyancode-blink.svg") center / contain no-repeat; box-shadow: 0 12px 26px -10px rgba(26, 92, 255, .55); }
@keyframes cc-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ---------------------------------------------------------------- toast: dark glass */
.toast, #toast { background: rgba(11, 18, 32, .86); color: #f4f7fc; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px -16px rgba(11, 18, 32, .55), inset 0 0 0 1px rgba(255, 255, 255, .08); }
#toast.bad { background: var(--bad); }

/* ---------------------------------------------------------------- footer */
.cc-foot { max-width: 1160px; margin: 0 auto; padding: 28px 24px 40px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); }
.cc-foot img { height: 28px; width: auto; opacity: .92; }
.cc-foot .cc-dark { display: none; }
@media (prefers-color-scheme: dark) { .cc-foot .cc-light { display: none; } .cc-foot .cc-dark { display: inline; } }
.cc-foot span { flex: 1; min-width: 200px; }

/* ---------------------------------------------------------------- page entrance */
.cc-reveal { animation: cc-in .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes cc-in { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

@media (prefers-reduced-motion: reduce) {
  .cc-backdrop::before, .eyebrow::before, .spinner, .cc-reveal { animation: none !important; }
  .cc-tabs .cc-ind { transition: none; }
}
@media (hover: none) {
  .card:hover, .stat:hover, .tile:hover { transform: none; }
}
