* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.hl-body {
  display: grid;
  grid-template-columns: 88px 1fr;
  min-height: 100vh;
  background: #fff;
  color: #111;
  font-family: Inter, "PingFang SC", "Noto Sans SC", sans-serif;
}

.hl-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 8px 16px;
  border-right: 1px solid #f0f0f2;
}

.hl-logo img {
  width: 36px;
  height: 36px;
  display: block;
  border-radius: 10px;
}

.hl-rail nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-top: 10px;
}

.hl-rail nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0 8px;
  border-radius: 16px;
  color: #6b6b73;
  text-decoration: none;
  font-size: 11px;
}

.hl-rail nav a svg { width: 22px; height: 22px; }
.hl-rail nav a.is-on,
.hl-rail nav a:hover { background: #f4f4f7; color: #111; }

.hl-new {
  margin-top: auto;
  width: 64px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.hl-history {
  width: 100%;
  max-height: 160px;
  overflow: auto;
  display: block;
}

.hl-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 8vw 28px;
}

.hl-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
body:not(.is-empty) .hl-hero { display: none; }

.hl-hero h1 {
  margin: 0 0 28px;
  font-size: clamp(32px, 4vw, 44px);
  letter-spacing: -0.04em;
  font-weight: 700;
}

.hl-switch {
  display: inline-flex;
  align-items: center;
  margin: 0 8px;
  padding: 4px 14px;
  border-radius: 12px;
  background: #f4f4f7;
  font-size: 0.72em;
  vertical-align: middle;
}

.hl-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 280px));
  gap: 16px;
  width: min(920px, 100%);
}

.hl-cards button {
  appearance: none;
  border: 0;
  text-align: left;
  color: #fff;
  border-radius: 22px;
  min-height: 168px;
  padding: 18px;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(0,0,0,.15), rgba(0,0,0,.55)),
    #1a1a22;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
}

.hl-cards button:nth-child(1) { background-image: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.6)), linear-gradient(135deg, #3a2a4a, #111); }
.hl-cards button:nth-child(2) { background-image: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.6)), linear-gradient(135deg, #2a3a28, #111); }
.hl-cards button:nth-child(3) { background-image: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.6)), linear-gradient(135deg, #2a3348, #111); }

.hl-cards small {
  align-self: flex-start;
  background: #7c5cff;
  color: #fff;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: auto;
}
.hl-cards strong { font-size: 16px; }
.hl-cards span { font-size: 13px; color: rgba(255,255,255,.78); }

.hl-thread {
  flex: 1;
  overflow: auto;
  width: min(820px, 100%);
  margin: 0 auto 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg {
  max-width: 92%;
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.65;
  white-space: pre-wrap;
  font-size: 15px;
}
.msg.user { margin-left: auto; background: #111; color: #fff; }
.msg.assistant { background: #f6f6f8; }
.msg.pending { color: #8a8a92; }

.hl-prompt {
  width: min(920px, 100%);
  margin: 0 auto;
  background: #fff;
  border: 1px solid #ececef;
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(17,17,17,.06);
  padding: 16px 16px 12px;
}

.hl-prompt-top { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 8px; }
.hl-mode {
  border: 1px solid #ececef;
  background: #fff;
  border-radius: 12px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.hl-mode.is-on { background: #f4f4f7; font-weight: 600; }

.hl-prompt textarea {
  width: 100%;
  border: 0;
  resize: none;
  outline: none;
  font: inherit;
  font-size: 15px;
  min-height: 72px;
  color: #111;
}

.hl-prompt-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.hl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hl-chips span {
  border: 1px solid #ececef;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: #4b4b53;
}

.hl-create {
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.hl-create:disabled { opacity: 0.5; }

@media (max-width: 860px) {
  body.hl-body { grid-template-columns: 1fr; }
  .hl-rail { display: none; }
  .hl-cards { grid-template-columns: 1fr; }
}
