/* ==========================================================================
   AI 问答训练 — user-facing styles
   Mobile-first, royal blue + warm gold visual system.
   ========================================================================== */

:root {
  --navy-950: #061a3d;
  --navy-900: #0a2656;
  --navy-800: #0e3c8f;
  --blue-700: #1558c8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --sky-400: #38bdf8;
  --sky-200: #bae6fd;
  --sky-50: #eff8ff;
  --gold-500: #f0b429;
  --gold-400: #f6c445;
  --gold-300: #ffdb7e;
  --gold-50: #fff8e6;
  --ink-900: #13233f;
  --ink-700: #40516d;
  --ink-500: #6b7c97;
  --ink-300: #a9b5c7;
  --line: #e3ebf5;
  --surface: #ffffff;
  --canvas: #f3f7fd;
  --success: #138a62;
  --danger: #c2413b;
  --radius-lg: 24px;
  --radius-md: 18px;
  --shadow-card: 0 12px 30px rgba(20, 55, 110, 0.1);
  --shadow-soft: 0 4px 16px rgba(20, 55, 110, 0.07);
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink-900);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(56, 189, 248, 0.6);
  outline-offset: 2px;
}

.app-root,
.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.boot-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-content: center;
  gap: 12px;
  justify-items: center;
  color: var(--ink-500);
  font-size: 14px;
  background: var(--canvas);
}

.boot-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 17px;
  color: #fff;
  font-size: 23px;
  background: linear-gradient(140deg, var(--blue-500), var(--navy-800));
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.32);
  animation: bootPulse 1.4s ease-in-out infinite;
}

@keyframes bootPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.03);
  }
}

/* --------------------------------------------------------------------------
   Shared bits
   -------------------------------------------------------------------------- */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #2f7cf6, #0b2b75);
  box-shadow: 0 7px 16px rgba(16, 66, 160, 0.28);
  font-size: 18px;
}

.logo-mark::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.logo-text strong {
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.logo-text small {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink-300);
  text-transform: uppercase;
  white-space: nowrap;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease,
    opacity 0.18s ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.55;
}

.btn-gold {
  color: #3b2b06;
  background: linear-gradient(135deg, #ffd76f 0%, #f4c03a 55%, #eeb126 100%);
  box-shadow: 0 9px 22px rgba(233, 170, 30, 0.28);
}

.btn-gold:hover:not(:disabled) {
  box-shadow: 0 12px 26px rgba(233, 170, 30, 0.34);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #307df4, #1558c8);
  box-shadow: 0 9px 22px rgba(21, 88, 200, 0.26);
}

.btn-ghost {
  color: var(--ink-700);
  background: #fff;
  border: 1px solid var(--line);
}

.btn-soft {
  color: var(--blue-700);
  background: #eaf3ff;
}

.btn-block {
  width: 100%;
}

.language-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.language-chip.on-light {
  color: var(--ink-500);
  border-color: var(--line);
  background: #fff;
}

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  background: linear-gradient(140deg, #57a9ff, #1f4fbb);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(calc(100% - 32px), 520px);
  transform: translateX(-50%);
  pointer-events: none;
}

body.in-chat .toast-stack {
  top: calc(72px + env(safe-area-inset-top, 0px));
  bottom: auto;
}

body.in-chat .toast {
  animation-name: toastInDown;
}

@keyframes toastInDown {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

.toast {
  max-width: 100%;
  padding: 11px 16px;
  border-radius: 12px;
  color: #fff;
  background: rgba(10, 38, 86, 0.94);
  box-shadow: 0 12px 30px rgba(7, 28, 68, 0.26);
  font-size: 13px;
  line-height: 1.45;
  animation: toastIn 0.22s ease both;
  backdrop-filter: blur(12px);
}

.toast.error {
  background: rgba(150, 43, 38, 0.96);
}

.toast.success {
  background: rgba(12, 106, 75, 0.96);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */

.login-screen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(22px, env(safe-area-inset-top, 0px)) 18px
    max(22px, env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at 12% 6%, rgba(80, 177, 255, 0.36), transparent 32%),
    radial-gradient(circle at 86% 30%, rgba(46, 131, 255, 0.3), transparent 36%),
    radial-gradient(circle at 50% 100%, rgba(66, 210, 255, 0.2), transparent 45%),
    linear-gradient(160deg, #103f93 0%, #0a2a69 46%, #061a40 100%);
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(140, 210, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 210, 255, 0.2) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 68%);
  pointer-events: none;
}

.login-screen::after {
  content: "";
  position: fixed;
  width: 540px;
  height: 540px;
  left: 50%;
  bottom: -400px;
  border: 1px solid rgba(125, 211, 252, 0.25);
  border-radius: 50%;
  box-shadow:
    0 0 0 56px rgba(125, 211, 252, 0.055),
    0 0 0 112px rgba(125, 211, 252, 0.04);
  transform: translateX(-50%);
  pointer-events: none;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}

.login-orb.one {
  width: 9px;
  height: 9px;
  left: 12%;
  top: 22%;
  background: #a5edff;
  box-shadow: 0 0 22px 8px rgba(88, 218, 255, 0.45);
  animation: drift 7s ease-in-out infinite;
}

.login-orb.two {
  width: 6px;
  height: 6px;
  right: 14%;
  top: 40%;
  background: #ffe19a;
  box-shadow: 0 0 20px 7px rgba(255, 205, 92, 0.4);
  animation: drift 9s ease-in-out -2s infinite;
}

.login-orb.three {
  width: 5px;
  height: 5px;
  left: 23%;
  bottom: 16%;
  background: #9cd7ff;
  box-shadow: 0 0 18px 6px rgba(125, 211, 252, 0.4);
  animation: drift 8s ease-in-out -4s infinite;
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(6px, -12px, 0);
  }
}

.login-shell {
  position: relative;
  z-index: 2;
  width: min(100%, 420px);
  margin: auto 0;
}

.login-topline {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 6px 18px;
}

.robot-stage {
  position: relative;
  width: 142px;
  height: 142px;
  margin-bottom: -3px;
}

.robot-stage::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(122, 222, 255, 0.35), transparent 68%);
  filter: blur(5px);
}

.robot-stage::after {
  content: "";
  position: absolute;
  width: 154px;
  height: 154px;
  left: 50%;
  top: 49%;
  border: 1px dashed rgba(168, 231, 255, 0.38);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: orbit 26s linear infinite;
}

.robot-stage img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(2, 23, 60, 0.35));
  animation: floaty 5.5s ease-in-out infinite;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes orbit {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.login-brand .brand-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #a5ecff;
  background: rgba(133, 221, 255, 0.1);
  border: 1px solid rgba(160, 232, 255, 0.22);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-kicker::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7af2cb;
  box-shadow: 0 0 8px #7af2cb;
}

.login-brand h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(27px, 7.3vw, 34px);
  font-weight: 800;
  letter-spacing: 0.015em;
  line-height: 1.18;
  text-shadow: 0 8px 28px rgba(2, 20, 55, 0.35);
}

.login-brand p {
  margin: 7px 0 0;
  max-width: 330px;
  color: rgba(214, 238, 255, 0.78);
  font-size: 12.5px;
  line-height: 1.65;
}

.login-card {
  position: relative;
  padding: 22px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.97);
  box-shadow:
    0 28px 70px rgba(1, 16, 48, 0.38),
    inset 0 1px 0 #fff;
  backdrop-filter: blur(18px);
  animation: cardRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cardRise {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}

.login-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
}

.login-card-header h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
}

.login-card-header p {
  margin: 5px 0 0;
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.55;
}

.login-card-header .mini-badge {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  color: var(--blue-700);
  background: #eef6ff;
  font-size: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 13px;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-700);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: #8aa0bd;
  pointer-events: none;
}

.text-input,
.text-area,
.select-input {
  width: 100%;
  min-height: 49px;
  padding: 0 14px;
  border: 1px solid #dce7f4;
  border-radius: 13px;
  background: #f7faff;
  color: var(--ink-900);
  font-size: 16px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input-wrap .text-input {
  padding-left: 41px;
}

.text-input::placeholder,
.text-area::placeholder {
  color: #a3b2c6;
}

.text-input:focus,
.text-area:focus,
.select-input:focus {
  border-color: #77b4ff;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(56, 132, 255, 0.12);
}

.text-area {
  min-height: 92px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.6;
}

.login-card .btn {
  min-height: 50px;
  margin-top: 3px;
  border-radius: 14px;
  font-size: 15px;
}

.login-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 14px;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.45;
}

.lock-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22b07d;
  box-shadow: 0 0 0 3px rgba(34, 176, 125, 0.13);
}

.demo-box {
  margin-top: 15px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px dashed #d7e3f3;
  background: #f8fbff;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.6;
}

.demo-box strong {
  color: var(--ink-700);
  font-weight: 700;
}

.demo-box code {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 5px;
  background: #eaf3ff;
  color: #1558c8;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10.5px;
}

.login-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 0 4px;
  color: rgba(205, 232, 255, 0.62);
  font-size: 10.5px;
}

.login-footer a {
  color: rgba(235, 247, 255, 0.9);
  text-decoration: none;
  border-bottom: 1px solid rgba(235, 247, 255, 0.28);
  padding-bottom: 1px;
}

.form-error {
  margin: 0 0 12px;
  padding: 9px 11px;
  border-radius: 10px;
  color: #9e2b26;
  background: #fff1ef;
  border: 1px solid #ffd9d4;
  font-size: 12px;
  line-height: 1.5;
}

.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner.dark {
  border-color: rgba(59, 43, 6, 0.22);
  border-top-color: #3b2b06;
}

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

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */

.dashboard {
  background:
    radial-gradient(circle at 100% 0%, rgba(91, 165, 255, 0.12), transparent 30%),
    var(--canvas);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247, 250, 255, 0.86);
  border-bottom: 1px solid rgba(220, 232, 246, 0.8);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: min(100%, 1080px);
  min-height: 64px;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top, 0px)) 18px 10px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 9px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 5px 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}

.user-pill-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.user-pill-meta strong {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.2;
}

.user-pill-meta small {
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-300);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--ink-500);
  background: #fff;
  border: 1px solid var(--line);
  transition: background 0.18s ease, color 0.18s ease;
}

.icon-btn:hover {
  color: var(--blue-700);
  background: #f4f9ff;
}

.dashboard-main {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 18px 16px 38px;
}

.hero-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 196px;
  padding: 23px 20px 18px;
  border-radius: 26px;
  color: #fff;
  background:
    radial-gradient(circle at 84% 16%, rgba(106, 207, 255, 0.34), transparent 34%),
    linear-gradient(128deg, #0a2b66 0%, #11479f 53%, #1768d8 100%);
  box-shadow: 0 18px 40px rgba(12, 55, 130, 0.22);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(164, 222, 255, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(164, 222, 255, 0.13) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(100deg, transparent 10%, #000 78%);
}

.hero-panel::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 310px;
  height: 310px;
  right: -115px;
  top: -146px;
  border-radius: 50%;
  border: 1px solid rgba(152, 224, 255, 0.26);
  box-shadow:
    0 0 0 32px rgba(152, 224, 255, 0.05),
    0 0 0 64px rgba(152, 224, 255, 0.035);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 270px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: #a9e9ff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-eyebrow::before {
  content: "";
  width: 14px;
  height: 1px;
  background: currentColor;
}

.eyebrow-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 17px;
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 999px;
  color: #3b2b06;
  background: linear-gradient(135deg, #ffe18b, #f3bd37);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  box-shadow: 0 2px 8px rgba(240, 180, 41, 0.25);
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.hero-copy h1 span {
  color: #ffd875;
}

.hero-copy p {
  margin: 8px 0 0;
  max-width: 250px;
  color: rgba(216, 241, 255, 0.8);
  font-size: 11.5px;
  line-height: 1.65;
}

.hero-robot {
  position: absolute;
  z-index: 1;
  right: -4px;
  top: 22px;
  bottom: auto;
  width: 116px;
  height: 116px;
  opacity: 0.92;
  filter: drop-shadow(0 14px 20px rgba(2, 17, 55, 0.26));
  pointer-events: none;
}

.hero-stats {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.hero-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(7px);
}

.hero-stat strong {
  font-size: 15px;
  line-height: 1;
  color: #fff;
}

.hero-stat span {
  color: rgba(213, 239, 255, 0.72);
  font-size: 9.5px;
  line-height: 1;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 25px 2px 13px;
}

.section-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.section-head p {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 11px;
}

.section-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--blue-700);
  background: #eaf3ff;
  font-size: 10px;
  font-weight: 700;
}

.category-section {
  margin-top: 17px;
}

.category-section + .category-section {
  margin-top: 26px;
  padding-top: 23px;
  border-top: 1px solid #e1eaf5;
}

.category-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  margin-bottom: 13px;
}

.category-index {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  color: #1558c8;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(223, 240, 255, 0.9)),
    #edf6ff;
  border: 1px solid #d4e7fa;
  box-shadow: 0 5px 14px rgba(21, 88, 200, 0.09);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.category-heading {
  min-width: 0;
}

.category-kicker {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 1px 0 3px;
  color: var(--ink-300);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.category-kicker::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-500);
}

.category-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.005em;
}

.category-heading > p:last-child {
  max-width: 620px;
  margin: 4px 0 0;
  color: var(--ink-500);
  font-size: 10.5px;
  line-height: 1.6;
}

.category-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.category-status::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.category-status.open {
  color: #0b7555;
  background: #e7f9f2;
}

.category-status.soon {
  color: #8a5c00;
  background: #fff5d9;
}

.category-upcoming {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  overflow: hidden;
  padding: 16px;
  border-radius: 17px;
  border: 1px dashed #cfe2f5;
  background:
    radial-gradient(circle at 92% 18%, rgba(92, 174, 255, 0.14), transparent 34%),
    linear-gradient(135deg, #fbfdff 0%, #eef7ff 100%);
}

.category-upcoming::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -48px;
  bottom: -70px;
  border-radius: 50%;
  border: 1px solid rgba(91, 170, 255, 0.2);
  box-shadow: 0 0 0 20px rgba(91, 170, 255, 0.045);
  pointer-events: none;
}

.category-upcoming-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 13px;
  color: var(--blue-700);
  background: #fff;
  border: 1px solid #dbeafa;
  box-shadow: 0 5px 14px rgba(21, 88, 200, 0.08);
}

.category-upcoming-icon svg {
  width: 21px;
  height: 21px;
}

.category-upcoming-copy {
  min-width: 0;
  flex: 1;
}

.category-upcoming-copy strong {
  display: block;
  color: var(--ink-900);
  font-size: 12px;
  font-weight: 750;
}

.category-upcoming-copy p {
  max-width: 560px;
  margin: 4px 0 0;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.6;
}

.category-soon-tag {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 3px 6px;
  border-radius: 5px;
  color: #8a5c00;
  background: #fff2cc;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.daily-task-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -3px 0 13px;
  padding: 7px 10px;
  border-radius: 9px;
  color: #8a5c00;
  background: #fff8e6;
  border: 1px solid #f5e4b4;
  font-size: 9.5px;
  line-height: 1.5;
}

.daily-task-note span {
  font-size: 12px;
  line-height: 1;
}

@media (max-width: 520px) {
  .category-head {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
  }

  .category-index {
    grid-row: 1 / span 2;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 11.5px;
  }

  .category-heading h2 {
    font-size: 14.5px;
  }

  .category-status {
    grid-column: 2;
    justify-self: start;
    margin-top: -5px;
  }

  .category-upcoming {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    padding: 13px;
  }

  .category-upcoming-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 11px;
  }

  .category-upcoming-copy strong {
    font-size: 11.5px;
  }

  .category-upcoming-copy p {
    font-size: 9.5px;
  }

  .category-soon-tag {
    display: none;
  }
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.task-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  padding: 0;
  border-radius: 18px;
  border: 1px solid rgba(220, 232, 245, 0.95);
  background: #fff;
  box-shadow: 0 6px 18px rgba(20, 55, 110, 0.08);
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-card:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(20, 55, 110, 0.14);
}

.task-card:active:not(:disabled) {
  transform: translateY(-1px) scale(0.995);
}

.task-card:disabled {
  opacity: 0.68;
}

.task-card.locked-today:disabled {
  opacity: 1;
  border-color: #f0dfb4;
  background: #fffdf8;
}

.task-complete-pill.today {
  color: #4b3504;
  background: linear-gradient(135deg, #ffe18b, #f4c445);
  border-color: rgba(232, 178, 40, 0.6);
}

.task-progress .locked {
  color: #9a6b00;
  font-weight: 700;
}

.task-start.is-locked {
  color: #8a6100;
  background: linear-gradient(135deg, #fff4d2, #ffe9a8);
  box-shadow: none;
}

.task-art {
  position: relative;
  aspect-ratio: 320 / 186;
  overflow: hidden;
  background: #06246b;
}

.task-art svg {
  width: 100%;
  height: 100%;
}

.task-complete-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #e7fbff;
  background: rgba(4, 26, 66, 0.62);
  border: 1px solid rgba(153, 237, 255, 0.38);
  font-size: 8.5px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

.task-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 10px 11px;
}

.task-kicker {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-300);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.task-kicker::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-500);
}

.task-title {
  margin: 0;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
  color: var(--ink-900);
}

.task-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 16px;
  color: var(--ink-500);
  font-size: 9px;
}

.task-progress .ok {
  color: var(--success);
  font-weight: 700;
}

.task-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 33px;
  border-radius: 10px;
  color: #413006;
  background: linear-gradient(135deg, #ffe18b 0%, #f6c445 55%, #edb42b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.task-start .arrow {
  font-size: 13px;
  line-height: 1;
  transition: transform 0.18s ease;
}

.task-card:hover:not(:disabled) .task-start .arrow {
  transform: translateX(2px);
}

.empty-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  border-radius: 20px;
  border: 1px dashed #d3e0f0;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.6;
}

.empty-panel strong {
  color: var(--ink-900);
  font-size: 14px;
}

.dashboard-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 26px;
  color: var(--ink-300);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-align: center;
}

.dashboard-footnote::before,
.dashboard-footnote::after {
  content: "";
  width: 24px;
  height: 1px;
  background: #dbe5f1;
}

/* --------------------------------------------------------------------------
   Chat / training session
   -------------------------------------------------------------------------- */

.chat-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 12%, rgba(86, 174, 255, 0.14), transparent 30%),
    linear-gradient(180deg, #eef8ff 0%, #e7f2ff 100%);
}

.chat-header {
  position: relative;
  z-index: 10;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.93);
  border-bottom: 1px solid rgba(213, 228, 244, 0.86);
  box-shadow: 0 4px 18px rgba(24, 61, 120, 0.045);
  backdrop-filter: blur(16px);
}

.chat-header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 760px);
  min-height: 60px;
  margin: 0 auto;
  padding: max(8px, env(safe-area-inset-top, 0px)) 13px 8px;
}

.back-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 12px;
  color: var(--ink-700);
  background: #f4f9ff;
  border: 1px solid #e2ecf8;
}

.chat-title {
  min-width: 0;
  flex: 1;
}

.chat-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.chat-title span {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 9.5px;
  font-weight: 600;
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #1ab88a;
  box-shadow: 0 0 0 3px rgba(26, 184, 138, 0.13);
}

.chat-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--blue-700);
  background: #edf5ff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chat-status.done {
  color: #086b4d;
  background: #e6f8f1;
}

.chat-status.review {
  color: #8a5c00;
  background: #fff5dc;
}

.chat-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 15px 13px 12px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #c4d9ef transparent;
}

.chat-main::-webkit-scrollbar {
  width: 4px;
}

.chat-main::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #c4d9ef;
}

.chat-main::-webkit-scrollbar-track {
  background: transparent;
}

.chat-inner {
  width: min(100%, 690px);
  margin: 0 auto;
}

.chat-date {
  display: flex;
  justify-content: center;
  margin: 0 0 17px;
}

.chat-date span {
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--ink-500);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(213, 228, 244, 0.9);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
  animation: messageIn 0.28s ease both;
}

.message.user {
  justify-content: flex-end;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.bot-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  overflow: hidden;
  border-radius: 11px;
  background: #fff;
  border: 1px solid #d7e9fa;
  box-shadow: 0 4px 10px rgba(24, 61, 120, 0.08);
}

.bot-avatar img {
  width: 31px;
  height: 31px;
  object-fit: contain;
}

.bubble-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: min(84%, 560px);
}

.message.user .bubble-stack {
  align-items: flex-end;
}

.bubble-name {
  margin: 0 0 2px 3px;
  color: var(--ink-300);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.bubble {
  padding: 11px 13px;
  border-radius: 5px 17px 17px 17px;
  color: var(--ink-900);
  background: #fff;
  border: 1px solid rgba(218, 232, 247, 0.95);
  box-shadow: 0 4px 12px rgba(24, 61, 120, 0.055);
  font-size: 13.5px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.bubble.greeting {
  background: linear-gradient(180deg, #fff 0%, #f9fcff 100%);
}

.bubble.user {
  border: 1px solid rgba(228, 178, 52, 0.32);
  border-radius: 17px 5px 17px 17px;
  color: #3b2b06;
  background: linear-gradient(135deg, #ffe294 0%, #f6c445 100%);
  box-shadow: 0 6px 16px rgba(211, 157, 29, 0.17);
}

.bubble.answer {
  border-top-left-radius: 5px;
  padding-top: 10px;
}

.answer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid #eef4fb;
}

.answer-meta-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--blue-700);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.answer-meta-label::before {
  content: "✦";
  color: var(--gold-500);
  font-size: 11px;
}

.engine-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--ink-500);
  background: #f0f6fd;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.engine-badge.openai {
  color: #0d6b52;
  background: #e9fbf4;
}

.answer-text {
  font-size: 13.5px;
  line-height: 1.75;
  color: #263952;
}

.answer-text p {
  margin: 0 0 9px;
}

.answer-text p:last-child {
  margin-bottom: 0;
}

.answer-text strong {
  color: #10233f;
  font-weight: 750;
}

.answer-text code {
  padding: 1px 4px;
  border-radius: 4px;
  color: #1558c8;
  background: #eef4ff;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9em;
}

.answer-text ul {
  margin: 6px 0 9px;
  padding-left: 17px;
}

.answer-text li {
  margin-bottom: 4px;
}

.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
  padding: 2px 0;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #79a9e8;
  animation: typingDot 1.15s ease-in-out infinite;
}

.typing span:nth-child(2) {
  animation-delay: 0.16s;
}

.typing span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes typingDot {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.notice-bubble {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 13px;
  color: #9a3630;
  background: #fff4f2;
  border: 1px solid #ffdcd6;
  font-size: 11.5px;
  line-height: 1.55;
}

.notice-bubble.success {
  color: #0b6a4e;
  background: #eefbf6;
  border-color: #c8efdf;
}

.notice-bubble strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
}

.chat-dock {
  position: relative;
  z-index: 9;
  flex: 0 0 auto;
  padding: 9px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(231, 242, 255, 0) 0%, #e7f2ff 24%, #e7f2ff 100%);
}

.chat-dock-inner {
  width: min(100%, 690px);
  margin: 0 auto;
}

.dock-card {
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(210, 226, 244, 0.98);
  background: #fff;
  box-shadow: 0 12px 32px rgba(16, 52, 110, 0.15);
  animation: dockIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes dockIn {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
}

.question-dock {
  padding: 13px 14px 14px;
}

.dock-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.dock-label-left {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8a5c00;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.dock-label-left::before {
  content: "✦";
  color: var(--gold-500);
  font-size: 11px;
}

.dock-tag {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--ink-300);
  background: #f5f8fd;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.question-copy {
  margin: 0 0 12px;
  max-height: 126px;
  overflow-y: auto;
  color: #1a2d48;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.62;
}

.dock-hint {
  margin: -4px 0 11px;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.55;
}

.waiting-dock {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px;
  background: linear-gradient(120deg, #f8fcff, #eef7ff);
}

.waiting-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 11px;
  color: var(--blue-700);
  background: #e2f1ff;
  font-size: 17px;
  animation: softPulse 1.8s ease-in-out infinite;
}

@keyframes softPulse {
  0%,
  100% {
    opacity: 0.75;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

.waiting-copy strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 750;
}

.waiting-copy span {
  color: var(--ink-500);
  font-size: 10px;
}

.error-dock {
  padding: 13px 14px;
  color: #8f302a;
  font-size: 11.5px;
  line-height: 1.55;
}

.error-dock .dock-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.error-dock .btn {
  min-height: 39px;
  flex: 1;
  font-size: 12px;
}

.feedback-dock {
  padding: 14px;
}

.feedback-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 12px;
}

.feedback-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  color: #8a5c00;
  background: #fff5d9;
  font-size: 15px;
}

.feedback-head h3 {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.4;
}

.feedback-head p {
  margin: 3px 0 0;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.5;
}

.feedback-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.feedback-actions .btn {
  min-height: 43px;
  padding: 0 10px;
  font-size: 12px;
}

.feedback-actions .btn-gold {
  box-shadow: 0 6px 14px rgba(233, 170, 30, 0.2);
}

.dock-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  min-height: 35px;
  margin-top: 7px;
  color: var(--ink-500);
  font-size: 10.5px;
  font-weight: 600;
}

.dock-link:hover {
  color: var(--blue-700);
}

.dispute-form {
  margin-top: 11px;
  padding-top: 12px;
  border-top: 1px dashed #e2ebf6;
  animation: dockIn 0.25s ease both;
}

.dispute-actions {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 8px;
  margin-top: 8px;
}

.dispute-actions .btn {
  min-height: 42px;
  font-size: 12px;
}

.dispute-note {
  margin: 7px 1px 0;
  color: var(--ink-300);
  font-size: 9px;
  line-height: 1.5;
}

.completed-dock {
  padding: 19px 16px;
  text-align: center;
}

.completed-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin: 0 auto 10px;
  border-radius: 50%;
  color: #0a7958;
  background: #e8faf3;
  border: 1px solid #c3edde;
  font-size: 22px;
}

.completed-mark.review {
  color: #8a5c00;
  background: #fff5d9;
  border-color: #f1dda4;
  font-size: 20px;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   Text-to-image training
   -------------------------------------------------------------------------- */

.image-brief-card {
  margin: 0 0 14px 42px;
  padding: 13px 14px;
  border-radius: 5px 16px 16px 16px;
  border: 1px solid #dceafb;
  background: linear-gradient(165deg, #ffffff, #f7fbff);
  box-shadow: 0 4px 12px rgba(24, 61, 120, 0.055);
}

.image-brief-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid #eef4fb;
}

.image-brief-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #6d46c8;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.image-brief-label::before {
  content: "✦";
  color: var(--gold-500);
  font-size: 11px;
}

.image-brief-tag {
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--ink-300);
  background: #f2f7fd;
  font-size: 7.5px;
  font-weight: 700;
}

.image-brief-card p {
  margin: 0;
  color: #263952;
  font-size: 12.5px;
  line-height: 1.72;
}

.image-prompt-dock {
  padding: 13px 14px 12px;
}

.image-prompt-input {
  min-height: 98px;
  margin-bottom: 1px;
  resize: vertical;
  font-size: 16px;
}

.image-free-hint {
  margin: 7px 1px 0;
  color: var(--ink-300);
  font-size: 8.5px;
  line-height: 1.55;
}

.image-wait-card {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 14px 42px;
  padding: 14px;
  border-radius: 15px;
  border: 1px solid #d8e9fa;
  background: linear-gradient(135deg, #f3faff, #eaf5ff);
}

.image-wait-card strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-900);
  font-size: 11.5px;
}

.image-wait-card span {
  color: var(--ink-500);
  font-size: 9.5px;
  line-height: 1.5;
}

.image-wait-body {
  flex: 1;
  min-width: 0;
}

.image-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.image-progress-head strong {
  margin-bottom: 0;
}

.image-progress-value {
  flex: none;
  color: #b47a13;
  font-size: 11px !important;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.image-progress-track {
  position: relative;
  width: 100%;
  height: 7px;
  margin: 0 0 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dcebfa;
  box-shadow: inset 0 1px 2px rgba(20, 60, 120, 0.07);
}

.image-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f4c34f, #eaa632);
  box-shadow: 0 0 10px rgba(236, 174, 45, 0.32);
  transition: width 0.22s linear;
}

.image-waiting-dock {
  align-items: flex-start;
}

.image-waiting-dock .image-progress-track {
  margin-top: 2px;
}

.image-result-stack {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.image-generation-stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid #d9e8f8;
  background:
    radial-gradient(circle at 50% 30%, rgba(126, 187, 255, 0.22), transparent 48%),
    linear-gradient(155deg, #edf7ff, #dcecff);
  box-shadow: 0 8px 24px rgba(18, 53, 110, 0.08);
}

.image-generation-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(89, 150, 220, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(89, 150, 220, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, #000, transparent 78%);
}

.image-generation-mark {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--gold-500);
  font-size: 30px;
  line-height: 1;
  text-shadow: 0 0 22px rgba(240, 180, 41, 0.65);
  animation: image-generation-pulse 1.8s ease-in-out infinite;
}

.image-generation-scan {
  position: absolute;
  z-index: 1;
  top: -45%;
  left: 0;
  width: 100%;
  height: 42%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
  animation: image-generation-scan 2.6s linear infinite;
}

.image-generation-progress {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 12px;
  left: 12px;
  padding: 10px 12px 9px;
  border-radius: 12px;
  border: 1px solid rgba(211, 229, 248, 0.9);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(23, 62, 120, 0.1);
  backdrop-filter: blur(7px);
}

.image-generation-progress .image-progress-head {
  margin-bottom: 5px;
}

.image-generation-progress .image-progress-head strong {
  color: var(--ink-900);
  font-size: 10.5px;
}

.image-generation-note {
  display: block;
  margin-top: 5px;
  color: var(--ink-500);
  font-size: 8px;
  line-height: 1.45;
}

@keyframes image-generation-scan {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(360%);
  }
}

@keyframes image-generation-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(0.92);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

.audio-result-stack {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.audio-result-card {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #f0dfb9;
  background: linear-gradient(160deg, #fffdf7, #fff9ea);
  box-shadow: 0 8px 24px rgba(120, 84, 20, 0.1);
}

.audio-result-head {
  margin-bottom: 9px;
  color: #8b6417;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audio-player {
  display: block;
  width: 100%;
  height: 42px;
  margin: 0 0 7px;
}

.audio-play-hint {
  margin: 0 0 10px;
  color: var(--ink-500);
  font-size: 8.5px;
  line-height: 1.5;
}

.audio-transcript {
  padding: 10px;
  border-radius: 9px;
  border: 1px solid #f2e8cf;
  background: rgba(255, 255, 255, 0.7);
}

.audio-transcript > span {
  display: block;
  margin-bottom: 4px;
  color: #a07a27;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audio-transcript p {
  margin: 0;
  color: var(--ink-700);
  font-size: 11.5px;
  line-height: 1.65;
}

.audio-wait-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border-radius: 15px;
  border: 1px solid #f0dfb9;
  background: linear-gradient(135deg, #fffdf7, #fff6df);
}

.audio-wait-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-900);
  font-size: 11.5px;
}

.audio-wait-card span {
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.5;
}

.audio-wave {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff3cf;
}

.audio-wave i {
  display: block;
  width: 3px;
  height: 12px;
  border-radius: 999px;
  background: #d9a52a;
  animation: audio-wave 1s ease-in-out infinite;
}

.audio-wave i:nth-child(2) {
  height: 20px;
  animation-delay: 0.12s;
}

.audio-wave i:nth-child(3) {
  height: 28px;
  animation-delay: 0.24s;
}

.audio-wave i:nth-child(4) {
  height: 18px;
  animation-delay: 0.36s;
}

.audio-wave i:nth-child(5) {
  height: 10px;
  animation-delay: 0.48s;
}

@keyframes audio-wave {
  0%,
  100% {
    transform: scaleY(0.5);
    opacity: 0.55;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.image-result-card {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid #d9e8f8;
  background: #fff;
  box-shadow: 0 8px 24px rgba(18, 53, 110, 0.1);
}

.image-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-bottom: 1px solid #edf4fb;
  color: var(--ink-700);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.image-result-link {
  display: block;
  padding: 7px;
  background:
    radial-gradient(circle at 50% 0%, rgba(91, 170, 255, 0.12), transparent 60%),
    #f2f8ff;
  text-align: center;
}

.generated-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 420px;
  margin: 0 auto;
  border-radius: 10px;
  background: #0b1530;
}

.image-result-caption {
  display: block;
  padding: 8px 11px 10px;
  color: var(--ink-300);
  font-size: 8.5px;
  line-height: 1.5;
}

.completed-dock h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.completed-dock p {
  margin: 5px auto 13px;
  max-width: 320px;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.6;
}

.completed-dock .btn {
  min-height: 44px;
  width: 100%;
  font-size: 13px;
}

.chat-typing-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 10px 42px;
  color: var(--ink-500);
  font-size: 9.5px;
}

.loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 50px 20px;
  color: var(--ink-500);
  font-size: 12px;
}

.loading-spinner {
  width: 29px;
  height: 29px;
  border: 3px solid #d8e8fa;
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 520px) {
  .topbar-inner {
    gap: 8px;
    padding-left: 14px;
    padding-right: 12px;
  }

  .topbar-right {
    gap: 6px;
  }

  .logo {
    gap: 8px;
  }

  .logo-text small {
    display: none;
  }

  .logo-text strong {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13.5px;
  }

  .user-pill {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .user-pill-meta {
    display: none;
  }

  .user-pill .avatar {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }

  .topbar-right .icon-btn {
    width: 36px;
    height: 36px;
  }

  .hero-panel {
    min-height: 214px;
  }

  .hero-copy {
    max-width: 210px;
  }

  .hero-copy p {
    max-width: 210px;
  }
}

@media (max-width: 639px) {
  .chat-main::-webkit-scrollbar {
    width: 0;
  }
}

@media (max-width: 370px) {
  .login-screen {
    padding-left: 12px;
    padding-right: 12px;
  }

  .login-card {
    padding: 18px;
    border-radius: 22px;
  }

  .robot-stage {
    width: 122px;
    height: 122px;
  }

  .dashboard-main {
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar-inner {
    padding-left: 12px;
    padding-right: 10px;
  }

  .logo-text strong {
    max-width: 76px;
    font-size: 12.5px;
  }

  .language-chip {
    padding: 0 8px;
  }

  .hero-panel {
    padding: 20px 17px 16px;
    border-radius: 22px;
  }

  .hero-robot {
    width: 104px;
    height: 104px;
    right: -6px;
    top: 24px;
    bottom: auto;
    opacity: 0.86;
  }

  .hero-copy {
    max-width: 195px;
  }

  .hero-copy p {
    max-width: 195px;
  }

  .task-grid {
    gap: 9px;
  }

  .task-title {
    font-size: 12px;
  }

  .task-body {
    padding: 9px 8px 9px;
  }

  .task-start {
    min-height: 31px;
    font-size: 9.5px;
  }

  .chat-main {
    padding-left: 10px;
    padding-right: 10px;
  }

  .bubble {
    font-size: 13px;
  }
}

@media (min-width: 640px) {
  .dashboard-main {
    padding: 24px 24px 48px;
  }

  .hero-panel {
    min-height: 218px;
    padding: 28px 28px 22px;
  }

  .hero-copy {
    max-width: 360px;
  }

  .hero-copy p {
    max-width: 330px;
    font-size: 12.5px;
  }

  .hero-robot {
    width: 190px;
    height: 190px;
    right: 10px;
    top: auto;
    bottom: -18px;
  }

  .task-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .task-title {
    font-size: 14px;
  }

  .task-start {
    min-height: 36px;
    font-size: 11.5px;
  }

  .chat-header-inner {
    padding-left: 20px;
    padding-right: 20px;
  }

  .chat-main {
    padding: 20px 22px 14px;
  }

  .chat-dock {
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .question-dock,
  .feedback-dock {
    padding: 16px 18px;
  }

  .question-copy {
    font-size: 15px;
  }

  .bubble {
    font-size: 14px;
  }

  .answer-text {
    font-size: 14px;
  }
}

@media (min-width: 960px) {
  .topbar-inner {
    padding-left: 24px;
    padding-right: 24px;
  }

  .dashboard-main {
    padding-top: 30px;
  }

  .task-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }

  .chat-page {
    width: min(100%, 820px);
    margin: 0 auto;
    border-left: 1px solid rgba(210, 227, 244, 0.8);
    border-right: 1px solid rgba(210, 227, 244, 0.8);
    box-shadow: 0 0 50px rgba(20, 55, 110, 0.09);
  }
}

@media (min-width: 1200px) {
  .login-shell {
    width: min(100%, 430px);
  }
}

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