* { box-sizing: border-box; }
:root {
  --ink: #17202a;
  --muted: #657084;
  --line: #dfe4ea;
  --paper: #ffffff;
  --soft: #f6f8fb;
  --green: #1f9d7a;
  --green-dark: #14785d;
  --blue: #315c96;
  --amber: #b56a1f;
  --rose: #b94f62;
}
body {
  margin: 0;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  background: var(--soft);
  color: var(--ink);
}
button,
.button-link {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--green);
  color: white;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}
button:hover,
.button-link:hover { background: var(--green-dark); }
button:disabled {
  opacity: .6;
  cursor: not-allowed;
}
.ghost {
  background: #eef2f7;
  color: #314052;
}
.ghost:hover { background: #e1e8f0; }
input, textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #ccd4df;
  border-radius: 6px;
  padding: 10px 11px;
  font: inherit;
  outline: none;
  background: #fff;
}
input:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 157, 122, .12);
}
label {
  display: block;
  margin-bottom: 14px;
  color: #415064;
  font-size: 13px;
  font-weight: 700;
}

.setup-page {
  min-height: 100vh;
  background:
    linear-gradient(180deg, #eef4f8 0, #f7f8fb 360px),
    #f7f8fb;
}
.setup-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 32px;
}
.setup-hero {
  min-height: 190px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 22px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.setup-hero h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.18;
}
.hero-copy {
  max-width: 580px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.hero-actions,
.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}
.metric {
  padding: 16px;
  background: var(--paper);
}
.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  line-height: 1.2;
}
.setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.panel {
  min-height: 250px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.primary-panel {
  border-top: 4px solid var(--green);
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.panel h2 {
  margin: 0;
  font-size: 20px;
}
.panel-copy {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}
.pill {
  border: 1px solid #d3dee9;
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--blue);
  background: #f0f5fb;
  font-size: 12px;
  font-weight: 800;
}
.copy-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}
.icon-button {
  min-width: 64px;
}
.role-list {
  margin: 0 0 18px;
  display: grid;
  gap: 10px;
}
.role-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf0f4;
}
.role-list dt {
  color: var(--muted);
  font-weight: 700;
}
.role-list dd {
  margin: 0;
  font-weight: 800;
}
.secondary-link {
  background: var(--blue);
}
.secondary-link:hover {
  background: #244775;
}
.clean-steps {
  margin: 0;
  padding-left: 22px;
  color: #314052;
  line-height: 1.9;
}
.setup-note {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #ecd8bf;
  border-radius: 8px;
  background: #fff8ef;
  color: var(--amber);
  font-size: 13px;
  font-weight: 700;
}

.landing-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}
.landing-hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  gap: 36px;
  align-items: center;
  padding: 34px 0 28px;
}
.hero-content h1 {
  max-width: 660px;
  margin: 0;
  font-size: 44px;
  line-height: 1.12;
}
.primary-cta {
  min-width: 190px;
  background: #14876f;
}
.primary-cta:hover {
  background: #0f6f5c;
}
.ghost-link {
  border: 1px solid #d7e0e8;
}
.small-note {
  max-width: 620px;
  margin-top: 14px;
  color: #687487;
}
.hero-preview {
  padding: 22px;
  border: 1px solid #dce6ed;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(25, 49, 70, .08);
}
.preview-window {
  min-height: 270px;
  padding: 18px;
  border: 1px solid #e2e8ee;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #f7fbfa 0, #ffffff 52%),
    #fff;
}
.preview-top {
  display: flex;
  gap: 6px;
  margin-bottom: 34px;
}
.preview-top span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #9fb5c6;
}
.preview-line {
  width: 68%;
  height: 12px;
  margin-bottom: 12px;
  border-radius: 6px;
  background: #dfe8ee;
}
.preview-line.wide {
  width: 88%;
}
.preview-card {
  display: grid;
  gap: 8px;
  margin-top: 32px;
  padding: 18px;
  border: 1px solid #cce9df;
  border-radius: 8px;
  background: #effaf5;
}
.preview-card strong {
  color: #107158;
  font-size: 24px;
}
.preview-card span {
  color: #526172;
}
.public-section,
.public-grid,
.qr-section {
  margin-top: 20px;
}
.section-heading {
  margin-bottom: 14px;
}
.section-heading h2,
.qr-section h2,
.info-panel h2 {
  margin: 0;
  font-size: 24px;
}
.step-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.step-cards article,
.info-panel,
.qr-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.step-cards article {
  min-height: 180px;
  padding: 20px;
}
.step-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  border-radius: 8px;
  color: #fff;
  background: #315c96;
  font-weight: 800;
}
.step-cards h3 {
  margin: 0 0 8px;
  font-size: 18px;
}
.step-cards p,
.qr-section p {
  color: var(--muted);
  line-height: 1.7;
}
.public-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.info-panel {
  padding: 22px;
}
.plain-list {
  margin: 16px 0 0;
  padding-left: 20px;
  color: #314052;
  line-height: 1.9;
}
.qr-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 24px;
  align-items: center;
  padding: 24px;
}
.qr-card {
  min-height: 210px;
  display: grid;
  place-items: center;
  border: 1px dashed #bcc9d6;
  border-radius: 8px;
  background: #f8fafc;
}
.qr-card img {
  width: 180px;
  height: 180px;
  object-fit: contain;
}
.qr-placeholder {
  display: none;
  gap: 8px;
  padding: 18px;
  text-align: center;
  color: #5d6a7b;
}
.qr-placeholder strong {
  color: #263545;
}
.public-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 18px 0 4px;
  color: var(--muted);
  font-size: 13px;
}
.public-footer a {
  color: #14785d;
  font-weight: 800;
  text-decoration: none;
}
.compact-hero {
  min-height: 150px;
}

.app {
  height: 100vh;
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  background: #fff;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
h1 { margin: 0; font-size: 20px; }
p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.settings {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
}
.hidden { display: none; }
.row {
  display: flex;
  gap: 8px;
}
.setup-app {
  height: auto;
  min-height: 100vh;
  grid-template-rows: auto auto auto auto;
}
h2 {
  margin: 0 0 12px;
  font-size: 16px;
}
.info-box {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #374151;
}
.steps {
  margin: 0;
  padding-left: 22px;
  color: #374151;
  line-height: 1.8;
}
.messages {
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg {
  max-width: 76%;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.user {
  align-self: flex-end;
  background: #dcfce7;
}
.assistant {
  align-self: flex-start;
  background: #f3f4f6;
}
.meta {
  font-size: 12px;
  color: var(--muted);
  padding-top: 4px;
}
.composer, .feedback {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}
.feedback {
  background: #fafafa;
}
@media (max-width: 760px) {
  .setup-shell { width: min(100% - 20px, 1120px); padding-top: 16px; }
  .setup-hero { display: block; min-height: auto; }
  .hero-actions { margin-top: 18px; }
  .status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-grid { grid-template-columns: 1fr; }
  .setup-note { display: block; }
  .setup-note span { display: block; }
  .setup-note span + span { margin-top: 8px; }
  .landing-shell { width: min(100% - 20px, 1080px); padding-top: 18px; }
  .landing-hero,
  .public-grid,
  .qr-section {
    grid-template-columns: 1fr;
  }
  .landing-hero {
    min-height: auto;
    gap: 20px;
  }
  .hero-content h1 {
    font-size: 34px;
  }
  .step-cards {
    grid-template-columns: 1fr;
  }
  .qr-section {
    padding: 20px;
  }
}
@media (max-width: 640px) {
  .app { border: 0; }
  .msg { max-width: 88%; }
  .composer, .feedback { grid-template-columns: 1fr; }
  .copy-field,
  .action-row { grid-template-columns: 1fr; }
  .hero-actions,
  .action-row {
    flex-direction: column;
  }
  .hero-actions > *,
  .action-row > * {
    width: 100%;
  }
  .setup-hero h1 { font-size: 28px; }
}
