:root {
  --ink: #171b27;
  --ink-2: #626b7a;
  --ink-3: #94a0b3;
  --line: rgba(126, 143, 164, 0.18);
  --panel: #f7f9fc;
  --nav: #eef3fb;
  --blue: #4d8cff;
  --blue-soft: #d9e9ff;
  --green: #1f9f68;
  --orange: #df8a24;
  --red: #e14b5a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #f4f6fa;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 216px 432px minmax(720px, 1fr);
  background: #fff;
}

.global-nav {
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-height: 100vh;
  padding: 22px 16px 18px;
  background: var(--nav);
  border-right: 1px solid rgba(126, 143, 164, 0.12);
}

.workspace-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 500;
}

.workspace-mark img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.main-nav,
.app-list {
  display: grid;
  gap: 8px;
}

.main-nav button,
.app-list button {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border-radius: 9px;
  color: #56637a;
  background: transparent;
  font-size: 18px;
  text-align: left;
}

.main-nav button.is-active {
  color: #293143;
  background: rgba(70, 95, 145, 0.12);
  font-weight: 520;
}

.nav-icon,
.app-dot {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px currentColor;
}

.chat-icon {
  border-radius: 4px 4px 4px 1px;
}

.link-icon {
  border-radius: 50%;
}

.app-list {
  padding-top: 18px;
  border-top: 1px solid rgba(126, 143, 164, 0.2);
}

.app-list p {
  margin: 0 0 8px;
  color: #8f9bad;
  font-size: 15px;
}

.app-list button {
  position: relative;
  min-height: 45px;
}

.app-list button i {
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-radius: 50%;
  background: #ff4b5c;
}

.app-dot {
  box-shadow: none;
}

.sop { color: #836bff; box-shadow: inset 0 0 0 2px currentColor; }
.memo { color: #25c979; box-shadow: inset 0 0 0 2px currentColor; }
.follow { color: #20c5df; box-shadow: inset 0 0 0 2px currentColor; }
.vote { color: #1da1ff; box-shadow: inset 0 0 0 2px currentColor; }
.calendar { color: #ff9d25; box-shadow: inset 0 0 0 2px currentColor; }

.user-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-footer span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #bcc5d6, #727d91);
}

.user-footer button {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: transparent;
  box-shadow: inset 0 0 0 2px #74839a;
}

.flow-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 0;
  background: #fbfcfe;
  border-right: 1px solid rgba(126, 143, 164, 0.14);
}

.flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.flow-head h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 620;
}

.flow-tools {
  display: flex;
  gap: 12px;
}

.flow-tools button,
.topbar-action {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #7a879b;
  background: transparent;
}

svg {
  width: 22px;
  height: 22px;
}

path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kiki-flow-card {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 17px;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(39, 157, 255, 0.62);
  text-align: left;
}

.kiki-flow-card img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.kiki-flow-card span {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.kiki-flow-card strong {
  font-size: 19px;
  font-weight: 560;
}

.kiki-flow-card small {
  max-width: 250px;
  overflow: hidden;
  color: #8c98aa;
  font-size: 15px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.flow-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 38px 0 28px;
  padding: 5px;
  border-radius: 15px;
  background: #f0f2f5;
}

.flow-tabs button {
  height: 42px;
  border-radius: 11px;
  color: #8b95a8;
  background: transparent;
  font-size: 17px;
}

.flow-tabs button.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 3px rgba(30, 45, 80, 0.04);
  font-weight: 520;
}

.flow-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
}

.flow-list p {
  margin: 0 0 14px;
  color: #98a3b5;
  font-size: 15px;
}

.flow-list button {
  width: 100%;
  min-height: 50px;
  display: block;
  overflow: hidden;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font-size: 18px;
  line-height: 1.45;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-workspace {
  position: relative;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.chat-topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px 0 20px;
  border-bottom: 1px solid rgba(126, 143, 164, 0.12);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-action.is-active {
  color: var(--ink);
  background: #f3f6fb;
  border-radius: 9px;
}

.kiki-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kiki-title img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.kiki-title div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kiki-title strong {
  font-size: 19px;
  font-weight: 620;
}

.kiki-title span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #1aa566;
  background: #eaf9f1;
  font-size: 13px;
}

.kiki-title span i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.brief-shell {
  position: absolute;
  top: 92px;
  right: 34px;
  z-index: 20;
  width: 382px;
  margin: 0;
}

.brief-panel {
  width: 100%;
  min-height: 430px;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  margin-top: 0;
  padding: 22px 22px 28px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(126, 143, 164, 0.14),
    0 24px 60px rgba(40, 55, 100, 0.16);
}

.brief-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
}

.brief-panel h2 {
  margin: 0;
  color: #8d98aa;
  font-size: 13px;
  line-height: 1;
  font-weight: 400;
}

.brief-panel p {
  display: none;
}

.brief-group {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  padding: 16px 0;
  border-top: 1px solid rgba(126, 143, 164, 0.13);
}

.brief-group time {
  padding-top: 8px;
  color: #4f5663;
  line-height: 1;
}

.brief-group time svg {
  width: 17px;
  height: 17px;
  display: block;
}

.brief-group time path,
.brief-group time circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brief-group time .filled {
  fill: currentColor;
  stroke: none;
}

.brief-items {
  display: grid;
  gap: 14px;
}

.brief-item {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  padding: 0;
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.brief-item:hover {
  background: transparent;
}

.brief-item span {
  display: grid;
  place-items: start center;
  width: 17px;
  height: 17px;
  margin-top: 3px;
}

.brief-item span svg {
  width: 17px;
  height: 17px;
}

.brief-item span path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brief-item.done span { color: #20a66a; }
.brief-item.need span { color: #e4933a; }
.brief-item.remind span { color: #d84545; }

.brief-item strong {
  color: #65686f;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}

.brief-item b {
  display: inline-block;
  margin-right: 2px;
  color: var(--ink);
  font-weight: 600;
}

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 86px max(48px, calc((100% - 880px) / 2)) 200px;
  transition: transform 180ms ease;
}

.chat-workspace.brief-open .chat-scroll {
  transform: translateX(-180px);
}

.message {
  max-width: 880px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.7;
}

.message p {
  margin: 0;
}

.assistant-message {
  align-self: flex-start;
}

.assistant-message button {
  margin-top: 18px;
  padding: 0;
  color: #8b99ad;
  background: transparent;
  font-size: 15px;
}

.user-message {
  align-self: flex-end;
  padding: 16px 20px;
  border-radius: 18px 18px 4px 18px;
  background: #cfe3ff;
}

.user-message.wide {
  max-width: 880px;
  padding: 18px 22px;
  border-radius: 16px;
}

.composer {
  position: absolute;
  left: 50%;
  bottom: 26px;
  width: min(880px, calc(100% - 96px));
  min-height: 128px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;
  padding: 20px 20px 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    inset 0 0 0 1px rgba(126, 143, 164, 0.12),
    0 18px 44px rgba(40, 55, 100, 0.1);
  transform: translateX(-50%);
  transition: left 180ms ease;
}

.chat-workspace.brief-open .composer {
  left: calc(50% - 180px);
}

.composer textarea {
  width: 100%;
  resize: none;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
  font-size: 18px;
}

.composer textarea::placeholder {
  color: #a4adbb;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.composer-actions button {
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(126, 143, 164, 0.16);
  font-size: 16px;
}

.composer-actions button:first-child,
.composer-actions .send {
  width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
}

.composer-actions .send {
  margin-left: auto;
  color: #fff;
  background: #d4dbe6;
  box-shadow: none;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 84px 360px minmax(560px, 1fr);
  }

  .brief-shell {
    right: 24px;
    width: 350px;
  }

  .chat-workspace.brief-open .chat-scroll {
    transform: translateX(-150px);
  }

  .chat-workspace.brief-open .composer {
    left: calc(50% - 150px);
  }

  .workspace-mark span,
  .main-nav button,
  .app-list p,
  .app-list button {
    font-size: 0;
  }

  .main-nav button,
  .app-list button {
    justify-content: center;
    padding: 0;
  }
}
