:root {
  color-scheme: light;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #172b3f;
  background: #f4f8fd;
  font-size: 16px;
  --muted: #5a6f83;
  --line: #e2eaf3;
  --blue: #185ebc;
  --blue-dark: #114d9f;
  --paper: #fff;
  --shadow: 0 20px 70px -40px #3a68965c;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; -webkit-text-size-adjust: 100%; }
h1, h2, p { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .64; cursor: wait; }
button, input, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #4e95ed; outline-offset: 3px; }

.site-header {
  border-bottom: 1px solid #e4edf6;
  background: #f8fbff;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 72px;
  max-width: 1248px;
  margin: auto;
  padding: 10px clamp(18px, 4vw, 44px);
}
.brand { display: flex; gap: 11px; align-items: center; font-weight: 700; letter-spacing: .035em; }
.mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: #1761ba;
  background: #e4efff;
  font-size: 20px;
  line-height: 1;
}
.plain { border: 0; background: transparent; color: var(--blue-dark); padding: 8px 11px; min-height: 44px; border-radius: 10px; }
.plain:hover { background: #e9f2ff; }
.welcome {
  width: min(100% - 72px, 1160px);
  margin: clamp(26px, 7vh, 76px) auto 40px;
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
}
.coast {
  position: relative;
  isolation: isolate;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  border-radius: 28px;
  overflow: hidden;
  color: #fff;
  background: #305f75 url("/assets/coast.webp") 53% center / cover no-repeat;
  box-shadow: var(--shadow);
}
.coast::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, transparent 31%, #102d4760 66%, #0a243bd9 100%);
}
.coast-copy { padding: 36px 46px 46px; text-shadow: 0 2px 14px #0a25384d; }
.coast h1 { font-size: clamp(45px, 5.9vw, 84px); line-height: 1.08; letter-spacing: -.055em; }
.coast p { margin-top: 16px; color: #f1f8ff; font-size: 18px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.access { display: grid; align-items: center; padding: clamp(24px, 3vw, 42px); }
.access-content { min-width: 0; }
.access h1, .access h2 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -.045em; line-height: 1.2; }
.subtitle, .access-foot { color: var(--muted); line-height: 1.6; font-size: .9375rem; }
.access .subtitle { margin-top: 9px; }
.access-foot { margin-top: 19px; }
.switcher {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #edf3fa;
  border-radius: 13px;
  margin-bottom: 26px;
}
.switcher button {
  flex: 1;
  border: 0;
  border-radius: 10px;
  min-height: 44px;
  color: var(--muted);
  background: transparent;
  font-size: .9375rem;
}
.switcher [aria-pressed="true"] { color: #164d91; font-weight: 650; background: #fff; box-shadow: 0 1px 5px #2d52791a; }
.access form { display: grid; margin-top: 24px; gap: 8px; }
label { font-size: .9375rem; font-weight: 630; }
input, textarea {
  color: inherit;
  background: #f8fbff;
  border: 1px solid #d6e1ed;
  border-radius: 12px;
  padding: 11px 13px;
  width: 100%;
  min-width: 0;
}
input { min-height: 49px; margin-bottom: 7px; }
textarea { min-height: 52px; max-height: 27vh; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: #657a8f; }
.primary {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  padding: 10px 20px;
  font-weight: 650;
  white-space: nowrap;
  background: var(--blue);
  color: #fff;
}
.primary:hover { background: var(--blue-dark); }
.notice { padding: 7px 0; font-size: .9375rem; line-height: 1.5; overflow-wrap: anywhere; }
.error { color: #a12733; }
.studio-entry { width: min(100% - 32px, 450px); margin: min(10vh, 90px) auto 32px; }
.studio-entry .access { min-height: 310px; }
.workspace { width: min(100% - 56px, 1160px); margin: 26px auto; }
.guest-workspace { max-width: 850px; }
.studio-workspace { display: grid; grid-template-columns: minmax(250px, 34%) minmax(0, 1fr); gap: 14px; }
.workspace .panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 124px);
  height: calc(100dvh - 124px);
  min-height: 300px;
  overflow: hidden;
}
.conversation-header { padding: 19px 22px; border-bottom: 1px solid var(--line); }
.conversation-header h1, .conversation-header h2 { font-size: 1.25rem; line-height: 1.35; }
.conversation-header .subtitle { margin-top: 4px; }
.history, .thread-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.history { padding: 14px 22px 24px; }
.thread-scroll { padding: 8px; }
.empty { color: var(--muted); padding: 35px 12px; text-align: center; line-height: 1.65; }
.load { display: block; margin: 3px auto 12px; }
.messages { display: grid; gap: 15px; }
.entry { min-width: 0; max-width: 88%; justify-self: start; }
.entry.mine { justify-self: end; }
.entry .time {
  display: block;
  margin: 0 5px 4px;
  color: var(--muted);
  font-size: .8125rem;
}
.entry.mine .time { text-align: right; }
.bubble { border-radius: 16px 16px 16px 5px; padding: 10px 13px; background: #eef3f8; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.mine .bubble { background: #e3efff; border-radius: 16px 16px 5px 16px; }
.composer {
  border-top: 1px solid var(--line);
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}
.composer .notice { grid-column: 1 / -1; padding: 0; }
.thread {
  display: grid;
  width: 100%;
  min-height: 73px;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: center;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #eef3f8;
  border-radius: 12px;
  color: var(--ink, #172b3f);
  background: transparent;
  padding: 10px;
}
.thread:hover, .thread[aria-current="true"] { background: #eaf3ff; }
.thread .snippet { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .9rem; }
.thread .pending { font-size: .8125rem; color: #1759a4; }
.back { display: none; }
.visually-hidden { position: absolute; clip-path: inset(50%); overflow: hidden; width: 1px; height: 1px; white-space: nowrap; }

@media (max-width: 720px) {
  .header-inner { min-height: 60px; }
  .welcome { width: min(100% - 28px, 510px); margin: 14px auto 22px; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .coast { min-height: clamp(218px, 36vh, 320px); border-radius: 21px; background-position: center 49%; }
  .coast-copy { padding: 24px; }
  .coast h1 { font-size: clamp(38px, 9.2vw, 54px); }
  .coast p { margin-top: 9px; font-size: 16px; }
  .panel { border-radius: 20px; }
  .access { padding: 20px; }
  .switcher { margin-bottom: 19px; }
  .access form { margin-top: 17px; }
  .workspace { width: 100%; margin: 0; }
  .workspace .panel { border-radius: 0; border-inline: 0; height: calc(100vh - 61px); height: calc(var(--visible-height, 100dvh) - 61px); }
  .studio-workspace { display: block; }
  .studio-workspace:not(.has-thread) .conversation, .studio-workspace.has-thread .threads { display: none; }
  .conversation-header { padding: 13px 16px; }
  .history { padding: 10px 13px 18px; }
  .composer { padding-inline: 12px; }
  .composer .primary { padding-inline: 16px; }
  .back { display: block; margin: -6px 0 2px -9px; }
}
