:root {
  --bg: #fbfaf7;
  --sidebar: #f4f1ec;
  --ink: #292827;
  --muted: #77736f;
  --soft: #aaa6a0;
  --line: #dedbd5;
  --surface: #ffffff;
  --warm: #ffd28a;
  --warm-strong: #ffc15f;
  --green: #72c900;
  --green-dark: #356b00;
  --red: #ff554f;
  --shadow: 0 18px 40px rgba(31, 28, 24, 0.08);
  --radius: 18px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 36px;
}

.auth-brand {
  margin-bottom: 12px;
}

.auth-subtitle,
.auth-hint {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.auth-subtitle {
  margin-bottom: 24px;
}

.auth-hint {
  margin-top: 18px;
  font-size: 13px;
  text-align: center;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.auth-tabs button {
  min-height: 40px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.auth-tabs button.active {
  border-bottom-color: var(--ink);
  color: var(--ink);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: var(--bg);
  color: var(--ink);
  padding: 12px 14px;
  font-size: 16px;
}

.auth-form input:focus {
  border-color: var(--warm-strong);
}

.auth-form button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--warm);
  color: #4b3820;
  font-weight: 800;
}

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

.sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 22px 16px;
  background: var(--sidebar);
  border-right: 1px solid #e6e1da;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-weight: 900;
  transform: rotate(-8deg);
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 500;
  line-height: 1;
}

.icon-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.primary-nav {
  display: grid;
  gap: 12px;
}

.nav-action {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #3b3937;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 2px;
  text-align: left;
  font-size: 18px;
}

.nav-action:hover,
.nav-action.active {
  color: #111;
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
}

.nav-action:nth-child(2) .nav-icon {
  border-radius: 7px;
}

.nav-action em {
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.project-section {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #b0b0be;
  font-size: 18px;
  font-weight: 700;
}

.sidebar-heading button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
}

.project-list {
  display: grid;
  gap: 8px;
  overflow: auto;
}

.project-item {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #3f3d3b;
  padding: 6px 4px;
  text-align: left;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-item:hover,
.project-item.active {
  background: rgba(255, 255, 255, 0.7);
}

.project-item span {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 2px solid #8b8781;
  border-radius: 50%;
}

.sidebar-account {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.sidebar-account span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

.main-stage {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
}

.main-stage.chat-mode,
.main-stage:has(.conversation-panel:not(.hidden)) {
  justify-content: stretch;
}

.welcome-panel {
  width: min(1040px, calc(100% - 72px));
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 54px 0 76px;
}

.chat-mode .welcome-panel,
.main-stage:has(.conversation-panel:not(.hidden)) .welcome-panel {
  order: 2;
  width: min(960px, calc(100% - 72px));
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 10;
  justify-content: flex-start;
  padding: 16px 0 22px;
  background: linear-gradient(180deg, rgba(251, 250, 247, 0), var(--bg) 18%);
}

.chat-mode .mascot,
.chat-mode .welcome-panel > .eyebrow,
.chat-mode .welcome-panel > h1,
.main-stage:has(.conversation-panel:not(.hidden)) .mascot,
.main-stage:has(.conversation-panel:not(.hidden)) .welcome-panel > .eyebrow,
.main-stage:has(.conversation-panel:not(.hidden)) .welcome-panel > h1 {
  display: none;
}

.mascot {
  width: 96px;
  height: 112px;
  position: relative;
  margin-bottom: 20px;
}

.mascot-body {
  position: absolute;
  left: 24px;
  bottom: 0;
  width: 54px;
  height: 78px;
  border: 4px solid #363432;
  border-radius: 48% 48% 42% 42%;
  background: transparent;
}

.mascot-head {
  position: absolute;
  left: 10px;
  top: 24px;
  width: 64px;
  height: 42px;
  border: 4px solid #363432;
  border-radius: 48% 40% 45% 42%;
  background: var(--bg);
  transform: rotate(-10deg);
  z-index: 2;
}

.mascot-head::before,
.mascot-head::after {
  content: "";
  position: absolute;
  top: -10px;
  width: 16px;
  height: 12px;
  border: 4px solid #363432;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: var(--bg);
}

.mascot-head::before {
  left: 12px;
}

.mascot-head::after {
  right: 12px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 12px;
  color: #393735;
  font-size: clamp(38px, 4vw, 52px);
  font-weight: 500;
  letter-spacing: 0;
  text-align: center;
}

.prompt-box {
  width: min(860px, 100%);
  min-height: 150px;
  border: 1px solid #d6d4cf;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 3px 8px rgba(35, 31, 27, 0.06);
  display: grid;
  grid-template-rows: minmax(82px, auto) auto;
  overflow: hidden;
}

.chat-mode .prompt-box,
.main-stage:has(.conversation-panel:not(.hidden)) .prompt-box {
  width: 100%;
  min-height: 118px;
  box-shadow: 0 10px 28px rgba(31, 28, 24, 0.08);
}

.chat-mode .prompt-box textarea,
.main-stage:has(.conversation-panel:not(.hidden)) .prompt-box textarea {
  min-height: 66px;
  padding: 18px 24px 8px;
}

.prompt-box textarea {
  width: 100%;
  min-height: 92px;
  border: 0;
  outline: 0;
  resize: none;
  padding: 26px 30px 10px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.55;
  background: transparent;
}

.prompt-box textarea::placeholder {
  color: #777;
}

.prompt-actions {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px 16px 24px;
}

.left-tools,
.right-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.upload-button,
.send-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  line-height: 1;
}

.upload-button {
  background: transparent;
  color: #706d69;
  cursor: pointer;
}

.upload-button input {
  display: none;
}

.upload-button span {
  transform: translateY(-1px);
}

.send-button {
  background: var(--warm);
  color: var(--surface);
  font-size: 30px;
  box-shadow: 0 8px 18px rgba(255, 193, 95, 0.4);
}

.quick-skills {
  width: min(760px, 100%);
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.chat-mode .quick-skills,
.main-stage:has(.conversation-panel:not(.hidden)) .quick-skills {
  width: 100%;
  margin-top: 12px;
  justify-content: flex-start;
}

.chat-mode .quick-skills button,
.main-stage:has(.conversation-panel:not(.hidden)) .quick-skills button {
  min-height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

.quick-skills button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: #77736f;
  padding: 0 20px;
  font-size: 16px;
  box-shadow: 0 2px 5px rgba(35, 31, 27, 0.04);
}

.quick-skills button:hover {
  color: var(--ink);
  border-color: #c9c4bd;
}

.conversation-panel {
  width: min(960px, calc(100% - 72px));
  margin: 16px auto 60px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-mode .conversation-panel,
.main-stage:has(.conversation-panel:not(.hidden)) .conversation-panel {
  order: 1;
  flex: 1 1 auto;
  min-height: 0;
  margin: 24px auto 0;
  display: flex;
  flex-direction: column;
}

.conversation-panel.hidden {
  display: none;
}

.conversation-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.conversation-header h2 {
  margin: 0;
  color: #3b3937;
  font-size: 22px;
  font-weight: 600;
}

.status-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eff8ea;
  color: var(--green-dark);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.messages {
  min-height: 260px;
  max-height: 420px;
  overflow: auto;
  padding: 20px;
  display: grid;
  gap: 12px;
}

.chat-mode .messages,
.main-stage:has(.conversation-panel:not(.hidden)) .messages {
  flex: 1 1 auto;
  min-height: 260px;
  max-height: none;
}

.message {
  width: min(720px, 90%);
  display: grid;
  gap: 6px;
}

.message.user {
  justify-self: end;
}

.message span {
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

.message.user span {
  text-align: right;
}

.message-body span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.message-body {
  margin: 0;
  border-radius: 16px;
  padding: 14px 16px;
  line-height: 1.65;
}

.message.ai .message-body {
  background: #f3f1ed;
}

.message.user .message-body {
  background: #fff1d7;
}

.message-body p {
  margin: 0;
  white-space: pre-wrap;
}

.message-body p + p,
.message-body p + .rich-table-wrap,
.message-body .rich-table-wrap + p,
.message-body .rich-list + p,
.message-body p + .rich-list,
.message-body .rich-callout + p,
.message-body p + .rich-callout,
.message-body .rich-code + p,
.message-body p + .rich-code {
  margin-top: 12px;
}

.thinking-panel {
  border: 1px solid #d9d5cd;
  border-radius: 12px;
  background: #fffdf7;
  overflow: hidden;
}

.thinking-panel summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: #5b554e;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.thinking-panel ul {
  margin: 0;
  border-top: 1px solid #ece7dd;
  padding: 10px 14px 12px 28px;
  color: #6f6961;
  font-size: 13px;
  line-height: 1.65;
}

.thinking-panel.pending {
  border-color: #ead6a9;
  background: #fffaf0;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.typing-dots b {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--warm-strong);
  animation: typingPulse 1s infinite ease-in-out;
}

.typing-dots b:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots b:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typingPulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.rich-heading {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.35;
}

.rich-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.rich-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid #ded8cf;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
}

.rich-table th,
.rich-table td {
  border-bottom: 1px solid #ebe5dc;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

.rich-table th {
  background: #f8f3e8;
  color: #4c453d;
  font-weight: 800;
}

.rich-table tr:last-child td {
  border-bottom: 0;
}

.rich-list {
  margin: 0;
  padding-left: 22px;
}

.rich-list li + li {
  margin-top: 4px;
}

.rich-code {
  margin: 0;
  overflow-x: auto;
  border-radius: 10px;
  background: #27231f;
  color: #f7f1e8;
  padding: 12px;
  font-size: 13px;
  line-height: 1.55;
}

.message-body code {
  border-radius: 5px;
  background: rgba(31, 28, 24, 0.08);
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}

.rich-code code {
  background: transparent;
  padding: 0;
}

.rich-callout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  border: 1px solid #ded8cf;
  border-radius: 12px;
  background: #fffdf7;
  padding: 10px 12px;
}

.rich-callout strong {
  color: #51493e;
}

.rich-callout.warning {
  border-color: #f0c56f;
  background: #fff8e8;
}

.rich-callout.error {
  border-color: #f3a19b;
  background: #fff0ee;
}

.rich-callout.success {
  border-color: #b9d890;
  background: #f5fbef;
}

.rich-progress {
  display: grid;
  gap: 8px;
}

.rich-progress div {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.rich-progress i,
.rich-bar i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--warm-strong) var(--progress), #e9e3d8 var(--progress));
}

.rich-chart {
  display: grid;
  gap: 8px;
}

.rich-bar {
  display: grid;
  grid-template-columns: minmax(82px, 0.8fr) minmax(80px, 2fr) auto;
  gap: 10px;
  align-items: center;
  color: #615b53;
  font-size: 13px;
}

.rich-bar i {
  background: linear-gradient(90deg, var(--green) var(--bar), #e9e3d8 var(--bar));
}

.stage-result {
  margin: 0 20px 16px;
  border: 1px solid #e6e1da;
  border-radius: 14px;
  background: #fffefa;
  padding: 16px;
}

.stage-result.hidden {
  display: none;
}

.stage-result h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

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

.stage-result-item {
  border-radius: 12px;
  background: #f6f4f0;
  padding: 11px 12px;
}

.stage-result-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stage-result-item strong {
  display: block;
  margin-top: 5px;
  line-height: 1.4;
}

.stage-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.75;
}

.task-card {
  margin: 0 20px 16px;
  border: 1px solid #e6e1da;
  border-radius: 14px;
  background: #fffaf0;
  padding: 14px 16px;
}

.task-card.hidden {
  display: none;
}

.task-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-card strong {
  font-size: 17px;
}

.task-card span {
  border-radius: 999px;
  background: #eff8ea;
  color: var(--green-dark);
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
}

.task-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.phase-strip {
  display: none;
}

.legacy-phase-strip {
  display: flex;
  gap: 8px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  overflow-x: auto;
}

.phase-chip {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 12px;
  white-space: nowrap;
}

.phase-chip.active {
  color: var(--green-dark);
  border-color: #cae8b8;
  background: #eff8ea;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  transform: translateY(110px);
  opacity: 0;
  transition: 0.22s ease;
  border-radius: 12px;
  background: #2f2c29;
  color: #fff;
  padding: 12px 16px;
  box-shadow: var(--shadow);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(36, 33, 29, 0.24);
  backdrop-filter: blur(6px);
  padding: 24px;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(420px, 100%);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 28px;
  text-align: center;
}

.modal-card h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.modal-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.65;
}

.modal-button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--warm);
  color: #4b3820;
  padding: 0 22px;
  font-weight: 700;
}

.report-modal-card {
  width: min(860px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.report-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.report-modal-header h2 {
  margin: 0;
  font-size: 30px;
}

.close-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.report-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.report-section:last-child {
  border-bottom: 0;
}

.report-section h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.report-kpi-grid,
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.report-kpi,
.contact-card {
  border-radius: 12px;
  background: #f6f4f0;
  padding: 12px;
}

.report-kpi span,
.contact-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.report-kpi strong,
.contact-card strong {
  display: block;
  margin-top: 6px;
  line-height: 1.4;
}

.report-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.script-box {
  border-radius: 12px;
  background: #fff1d7;
  padding: 14px;
  color: #4b3a22;
  line-height: 1.7;
}

.task-open-report {
  margin-top: 12px;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: var(--warm);
  color: #4b3820;
  padding: 0 14px;
  font-weight: 700;
}

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

  .sidebar {
    padding: 18px 12px;
  }

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

  .welcome-panel,
  .conversation-panel {
    width: min(100% - 36px, 860px);
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .project-list {
    max-height: 180px;
  }

  .welcome-panel {
    min-height: auto;
    padding: 34px 0 52px;
  }

  .prompt-actions,
  .conversation-header {
    display: grid;
  }

  .report-kpi-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .stage-result-grid {
    grid-template-columns: 1fr;
  }

  .right-tools {
    justify-content: space-between;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 34px;
  }

  .prompt-box textarea {
    padding: 20px 20px 8px;
    font-size: 16px;
  }

  .quick-skills button {
    width: 100%;
  }
}

/* AI workspace redesign: conversation-first, inspired by current mainstream AI chat products. */
:root {
  --bg: #f7f7f4;
  --sidebar: #efeee9;
  --ink: #1f2320;
  --muted: #777a74;
  --soft: #9b9e98;
  --line: #e3e1da;
  --surface: #ffffff;
  --surface-soft: #f2f1ed;
  --warm: #ffc86f;
  --warm-strong: #f3b447;
  --green: #79c53f;
  --green-dark: #27620f;
  --shadow: 0 18px 50px rgba(31, 35, 32, 0.08);
  --radius: 16px;
}

body {
  background:
    radial-gradient(circle at 70% 0%, rgba(255, 200, 111, 0.16), transparent 34%),
    linear-gradient(180deg, #fbfbf8 0%, var(--bg) 100%);
}

.app-shell {
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  background: rgba(239, 238, 233, 0.92);
  border-right: 1px solid rgba(31, 35, 32, 0.08);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.55);
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-width: 1.5px;
  transform: none;
  font-size: 15px;
}

.brand strong {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 24px;
  font-weight: 750;
}

.icon-button {
  border-color: rgba(31, 35, 32, 0.1);
  background: rgba(255, 255, 255, 0.72);
  font-size: 20px;
  transition:
    background 0.18s ease,
    transform 0.18s ease;
}

.icon-button:hover {
  background: #fff;
  transform: translateY(-1px);
}

.nav-action {
  min-height: 44px;
  border-radius: 12px;
  padding: 0 8px;
  font-size: 16px;
  font-weight: 650;
}

.nav-action:hover,
.nav-action.active {
  background: rgba(255, 255, 255, 0.68);
}

.nav-icon {
  width: 24px;
  height: 24px;
  border-width: 1.6px;
}

.sidebar-heading {
  color: #a4a7a0;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-list {
  gap: 6px;
}

.project-item {
  min-height: 42px;
  border-radius: 12px;
  padding: 0 10px;
  font-size: 15px;
  font-weight: 560;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.project-item:hover,
.project-item.active {
  background: rgba(255, 255, 255, 0.82);
  color: #111411;
  transform: translateX(2px);
}

.project-item span {
  width: 8px;
  height: 8px;
  border: 1.5px solid #9da098;
}

.sidebar-account {
  border-top-color: rgba(31, 35, 32, 0.1);
}

.sidebar-account button {
  min-height: 40px;
  border-color: rgba(31, 35, 32, 0.1);
  background: rgba(255, 255, 255, 0.78);
}

.main-stage {
  min-height: 100vh;
  padding: 0 28px;
  align-items: stretch;
}

.welcome-panel {
  width: min(860px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 96px 0 88px;
  justify-content: center;
}

.mascot {
  display: none;
}

.welcome-panel > .eyebrow {
  margin-bottom: 14px;
  color: #8d918b;
}

h1 {
  max-width: 760px;
  margin-bottom: 30px;
  color: #20231f;
  font-size: clamp(38px, 5.2vw, 68px);
  font-weight: 720;
  line-height: 1.05;
}

.prompt-box {
  width: min(880px, 100%);
  min-height: 132px;
  border: 1px solid rgba(31, 35, 32, 0.1);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 50px rgba(31, 35, 32, 0.1);
}

.prompt-box textarea {
  min-height: 70px;
  padding: 22px 26px 8px;
  font-size: 17px;
}

.prompt-box textarea::placeholder {
  color: #8c9089;
}

.prompt-actions {
  min-height: 56px;
  padding: 0 18px 14px 22px;
}

.upload-button,
.send-button {
  width: 44px;
  height: 44px;
}

.upload-button {
  color: #6f736c;
}

.upload-button:hover {
  background: var(--surface-soft);
}

.send-button {
  background: #20231f;
  color: #fff;
  font-size: 28px;
  box-shadow: 0 10px 24px rgba(31, 35, 32, 0.2);
}

.send-button:hover {
  background: #090b09;
}

.quick-skills {
  width: min(800px, 100%);
  margin-top: 18px;
  gap: 10px;
}

.quick-skills button {
  min-height: 40px;
  border-color: rgba(31, 35, 32, 0.1);
  background: rgba(255, 255, 255, 0.66);
  color: #696d67;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 560;
  box-shadow: none;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.quick-skills button:hover {
  background: #fff;
  color: #20231f;
  transform: translateY(-1px);
}

.conversation-panel {
  width: min(920px, 100%);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.chat-mode .conversation-panel,
.main-stage:has(.conversation-panel:not(.hidden)) .conversation-panel {
  margin: 0 auto;
  padding-top: 32px;
}

.conversation-header {
  min-height: 52px;
  border-bottom: 0;
  padding: 8px 0 18px;
}

.conversation-header .eyebrow,
.status-pill {
  display: none;
}

.conversation-header h2 {
  color: #20231f;
  font-size: 18px;
  font-weight: 680;
}

.messages {
  padding: 8px 0 24px;
  gap: 18px;
}

.message {
  width: min(760px, 100%);
}

.message.user {
  width: min(720px, 84%);
}

.message span {
  color: #a2a59f;
  font-size: 12px;
}

.message p {
  border-radius: 22px;
  padding: 16px 20px;
  font-size: 16px;
  white-space: pre-wrap;
}

.message.ai p {
  background: transparent;
  padding-left: 0;
  color: #232622;
}

.message.user p {
  background: #fff2d4;
}

.stage-result,
.phase-strip {
  display: none !important;
}

.task-card {
  margin: 2px 0 20px;
  border-color: rgba(31, 35, 32, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 34px rgba(31, 35, 32, 0.07);
}

.chat-mode .welcome-panel,
.main-stage:has(.conversation-panel:not(.hidden)) .welcome-panel {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 12px 0 22px;
  background: linear-gradient(180deg, rgba(247, 247, 244, 0), var(--bg) 28%);
}

.chat-mode .prompt-box,
.main-stage:has(.conversation-panel:not(.hidden)) .prompt-box {
  min-height: 112px;
  border-radius: 22px;
}

.chat-mode .quick-skills,
.main-stage:has(.conversation-panel:not(.hidden)) .quick-skills {
  display: none;
}

.main-stage.chat-mode,
.main-stage:has(.conversation-panel:not(.hidden)) {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  overflow: hidden;
}

.chat-mode .conversation-panel,
.main-stage:has(.conversation-panel:not(.hidden)) .conversation-panel {
  grid-row: 1;
  width: min(920px, 100%);
  min-height: 0;
  overflow: auto;
  padding: 32px 0 20px;
}

.chat-mode .welcome-panel,
.main-stage:has(.conversation-panel:not(.hidden)) .welcome-panel {
  grid-row: 2;
  position: static;
  width: min(920px, 100%);
  min-height: 0;
  padding: 12px 0 22px;
}

.chat-mode .messages,
.main-stage:has(.conversation-panel:not(.hidden)) .messages {
  min-height: 0;
  overflow: visible;
}

.toast {
  border-radius: 14px;
  background: #20231f;
}

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

  .main-stage {
    padding: 0 18px;
  }
}

@media (max-width: 760px) {
  .main-stage {
    padding: 0 14px;
  }

  .welcome-panel {
    min-height: auto;
    padding: 48px 0 44px;
  }

  h1 {
    font-size: 38px;
  }

  .prompt-box {
    border-radius: 20px;
  }
}
