@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/Inter-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('/fonts/JetBrainsMono-latin.woff2') format('woff2');
}

:root {
  --caret: #5eead4;
  --bg: #06080f;
  --bg-deep: #04060b;
  --bg-raised: #0a0e18;
  --panel: rgba(12, 17, 29, 0.76);
  --panel-solid: #0b101b;
  --card: rgba(15, 21, 36, 0.78);
  --card-solid: #0e1422;
  --line: rgba(148, 163, 184, 0.1);
  --line-strong: rgba(148, 163, 184, 0.17);
  --text: #edf2ff;
  --text-2: #b8c4da;
  --muted: #8290a8;
  --faint: #56647c;
  --accent: #8b5cf6;
  --accent-deep: #6d4aff;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --accent-rgb: 139, 92, 246;
  --accent-deep-rgb: 109, 74, 255;
  --accent2-rgb: 34, 211, 238;
  --accent3-rgb: 244, 114, 182;
  --green: #34d399;
  --red: #fb7185;
  --amber: #fbbf24;
  --orange: #fb923c;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8);
  --font-ui: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', 'Microsoft YaHei UI', 'PingFang SC', sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'SFMono-Regular', Consolas, 'Microsoft YaHei UI', monospace;
  --io-height: 258px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: rgba(124, 92, 246, 0.38);
  color: #fff;
}

:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.8);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.16);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.28);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.icon {
  display: block;
  flex: none;
}

[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-bottom-color: rgba(148, 163, 184, 0.28);
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.06);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.app {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
  opacity: 1;
  animation: app-in 0.8s var(--ease) both;
}

.app.is-loading {
  opacity: 0;
}

@keyframes app-in {
  from { opacity: 0; transform: scale(0.995); }
  to { opacity: 1; transform: none; }
}

/* ── Ambient background ───────────────────────────────────── */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-custom {
  position: absolute;
  inset: -28px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  filter: blur(var(--bg-image-blur, 0px));
  transform: scale(1.03);
  transition: opacity 0.8s var(--ease), filter 0.5s var(--ease);
}

.ambient-custom::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 6, 11, 0.42), rgba(4, 6, 11, 0.72)),
    radial-gradient(ellipse at 50% 28%, transparent 10%, rgba(4, 6, 11, 0.46) 78%);
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: var(--ambient-strength, 0.72);
  will-change: transform;
}

.blob-a {
  top: -24%;
  left: 8%;
  width: 46vw;
  height: 42vw;
  background: radial-gradient(circle, var(--ambient-a, rgba(var(--accent-deep-rgb), 0.26)), transparent 68%);
  animation: drift-a 26s ease-in-out infinite alternate;
}

.blob-b {
  right: -18%;
  top: 10%;
  width: 42vw;
  height: 42vw;
  background: radial-gradient(circle, var(--ambient-b, rgba(var(--accent2-rgb), 0.14)), transparent 68%);
  animation: drift-b 31s ease-in-out infinite alternate;
}

.blob-c {
  left: 28%;
  bottom: -32%;
  width: 50vw;
  height: 40vw;
  background: radial-gradient(circle, var(--ambient-c, rgba(var(--accent3-rgb), 0.1)), transparent 68%);
  animation: drift-a 36s ease-in-out infinite alternate-reverse;
}

@keyframes drift-a {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to { transform: translate3d(5%, 4%, 0) scale(1.12); }
}

@keyframes drift-b {
  from { transform: translate3d(2%, 0, 0) scale(1.05); }
  to { transform: translate3d(-4%, 7%, 0) scale(0.94); }
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: var(--grid-strength, 1);
  mask-image: radial-gradient(ellipse 90% 75% at 50% 20%, #000 20%, transparent 82%);
}

.ambient-noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ── Splash ───────────────────────────────────────────────── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(var(--accent-deep-rgb), 0.17), transparent 36%),
    radial-gradient(circle at 60% 66%, rgba(var(--accent2-rgb), 0.08), transparent 40%),
    #05070d;
  transition: opacity 0.64s var(--ease), visibility 0.64s;
}

.splash::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 0 36%, rgba(5, 7, 13, 0.6) 80%);
}

.splash.is-done {
  opacity: 0;
  visibility: hidden;
}

.splash-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 50%, #000 0 30%, transparent 72%);
  animation: splash-grid 1.4s var(--ease) both;
}

@keyframes splash-grid {
  from { opacity: 0; transform: scale(1.08); }
  to { opacity: 1; transform: scale(1); }
}

.splash-glow {
  position: absolute;
  width: 44vw;
  height: 44vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 246, 0.24), transparent 65%);
  filter: blur(40px);
  animation: splash-pulse 3s ease-in-out infinite alternate;
}

@keyframes splash-pulse {
  from { transform: scale(0.88); opacity: 0.65; }
  to { transform: scale(1.1); opacity: 0.95; }
}

.splash-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translateY(-2vh);
}

.splash-mark {
  width: 104px;
  height: 104px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 34px rgba(124, 92, 246, 0.5));
  animation: mark-in 1s var(--ease) both;
}

.splash-mark svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes mark-in {
  from { opacity: 0; transform: scale(0.75) rotate(-8deg); }
  to { opacity: 1; transform: none; }
}

.splash-wordmark {
  font-size: clamp(30px, 4.2vw, 46px);
  font-weight: 800;
  letter-spacing: 0.22em;
  line-height: 1;
  padding-left: 0.22em;
  background: linear-gradient(100deg, #ffffff 0%, #d9d3ff 35%, var(--accent) 68%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: word-in 0.9s 0.1s var(--ease) both;
}

.splash-wordmark span {
  font-weight: 300;
}

@keyframes word-in {
  from { opacity: 0; letter-spacing: 0.38em; }
  to { opacity: 1; letter-spacing: 0.22em; }
}

.splash-sub {
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.32em;
  animation: word-in 0.9s 0.22s var(--ease) both;
}

.splash-track {
  width: 218px;
  height: 2px;
  margin-top: 38px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.12);
}

.splash-track i {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(var(--accent2-rgb), 0.6);
  transition: width 0.6s var(--ease);
}

.splash-status {
  margin-top: 13px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.04em;
}

/* ── Auth screen ─────────────────────────────────────────── */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  overflow-y: auto;
  background:
    radial-gradient(circle at 22% 8%, rgba(var(--accent-rgb), 0.12), transparent 34%),
    radial-gradient(circle at 82% 88%, rgba(var(--accent2-rgb), 0.07), transparent 34%),
    rgba(4, 6, 11, 0.68);
  backdrop-filter: blur(20px) saturate(1.12);
  opacity: 1;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}

.auth-screen.open {
  display: block;
}

.auth-screen.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-shell {
  display: grid;
  width: min(1180px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 48px 52px;
  grid-template-columns: minmax(0, 1.12fr) minmax(390px, 0.78fr);
  align-items: center;
  gap: 64px;
}

.auth-showcase {
  position: relative;
  max-width: 610px;
  padding: 12px 0;
  animation: auth-rise 0.8s var(--ease) both;
}

@keyframes auth-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 54px;
}

.auth-brand-mark {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 0 18px rgba(124, 92, 246, 0.36));
}

.auth-brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.auth-brand-word {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: #f3f5ff;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.auth-brand-word span {
  color: color-mix(in srgb, var(--accent) 40%, #ffffff);
  font-weight: 300;
}

.auth-brand-word small {
  margin-left: 7px;
  color: var(--faint);
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.auth-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  color: rgba(var(--accent2-rgb), 0.66);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.22em;
}

.auth-kicker i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 9px rgba(var(--accent2-rgb), 0.8);
}

.auth-showcase h1 {
  margin: 0;
  color: #f4f7ff;
  font-size: clamp(40px, 4.4vw, 58px);
  font-weight: 800;
  letter-spacing: -0.065em;
  line-height: 1.13;
}

.auth-showcase h1 span {
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 40%, #ffffff), var(--accent) 48%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-lead {
  max-width: 500px;
  margin: 23px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.85;
}

.auth-features {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 26px;
  margin-top: 30px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 9px;
}

.auth-feature-icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.045);
  color: #a5b4fc;
}

.auth-feature > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-feature b {
  color: var(--text-2);
  font-size: 9.5px;
  font-weight: 600;
}

.auth-feature small {
  color: var(--faint);
  font-size: 8px;
}

.auth-code-card {
  position: relative;
  overflow: hidden;
  margin-top: 38px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 13px;
  background: rgba(9, 13, 23, 0.67);
  box-shadow: 0 28px 70px -30px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(16px);
}

.auth-code-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
}

.auth-code-head > span:first-child {
  display: flex;
  gap: 4px;
}

.auth-code-head > span:first-child i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.24);
}

.auth-code-head > span:first-child i:first-child {
  background: rgba(251, 113, 133, 0.55);
}

.auth-code-head > span:first-child i:nth-child(2) {
  background: rgba(251, 191, 36, 0.55);
}

.auth-code-head > span:first-child i:nth-child(3) {
  background: rgba(52, 211, 153, 0.55);
}

.auth-code-head > span:nth-child(2) {
  color: var(--muted);
}

.auth-code-head > span:last-child {
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 3px;
  color: color-mix(in srgb, var(--accent) 40%, #ffffff);
}

.auth-code-card pre {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 17px 20px 20px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.8;
  white-space: pre;
}

.auth-code-card code {
  color: #cbd5e1;
}

.auth-code-card .tok-c { color: #5d6d8b; font-style: italic; }
.auth-code-card .tok-k { color: #c084fc; }
.auth-code-card .tok-s { color: #7dd3fc; }
.auth-code-card .tok-t { color: #5eead4; }
.auth-code-card .tok-f { color: #93c5fd; }
.auth-code-card .tok-n { color: #fbbf24; }

.auth-code-glow {
  position: absolute;
  right: -40px;
  bottom: -80px;
  width: 240px;
  height: 180px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.12);
  filter: blur(38px);
  pointer-events: none;
}

.auth-showcase-foot {
  margin-top: 17px;
  color: rgba(86, 100, 124, 0.78);
  font-size: 8px;
  letter-spacing: 0.02em;
}

.auth-panel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: auth-rise 0.8s 0.1s var(--ease) both;
}

.auth-panel {
  position: relative;
  width: 100%;
  max-width: 410px;
  padding: 25px 27px 22px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--accent-rgb), 0.11), transparent 44%),
    linear-gradient(145deg, rgba(16, 22, 38, 0.88), rgba(8, 12, 21, 0.87));
  box-shadow: 0 34px 100px -28px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.015) inset;
  backdrop-filter: blur(24px);
}

.auth-panel::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 15%;
  width: 70%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.75), rgba(var(--accent2-rgb), 0.5), transparent);
}

.auth-panel-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 23px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
}

.auth-mini-logo {
  width: 21px;
  height: 21px;
  flex: none;
}

.auth-mini-logo svg {
  display: block;
  width: 100%;
  height: 100%;
}

.auth-secure {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  color: rgba(52, 211, 153, 0.65);
  font-size: 6.5px;
  letter-spacing: 0.12em;
}

.auth-secure i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.65);
}

.auth-tabs {
  position: relative;
  display: flex;
  gap: 2px;
  margin-bottom: 24px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(5, 8, 14, 0.5);
}

.auth-tab {
  position: relative;
  z-index: 1;
  flex: 1;
  height: 31px;
  border-radius: 7px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  transition: color 0.2s, background 0.2s;
}

.auth-tab:hover {
  color: var(--text-2);
}

.auth-tab.active {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-rgb), 0.1));
  color: #ede9fe;
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.18) inset;
}

.auth-title {
  margin: 0;
  color: #f3f6ff;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.auth-subtitle {
  margin: 6px 0 20px;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.6;
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.auth-field {
  margin-bottom: 12px;
}

.auth-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.auth-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(4, 7, 13, 0.55);
  color: var(--faint);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input-wrap:focus-within {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(9, 13, 22, 0.72);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.09);
}

.auth-input-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 11.5px;
  user-select: text;
}

.auth-input-wrap input::placeholder {
  color: rgba(86, 100, 124, 0.67);
}

.auth-eye {
  display: grid;
  width: 23px;
  height: 23px;
  flex: none;
  place-items: center;
  border-radius: 5px;
  color: var(--faint);
  transition: color 0.2s, background 0.2s;
}

.auth-eye:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-2);
}

.auth-error {
  min-height: 18px;
  margin: 2px 0 7px;
  color: #fda4af;
  font-size: 9px;
  line-height: 1.5;
}

.auth-error.is-error {
  animation: auth-shake 0.32s var(--ease);
}

@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.auth-submit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 42px;
  margin-top: 2px;
  padding: 0 14px;
  overflow: hidden;
  border-radius: 9px;
  background: linear-gradient(115deg, var(--accent-deep), var(--accent) 48%, var(--accent-2));
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  box-shadow: 0 10px 28px -12px rgba(var(--accent-rgb), 0.9), 0 1px 0 rgba(255, 255, 255, 0.14) inset;
  transition: transform 0.2s, box-shadow 0.2s;
}

.auth-submit::before {
  content: '';
  position: absolute;
  top: -100%;
  left: -20%;
  width: 36%;
  height: 300%;
  background: rgba(255, 255, 255, 0.16);
  filter: blur(11px);
  transform: rotate(18deg) translateX(-180%);
  transition: transform 0.7s var(--ease);
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px -12px rgba(var(--accent-rgb), 1), 0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.auth-submit:hover::before {
  transform: rotate(18deg) translateX(460%);
}

.auth-submit:disabled {
  opacity: 0.6;
  transform: none;
}

.auth-submit-arrow {
  font-size: 16px;
  font-weight: 300;
  opacity: 0.8;
}

.auth-switch {
  margin-top: 16px;
  color: var(--faint);
  font-size: 9px;
  text-align: center;
}

.auth-switch button {
  margin-left: 3px;
  color: color-mix(in srgb, var(--accent) 40%, #ffffff);
  font-weight: 600;
  transition: color 0.2s;
}

.auth-switch button:hover {
  color: #ede9fe;
}

.auth-account-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: rgba(86, 100, 124, 0.78);
  font-size: 8px;
  line-height: 1.55;
}

.auth-account-note span:first-child {
  margin-top: 1px;
  color: rgba(var(--accent2-rgb), 0.55);
}

.auth-panel-foot {
  color: rgba(86, 100, 124, 0.66);
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

.auth-busy {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border-radius: inherit;
  background: rgba(7, 10, 17, 0.88);
  color: var(--text-2);
  font-size: 10px;
  backdrop-filter: blur(12px);
}

.auth-busy[hidden] {
  display: none !important;
}

.auth-busy i {
  width: 25px;
  height: 25px;
  border: 2px solid rgba(148, 163, 184, 0.18);
  border-top-color: color-mix(in srgb, var(--accent) 70%, #ffffff);
  border-right-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@media (max-height: 760px) and (min-width: 900px) {
  .auth-shell { padding-top: 26px; padding-bottom: 26px; }
  .auth-brand { margin-bottom: 28px; }
  .auth-showcase h1 { font-size: 42px; }
  .auth-code-card { margin-top: 22px; }
  .auth-panel { padding-top: 19px; padding-bottom: 18px; }
  .auth-panel-brand { margin-bottom: 15px; }
  .auth-tabs { margin-bottom: 17px; }
  .auth-subtitle { margin-bottom: 14px; }
  .auth-account-note { margin-top: 12px; padding-top: 10px; }
}

@media (max-width: 960px) {
  .auth-shell {
    width: min(520px, 100%);
    grid-template-columns: 1fr;
    padding: 28px 20px;
  }
  .auth-showcase { display: none; }
  .auth-panel-wrap { width: 100%; }
  .auth-panel { max-width: 440px; }
  .auth-screen.open { display: flex; align-items: center; }
}

@media (max-width: 480px) {
  .auth-shell { padding: 16px 12px; }
  .auth-panel { padding: 21px 17px 18px; border-radius: 17px; }
  .auth-title { font-size: 21px; }
  .auth-input-wrap { height: 39px; }
}

/* ── Titlebar ─────────────────────────────────────────────── */
.titlebar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  flex: 0 0 62px;
  gap: 18px;
  padding: 0 16px 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(9, 13, 23, 0.78), rgba(7, 10, 18, 0.6));
  backdrop-filter: blur(24px) saturate(1.2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 202px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 14px rgba(124, 92, 246, 0.35));
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
  color: #f4f6ff;
}

.brand-name span {
  font-weight: 300;
  color: color-mix(in srgb, var(--accent) 40%, #ffffff);
}

.brand-sub {
  color: var(--faint);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.brand-beta {
  align-self: flex-start;
  margin-top: 1px;
  padding: 2px 5px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 4px;
  background: rgba(var(--accent-rgb), 0.1);
  color: color-mix(in srgb, var(--accent) 40%, #ffffff);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.chrome-btn {
  display: grid;
  width: 30px;
  height: 30px;
  flex: none;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--faint);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.chrome-btn:hover {
  border-color: var(--line);
  background: rgba(148, 163, 184, 0.06);
  color: var(--text-2);
}

body.sidebar-collapsed .chrome-btn {
  color: color-mix(in srgb, var(--accent) 40%, #ffffff);
  border-color: rgba(var(--accent-rgb), 0.2);
  background: rgba(var(--accent-rgb), 0.08);
}

.project-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  max-width: 260px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-2);
  transition: background 0.2s, border-color 0.2s;
}

.project-pill:hover {
  border-color: var(--line);
  background: rgba(148, 163, 184, 0.05);
}

.project-pill > span:first-child {
  color: color-mix(in srgb, var(--accent) 70%, #ffffff);
}

.project-name {
  overflow: hidden;
  max-width: 180px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}

.project-caret {
  color: var(--faint);
}

.title-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.sync-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--faint);
  font-size: 10.5px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.sync-pill[data-state='saved'] .sync-icon {
  color: var(--green);
}

.sync-pill[data-state='saving'] .sync-icon {
  color: var(--amber);
  animation: soft-pulse 1.2s infinite;
}

.sync-pill[data-state='error'] .sync-icon {
  color: var(--red);
}

.sync-pill:hover {
  background: rgba(148, 163, 184, 0.05);
}

@keyframes soft-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.checkin-quick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(251, 146, 60, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.1), rgba(244, 63, 94, 0.06));
  color: #fdba74;
  font-size: 11px;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.checkin-quick:hover {
  border-color: rgba(251, 146, 60, 0.35);
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.17), rgba(244, 63, 94, 0.09));
  transform: translateY(-1px);
}

.checkin-quick b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 17px;
  padding: 0 5px;
  border-radius: 99px;
  background: rgba(251, 146, 60, 0.16);
  color: #fdba74;
  font-size: 9.5px;
}

.checkin-ready-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fb923c;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.14);
  animation: dot-pulse 2s infinite;
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.18); }
  50% { box-shadow: 0 0 0 5px rgba(251, 146, 60, 0.04); }
}

.xp-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.035);
  color: var(--muted);
  transition: border-color 0.2s, background 0.2s;
}

.xp-widget:hover {
  border-color: var(--line-strong);
  background: rgba(148, 163, 184, 0.06);
}

.xp-level {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.xp-level b {
  color: #d8ccff;
  font-size: 11px;
}

.xp-track {
  position: relative;
  width: 45px;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.14);
}

.xp-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.7s var(--ease);
}

.xp-value {
  font-size: 9px;
  color: var(--faint);
  white-space: nowrap;
}

.avatar {
  position: relative;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent) 55%, var(--accent-2));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15) inset, 0 4px 14px rgba(var(--accent-rgb), 0.3);
  transition: transform 0.2s;
}

.avatar:hover {
  transform: scale(1.06);
}

.avatar-ring {
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 50%;
}

/* ── Shell / rail / sidebar ───────────────────────────────── */
.shell {
  position: relative;
  z-index: 2;
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: 62px 288px minmax(0, 1fr);
}

.rail {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 10px;
  border-right: 1px solid var(--line);
  background: rgba(7, 10, 18, 0.45);
  backdrop-filter: blur(20px);
}

.rail-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.rail-btn {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 11px;
  color: var(--faint);
  transition: color 0.2s, background 0.2s, transform 0.2s;
}

.rail-btn:hover {
  background: rgba(148, 163, 184, 0.06);
  color: var(--text-2);
}

.rail-btn.active {
  color: #ddd6fe;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.17), rgba(var(--accent-rgb), 0.06));
}

.rail-btn.active::before {
  content: '';
  position: absolute;
  inset: 8px auto 8px -10px;
  width: 2px;
  border-radius: 99px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 70%, #ffffff), var(--accent-2));
  box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.7);
}

.rail-indicator {
  position: absolute;
  inset: auto auto -2px auto;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 70%, #ffffff);
  opacity: 0;
}

.rail-btn.active .rail-indicator {
  opacity: 1;
}

.rail-badge {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fb923c;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.13);
}

.rail-bottom {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.sidebar {
  position: relative;
  z-index: 15;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: rgba(8, 12, 21, 0.48);
  backdrop-filter: blur(22px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

body.sidebar-collapsed .shell {
  grid-template-columns: 62px 0 minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
}

.panel {
  display: none;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

.panel.active {
  display: flex;
  animation: panel-in 0.34s var(--ease) both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex: none;
  padding: 20px 18px 13px;
}

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel-actions {
  display: flex;
  gap: 4px;
}

.head-count {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.icon-btn {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.icon-btn:hover {
  border-color: var(--line);
  background: rgba(148, 163, 184, 0.07);
  color: var(--text);
}

.icon-btn.tiny {
  width: 23px;
  height: 23px;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}

.text-btn:hover {
  background: rgba(148, 163, 184, 0.06);
  color: var(--text);
}

.text-btn.tiny {
  padding: 3px 5px;
  font-size: 9.5px;
}

.panel-body,
.explorer-scroll,
.snippet-list,
.achievement-list {
  min-height: 0;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 14px 20px;
}

.explorer-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 16px;
}

/* ── Explorer ─────────────────────────────────────────────── */
.tree-root {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 7px;
  margin-bottom: 2px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.tree-chevron {
  color: var(--faint);
}

.tree-folder {
  color: color-mix(in srgb, var(--accent) 70%, #ffffff);
}

.tree-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-count {
  margin-left: auto;
  color: var(--faint);
  font-size: 9px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.file-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 31px;
  padding: 0 7px 0 24px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: 11.5px;
  transition: background 0.16s, color 0.16s;
}

.file-row:hover {
  background: rgba(148, 163, 184, 0.05);
  color: var(--text-2);
}

.file-row.active {
  border-color: rgba(var(--accent-rgb), 0.16);
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.13), rgba(var(--accent-rgb), 0.035));
  color: #e9e5ff;
}

.file-row.active::before {
  content: '';
  position: absolute;
  left: 10px;
  width: 2px;
  height: 12px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 70%, #ffffff);
}

.file-icon {
  color: #7dd3fc;
}

.file-row.active .file-icon {
  color: color-mix(in srgb, var(--accent) 40%, #ffffff);
}

.file-name {
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.file-dirty {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.file-menu-btn {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 5px;
  color: var(--faint);
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}

.file-row:hover .file-menu-btn {
  opacity: 1;
}

.file-menu-btn:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text);
}

.new-file-row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 31px;
  margin-top: 3px;
  padding: 0 7px 0 24px;
  border: 1px dashed transparent;
  border-radius: 7px;
  color: var(--faint);
  font-size: 10.5px;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.new-file-row span:nth-child(2) {
  flex: 1;
  text-align: left;
}

.new-file-row:hover {
  border-color: var(--line);
  background: rgba(148, 163, 184, 0.035);
  color: var(--text-2);
}

.new-file-row kbd {
  opacity: 0;
  transition: opacity 0.2s;
}

.new-file-row:hover kbd {
  opacity: 1;
}

.mini-divider {
  height: 1px;
  margin: 14px 6px;
  background: var(--line);
}

.compiler-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--accent2-rgb), 0.08), transparent 50%),
    linear-gradient(145deg, rgba(19, 26, 44, 0.8), rgba(11, 15, 26, 0.6));
}

.compiler-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.compiler-state {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 600;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.06);
}

.status-dot.ready {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12), 0 0 8px rgba(52, 211, 153, 0.5);
}

.status-dot.busy {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
  animation: soft-pulse 1.2s infinite;
}

.status-dot.error {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.1);
}

.compiler-version {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
}

.compiler-detail {
  margin-top: 7px;
  overflow: hidden;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compiler-progress {
  height: 3px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.12);
}

.compiler-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.5s var(--ease);
}

.std-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 10px;
}

.std-chip {
  width: 100%;
  padding: 3px 5px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.06);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
  text-align: center;
  transition: color 0.2s, background 0.2s;
}

.std-chip.active {
  border-color: rgba(var(--accent-rgb), 0.25);
  background: rgba(var(--accent-rgb), 0.13);
  color: #d8ccff;
}

.compiler-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 8px;
}

.compiler-foot span:first-child {
  color: rgba(var(--accent2-rgb), 0.6);
}

.shortcut-card {
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(13, 18, 31, 0.42);
}

.shortcut-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
}

.shortcut-title span:first-child {
  color: var(--amber);
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  color: var(--faint);
  font-size: 9px;
}

.shortcut-row span {
  margin-left: auto;
}

/* ── Snippets ─────────────────────────────────────────────── */
.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 9, 16, 0.5);
  color: var(--faint);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.08);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font-size: 10.5px;
  user-select: text;
}

.search-box input::placeholder {
  color: var(--faint);
}

.search-box kbd {
  flex: none;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 10px 0;
}

.chip {
  height: 24px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 99px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 500;
  transition: all 0.2s;
}

.chip:hover {
  background: rgba(148, 163, 184, 0.06);
  color: var(--text-2);
}

.chip.active {
  border-color: rgba(var(--accent-rgb), 0.24);
  background: rgba(var(--accent-rgb), 0.13);
  color: #ddd6fe;
}

.snippet-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  max-height: calc(100vh - 350px);
  padding-right: 2px;
}

.snippet-item {
  display: flex;
  gap: 9px;
  width: 100%;
  padding: 9px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 18, 31, 0.4);
  text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.snippet-item:hover {
  border-color: rgba(var(--accent-rgb), 0.24);
  background: rgba(var(--accent-rgb), 0.06);
  transform: translateX(1px);
}

.snippet-item-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: none;
  place-items: center;
  border-radius: 7px;
  background: rgba(var(--accent2-rgb), 0.07);
  color: #67e8f9;
}

.snippet-item-main {
  min-width: 0;
  flex: 1;
}

.snippet-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.snippet-item-name {
  overflow: hidden;
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snippet-item-std {
  margin-left: auto;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 7px;
}

.snippet-item-desc {
  margin-top: 3px;
  overflow: hidden;
  color: var(--faint);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snippet-item-code {
  overflow: hidden;
  margin-top: 4px;
  color: rgba(125, 211, 252, 0.45);
  font-family: var(--font-mono);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.025);
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.6;
}

.panel-hint span:first-child {
  margin-top: 1px;
  color: rgba(var(--accent2-rgb), 0.6);
}

.panel-hint kbd {
  height: 14px;
  min-width: 14px;
  font-size: 8px;
}

/* ── Check-in ─────────────────────────────────────────────── */
.checkin-hero {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(251, 146, 60, 0.18);
  border-radius: 14px;
  background:
    radial-gradient(circle at 88% 10%, rgba(251, 146, 60, 0.18), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(244, 63, 94, 0.08), transparent 40%),
    linear-gradient(145deg, rgba(35, 22, 28, 0.8), rgba(14, 17, 30, 0.75));
}

.hero-glow {
  position: absolute;
  top: -40%;
  right: -18%;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(251, 146, 60, 0.12);
  filter: blur(26px);
  pointer-events: none;
}

.checkin-hero-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(253, 186, 116, 0.8);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.today-date {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0;
}

.streak-display {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 12px;
}

.streak-number {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.streak-number > span {
  color: #fff7ed;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  text-shadow: 0 0 24px rgba(251, 146, 60, 0.24);
}

.streak-number small {
  color: rgba(253, 186, 116, 0.6);
  font-size: 9px;
}

.streak-flame {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: rgba(251, 146, 60, 0.1);
  color: #fb923c;
}

.streak-flame::before {
  content: '';
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(251, 146, 60, 0.1);
  border-radius: 50%;
  animation: ring-breathe 3s ease-in-out infinite;
}

.streak-flame i {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 146, 60, 0.24), transparent 70%);
  filter: blur(5px);
}

@keyframes ring-breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.4; }
  50% { transform: scale(1.08); opacity: 0.9; }
}

.week-row {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 12px;
}

.week-day {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.week-dot {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.04);
  color: var(--faint);
  font-size: 7px;
  transition: all 0.2s;
}

.week-day.checked .week-dot {
  border-color: rgba(251, 146, 60, 0.4);
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.32), rgba(244, 63, 94, 0.2));
  color: #fed7aa;
  box-shadow: 0 0 10px rgba(251, 146, 60, 0.16);
}

.week-day.today .week-dot {
  outline: 1px solid rgba(253, 186, 116, 0.5);
  outline-offset: 2px;
}

.week-label {
  color: var(--faint);
  font-size: 7px;
}

.week-day.today .week-label {
  color: #fdba74;
}

.checkin-big {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 36px;
  padding: 0 11px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, #fb923c, #f43f5e);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  box-shadow: 0 8px 20px -8px rgba(244, 63, 94, 0.55);
  transition: transform 0.2s, box-shadow 0.2s;
}

.checkin-big:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 26px -8px rgba(244, 63, 94, 0.7);
}

.checkin-big b {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 8.5px;
}

.checkin-big.is-done {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.2), rgba(20, 184, 166, 0.12));
  color: #6ee7b7;
  box-shadow: none;
  cursor: default;
}

.checkin-big.is-done:hover {
  transform: none;
}

.checkin-big-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.22), transparent 65%);
  transform: translateX(-110%);
  animation: shine 4.4s ease-in-out infinite;
}

@keyframes shine {
  0%, 58% { transform: translateX(-110%); }
  78%, 100% { transform: translateX(110%); }
}

.checkin-hint {
  margin-top: 7px;
  color: rgba(253, 186, 116, 0.42);
  font-size: 8px;
  text-align: center;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 9px;
}

.stat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 18, 31, 0.38);
}

.stat-value {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-label {
  color: var(--faint);
  font-size: 7.5px;
}

.calendar-card {
  margin-top: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 18, 31, 0.38);
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--text-2);
  font-size: 9.5px;
  font-weight: 600;
}

#calendarPrev span,
#calendarNext span {
  transform: rotate(90deg);
}

#calendarNext span {
  transform: rotate(-90deg);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-weekdays {
  margin-bottom: 4px;
  color: var(--faint);
  font-size: 7px;
  text-align: center;
}

.calendar-day {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 5px;
  color: var(--faint);
  font-size: 8px;
  transition: background 0.2s, color 0.2s;
}

.calendar-day.blank {
  opacity: 0;
}

.calendar-day.checked {
  background: rgba(251, 146, 60, 0.16);
  color: #fdba74;
}

.calendar-day.today {
  outline: 1px solid rgba(253, 186, 116, 0.5);
  outline-offset: -1px;
  color: #fdba74;
}

/* ── Achievements ─────────────────────────────────────────── */
.achievement-summary {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--accent-rgb), 0.13), transparent 48%),
    rgba(13, 18, 31, 0.45);
}

.ring {
  position: relative;
  width: 64px;
  height: 64px;
  flex: none;
}

.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring circle {
  fill: none;
  stroke-width: 4;
}

.ring-bg {
  stroke: rgba(148, 163, 184, 0.1);
}

.ring-fg {
  stroke: url(#ringGradient);
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 188.5;
  stroke-dashoffset: 188.5;
  transition: stroke-dashoffset 0.8s var(--ease);
  filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.5));
}

.ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  color: var(--text);
}

.ring-label b {
  font-size: 17px;
  font-weight: 700;
}

.ring-label span {
  color: var(--faint);
  font-size: 7.5px;
}

.achievement-summary-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.achievement-summary-text strong {
  font-size: 11px;
  font-weight: 600;
}

.achievement-summary-text > span {
  color: var(--faint);
  font-size: 8px;
  line-height: 1.45;
}

.summary-bar {
  height: 3px;
  margin-top: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.1);
}

.summary-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.7s var(--ease);
}

.achievement-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
  overflow-y: auto;
  max-height: calc(100vh - 335px);
  padding-right: 2px;
}

.achievement-card {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(13, 18, 31, 0.38);
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.achievement-card:hover {
  border-color: var(--line-strong);
  background: rgba(148, 163, 184, 0.04);
}

.achievement-card.locked {
  opacity: 0.48;
  filter: saturate(0.4);
}

.achievement-medal {
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  place-items: center;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.07);
  color: var(--muted);
}

.achievement-card[data-tier='rare'] .achievement-medal {
  background: rgba(var(--accent2-rgb), 0.1);
  color: #67e8f9;
}

.achievement-card[data-tier='epic'] .achievement-medal {
  background: rgba(var(--accent-rgb), 0.13);
  color: color-mix(in srgb, var(--accent) 40%, #ffffff);
}

.achievement-card[data-tier='legendary'] .achievement-medal {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.08);
}

.achievement-info {
  min-width: 0;
  flex: 1;
}

.achievement-name {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 600;
}

.achievement-name .lock {
  color: var(--faint);
}

.achievement-desc {
  margin-top: 2px;
  overflow: hidden;
  color: var(--faint);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.achievement-xp {
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 8px;
  white-space: nowrap;
}

/* ── Leaderboard ──────────────────────────────────────────── */
.leader-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 12px;
  background:
    radial-gradient(circle at 88% 0%, rgba(var(--accent-rgb), 0.18), transparent 45%),
    rgba(13, 18, 31, 0.55);
}

.leader-crown {
  display: grid;
  width: 42px;
  height: 42px;
  flex: none;
  place-items: center;
  border-radius: 11px;
  background: rgba(251, 191, 36, 0.1);
  color: #fcd34d;
}

.leader-self {
  min-width: 0;
  flex: 1;
}

.leader-rank {
  display: flex;
  align-items: baseline;
  gap: 1px;
  color: #ddd6fe;
  font-weight: 800;
}

.leader-rank span {
  color: var(--faint);
  font-size: 11px;
}

.leader-rank b {
  font-size: 22px;
  letter-spacing: -0.04em;
}

.leader-name {
  display: block;
  overflow: hidden;
  max-width: 110px;
  color: var(--text-2);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-xp {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.leader-xp b {
  color: #fcd34d;
  font-size: 16px;
  font-weight: 700;
}

.leader-xp span {
  color: var(--faint);
  font-size: 7px;
  letter-spacing: 0.15em;
}

.leader-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 10px;
}

.leader-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: background 0.2s, border-color 0.2s;
}

.leader-row:hover {
  border-color: var(--line);
  background: rgba(148, 163, 184, 0.035);
}

.leader-row.self {
  border-color: rgba(var(--accent-rgb), 0.16);
  background: rgba(var(--accent-rgb), 0.06);
}

.leader-index {
  width: 17px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9px;
  text-align: center;
}

.leader-row:nth-child(1) .leader-index {
  color: #fcd34d;
}

.leader-row:nth-child(2) .leader-index {
  color: #cbd5e1;
}

.leader-row:nth-child(3) .leader-index {
  color: #fdba74;
}

.leader-avatar {
  display: grid;
  width: 25px;
  height: 25px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.7), rgba(var(--accent2-rgb), 0.5));
  color: #fff;
  font-size: 8px;
  font-weight: 700;
}

.leader-meta {
  min-width: 0;
  flex: 1;
}

.leader-meta strong {
  display: block;
  overflow: hidden;
  color: var(--text-2);
  font-size: 9.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-meta span {
  color: var(--faint);
  font-size: 7.5px;
}

.leader-score {
  color: #d8ccff;
  font-family: var(--font-mono);
  font-size: 9px;
}

.lan-card {
  margin-top: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 18, 31, 0.4);
}

.lan-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 9.5px;
  font-weight: 600;
}

.lan-card-head span:first-child {
  color: var(--accent-2);
}

.lan-url {
  overflow: hidden;
  margin: 8px 0;
  padding: 7px 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: #67e8f9;
  font-family: var(--font-mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.lan-card p {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 7.5px;
  line-height: 1.55;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 33px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.05);
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s;
}

.btn:hover {
  border-color: var(--line-strong);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
}

.btn.full {
  width: 100%;
}

.btn-subtle {
  height: 28px;
  border-color: var(--line);
  background: rgba(148, 163, 184, 0.035);
  color: var(--muted);
  font-size: 9.5px;
}

.btn-danger {
  border-color: rgba(251, 113, 133, 0.2);
  background: rgba(251, 113, 133, 0.06);
  color: #fda4af;
}

.btn-danger:hover {
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.1);
  color: #fecdd3;
}

/* ── Settings ─────────────────────────────────────────────── */
.settings-group {
  margin-bottom: 14px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 18, 31, 0.35);
}

.settings-title {
  margin-bottom: 4px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 1px;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child {
  border-bottom: 0;
  padding-bottom: 1px;
}

.setting-row > div:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.setting-row strong {
  color: var(--text-2);
  font-size: 9.5px;
  font-weight: 500;
}

.setting-row span {
  overflow: hidden;
  color: var(--faint);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(6, 9, 16, 0.5);
}

.stepper button {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 4px;
  color: var(--muted);
}

.stepper button:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text);
}

.stepper b {
  min-width: 22px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 9px;
  text-align: center;
}

.switch {
  position: relative;
  width: 29px;
  height: 16px;
  flex: none;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.18);
  transition: background 0.2s;
}

.switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: transform 0.22s var(--ease), background 0.2s;
}

.switch.on {
  background: linear-gradient(90deg, var(--accent), var(--accent));
}

.switch.on i {
  background: #fff;
  transform: translateX(13px);
}

.compiler-settings {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 0 8px;
}

.compiler-settings-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  place-items: center;
  border-radius: 8px;
  background: rgba(var(--accent2-rgb), 0.08);
  color: #67e8f9;
}

.compiler-settings > div:nth-child(2) {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.compiler-settings strong {
  color: var(--text-2);
  font-size: 9.5px;
  font-weight: 600;
}

.compiler-settings span {
  color: var(--faint);
  font-size: 8px;
}

.settings-note {
  margin: 0;
  color: var(--faint);
  font-size: 8px;
  line-height: 1.55;
}

.settings-note code {
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 7.5px;
}

.account-group {
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--accent-rgb), 0.09), transparent 50%),
    rgba(13, 18, 31, 0.35);
}

.account-settings {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0 9px;
}

.account-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent) 55%, var(--accent-2));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.account-settings-info {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.account-settings-info strong {
  overflow: hidden;
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-settings-info span {
  overflow: hidden;
  color: var(--faint);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-online {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(52, 211, 153, 0.66);
  font-size: 7px;
  white-space: nowrap;
}

.account-online i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.55);
}

.account-actions {
  display: flex;
  gap: 5px;
  margin-top: 3px;
}

.account-actions .btn {
  height: 27px;
  flex: 1;
  font-size: 8.5px;
}

.bg-swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin: 8px 0 5px;
}

.bg-preview {
  position: relative;
  height: 58px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #06080f;
  background-position: center;
  background-size: cover;
  transition: background 0.3s var(--ease);
}

.bg-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(4, 6, 11, 0.5));
}

.bg-preview > span {
  position: absolute;
  z-index: 1;
  top: 7px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(4, 6, 11, 0.45);
  color: rgba(226, 232, 240, 0.7);
  font-size: 6.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  backdrop-filter: blur(8px);
}

.bg-preview > span i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--green);
}

.bg-swatch {
  position: relative;
  height: 35px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--swatch-bg);
  transition: border-color 0.2s, transform 0.2s;
}

.bg-swatch::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 28% 28%, var(--swatch-a), transparent 58%), radial-gradient(circle at 74% 70%, var(--swatch-b), transparent 52%);
}

.bg-swatch:hover {
  transform: translateY(-1px);
}

.bg-swatch.active {
  border-color: rgba(196, 181, 253, 0.7);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.12);
}

.bg-swatch.active::before {
  content: '';
  position: absolute;
  z-index: 2;
  right: 4px;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
}

.bg-slider-row {
  padding-bottom: 3px;
  border-bottom: 0;
}

.range-value {
  color: color-mix(in srgb, var(--accent) 40%, #ffffff) !important;
  font-family: var(--font-mono);
  font-size: 8px !important;
}

.range-input {
  width: 100%;
  height: 16px;
  margin: 0 0 8px;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.range-input::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.6), rgba(var(--accent2-rgb), 0.4));
}

.range-input::-webkit-slider-thumb {
  width: 11px;
  height: 11px;
  margin-top: -4px;
  appearance: none;
  border: 2px solid #0b101b;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 40%, #ffffff);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.55);
}

.range-input::-moz-range-track {
  height: 3px;
  border-radius: 99px;
  background: rgba(var(--accent-rgb), 0.5);
}

.range-input::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border: 2px solid #0b101b;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 40%, #ffffff);
}

.bg-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.bg-actions .btn {
  height: 26px;
  padding: 0 7px;
  font-size: 8.5px;
}

.danger-group {
  border-color: rgba(251, 113, 133, 0.1);
}

.about-line {
  padding: 4px 0 16px;
  color: var(--faint);
  font-size: 7.5px;
  text-align: center;
  letter-spacing: 0.05em;
}

/* ── Workbench ────────────────────────────────────────────── */
.workbench {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: rgba(7, 10, 18, 0.12);
}

.workbench-top {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: stretch;
  flex: 0 0 46px;
  gap: 8px;
  padding-right: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 13, 22, 0.38);
  backdrop-filter: blur(16px);
}

.tabs {
  display: flex;
  min-width: 0;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 132px;
  max-width: 190px;
  height: 100%;
  padding: 0 10px;
  border-right: 1px solid var(--line);
  color: var(--faint);
  font-size: 10.5px;
  transition: background 0.18s, color 0.18s;
}

.tab:hover {
  background: rgba(148, 163, 184, 0.035);
  color: var(--muted);
}

.tab.active {
  background: rgba(13, 18, 31, 0.75);
  color: var(--text-2);
}

.tab.active::after {
  content: '';
  position: absolute;
  right: 8px;
  bottom: 0;
  left: 8px;
  height: 2px;
  border-radius: 99px 99px 0 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.4);
}

.tab-icon {
  color: #67e8f9;
}

.tab.active .tab-icon {
  color: color-mix(in srgb, var(--accent) 40%, #ffffff);
}

.tab-name {
  overflow: hidden;
  flex: 1;
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.tab-close {
  display: grid;
  width: 17px;
  height: 17px;
  flex: none;
  place-items: center;
  border-radius: 4px;
  color: var(--faint);
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}

.tab:hover .tab-close,
.tab.active .tab-close {
  opacity: 1;
}

.tab-close:hover {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
}

.tab-add {
  display: grid;
  width: 32px;
  flex: none;
  place-items: center;
  color: var(--faint);
  transition: color 0.2s;
}

.tab-add:hover {
  color: var(--text-2);
}

.workbench-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.std-select {
  position: relative;
  z-index: 70;
}

.std-trigger {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 29px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.035);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s;
}

.std-trigger:hover,
.std-select.open .std-trigger {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.07);
}

.std-glow {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 7px rgba(var(--accent-rgb), 0.9);
}

.std-chevron {
  color: var(--faint);
  transition: transform 0.2s;
}

.std-select.open .std-chevron {
  transform: rotate(180deg);
}

.std-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  width: 292px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(11, 16, 28, 0.97);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(0.985);
  transform-origin: top right;
  transition: opacity 0.18s, visibility 0.18s, transform 0.18s var(--ease);
  backdrop-filter: blur(24px);
}

.std-select.open .std-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.std-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border-radius: 7px;
  text-align: left;
  transition: background 0.15s;
}

.std-option:hover {
  background: rgba(148, 163, 184, 0.06);
}

.std-option.active {
  background: rgba(var(--accent-rgb), 0.1);
}

.std-option-badge {
  display: grid;
  width: 38px;
  height: 26px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 6px;
  background: rgba(6, 9, 16, 0.55);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
}

.std-option.active .std-option-badge {
  border-color: rgba(var(--accent-rgb), 0.35);
  color: #ddd6fe;
}

.std-option-info {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.std-option-info strong {
  color: var(--text-2);
  font-size: 10px;
  font-weight: 600;
}

.std-option-info span {
  overflow: hidden;
  color: var(--faint);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.std-option-year {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
}

.std-option-check {
  color: color-mix(in srgb, var(--accent) 70%, #ffffff);
  opacity: 0;
}

.std-option.active .std-option-check {
  opacity: 1;
}

.btn-compile {
  height: 29px;
  padding: 0 9px;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
}

.btn-compile:hover {
  background: rgba(148, 163, 184, 0.06);
  color: var(--text-2);
}

.btn-run {
  position: relative;
  height: 30px;
  padding: 0 10px;
  overflow: hidden;
  border: 0;
  background: linear-gradient(120deg, var(--accent-deep), var(--accent) 48%, var(--accent-2));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.12) inset, 0 8px 22px -10px rgba(var(--accent-rgb), 0.9);
}

.btn-run:hover {
  background: linear-gradient(120deg, var(--accent-2), var(--accent) 50%, var(--accent-deep));
  color: #fff;
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.16) inset, 0 10px 28px -10px rgba(var(--accent-rgb), 1);
  transform: translateY(-1px);
}

.btn-run.is-running {
  background: linear-gradient(120deg, #be123c, #e11d48);
  box-shadow: 0 8px 22px -10px rgba(225, 29, 72, 0.8);
}

.btn-run kbd {
  height: 15px;
  margin-left: 2px;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.65);
  font-size: 7px;
}

.btn-run-glow {
  position: absolute;
  top: -50%;
  left: -20%;
  width: 40%;
  height: 200%;
  background: rgba(255, 255, 255, 0.18);
  filter: blur(9px);
  transform: rotate(18deg) translateX(-160%);
  transition: transform 0.6s var(--ease);
}

.btn-run:hover .btn-run-glow {
  transform: rotate(18deg) translateX(430%);
}

.run-icon {
  width: 12px;
  height: 12px;
}

.run-icon.is-loading {
  display: block;
  width: 11px;
  height: 11px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.run-icon.is-loading svg {
  display: none;
}

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

/* ── Editor ───────────────────────────────────────────────── */
.editor-area {
  position: relative;
  flex: 1;
  min-height: 0;
  background: transparent;
}

#editor {
  position: absolute;
  inset: 0;
}

.monaco-editor,
.monaco-editor-background,
.monaco-editor .margin {
  background-color: rgba(9, 13, 24, 0.76) !important;
}

.monaco-editor .scroll-decoration {
  box-shadow: 0 6px 10px -8px rgba(0, 0, 0, 0.8) !important;
}

.monaco-editor .suggest-widget,
.monaco-editor .parameter-hints-widget {
  border-color: rgba(148, 163, 184, 0.14) !important;
  background: #0d1321 !important;
  box-shadow: 0 18px 45px -12px rgba(0, 0, 0, 0.8) !important;
}

.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused {
  background-color: rgba(var(--accent-rgb), 0.14) !important;
}

.monaco-editor .monaco-hover {
  border-color: rgba(148, 163, 184, 0.14) !important;
  background: #0d1321 !important;
}

.monaco-editor .cursors-layer .cursor {
  box-shadow: 0 0 6px rgba(var(--accent2-rgb), 0.45);
}

.editor-corner {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.2s;
}

.editor-area:hover .editor-corner {
  opacity: 1;
}

.editor-corner-btn {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(13, 18, 31, 0.72);
  color: var(--muted);
  backdrop-filter: blur(8px);
}

.editor-corner-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

/* ── IO panel ─────────────────────────────────────────────── */
.panel-resizer {
  position: relative;
  z-index: 10;
  display: flex;
  height: 6px;
  flex: none;
  align-items: center;
  justify-content: center;
  cursor: ns-resize;
  background: transparent;
}

.panel-resizer::before {
  content: '';
  position: absolute;
  inset: 0;
  border-top: 1px solid var(--line);
}

.panel-resizer span {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 3px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.2);
  transition: background 0.2s, box-shadow 0.2s;
}

.panel-resizer:hover span {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.6);
}

.io-panel {
  display: flex;
  height: var(--io-height);
  flex: none;
  flex-direction: column;
  overflow: hidden;
  background: rgba(7, 10, 18, 0.55);
  transition: height 0.28s var(--ease);
}

.io-panel.collapsed {
  height: 37px;
}

.io-panel.collapsed .io-grid {
  display: none;
}

.io-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  flex: none;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 24, 0.7);
}

.io-head-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.io-title-icon {
  color: var(--accent-2);
}

.io-title {
  color: var(--text-2);
  font-size: 10px;
  font-weight: 600;
}

.run-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--faint);
  font-size: 8px;
}

.run-state i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--faint);
}

.run-state[data-state='running'] {
  border-color: rgba(var(--accent2-rgb), 0.2);
  color: #67e8f9;
}

.run-state[data-state='running'] i {
  background: var(--accent-2);
  box-shadow: 0 0 6px rgba(var(--accent2-rgb), 0.7);
  animation: soft-pulse 1s infinite;
}

.run-state[data-state='success'] {
  border-color: rgba(52, 211, 153, 0.18);
  color: #6ee7b7;
}

.run-state[data-state='success'] i {
  background: var(--green);
}

.run-state[data-state='error'] {
  border-color: rgba(251, 113, 133, 0.18);
  color: #fda4af;
}

.run-state[data-state='error'] i {
  background: var(--red);
}

.io-head-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.io-grid {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.4fr);
}

.io-pane {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}

.stdin-pane {
  border-right: 1px solid var(--line);
  background: rgba(6, 9, 16, 0.38);
}

.tests-pane {
  border-right: 1px solid var(--line);
  background: rgba(6, 9, 16, 0.38);
}

.test-pane-body {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding: 8px 10px;
}

.tests-pane .test-case-body {
  grid-template-columns: 1fr;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 31px;
  flex: none;
  padding: 0 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}

.pane-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pane-label span {
  color: var(--muted);
}

.pane-head-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pane-meta {
  color: var(--faint);
  font-size: 7.5px;
}

#stdinInput {
  width: 100%;
  min-height: 0;
  flex: 1;
  resize: none;
  padding: 10px 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #a5f3fc;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.65;
  tab-size: 4;
  user-select: text;
}

#stdinInput::placeholder {
  color: rgba(86, 100, 124, 0.62);
}

#stdinInput::selection {
  background: rgba(var(--accent2-rgb), 0.22);
}

.pane-foot {
  flex: none;
  padding: 5px 11px;
  border-top: 1px solid rgba(148, 163, 184, 0.05);
  color: rgba(86, 100, 124, 0.7);
  font-family: var(--font-mono);
  font-size: 7px;
}

.output-pane {
  background: rgba(5, 8, 14, 0.32);
}

.out-tabs {
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 2px;
}

.out-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  color: var(--faint);
  font-size: 8.5px;
  font-weight: 500;
  transition: color 0.2s;
}

.out-tab:hover {
  color: var(--text-2);
}

.out-tab.active {
  color: var(--text-2);
}

.out-tab.active::after {
  content: '';
  position: absolute;
  right: 7px;
  bottom: -1px;
  left: 7px;
  height: 1.5px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 13px;
  height: 13px;
  padding: 0 3px;
  border-radius: 99px;
  background: rgba(251, 113, 133, 0.13);
  color: #fda4af;
  font-size: 7px;
  font-weight: 600;
}

.tab-count.warn {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
}

.exit-badge {
  padding: 2px 6px;
  border: 1px solid rgba(52, 211, 153, 0.18);
  border-radius: 99px;
  background: rgba(52, 211, 153, 0.07);
  color: #6ee7b7;
  font-family: var(--font-mono);
  font-size: 7.5px;
}

.exit-badge.fail {
  border-color: rgba(251, 113, 133, 0.2);
  background: rgba(251, 113, 133, 0.07);
  color: #fda4af;
}

.out-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.out-view {
  display: none;
  min-height: 100%;
  padding: 10px 12px;
}

.out-view.active {
  display: block;
}

/* ── 测试点（样例评测） ── */

.tests-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.tests-bar .pane-meta {
  margin-left: auto;
}

.test-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-case {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--card);
}

.test-case.active {
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.18);
}

.test-case.dropping {
  border-style: dashed;
}

.test-field textarea.dragging {
  border-color: rgba(96, 165, 250, 0.75);
  background: rgba(96, 165, 250, 0.1);
}

.test-case.running {
  border-color: rgba(96, 165, 250, 0.5);
}

.test-case.ac {
  border-color: rgba(52, 211, 153, 0.42);
  background: rgba(52, 211, 153, 0.08);
}

.test-case.wa,
.test-case.re,
.test-case.tle,
.test-case.ce {
  border-color: rgba(251, 113, 133, 0.42);
  background: rgba(251, 113, 133, 0.07);
}

.test-case-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.test-index {
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 0.04em;
}

.test-name {
  flex: 1 1 140px;
  min-width: 90px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
}

.test-name:hover {
  border-color: var(--line-strong);
}

.test-name:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.5);
  background: var(--bg-deep);
}

.test-badge {
  padding: 2px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.test-badge.running {
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.45);
}

.test-badge.ac {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.12);
}

.test-badge.wa,
.test-badge.re,
.test-badge.tle,
.test-badge.ce {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.12);
}

.test-case-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.test-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.test-field span {
  font-size: 11px;
  color: var(--muted);
}

.test-field textarea {
  min-height: 62px;
  max-height: 180px;
  resize: vertical;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg-deep);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
  font-size: 12px;
  line-height: 1.55;
}

.test-field textarea:focus {
  outline: none;
  border-color: rgba(96, 165, 250, 0.5);
}

.test-case-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.test-detail {
  color: var(--muted);
  font-size: 11.5px;
}

.test-out {
  max-height: 130px;
  margin: 0;
  padding: 6px 9px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-deep);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
  font-size: 11.5px;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .test-case-body {
    grid-template-columns: 1fr;
  }
}

.output-empty {
  display: flex;
  min-height: 158px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--faint);
  text-align: center;
}

.output-empty.compact {
  min-height: 130px;
}

.empty-icon {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 3px;
  place-items: center;
  border: 1px dashed rgba(148, 163, 184, 0.16);
  border-radius: 9px;
  color: rgba(var(--accent2-rgb), 0.5);
}

.output-empty strong {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 500;
}

.output-empty span {
  max-width: 260px;
  font-size: 8.5px;
  line-height: 1.6;
}

.output-empty kbd {
  height: 14px;
  min-width: 14px;
  margin: 0 1px;
  font-size: 7px;
}

.terminal-output {
  min-height: 100%;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.7;
  user-select: text;
}

.terminal-command {
  margin-bottom: 6px;
  color: rgba(148, 163, 184, 0.4);
  font-size: 8px;
}

.terminal-command::before {
  content: '❯ ';
  color: rgba(var(--accent2-rgb), 0.65);
}

.stdout,
.stderr {
  margin: 0;
  color: #d9e3f5;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

.stderr {
  margin-top: 6px;
  color: #fda4af;
}

.stderr:empty {
  display: none;
}

.terminal-meta {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed rgba(148, 163, 184, 0.08);
  color: var(--faint);
  font-size: 7.5px;
}

.compiler-log {
  margin: 0;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
}

.compiler-log .log-error {
  color: #fda4af;
}

.compiler-log .log-warning {
  color: #fcd34d;
}

.compiler-log .log-note {
  color: #67e8f9;
}

.compiler-log .log-dim {
  color: var(--faint);
}

.problem-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.problem-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  width: 100%;
  padding: 6px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.problem-item:hover {
  border-color: var(--line);
  background: rgba(148, 163, 184, 0.04);
}

.problem-item .severity {
  width: 4px;
  height: 4px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px rgba(251, 113, 133, 0.5);
}

.problem-item.warning .severity {
  background: var(--amber);
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
}

.problem-text {
  min-width: 0;
  flex: 1;
}

.problem-text strong {
  display: block;
  overflow: hidden;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.problem-loc {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 7.5px;
}

/* ── Statusbar ────────────────────────────────────────────── */
.statusbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 27px;
  flex: none;
  padding: 0 12px;
  border-top: 1px solid var(--line);
  background: rgba(7, 10, 18, 0.68);
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.01em;
  backdrop-filter: blur(14px);
}

.status-left,
.status-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.status-brand {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-weight: 700;
  font-size: 7.5px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.status-brand i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.7);
}

.status-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.status-button {
  padding: 2px 4px;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}

.status-button:hover {
  background: rgba(148, 163, 184, 0.07);
  color: var(--text-2);
}

.status-network {
  color: rgba(52, 211, 153, 0.65);
}

.status-network i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 5px rgba(52, 211, 153, 0.6);
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 5, 10, 0.68);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  position: relative;
  width: min(720px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--accent-rgb), 0.11), transparent 42%),
    radial-gradient(circle at 0% 100%, rgba(var(--accent2-rgb), 0.06), transparent 40%),
    #0b101b;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  transform: translateY(14px) scale(0.97);
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

.modal-backdrop.open .modal-card {
  transform: none;
  opacity: 1;
}

.modal-card.wide {
  width: min(960px, 94vw);
}

.modal-card.narrow {
  width: min(440px, 92vw);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
}

.modal-eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.modal-title {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.modal-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.modal-section {
  margin-top: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 22px;
}

.modal-actions .btn {
  height: 35px;
  padding: 0 14px;
}

.modal-actions-spread {
  align-items: center;
  justify-content: space-between;
}

.modal-actions-left {
  display: flex;
  gap: 6px;
}

.modal-actions-spread .btn {
  height: 33px;
}

.field-label {
  display: block;
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.text-input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  background: rgba(5, 8, 14, 0.6);
  color: var(--text);
  font-size: 12px;
  user-select: text;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.text-input:focus {
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.09);
}

.file-type-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.file-type {
  flex: 1;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.04);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  transition: all 0.2s;
}

.file-type:hover {
  border-color: var(--line-strong);
  color: var(--text-2);
}

.file-type.active {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.1);
  color: #ddd6fe;
}

/* Modal: check-in */
.checkin-modal-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  overflow: hidden;
  margin-top: 18px;
  padding: 20px;
  border: 1px solid rgba(251, 146, 60, 0.18);
  border-radius: 14px;
  background:
    radial-gradient(circle at 90% 0%, rgba(251, 146, 60, 0.18), transparent 45%),
    linear-gradient(140deg, rgba(35, 22, 28, 0.8), rgba(12, 16, 28, 0.7));
}

.checkin-modal-streak {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.checkin-modal-streak b {
  color: #fff7ed;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
}

.checkin-modal-streak span {
  color: rgba(253, 186, 116, 0.65);
  font-size: 11px;
}

.checkin-modal-hero p {
  margin: 6px 0 0;
  color: rgba(253, 186, 116, 0.52);
  font-size: 9px;
}

.checkin-modal-reward {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.checkin-modal-reward b {
  color: #fcd34d;
  font-size: 22px;
  font-weight: 700;
}

.checkin-modal-reward span {
  color: var(--faint);
  font-size: 8px;
}

.checkin-modal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin-top: 14px;
}

.checkin-modal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 9px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.025);
}

.checkin-modal-day .dot {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 50%;
  color: var(--faint);
  font-size: 8px;
}

.checkin-modal-day.checked .dot {
  border-color: rgba(251, 146, 60, 0.4);
  background: rgba(251, 146, 60, 0.18);
  color: #fed7aa;
}

.checkin-modal-day.today .dot {
  outline: 1px solid rgba(253, 186, 116, 0.5);
  outline-offset: 2px;
}

.checkin-modal-day span {
  color: var(--faint);
  font-size: 7.5px;
}

.reward-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 14px;
}

.reward-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 9px;
}

.reward-row b {
  margin-left: auto;
  color: #fcd34d;
  font-family: var(--font-mono);
  font-size: 8.5px;
}

.reward-row.today {
  border-color: rgba(251, 146, 60, 0.2);
  background: rgba(251, 146, 60, 0.05);
}

/* Modal: achievements gallery */
.achievement-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 20px;
}

.gallery-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 18, 31, 0.4);
}

.gallery-card.locked {
  opacity: 0.45;
  filter: saturate(0.35);
}

.gallery-card[data-tier='rare'] {
  border-color: rgba(var(--accent2-rgb), 0.14);
}

.gallery-card[data-tier='epic'] {
  border-color: rgba(var(--accent-rgb), 0.18);
}

.gallery-card[data-tier='legendary'] {
  border-color: rgba(251, 191, 36, 0.2);
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.035), rgba(13, 18, 31, 0.4));
}

.gallery-medal {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.07);
  color: var(--muted);
}

.gallery-card[data-tier='rare'] .gallery-medal {
  background: rgba(var(--accent2-rgb), 0.1);
  color: #67e8f9;
}

.gallery-card[data-tier='epic'] .gallery-medal {
  background: rgba(var(--accent-rgb), 0.13);
  color: color-mix(in srgb, var(--accent) 40%, #ffffff);
}

.gallery-card[data-tier='legendary'] .gallery-medal {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
}

.gallery-info {
  min-width: 0;
  flex: 1;
}

.gallery-info strong {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
}

.gallery-info p {
  margin: 3px 0 0;
  color: var(--faint);
  font-size: 8.5px;
  line-height: 1.5;
}

.gallery-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  color: var(--faint);
  font-size: 7.5px;
}

.gallery-meta .xp {
  color: var(--amber);
  font-family: var(--font-mono);
}

.tier-badge {
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--faint);
  font-size: 6.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Modal: profile */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 18px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background:
    radial-gradient(circle at 0% 0%, rgba(var(--accent-rgb), 0.13), transparent 45%),
    rgba(13, 18, 31, 0.4);
}

.profile-avatar {
  display: grid;
  width: 60px;
  height: 60px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent) 55%, var(--accent-2));
  color: #fff;
  font-size: 23px;
  font-weight: 700;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.08), 0 8px 24px rgba(var(--accent-rgb), 0.3);
}

.profile-hero-info {
  min-width: 0;
  flex: 1;
}

.profile-hero-info h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.profile-hero-info p {
  margin: 3px 0 0;
  color: var(--faint);
  font-size: 8.5px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 12px;
}

.profile-stat {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 18, 31, 0.4);
}

.profile-stat b {
  display: block;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.profile-stat span {
  color: var(--faint);
  font-size: 7.5px;
}

/* Modal: shortcuts */
.shortcut-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 24px;
  margin-top: 18px;
}

.shortcut-modal-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.shortcut-modal-row kbd {
  height: 19px;
  color: var(--text-2);
}

.shortcut-modal-row span {
  margin-left: auto;
  color: var(--muted);
  font-size: 9px;
}

/* ── Toast ────────────────────────────────────────────────── */
.toast-stack {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 800;
  display: flex;
  width: 330px;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  overflow: hidden;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(11, 16, 28, 0.96);
  box-shadow: 0 18px 50px -14px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateX(18px) scale(0.98);
  animation: toast-in 0.36s var(--ease) forwards;
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.toast.is-out {
  animation: toast-out 0.3s var(--ease) forwards;
}

@keyframes toast-in {
  to { opacity: 1; transform: none; }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(24px) scale(0.97); }
}

.toast-icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: none;
  place-items: center;
  border-radius: 7px;
  background: rgba(var(--accent-rgb), 0.12);
  color: color-mix(in srgb, var(--accent) 40%, #ffffff);
}

.toast.success .toast-icon {
  background: rgba(52, 211, 153, 0.1);
  color: #6ee7b7;
}

.toast.error .toast-icon {
  background: rgba(251, 113, 133, 0.1);
  color: #fda4af;
}

.toast.achievement {
  border-color: rgba(251, 191, 36, 0.22);
  background:
    radial-gradient(circle at 100% 0%, rgba(251, 191, 36, 0.1), transparent 45%),
    rgba(11, 16, 28, 0.97);
}

.toast.achievement .toast-icon {
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
}

.toast-content {
  min-width: 0;
  flex: 1;
}

.toast-title {
  color: var(--text);
  font-size: 10px;
  font-weight: 600;
}

.toast-desc {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.5;
}

.toast-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: rgba(148, 163, 184, 0.08);
}

.toast-progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform-origin: left;
  animation: toast-progress var(--duration, 4s) linear forwards;
}

@keyframes toast-progress {
  to { transform: scaleX(0); }
}

/* ── Confetti ─────────────────────────────────────────────── */
.confetti {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0;
}

.confetti.active {
  opacity: 1;
}

/* ── Focus mode ───────────────────────────────────────────── */
body.focus-mode .rail,
body.focus-mode .sidebar,
body.focus-mode .statusbar,
body.focus-mode .titlebar,
body.focus-mode .workbench-top {
  display: none !important;
}

body.focus-mode .shell {
  grid-template-columns: minmax(0, 1fr);
}

body.focus-mode .app {
  height: 100dvh;
}

body.focus-mode .editor-corner {
  opacity: 1;
}

body.focus-mode .workbench {
  border-radius: 0;
}

/* ── Small additive states ────────────────────────────────── */
.file-row,
.calendar-day {
  cursor: pointer;
}

.std-chip {
  cursor: pointer;
}

.btn:disabled,
.checkin-big:disabled {
  opacity: 0.45;
  transform: none;
}

.checkin-big:disabled {
  cursor: not-allowed;
}

.modal-error {
  min-height: 16px;
  margin-top: 8px;
  color: #fda4af;
  font-size: 9px;
  line-height: 1.5;
}

.icon-btn.rotated > span {
  transform: rotate(180deg);
}

.log-success {
  color: #6ee7b7;
}

.stdout.muted {
  color: var(--faint);
}

.xp-widget.xp-pop {
  animation: xp-pop 0.62s var(--ease);
}

@keyframes xp-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.08); border-color: rgba(var(--accent-rgb), 0.6); box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.25); }
  100% { transform: scale(1); }
}

body.is-resizing {
  cursor: ns-resize;
  user-select: none;
}

body.is-resizing * {
  cursor: ns-resize !important;
}

/* 拖动分隔条期间不要走展开/收起动画，避免尺寸跟手延迟 */
body.is-resizing .io-panel {
  transition: none !important;
}

@media (min-width: 901px) {
  body.is-resizing[data-out-dock='left'],
  body.is-resizing[data-out-dock='right'] { cursor: col-resize; }
  body.is-resizing[data-out-dock='left'] *,
  body.is-resizing[data-out-dock='right'] * { cursor: col-resize !important; }
}

.checkin-success {
  padding-top: 8px;
  text-align: center;
}

.success-burst {
  display: grid;
  width: 96px;
  height: 96px;
  margin: 6px auto 20px;
  place-items: center;
  border: 1px solid rgba(251, 146, 60, 0.22);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(251, 146, 60, 0.28), rgba(244, 63, 94, 0.08) 55%, transparent 70%);
  color: #fb923c;
  box-shadow: 0 0 46px rgba(251, 146, 60, 0.2);
  animation: success-pop 0.75s var(--ease) both;
}

@keyframes success-pop {
  0% { opacity: 0; transform: scale(0.45) rotate(-14deg); }
  65% { transform: scale(1.06) rotate(3deg); }
  100% { opacity: 1; transform: none; }
}

.checkin-success .modal-eyebrow {
  margin-bottom: 7px;
}

.checkin-success .modal-actions {
  justify-content: center;
}

.checkin-success-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 20px;
}

.checkin-success-stats > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 15px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 18, 31, 0.45);
}

.checkin-success-stats b {
  color: #fcd34d;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.checkin-success-stats span {
  color: var(--faint);
  font-size: 8px;
}

.weekly-bonus {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  padding: 9px;
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.06);
  color: #fcd34d;
  font-size: 9px;
}

/* ── Readability tuning ───────────────────────────────────── */
.eyebrow {
  font-size: 8.5px;
}

.file-row {
  font-size: 12px;
}

.file-name {
  font-size: 11.5px;
}

.compiler-state {
  font-size: 11px;
}

.compiler-detail {
  font-size: 10px;
  line-height: 1.5;
}

.compiler-foot {
  font-size: 8.5px;
  line-height: 1.45;
}

.std-chip {
  font-size: 8.5px;
  padding: 3px 6px;
}

.shortcut-title {
  font-size: 10px;
}

.shortcut-row {
  font-size: 9.5px;
}

.panel-hint {
  font-size: 9.5px;
}

.search-box input {
  font-size: 11px;
}

.snippet-item-name {
  font-size: 11px;
}

.snippet-item-desc {
  font-size: 9.5px;
}

.snippet-item-code {
  font-size: 8.5px;
}

.snippet-item-std {
  font-size: 7.5px;
}

.checkin-hero-top {
  font-size: 9px;
}

.today-date {
  font-size: 9px;
}

.streak-number small {
  font-size: 10px;
}

.week-label {
  font-size: 8px;
}

.stat-label {
  font-size: 8.5px;
}

.calendar-weekdays {
  font-size: 8px;
}

.calendar-day {
  font-size: 9px;
}

.checkin-hint {
  font-size: 8.5px;
}

.achievement-name {
  font-size: 11px;
}

.achievement-desc {
  font-size: 9px;
}

.achievement-xp {
  font-size: 8.5px;
}

.achievement-summary-text > span {
  font-size: 9px;
}

.leader-meta strong {
  font-size: 10px;
}

.leader-meta span {
  font-size: 8.5px;
}

.leader-score {
  font-size: 9.5px;
}

.lan-card p {
  font-size: 8.5px;
}

.setting-row strong {
  font-size: 10.5px;
}

.setting-row span {
  font-size: 8.5px;
}

.settings-title {
  font-size: 8.5px;
}

.settings-note {
  font-size: 8.5px;
}

.compiler-settings strong {
  font-size: 10px;
}

.compiler-settings span {
  font-size: 8.5px;
}

.statusbar {
  font-size: 9px;
}

.status-brand {
  font-size: 8px;
}

.tab-name {
  font-size: 10px;
}

.btn-compile {
  font-size: 10px;
}

.btn-run {
  font-size: 10.5px;
}

.std-trigger {
  font-size: 10px;
}

.std-option-info strong {
  font-size: 10.5px;
}

.std-option-info span {
  font-size: 8.5px;
}

.io-title {
  font-size: 10.5px;
}

.run-state {
  font-size: 8.5px;
}

.out-tab {
  font-size: 9px;
}

.pane-label {
  font-size: 8.5px;
}

.pane-meta {
  font-size: 8px;
}

#stdinInput {
  font-size: 10.5px;
}

.terminal-output {
  font-size: 10.5px;
}

.compiler-log {
  font-size: 10px;
}

.problem-text strong {
  font-size: 9px;
}

.problem-loc {
  font-size: 8px;
}

.toast-title {
  font-size: 10.5px;
}

.toast-desc {
  font-size: 9px;
}

.modal-subtitle {
  font-size: 11px;
}

.field-label {
  font-size: 9.5px;
}

.modal-eyebrow {
  font-size: 8.5px;
}

.gallery-info p {
  font-size: 9px;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1240px) {
  .shell {
    grid-template-columns: 58px 266px minmax(0, 1fr);
  }
  .brand {
    min-width: 176px;
  }
  .xp-track {
    width: 32px;
  }
  .brand-beta {
    display: none;
  }
}

@media (max-width: 1020px) {
  .shell {
    grid-template-columns: 56px 248px minmax(0, 1fr);
  }
  .xp-widget {
    display: none;
  }
  .sync-pill .sync-text {
    display: none;
  }
  .brand {
    min-width: 150px;
  }
  .brand-sub {
    display: none;
  }
  .project-pill {
    max-width: 190px;
  }
  .workbench-actions .btn-run kbd {
    display: none;
  }
  .status-right {
    gap: 8px;
  }
  .status-item:nth-child(4),
  .status-item:nth-child(5) {
    display: none;
  }
}

@media (max-width: 840px) {
  .titlebar {
    gap: 8px;
    padding: 0 10px;
    flex-basis: 56px;
  }
  .brand {
    min-width: 0;
  }
  .brand-text {
    display: none;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
  }
  .project-pill {
    max-width: 160px;
  }
  .checkin-label {
    display: none;
  }
  .checkin-quick {
    padding: 0 7px;
  }
  .shell {
    grid-template-columns: 52px minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    top: 56px;
    bottom: 27px;
    left: 52px;
    z-index: 90;
    width: min(310px, calc(100vw - 52px));
    border-right: 1px solid var(--line-strong);
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.5);
    transform: translateX(-105%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s var(--ease), opacity 0.28s;
  }
  body.sidebar-open .sidebar {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
  body.sidebar-collapsed .shell {
    grid-template-columns: 52px minmax(0, 1fr);
  }
  body.sidebar-collapsed .sidebar {
    transform: translateX(-105%);
  }
  body.sidebar-open .rail-btn.active {
    color: #ddd6fe;
  }
  .workbench-top {
    padding-right: 7px;
  }
  .btn-compile span:last-child {
    display: none;
  }
  .io-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 100px minmax(0, 1fr);
  }
  .stdin-pane,
  .tests-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .pane-foot {
    display: none;
  }
  .status-left .status-item:nth-child(2) {
    display: none;
  }
  .status-right .status-item:nth-child(1),
  .status-right .status-item:nth-child(2) {
    display: none;
  }
  .snippet-list,
  .achievement-list {
    max-height: none;
  }
}

@media (max-width: 560px) {
  .titlebar {
    gap: 5px;
  }
  .project-pill {
    display: none;
  }
  .sync-pill {
    display: none;
  }
  .checkin-quick b {
    display: inline-flex;
  }
  .workbench-actions {
    gap: 4px;
  }
  #compileBtn {
    display: none;
  }
  .std-trigger {
    padding: 0 6px;
  }
  .btn-run {
    padding: 0 9px;
  }
  .btn-run .run-label {
    display: inline;
  }
  .io-panel {
    height: 300px;
  }
  .status-left {
    display: none;
  }
  .statusbar {
    justify-content: flex-end;
  }
  .status-right {
    width: 100%;
    justify-content: flex-end;
    gap: 10px;
  }
  .toast-stack {
    right: 8px;
    left: 8px;
    width: auto;
  }
  .modal-card {
    padding: 22px 16px;
  }
  .achievement-gallery {
    grid-template-columns: 1fr;
  }
  .shortcut-modal-grid {
    grid-template-columns: 1fr;
  }
  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ═════════════════════════════════════════════════════════════════
   主题系统 · 白色 / 黑色背景
   html[data-theme='dark'] 为默认深色，html[data-theme='light'] 为浅色。
   浅色覆盖全部使用前缀提升优先级，基础深色规则不做改动。
   ═════════════════════════════════════════════════════════════════ */

/* ── 切换瞬间的柔和过渡（平时不产生额外开销） ───────────────── */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition:
    background-color 0.34s ease,
    background-image 0.34s ease,
    color 0.34s ease,
    border-color 0.34s ease,
    box-shadow 0.34s ease,
    fill 0.34s ease !important;
}

/* ── 浅色令牌 ─────────────────────────────────────────────── */
html[data-theme='light'] {
  color-scheme: light;
  --caret: #0f172a;
  --bg: #f6f7fa;
  --bg-deep: #eceff5;
  --bg-raised: #ffffff;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --card: rgba(255, 255, 255, 0.9);
  --card-solid: #ffffff;
  --line: rgba(15, 23, 42, 0.09);
  --line-strong: rgba(15, 23, 42, 0.16);
  --text: #12192a;
  --text-2: #2f3950;
  --muted: #5a6780;
  --faint: #7b879d;
  --accent: var(--accent-deep);
  --accent-deep: #6d28d9;
  --accent-2: var(--accent-2);
  --shadow: 0 18px 44px -18px rgba(15, 23, 42, 0.16);
}

html[data-theme='light'] ::selection {
  background: rgba(var(--accent-deep-rgb), 0.18);
  color: #1b1130;
}

html[data-theme='light'] :focus-visible {
  outline: 2px solid rgba(var(--accent-deep-rgb), 0.55);
}

html[data-theme='light'] ::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.16);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

html[data-theme='light'] ::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.28);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

html[data-theme='light'] kbd {
  border-color: rgba(15, 23, 42, 0.14);
  border-bottom-color: rgba(15, 23, 42, 0.24);
  background: rgba(15, 23, 42, 0.045);
  color: var(--muted);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

/* ── 环境光 / 网格 / 噪点 ─────────────────────────────────── */
html[data-theme='light'] .ambient-custom::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.86)),
    radial-gradient(ellipse at 50% 28%, transparent 10%, rgba(255, 255, 255, 0.55) 78%);
}

html[data-theme='light'] .ambient-grid {
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.055) 1px, transparent 1px);
}

html[data-theme='light'] .ambient-noise {
  opacity: 0.018;
  mix-blend-mode: multiply;
}

/* ── Splash ───────────────────────────────────────────────── */
html[data-theme='light'] .splash {
  background:
    radial-gradient(circle at 50% 42%, rgba(var(--accent-deep-rgb), 0.12), transparent 36%),
    radial-gradient(circle at 60% 66%, rgba(8, 145, 178, 0.08), transparent 40%),
    #f7f8fb;
}

html[data-theme='light'] .splash::after {
  background: radial-gradient(circle at 50% 50%, transparent 0 36%, rgba(247, 248, 251, 0.75) 80%);
}

html[data-theme='light'] .splash-wordmark {
  background: linear-gradient(100deg, #1c1533 0%, color-mix(in srgb, var(--accent-deep) 60%, #000000) 32%, var(--accent-deep) 62%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme='light'] .splash-grid {
  opacity: 0.5;
}

html[data-theme='light'] .splash-track i {
  box-shadow: 0 0 12px rgba(8, 145, 178, 0.45);
}

/* ── 登录页 ───────────────────────────────────────────────── */
html[data-theme='light'] .auth-screen {
  background:
    radial-gradient(circle at 22% 8%, rgba(var(--accent-deep-rgb), 0.1), transparent 34%),
    radial-gradient(circle at 82% 88%, rgba(8, 145, 178, 0.07), transparent 34%),
    rgba(247, 248, 251, 0.72);
}

html[data-theme='light'] .auth-kicker {
  color: #0e7490;
}

html[data-theme='light'] .auth-kicker i {
  box-shadow: 0 0 9px rgba(8, 145, 178, 0.5);
}

html[data-theme='light'] .auth-showcase h1 span {
  background: linear-gradient(100deg, #6d28d9, var(--accent-deep) 48%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme='light'] .auth-code-card {
  border-color: rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 60px -30px rgba(15, 23, 42, 0.28);
}

html[data-theme='light'] .auth-showcase-foot,
html[data-theme='light'] .auth-account-note,
html[data-theme='light'] .auth-panel-foot {
  color: rgba(15, 23, 42, 0.55);
}

html[data-theme='light'] .auth-account-note span:first-child {
  color: #0e7490;
}

html[data-theme='light'] .auth-panel {
  border-color: rgba(15, 23, 42, 0.12);
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--accent-deep-rgb), 0.08), transparent 44%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(246, 247, 250, 0.94));
  box-shadow: 0 30px 80px -30px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.7) inset;
}

html[data-theme='light'] .auth-panel::before {
  background: linear-gradient(90deg, transparent, rgba(var(--accent-deep-rgb), 0.55), rgba(8, 145, 178, 0.4), transparent);
}

html[data-theme='light'] .auth-secure {
  color: #047857;
}

html[data-theme='light'] .auth-secure i {
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

html[data-theme='light'] .auth-tabs {
  background: rgba(15, 23, 42, 0.04);
}

html[data-theme='light'] .auth-tab.active {
  background: linear-gradient(135deg, rgba(var(--accent-deep-rgb), 0.14), rgba(var(--accent-rgb), 0.08));
  color: color-mix(in srgb, var(--accent-deep) 60%, #000000);
  box-shadow: 0 0 0 1px rgba(var(--accent-deep-rgb), 0.2) inset;
}

html[data-theme='light'] .auth-input-wrap {
  background: rgba(255, 255, 255, 0.86);
  color: var(--faint);
}

html[data-theme='light'] .auth-input-wrap:focus-within {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(var(--accent-deep-rgb), 0.1);
}

html[data-theme='light'] .auth-input-wrap input::placeholder {
  color: rgba(15, 23, 42, 0.42);
}

html[data-theme='light'] .auth-busy {
  background: rgba(255, 255, 255, 0.9);
}

html[data-theme='light'] .auth-busy i {
  border-color: rgba(15, 23, 42, 0.14);
  border-top-color: var(--accent-deep);
  border-right-color: var(--accent-2);
}

/* ── 顶栏 / 侧栏 ──────────────────────────────────────────── */
html[data-theme='light'] .titlebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.74));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

html[data-theme='light'] .rail {
  background: rgba(255, 255, 255, 0.66);
}

html[data-theme='light'] .rail-btn.active {
  color: #5b21b6;
  background: linear-gradient(135deg, rgba(var(--accent-deep-rgb), 0.14), rgba(var(--accent-rgb), 0.05));
}

html[data-theme='light'] .rail-btn.active::before {
  box-shadow: 0 0 10px rgba(var(--accent-deep-rgb), 0.45);
}

html[data-theme='light'] .sidebar {
  background: rgba(255, 255, 255, 0.62);
}

html[data-theme='light'] body.sidebar-collapsed .chrome-btn {
  color: #6d28d9;
  border-color: rgba(var(--accent-deep-rgb), 0.22);
  background: rgba(var(--accent-deep-rgb), 0.07);
}

html[data-theme='light'] .compiler-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(8, 145, 178, 0.07), transparent 50%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(240, 244, 249, 0.86));
}

html[data-theme='light'] .compiler-foot span:first-child {
  color: #0e7490;
}

html[data-theme='light'] .shortcut-card {
  background: rgba(255, 255, 255, 0.86);
}

/* ── 代码片段 ─────────────────────────────────────────────── */
html[data-theme='light'] .search-box {
  background: rgba(255, 255, 255, 0.86);
  color: var(--faint);
}

html[data-theme='light'] .snippet-item {
  background: rgba(255, 255, 255, 0.82);
}

html[data-theme='light'] .snippet-item-icon {
  background: rgba(8, 145, 178, 0.08);
  color: var(--accent-2);
}

html[data-theme='light'] .panel-hint span:first-child {
  color: #0e7490;
}

/* ── 签到 ─────────────────────────────────────────────────── */
html[data-theme='light'] .checkin-hero {
  border-color: rgba(251, 146, 60, 0.28);
  background:
    radial-gradient(circle at 88% 10%, rgba(251, 146, 60, 0.16), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(244, 63, 94, 0.07), transparent 40%),
    linear-gradient(145deg, rgba(255, 252, 248, 0.95), rgba(255, 255, 255, 0.9));
}

html[data-theme='light'] .checkin-big.is-done {
  color: #047857;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(13, 148, 136, 0.1));
}

html[data-theme='light'] .stat-cell,
html[data-theme='light'] .calendar-card {
  background: rgba(255, 255, 255, 0.82);
}

/* ── 成就 / 排行榜 ────────────────────────────────────────── */
html[data-theme='light'] .achievement-summary {
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--accent-deep-rgb), 0.1), transparent 48%),
    rgba(255, 255, 255, 0.88);
}

html[data-theme='light'] .achievement-card {
  background: rgba(255, 255, 255, 0.82);
}

html[data-theme='light'] .achievement-card[data-tier='rare'] .achievement-medal {
  background: rgba(8, 145, 178, 0.1);
  color: #0e7490;
}

html[data-theme='light'] .leader-hero {
  border-color: rgba(var(--accent-deep-rgb), 0.2);
  background:
    radial-gradient(circle at 88% 0%, rgba(var(--accent-deep-rgb), 0.13), transparent 45%),
    rgba(255, 255, 255, 0.88);
}

html[data-theme='light'] .lan-card {
  background: rgba(255, 255, 255, 0.84);
}

/* ── 设置面板 ─────────────────────────────────────────────── */
html[data-theme='light'] .settings-group {
  background: rgba(255, 255, 255, 0.82);
}

html[data-theme='light'] .account-group {
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--accent-deep-rgb), 0.07), transparent 50%),
    rgba(255, 255, 255, 0.84);
}

html[data-theme='light'] .stepper {
  background: rgba(15, 23, 42, 0.05);
}

html[data-theme='light'] .compiler-settings-icon {
  background: rgba(8, 145, 178, 0.08);
  color: var(--accent-2);
}

html[data-theme='light'] .account-online {
  color: #047857;
}

html[data-theme='light'] .account-online i {
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

html[data-theme='light'] .bg-preview::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.5));
}

html[data-theme='light'] .bg-preview > span {
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.62);
  color: #3f4a5f;
}

html[data-theme='light'] .bg-swatch.active::before {
  background: var(--accent-deep);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), 0 0 8px rgba(var(--accent-deep-rgb), 0.55);
}

html[data-theme='light'] .range-input::-webkit-slider-thumb {
  border-color: #ffffff;
  background: var(--accent-deep);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.24), 0 0 8px rgba(var(--accent-deep-rgb), 0.35);
}

html[data-theme='light'] .range-input::-moz-range-thumb {
  border-color: #ffffff;
  background: var(--accent-deep);
}

/* ── 工作台 / 编辑器 ──────────────────────────────────────── */
html[data-theme='light'] .workbench {
  background: rgba(255, 255, 255, 0.22);
}

html[data-theme='light'] .workbench-top {
  background: rgba(255, 255, 255, 0.7);
}

html[data-theme='light'] .tab.active {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
}

html[data-theme='light'] .tab.active::after {
  box-shadow: 0 0 8px rgba(var(--accent-deep-rgb), 0.28);
}

html[data-theme='light'] .std-menu {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 48px -16px rgba(15, 23, 42, 0.24), 0 0 0 1px rgba(15, 23, 42, 0.03) inset;
}

html[data-theme='light'] .std-option-badge {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.045);
  color: var(--text-2);
}

html[data-theme='light'] .editor-corner-btn {
  background: rgba(255, 255, 255, 0.86);
}

html[data-theme='light'] .monaco-editor,
html[data-theme='light'] .monaco-editor-background,
html[data-theme='light'] .monaco-editor .margin {
  background-color: rgba(255, 255, 255, 0.92) !important;
}

html[data-theme='light'] .monaco-editor .scroll-decoration {
  box-shadow: 0 6px 10px -8px rgba(15, 23, 42, 0.18) !important;
}

html[data-theme='light'] .monaco-editor .suggest-widget,
html[data-theme='light'] .monaco-editor .parameter-hints-widget {
  border-color: rgba(15, 23, 42, 0.12) !important;
  background: #ffffff !important;
  box-shadow: 0 16px 40px -14px rgba(15, 23, 42, 0.22) !important;
}

html[data-theme='light'] .monaco-editor .monaco-hover {
  border-color: rgba(15, 23, 42, 0.12) !important;
  background: #ffffff !important;
}

html[data-theme='light'] .monaco-editor .cursors-layer .cursor {
  box-shadow: 0 0 4px rgba(8, 145, 178, 0.28);
}

/* ── 控制台 ───────────────────────────────────────────────── */
html[data-theme='light'] .io-panel {
  background: rgba(255, 255, 255, 0.64);
}

html[data-theme='light'] .io-head {
  background: rgba(255, 255, 255, 0.82);
}

html[data-theme='light'] .run-state[data-state='running'] {
  border-color: rgba(8, 145, 178, 0.24);
  color: #0369a1;
}

html[data-theme='light'] .run-state[data-state='running'] i {
  box-shadow: 0 0 6px rgba(8, 145, 178, 0.55);
}

html[data-theme='light'] .run-state[data-state='success'] {
  border-color: rgba(16, 185, 129, 0.24);
  color: #047857;
}

html[data-theme='light'] .stdin-pane,
html[data-theme='light'] .tests-pane {
  background: rgba(255, 255, 255, 0.7);
}

html[data-theme='light'] #stdinInput::placeholder {
  color: rgba(15, 23, 42, 0.4);
}

html[data-theme='light'] #stdinInput::selection {
  background: rgba(8, 145, 178, 0.22);
}

html[data-theme='light'] .pane-foot {
  color: rgba(15, 23, 42, 0.46);
}

html[data-theme='light'] .output-pane {
  background: rgba(255, 255, 255, 0.56);
}

html[data-theme='light'] .exit-badge {
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}

html[data-theme='light'] .empty-icon {
  border-color: rgba(15, 23, 42, 0.14);
  color: rgba(8, 145, 178, 0.55);
}

html[data-theme='light'] .terminal-command::before {
  color: var(--accent-2);
}

/* ── 状态栏 ───────────────────────────────────────────────── */
html[data-theme='light'] .statusbar {
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.6) inset;
}

html[data-theme='light'] .status-brand i {
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

html[data-theme='light'] .status-network {
  color: #047857;
}

html[data-theme='light'] .status-network i {
  box-shadow: 0 0 5px rgba(16, 185, 129, 0.45);
}

/* ── 弹窗 / 提示 ──────────────────────────────────────────── */
html[data-theme='light'] .modal-backdrop {
  background: rgba(15, 23, 42, 0.3);
}

html[data-theme='light'] .modal-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--accent-deep-rgb), 0.08), transparent 42%),
    radial-gradient(circle at 0% 100%, rgba(8, 145, 178, 0.05), transparent 40%),
    #ffffff;
  box-shadow: 0 36px 90px -28px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}

html[data-theme='light'] .text-input {
  background: rgba(255, 255, 255, 0.92);
}

html[data-theme='light'] .checkin-modal-hero {
  border-color: rgba(251, 146, 60, 0.28);
  background:
    radial-gradient(circle at 90% 0%, rgba(251, 146, 60, 0.16), transparent 45%),
    linear-gradient(140deg, rgba(255, 252, 247, 0.95), rgba(255, 255, 255, 0.92));
}

html[data-theme='light'] .gallery-card {
  background: rgba(255, 255, 255, 0.86);
}

html[data-theme='light'] .gallery-card[data-tier='rare'] {
  border-color: rgba(8, 145, 178, 0.24);
}

html[data-theme='light'] .gallery-card[data-tier='legendary'] {
  border-color: rgba(251, 191, 36, 0.34);
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.11), rgba(255, 255, 255, 0.9));
}

html[data-theme='light'] .gallery-card[data-tier='rare'] .gallery-medal {
  background: rgba(8, 145, 178, 0.1);
  color: #0e7490;
}

html[data-theme='light'] .profile-hero {
  background:
    radial-gradient(circle at 0% 0%, rgba(var(--accent-deep-rgb), 0.1), transparent 45%),
    rgba(255, 255, 255, 0.88);
}

html[data-theme='light'] .profile-stat {
  background: rgba(255, 255, 255, 0.86);
}

html[data-theme='light'] .toast {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 16px 42px -16px rgba(15, 23, 42, 0.24);
}

html[data-theme='light'] .toast.success .toast-icon {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}

html[data-theme='light'] .toast.achievement {
  border-color: rgba(251, 191, 36, 0.34);
  background:
    radial-gradient(circle at 100% 0%, rgba(251, 191, 36, 0.14), transparent 45%),
    rgba(255, 255, 255, 0.97);
}

html[data-theme='light'] .checkin-success-stats > div {
  background: rgba(255, 255, 255, 0.86);
}

html[data-theme='light'] .profile-avatar {
  box-shadow: 0 0 0 4px rgba(var(--accent-deep-rgb), 0.1), 0 8px 24px rgba(var(--accent-rgb), 0.26);
}

@media (max-width: 840px) {
  html[data-theme='light'] .sidebar {
    box-shadow: 24px 0 60px rgba(15, 23, 42, 0.16);
  }
}

/* ═════════════════════════════════════════════════════════════════
   新增控件：界面模式切换（深色 / 浅色）
   ═════════════════════════════════════════════════════════════════ */
.theme-segmented {
  display: flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
}

.theme-segmented button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.theme-segmented button svg {
  width: 12px;
  height: 12px;
}

.theme-segmented button:hover {
  color: var(--text-2);
  background: rgba(148, 163, 184, 0.12);
}

.theme-segmented button.is-active {
  color: var(--text);
  background: var(--card-solid);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(148, 163, 184, 0.22) inset;
}

html[data-theme='light'] .theme-segmented {
  background: rgba(15, 23, 42, 0.05);
}

html[data-theme='light'] .theme-segmented button.is-active {
  color: #5b21b6;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(var(--accent-deep-rgb), 0.26) inset;
}

.theme-mode-row {
  align-items: center;
}

/* 顶栏快速切换按钮 */
.theme-quick {
  color: var(--muted);
}

.theme-quick svg {
  transition: transform 0.34s var(--ease), opacity 0.2s;
}

.theme-quick:hover svg {
  transform: rotate(-18deg) scale(1.06);
}

html[data-theme='light'] .theme-quick {
  color: #b45309;
}

/* 背景色卡自适应数量 */
.bg-swatches {
  grid-template-columns: repeat(auto-fit, minmax(26px, 1fr));
}

.bg-swatch.active {
  border-color: rgba(var(--accent-rgb), 0.45);
}

html[data-theme='light'] .bg-swatch.active {
  border-color: rgba(var(--accent-deep-rgb), 0.55);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

/* ── 浅色下的强调文字（把深色主题里的浅色文字换成高对比度深色） ── */
html[data-theme='light'] .brand-name {
  color: #12192a;
}

html[data-theme='light'] .brand-name span {
  color: #6d28d9;
}

html[data-theme='light'] .brand-beta {
  border-color: rgba(var(--accent-deep-rgb), 0.3);
  background: rgba(var(--accent-deep-rgb), 0.07);
  color: #6d28d9;
}

html[data-theme='light'] .checkin-quick,
html[data-theme='light'] .checkin-quick b {
  color: #c2410c;
}

html[data-theme='light'] .xp-level b {
  color: #6d28d9;
}

html[data-theme='light'] .file-row.active {
  color: color-mix(in srgb, var(--accent-deep) 60%, #000000);
}

html[data-theme='light'] .file-icon {
  color: #0e7490;
}

html[data-theme='light'] .file-row.active .file-icon {
  color: #6d28d9;
}

html[data-theme='light'] .std-chip.active {
  color: #5b21b6;
}

html[data-theme='light'] .chip.active {
  color: #5b21b6;
}

html[data-theme='light'] .streak-number > span {
  color: #c2410c;
}

html[data-theme='light'] .week-day.checked .week-dot {
  color: #c2410c;
}

html[data-theme='light'] .week-day.today .week-label {
  color: #b45309;
}

html[data-theme='light'] .calendar-day.checked,
html[data-theme='light'] .calendar-day.today {
  color: #c2410c;
}

html[data-theme='light'] .achievement-card[data-tier='rare'] .achievement-medal {
  color: #0e7490;
}

html[data-theme='light'] .achievement-card[data-tier='epic'] .achievement-medal {
  color: #6d28d9;
}

html[data-theme='light'] .achievement-card[data-tier='legendary'] .achievement-medal {
  color: #b45309;
}

html[data-theme='light'] .leader-crown {
  color: #b45309;
}

html[data-theme='light'] .leader-rank,
html[data-theme='light'] .leader-score {
  color: #5b21b6;
}

html[data-theme='light'] .leader-xp b {
  color: #b45309;
}

html[data-theme='light'] .leader-row:nth-child(1) .leader-index {
  color: #b45309;
}

html[data-theme='light'] .leader-row:nth-child(2) .leader-index {
  color: #475569;
}

html[data-theme='light'] .leader-row:nth-child(3) .leader-index {
  color: #c2410c;
}

html[data-theme='light'] .lan-url {
  color: #0e7490;
}

html[data-theme='light'] .btn-danger {
  color: #b91c1c;
}

html[data-theme='light'] .btn-danger:hover {
  color: #991b1b;
}

html[data-theme='light'] .switch i {
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.06);
}

html[data-theme='light'] .range-value {
  color: #6d28d9;
}

html[data-theme='light'] .tab-icon {
  color: #0e7490;
}

html[data-theme='light'] .tab.active .tab-icon {
  color: #6d28d9;
}

html[data-theme='light'] .std-option.active .std-option-badge {
  color: #5b21b6;
}

html[data-theme='light'] .run-state[data-state='error'] {
  color: #b91c1c;
}

html[data-theme='light'] #stdinInput {
  color: #12192a;
}

html[data-theme='light'] .tab-count {
  color: #b91c1c;
}

html[data-theme='light'] .tab-count.warn {
  color: #b45309;
}

html[data-theme='light'] .exit-badge.fail {
  color: #b91c1c;
}

html[data-theme='light'] .stdout,
html[data-theme='light'] .stderr {
  color: #1f2a44;
}

html[data-theme='light'] .stderr {
  color: #b91c1c;
}

html[data-theme='light'] .compiler-log .log-error {
  color: #b91c1c;
}

html[data-theme='light'] .compiler-log .log-warning {
  color: #b45309;
}

html[data-theme='light'] .compiler-log .log-note {
  color: #0e7490;
}

html[data-theme='light'] .file-type.active {
  color: #5b21b6;
}

html[data-theme='light'] .checkin-modal-streak b {
  color: #c2410c;
}

html[data-theme='light'] .checkin-modal-reward b,
html[data-theme='light'] .reward-row b {
  color: #b45309;
}

html[data-theme='light'] .checkin-modal-day.checked .dot {
  color: #c2410c;
}

html[data-theme='light'] .gallery-card[data-tier='rare'] .gallery-medal {
  color: #0e7490;
}

html[data-theme='light'] .gallery-card[data-tier='epic'] .gallery-medal {
  color: #6d28d9;
}

html[data-theme='light'] .gallery-card[data-tier='legendary'] .gallery-medal {
  color: #b45309;
}

html[data-theme='light'] .toast-icon {
  color: #6d28d9;
}

html[data-theme='light'] .toast.error .toast-icon {
  color: #b91c1c;
}

html[data-theme='light'] .toast.achievement .toast-icon {
  color: #b45309;
}

html[data-theme='light'] .modal-error {
  color: #b91c1c;
}

html[data-theme='light'] .log-success {
  color: #047857;
}

html[data-theme='light'] .checkin-success-stats b,
html[data-theme='light'] .weekly-bonus {
  color: #b45309;
}

@media (max-width: 840px) {
  html[data-theme='light'] body.sidebar-open .rail-btn.active {
    color: #5b21b6;
  }
}

/* ── 登录页强调文字 ───────────────────────────────────────── */
html[data-theme='light'] .auth-brand-word {
  color: #12192a;
}

html[data-theme='light'] .auth-brand-word span {
  color: #6d28d9;
}

html[data-theme='light'] .auth-showcase h1 {
  color: #12192a;
}

html[data-theme='light'] .auth-feature-icon {
  color: #4338ca;
}

html[data-theme='light'] .auth-code-head > span:last-child {
  color: #6d28d9;
}

html[data-theme='light'] .auth-code-card code {
  color: #26324a;
}

html[data-theme='light'] .auth-code-card .tok-c {
  color: #6b7d99;
}

html[data-theme='light'] .auth-code-card .tok-k {
  color: var(--accent-deep);
}

html[data-theme='light'] .auth-code-card .tok-s {
  color: #0e7490;
}

html[data-theme='light'] .auth-code-card .tok-t {
  color: #0f766e;
}

html[data-theme='light'] .auth-code-card .tok-f {
  color: #1d4ed8;
}

html[data-theme='light'] .auth-code-card .tok-n {
  color: #b45309;
}

html[data-theme='light'] .auth-title {
  color: #12192a;
}

html[data-theme='light'] .auth-error {
  color: #b91c1c;
}

html[data-theme='light'] .auth-switch button {
  color: #6d28d9;
}

html[data-theme='light'] .auth-switch button:hover {
  color: color-mix(in srgb, var(--accent-deep) 60%, #000000);
}
/* ── 浅色细节补丁 ───────────────────────────────────────── */
html[data-theme='light'] .snippet-item-code {
  color: #6b7a90;
}

html[data-theme='light'] .snippet-item-desc {
  color: var(--muted);
}

html[data-theme='light'] .bg-swatch {
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme='light'] .bg-swatch.active {
  border-color: rgba(var(--accent-deep-rgb), 0.55);
}

html[data-theme='light'] .bg-preview {
  border-color: rgba(15, 23, 42, 0.12);
}
/* ── 浅色对比度补丁 2（弹窗 / 签到 / 成就 / 控件） ───────── */
html[data-theme='light'] .checkin-hero-top span {
  color: #b45309;
}

html[data-theme='light'] .checkin-hint {
  color: #a1662f;
}

html[data-theme='light'] .achievement-xp {
  color: #b45309;
}

html[data-theme='light'] .range-value {
  color: #6d28d9 !important;
}

html[data-theme='light'] .checkin-modal-streak span {
  color: #c2410c;
}

html[data-theme='light'] .checkin-modal-hero p {
  color: #a1662f;
}

html[data-theme='light'] .checkin-modal-reward span {
  color: #9a3412;
}

html[data-theme='light'] .btn:disabled {
  opacity: 0.9;
}

html[data-theme='light'] .btn.btn-run:disabled {
  background-image: none;
  background: rgba(var(--accent-deep-rgb), 0.13);
  border: 1px solid rgba(var(--accent-deep-rgb), 0.22);
  color: #6d28d9;
  opacity: 1;
}
/* ── 聊天系统 · 白色 / 黑色背景 ───────────────────────────── */
.rail-badge-count {
  top: 5px;
  right: 3px;
  width: auto;
  height: auto;
  min-width: 13px;
  padding: 0 3px;
  border-radius: 7px;
  color: #ffffff;
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  line-height: 13px;
  text-align: center;
  background: linear-gradient(135deg, var(--accent), var(--accent));
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.22);
}

.chat-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  padding: 0 14px 12px;
}

.chat-subhead {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.1);
}

.chat-tab {
  position: relative;
  padding: 5px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}

.chat-tab:hover {
  color: var(--text-2);
}

.chat-tab.is-active {
  color: #ffffff;
  background: linear-gradient(120deg, var(--accent), var(--accent));
  box-shadow: 0 8px 18px -12px rgba(var(--accent-rgb), 0.9);
}

.chat-tab-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 5px;
  vertical-align: 1px;
  border-radius: 50%;
  background: #fb923c;
}

.chat-tab-dot[hidden] {
  display: none;
}

.chat-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-family: inherit;
  font-size: 9px;
  cursor: pointer;
}

.chat-back[hidden] {
  display: none;
}

.chat-back:hover {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.35);
}

.chat-peers {
  display: flex;
  flex: none;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.chat-peers::-webkit-scrollbar {
  height: 4px;
}

.chat-peer {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  max-width: 128px;
  padding: 3px 9px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-2);
  font-family: inherit;
  font-size: 9px;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.chat-peer:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  transform: translateY(-1px);
}

.chat-peer i {
  display: grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.chat-peer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-peers-empty {
  color: var(--faint);
  font-size: 9px;
  line-height: 1.5;
}

.chat-thread {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
  padding: 12px 11px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 10px;
  pointer-events: none;
}

.chat-empty[hidden] {
  display: none;
}

.chat-empty span {
  color: var(--accent);
  opacity: 0.8;
}

.chat-day {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--faint);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.chat-day::before,
.chat-day::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  max-width: 100%;
}

.chat-row.is-mine {
  flex-direction: row-reverse;
}

.chat-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.chat-bubble {
  max-width: 78%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.12);
}

.chat-row.is-mine .chat-bubble {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: linear-gradient(120deg, rgba(var(--accent-rgb), 0.24), rgba(var(--accent2-rgb), 0.16));
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 8px;
}

.chat-meta b {
  color: var(--text-2);
  font-weight: 600;
}

.chat-row.is-mine .chat-meta {
  justify-content: flex-end;
}

.chat-bubble p {
  margin: 0;
  color: var(--text);
  font-size: 10.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-threads {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  overflow-y: auto;
}

.chat-threads[hidden] {
  display: none;
}

.chat-thread-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.07);
  color: var(--text-2);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.chat-thread-item:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.12);
}

.chat-thread-item i {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.chat-thread-item div {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.chat-thread-item strong {
  color: var(--text);
  font-size: 10px;
}

.chat-thread-item span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-unread {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fb923c;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.16);
}

.chat-threads-empty {
  padding: 26px 10px;
  color: var(--faint);
  font-size: 9.5px;
  text-align: center;
}

.chat-composer {
  flex: none;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-solid);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.chat-composer:focus-within {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.chat-composer.is-disabled {
  opacity: 0.6;
}

#chatInput {
  width: 100%;
  min-height: 42px;
  max-height: 104px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 10.5px;
  line-height: 1.5;
  outline: none;
  resize: none;
}

#chatInput::placeholder {
  color: var(--faint);
}

.chat-composer-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.chat-hint {
  flex: 1;
  color: var(--faint);
  font-size: 8px;
}

.chat-count {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
}

.chat-count.is-limit {
  color: #f59e0b;
}

.chat-send {
  height: 26px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 9.5px;
}

html[data-theme='light'] .rail-badge-count {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent-2));
  box-shadow: 0 0 0 2px rgba(var(--accent-deep-rgb), 0.16);
}

html[data-theme='light'] .chat-tabs {
  background: rgba(15, 23, 42, 0.045);
}

html[data-theme='light'] .chat-tab {
  color: #5a6780;
}

html[data-theme='light'] .chat-tab.is-active {
  color: #ffffff;
  background: linear-gradient(120deg, var(--accent-deep), var(--accent-2));
}

html[data-theme='light'] .chat-thread {
  background: rgba(255, 255, 255, 0.92);
}

html[data-theme='light'] .chat-bubble {
  border-color: rgba(15, 23, 42, 0.08);
  background: #f1f4f9;
}

html[data-theme='light'] .chat-row.is-mine .chat-bubble {
  border-color: rgba(var(--accent-deep-rgb), 0.25);
  background: linear-gradient(120deg, rgba(var(--accent-deep-rgb), 0.14), rgba(8, 145, 178, 0.12));
}

html[data-theme='light'] .chat-bubble p {
  color: #1f2a44;
}

html[data-theme='light'] .chat-meta {
  color: #5a6780;
}

html[data-theme='light'] .chat-meta b {
  color: #2f3950;
}

html[data-theme='light'] .chat-peer,
html[data-theme='light'] .chat-thread-item {
  background: #ffffff;
}

html[data-theme='light'] .chat-thread-item:hover {
  background: rgba(var(--accent-deep-rgb), 0.08);
}

html[data-theme='light'] .chat-thread-item strong {
  color: #12192a;
}

html[data-theme='light'] .chat-thread-item span {
  color: #5a6780;
}

html[data-theme='light'] .chat-composer {
  background: #ffffff;
}

html[data-theme='light'] #chatInput {
  color: #12192a;
}

/* 注册邮箱验证 */
.auth-send-code {
  position: static;
  width: auto;
  height: 26px;
  padding: 0 10px;
  margin-left: 4px;
  border-radius: 8px;
  border: 1px solid rgba(124, 92, 255, 0.35);
  background: rgba(124, 92, 255, 0.12);
  color: #c7bdff;
  font-size: 11px;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, opacity 0.18s ease;
}

.auth-send-code:hover:not(:disabled) {
  background: rgba(124, 92, 255, 0.22);
}

.auth-send-code:disabled {
  cursor: default;
  opacity: 0.55;
}

.auth-hint {
  margin: 6px 2px 0;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(148, 163, 184, 0.9);
}

html[data-theme='light'] .auth-send-code {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.1);
  color: #4338ca;
}

html[data-theme='light'] .auth-hint {
  color: #6b7a90;
}

/* 多项目选择 */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  margin: 12px 0 4px;
  overflow: auto;
}

.project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.project-item:hover {
  border-color: rgba(124, 92, 255, 0.4);
  background: rgba(124, 92, 255, 0.08);
}

.project-item.is-active {
  border-color: rgba(124, 92, 255, 0.6);
  background: rgba(124, 92, 255, 0.13);
}

.project-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.project-item-main strong {
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-item-main span {
  font-size: 10.5px;
  opacity: 0.55;
}

.project-item-state {
  flex: none;
  font-style: normal;
  font-size: 10px;
  opacity: 0.62;
}

.project-new-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-new-row .text-input {
  flex: 1;
}

html[data-theme='light'] .project-item {
  border-color: rgba(15, 23, 42, 0.09);
  background: rgba(248, 250, 252, 0.9);
  color: #1e293b;
}

html[data-theme='light'] .project-item.is-active {
  border-color: rgba(124, 92, 255, 0.55);
  background: rgba(124, 92, 255, 0.1);
}

html[data-theme='light'] .project-item-main span {
  color: #64748b;
  opacity: 1;
}

/* 首次进入 · Windows 客户端提示 */
.client-promo {
  position: fixed;
  inset: 0;
  z-index: 9200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 5, 10, 0.62);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s;
}

.client-promo.is-open {
  opacity: 1;
  visibility: visible;
}

.client-promo-card {
  position: relative;
  width: min(430px, 92vw);
  padding: 26px 26px 22px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--accent-rgb), 0.16), transparent 46%),
    linear-gradient(160deg, rgba(20, 24, 38, 0.98), rgba(9, 12, 20, 0.99));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  transform: translateY(10px) scale(0.985);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.client-promo.is-open .client-promo-card {
  transform: none;
}

.client-promo-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.client-promo-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.client-promo-eyebrow {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent-2);
  opacity: 0.85;
  margin-bottom: 8px;
}

.client-promo-card h3 {
  margin: 0 0 10px;
  font-size: 19px;
  line-height: 1.3;
  color: var(--text);
}

.client-promo-card p {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-dim);
}

.client-promo-card p strong {
  color: var(--text);
  font-weight: 600;
}

.client-promo-points {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.client-promo-points li {
  position: relative;
  padding-left: 16px;
  font-size: 12px;
  color: var(--text-dim);
}

.client-promo-points li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
  opacity: 0.85;
}

.client-promo-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-promo-actions .btn {
  flex: 1;
  justify-content: center;
}

.client-promo-hint {
  display: block;
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.75;
}

html[data-theme='light'] .client-promo {
  background: rgba(15, 23, 42, 0.28);
}

html[data-theme='light'] .client-promo-card {
  border-color: rgba(15, 23, 42, 0.1);
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 92, 255, 0.1), transparent 48%),
    linear-gradient(160deg, #ffffff, #f4f6fb);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

html[data-theme='light'] .client-promo-close:hover {
  background: rgba(15, 23, 42, 0.06);
}

/* 聊天二级密码弹层 */
.chat-gate {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-gate h3 {
  margin: 2px 0 0;
  font-size: 17px;
}

.chat-gate p {
  margin: 0 0 4px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-dim);
}

.chat-gate-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}

.chat-gate-field .text-input {
  width: 100%;
  font-size: 13px;
}

.chat-gate-error {
  font-size: 12px;
  color: #f87171;
}

html[data-theme='light'] .chat-gate-error {
  color: #c2410c;
}

.chat-gate-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.chat-gate-actions .btn {
  flex: 1;
  justify-content: center;
}

.chat-gate-link {
  align-self: flex-start;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 11.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.chat-gate-link:hover {
  color: var(--text);
}

/* ---- 测试点汇总 ---- */
.tests-pane #testFoot {
  font-size: 10px;
  letter-spacing: 0.02em;
  color: rgba(148, 163, 184, 0.78);
  transition: color 0.2s ease;
}

.tests-pane #testFoot.all-pass {
  color: #34d399;
  font-weight: 600;
}

/* ── 光标可见性（浅色模式下加深，避免白底看不见） ───────────── */
input,
textarea,
[contenteditable='true'] {
  caret-color: var(--caret, var(--accent-2));
}

html[data-theme='light'] .monaco-editor .cursors-layer .cursor {
  background-color: #0f172a !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7) !important;
}

html[data-theme='light'] .monaco-editor .cursors-layer .cursor-block {
  background-color: rgba(15, 23, 42, 0.28) !important;
}

/* 专注模式下保留测试点（输入 / 输出）面板 */
body.focus-mode .io-panel {
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}

/* ── 光标动画 / 闪烁 分段控件（设置面板内更紧凑） ───────────── */
.setting-row .cursor-segmented {
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px;
  padding: 2px;
}

.setting-row .cursor-segmented button {
  height: 22px;
  padding: 0 7px;
  font-size: 9.5px;
  letter-spacing: 0;
}

.download-actions{display:flex;align-items:center;gap:8px;}
.download-actions .download-btn{white-space:nowrap;}
.bg-color-chip{width:22px;height:22px;border-radius:50%;border:1px solid rgba(255,255,255,.28);box-shadow:inset 0 0 0 2px rgba(0,0,0,.18);background:#06080f;}
.bg-color-chip.custom{box-shadow:inset 0 0 0 2px rgba(0,0,0,.18),0 0 0 2px rgba(94,234,212,.55);}
.bg-wheel-wrap{display:flex;align-items:center;gap:16px;padding:4px 0 12px;}
#accentWheel,#bgWheel{width:128px;height:128px;border-radius:50%;flex:0 0 auto;cursor:crosshair;touch-action:none;box-shadow:0 0 0 1px rgba(255,255,255,.16),0 8px 22px rgba(0,0,0,.35);}
#accentWheel:focus-visible,#bgWheel:focus-visible{outline:2px solid rgba(94,234,212,.7);outline-offset:3px;}
.bg-wheel-side{flex:1 1 auto;display:flex;flex-direction:column;gap:8px;min-width:0;}
.bg-wheel-row{display:flex;align-items:center;justify-content:space-between;font-size:12px;opacity:.72;}
.bg-color-reset{align-self:flex-start;}
/* 控制台停靠到编辑器右侧 */
body[data-out-dock="right"] .workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6px var(--io-width, 380px);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "top top top"
    "editor resize panel";
}
body[data-out-dock="right"] .workbench-top { grid-area: top; align-self: start; }
body[data-out-dock="right"] .editor-area { grid-area: editor; min-height: 0; }
body[data-out-dock="right"] .panel-resizer {
  grid-area: resize;
  width: 6px;
  height: auto;
  cursor: col-resize;
}
body[data-out-dock="right"] .panel-resizer::before {
  inset: 0;
  border-top: 0;
  border-left: 1px solid var(--line);
}
body[data-out-dock="right"] .panel-resizer span { width: 3px; height: 34px; }
body[data-out-dock="right"] .io-panel {
  grid-area: panel;
  height: auto;
  width: 100%;
  min-height: 0;
  border-left: 1px solid var(--line);
  transition: width 0.28s var(--ease);
}
body[data-out-dock="right"] .io-panel.collapsed { height: auto; width: 38px; }
body[data-out-dock="right"] .io-panel.collapsed .io-head { padding: 0 6px; }
body[data-out-dock="right"] .io-panel.collapsed .io-head-left .io-title,
body[data-out-dock="right"] .io-panel.collapsed .io-head-left .run-state,
body[data-out-dock="right"] .io-panel.collapsed .io-head-actions .text-btn { display: none; }
body[data-out-dock="right"] .io-grid {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 44%) minmax(0, 1fr);
}
body[data-out-dock="right"] .tests-pane {
  border-right: 0;
  border-bottom: 1px solid var(--line);
}
body[data-out-dock="right"] .tests-pane .test-case-body { grid-template-columns: 1fr; }
@media (max-width: 900px) {
  body[data-out-dock="right"] .workbench {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) 6px auto;
    grid-template-areas:
      "top"
      "editor"
      "resize"
      "panel";
  }
  body[data-out-dock="right"] .panel-resizer { cursor: ns-resize; }
  body[data-out-dock="right"] .io-grid {
    grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.4fr);
    grid-template-rows: minmax(0, 1fr);
  }
}
@media (max-width: 900px) {
  body[data-out-dock="right"] .io-panel { width: 100%; height: var(--io-height, 258px); border-left: 0; }
  body[data-out-dock="right"] .io-panel.collapsed { width: 100%; height: 37px; }
}


/* ── 断点调试 ─────────────────────────────────────────── */
.nova-bp-dot {
  background: radial-gradient(circle at 50% 50%, #ff5a63 0 4.2px, rgba(255, 90, 99, 0.22) 4.6px 5.6px, transparent 6px);
}

.nova-debug-line {
  background: rgba(251, 191, 36, 0.16);
  border-left: 2px solid rgba(251, 191, 36, 0.75);
}

.nova-debug-arrow {
  width: 0;
  height: 0;
  margin: 5px 0 0 6px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid var(--amber);
}

.debug-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.debug-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.06);
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.debug-btn:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.13);
  color: var(--text);
}

.debug-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.debug-btn.danger:hover:not(:disabled) {
  border-color: rgba(251, 113, 133, 0.55);
  background: rgba(251, 113, 133, 0.12);
  color: #ffd6dc;
}

.debug-btn kbd {
  padding: 1px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(6, 8, 15, 0.5);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.3;
}

.debug-btn.primary {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.28), rgba(var(--accent2-rgb), 0.16));
  color: var(--text);
}

.debug-btn.is-stop {
  border-color: rgba(251, 113, 133, 0.6);
  background: rgba(251, 113, 133, 0.16);
  color: #ffe1e6;
}

.debug-status {
  margin-left: auto;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.debug-status[data-state="error"] {
  color: var(--red);
}

.debug-status[data-state="live"] {
  color: var(--amber);
}

.debug-status[data-state="done"] {
  color: var(--green);
}

.debug-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.debug-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(6, 8, 15, 0.42);
  overflow: hidden;
}

.debug-title {
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.debug-vars,
.debug-stack {
  max-height: 178px;
  padding: 6px 4px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
}

.debug-var {
  display: flex;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 5px;
}

.debug-var:hover {
  background: rgba(148, 163, 184, 0.08);
}

.debug-var-name {
  color: var(--accent-2);
}

.debug-var-value {
  color: var(--text);
  word-break: break-all;
}

.debug-frame {
  display: flex;
  gap: 8px;
  align-items: baseline;
  width: 100%;
  padding: 4px 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.debug-frame:hover {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--text);
}

.debug-frame.is-active {
  background: rgba(var(--accent-rgb), 0.22);
  color: var(--text);
}

.debug-frame-index {
  color: var(--faint);
}

.debug-frame-func {
  color: var(--amber);
}

.debug-frame-where {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.debug-out {
  margin: 10px;
}

.debug-out #debugStdout {
  max-height: 168px;
  padding: 8px 10px;
  overflow: auto;
}

.debug-var-eq {
  color: var(--faint);
}


/* 调色盘快捷入口 + 打开时高亮 */
.palette-quick {
  position: relative;
}

.palette-quick::after {
  content: '';
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--palette-current, var(--accent));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.bg-wheel-wrap.is-flash {
  animation: paletteFlash 1.5s var(--ease);
}

@keyframes paletteFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.55);
  }
  55% {
    box-shadow: 0 0 0 5px rgba(var(--accent-rgb), 0.16);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0);
  }
}




/* ── 调试时整个控制台切换为调试视图 ─────────────────────── */
body[data-debug-console='on'] .io-grid {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

body[data-debug-console='on'] .io-grid .tests-pane {
  display: none;
}

body[data-debug-console='on'] .output-pane .pane-head {
  display: none;
}

body[data-debug-console='on'] .output-pane {
  border-left: 0;
}

body[data-debug-console='on'] .out-view[data-out-view='debug'] {
  min-height: 100%;
}

body[data-debug-console='on'] .debug-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

body[data-debug-console='on'] .debug-toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
}

body[data-debug-console='on'] .debug-status {
  flex: 1 1 240px;
  text-align: left;
}

@media (max-width: 900px) {
  body[data-debug-console='on'] .debug-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 调试变量里的数组 / 类型标记 */
.debug-var-type {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 0 5px;
  border: 1px solid rgba(var(--accent-rgb), 0.34);
  border-radius: 999px;
  font-size: 10px;
  line-height: 16px;
  color: color-mix(in srgb, var(--accent-2) 78%, var(--text) 22%);
  background: rgba(var(--accent-rgb), 0.08);
  word-break: break-all;
}

.debug-var.is-array .debug-var-value {
  color: #7ee2b8;
}

/* 数组变量：名称/类型一行，元素值独占下一行 */
.debug-var.is-array {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  grid-template-areas:
    'name eq type'
    'value value value';
  align-items: start;
  row-gap: 2px;
}

.debug-var.is-array .debug-var-name { grid-area: name; }
.debug-var.is-array .debug-var-eq { grid-area: eq; }
.debug-var.is-array .debug-var-type { grid-area: type; justify-self: start; }
.debug-var.is-array .debug-var-value { grid-area: value; }

body[data-debug-console='on'] .debug-vars,
body[data-debug-console='on'] .debug-stack {
  max-height: 300px;
}

/* ── 控制台停靠左侧 ───────────────────────────────────── */
body[data-out-dock='left'] .workbench {
  display: grid;
  grid-template-columns: var(--io-width, 380px) 6px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    'top top top'
    'panel resize editor';
}

body[data-out-dock='left'] .workbench-top { grid-area: top; align-self: start; }
body[data-out-dock='left'] .editor-area { grid-area: editor; min-height: 0; }
body[data-out-dock='left'] .panel-resizer {
  grid-area: resize;
  width: 6px;
  height: auto;
  cursor: col-resize;
}
body[data-out-dock='left'] .panel-resizer::before {
  inset: 0;
  border-top: 0;
  border-right: 1px solid var(--line);
}
body[data-out-dock='left'] .panel-resizer span { width: 3px; height: 34px; }
body[data-out-dock='left'] .io-panel {
  grid-area: panel;
  height: auto;
  width: 100%;
  min-height: 0;
  border-right: 1px solid var(--line);
}
body[data-out-dock='left'] .io-grid {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 44%) minmax(0, 1fr);
}
body[data-out-dock='left'] .tests-pane {
  border-right: 0;
  border-bottom: 1px solid var(--line);
}
body[data-out-dock='left'] .tests-pane .test-case-body { grid-template-columns: 1fr; }

/* 侧边收起：真正收成一条竖栏，不留空白列 */
body[data-out-dock='right'][data-io-collapsed='on'] .workbench {
  grid-template-columns: minmax(0, 1fr) 6px 38px;
}
body[data-out-dock='left'][data-io-collapsed='on'] .workbench {
  grid-template-columns: 38px 6px minmax(0, 1fr);
}
body[data-out-dock='right'][data-io-collapsed='on'] .panel-resizer,
body[data-out-dock='left'][data-io-collapsed='on'] .panel-resizer {
  cursor: col-resize;
  opacity: 0.55;
}
body[data-out-dock='right'][data-io-collapsed='on'] .io-panel,
body[data-out-dock='left'][data-io-collapsed='on'] .io-panel {
  height: auto;
}
body[data-out-dock='right'] .io-panel.collapsed,
body[data-out-dock='left'] .io-panel.collapsed {
  width: 38px;
}
body[data-out-dock='right'] .io-panel.collapsed .io-head,
body[data-out-dock='left'] .io-panel.collapsed .io-head {
  justify-content: center;
  padding: 0 6px;
}
body[data-out-dock='right'] .io-panel.collapsed .io-title-icon,
body[data-out-dock='left'] .io-panel.collapsed .io-title-icon,
body[data-out-dock='right'] .io-panel.collapsed .io-title,
body[data-out-dock='left'] .io-panel.collapsed .io-title,
body[data-out-dock='right'] .io-panel.collapsed .run-state,
body[data-out-dock='left'] .io-panel.collapsed .run-state,
body[data-out-dock='right'] .io-panel.collapsed .io-head-actions .text-btn,
body[data-out-dock='left'] .io-panel.collapsed .io-head-actions .text-btn {
  display: none;
}

/* 侧边的收起箭头朝向编辑器 */
body[data-out-dock='right'] .icon-btn.rotated > span { transform: rotate(90deg); }
body[data-out-dock='left'] .icon-btn.rotated > span { transform: rotate(-90deg); }

@media (max-width: 900px) {
  body[data-out-dock='left'] .workbench {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) 6px auto;
    grid-template-areas:
      'top'
      'editor'
      'resize'
      'panel';
  }
  body[data-out-dock='left'] .panel-resizer { cursor: ns-resize; }
  body[data-out-dock='left'] .io-grid {
    grid-template-columns: minmax(240px, 1fr) minmax(300px, 1.4fr);
    grid-template-rows: minmax(0, 1fr);
  }
  body[data-out-dock='left'][data-io-collapsed='on'] .workbench {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) 6px auto;
  }
  body[data-out-dock='left'] .io-panel {
    width: 100%;
    height: var(--io-height, 258px);
    border-right: 0;
  }
  body[data-out-dock='left'] .io-panel.collapsed {
    width: 100%;
    height: 37px;
  }
  body[data-out-dock='right'][data-io-collapsed='on'] .workbench {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) 6px auto;
  }
}

@media (max-width: 900px) {
  body[data-out-dock='left'][data-io-collapsed='on'] .panel-resizer,
  body[data-out-dock='right'][data-io-collapsed='on'] .panel-resizer {
    cursor: ns-resize;
  }
}
