:root {
  --bg: #e9eaef;
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .76);
  --ink: #151922;
  --muted: #687083;
  --line: rgba(30, 35, 46, .09);
  --dark: #171d27;
  --orange: #ff6542;
  --cyan: #4dd6e9;
  --violet: #9d7cff;
  --green: #34d399;
  --shadow: 0 28px 80px rgba(28, 33, 44, .16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 16%, rgba(157, 124, 255, .35), transparent 26%),
    radial-gradient(circle at 72% 12%, rgba(77, 214, 233, .42), transparent 24%),
    radial-gradient(circle at 82% 76%, rgba(255, 101, 66, .22), transparent 26%),
    linear-gradient(135deg, #f8f8fb 0%, #e6e7ec 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .35) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 72%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.appShell {
  width: min(1120px, calc(100vw - 48px));
  margin: 32px auto;
  position: relative;
}

.appShell::before,
.appShell::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  filter: blur(4px);
}

.appShell::before {
  width: 260px;
  height: 260px;
  right: -70px;
  top: 110px;
  background: rgba(77, 214, 233, .24);
}

.appShell::after {
  width: 220px;
  height: 220px;
  left: -80px;
  bottom: 120px;
  background: rgba(255, 101, 66, .18);
}

.heroPanel,
.categoryBoard,
.quickSearch,
.supplierStrip {
  border: 1px solid rgba(255, 255, 255, .68);
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(160%);
}

.heroPanel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: end;
  min-height: 210px;
  padding: 32px;
  border-radius: 34px;
  position: relative;
  overflow: hidden;
}

.heroPanel::after {
  content: "";
  position: absolute;
  right: 30px;
  top: 28px;
  width: 250px;
  height: 120px;
  border-radius: 999px 999px 0 0;
  background:
    radial-gradient(circle at 50% 100%, transparent 36%, rgba(255, 101, 66, .24) 37%, rgba(255, 101, 66, .08) 68%, transparent 69%);
  opacity: .9;
}

h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  width: fit-content;
  margin-bottom: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #bf3c22;
  background: rgba(255, 101, 66, .13);
  font-size: 12px;
  font-weight: 800;
}

.heroPanel h1 {
  max-width: 640px;
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: 0;
}

.heroPanel p:not(.eyebrow) {
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

input,
select {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .64);
  color: var(--ink);
  padding: 0 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 10px 26px rgba(28, 33, 44, .07);
}

input:focus,
select:focus {
  outline: 3px solid rgba(77, 214, 233, .22);
  border-color: rgba(77, 214, 233, .62);
}

.categoryBoard {
  margin-top: 18px;
  padding: 20px;
  border-radius: 30px;
}

.sectionHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.sectionHead h2 {
  font-size: 18px;
}

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

.categoryGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.categoryCard {
  min-height: 148px;
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 24px;
  background: rgba(255, 255, 255, .48);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 12px 32px rgba(28, 33, 44, .06);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.categoryCard:hover,
.categoryCard.active {
  transform: translateY(-3px);
  border-color: rgba(255, 101, 66, .36);
  background: rgba(255, 255, 255, .82);
}

.cardIcon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--dark), #303847);
  box-shadow: 0 12px 24px rgba(23, 29, 39, .18);
}

.categoryCard:nth-child(2n) .cardIcon {
  background: linear-gradient(135deg, var(--cyan), #5f8cff);
}

.categoryCard:nth-child(3n) .cardIcon {
  background: linear-gradient(135deg, var(--orange), #ffad66);
}

.categoryCard strong {
  font-size: 16px;
  line-height: 1.32;
}

.categoryCard em {
  padding: 3px 8px;
  border-radius: 999px;
  color: #bf3c22;
  background: rgba(255, 101, 66, .12);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.categoryCard p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.quickSearch {
  margin-top: 18px;
  padding: 26px;
  border-radius: 34px;
}

.quickTitle {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.iconBadge {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(135deg, var(--dark), #303847);
}

.iconBadge svg {
  fill: currentColor;
  stroke: currentColor;
}

.quickTitle h1 {
  font-size: 28px;
}

.quickTitle p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.quickFields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
}

.fieldLabel {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.craftPicker {
  margin-top: 22px;
}

.craftButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 10px;
}

.craftButtons button {
  min-height: 36px;
  padding: 5px 13px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  color: var(--ink);
  transition: transform .16s ease, background .16s ease;
}

.craftButtons button:hover,
.craftButtons button.active {
  transform: translateY(-1px);
  background: var(--dark);
  color: #fff;
}

.quickButton {
  width: 100%;
  min-height: 58px;
  margin-top: 22px;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--dark), #303847);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 18px 36px rgba(23, 29, 39, .24);
}

.buttonIcon {
  width: 21px;
  height: 21px;
}

.quickAnswer {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .74), rgba(255, 255, 255, .38)),
    radial-gradient(circle at 88% 12%, rgba(77, 214, 233, .32), transparent 32%);
  box-shadow: 0 18px 42px rgba(28, 33, 44, .1);
  backdrop-filter: blur(18px) saturate(170%);
}

.answerHero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 18px;
  align-items: center;
}

.answerHero span,
.answerMain span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.answerHero strong,
.answerMain strong {
  display: block;
  margin-top: 7px;
  font-size: 34px;
  line-height: 1.1;
}

.answerHero em,
.answerMain em {
  display: block;
  margin-top: 8px;
  color: #bf3c22;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.answerGauge {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, .92) 48%, transparent 50%),
    conic-gradient(var(--orange), var(--cyan), var(--violet), var(--orange));
}

.answerGauge b {
  font-size: 26px;
}

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

.quickAnswer ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.calcBreakdown {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 18px;
  background: rgba(255, 255, 255, .46);
}

.calcBreakdown h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
}

.calcLine {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-top: 1px solid rgba(30, 35, 46, .08);
  color: var(--muted);
}

.calcLine:first-of-type {
  border-top: 0;
}

.calcLine strong {
  flex: 0 0 auto;
  color: var(--ink);
}

.quickAnswer li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .58);
  color: var(--muted);
  font-size: 13px;
}

.quickAnswer li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quickAnswer li strong {
  flex: 0 0 auto;
  color: var(--ink);
}

.dataSummary {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.supplierStrip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding: 12px;
  border-radius: 28px;
}

.supplierCard {
  padding: 13px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .52);
}

.supplierCard strong,
.supplierCard span {
  display: block;
}

.supplierCard span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

dialog {
  width: min(1000px, calc(100vw - 32px));
  max-height: calc(100vh - 50px);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 0;
}

.dialogHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.rawTable {
  overflow: auto;
  max-height: calc(100vh - 130px);
  padding: 12px;
}

table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 12px;
}

td,
th {
  border: 1px solid var(--line);
  padding: 6px 8px;
  vertical-align: top;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  .appShell {
    width: min(860px, calc(100vw - 28px));
  }

  .heroPanel,
  .quickFields,
  .answerHero,
  .supplierStrip {
    grid-template-columns: 1fr;
  }

  .categoryGrid,
  .quickAnswer ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .appShell {
    width: calc(100vw - 18px);
    margin: 9px auto;
  }

  .heroPanel,
  .categoryBoard,
  .quickSearch {
    border-radius: 24px;
    padding: 18px;
  }

  .heroPanel h1 {
    font-size: 32px;
  }

  .categoryGrid,
  .quickAnswer ul {
    grid-template-columns: 1fr;
  }
}
