body {
  min-height: 100vh;
  overflow: hidden;
  background: #dce9f8;
}

body.is-admin {
  background: #eef3ef;
}

body.is-admin .app-header,
body.is-admin .app-shell,
body.is-admin .workspace-backdrop {
  visibility: hidden;
}

.app-header {
  width: 100%;
  height: 64px;
  padding: 0 clamp(22px, 4vw, 58px);
  position: relative;
  z-index: 20;
  border-bottom: 1px solid rgba(21, 33, 29, 0.08);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 18px;
  box-shadow: 0 6px 18px rgba(11, 79, 64, 0.16);
}

.brand strong {
  font-size: 15px;
}

.brand small {
  font-size: 8px;
  letter-spacing: 0.11em;
}

.header-meta {
  gap: 9px;
}

.header-action {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #cddbd4;
  border-radius: 10px;
  color: #3f544c;
  background: #f9fbf9;
  font-size: 11px;
  font-weight: 700;
}

.header-action:hover {
  border-color: var(--green);
  color: var(--green);
}

.app-shell {
  width: 100%;
  height: calc(100vh - 64px);
  min-height: 0;
  margin: 0;
  display: block;
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(129, 203, 255, 0.64), transparent 28rem),
    radial-gradient(circle at 83% 18%, rgba(225, 186, 219, 0.46), transparent 26rem),
    radial-gradient(circle at 68% 92%, rgba(81, 135, 189, 0.72), transparent 34rem),
    linear-gradient(138deg, #a8caea 0%, #b8cde4 35%, #718fbf 66%, #4d6b9b 100%);
  box-shadow: none;
  backdrop-filter: none;
}

.app-shell::before {
  content: "";
  position: absolute;
  inset: 8% 4% 5%;
  opacity: 0.76;
  background-image:
    radial-gradient(circle at 7% 18%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 17% 73%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 31% 25%, rgba(255, 255, 255, 0.7) 0 1px, transparent 2px),
    radial-gradient(circle at 44% 81%, rgba(255, 255, 255, 0.7) 0 2px, transparent 3px),
    radial-gradient(circle at 62% 32%, rgba(255, 255, 255, 0.75) 0 2px, transparent 3px),
    radial-gradient(circle at 79% 70%, rgba(255, 255, 255, 0.86) 0 2px, transparent 3px),
    radial-gradient(circle at 91% 27%, rgba(255, 255, 255, 0.72) 0 1px, transparent 2px),
    linear-gradient(23deg, transparent 49.8%, rgba(255, 255, 255, 0.2) 50%, transparent 50.2%),
    linear-gradient(155deg, transparent 49.8%, rgba(255, 255, 255, 0.16) 50%, transparent 50.2%),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: auto, auto, auto, auto, auto, auto, auto, 520px 430px, 600px 440px, 64px 64px, 64px 64px;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  pointer-events: none;
}

.app-shell::after {
  content: "";
  position: absolute;
  width: 70vw;
  height: 70vw;
  right: -30vw;
  bottom: -48vw;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  box-shadow:
    0 0 0 7vw rgba(255, 255, 255, 0.035),
    0 0 0 15vw rgba(255, 255, 255, 0.025);
  pointer-events: none;
}

.chat-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  background: transparent;
}

.landing-hero {
  width: min(940px, calc(100% - 48px));
  margin: auto;
  padding: 26px 0 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  color: #fff;
  text-align: center;
  animation: hero-rise 450ms ease both;
}

.hero-avatar {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 25px;
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, 0.28), transparent 40%),
    linear-gradient(145deg, #167b65, #0b4438);
  box-shadow: 0 18px 45px rgba(24, 55, 78, 0.32);
  font-family: "STSong", "Songti SC", serif;
  font-size: 40px;
}

.hero-avatar::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 17px;
  height: 17px;
  border: 4px solid #e5eef6;
  border-radius: 50%;
  background: #62d5a4;
}

.landing-hero h1 {
  margin: 16px 0 0;
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
  font-size: clamp(30px, 3.2vw, 44px);
  font-weight: 700;
  letter-spacing: -0.035em;
  text-shadow: 0 3px 16px rgba(20, 47, 73, 0.2);
}

.hero-welcome-card {
  width: min(800px, 100%);
  margin-top: 18px;
  padding: 16px 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  color: #21342e;
  background: rgba(255, 255, 255, 0.91);
  box-shadow: 0 10px 32px rgba(32, 63, 88, 0.13);
  text-align: left;
  backdrop-filter: blur(16px);
}

.hero-welcome-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
}

.starter-prompts {
  width: min(800px, 100%);
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.starter-prompts button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 10px;
  color: #294238;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 6px 20px rgba(32, 63, 88, 0.09);
  text-align: left;
  font-size: 12px;
  backdrop-filter: blur(12px);
  transition: 160ms ease;
}

.starter-prompts button:hover {
  color: var(--green-dark);
  background: #fff;
  transform: translateX(3px);
}

.chat-log {
  width: min(900px, calc(100% - 48px));
  max-height: none;
  margin: 0;
  padding: 28px 10px 165px;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  overflow-y: auto;
  z-index: 3;
}

.chat-panel.has-conversation .landing-hero {
  display: none;
}

.chat-panel.has-conversation .chat-log {
  display: block;
}

.chat-panel.has-conversation .quick-replies {
  display: flex;
}

.message {
  width: min(78%, 680px);
}

.message.is-agent .message-bubble {
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(12px);
}

.message.is-user .message-bubble {
  border-color: rgba(9, 76, 61, 0.72);
  background: rgba(10, 76, 61, 0.94);
}

.message-meta {
  color: rgba(255, 255, 255, 0.76);
  text-shadow: 0 1px 5px rgba(27, 48, 65, 0.2);
}

.quick-replies {
  width: min(900px, calc(100% - 48px));
  min-height: 0;
  padding: 0 0 115px;
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 4;
  display: none;
  transform: translateX(-50%);
}

.quick-reply {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
}

.composer {
  width: min(900px, calc(100% - 48px));
  position: absolute;
  left: 50%;
  bottom: 31px;
  z-index: 6;
  transform: translateX(-50%);
  border-color: rgba(255, 255, 255, 0.84);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 15px 42px rgba(31, 59, 82, 0.18);
}

.composer-note {
  position: absolute;
  left: 50%;
  bottom: 9px;
  z-index: 5;
  color: rgba(255, 255, 255, 0.83);
  transform: translateX(-50%);
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(19, 42, 60, 0.22);
}

.send-button {
  background: #1679d7;
}

.profile-panel {
  width: min(440px, 92vw);
  height: calc(100vh - 64px);
  padding: 34px 28px 28px;
  position: fixed;
  top: 64px;
  right: 0;
  z-index: 50;
  overflow-y: auto;
  border: 0;
  border-left: 1px solid var(--line);
  background: rgba(249, 251, 248, 0.98);
  box-shadow: -22px 0 60px rgba(23, 48, 42, 0.14);
  transform: translateX(105%);
  transition: transform 250ms ease;
}

.profile-panel.is-open {
  transform: translateX(0);
}

.workspace-backdrop {
  position: fixed;
  inset: 64px 0 0;
  z-index: 40;
  display: none;
  border: 0;
  background: rgba(16, 34, 28, 0.28);
  backdrop-filter: blur(2px);
}

.workspace-backdrop.is-open {
  display: block;
}

.workspace-close {
  width: 34px;
  height: 34px;
  position: absolute;
  top: 18px;
  right: 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #63716b;
  background: #fff;
  font-size: 21px;
  line-height: 1;
}

.profile-panel .profile-header {
  padding-right: 42px;
}

.settings-button {
  border-color: #cdd8e7;
  color: #355688;
  background: #f2f6fc;
}

.settings-button:hover {
  border-color: #1d73cc;
  color: #1d66b5;
  background: #fff;
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@media (max-width: 700px) {
  .app-header {
    height: 58px;
    padding: 0 14px;
  }

  .app-shell {
    height: calc(100vh - 58px);
  }

  .brand strong {
    font-size: 13px;
  }

  .brand small {
    display: none;
  }

  .header-meta {
    gap: 6px;
  }

  .header-action {
    height: 34px;
    padding: 0 10px;
    font-size: 10px;
  }

  .settings-button {
    width: 34px;
    height: 34px;
    padding: 0;
  }

  .settings-button span {
    display: none;
  }

  .landing-hero {
    width: calc(100% - 28px);
    padding: 20px 0 135px;
  }

  .hero-avatar {
    width: 76px;
    height: 76px;
    border-radius: 21px;
    font-size: 33px;
  }

  .landing-hero h1 {
    margin-top: 13px;
    font-size: 30px;
    line-height: 1.25;
  }

  .hero-welcome-card {
    margin-top: 14px;
    padding: 13px 15px;
  }

  .hero-welcome-card p {
    font-size: 11px;
    line-height: 1.7;
  }

  .starter-prompts {
    gap: 7px;
    margin-top: 11px;
  }

  .starter-prompts button {
    min-height: 39px;
    padding: 8px 12px;
    font-size: 10px;
  }

  .composer {
    width: calc(100% - 28px);
    bottom: 35px;
    border-radius: 13px;
  }

  .composer-note {
    bottom: 12px;
    font-size: 8px;
  }

  .chat-log {
    width: 100%;
    padding: 18px 14px 145px;
  }

  .message {
    width: 88%;
  }

  .quick-replies {
    width: calc(100% - 28px);
    padding-bottom: 108px;
  }

  .profile-panel {
    width: 100%;
    height: calc(100vh - 58px);
    top: 58px;
    padding: 30px 20px 28px;
  }

  .workspace-backdrop {
    inset: 58px 0 0;
  }
}
