:root {
  --paper: #f7efe0;
  --paper-deep: #ead8bd;
  --ink: #211b16;
  --muted: #6d6257;
  --line: #dec9aa;
  --orange: #ef6d2f;
  --red: #c83e2a;
  --green: #76896a;
  --white: #fffaf0;
  --shadow: 0 24px 80px rgba(69, 42, 18, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(239, 109, 47, 0.16), transparent 28rem),
    radial-gradient(circle at 90% 4%, rgba(118, 137, 106, 0.22), transparent 30rem),
    linear-gradient(135deg, #f8f0df, #efe0c6);
}

button,
textarea,
select {
  font: inherit;
}

.app-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(36px, 5vw, 72px);
  letter-spacing: 0;
  line-height: 0.95;
}

.hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-note {
  width: 380px;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.68);
  box-shadow: var(--shadow);
}

.hero-note span {
  display: block;
  color: var(--red);
  font-size: 14px;
  margin-bottom: 8px;
}

.hero-note strong {
  font-size: 18px;
  line-height: 1.5;
}

.workspace {
  display: grid;
  grid-template-columns: 330px minmax(420px, 1fr) 460px;
  gap: 18px;
  align-items: stretch;
}

.research-workspace {
  grid-template-columns: 350px minmax(460px, 1fr) 440px;
}

.panel {
  min-height: 760px;
  padding: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.78);
  box-shadow: var(--shadow);
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-title span {
  color: var(--red);
  font-size: 15px;
}

.panel-title strong {
  font-size: 22px;
  letter-spacing: 0;
}

label {
  display: block;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 14px;
}

.industry-card {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(92, 74, 54, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 248, 233, 0.92), rgba(245, 231, 203, 0.76));
}

.industry-card label {
  margin-bottom: 10px;
}

.industry-status {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.industry-status strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

.industry-status span,
.industry-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.industry-card p {
  margin: 0;
}

textarea,
select {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  background: #fff8e9;
  color: var(--ink);
  padding: 12px;
  outline: none;
}

textarea {
  min-height: 78px;
  resize: vertical;
  line-height: 1.55;
}

select {
  height: 46px;
}

#generateBtn {
  width: 100%;
  border: 0;
  background: var(--ink);
  color: var(--white);
  padding: 14px 18px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

#generateBtn:hover {
  transform: translateY(-2px);
  background: var(--red);
}

#runBtn,
.secondary-btn,
.tool-link {
  width: 100%;
  display: block;
  border: 0;
  background: var(--ink);
  color: var(--white);
  padding: 14px 18px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.tool-link {
  margin-top: 10px;
  background: var(--green);
}

.secondary-btn {
  margin-top: 10px;
  background: #5f5141;
}

#runBtn:hover,
.secondary-btn:hover,
.tool-link:hover {
  transform: translateY(-2px);
  background: var(--red);
}

.method-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.research-flow {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.research-flow article,
.review-gate div,
.knowledge-block,
.knowledge-card,
.push-card {
  border: 1px solid var(--line);
  background: #fff8e9;
  padding: 16px;
}

.research-flow span {
  display: block;
  margin-bottom: 8px;
  color: var(--red);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.research-flow strong,
.review-gate strong {
  color: var(--ink);
}

.research-flow p,
.review-gate p {
  margin: 8px 0 0;
  font-size: 13px;
}

.review-gate {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.source-panel,
.coverage-panel,
.execution-panel,
.toolchain-panel,
.collection-console,
.material-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff8e9;
}

.collection-console {
  background:
    linear-gradient(135deg, rgba(33, 27, 22, 0.94), rgba(95, 81, 65, 0.92)),
    #211b16;
}

.collection-console h3,
.collection-console .section-head span,
.collection-console .console-intro {
  color: var(--white);
}

.console-intro {
  margin: 0 0 12px;
  font-size: 13px;
}

.console-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.console-actions button {
  border: 1px solid rgba(255, 250, 240, 0.32);
  background: #fff8e9;
  color: var(--ink);
  padding: 12px;
  cursor: pointer;
}

.console-actions button:hover {
  background: var(--orange);
  color: white;
}

.console-actions .secondary-action {
  background: rgba(255, 248, 233, 0.14);
  color: var(--white);
}

.muted-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.muted-actions button {
  background: rgba(255, 248, 233, 0.14);
  color: var(--white);
}

.agent-prompt-panel {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 250, 240, 0.22);
  background: rgba(255, 248, 233, 0.1);
}

.agent-prompt-panel h3,
.agent-prompt-panel .section-head span {
  color: var(--white);
}

.agent-prompt-panel p {
  margin: 0 0 10px;
  color: rgba(255, 250, 240, 0.78);
  font-size: 13px;
  line-height: 1.55;
}

#agentPromptOutput {
  min-height: 240px;
  margin: 0 0 10px;
  border-color: rgba(255, 250, 240, 0.32);
  background: rgba(255, 250, 240, 0.96);
  font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  font-size: 13px;
}

#copyPromptBtn {
  width: 100%;
  border: 1px solid rgba(255, 250, 240, 0.32);
  background: var(--orange);
  color: white;
  padding: 12px;
  cursor: pointer;
}

#copyPromptBtn:hover {
  background: var(--red);
}

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

.collection-card {
  padding: 12px;
  border: 1px solid rgba(255, 250, 240, 0.22);
  background: rgba(255, 248, 233, 0.1);
}

.collection-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.collection-top strong {
  color: var(--white);
}

.collection-top span {
  color: #f4c08e;
  font-size: 12px;
  white-space: nowrap;
}

.collection-card p,
.collection-card dd {
  color: rgba(255, 250, 240, 0.78);
  font-size: 13px;
  line-height: 1.55;
}

.collection-card p {
  margin: 0 0 8px;
}

.collection-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.collection-card dl div {
  padding-top: 7px;
  border-top: 1px solid rgba(255, 250, 240, 0.18);
}

.collection-card dt {
  color: #f4c08e;
  font-size: 12px;
}

.collection-card dd {
  margin: 2px 0 0;
}

.material-list {
  display: grid;
  gap: 10px;
}

.material-item {
  padding: 12px;
  border: 1px solid rgba(222, 201, 170, 0.92);
  background: rgba(255, 250, 240, 0.82);
}

.material-item span {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  color: var(--red);
  font-size: 12px;
}

.material-item strong {
  display: block;
  color: var(--ink);
  line-height: 1.4;
}

.material-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.material-meta em {
  padding: 4px 7px;
  border: 1px solid var(--line);
  background: #fff8e9;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.material-item p {
  margin: 8px 0;
  font-size: 13px;
}

.material-item a {
  color: var(--red);
  font-size: 13px;
}

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

.toolchain-grid article {
  padding: 12px;
  border: 1px solid rgba(222, 201, 170, 0.92);
  background: rgba(255, 250, 240, 0.82);
}

.toolchain-grid strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.toolchain-grid p {
  margin: 0;
  font-size: 13px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h3 {
  margin: 0;
}

.section-head span {
  color: var(--red);
  font-size: 13px;
}

.source-list {
  display: grid;
  gap: 10px;
}

.source-item {
  padding: 12px;
  border: 1px solid rgba(222, 201, 170, 0.9);
  background: rgba(255, 250, 240, 0.76);
}

.source-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  line-height: 1.4;
}

.source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.source-meta span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  background: #fff8e9;
  color: var(--muted);
  font-size: 12px;
}

.source-item a {
  color: var(--red);
  font-size: 13px;
}

.source-item p {
  margin: 8px 0 0;
  font-size: 13px;
}

.document-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.document-item {
  padding: 10px;
  border-left: 3px solid var(--green);
  background: rgba(243, 226, 196, 0.62);
}

.document-item strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.document-item p {
  margin: 4px 0 6px;
}

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.coverage-cell {
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.72);
}

.coverage-cell strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.coverage-cell span {
  color: var(--red);
  font-size: 13px;
}

.gap-box {
  margin-top: 10px;
  padding: 12px;
  background: var(--ink);
}

.gap-box strong,
.gap-box p {
  color: var(--white);
}

.gap-box p {
  margin: 6px 0 0;
  font-size: 13px;
}

.gap-action-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.74);
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-list.compact {
  gap: 8px;
}

.task-item {
  padding: 12px;
  border: 1px solid rgba(222, 201, 170, 0.92);
  background: rgba(255, 250, 240, 0.82);
}

.task-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.task-item p {
  margin: 0;
  font-size: 13px;
}

.task-item span {
  display: inline-block;
  margin-bottom: 7px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  color: var(--red);
  font-size: 12px;
}

.knowledge-card {
  display: grid;
  gap: 12px;
  background:
    linear-gradient(135deg, rgba(255, 248, 233, 0.98), rgba(240, 220, 186, 0.78));
}

.knowledge-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.knowledge-head span {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--red);
  font-size: 14px;
}

.knowledge-head strong {
  display: block;
  font-size: 34px;
  letter-spacing: 0;
}

.knowledge-block h3 {
  font-size: 18px;
}

.knowledge-block p {
  margin: 0;
}

.evidence-block ul {
  padding-left: 18px;
  margin: 0;
}

.evidence-block li {
  margin-bottom: 8px;
  font-size: 14px;
}

.push-card {
  background: var(--ink);
}

.push-card strong,
.push-card p {
  color: var(--white);
}

.method-chain span {
  padding: 8px 11px;
  border: 1px solid var(--line);
  background: #fff6e4;
  color: var(--muted);
  font-size: 14px;
}

.user-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.user-grid article,
.insight-card,
.motivation-card,
.bundle-card,
.copy-card,
.score-card {
  border: 1px solid var(--line);
  background: #fff8e9;
  padding: 16px;
}

h3 {
  margin: 0 0 10px;
  font-size: 20px;
  letter-spacing: 0;
}

p,
li {
  color: var(--muted);
  line-height: 1.65;
}

.user-grid p {
  margin: 8px 0;
  font-size: 14px;
}

.user-grid strong {
  display: block;
  margin-top: 12px;
  color: var(--green);
  font-size: 14px;
  line-height: 1.45;
}

.insight-card {
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff8e9, #f4e1be);
}

.motivation-card {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(255, 248, 233, 0.96), rgba(231, 212, 181, 0.72));
}

.motivation-card div {
  padding: 12px;
  border-left: 4px solid var(--green);
  background: rgba(255, 250, 240, 0.7);
}

.motivation-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 15px;
}

.motivation-card p {
  margin: 0;
  font-size: 14px;
}

.samples-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.samples-strip img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--line);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 10px 8px;
  cursor: pointer;
}

.tab.active {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.poster-card {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.poster-set {
  display: grid;
  gap: 10px;
}

.poster-preview {
  position: relative;
  min-height: 255px;
  padding: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), transparent),
    linear-gradient(135deg, #f8cf8f, #f26d32);
  border: 1px solid var(--line);
}

.poster-primary {
  min-height: 300px;
}

.poster-secondary {
  min-height: 240px;
  background:
    radial-gradient(circle at 80% 18%, rgba(255, 255, 255, 0.44), transparent 8rem),
    linear-gradient(145deg, #7d8f71, #24301f);
}

.poster-kicker {
  margin-bottom: 10px;
  color: rgba(255, 250, 240, 0.86);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.poster-title {
  font-size: 30px;
  line-height: 1.05;
  color: var(--red);
  font-weight: 900;
  letter-spacing: 0;
}

.poster-secondary .poster-title {
  color: #fff8e9;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.22);
}

.poster-teacher {
  margin-top: 32px;
  padding: 10px;
  background: rgba(255, 250, 240, 0.72);
  color: var(--green);
}

.poster-secondary .poster-teacher {
  color: var(--red);
}

.poster-books {
  position: absolute;
  left: 18px;
  bottom: 74px;
  color: white;
  font-weight: 700;
}

.poster-action {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 14px;
  background: #fff8e9;
  color: var(--red);
  font-weight: 800;
}

.qr {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: white;
  border: 2px solid var(--ink);
  font-size: 12px;
}

.poster-card ul {
  padding-left: 18px;
  margin: 10px 0 0;
}

.score-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--muted);
}

.score-row strong {
  color: var(--red);
}

.bundle-card {
  margin-top: 16px;
  background: #fff8e9;
}

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

.bundle-grid article {
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.82), rgba(243, 226, 196, 0.78));
}

.bundle-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--red);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.bundle-grid strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.bundle-grid p {
  margin: 0;
  font-size: 13px;
}

.estimate-card {
  background: linear-gradient(135deg, #fff8e9, #f1d7ad);
}

.estimate-hero {
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid rgba(200, 62, 42, 0.24);
  background: rgba(255, 250, 240, 0.68);
}

.estimate-hero span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.estimate-hero strong {
  display: block;
  margin: 6px 0;
  color: var(--red);
  font-size: 32px;
  letter-spacing: 0;
}

.estimate-hero p,
.decision-box p {
  margin: 0;
  font-size: 14px;
}

.decision-box {
  margin-top: 12px;
  padding: 14px;
  background: var(--ink);
  color: var(--white);
}

.decision-box strong,
.decision-box p {
  color: var(--white);
}

.copy-card {
  margin-bottom: 12px;
}

.copy-card p {
  margin: 0;
  font-size: 17px;
}

.copy-card.alt {
  background: #fff2d8;
}

.copy-card.muted {
  background: #f3e2c4;
}

.private-framework {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.private-framework div {
  position: relative;
  border: 1px solid var(--line);
  background: #fff8e9;
  padding: 14px 14px 14px 42px;
}

.private-framework span {
  position: absolute;
  left: 12px;
  top: 14px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 13px;
}

.private-framework strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.private-framework p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.showcase-section {
  margin-bottom: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 250, 240, 0.92), rgba(240, 220, 186, 0.78));
  box-shadow: var(--shadow);
}

.showcase-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.showcase-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border: 1px solid var(--red);
  color: var(--red);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.showcase-header h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: 0;
  line-height: 1.15;
}

.showcase-conclusion {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.showcase-card {
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff8e9;
}

.showcase-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: 0;
}

.showcase-stats,
.showcase-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.showcase-stats li,
.showcase-list li {
  padding: 6px 0;
  border-bottom: 1px dashed rgba(222, 201, 170, 0.6);
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.showcase-stats li:last-child,
.showcase-list li:last-child {
  border-bottom: none;
}

.showcase-stats strong {
  color: var(--red);
  font-size: 18px;
}

.showcase-list li::before {
  content: "·";
  margin-right: 8px;
  color: var(--green);
  font-weight: bold;
}

.showcase-boundary {
  padding: 16px 18px;
  border: 1px solid rgba(200, 62, 42, 0.28);
  background: rgba(255, 248, 233, 0.6);
}

.showcase-boundary h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--red);
}

.showcase-boundary ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.showcase-boundary li {
  padding: 6px 12px;
  border: 1px solid rgba(200, 62, 42, 0.32);
  background: rgba(255, 250, 240, 0.72);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: auto;
  }

  .hero {
    display: block;
  }

  .hero-note {
    width: auto;
    margin-top: 18px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 16px;
  }

  .user-grid,
  .poster-card,
  .samples-strip,
  .private-framework,
  .bundle-grid,
  .research-flow,
  .coverage-grid,
  .toolchain-grid,
  .collection-grid,
  .console-actions,
  .showcase-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    flex-direction: column;
  }
}
