:root {
  --lenovo-red: #e2231a;
  --red-dark: #b51c16;
  --ink: #15171d;
  --text: #242832;
  --muted: #687182;
  --line: #dde3ec;
  --canvas: #eef2f6;
  --panel: #ffffff;
  --soft: #f7f9fc;
  --blue: #2457c5;
  --green: #168247;
  --amber: #a35d00;
  --violet: #6254c8;
  --shadow-1: 0 8px 24px rgba(15, 23, 42, .08);
  --shadow-2: 0 20px 52px rgba(15, 23, 42, .16);
  --radius: 8px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--canvas);
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.app-shell {
  height: 100vh;
  min-width: 1180px;
  display: grid;
  grid-template-columns: minmax(360px, 420px) 1fr;
}

.conversation-pane {
  min-width: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: 68px 52px 1fr auto;
}

.brandbar,
.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brandbar {
  padding: 0 18px;
}

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

.brand strong {
  display: block;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.15;
}

.brand span:last-child {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--lenovo-red);
  position: relative;
  box-shadow: inset 10px 0 0 rgba(255, 255, 255, .9);
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 7px;
  width: 5px;
  height: 16px;
  border-radius: 8px;
  background: #fff;
}

.ghost-button,
.primary-button,
.send-button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 36px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.primary-button,
.send-button {
  border-color: var(--lenovo-red);
  background: var(--lenovo-red);
  color: #fff;
}

.ghost-button:hover,
.icon-button:hover {
  border-color: #c6ced9;
  background: var(--soft);
}

.primary-button:hover,
.send-button:hover {
  background: var(--red-dark);
}

.segment-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
}

.segment-tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.segment-tabs button.active {
  background: var(--ink);
  color: #fff;
}

.chat-stream {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  display: grid;
  gap: 7px;
  max-width: 96%;
}

.message.user {
  margin-left: auto;
  justify-items: end;
}

.message.assistant {
  justify-items: start;
}

.message-meta {
  color: var(--muted);
  font-size: 12px;
}

.bubble {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 13px;
  line-height: 1.62;
  font-size: 14px;
  background: #fff;
}

.user .bubble {
  border-color: #d6dbe5;
  background: #f4f6fa;
}

.assistant .bubble {
  border-color: #f0c7c4;
  background: #fff7f6;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-actions button,
.quick-prompts button,
.small-action {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #3f4652;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.message-actions button:hover,
.quick-prompts button:hover,
.small-action:hover {
  color: var(--lenovo-red);
  border-color: #efb3af;
  background: #fff8f7;
}

.composer {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.quick-prompts {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.quick-prompts button {
  white-space: nowrap;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.composer-tools label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.composer-tools .icon-button {
  margin-left: auto;
  min-width: 34px;
  padding: 0;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 8px;
}

textarea {
  width: 100%;
  resize: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
  outline: none;
  color: var(--text);
  background: var(--soft);
  min-height: 48px;
}

textarea:focus {
  border-color: #aeb8c8;
  background: #fff;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: 74px 52px 1fr;
  background: var(--canvas);
}

.workspace-header {
  padding: 0 24px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.workspace-header h1 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .68);
}

.page-tab {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.page-tab.active {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}

.content-canvas {
  min-height: 0;
  overflow: auto;
  padding: 22px 24px 28px;
}

.home-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 18px;
}

.panel,
.product-card,
.summary-strip,
.modal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-1);
}

.panel {
  padding: 18px;
}

.panel h2,
.panel h3,
.section-title {
  margin: 0;
  color: var(--ink);
}

.panel h2 {
  font-size: 24px;
  line-height: 1.25;
  max-width: 760px;
}

.panel h3,
.section-title {
  font-size: 17px;
}

.panel p {
  color: var(--muted);
  line-height: 1.72;
}

.intent-grid,
.policy-grid,
.product-grid {
  display: grid;
  gap: 12px;
}

.intent-grid {
  margin-top: 18px;
  grid-template-columns: repeat(3, 1fr);
}

.intent-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--soft);
}

.intent-card strong {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
}

.intent-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.policy-grid {
  margin-top: 14px;
  grid-template-columns: repeat(2, 1fr);
}

.policy-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.policy-item b {
  display: block;
  margin-bottom: 4px;
}

.policy-item span {
  color: var(--muted);
  font-size: 13px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--line);
}

.summary-strip div {
  background: #fff;
  padding: 14px;
}

.summary-strip b {
  display: block;
  color: var(--ink);
  font-size: 20px;
}

.summary-strip span {
  color: var(--muted);
  font-size: 12px;
}

.product-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.product-card {
  overflow: hidden;
  display: grid;
  grid-template-rows: 132px auto;
}

.product-visual {
  position: relative;
  display: grid;
  place-items: center;
  background: var(--product-bg, #f3f6fa);
}

.device {
  width: 145px;
  height: 86px;
  border: 9px solid #20242c;
  border-bottom-width: 15px;
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(226, 35, 26, .22), rgba(36, 87, 197, .18)), #fff;
  box-shadow: 0 18px 35px rgba(15, 23, 42, .16);
}

.device.server {
  height: 72px;
  border: 0;
  border-radius: 7px;
  background:
    linear-gradient(#2d333e 0 0) 18px 20px / 108px 8px no-repeat,
    linear-gradient(#687182 0 0) 18px 38px / 84px 8px no-repeat,
    #20242c;
}

.product-body {
  padding: 15px;
}

.product-body h3 {
  margin: 0 0 5px;
  font-size: 17px;
}

.spec {
  min-height: 42px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.price {
  color: var(--lenovo-red);
  font-size: 22px;
  font-weight: 950;
}

.old-price {
  color: #9aa3b2;
  font-size: 12px;
  text-decoration: line-through;
}

.reason-box {
  border: 1px solid #f0d6d4;
  border-radius: var(--radius);
  background: #fff8f7;
  padding: 10px;
  color: #7b241f;
  font-size: 13px;
  line-height: 1.55;
}

.tag-row,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-row {
  margin: 11px 0;
}

.tag {
  border-radius: 999px;
  background: #f0f3f7;
  color: #4f5969;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.card-actions {
  margin-top: 12px;
}

.card-actions button {
  flex: 1 0 auto;
}

.detail-layout {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: 18px;
}

.detail-hero {
  min-height: 420px;
  display: grid;
  place-items: center;
  background: var(--product-bg, #f3f6fa);
}

.detail-copy {
  display: grid;
  gap: 14px;
}

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

.highlight-list div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px;
  background: var(--soft);
  font-weight: 800;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-1);
}

.compare-table th,
.compare-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 13px;
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}

.compare-table th {
  background: #f8fafc;
  color: var(--ink);
  font-size: 13px;
}

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

.solution-grid,
.price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.steps {
  display: grid;
  gap: 10px;
  counter-reset: step;
}

.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
}

.step b {
  display: block;
  margin-bottom: 4px;
}

.step span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.price-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
}

.price-line {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed #d6dce6;
  padding: 8px 0;
  color: var(--muted);
}

.price-line.total {
  border: 0;
  color: var(--ink);
  font-weight: 950;
  font-size: 18px;
}

.modal-layer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .38);
  z-index: 50;
  padding: 24px;
}

.modal-layer.hidden {
  display: none;
}

.modal-card {
  position: relative;
  width: min(560px, 100%);
  padding: 22px;
  box-shadow: var(--shadow-2);
}

.modal-card h2 {
  margin: 0 0 16px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 22px;
  line-height: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #3f4652;
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  min-height: 40px;
  padding: 9px 10px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  border: 1px solid #b8dfc6;
  border-radius: var(--radius);
  background: #f2fbf5;
  color: #145c34;
  box-shadow: var(--shadow-1);
  padding: 12px 14px;
  font-weight: 800;
  z-index: 60;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 380px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .app-shell {
    min-width: 0;
    height: auto;
    grid-template-columns: 1fr;
  }

  .conversation-pane,
  .workspace {
    min-height: 100vh;
  }

  .home-grid,
  .detail-layout,
  .solution-grid,
  .price-grid,
  .product-grid,
  .intent-grid {
    grid-template-columns: 1fr;
  }
}
