:root {
  --bg: #f6f4ef;
  --panel: #ffffff;
  --ink: #202124;
  --muted: #686963;
  --line: #ded9cd;
  --line-strong: #c8d8d4;
  --green: #1b6f68;
  --green-dark: #104c47;
  --green-soft: #e7f2ef;
  --amber: #a76d1f;
  --amber-soft: #fff3dd;
  --danger: #9b3d16;
  --danger-bg: #fff0e8;
  --shadow: 0 18px 50px rgba(38, 36, 29, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
}

.brand-button {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

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

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

.brand-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.top-actions,
.button-row,
.split-row,
.result-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-actions {
  flex: 0 0 auto;
}

.invite-layout {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
}

.invite-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.invite-panel h1,
.invite-panel p {
  margin: 0;
}

.invite-panel p {
  color: var(--muted);
}

.invite-input {
  width: 100%;
}

.wrap {
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button,
.text-button,
.small-button,
.link-button,
.icon-button,
.image-download {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-weight: 700;
  text-decoration: none;
}

.primary-button {
  background: var(--green);
  color: #fff;
}

.primary-button:hover {
  background: var(--green-dark);
}

.secondary-button,
.ghost-button,
.small-button,
.image-download {
  background: var(--panel);
  border-color: var(--line-strong);
  color: var(--green-dark);
}

.ghost-button.active,
.ghost-button:hover,
.secondary-button:hover,
.small-button:hover {
  background: var(--green-soft);
}

.text-button,
.link-button {
  background: transparent;
  color: var(--green);
  border-color: transparent;
}

.link-button {
  min-height: auto;
  padding: 0;
}

.icon-button {
  width: 40px;
  padding: 0;
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.full {
  width: 100%;
}

.notice,
.loading-strip {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  line-height: 1.55;
}

.loading-strip {
  background: var(--green-soft);
  color: var(--green-dark);
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.entry-panel,
.recommend-panel,
.work-main,
.side-panel,
.history-item,
.empty-state,
.detail-header,
.answer-timeline {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.entry-panel,
.recommend-panel,
.work-main,
.side-panel,
.empty-state,
.detail-header,
.answer-timeline {
  padding: 26px;
}

.eyebrow,
.hint-title,
.small-label,
.recommend-label {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

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

.entry-panel h1,
.history-header h1,
.detail-header h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: 0;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.main-input,
.answer-input,
.text-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.main-input:focus,
.answer-input:focus,
.text-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(27, 111, 104, 0.12);
}

.main-input {
  min-height: 220px;
  margin: 8px 0 18px;
  padding: 18px;
  resize: vertical;
  line-height: 1.65;
}

.answer-input {
  min-height: 96px;
  margin-top: 18px;
  padding: 14px;
  resize: vertical;
  line-height: 1.55;
}

.text-input {
  min-height: 44px;
  padding: 0 12px;
}

.chip-list,
.option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.recommend-group + .recommend-group {
  margin-top: 24px;
}

.recommend-label {
  margin-bottom: 10px;
  color: #8a8377;
}

.example-chip {
  max-width: 100%;
  border: 1px solid #e4ded2;
  border-radius: 8px;
  background: #fff;
  color: #2d302f;
  padding: 13px 14px;
  text-align: left;
  line-height: 1.45;
}

.example-chip:hover {
  border-color: var(--green);
  background: var(--green-soft);
}

.work-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.work-layout.single,
.result-layout {
  grid-template-columns: minmax(0, 860px);
  justify-content: center;
}

.meta-row,
.question-toolbar,
.prompt-header,
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.meta-row {
  margin-bottom: 20px;
}

.pill,
.mode-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: 100%;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.round {
  color: var(--muted);
  font-size: 13px;
}

.mode-multi {
  background: var(--amber-soft);
  color: #70460d;
}

.quick-actions {
  display: flex;
  justify-content: flex-end;
  margin: -6px 0 16px;
}

.origin-card,
.draft-card,
.media-card,
.result-card,
.image-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.origin-card,
.draft-card,
.media-card,
.result-card {
  padding: 20px;
}

.origin-card p,
.draft-card p {
  margin: 8px 0 0;
  color: #303331;
  line-height: 1.7;
  white-space: pre-wrap;
}

.question-title {
  margin-bottom: 18px;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.32;
  letter-spacing: 0;
}

.question-toolbar {
  margin: 18px 0 12px;
}

.option-list {
  flex-direction: column;
}

.option-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  border: 1px solid #e3dfd4;
  border-radius: 8px;
  background: #fff;
  color: #2d302f;
  padding: 13px 15px;
  text-align: left;
  line-height: 1.45;
}

.option-button:hover,
.option-button.selected.single {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
}

.option-button.selected.multi {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: #613b05;
}

.choice-mark {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid #c9c3b7;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.multi .choice-mark {
  border-radius: 5px;
}

.selected .choice-mark {
  border-color: var(--green);
  background: var(--green);
}

.selected.multi .choice-mark {
  border-color: var(--amber);
  background: var(--amber);
}

.button-stack {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.split-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.side-panel {
  position: sticky;
  top: 18px;
}

.answer-item {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #ece8dd;
  background: transparent;
  padding: 15px 0;
  color: var(--ink);
  text-align: left;
}

.answer-item span,
.timeline-item span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.answer-item strong,
.timeline-item strong {
  display: block;
  margin-top: 5px;
  line-height: 1.5;
}

.muted {
  color: var(--muted);
  line-height: 1.6;
}

.center {
  text-align: center;
}

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

.brief-item {
  min-width: 0;
  border: 1px solid #e3dfd4;
  border-radius: 8px;
  background: #fff;
  padding: 13px 14px;
  line-height: 1.55;
}

.brief-item span {
  display: inline-block;
  min-width: 44px;
  margin-right: 8px;
  color: var(--green);
  font-weight: 800;
}

.media-card {
  margin-bottom: 16px;
}

.blueprint-image,
.generated-image {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: #111827;
}

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

.image-card {
  overflow: hidden;
}

.image-download {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px;
}

.prompt-text {
  line-height: 1.7;
  white-space: pre-wrap;
}

.prompt-text.collapsed {
  max-height: 132px;
  overflow: hidden;
}

.draft-note {
  border-top: 1px solid #eef2ef;
  padding-top: 14px;
  color: var(--muted);
}

.result-card h2 {
  margin-bottom: 14px;
  font-size: 28px;
  line-height: 1.35;
}

.result-summary {
  border-radius: 8px;
  background: #f3f8f6;
  color: #234d49;
  padding: 16px;
  line-height: 1.7;
}

.result-block {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #efebe3;
}

.result-block h3 {
  margin-bottom: 12px;
  color: var(--green);
  font-size: 17px;
}

.result-block p {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
  line-height: 1.7;
}

.line-dot {
  width: 7px;
  height: 7px;
  margin-top: 11px;
  border-radius: 50%;
  background: #8fbdb6;
  flex: 0 0 auto;
}

.action-index {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.revise-panel {
  margin-top: 16px;
}

.history-layout,
.history-detail {
  display: grid;
  gap: 18px;
}

.history-header {
  padding: 8px 0 10px;
}

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

.history-item {
  display: grid;
  gap: 12px;
  padding: 18px;
  color: var(--ink);
  text-align: left;
}

.history-item:hover {
  border-color: var(--green);
}

.history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.history-head strong {
  line-height: 1.35;
}

.history-head em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  padding: 4px 9px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.history-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  object-fit: cover;
  background: #ebe7dc;
}

.history-input {
  color: #303331;
  line-height: 1.55;
}

.history-time {
  color: var(--muted);
  font-size: 13px;
}

.detail-header {
  display: grid;
  gap: 10px;
}

.detail-header h1 {
  margin: 0;
}

.detail-header p {
  margin: 0;
  color: var(--muted);
}

.answer-timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  border-bottom: 1px solid #ece8dd;
  padding-bottom: 10px;
}

.timeline-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.loading-mask,
.zoom-view {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.loading-panel {
  width: min(440px, 100%);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(32, 33, 36, 0.18);
  padding: 22px;
}

.loading-mask {
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(32, 33, 36, 0.34);
}

.loading-panel {
  text-align: center;
}

.loading-panel p {
  margin: 10px 0 0;
}

.loading-panel .loading-hint {
  margin-top: 6px;
  color: #8a8377;
  font-size: 14px;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 4px solid #d7ece8;
  border-top-color: var(--green);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.zoom-view {
  display: flex;
  flex-direction: column;
  background: #0f172a;
}

.zoom-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: #020617;
  color: #fff;
}

.zoom-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 24px;
}

.zoom-stage img {
  display: block;
  max-width: min(1200px, 100%);
  max-height: 100%;
  margin: 0 auto;
  border-radius: 8px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #202124;
  color: #fff;
  padding: 10px 16px;
  font-weight: 700;
}

@media (max-width: 820px) {
  .app-shell {
    padding: 18px 14px 52px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand-button small {
    display: none;
  }

  .top-actions {
    gap: 8px;
  }

  .ghost-button {
    padding: 0 12px;
  }

  .home-grid,
  .work-layout,
  .history-list {
    grid-template-columns: 1fr;
  }

  .entry-panel,
  .recommend-panel,
  .work-main,
  .side-panel,
  .empty-state,
  .detail-header,
  .answer-timeline {
    padding: 18px;
  }

  .entry-panel h1,
  .history-header h1,
  .detail-header h1 {
    font-size: 36px;
  }

  .lead {
    font-size: 16px;
  }

  .main-input {
    min-height: 180px;
  }

  .button-row,
  .split-row,
  .result-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .button-row > *,
  .split-row > *,
  .result-actions > * {
    width: 100%;
  }

  .side-panel {
    position: static;
  }

  .brief-grid,
  .image-list {
    grid-template-columns: 1fr;
  }

  .question-toolbar,
  .meta-row {
    align-items: flex-start;
    flex-direction: column;
  }

}
