:root {
  color-scheme: dark;
  --ink: #0b0d0e;
  --charcoal: #171a1c;
  --charcoal-2: #202426;
  --warm-white: #f1eee8;
  --muted: #a8aba8;
  --line: rgba(241, 238, 232, 0.12);
  --line-strong: rgba(241, 238, 232, 0.22);
  --cyan: #43b4ca;
  --cyan-soft: rgba(67, 180, 202, 0.16);
  --error: #e17f72;
  --success: #7ebca7;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.36);
  --radius: 24px;
  font-family: Inter, "Helvetica Neue", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--ink);
  color: var(--warm-white);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 74% 10%, rgba(67, 180, 202, 0.08), transparent 30%),
    linear-gradient(145deg, #090b0c 0%, #101315 48%, #090b0c 100%);
  color: var(--warm-white);
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.material-light {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  filter: blur(70px) saturate(0.75);
  opacity: 0.14;
  background-repeat: no-repeat;
  background-size: cover;
  animation: material-drift 18s ease-in-out infinite alternate;
}

.material-light-a {
  width: 52vw;
  height: 52vw;
  right: -15vw;
  top: -10vw;
  background-image: url('/assets/xingkong-t.webp');
  border-radius: 44% 56% 64% 36%;
}

.material-light-b {
  width: 38vw;
  height: 38vw;
  left: -18vw;
  bottom: 2vh;
  background-image: url('/assets/huansha.webp');
  animation-delay: -7s;
}

.site-header,
main,
.site-footer {
  width: min(1500px, calc(100% - 64px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  text-decoration: none;
  letter-spacing: 0.22em;
  font-size: 13px;
  font-weight: 650;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.header-meta > .eyebrow { margin: 0; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-pill i,
.data-dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8c9290;
  box-shadow: 0 0 0 4px rgba(140, 146, 144, 0.09);
}

.status-pill.online i,
.data-note.online .data-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(126, 188, 167, 0.1);
}

.status-pill.offline i,
.data-note.offline .data-dot { background: var(--error); }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.55fr);
  align-items: end;
  gap: 8vw;
  padding: 72px 0 48px;
}

.intro h1 {
  max-width: 960px;
  margin: 0;
  font-size: clamp(44px, 5.25vw, 84px);
  font-weight: 430;
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.intro h1 > span,
.intro h1 em {
  display: block;
  white-space: nowrap;
}

.intro h1 em {
  color: var(--cyan);
  font-style: normal;
  font-weight: 430;
}

.intro-copy {
  max-width: 390px;
  margin: 0 0 8px;
  color: #c8c8c3;
  font-size: 15px;
  line-height: 1.9;
}

.intro-copy span { display: block; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 2.16fr) minmax(320px, 0.84fr);
  gap: 24px;
  align-items: start;
  padding-bottom: 88px;
}

.glass-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: linear-gradient(145deg, rgba(31, 35, 37, 0.84), rgba(13, 16, 17, 0.92));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.05);
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,0.07), transparent 22%, transparent 72%, rgba(67,180,202,0.05));
}

.chat-panel {
  min-height: 720px;
  height: calc(100vh - 174px);
  max-height: 920px;
  display: grid;
  grid-template-rows: auto auto auto minmax(240px, 1fr);
  border-radius: var(--radius);
  padding: clamp(22px, 3vw, 40px);
}

.panel-head,
.dialog-head,
.rail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.panel-head h2,
.rail-heading h2,
.inventory-card h2,
.dialog-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.text-button,
.close-button {
  border: 0;
  padding: 4px 0;
  color: var(--muted);
  background: none;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.text-button:hover,
.close-button:hover { color: var(--warm-white); text-decoration-color: currentColor; }

.data-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.view-switch {
  display: inline-flex;
  width: fit-content;
  height: 40px;
  align-items: center;
  align-self: start;
  justify-self: start;
  gap: 3px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: rgba(255,255,255,0.025);
}

.view-switch button {
  border: 0;
  border-radius: 999px;
  padding: 8px 15px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

.view-switch button[aria-selected="true"] { color: #071013; background: var(--cyan); }

#chat-view {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto auto;
}

#chat-view[hidden] { display: none; }

.stock-table-view {
  min-width: 0;
  min-height: 0;
  margin-top: 18px;
  overflow-y: auto;
}
.stock-table-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stock-table-meta > span { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; background: rgba(255,255,255,0.025); }
.stock-table-meta small, .stock-table-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-table-meta small { margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.stock-table-meta strong { font-size: 11px; font-weight: 550; }

.stock-filter-form { display: grid; grid-template-columns: 1.7fr repeat(5, minmax(90px, 1fr)); gap: 9px; margin-top: 14px; }
.stock-filter-form label { min-width: 0; }
.stock-filter-form label > span { display: block; margin: 0 0 5px 2px; color: var(--muted); font-size: 9px; }
.stock-filter-form input:not([type="checkbox"]), .stock-filter-form select { width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; color: var(--warm-white); background: #111516; outline: 0; font: inherit; font-size: 11px; }
.stock-filter-form input:focus, .stock-filter-form select:focus { border-color: rgba(67,180,202,0.6); }
.stock-filter-form .zero-stock-toggle { display: flex; align-items: center; gap: 8px; min-height: 38px; align-self: end; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; cursor: pointer; }
.stock-filter-form .zero-stock-toggle span { margin: 0; white-space: nowrap; }
.zero-stock-toggle input { accent-color: var(--cyan); }
.stock-reset { align-self: end; min-height: 38px; }
.stock-table-status { min-height: 30px; padding: 12px 1px 7px; color: var(--muted); font-size: 10px; }
.stock-product-totals { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 7px; }
.stock-product-totals span { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 6px 9px; color: var(--cyan); font-size: 9px; white-space: nowrap; }
.stock-product-totals b { margin-right: 7px; color: var(--warm-white); font-weight: 550; }
.stock-table-scroll { max-height: 440px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.stock-results-table { width: 100%; min-width: 940px; border-collapse: separate; border-spacing: 0; font-size: 10px; }
.stock-results-table th, .stock-results-table td { border-bottom: 1px solid rgba(255,255,255,0.06); padding: 10px 9px; text-align: left; vertical-align: top; }
.stock-results-table thead th { position: sticky; z-index: 2; top: 0; color: #aeb5b2; background: #15191a; white-space: nowrap; }
.stock-results-table tbody th { max-width: 170px; color: var(--warm-white); font-weight: 600; }
.stock-results-table thead button { border: 0; padding: 0; color: inherit; background: transparent; cursor: pointer; font: inherit; }
.stock-results-table thead button::after { content: " ↕"; color: #66706e; }
.stock-qty { color: var(--cyan); font-size: 13px; font-weight: 700; }
.stock-qty.zero, .stock-card strong.zero { color: #9b9f9d; }
.stock-locations details { min-width: 135px; }
.stock-locations summary { color: var(--cyan); cursor: pointer; white-space: nowrap; }
.stock-locations ul { margin: 8px 0 0; padding-left: 15px; color: #bdc2c0; line-height: 1.7; }
.stock-cards { display: none; }
.stock-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding-top: 14px; }
.stock-pagination span { min-width: 90px; color: var(--muted); text-align: center; font-size: 10px; }
.stock-pagination button:disabled { cursor: not-allowed; opacity: 0.35; transform: none; }

.weight-view {
  min-width: 0;
  min-height: 0;
  margin-top: 18px;
  overflow-y: auto;
}
.weight-view[hidden] { display: none; }
.weight-intro h3 { margin: 5px 0 8px; font-size: 22px; font-weight: 520; }
.weight-intro > p:last-child { max-width: 720px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.weight-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 10px; margin-top: 22px; }
.weight-form label > span { display: block; margin: 0 0 6px 2px; color: var(--muted); font-size: 9px; }
.weight-form input, .weight-form select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; color: var(--warm-white); background: #111516; outline: 0; font: inherit; font-size: 12px; }
.weight-form input:focus, .weight-form select:focus { border-color: rgba(67,180,202,0.6); }
.weight-submit { min-height: 42px; border: 0; cursor: pointer; font: inherit; white-space: nowrap; }
.board-reference-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.board-reference-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: rgba(255,255,255,0.025); }
.board-reference-card strong, .board-reference-card span { display: block; }
.board-reference-card strong { margin-bottom: 8px; font-size: 13px; }
.board-reference-card span { color: var(--muted); font-size: 9px; line-height: 1.7; }
.weight-result { margin-top: 14px; border: 1px solid rgba(67,180,202,0.3); border-radius: 14px; padding: 17px; background: rgba(67,180,202,0.07); }
.weight-result > span { color: var(--muted); font-size: 11px; }
.weight-result-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.weight-result-grid div { min-width: 0; }
.weight-result-grid small, .weight-result-grid strong { display: block; }
.weight-result-grid small { margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.weight-result-grid strong { color: var(--warm-white); font-size: 14px; }
.weight-result-grid .weight-total strong { color: var(--cyan); font-size: 23px; }
.weight-disclaimer { margin: 13px 0 0; color: #aeb5b2; font-size: 9px; line-height: 1.6; }

.usage-guide { margin-bottom: 88px; border-radius: var(--radius); padding: 34px; }
.usage-guide-head { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(180px, .5fr) 1.5fr; gap: 4px 28px; align-items: end; }
.usage-guide-head .eyebrow { grid-column: 1 / -1; }
.usage-guide-head h2 { margin: 0; font-size: 28px; font-weight: 480; }
.usage-guide-head > p:last-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.usage-guide-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 26px; }
.usage-guide-grid article { min-width: 0; border: 1px solid var(--line); border-radius: 14px; padding: 17px; background: rgba(255,255,255,0.025); }
.usage-guide-grid article > span { color: var(--cyan); font-size: 9px; letter-spacing: .14em; }
.usage-guide-grid h3 { margin: 9px 0 7px; font-size: 14px; font-weight: 560; }
.usage-guide-grid p { min-height: 48px; margin: 0 0 12px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.usage-guide-grid code { display: block; margin-top: 6px; overflow-wrap: anywhere; border-radius: 7px; padding: 7px 8px; color: #ccebf1; background: rgba(67,180,202,0.08); font-family: inherit; font-size: 9px; }

.dify-fallback {
  display: flex;
  flex-direction: column;
  min-height: 500px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(3, 5, 6, 0.5);
}

.dify-fallback iframe {
  flex: 1 1 0;
  display: block;
  width: 100%;
  height: auto;
  min-height: 420px;
  border: 0;
  background: transparent;
}

.dify-fallback p {
  display: none;
}

.dify-fallback a { color: var(--cyan); }

.messages {
  overflow-y: auto;
  padding: 26px 6px 26px 0;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
}

.message {
  width: min(88%, 760px);
  margin-bottom: 26px;
}

.message-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.message-content {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.78;
}

.assistant-message .message-content {
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 3px 18px 18px 18px;
  background: rgba(255, 255, 255, 0.045);
}

.user-message {
  margin-left: auto;
  text-align: right;
}

.user-message .message-content {
  display: inline-block;
  padding: 15px 18px;
  border-radius: 18px 3px 18px 18px;
  background: var(--cyan-soft);
  text-align: left;
}

.message.error .message-content {
  border-color: rgba(225, 127, 114, 0.38);
  color: #f0bbb3;
}

.retry-button {
  margin-top: 10px;
  border: 0;
  padding: 2px 0;
  color: var(--cyan);
  background: none;
  cursor: pointer;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.typing::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 14px;
  margin-left: 4px;
  vertical-align: -2px;
  background: var(--cyan);
  animation: blink 900ms steps(1) infinite;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 18px;
}

.suggestions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  color: #c9cbc7;
  background: rgba(255,255,255,0.025);
  cursor: pointer;
  font-size: 11px;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.suggestions button:hover {
  border-color: rgba(67,180,202,0.5);
  color: var(--warm-white);
  background: var(--cyan-soft);
}

.composer {
  position: relative;
  padding: 16px 18px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(5, 7, 8, 0.58);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.composer:focus-within {
  border-color: rgba(67,180,202,0.55);
  box-shadow: 0 0 0 3px rgba(67,180,202,0.07);
}

.composer textarea {
  display: block;
  width: 100%;
  max-height: 140px;
  resize: none;
  border: 0;
  outline: 0;
  color: var(--warm-white);
  background: transparent;
  font-size: 15px;
  line-height: 1.6;
}

.composer textarea::placeholder { color: #747a78; }

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.composer-actions > span {
  margin-right: auto;
  color: #707573;
  font-size: 10px;
}

.send-button,
.stop-button,
.primary-button,
.secondary-button,
.danger-button,
.primary-link {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 17px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.send-button,
.primary-button,
.primary-link {
  color: #071013;
  background: var(--cyan);
}

.send-button:hover,
.primary-button:hover,
.primary-link:hover { transform: translateY(-1px); background: #59bfd3; }

.stop-button,
.secondary-button {
  border-color: var(--line-strong);
  color: var(--warm-white);
  background: rgba(255,255,255,0.04);
}

.danger-button {
  width: 100%;
  margin-top: 18px;
  border-color: rgba(225, 127, 114, 0.4);
  color: #f0bbb3;
  background: rgba(225, 127, 114, 0.08);
}

button:disabled { cursor: not-allowed; opacity: 0.42; transform: none !important; }

.side-rail {
  display: grid;
  gap: 24px;
}

.material-feature,
.rail-section,
.inventory-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--charcoal);
}

.material-feature {
  position: relative;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1.58 / 1;
  background: #111416;
}

.material-slides,
.material-slides::after {
  position: absolute;
  inset: 0;
}

.material-slides::after {
  content: "";
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8,10,11,0.08) 12%, rgba(8,10,11,0.22) 48%, rgba(8,10,11,0.88) 100%);
}

.material-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  filter: saturate(0.86) contrast(1.04);
  transition: opacity 800ms ease;
}

.material-slide.active {
  z-index: 1;
  opacity: 1;
}

.material-feature::after {
  content: "";
  position: absolute;
  inset: -50% -30%;
  background: linear-gradient(110deg, transparent 42%, rgba(255,255,255,0.14) 50%, transparent 58%);
  transform: translateX(-40%);
  animation: refract 9s ease-in-out infinite;
}

.material-copy {
  position: absolute;
  z-index: 3;
  left: 24px;
  right: 24px;
  bottom: 24px;
}

.material-copy h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 450;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.rail-section { padding: 24px; }
.rail-heading { margin-bottom: 18px; }

.resource-list {
  display: grid;
  gap: 12px;
}

.resource-card {
  display: grid;
  grid-template-columns: minmax(96px, 36%) minmax(0, 1fr);
  height: 116px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit;
  background: rgba(255,255,255,0.018);
  text-decoration: none;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.resource-card:hover {
  transform: translateY(-2px);
  border-color: rgba(241,238,232,0.24);
  background: rgba(255,255,255,0.028);
}

.resource-thumbnail {
  display: block;
  min-width: 0;
  overflow: hidden;
  background: #e8e8e5;
}

.resource-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  transition: transform 220ms ease;
}

.resource-thumbnail img.contain {
  padding: 4px;
  object-fit: contain;
}

.resource-card:hover .resource-thumbnail img { transform: scale(1.02); }

.resource-card-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 15px 14px;
}

.resource-card-copy strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 560;
  line-height: 1.35;
}

.resource-description {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.resource-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  color: var(--cyan);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.resource-download b {
  font-size: 13px;
  font-weight: 400;
  transition: transform 220ms ease;
}

.resource-card:hover .resource-download b { transform: translate(2px, -2px); }

.empty-note { margin: 0; padding: 16px 0 2px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.inventory-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  min-height: 274px;
  background:
    radial-gradient(circle at 14% 2%, rgba(67,180,202,0.065), transparent 42%),
    #121617;
}

.inventory-body {
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 25px 22px 23px 24px;
}

.inventory-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inventory-heading .eyebrow { margin: 0; }

.inventory-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a9b0ad;
  font-size: 9px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.inventory-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7bc6b2;
  box-shadow: 0 0 0 4px rgba(123,198,178,0.08);
}

.inventory-card h2 {
  margin-top: 16px;
  font-size: 23px;
  font-weight: 520;
}

.inventory-description {
  max-width: 260px;
  margin: 9px 0 16px;
  color: #8f9693;
  font-size: 11px;
  line-height: 1.7;
}

.inventory-meta {
  display: grid;
  gap: 8px;
  margin: 0 0 19px;
}

.inventory-meta-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}

.inventory-meta-item small {
  color: #666e6b;
  font-size: 9px;
  letter-spacing: 0.04em;
}

.inventory-meta-item strong {
  overflow: hidden;
  color: #c9cecb;
  font-size: 10px;
  font-weight: 450;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-meta-item.file strong { color: var(--warm-white); }

.inventory-image {
  position: relative;
  min-width: 0;
  border-left: 1px solid rgba(255,255,255,0.07);
  background-image:
    linear-gradient(180deg, rgba(10,12,13,0.05), rgba(10,12,13,0.46)),
    url('/assets/huansha.webp');
  background-position: 58% center;
  background-size: cover;
  filter: saturate(0.56) contrast(1.06);
}

.inventory-image::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(18,22,23,0.38), transparent 52%);
  content: "";
}

.inventory-image span {
  position: absolute;
  z-index: 1;
  right: 13px;
  bottom: 16px;
  color: rgba(241,238,232,0.56);
  font-size: 9px;
  letter-spacing: 0.18em;
  writing-mode: vertical-rl;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.inventory-card .primary-link,
.inventory-card .secondary-button {
  min-height: 36px;
  padding: 9px 13px;
  font-size: 10px;
}

.inventory-card .primary-link {
  gap: 18px;
  justify-content: space-between;
}

.inventory-card .primary-link b {
  font-size: 13px;
  font-weight: 400;
}

.site-footer {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  align-items: center;
  gap: 30px;
  padding: 38px 0 52px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-brand img {
  display: block;
  width: 130px;
  max-height: 48px;
  object-fit: contain;
  object-position: left center;
  opacity: 0.72;
  filter: grayscale(0.2) saturate(0.7);
}

.site-footer p { margin: 0 0 5px; color: var(--warm-white); font-size: 11px; letter-spacing: 0.15em; }
.site-footer span, .footer-note { font-size: 10px !important; letter-spacing: 0 !important; }
.footer-note { justify-self: end; color: var(--muted) !important; }

.admin-dialog {
  width: min(720px, calc(100% - 28px));
  max-height: min(860px, calc(100vh - 30px));
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 0;
  color: var(--warm-white);
  background: rgba(17,20,21,0.97);
  box-shadow: 0 35px 120px rgba(0,0,0,0.7);
}

.admin-dialog::backdrop { background: rgba(0,0,0,0.74); backdrop-filter: blur(12px); }
.dialog-shell { padding: clamp(24px, 5vw, 42px); }
.dialog-head { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.dialog-description { margin: 26px 0; color: var(--muted); font-size: 13px; line-height: 1.75; }

.stack-form { display: grid; gap: 12px; }
.stack-form label { color: var(--muted); font-size: 12px; }
.stack-form input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: 0;
  padding: 13px 14px;
  color: var(--warm-white);
  background: rgba(0,0,0,0.25);
}
.stack-form input:focus { border-color: rgba(67,180,202,0.55); }
.stack-form .primary-button { justify-self: start; margin-top: 6px; }
.form-status { min-height: 20px; margin: 0; color: var(--error); font-size: 12px; }

.step-line {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 26px 0;
  color: #6f7472;
  font-size: 10px;
  letter-spacing: 0.06em;
}
.step-line span { padding-top: 10px; border-top: 1px solid var(--line); }
.step-line span.active { border-color: var(--cyan); color: var(--warm-white); }

.upload-form { display: grid; gap: 14px; }
.drop-zone {
  display: grid;
  gap: 8px;
  min-height: 132px;
  place-content: center;
  padding: 22px;
  border: 1px dashed rgba(67,180,202,0.46);
  border-radius: 16px;
  background: rgba(67,180,202,0.045);
  text-align: center;
  cursor: pointer;
}
.drop-zone span { font-size: 14px; }
.drop-zone small { color: var(--muted); font-size: 11px; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.selected-file { color: var(--muted); font-size: 12px; }
.upload-form .primary-button { justify-self: start; }

.preview-result { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.preview-status { margin-bottom: 18px; font-size: 14px; }
.preview-status.good { color: var(--success); }
.preview-status.bad { color: var(--error); }
.preview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.preview-metric { padding: 15px; background: #141718; }
.preview-metric small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.preview-metric strong { font-size: 13px; font-weight: 520; word-break: break-word; }
.message-list { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,0.025); }
.message-list h3 { margin: 0 0 8px; font-size: 11px; font-weight: 600; }
.message-list ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.message-list.error-list { border: 1px solid rgba(225,127,114,0.25); }
.confirm-check { display: flex; gap: 10px; margin-top: 20px; color: #c9cbc7; font-size: 12px; line-height: 1.65; }
.confirm-check input { margin-top: 3px; accent-color: var(--cyan); }
.dialog-foot { display: flex; justify-content: flex-end; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100% - 48px));
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 13px 16px;
  color: var(--warm-white);
  background: rgba(25,29,30,0.96);
  box-shadow: var(--shadow);
  font-size: 12px;
}

@keyframes material-drift { to { transform: translate3d(3vw, 2vw, 0) rotate(4deg); } }
@keyframes refract { 0%, 30% { transform: translateX(-45%); } 65%, 100% { transform: translateX(45%); } }
@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr); }
  .chat-panel { height: auto; min-height: 700px; max-height: none; }
  .intro { gap: 5vw; }
}

@media (max-width: 820px) {
  .site-header, main, .site-footer { width: min(100% - 32px, 720px); }
  .header-meta > .eyebrow { display: none; }
  .intro { grid-template-columns: 1fr; gap: 28px; padding: 52px 0 34px; }
  .intro-copy { max-width: 540px; }
  .workspace { grid-template-columns: 1fr; }
  .chat-panel { min-height: min(760px, calc(100vh - 36px)); order: 0; }
  .side-rail { order: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .material-feature { min-height: 300px; }
  .rail-section { min-height: 300px; }
  .inventory-card { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) 180px; min-height: 224px; }
  .inventory-body { padding: 27px 28px 25px; }
  .inventory-description { max-width: 430px; }
  .inventory-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .inventory-meta-item { display: block; }
  .inventory-meta-item small { display: block; margin-bottom: 4px; }
  .inventory-meta-item strong { display: block; }
  .site-footer { grid-template-columns: 130px 1fr; }
  .stock-filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .weight-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weight-submit { width: 100%; }
  .board-reference-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .usage-guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-search-field { grid-column: span 2; }
  .footer-note { display: none; }
}

@media (max-width: 560px) {
  .site-header, main, .site-footer { width: calc(100% - 24px); }
  .site-header { min-height: 64px; }
  .wordmark { font-size: 11px; letter-spacing: 0.18em; }
  .status-pill { font-size: 10px; }
  .header-meta { gap: 0; }
  .intro { gap: 12px; padding: 24px 0 20px; }
  .intro .eyebrow { margin-bottom: 7px; }
  .intro h1 { font-size: clamp(34px, 10.8vw, 46px); line-height: 1.02; }
  .intro h1 br { display: none; }
  .intro h1 em { display: block; margin-top: 2px; }
  .intro-copy { margin: 0; font-size: 12px; line-height: 1.65; }
  .workspace { gap: 14px; padding-bottom: 42px; }
  .chat-panel {
    min-height: 0;
    height: auto;
    padding: 17px 12px 12px;
    border-radius: 16px;
    scroll-margin-top: 10px;
  }
  .panel-head { gap: 12px; padding-inline: 2px; }
  .panel-head h2 { font-size: 19px; }
  .data-note { align-items: flex-start; margin-top: 12px; padding: 0 2px 12px; font-size: 10px; line-height: 1.5; }
  .data-dot { flex: 0 0 auto; margin-top: 4px; }
  .view-switch { width: 100%; margin-top: 12px; }
  .view-switch button { flex: 1; }
  .weight-form { grid-template-columns: 1fr; }
  .weight-submit { width: 100%; }
  .board-reference-grid, .weight-result-grid, .usage-guide-grid { grid-template-columns: 1fr; }
  .usage-guide { margin-bottom: 42px; padding: 20px 14px; border-radius: 16px; }
  .usage-guide-head { grid-template-columns: 1fr; }
  .usage-guide-head h2 { font-size: 22px; }
  .usage-guide-grid p { min-height: 0; }
  .stock-table-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stock-search-field { grid-column: 1 / -1; }
  .stock-filter-form .zero-stock-toggle, .stock-reset { min-height: 42px; }
  .stock-table-scroll { display: none; }
  .stock-cards { display: grid; gap: 9px; }
  .stock-card { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 13px; background: rgba(255,255,255,0.025); }
  .stock-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .stock-card h3 { margin: 0 0 4px; overflow-wrap: anywhere; font-size: 13px; }
  .stock-card-head span { color: var(--muted); font-size: 9px; }
  .stock-card-head strong { flex: 0 0 auto; color: var(--cyan); font-size: 15px; }
  .stock-card dl { display: grid; grid-template-columns: 1.25fr .75fr; gap: 8px; margin: 11px 0; }
  .stock-card dl div { min-width: 0; }
  .stock-card dt { margin-bottom: 3px; color: var(--muted); font-size: 8px; }
  .stock-card dd { margin: 0; overflow-wrap: anywhere; font-size: 10px; }
  .dify-fallback {
    min-height: min(650px, calc(100svh - 150px));
    margin-top: 12px;
    border-radius: 12px;
  }
  .dify-fallback iframe { min-height: max(500px, 72svh); }
  .messages { padding-top: 20px; }
  .message { width: 94%; }
  .message-content { font-size: 14px; }
  .suggestions { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 14px; }
  .suggestions button { flex: 0 0 auto; }
  .composer-actions > span { display: none; }
  .side-rail { grid-template-columns: 1fr; gap: 14px; }
  .material-feature {
    display: block;
    order: 1;
    min-height: 0;
    aspect-ratio: 1.68 / 1;
    border-radius: 18px;
  }
  .material-copy { left: 20px; right: 20px; bottom: 20px; }
  .material-copy h2 { font-size: 23px; }
  .material-feature::after { opacity: 0.62; }
  .rail-section { order: 2; min-height: 0; padding: 20px; }
  .rail-heading { margin-bottom: 8px; }
  .resource-card { grid-template-columns: 112px minmax(0, 1fr); height: 114px; }
  .resource-card-copy { padding: 13px 14px; }
  .inventory-card { grid-column: auto; order: 0; grid-template-columns: minmax(0, 1fr) 76px; min-height: 248px; }
  .inventory-body { padding: 20px 16px 18px 20px; }
  .inventory-heading { justify-content: flex-start; }
  .inventory-live { display: none; }
  .inventory-card h2 { margin-top: 13px; font-size: 21px; }
  .inventory-description { margin: 7px 0 14px; font-size: 10px; }
  .inventory-meta { display: grid; grid-template-columns: 1fr; gap: 5px; margin-bottom: 15px; }
  .inventory-meta-item { display: grid; grid-template-columns: 45px minmax(0, 1fr); }
  .inventory-image { min-height: 0; }
  .inventory-image span { right: 9px; bottom: 13px; }
  .card-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .card-actions > * { justify-content: center; text-align: center; }
  .inventory-card .primary-link { gap: 8px; justify-content: center; }
  .site-footer { grid-template-columns: 1fr; gap: 18px; }
  .footer-brand img { width: 120px; }
  .admin-dialog {
    inset: 0;
    width: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    background:
      radial-gradient(circle at 88% 0%, rgba(67,180,202,0.09), transparent 34%),
      #101314;
  }
  .dialog-shell {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    padding: 0;
  }
  .dialog-head {
    position: sticky;
    z-index: 4;
    top: 0;
    align-items: center;
    padding: 17px 18px 15px;
    border-bottom-color: rgba(255,255,255,0.07);
    background: rgba(16,19,20,0.94);
    backdrop-filter: blur(16px);
  }
  .dialog-head .eyebrow { margin-bottom: 5px; }
  .dialog-head h2 { font-size: 22px; }
  .close-button {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    padding: 0;
    font-size: 0;
    text-decoration: none;
  }
  .close-button::before {
    content: "×";
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
  }
  #login-view {
    display: grid;
    min-height: calc(100dvh - 78px);
    align-content: center;
    padding: 32px 20px 12vh;
  }
  .dialog-description {
    max-width: 340px;
    margin: 0 0 24px;
    font-size: 12px;
    line-height: 1.8;
  }
  .stack-form { gap: 10px; }
  .stack-form input {
    min-height: 52px;
    border-radius: 14px;
    padding: 15px 16px;
    font-size: 16px;
  }
  .stack-form .primary-button,
  .upload-form .primary-button {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    margin-top: 6px;
  }
  .form-status { min-height: 18px; }
  #upload-view {
    display: flex;
    min-height: calc(100dvh - 78px);
    flex: 1;
    flex-direction: column;
    padding: 0 18px;
  }
  .step-line {
    gap: 6px;
    margin: 22px 0 20px;
    font-size: 9px;
  }
  .step-line span {
    padding-top: 9px;
    white-space: nowrap;
  }
  .drop-zone {
    min-height: 152px;
    padding: 22px 16px;
    border-radius: 18px;
    background:
      radial-gradient(circle at 50% 0%, rgba(67,180,202,0.08), transparent 70%),
      rgba(255,255,255,0.018);
  }
  .drop-zone span { font-size: 15px; }
  .drop-zone small { max-width: 250px; margin-inline: auto; line-height: 1.65; }
  .selected-file {
    min-height: 38px;
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.025);
    font-size: 11px;
  }
  .preview-result { margin-top: 22px; padding-top: 20px; }
  .preview-status { margin-bottom: 14px; font-size: 13px; line-height: 1.6; }
  .preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-metric { min-width: 0; padding: 12px; }
  .preview-metric strong { font-size: 11px; line-height: 1.45; }
  .message-list { margin-top: 12px; padding: 13px 14px; }
  .confirm-check {
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    background: rgba(255,255,255,0.02);
    font-size: 11px;
  }
  .danger-button {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    margin-top: 12px;
  }
  .dialog-foot {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    margin-inline: -18px;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    background: rgba(16,19,20,0.96);
    backdrop-filter: blur(16px);
  }
  .dialog-foot .text-button {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    text-decoration: none;
  }
  .toast { right: 16px; bottom: 16px; max-width: calc(100% - 32px); }
}

@media (max-width: 420px) {
  .intro h1 > span,
  .intro h1 em { white-space: normal; }
  .intro-copy span { display: inline; }
  .resource-card { grid-template-columns: 96px minmax(0, 1fr); }
  .resource-card-copy { padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
