:root {
  color-scheme: light;
  --ink: #13221d;
  --muted: #64746d;
  --line: #dae7e1;
  --surface: #ffffff;
  --soft: #f3f8f5;
  --panel: #eef7f2;
  --green: #1d8a61;
  --green-dark: #115b40;
  --mint: #a7eccb;
  --cyan: #278f9d;
  --violet: #5551a4;
  --amber: #b8791c;
  --shadow: 0 22px 60px rgba(17, 77, 52, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 12%, rgba(39, 143, 157, 0.22), transparent 28%),
    radial-gradient(circle at 16% 88%, rgba(184, 121, 28, 0.12), transparent 30%),
    linear-gradient(135deg, #f7faf8 0%, #e9f4ef 52%, #fbfcfa 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(29, 138, 97, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 138, 97, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 82%);
  content: "";
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 24px;
  color: #f7fffb;
  background:
    radial-gradient(circle at 20% 10%, rgba(167, 236, 203, 0.18), transparent 28%),
    linear-gradient(180deg, #05251c, #0f4938 74%, #083126);
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.08);
}

.sidebar::after {
  height: 1px;
  margin-top: -14px;
  background: linear-gradient(90deg, transparent, rgba(167, 236, 203, 0.72), transparent);
  content: "";
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #073525;
  background: linear-gradient(135deg, var(--mint), #e7fff2);
  font-weight: 950;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  line-height: 1.2;
}

.brand small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.tool-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  text-align: left;
  font-weight: 900;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(167, 236, 203, 0.08));
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 98px;
  padding: 20px clamp(20px, 4vw, 48px);
  border-bottom: 1px solid rgba(218, 231, 225, 0.9);
  background: rgba(246, 250, 248, 0.84);
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.12;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1.04;
}

h3 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.28;
}

.user-panel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 32px rgba(25, 70, 50, 0.08);
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #899891;
}

.user-panel.signed-in .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(29, 138, 97, 0.14);
}

.ghost-button,
.primary-button {
  min-height: 40px;
  border-radius: 8px;
  font-weight: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.ghost-button {
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.primary-button {
  padding: 0 18px;
  border: 1px solid var(--green);
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  box-shadow: 0 12px 26px rgba(29, 138, 97, 0.2);
}

.ghost-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--green-dark), #1f6f7d);
}

main {
  padding: clamp(20px, 4vw, 48px);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-heading {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.feature-heading {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
}

.page-heading > div,
.visual-panel,
.tool-form,
.auth-box,
.account-panel,
.idea-grid article {
  border: 1px solid rgba(218, 231, 225, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.page-heading > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 210px;
  padding: clamp(24px, 4vw, 42px);
}

.page-heading p:not(.eyebrow),
.result,
.account-panel p,
.idea-grid p,
.form-message {
  color: var(--muted);
}

.visual-panel {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 210px;
  overflow: hidden;
  color: #effff7;
  background:
    radial-gradient(circle at 58% 34%, rgba(167, 236, 203, 0.22), transparent 24%),
    radial-gradient(circle at 20% 86%, rgba(184, 121, 28, 0.16), transparent 26%),
    linear-gradient(145deg, rgba(7, 52, 38, 0.96), rgba(24, 108, 84, 0.9)),
    #073426;
}

.dream-visual {
  background:
    radial-gradient(circle at 60% 30%, rgba(190, 188, 255, 0.22), transparent 26%),
    radial-gradient(circle at 16% 84%, rgba(167, 236, 203, 0.16), transparent 24%),
    linear-gradient(145deg, rgba(28, 31, 66, 0.96), rgba(27, 94, 83, 0.9)),
    #1d2446;
}

.visual-panel::before {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  content: "";
}

.visual-panel strong,
.visual-panel small {
  position: relative;
  z-index: 1;
}

.visual-panel strong {
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1;
}

.visual-panel small {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.orbit {
  position: absolute;
  border: 2px solid rgba(188, 255, 222, 0.42);
  border-radius: 50%;
}

.orbit-a {
  width: 180px;
  height: 180px;
  transform: rotate(24deg) scaleX(1.28);
}

.orbit-b {
  width: 116px;
  height: 116px;
  border-color: rgba(255, 255, 255, 0.22);
  transform: rotate(-28deg) scaleX(1.42);
}

.tool-form,
.auth-box {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.tool-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-form.single {
  grid-template-columns: 1fr;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

input,
select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  min-height: 150px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(29, 138, 97, 0.18);
  border-color: var(--green);
}

.tool-form .primary-button,
.result {
  grid-column: 1 / -1;
}

.result {
  min-height: 92px;
  padding: 16px;
  border: 1px solid #dce9e3;
  border-radius: 8px;
  background: var(--panel);
  white-space: pre-wrap;
}

.rich-result {
  min-height: 220px;
}

.streaming-result {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height: 1.75;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.auth-box .primary-button,
.auth-box .ghost-button {
  width: 100%;
}

.account-manager {
  display: grid;
  gap: 16px;
}

.account-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
}

.account-panel p {
  margin-bottom: 0;
}

.idea-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.idea-grid article {
  min-height: 170px;
  padding: 22px;
}

.idea-grid span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border-radius: 8px;
  color: #073525;
  background: linear-gradient(135deg, var(--mint), #dff8ef);
  font-weight: 950;
}

.form-message {
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .tool-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .feature-heading,
  .tool-form,
  .auth-grid,
  .idea-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .tool-nav {
    grid-template-columns: 1fr;
  }

  .topbar,
  .account-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .visual-panel {
    min-height: 160px;
  }
}
