:root {
  --bg: #ffffff;
  --ink: #1f1f1f;
  --muted: #5f6368;
  --muted-2: #80868b;
  --line: #e8eaed;
  --blue: #0b57d0;
  --blue-soft: #d3e3fd;
  --panel: #f8f9fa;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.12), 0 2px 8px rgba(60, 64, 67, 0.08);
  --composer-shadow: 0 1px 3px rgba(60, 64, 67, 0.12), 0 4px 16px rgba(60, 64, 67, 0.08);
  --sidebar-w: 280px;
  --font: "Google Sans", "Product Sans", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100%;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 12px 16px;
  border-right: 1px solid transparent;
  background: linear-gradient(180deg, #fbfcfe 0%, #ffffff 40%);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 22px;
  padding: 2px 4px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark { display: block; width: 28px; height: 28px; }
.brand-text {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #3c4043;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #444746;
}
.icon-btn:hover { background: #f1f3f4; }
.icon-btn svg { width: 22px; height: 22px; }

.side-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  color: #1f1f1f;
  font-size: 14px;
  text-align: left;
}
.side-link svg { width: 22px; height: 22px; flex-shrink: 0; color: #444746; }
.side-link:hover { background: #f1f3f4; }
.side-link.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin-top: 4px;
  align-items: flex-start;
  padding-top: 12px;
  padding-bottom: 12px;
}
.side-link.muted svg { margin-top: 1px; }

.sidebar-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.side-login {
  color: #1f1f1f;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 4px;
}
.side-login:hover { text-decoration: underline; }

.main {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(980px 520px at 50% 42%, rgba(168, 199, 250, 0.34) 0%, rgba(214, 207, 255, 0.16) 38%, rgba(255, 255, 255, 0) 72%),
    #fff;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 14px 20px 8px;
}

.top-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.top-links a {
  font-size: 13px;
  color: #444746;
  white-space: nowrap;
}
.top-links a:hover { text-decoration: underline; }

.login-pill {
  min-height: 40px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
}
.login-pill:hover { filter: brightness(0.98); }

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 48px;
  gap: 28px;
}

.hero-title {
  max-width: 920px;
  text-align: center;
  font-size: clamp(28px, 4.2vw, 42px);
  font-weight: 450;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: #1f1f1f;
}

.composer {
  width: min(760px, 100%);
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px 12px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--composer-shadow);
  border: 1px solid rgba(232, 234, 237, 0.9);
}

.composer-plus,
.mic-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #444746;
  flex-shrink: 0;
}
.composer-plus:hover,
.mic-btn:hover { background: #f1f3f4; }
.composer-plus svg,
.mic-btn svg { width: 22px; height: 22px; }

#input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 16px;
  line-height: 1.4;
  color: #1f1f1f;
}
#input::placeholder { color: #80868b; }

.model-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: #444746;
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}
.model-chip:hover { background: #f1f3f4; }
.model-chip svg { width: 16px; height: 16px; }

.footer {
  padding: 0 24px 18px;
  text-align: center;
}
.footer p {
  max-width: 920px;
  margin: 0 auto;
  font-size: 12px;
  line-height: 1.55;
  color: #80868b;
}

.help-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #444746;
  font-size: 18px;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 20;
}
.help-fab:hover { background: #f8f9fa; }

.wa-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.wa-modal[hidden] { display: none !important; }
.wa-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 33, 36, 0.45);
  backdrop-filter: blur(2px);
}
.wa-modal-panel {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}
.wa-modal-panel iframe {
  width: 100%;
  height: 560px;
  max-height: calc(100vh - 48px);
  border: 0;
  display: block;
  background: #fff;
}
.wa-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #f1f3f4;
  color: #5f6368;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.wa-modal-close:hover { background: #e8eaed; color: #202124; }

@media (max-width: 900px) {
  .app { grid-template-columns: 72px 1fr; }
  .brand-text,
  .side-link span,
  .side-login { display: none; }
  .sidebar { padding: 12px 8px; }
  .brand-row { justify-content: center; margin-bottom: 16px; }
  .icon-btn:first-of-type { display: none; }
  .side-link {
    justify-content: center;
    padding: 0;
    width: 44px;
    height: 44px;
    margin: 0 auto 6px;
  }
  .sidebar-bottom { justify-content: center; }
  .top-links { display: none; }
  .hero-title { font-size: 26px; padding: 0 8px; }
  .composer { min-height: 58px; }
}
