:root {
  color-scheme: light;
  --ink: #18202f;
  --muted: #687387;
  --line: #dfe5ee;
  --panel: #ffffff;
  --soft: #f6f8fb;
  --accent: #0d766e;
  --accent-2: #b42318;
  --gold: #b7791f;
  --shadow: 0 24px 70px rgba(21, 31, 48, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  min-height: 100vh;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(13, 118, 110, 0.12), transparent 34%),
    linear-gradient(225deg, rgba(183, 121, 31, 0.12), transparent 30%),
    #eef3f7;
}

button,
input {
  font: inherit;
}

.shell {
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.workspace {
  width: min(1180px, 100%);
  height: min(760px, calc(100vh - 56px));
  max-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar {
  background: #162033;
  color: #f8fafc;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 0;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #e9f8f5;
  color: #0d766e;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.status-card p,
.panel li,
.metric span {
  color: #b8c3d4;
}

.status-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.status-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  background: #34d399;
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.16);
}

.status-card p {
  margin: 5px 0 0;
  line-height: 1.6;
}

.panel {
  padding-top: 8px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 15px;
}

.panel ul {
  margin: 0;
  padding-left: 18px;
  line-height: 2;
}

.metric {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.metric strong {
  color: #d8f8ef;
}

.chat {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-width: 0;
  min-height: 0;
  background: var(--soft);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 32px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.session-pill {
  padding: 8px 12px;
  color: var(--muted);
  background: #f3f6f9;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.quick-row {
  display: flex;
  gap: 10px;
  padding: 16px 32px;
  overflow-x: auto;
  background: var(--panel);
}

.quick-row button,
.composer button {
  border: 0;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

.quick-row button {
  flex: 0 0 auto;
  padding: 9px 13px;
  background: #e7f4f1;
  color: #075f57;
  border: 1px solid #b8ded7;
}

.messages {
  min-height: 0;
  padding: 28px 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.message {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: flex-start;
}

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

.avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  background: #152033;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.message.user .avatar {
  display: none;
}

.bubble {
  max-width: min(620px, 78%);
  padding: 13px 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  line-height: 1.7;
}

.message.user .bubble {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.message.meta .bubble {
  color: var(--gold);
  background: #fff8e8;
  border-color: #f3d49a;
}

.typing {
  width: 48px;
  display: flex;
  gap: 5px;
}

.typing span {
  width: 7px;
  height: 7px;
  background: #9aa5b7;
  animation: blink 1s infinite ease-in-out;
}

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

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

.composer {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 12px;
  padding: 18px 32px 28px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.composer input {
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid var(--line);
  outline: none;
}

.composer input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 118, 110, 0.14);
}

.composer button {
  min-height: 48px;
  font-weight: 700;
}

@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 860px) {
  .shell {
    padding: 0;
  }

  .workspace {
    height: 100vh;
    max-height: 100vh;
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .chat-header,
  .quick-row,
  .messages,
  .composer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .chat-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .bubble {
    max-width: 88%;
  }
}
