:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(9, 20, 38, 0.82);
  --panel-strong: rgba(13, 28, 52, 0.94);
  --text: #e9f4ff;
  --muted: #8fa6c4;
  --line: rgba(119, 226, 255, 0.22);
  --accent: #20e0ff;
  --accent-2: #7c5cff;
  --accent-3: #22f6a4;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 18% 12%, rgba(32, 224, 255, 0.28), transparent 30%),
    radial-gradient(circle at 78% 18%, rgba(124, 92, 255, 0.24), transparent 32%),
    linear-gradient(135deg, #06101e 0%, #081a31 48%, #050914 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(119, 226, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 226, 255, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.86), transparent 88%);
}

body::after {
  content: "";
  position: fixed;
  width: 520px;
  height: 520px;
  right: -180px;
  bottom: -180px;
  pointer-events: none;
  border: 1px solid rgba(32, 224, 255, 0.22);
  border-radius: 50%;
  box-shadow:
    0 0 80px rgba(32, 224, 255, 0.18),
    inset 0 0 90px rgba(124, 92, 255, 0.12);
}

.shell {
  position: relative;
  width: min(1120px, calc(100vw - 32px));
  margin: 28px auto;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 4px;
}

h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  width: max-content;
  margin-bottom: 10px;
  padding: 5px 9px;
  border: 1px solid rgba(34, 246, 164, 0.42);
  border-radius: 999px;
  color: var(--accent-3);
  background: rgba(34, 246, 164, 0.08);
  font-size: 12px;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: 0 0 28px rgba(32, 224, 255, 0.28);
}

.topbar p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
}

.status {
  min-width: 112px;
  padding: 10px 14px;
  border: 1px solid rgba(32, 224, 255, 0.36);
  border-radius: 8px;
  background: rgba(5, 13, 26, 0.72);
  color: var(--accent);
  text-align: center;
  font-size: 14px;
  box-shadow: 0 0 26px rgba(32, 224, 255, 0.16);
}

.layout {
  display: block;
}

.chat {
  position: relative;
  height: clamp(500px, calc(100vh - 220px), 640px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(13, 28, 52, 0.92), rgba(7, 14, 28, 0.92)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow), 0 0 60px rgba(32, 224, 255, 0.12);
  backdrop-filter: blur(18px);
}

.chat::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(32, 224, 255, 0.18), transparent) 0 0 / 100% 1px no-repeat,
    radial-gradient(circle at 50% 0%, rgba(32, 224, 255, 0.12), transparent 34%);
}

.answer {
  position: relative;
  flex: 1;
  padding: 30px;
  white-space: pre-wrap;
  line-height: 1.78;
  font-size: 16px;
  color: #eef8ff;
}

.empty {
  color: var(--muted);
}

.keyword-bar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 14px 18px 0;
  border-top: 1px solid rgba(119, 226, 255, 0.18);
}

.keyword-bar button {
  min-width: 54px;
  height: 34px;
  border: 1px solid rgba(32, 224, 255, 0.26);
  border-radius: 999px;
  background: rgba(32, 224, 255, 0.08);
  color: #dff8ff;
  font-size: 13px;
  padding: 0 12px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.keyword-bar button:hover {
  border-color: rgba(34, 246, 164, 0.68);
  background: rgba(34, 246, 164, 0.13);
  box-shadow: 0 0 18px rgba(34, 246, 164, 0.16);
  transform: translateY(-1px);
}

.composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
  padding: 12px 18px 18px;
}

.composer input {
  height: 48px;
  border: 1px solid rgba(119, 226, 255, 0.26);
  border-radius: 8px;
  padding: 0 15px;
  background: rgba(3, 10, 22, 0.76);
  color: var(--text);
  font-size: 15px;
  outline: none;
  box-shadow: inset 0 0 22px rgba(32, 224, 255, 0.05);
}

.composer input::placeholder {
  color: rgba(143, 166, 196, 0.82);
}

.composer input:focus {
  border-color: rgba(32, 224, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(32, 224, 255, 0.1), inset 0 0 22px rgba(32, 224, 255, 0.08);
}

.composer button {
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(32, 224, 255, 0.22);
}

.composer button:disabled {
  cursor: wait;
  opacity: 0.7;
}

@media (max-width: 820px) {
  .shell {
    width: min(100vw - 20px, 720px);
    margin: 12px auto;
  }

  .topbar {
    display: block;
  }

  .status {
    width: max-content;
    margin-top: 14px;
  }

  .chat {
    height: calc(100vh - 190px);
    min-height: 520px;
  }

  .answer {
    padding: 22px;
    font-size: 15px;
  }
}
