
:root{
  --vh: 1vh;
  --bg: #05070b;
  --txt: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.70);
  --line: rgba(255,255,255,.10);
  --glass: rgba(10, 12, 18, .55);
  --glass-2: rgba(15, 22, 35, .54);
  --radius: 18px;
  --shadow: 0 18px 70px rgba(0,0,0,.55);
  --topbar-h: 64px;
}

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

html, body{
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

html{ overflow-x: hidden; }
body{ min-height: 100svh; overflow-x: hidden; }

img, svg, video, canvas{ max-width: 100%; height: auto; }

a{ color: inherit; }

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

.t1-bg{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 1;

  overflow: hidden;
  clip-path: inset(0);
  contain: paint;
  background:
    radial-gradient(1100px 760px at 18% 40%, rgba(90,140,255,0.22), transparent 62%),
    radial-gradient(980px 720px at 82% 46%, rgba(0,255,210,0.14), transparent 66%),
    radial-gradient(900px 720px at 50% 86%, rgba(255,255,255,0.06), transparent 70%),
    radial-gradient(560px 460px at 55% 55%, rgba(120,180,255,0.10), transparent 72%),
    linear-gradient(180deg, rgba(8,10,18,0.86), rgba(4,6,12,0.96));
  filter: saturate(1.25);
  animation: t1-bg-drift 18s ease-in-out infinite;
}

.t1-bg::before{
  content: "";
  position: absolute;
  inset: -18%;
  pointer-events: none;
  background:
    radial-gradient(900px 620px at 24% 32%, rgba(70,120,255,0.18), transparent 62%),
    radial-gradient(860px 620px at 78% 34%, rgba(0,255,210,0.12), transparent 66%),
    radial-gradient(1000px 780px at 50% 72%, rgba(255,255,255,0.045), transparent 72%);
  filter: blur(38px);
  opacity: .95;
  animation: t1-bg-float 10s ease-in-out infinite;
}

@keyframes t1-bg-drift{
  0%   { transform: translate3d(-1%, 0%, 0) scale(1.02); }
  50%  { transform: translate3d( 1%, -1%, 0) scale(1.05); }
  100% { transform: translate3d(-1%, 0%, 0) scale(1.02); }
}
@keyframes t1-bg-float{
  0%   { transform: translate3d(0%, 0%, 0); }
  50%  { transform: translate3d(1.2%, -0.8%, 0); }
  100% { transform: translate3d(0%, 0%, 0); }
}

#particles{
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  clip-path: inset(0);
  contain: paint;
}

#particles canvas{
  width: 100% !important;
  height: 100% !important;
  display: block;
}

#particles[data-disabled="true"]{
  display: none !important;
}

html.t1-fit, body.t1-fit{
  overflow: hidden;
  height: calc(var(--vh) * 100);
  max-height: calc(var(--vh) * 100);
  overscroll-behavior: none;
}

.t1-topbar{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  z-index: 60;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(8,11,18,.82), rgba(8,11,18,.56));
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.t1-topbar__inner{
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
}

.t1-topbar__title{
  justify-self: center;
  font-weight: 800;
  letter-spacing: .16em;
  font-size: 14px;
  opacity: .92;
}

.t1-topbar__btn{
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.t1-topbar__btn > span:last-child{
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t1-topbar__btn--top{ justify-self: end; }

.t1-topbar__btn:hover{
  transform: translateY(-1px);
  border-color: rgba(120,170,255,.35);
  background: rgba(120,170,255,.10);
}

.t1-topbar__progress{
  height: 2px;
  background: rgba(255,255,255,.06);
}

.t1-topbar__progress > span{
  display: block;
  height: 100%;
  width: 0%;
  background: rgba(120,170,255,.65);
  box-shadow: 0 0 10px rgba(120,170,255,.35);
  transition: width .06s linear;
}

.t1-fabHome{
  position: fixed;
  left: 18px;
  bottom: calc(env(safe-area-inset-bottom) + 18px);
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(10,12,18,.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.t1-fabHome:hover{
  transform: translateY(-1px);
  border-color: rgba(120,170,255,.35);
  background: rgba(120,170,255,.10);
}

.t1-fabHome__icon{
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(120,170,255,.12);
  border: 1px solid rgba(120,170,255,.20);
}

.t1-fabHome__text{
  font-weight: 700;
  letter-spacing: .06em;
}

@media (max-width: 760px){
  .t1-fabHome{ left: 12px; bottom: calc(env(safe-area-inset-bottom) + 12px); }
  .t1-fabHome__text{ display: none; }
  .t1-fabHome{ padding: 0 12px; }
}

.t1-empty{
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(15, 22, 35, .52);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.72);
}

.t1-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  font-size: 12px;
  color: rgba(255,255,255,.78);
}

.t1-pill > strong{ color: rgba(255,255,255,.90); font-weight: 800; }

.t1-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.88);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.t1-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(120,170,255,.35);
  background: rgba(120,170,255,.10);
}

.t1-btn--primary{
  border-color: rgba(120,170,255,.30);
  background: rgba(120,170,255,.14);
}

.t1-btn svg{ width: 18px; height: 18px; }

.t1-reveal{ opacity: 0; transform: translateY(10px); transition: opacity .28s ease, transform .28s ease; }
.t1-reveal.is-in{ opacity: 1; transform: translateY(0); }

@media (max-width: 420px){
  .t1-topbar__btn > span:last-child{ display: none; }
  .t1-topbar__btn{ gap: 0; padding: 0 12px; }
}


/* Stage 5: interaction, focus and mobile comfort improvements */
:where(a, button, [role="button"], summary):focus-visible{
  outline: 2px solid rgba(120,170,255,.88);
  outline-offset: 3px;
}

html.t1-modal-lock,
body.t1-modal-lock,
html.t1-lb-lock,
body.t1-lb-lock{
  overflow: hidden !important;
  overscroll-behavior: contain;
}

.t1-topbar__progress > span{
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
}

@media (hover: none) and (pointer: coarse){
  .t1-topbar__btn,
  .t1-btn,
  .t1-fabHome{
    min-height: 44px;
  }

  .t1-topbar__btn:hover,
  .t1-btn:hover,
  .t1-fabHome:hover{
    transform: none;
  }
}


/* UX polish v1: subtle interaction, loading and readability refinements */
html{
  scrollbar-width: thin;
  scrollbar-color: rgba(120,170,255,.34) rgba(255,255,255,.045);
}
body{
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}
::selection{
  background: rgba(120,170,255,.34);
  color: rgba(255,255,255,.96);
}
a, button, summary{
  -webkit-tap-highlight-color: transparent;
}
button{font:inherit}
.t1-topbar__btn:active,
.t1-btn:active,
.t1-fabHome:active{
  transform: translateY(0) scale(.985);
}
.t1-empty{
  line-height:1.75;
}
.t1-loadingCard{
  min-height:96px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.025));
  color:rgba(255,255,255,.72);
  box-shadow:0 12px 40px rgba(0,0,0,.22);
}
.t1-loadingDot{
  width:9px;
  height:9px;
  border-radius:999px;
  background:rgba(120,170,255,.9);
  box-shadow:0 0 0 0 rgba(120,170,255,.38);
  animation:t1-loading-pulse 1.15s ease-out infinite;
}
@keyframes t1-loading-pulse{
  0%{box-shadow:0 0 0 0 rgba(120,170,255,.36);transform:scale(.92)}
  70%{box-shadow:0 0 0 9px rgba(120,170,255,0);transform:scale(1)}
  100%{box-shadow:0 0 0 0 rgba(120,170,255,0);transform:scale(.92)}
}
@media (prefers-reduced-motion:reduce){
  .t1-loadingDot{animation:none}
}
@media (hover:none) and (pointer:coarse){
  .t1-topbar__btn:active,
  .t1-btn:active,
  .t1-fabHome:active{
    background:rgba(120,170,255,.14);
  }
}
@media (max-width:520px){
  .t1-topbar__inner{
    width:calc(100% - 18px);
    padding:0 8px;
    gap:8px;
  }
  .t1-topbar__title{
    letter-spacing:.12em;
  }
}
