:root {
  color-scheme: light;
  --navy: #17303a;
  --navy-soft: #294852;
  --teal: #0d8b79;
  --teal-dark: #087262;
  --teal-pale: #e8f6f2;
  --ink: #172b33;
  --muted: #6c7c82;
  --line: #e3e9e8;
  --surface: #ffffff;
  --canvas: #f7f9f8;
  --sidebar: #f2f6f4;
  --shadow: 0 16px 50px rgba(29, 55, 58, 0.1);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  overflow: hidden;
}

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

.login-screen[hidden], .app-shell[hidden] { display: none; }

.login-screen {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  color: #ecf8fa;
  background:
    radial-gradient(circle at 15% 12%, rgba(34, 205, 185, .12), transparent 29%),
    radial-gradient(circle at 82% 38%, rgba(57, 112, 219, .19), transparent 31%),
    linear-gradient(124deg, #041321 0%, #08243a 50%, #06172a 100%);
}
.login-screen::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 209, 216, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 209, 216, .035) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  mask-image: linear-gradient(90deg, rgba(0,0,0,.85), transparent 72%);
}
.login-visual { position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
.login-orb { position: absolute; display: block; border-radius: 50%; filter: blur(4px); }
.login-orb-one {
  top: -20%;
  right: -8%;
  width: min(56vw, 760px);
  aspect-ratio: 1;
  border: 1px solid rgba(91, 166, 255, .09);
  background: radial-gradient(circle, rgba(48, 109, 213, .2), rgba(22, 98, 158, .04) 51%, transparent 70%);
}
.login-orb-two {
  bottom: -38%;
  left: -12%;
  width: min(54vw, 700px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(22, 194, 171, .16), rgba(10, 102, 112, .025) 58%, transparent 70%);
}
.login-network { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .76; animation: network-drift 18s ease-in-out infinite alternate; }
.login-waterline { position: absolute; right: 0; bottom: 0; left: 0; width: 100%; height: 21%; opacity: .64; }
.login-waterline path:first-child { fill: rgba(13, 99, 119, .13); stroke: rgba(71, 224, 205, .17); stroke-width: 1; }
.login-waterline path:last-child { fill: none; stroke: rgba(106, 194, 225, .11); stroke-width: 1; }

.login-layout {
  display: grid;
  width: min(1240px, calc(100% - 88px));
  min-height: 100vh;
  min-height: 100svh;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 438px);
  align-items: center;
  gap: clamp(54px, 7vw, 112px);
  margin: 0 auto;
  padding: 42px 0;
}
.login-story {
  display: flex;
  min-width: 0;
  min-height: min(780px, calc(100vh - 84px));
  min-height: min(780px, calc(100svh - 84px));
  flex-direction: column;
}
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand-mark {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(127, 238, 224, .25);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(42, 211, 191, .2), rgba(60, 112, 188, .12));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 14px 34px rgba(0, 9, 22, .22);
}
.login-brand-mark svg { width: 36px; fill: none; stroke: #70eddd; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.45; }
.login-brand-mark svg circle { fill: #dffefa; stroke: none; }
.login-brand-mark .brand-core { fill: rgba(56, 218, 199, .12); stroke: #70eddd; }
.login-brand-mark .brand-orbit { stroke-width: 1.65; }
.login-brand-mark .brand-arrow { stroke-width: 1.45; }
.login-brand-mark .brand-nodes { stroke-width: 1; }
.login-brand strong, .login-brand small { display: block; }
.login-brand strong { color: #f3fbfc; font-family: Bahnschrift, "Segoe UI", sans-serif; font-size: 18px; font-weight: 650; letter-spacing: .055em; }
.login-brand small { margin-top: 4px; color: #7196a6; font-family: "Segoe UI", sans-serif; font-size: 8px; font-weight: 700; letter-spacing: .25em; }

.login-story-copy { margin: auto 0; }
.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border: 1px solid rgba(98, 218, 208, .16);
  border-radius: 999px;
  color: #8fc4cc;
  background: rgba(13, 53, 70, .36);
  font-size: 12px;
  letter-spacing: .08em;
}
.login-kicker i { width: 6px; height: 6px; border-radius: 50%; background: #43ddc8; box-shadow: 0 0 0 5px rgba(67,221,200,.08), 0 0 16px rgba(67,221,200,.55); }
.login-story h1 { margin: 28px 0 0; color: #f3fafb; font-size: clamp(43px, 4.35vw, 66px); font-weight: 650; letter-spacing: -.055em; line-height: 1.16; }
.login-story h1 em {
  color: transparent;
  background: linear-gradient(92deg, #56e1d0 0%, #7cc7ed 57%, #96b8ff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  font-style: normal;
}
.login-story-copy > p { max-width: 665px; margin: 24px 0 0; color: #9cb6c2; font-size: 15px; line-height: 1.95; }
.login-capabilities { display: grid; max-width: 680px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 38px; }
.login-capabilities > div {
  display: grid;
  min-width: 0;
  grid-template-columns: 38px 1fr;
  grid-template-rows: auto auto;
  column-gap: 11px;
  padding: 15px 14px;
  border: 1px solid rgba(123, 189, 206, .1);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(22, 63, 82, .4), rgba(15, 43, 63, .18));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.login-capabilities span { display: grid; width: 38px; height: 38px; grid-row: 1 / 3; place-items: center; border-radius: 10px; color: #62dfd1; background: rgba(54, 207, 189, .08); }
.login-capabilities svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.55; }
.login-capabilities strong { align-self: end; overflow: hidden; color: #e5f3f4; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.login-capabilities small { align-self: start; overflow: hidden; margin-top: 3px; color: #7293a0; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.login-platform-status { display: flex; align-items: center; gap: 19px; color: #527988; }
.login-platform-status span { display: inline-flex; align-items: center; gap: 8px; font-family: "Segoe UI", sans-serif; font-size: 9px; font-weight: 700; letter-spacing: .2em; }
.login-platform-status span i { width: 6px; height: 6px; border-radius: 50%; background: #3ed7b4; box-shadow: 0 0 9px rgba(62, 215, 180, .7); }
.login-platform-status small { padding-left: 19px; border-left: 1px solid rgba(137, 186, 199, .14); font-size: 10px; letter-spacing: .08em; }

.login-panel-wrap { width: 100%; }
.login-panel-topline { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 14px; color: #6a91a1; }
.login-panel-topline span { width: 28px; height: 1px; background: linear-gradient(90deg, transparent, rgba(118, 174, 190, .35)); }
.login-panel-topline span:last-child { transform: rotate(180deg); }
.login-panel-topline b { font-family: "Segoe UI", sans-serif; font-size: 8px; letter-spacing: .24em; }
.login-card {
  position: relative;
  overflow: hidden;
  padding: 38px 38px 32px;
  border: 1px solid rgba(151, 211, 222, .16);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(17, 49, 69, .91), rgba(7, 28, 47, .94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 34px 80px rgba(0, 7, 19, .42), 0 0 0 8px rgba(31, 94, 116, .035);
  backdrop-filter: blur(24px);
}
.login-card::before {
  position: absolute;
  top: -80px;
  right: -64px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(70, 182, 203, .13), transparent 69%);
  content: "";
  pointer-events: none;
}
.login-card-header { position: relative; display: flex; align-items: center; gap: 14px; }
.login-card-icon { display: grid; flex: 0 0 46px; width: 46px; height: 46px; place-items: center; border: 1px solid rgba(76, 224, 205, .2); border-radius: 13px; color: #60dfd0; background: rgba(52, 198, 182, .08); }
.login-card-icon svg { width: 27px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.55; }
.login-card-header div > span { color: #648d9c; font-family: "Segoe UI", sans-serif; font-size: 8px; font-weight: 700; letter-spacing: .17em; }
.login-card h2 { margin: 4px 0 0; color: #f2fafa; font-size: 25px; font-weight: 650; letter-spacing: -.02em; }
.login-lead { margin: 22px 0 29px; color: #8ca8b4; font-size: 12px; line-height: 1.65; }
.login-form { display: grid; gap: 20px; }
.login-field label { display: block; margin: 0 0 8px 2px; color: #bad0d6; font-size: 12px; font-weight: 650; }
.login-input {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 11px;
  padding: 0 14px;
  border: 1px solid rgba(132, 181, 195, .18);
  border-radius: 12px;
  background: rgba(3, 18, 31, .55);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.15);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.login-input:focus-within { border-color: rgba(68, 219, 201, .7); background: rgba(5, 25, 40, .78); box-shadow: 0 0 0 3px rgba(50, 207, 188, .08), inset 0 1px 3px rgba(0,0,0,.12); }
.login-input > svg { flex: 0 0 18px; width: 18px; fill: none; stroke: #5f8f9b; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.login-input input { min-width: 0; height: 50px; flex: 1; padding: 0; border: 0; outline: 0; color: #eef9f9; background: transparent; font-size: 13px; caret-color: #57ddca; }
.login-input input::placeholder { color: #567682; }
.login-input input:-webkit-autofill { -webkit-text-fill-color: #eef9f9; transition: background-color 9999s ease-out; }
.password-toggle { display: grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; padding: 0; border: 0; border-radius: 8px; color: #658b98; background: transparent; cursor: pointer; transition: color .2s, background .2s; }
.password-toggle:hover:not(:disabled) { color: #9adbd4; background: rgba(78, 205, 190, .07); }
.password-toggle svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.55; }
.password-toggle .eye-closed, .password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }
.login-error { display: flex; align-items: flex-start; gap: 9px; margin-top: -3px; padding: 10px 12px; border: 1px solid rgba(246, 126, 118, .18); border-radius: 9px; color: #ffc2bb; background: rgba(166, 53, 53, .12); font-size: 11px; line-height: 1.5; }
.login-error[hidden] { display: none; }
.login-error svg { flex: 0 0 17px; width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.6; }
.login-submit {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 53px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 3px;
  padding: 0 20px;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  color: #032521;
  background: linear-gradient(100deg, #43dec9, #62cfe4);
  box-shadow: 0 12px 28px rgba(36, 195, 179, .17), inset 0 1px 0 rgba(255,255,255,.5);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: .04em;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.login-submit::before { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.3) 48%, transparent 68%); content: ""; transform: translateX(-120%); transition: transform .5s ease; }
.login-submit:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.045); box-shadow: 0 16px 32px rgba(36, 195, 179, .23), inset 0 1px 0 rgba(255,255,255,.5); }
.login-submit:hover:not(:disabled)::before { transform: translateX(120%); }
.login-submit:active:not(:disabled) { transform: translateY(0); }
.login-submit:disabled { color: #8eb7ba; background: rgba(71, 116, 127, .18); box-shadow: inset 0 0 0 1px rgba(133, 180, 192, .1); cursor: wait; }
.login-submit-arrow { position: absolute; right: 18px; width: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.login-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(160, 201, 205, .25); border-top-color: #9ed7d5; border-radius: 50%; animation: login-spin .8s linear infinite; }
.login-submit.is-loading .login-spinner { display: block; }
.login-submit.is-loading .login-submit-arrow { display: none; }
.login-security-note { display: flex; align-items: center; gap: 10px; margin-top: 26px; padding-top: 22px; border-top: 1px solid rgba(136, 184, 197, .11); color: #668c99; }
.login-security-note > svg { width: 19px; fill: none; stroke: #4d9e9c; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.login-security-note strong, .login-security-note small { display: block; }
.login-security-note strong { color: #89aeb7; font-size: 10px; }
.login-security-note small { margin-top: 2px; font-size: 9px; }
.login-panel-footer { margin: 17px 0 0; color: #426d7c; font-family: "Segoe UI", sans-serif; font-size: 8px; font-weight: 700; letter-spacing: .18em; text-align: center; }
.login-screen :focus-visible { outline: 2px solid #75e6d7; outline-offset: 3px; }
.login-screen .login-input input:focus-visible { outline: 0; }

@keyframes network-drift { from { transform: translate3d(-5px, 0, 0) scale(1.005); } to { transform: translate3d(10px, -8px, 0) scale(1.018); } }
@keyframes login-spin { to { transform: rotate(360deg); } }

.app-shell { display: flex; min-height: 100%; }

.sidebar {
  position: relative;
  z-index: 10;
  display: flex;
  flex: 0 0 270px;
  flex-direction: column;
  min-height: 100vh;
  padding: 26px 18px 20px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(145deg, #0e9c87, #087463);
  box-shadow: 0 8px 20px rgba(13, 139, 121, 0.22);
}
.brand-mark svg { width: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: .02em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.new-chat {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  border: 1px solid #cfe0dc;
  border-radius: 12px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
}
.new-chat:hover { border-color: var(--teal); color: var(--teal-dark); box-shadow: 0 6px 20px rgba(30, 82, 75, .08); }
.new-chat svg, .conversation-item svg, .header-new-chat svg, .menu-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.conversation-nav { flex: 1; padding-top: 34px; }
.conversation-nav > p { margin: 0 10px 10px; color: #91a09e; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.conversation-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.conversation-item.active { color: #126f62; background: #e2f1ed; font-weight: 700; }

.session-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 11px 10px;
  border: 1px solid #dde7e4;
  border-radius: 11px;
  background: rgba(255,255,255,.65);
}
.session-avatar { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: #0b7566; background: #dcf1ec; font-size: 9px; font-weight: 850; letter-spacing: .05em; }
.session-copy { min-width: 0; flex: 1; }
.session-copy small, .session-copy strong { display: block; }
.session-copy small { color: #8b9996; font-size: 9px; }
.session-copy strong { overflow: hidden; margin-top: 2px; color: #334c51; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; padding: 0; border: 0; border-radius: 8px; color: #82928f; background: transparent; cursor: pointer; transition: .2s ease; }
.logout-button:hover:not(:disabled) { color: #b64e45; background: #f8e9e7; }
.logout-button:disabled { opacity: .45; cursor: wait; }
.logout-button svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 10px 0;
  border-top: 1px solid var(--line);
}
.trust-icon { display: grid; width: 26px; height: 26px; place-items: center; color: var(--teal-dark); border-radius: 50%; background: #dcefeb; font-weight: 900; }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { font-size: 12px; }
.sidebar-footer small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.workspace { display: flex; min-width: 0; flex: 1; flex-direction: column; height: 100vh; background: var(--surface); }
.topbar {
  position: relative;
  z-index: 4;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
}
.assistant-title { text-align: center; }
.assistant-title strong { display: block; font-size: 15px; }
.assistant-title > small { display: block; margin-top: 1px; color: #70827f; font-size: 9px; letter-spacing: .04em; }
.assistant-title span { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; color: var(--muted); font-size: 11px; }
.assistant-title i { width: 7px; height: 7px; border-radius: 50%; background: #f3ad43; }
.assistant-title .online i { background: #22a884; box-shadow: 0 0 0 3px #e1f5ee; }
.assistant-title .offline i { background: #db6a5e; }
.menu-button, .header-new-chat { position: absolute; display: none; width: 38px; height: 38px; place-items: center; border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.menu-button { left: 16px; }
.header-new-chat { right: 16px; }

.chat-area { min-height: 0; flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.welcome { width: min(760px, calc(100% - 40px)); margin: 0 auto; padding: clamp(54px, 9vh, 105px) 0 36px; text-align: center; }
.welcome-mark { display: grid; width: 62px; height: 62px; margin: 0 auto 24px; place-items: center; color: var(--teal); border: 1px solid #d9ebe7; border-radius: 20px; background: linear-gradient(145deg, #f3fbf8, #e2f4ef); box-shadow: 0 10px 30px rgba(20, 110, 97, .08); }
.welcome-mark svg { width: 36px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.welcome h1 { margin: 0; color: var(--navy); font-size: clamp(29px, 4vw, 40px); font-weight: 730; letter-spacing: -.04em; }
.welcome > p { margin: 14px 0 34px; color: var(--muted); font-size: 14px; }

.suggestions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; text-align: left; }
.suggestions button {
  display: grid;
  grid-template-columns: 38px 1fr 20px;
  align-items: center;
  gap: 11px;
  min-height: 86px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.suggestions button:hover { transform: translateY(-2px); border-color: #bfd9d4; box-shadow: var(--shadow); }
.suggestion-icon { display: grid; width: 38px; height: 38px; place-items: center; color: var(--teal-dark); border-radius: 11px; background: var(--teal-pale); font-size: 20px; }
.suggestions strong, .suggestions small { display: block; }
.suggestions strong { margin-bottom: 5px; color: var(--navy); font-size: 13px; }
.suggestions small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.suggestions b { color: #a0aeac; font-size: 18px; font-weight: 400; }

.messages { width: min(840px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 60px; }
.message { display: flex; gap: 13px; margin-bottom: 30px; }
.message.user { justify-content: flex-end; }
.message-avatar { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; color: #fff; border-radius: 11px; background: var(--teal); font-size: 12px; font-weight: 800; }
.message-content { min-width: 0; max-width: 720px; }
.user .message-content { padding: 11px 16px; border-radius: 16px 16px 4px 16px; background: #edf4f2; line-height: 1.65; }
.assistant .message-content { width: 100%; padding-top: 3px; }
.answer-copy { color: #24393f; font-size: 14px; line-height: 1.9; }
.answer-copy strong { color: var(--navy); }
.answer-copy > :first-child { margin-top: 0; }
.answer-copy > :last-child { margin-bottom: 0; }
.answer-copy h1,
.answer-copy h2,
.answer-copy h3,
.answer-copy h4 { margin: 1.35em 0 .5em; color: var(--navy); line-height: 1.4; }
.answer-copy h1 { font-size: 1.35rem; }
.answer-copy h2 { font-size: 1.2rem; }
.answer-copy h3 { font-size: 1.06rem; }
.answer-copy h4 { font-size: 1rem; }
.answer-copy p { margin: .65em 0; }
.answer-copy ul,
.answer-copy ol { margin: .65em 0; padding-left: 1.6em; }
.answer-copy li { margin: .3em 0; padding-left: .15em; }
.answer-copy blockquote { margin: .8em 0; padding: .2em 1em; border-left: 3px solid #9bc9c0; color: var(--muted); background: #f5faf8; }
.answer-copy code { padding: .12em .35em; border-radius: 5px; background: #edf3f1; font-family: Consolas, "SFMono-Regular", monospace; font-size: .9em; }
.answer-copy pre { overflow-x: auto; padding: 13px 15px; border-radius: 10px; background: #172a2e; color: #eef7f5; line-height: 1.6; }
.answer-copy pre code { padding: 0; background: transparent; color: inherit; }
.answer-copy table { display: block; overflow-x: auto; width: 100%; margin: 1em 0; border-collapse: collapse; }
.answer-copy th,
.answer-copy td { min-width: 90px; padding: 8px 10px; border: 1px solid var(--line); text-align: left; }
.answer-copy th { color: var(--navy); background: #eef6f3; }
.answer-copy .katex { font-size: 1.05em; }
.answer-copy .katex-display { overflow-x: auto; overflow-y: hidden; margin: 1em 0; padding: .4em 0; }
.answer-meta { margin-top: 12px; color: #8a9895; font-size: 10px; }
.answer-progress {
  overflow: hidden;
  width: min(100%, 570px);
  border: 1px solid #dce8e5;
  border-radius: 16px;
  background: linear-gradient(145deg, #fbfefd, #f3f9f7);
  box-shadow: 0 12px 34px rgba(31, 83, 76, .07);
}
.answer-progress > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 17px 13px;
  border-bottom: 1px solid #e3ecea;
}
.progress-heading { display: flex; align-items: center; gap: 10px; color: var(--navy); font-size: 13px; }
.progress-spinner {
  width: 17px;
  height: 17px;
  border: 2px solid #cde1dd;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: progress-spin .85s linear infinite;
}
.progress-timer { flex: 0 0 auto; color: #83928f; font-variant-numeric: tabular-nums; font-size: 10px; }
.progress-stages { display: grid; gap: 0; margin: 0; padding: 9px 17px; list-style: none; }
.progress-stages li {
  position: relative;
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  color: #8b9996;
  font-size: 12px;
  transition: color .25s ease;
}
.progress-stages li:not(:last-child)::after {
  position: absolute;
  top: 29px;
  bottom: -6px;
  left: 10px;
  width: 1px;
  background: #d9e5e2;
  content: "";
}
.progress-stage-marker {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 0 0 21px;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid #cedbd8;
  border-radius: 50%;
  color: #8d9d99;
  background: #f8fbfa;
  font-size: 9px;
  font-weight: 750;
  transition: .25s ease;
}
.progress-stages li.is-active { color: #174d47; font-weight: 700; }
.progress-stages li.is-active .progress-stage-marker {
  border-color: #58bcae;
  color: #fff;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(34, 168, 132, .1);
  animation: progress-marker 1.6s ease-in-out infinite;
}
.progress-stages li.is-complete { color: #58706c; }
.progress-stages li.is-complete .progress-stage-marker { border-color: #a6d8ce; color: transparent; background: #daf0eb; }
.progress-stages li.is-complete .progress-stage-marker::after { position: absolute; color: #16816f; content: "✓"; font-size: 11px; }
.answer-progress > footer { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 14px 10px 17px; border-top: 1px solid #e3ecea; background: rgba(255,255,255,.54); }
.progress-hint { color: #798986; font-size: 10px; line-height: 1.5; }
.progress-cancel { flex: 0 0 auto; padding: 6px 10px; border: 1px solid #d6e2df; border-radius: 8px; color: #60736f; background: #fff; font-size: 10px; cursor: pointer; transition: .2s ease; }
.progress-cancel:hover:not(:disabled) { border-color: #e0aaa4; color: #ad5148; background: #fff8f7; }
.progress-cancel:disabled { opacity: .55; cursor: wait; }
.answer-progress.is-long-wait { border-color: #eadfc7; }
.answer-progress.is-streaming { box-shadow: 0 8px 24px rgba(31, 83, 76, .05); }
.answer-progress.is-compact {
  position: relative;
  border-radius: 12px;
  box-shadow: 0 5px 16px rgba(31, 83, 76, .045);
}
.answer-progress.is-compact > header {
  min-height: 38px;
  padding: 8px 78px 5px 12px;
  border-bottom: 0;
}
.answer-progress.is-compact .progress-heading { gap: 7px; font-size: 11px; }
.answer-progress.is-compact .progress-spinner { width: 13px; height: 13px; border-width: 1.5px; }
.answer-progress.is-compact .progress-timer { font-size: 9px; }
.answer-progress.is-compact .progress-stages {
  display: flex;
  overflow-x: auto;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 12px 8px;
  scrollbar-width: none;
}
.answer-progress.is-compact .progress-stages::-webkit-scrollbar { display: none; }
.answer-progress.is-compact .progress-stages li {
  min-height: 22px;
  gap: 5px;
  padding: 3px 7px 3px 4px;
  border: 1px solid #e0e9e7;
  border-radius: 999px;
  background: rgba(255,255,255,.64);
  font-size: 9px;
  white-space: nowrap;
}
.answer-progress.is-compact .progress-stages li:not(:last-child)::after { display: none; }
.answer-progress.is-compact .progress-stage-marker {
  flex-basis: 14px;
  width: 14px;
  height: 14px;
  font-size: 7px;
}
.answer-progress.is-compact .progress-stages li.is-active .progress-stage-marker {
  box-shadow: 0 0 0 2px rgba(34,168,132,.09);
}
.answer-progress.is-compact > footer {
  position: absolute;
  top: 6px;
  right: 7px;
  display: block;
  min-height: 0;
  padding: 0;
  border-top: 0;
  background: transparent;
}
.answer-progress.is-compact .progress-hint { display: none; }
.answer-progress.is-compact .progress-cancel { padding: 4px 7px; font-size: 9px; }
.answer-progress.is-compact + .streaming-answer-copy {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 0;
}
.streaming-answer-copy {
  margin-top: 18px;
  padding: 18px 4px 2px;
  border-top: 1px solid var(--line);
  animation: streaming-answer-in .25s ease-out;
}
.streaming-answer-copy::after {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -.12em;
  border-radius: 2px;
  background: var(--teal);
  animation: streaming-caret 1s steps(1) infinite;
  content: "";
}
.answer-notice { display: grid; width: min(100%, 570px); gap: 5px; padding: 14px 16px; border: 1px solid #dfe8e6; border-radius: 13px; color: #6f817d; background: #f7faf9; font-size: 11px; }
.answer-notice strong { color: #344f4a; font-size: 12px; }
.typing { display: flex; gap: 5px; padding: 8px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #84aaa3; animation: pulse 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }
@keyframes pulse { 0%, 60%, 100% { opacity: .28; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@keyframes progress-spin { to { transform: rotate(360deg); } }
@keyframes progress-marker { 0%, 100% { box-shadow: 0 0 0 3px rgba(34,168,132,.08); } 50% { box-shadow: 0 0 0 7px rgba(34,168,132,.13); } }
@keyframes streaming-answer-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes streaming-caret { 0%, 48% { opacity: 1; } 49%, 100% { opacity: 0; } }

.sources { margin-top: 18px; border-top: 1px solid var(--line); }
.sources summary { display: inline-flex; align-items: center; gap: 7px; padding: 13px 2px 4px; color: var(--teal-dark); font-size: 12px; font-weight: 700; cursor: pointer; list-style: none; }
.sources summary::-webkit-details-marker { display: none; }
.sources summary::before { content: "▸"; transition: transform .2s; }
.sources[open] summary::before { transform: rotate(90deg); }
.source-list { display: grid; gap: 8px; margin-top: 8px; }
.source-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf9; }
.source-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.source-heading { display: flex; min-width: 0; flex: 1; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.source-card strong { color: var(--navy); font-size: 12px; }
.source-card span { flex: 0 0 auto; color: #84928f; font-size: 10px; }
.source-badge { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; color: #176b5f; background: #e1f1ed; font-size: 9px; font-weight: 750; }
.source-badge-standard { color: #72521b; background: #f7edcf; }
.source-badge-journal_article { color: #315d88; background: #e4eef8; }
.source-badge-plant_data, .source-badge-plant_document { color: #176b5f; background: #e1f1ed; }
.source-metadata { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.source-metadata span { padding: 3px 7px; border: 1px solid #dde7e4; border-radius: 6px; color: #667774; background: #fff; line-height: 1.35; }
.source-card p { display: -webkit-box; overflow: hidden; margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }

.composer-wrap { flex: 0 0 auto; padding: 14px max(24px, calc((100% - 840px) / 2)) 18px; background: linear-gradient(180deg, rgba(255,255,255,.75), #fff 24%); }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 8px 8px 8px 18px; border: 1px solid #d8e1df; border-radius: 18px; background: #fff; box-shadow: 0 8px 30px rgba(24, 54, 57, .08); transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: #91beb5; box-shadow: 0 10px 34px rgba(19, 105, 92, .12); }
.composer textarea { min-height: 40px; max-height: 145px; flex: 1; resize: none; padding: 9px 0 6px; border: 0; outline: 0; color: var(--ink); background: transparent; line-height: 1.55; }
.composer textarea::placeholder { color: #9ca9a7; }
.composer button { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border: 0; border-radius: 13px; color: #fff; background: var(--teal); cursor: pointer; transition: .2s; }
.composer button:hover:not(:disabled) { background: var(--teal-dark); transform: translateY(-1px); }
.composer button:disabled { color: #a8b5b2; background: #edf1f0; cursor: not-allowed; }
.composer button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.composer-wrap > p { margin: 8px 0 0; color: #98a3a1; font-size: 10px; text-align: center; }
.sidebar-backdrop { display: none; }

@media (max-width: 760px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; transform: translateX(-102%); transition: transform .25s ease; box-shadow: 20px 0 60px rgba(20, 42, 45, .16); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 8; inset: 0; background: rgba(20, 40, 43, .28); }
  .sidebar-backdrop.open { display: block; }
  .menu-button, .header-new-chat { display: grid; }
  .topbar { min-height: 62px; padding: 0 58px; }
  .assistant-title strong { font-size: 13px; }
  .assistant-title > small { font-size: 8px; }
  .welcome { width: min(100% - 28px, 620px); padding-top: 46px; }
  .welcome > p { padding: 0 16px; }
  .suggestions { grid-template-columns: 1fr; }
  .suggestions button { min-height: 76px; }
  .messages { width: calc(100% - 28px); padding-top: 28px; }
  .composer-wrap { padding: 10px 14px 12px; }
  .answer-progress > header, .answer-progress > footer { align-items: flex-start; }
  .answer-progress > footer { flex-direction: column; }
  .progress-cancel { align-self: flex-end; }
}

@media (max-width: 980px) {
  .login-layout { width: min(520px, calc(100% - 40px)); grid-template-columns: 1fr; align-content: center; gap: 24px; padding: 28px 0; }
  .login-story { display: block; min-height: 0; }
  .login-brand { justify-content: center; }
  .login-story-copy { margin: 30px 0 0; text-align: center; }
  .login-kicker { font-size: 11px; }
  .login-story h1 { margin-top: 19px; font-size: clamp(30px, 7vw, 39px); line-height: 1.22; }
  .login-story-copy > p, .login-capabilities, .login-platform-status { display: none; }
  .login-card { padding: 34px 34px 29px; }
  .login-network { opacity: .48; }
  .login-screen::before { mask-image: linear-gradient(rgba(0,0,0,.7), transparent 90%); }
}

@media (max-width: 560px) {
  .login-layout { width: calc(100% - 28px); gap: 19px; padding: 20px 0; }
  .login-brand-mark { width: 43px; height: 43px; border-radius: 13px; }
  .login-brand-mark svg { width: 31px; }
  .login-brand strong { font-size: 16px; }
  .login-story-copy { margin-top: 21px; }
  .login-kicker { padding: 6px 10px; font-size: 10px; }
  .login-story h1 { margin-top: 15px; font-size: 27px; letter-spacing: -.045em; }
  .login-card { padding: 27px 21px 24px; border-radius: 21px; }
  .login-card h2 { font-size: 22px; }
  .login-lead { margin: 18px 0 24px; font-size: 11px; }
  .login-form { gap: 17px; }
  .login-input { min-height: 50px; }
  .login-input input { height: 48px; }
  .login-submit { min-height: 51px; }
  .login-security-note { margin-top: 21px; padding-top: 18px; }
  .login-panel-footer, .login-panel-topline { display: none; }
}

@media (max-height: 740px) and (min-width: 981px) {
  .login-layout { padding: 28px 0; }
  .login-story { min-height: calc(100vh - 56px); min-height: calc(100svh - 56px); }
  .login-story h1 { margin-top: 20px; font-size: clamp(40px, 4vw, 57px); }
  .login-story-copy > p { margin-top: 17px; }
  .login-capabilities { margin-top: 25px; }
  .login-card { padding-top: 30px; padding-bottom: 27px; }
  .login-lead { margin: 17px 0 23px; }
  .login-form { gap: 16px; }
  .login-security-note { margin-top: 20px; padding-top: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-network, .login-spinner, .typing i, .progress-spinner, .progress-stages li.is-active .progress-stage-marker, .streaming-answer-copy, .streaming-answer-copy::after { animation: none; }
  .login-submit, .login-submit::before, .login-input, .sidebar { transition: none; }
}

@media (max-height: 720px) and (min-width: 761px) {
  .welcome { padding-top: 40px; }
  .welcome-mark { margin-bottom: 14px; }
  .welcome > p { margin: 10px 0 20px; }
  .suggestions button { min-height: 72px; }
}
