:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #1a1d21;
  --muted: #6b7280;
  --line: #e8eaed;
  --accent: #0d7a56;
  --accent-soft: #e8f5ef;
  --user: #0d7a56;
  --bot: #ffffff;
  --radius: 16px;
  --side-w: 260px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
}
#app { display: flex; height: 100%; }
.sidebar {
  width: var(--side-w);
  background: #111827;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
}
.brand {
  padding: 16px 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
  font-family: Outfit, "Noto Sans SC", sans-serif;
  font-weight: 700;
  font-size: 20px;
  flex: 1;
  letter-spacing: -.02em;
}
.btn-new {
  border: 1px solid rgba(255,255,255,.18);
  background: transparent;
  color: #fff;
  border-radius: 10px;
  height: 34px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 13px;
}
.btn-new:hover { background: rgba(255,255,255,.08); }
.sess-list { flex: 1; overflow: auto; padding: 10px; }
.sess-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: #d1d5db;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sess-item:hover, .sess-item.active { background: rgba(255,255,255,.08); color: #fff; }
.side-foot {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  gap: 16px;
  font-size: 13px;
}
.side-foot a { color: #9ca3af; text-decoration: none; }
.side-foot a:hover { color: #fff; }

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    radial-gradient(800px 400px at 50% -20%, #dff3ea 0%, transparent 60%),
    var(--bg);
}
.topbar {
  height: 52px;
  display: none;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
}
.top-title { flex: 1; font-weight: 600; font-size: 15px; }
.top-dl {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.icon-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  width: 36px;
  height: 36px;
  cursor: pointer;
}
.chat {
  flex: 1;
  overflow: auto;
  padding: 24px 16px 12px;
}
.welcome {
  max-width: 720px;
  margin: 8vh auto 0;
  text-align: center;
}
.w-brand {
  font-family: Outfit, "Noto Sans SC", sans-serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.03em;
}
.w-sub { margin-top: 10px; color: var(--muted); font-size: 15px; }
.suggests {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.suggests button {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}
.suggests button:hover { border-color: var(--accent); color: var(--accent); }
.msgs {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 12px;
}
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg.user { flex-direction: row-reverse; }
.avatar {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex: none;
}
.msg.assistant .avatar { background: var(--accent-soft); color: var(--accent); }
.msg.user .avatar { background: var(--accent); color: #fff; }
.bubble {
  max-width: min(100%, 640px);
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.65;
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.assistant .bubble {
  background: var(--bot);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.msg.user .bubble { background: var(--user); color: #fff; }
.bubble.typing::after {
  content: "…";
  animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: .3; } }

.composer-wrap {
  padding: 8px 16px 18px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 10px 10px 14px;
  box-shadow: 0 8px 24px rgba(17,24,39,.06);
}
.composer textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  max-height: 140px;
  font: inherit;
  line-height: 1.5;
  background: transparent;
  padding: 6px 0;
}
.composer button {
  width: 40px; height: 40px; border-radius: 12px;
  border: none; background: var(--accent); color: #fff;
  font-size: 18px; cursor: pointer; flex: none;
}
.composer button:disabled { opacity: .45; cursor: default; }
.tip {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}
.mask {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 15;
}

/* H5 / narrow */
@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .topbar { display: flex; }
  .mask.show { display: block; }
  .welcome { margin-top: 6vh; }
  .w-brand { font-size: 34px; }
  body.is-mobile .tip { display: none; }
}
