:root {
  --brand: #111111;
  --brand-deep: #000000;
  --sidebar-w: 258px;
  --sidebar-bg: #f5f5f5;
  --sidebar-line: transparent;
  --sidebar-text: #2b2b2b;
  --sidebar-hover: rgba(17, 17, 17, 0.055);
  --sidebar-active: #ffffff;
  --sidebar-active-text: #111111;
  --main-bg: #ffffff;
  --chat-width: 820px;
  --composer-width: 760px;
  --composer-radius: 28px;
  --composer-bg: #ffffff;
  --composer-border: #e6e6e6;
  --composer-shadow: 0 12px 42px rgba(17, 17, 17, 0.07), 0 2px 8px rgba(17, 17, 17, 0.03);
  --composer-focus-shadow: 0 12px 42px rgba(17, 17, 17, 0.07), 0 0 0 4px rgba(17, 17, 17, 0.045);
  --user-bubble: #f2f2f2;
  --user-text: #171717;
  --send-bg: #111111;
  --send-color: #ffffff;
  --avatar-bg: #f2f2f2;
  --top-link: #4a4a4a;
  --hrx-link: #2f6bff;
  --hrx-hover: rgba(47, 107, 255, 0.08);
  --icon-color: #5c5c5c;
  --tool-color: #4a4a4a;
  --placeholder: #a6a6a6;
  --assistant-avatar-size: 30px;
  --kimi-blue: #2f6bff;
}

body {
  background: #ffffff;
  color: #171717;
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(17, 17, 17, 0.45);
  outline-offset: 2px;
}

.composer textarea:focus-visible { outline: none; }

/* Sidebar --------------------------------------------------------- */

.sidebar {
  background: var(--sidebar-bg);
  border-right: 0;
}

.sidebar-top {
  padding: 16px 14px 8px;
  min-height: 58px;
}

.kimi-brand {
  gap: 0;
  line-height: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(17, 17, 17, 0.14);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.sidebar-collapse {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #6f6f6f;
}

.sidebar-collapse:hover { background: rgba(17, 17, 17, 0.06); color: #171717; }
.sidebar-collapse .icon { font-size: 17px; }

.kimi-new {
  width: calc(100% - 20px);
  margin: 2px 10px 6px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #1d1d1d;
  font-size: 14px;
  font-weight: 500;
}

.kimi-new:hover { background: rgba(17, 17, 17, 0.06); }
.kimi-new .icon { font-size: 17px; }

.kimi-new .side-extra {
  color: #9a9a9a;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.side-nav {
  padding: 2px 10px;
  gap: 1px;
}

.side-nav-tight { padding-top: 0; }

.side-item {
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 9px;
  color: #333333;
  font-size: 13.5px;
}

.side-item .icon { font-size: 16px; opacity: 0.78; }
.side-item:hover { background: rgba(17, 17, 17, 0.055); }

.side-label {
  padding: 17px 20px 6px;
  color: #a0a0a0;
  font-size: 11.5px;
}

.kimi-new-badge {
  margin-left: auto;
  padding: 1px 5px;
  border-radius: 4px;
  background: #e9efff;
  color: var(--kimi-blue);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.5;
}

.kimi-login-hint {
  padding: 1px 22px 10px;
  color: #a3a3a3;
  font-size: 12px;
  line-height: 1.6;
}

.kimi-history { padding: 0 10px; }

.history-item {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  color: #3a3a3a;
  font-size: 13px;
}

.history-item:hover { background: rgba(17, 17, 17, 0.055); }

.history-item.active {
  background: #ffffff;
  color: #111111;
  box-shadow: 0 1px 3px rgba(17, 17, 17, 0.06);
}

.history-time { color: #a6a6a6; }

.sidebar-footer {
  gap: 2px;
  padding: 10px 12px 14px;
  border-top: 1px solid rgba(17, 17, 17, 0.06);
}

.sidebar-footer .side-item {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12.5px;
}

.kimi-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: #111111;
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
}

/* Main / top bar -------------------------------------------------- */

.main { background: #ffffff; }

.kimi-topbar {
  min-height: 62px;
  padding: 0 20px;
  background: #ffffff;
  border-bottom: 0;
}

.topbar-right { gap: 4px; }

.kimi-hrx {
  color: var(--hrx-link);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 9px;
}

.kimi-hrx:hover { background: var(--hrx-hover); }

.kimi-top-login {
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  color: #3c3c3c;
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.kimi-top-login:hover { background: #f4f4f4; color: #111111; }

.kimi-top-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  margin-left: 2px;
  padding: 0 15px;
  border: 1px solid #e4e4e4;
  border-radius: 999px;
  background: #ffffff;
  color: #2b2b2b;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.kimi-top-download .icon { font-size: 14px; color: #555555; }

.kimi-top-download:hover {
  background: #f7f7f7;
  border-color: #d8d8d8;
}

/* Welcome / hero -------------------------------------------------- */

.chat-scroll {
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.kimi-welcome {
  position: relative;
  flex: 1 0 auto;
  justify-content: flex-start;
  gap: 30px;
  padding: clamp(80px, 15.5vh, 160px) 24px 26px;
}

.kimi-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
}

.kimi-hero-icon {
  width: 76px;
  height: 76px;
  flex: none;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.18);
}

.welcome h1.kimi-wordmark {
  margin: 0;
  color: #111111;
  font-family: "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", sans-serif;
  font-size: clamp(66px, 8.4vw, 94px);
  font-weight: 800;
  line-height: 0.94;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  user-select: none;
}

/* Composer ------------------------------------------------------- */

.composer-hero-slot { width: 100%; }
.composer-bottom-slot { padding-top: 8px; }

.kimi-composer {
  width: min(var(--composer-width), 100%);
  padding: 16px 18px 11px;
  border: 1px solid var(--composer-border);
  border-radius: var(--composer-radius);
  background: var(--composer-bg);
  box-shadow: var(--composer-shadow);
}

.kimi-composer:focus-within {
  border-color: #cfcfcf;
  box-shadow: var(--composer-focus-shadow);
}

.kimi-composer textarea {
  min-height: 54px;
  padding: 2px 4px 0;
  font-size: 15.5px;
  line-height: 1.7;
}

.kimi-composer .composer-tools {
  margin-top: 1px;
  gap: 8px;
}

.kimi-composer .composer-tools-right { gap: 2px; }

.kimi-plus {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #4d4d4d;
}

.kimi-plus .icon { font-size: 19px; }

.kimi-model {
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  color: #3c3c3c;
  font-size: 12.5px;
  font-weight: 500;
  gap: 4px;
}

.kimi-model::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--kimi-blue);
}

.kimi-model .icon { font-size: 14px; color: #8d8d8d; }
.kimi-model:hover { background: #f5f5f5; color: #111111; }
.kimi-model[aria-expanded="true"] { background: #f2f2f2; }

.kimi-model [data-model-label] {
  display: block;
  max-width: min(150px, 34vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kimi-composer .icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #555555;
}

.kimi-composer .icon-btn .icon { font-size: 17px; }
.kimi-composer .icon-btn:hover { background: #f5f5f5; color: #111111; }

.kimi-composer .send-btn {
  width: 32px;
  height: 32px;
  margin-left: 2px;
  background: #111111;
}

.kimi-composer .send-btn .icon { font-size: 16px; }

.kimi-composer .send-btn:disabled {
  background: #e9e9e9;
  color: #ffffff;
  opacity: 1;
}

.kimi-composer .send-btn:not(:disabled):hover { background: #2c2c2c; }
.kimi-composer .stop-btn { background: #111111; color: #ffffff; }

.kimi-composer-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #f0f0f0;
}

.kimi-bar-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  color: #777777;
  font-size: 12.5px;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.kimi-bar-item .icon { font-size: 14px; }
.kimi-bar-item:hover { background: #f5f5f5; color: #222222; }

/* Prompt chips --------------------------------------------------- */

.kimi-prompt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: min(720px, 100%);
  padding: 0 4px;
}

.kimi-prompt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 37px;
  padding: 0 14px;
  border: 1px solid #e8e8e8;
  border-radius: 999px;
  background: #ffffff;
  color: #3d3d3d;
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.025);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.kimi-prompt .icon { font-size: 15px; color: #626262; }
.kimi-prompt:hover { background: #f7f7f7; border-color: #dddddd; color: #111111; }
.kimi-prompt:active { transform: translateY(0.5px); }

/* Footer --------------------------------------------------------- */

.kimi-footer {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 150px 12px;
}

.kimi-legal {
  max-width: 100%;
  overflow: hidden;
  color: #b0b0b0;
  font-size: 10.5px;
  line-height: 1.6;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kimi-explore {
  position: absolute;
  right: 18px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  color: #8a8a8a;
  font-size: 12px;
  transition: background 0.15s ease, color 0.15s ease;
}

.kimi-explore .icon { font-size: 14px; }
.kimi-explore:hover { background: #f4f4f4; color: #333333; }

/* Chat messages -------------------------------------------------- */

.messages {
  padding-top: 28px;
  padding-bottom: 28px;
}

.message.assistant { gap: 11px; }

.assistant-avatar {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f2f2f2;
  color: #111111;
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.08);
}

.assistant-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 8px;
}

.assistant-head {
  color: #222222;
  font-size: 13px;
  font-weight: 600;
}

.model-chip {
  background: #f3f3f3;
  color: #8b8b8b;
}

.assistant-content {
  color: #232323;
  font-size: 14.5px;
  line-height: 1.78;
}

.assistant-content a { color: var(--kimi-blue); }
.assistant-content blockquote { border-left-color: #cfcfcf; color: #777777; }

.message.user .bubble {
  background: #f2f2f2;
  color: #171717;
  border-radius: 17px 17px 5px 17px;
}

.assistant-actions button:hover,
.user-actions button:hover {
  background: #f2f2f2;
  color: #111111;
}

.message-error {
  background: #fff2f2;
  color: #c0392b;
}

.typing-indicator i { background: #111111; }

/* Chat mode ------------------------------------------------------ */

.has-messages .chat-scroll {
  flex: 1 1 auto;
}

.kimi-bottom-slot {
  padding: 10px 20px 6px;
}

.kimi-bottom-slot .kimi-composer {
  box-shadow: 0 8px 30px rgba(17, 17, 17, 0.06);
}

.kimi-bottom-slot .kimi-composer-bar {
  display: none;
}

.has-messages .kimi-footer {
  justify-content: flex-start;
  padding: 2px 24px 8px;
}

.has-messages .kimi-legal {
  text-align: left;
  color: #b8b8b8;
}

.has-messages .kimi-explore { display: none; }

/* Sidebar drawer ------------------------------------------------- */

@media (max-width: 860px) {
  :root { --sidebar-w: 258px; }

  .sidebar {
    width: 268px;
    flex-basis: 268px;
    box-shadow: 20px 0 48px rgba(17, 17, 17, 0.14);
  }

  .kimi-topbar {
    min-height: 56px;
    padding: 0 12px;
  }

  .kimi-welcome {
    gap: 24px;
    padding: 46px 16px 20px;
  }

  .welcome h1.kimi-wordmark {
    font-size: clamp(52px, 15vw, 64px);
    letter-spacing: 0.1em;
    text-indent: 0.1em;
  }

  .kimi-hero { gap: 12px; }
  .kimi-hero-icon { width: 54px; height: 54px; border-radius: 14px; }

  .kimi-composer {
    --composer-radius: 22px;
    padding: 13px 14px 9px;
  }

  .kimi-composer textarea {
    min-height: 44px;
    font-size: 15px;
  }

  .kimi-top-download span:last-child { display: none; }
  .kimi-top-download { width: 34px; height: 34px; padding: 0; justify-content: center; }
  .kimi-top-login { padding: 0 10px; }
  .kimi-hrx { padding: 6px 6px; }

  .kimi-prompt-row {
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    padding: 2px 2px 6px;
  }

  .kimi-prompt { height: 34px; padding: 0 12px; font-size: 12.5px; }

  .kimi-footer {
    justify-content: center;
    min-height: 30px;
    padding: 4px 14px calc(9px + env(safe-area-inset-bottom));
  }

  .kimi-legal-extra { display: none; }
  .kimi-legal { font-size: 9.5px; }
  .kimi-explore { display: none; }

  .kimi-bottom-slot { padding: 8px 12px 4px; }
  .has-messages .kimi-footer { justify-content: center; padding: 2px 14px calc(7px + env(safe-area-inset-bottom)); }
  .has-messages .kimi-legal { text-align: center; }

  .messages { padding: 20px 16px 24px; }
}

@media (max-width: 520px) {
  .kimi-hrx { font-size: 12px; }
  .kimi-top-login { display: none; }
  .kimi-topbar { padding: 0 10px; }

  .kimi-welcome { padding-top: 38px; gap: 20px; }

  .welcome h1.kimi-wordmark { font-size: 48px; }

  .kimi-composer-bar { display: none; }
  .kimi-model::before { display: none; }
  .kimi-model { padding: 0 6px; font-size: 12px; }

  .kimi-footer { padding-bottom: 8px; }
  .kimi-legal {
    padding: 0 4px;
    font-size: 9px;
  }
}
