:root {
  --bg: #f3f6fa;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #d8e0ea;
  --line-strong: #bfccd9;
  --text: #1f2937;
  --muted: #64748b;
  --blue: #1f6feb;
  --blue-dark: #1557b6;
  --green: #138a54;
  --orange: #e56b1f;
  --red: #c43d3d;
  --nav: #1d2633;
  --nav-soft: #2b3646;
  --shadow: 0 16px 40px rgba(20, 32, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.is-hidden {
  display: none !important;
}

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

button {
  cursor: pointer;
}

.login-view {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 40px;
  background:
    linear-gradient(120deg, rgba(31, 111, 235, 0.12), rgba(19, 138, 84, 0.1)),
    #eef3f8;
}

.login-card {
  width: 460px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.login-brand strong,
.login-brand small {
  display: block;
}

.login-brand small {
  margin-top: 4px;
  color: var(--muted);
}

.login-copy {
  margin: 22px 0 18px;
}

.login-copy h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.login-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-demo {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  color: #405166;
  background: #f3f7fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}

.login-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.login-submit {
  width: 100%;
  min-height: 40px;
}

.app-shell {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  color: #e5eef8;
  background: var(--nav);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 8px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  font-weight: 800;
  background: var(--blue);
  border-radius: 8px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  line-height: 1.35;
}

.brand small {
  margin-top: 3px;
  color: #9fb0c4;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 5px;
  margin-top: 18px;
}

.nav-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 10px 9px;
  color: #d7e2ef;
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.is-active {
  background: #ffffff;
  color: var(--text);
  border-color: #ffffff;
}

.nav-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #dbeafe;
  background: var(--nav-soft);
  border-radius: 8px;
}

.nav-item.is-active .nav-mark {
  color: #fff;
  background: var(--blue);
}

.nav-item strong,
.nav-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item strong {
  font-size: 14px;
}

.nav-item small {
  margin-top: 3px;
  color: #9fb0c4;
  font-size: 12px;
}

.nav-item.is-active small {
  color: var(--muted);
}

.main {
  min-width: 0;
  padding: 18px 22px 32px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 68px;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.account {
  min-width: 110px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.account strong,
.account small {
  display: block;
}

.account small {
  color: var(--muted);
  font-size: 12px;
}

.endpoint-strip {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 4px 0 14px;
  padding: 8px 10px;
  background: #eaf1f8;
  border: 1px solid #d4dfeb;
  border-radius: 8px;
}

.endpoint-title {
  color: var(--muted);
  font-size: 12px;
  line-height: 24px;
}

.endpoint-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 58px;
  overflow: hidden;
}

.endpoint-list span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  color: #405166;
  background: #fff;
  border: 1px solid #dce5ef;
  border-radius: 6px;
  font-size: 11px;
}

.endpoint-list b {
  color: var(--blue-dark);
  font-weight: 700;
}

.workspace {
  display: grid;
  gap: 14px;
}

.auth-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #405166;
  background: #fff7e8;
  border: 1px solid #f1d6a8;
  border-radius: 8px;
}

.auth-banner strong {
  color: #9a4d00;
}

.auth-banner span {
  font-size: 13px;
}

.static-fallback {
  border-color: #cfe0f5;
}

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

.metric-grid.compact .metric-card {
  min-height: 100px;
}

.metric-card {
  min-height: 112px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin: 12px 0 8px;
  color: var(--text);
  font-size: 25px;
  line-height: 1.1;
}

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

.insight-window {
  min-height: 220px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.window-head h2 {
  margin: 0;
  font-size: 16px;
}

.window-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.window-body {
  display: grid;
  gap: 10px;
  margin-top: 13px;
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 7px 8px;
  align-items: center;
}

.progress-row strong,
.progress-row small {
  display: block;
}

.progress-row strong {
  font-size: 13px;
}

.progress-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.progress-row > span {
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.progress-bar {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  background: #edf2f7;
  border-radius: 6px;
}

.progress-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: 6px;
}

.risk-box {
  display: grid;
  gap: 6px;
  padding: 13px;
  background: #fff8ef;
  border: 1px solid #f4d7b7;
  border-radius: 8px;
}

.risk-box strong {
  color: var(--orange);
  font-size: 28px;
}

.risk-box span,
.risk-box small {
  color: var(--muted);
}

.risk-box b {
  color: var(--text);
  font-size: 18px;
}

.two-column,
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 14px;
}

.two-column.equal {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.split-layout {
  grid-template-columns: minmax(0, 1fr) 380px;
}

.panel,
.toolbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  min-width: 0;
  padding: 15px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
}

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

.panel-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.filter-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  width: 100%;
}

.filter-grid.four {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.filter-grid.inline {
  margin-top: 8px;
}

.form-grid .wide {
  grid-column: span 2;
}

label,
.field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}

.toolbar-actions,
.button-row,
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-actions {
  align-self: end;
  flex-wrap: nowrap;
}

.btn,
.text-btn,
.icon-btn {
  border: 1px solid transparent;
  border-radius: 6px;
}

.btn {
  min-height: 34px;
  padding: 7px 12px;
  color: var(--text);
  background: #fff;
  border-color: var(--line-strong);
}

.btn:hover {
  border-color: var(--blue);
}

.btn.primary {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.btn.primary:hover {
  background: var(--blue-dark);
}

.btn.ghost {
  color: var(--blue-dark);
  background: #eef5ff;
  border-color: #cfe0f5;
}

.text-btn {
  padding: 0;
  color: var(--blue-dark);
  background: transparent;
  border: 0;
  font-size: 13px;
}

.icon-btn {
  width: 32px;
  height: 32px;
  background: #f1f5f9;
  border-color: var(--line);
  font-size: 20px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

th,
td {
  padding: 10px 11px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

th {
  color: #405166;
  font-weight: 700;
  background: #f6f8fb;
  white-space: nowrap;
}

td {
  color: #2d3748;
}

tbody tr:hover {
  background: #f9fbfd;
}

.editable-table table {
  min-width: 1120px;
}

.salesperson-inns-cell {
  width: 180px;
  min-width: 160px;
}

.salesperson-inns-scroll {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 58px;
  max-height: 58px;
  padding: 5px 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #2d3748;
  background: #f8fafc;
  border: 1px solid #dce5ef;
  border-radius: 6px;
  scrollbar-width: thin;
}

.salesperson-inns-scroll.is-empty {
  justify-content: center;
}

.salesperson-inn-tag {
  display: block;
  padding: 3px 6px;
  line-height: 1.25;
  word-break: break-word;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
}

.salesperson-inns-empty {
  color: var(--muted);
  font-size: 12px;
}

.editable-table input,
.editable-table select,
.editable-table textarea {
  min-height: 30px;
  padding: 5px 7px;
  font-size: 13px;
}

.editable-table textarea {
  min-width: 220px;
}

.draft-row {
  background: #fbfdff;
}

.add-row-btn {
  width: 100%;
}

.edit-actions {
  min-width: 84px;
}

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

td strong,
td small {
  display: block;
}

td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

code {
  padding: 3px 6px;
  color: #103a74;
  background: #edf5ff;
  border-radius: 5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.success {
  color: #0f6b43;
  background: #e8f6ef;
}

.badge.warning {
  color: #9a4d00;
  background: #fff2df;
}

.badge.danger {
  color: #9f2f2f;
  background: #fdeaea;
}

.badge.neutral {
  color: #536275;
  background: #eef2f6;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  height: 260px;
  padding: 8px 4px 0;
}

.bar-item {
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: end;
  justify-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.bar-track {
  position: relative;
  width: 52px;
  height: 178px;
  overflow: hidden;
  background: #edf2f7;
  border-radius: 6px;
}

.bar-track span {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(180deg, #2d8cff 0%, #1d7f57 100%);
  border-radius: 6px 6px 0 0;
}

.bar-item strong {
  color: var(--text);
}

.todo-list,
.selection-list,
.setting-list,
.ticket-list,
.stack-form,
.detail-list {
  display: grid;
  gap: 10px;
}

.relation-board {
  display: grid;
  gap: 10px;
}

.relation-chain {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 22px minmax(150px, 0.9fr) 22px minmax(170px, 1fr) 22px minmax(150px, 0.85fr);
  gap: 8px;
  align-items: stretch;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.relation-chain.management {
  grid-template-columns: minmax(220px, 1fr) 22px minmax(180px, 0.8fr);
  border-color: #cfe0f5;
  background: #f4f8ff;
}

.chain-step {
  min-width: 0;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.chain-step span,
.chain-step strong,
.chain-step small {
  display: block;
}

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

.chain-step strong {
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chain-step small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chain-link {
  align-self: center;
  justify-self: center;
  color: var(--blue-dark);
  font-weight: 800;
}

.rank-list,
.binding-grid,
.chain-card-grid,
.ownership-card-grid,
.health-grid,
.direct-list {
  display: grid;
  gap: 10px;
}

.rank-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rank-row > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  font-weight: 800;
  background: var(--blue);
  border-radius: 8px;
}

.rank-row strong,
.rank-row small {
  display: block;
}

.rank-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.rank-row b {
  color: var(--orange);
}

.binding-grid,
.health-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.binding-card,
.health-card,
.chain-card,
.ownership-card,
.direct-row {
  padding: 11px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.binding-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
}

.binding-card.direct {
  background: #f4f8ff;
  border-color: #cfe0f5;
}

.binding-card strong,
.binding-card small,
.binding-card span {
  display: block;
}

.binding-card small,
.binding-card span {
  color: var(--muted);
  font-size: 12px;
}

.binding-card b {
  color: var(--orange);
}

.health-card {
  display: grid;
  gap: 5px;
}

.health-card span,
.health-card small {
  color: var(--muted);
  font-size: 12px;
}

.health-card strong {
  font-size: 22px;
}

.health-card.warning {
  background: #fff8ef;
  border-color: #f4d7b7;
}

.chain-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chain-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.chain-card strong,
.chain-card small {
  display: block;
}

.chain-card small {
  margin-top: 3px;
  color: var(--muted);
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0;
}

.mini-metrics span {
  padding: 8px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}

.mini-metrics b {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.inn-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inn-chip-row span {
  padding: 4px 7px;
  color: #405166;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}

.ownership-card-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.ownership-card {
  display: grid;
  gap: 9px;
}

.ownership-card strong,
.ownership-card small {
  display: block;
}

.ownership-card small {
  margin-top: 3px;
  color: var(--muted);
}

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

.ownership-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.ownership-card dt {
  color: var(--muted);
}

.ownership-card dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.direct-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
}

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

.empty-state {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: var(--panel-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}

.todo-row,
.check-row {
  display: grid;
  align-items: center;
  width: 100%;
  padding: 11px;
  text-align: left;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.todo-row {
  grid-template-columns: 1fr 48px;
}

.todo-row strong {
  color: var(--orange);
  font-size: 22px;
  text-align: right;
}

.check-row {
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 10px;
}

.check-row input {
  width: 16px;
  min-height: 16px;
}

.check-row strong,
.check-row small {
  display: block;
}

.check-row small {
  margin-top: 3px;
  color: var(--muted);
}

.action-panel {
  align-self: start;
}

.note-box {
  padding: 11px;
  color: #405166;
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
}

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

.impact-grid div,
.target-preview {
  padding: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.impact-grid span,
.target-preview span,
.target-preview small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.impact-grid strong,
.target-preview strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.target-preview {
  display: grid;
  gap: 3px;
}

.form-panel {
  align-self: start;
}

.ticket-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  padding: 13px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ticket-card strong,
.ticket-card small {
  display: block;
}

.ticket-card small {
  margin-top: 5px;
  color: var(--muted);
}

.ticket-price {
  color: var(--orange);
  font-size: 24px;
  font-weight: 800;
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-row span {
  padding: 3px 6px;
  color: var(--blue-dark);
  background: #eaf3ff;
  border-radius: 5px;
  font-size: 12px;
}

.ticket-meta {
  justify-self: end;
  color: var(--muted);
  font-size: 12px;
}

.setting-list label {
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
}

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.32);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 21;
  width: min(560px, 46vw);
  height: 100vh;
  background: #fff;
  box-shadow: var(--shadow);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
  margin: 0;
  font-size: 18px;
}

.drawer-body {
  display: grid;
  gap: 14px;
  height: calc(100vh - 62px);
  padding: 16px 18px 28px;
  overflow: auto;
}

.drawer-section h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.drawer-section p {
  margin: 0 0 12px;
  color: var(--muted);
}

.drawer-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.drawer-stats .metric-card {
  min-height: 94px;
  padding: 12px;
}

.drawer-stats .metric-card strong {
  font-size: 18px;
}

.qrcode-panel {
  display: grid;
  gap: 14px;
}

.qrcode-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.qrcode-entry-grid {
  display: grid;
  gap: 12px;
}

.qrcode-entry-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qrcode-entry-head h3 {
  margin: 0;
  font-size: 15px;
}

.qrcode-entry-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.qrcode-preview {
  display: grid;
  place-items: center;
  min-height: 232px;
  padding: 18px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qrcode-preview img {
  width: min(220px, 62vw);
  height: min(220px, 62vw);
  object-fit: contain;
  image-rendering: crisp-edges;
  background: #fff;
  border: 1px solid #dce5ef;
  border-radius: 8px;
}

.qrcode-empty {
  display: grid;
  place-items: center;
  width: min(220px, 62vw);
  min-height: 220px;
  padding: 16px;
  color: var(--muted);
  text-align: center;
  background: #fff;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}

.qrcode-meta dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.qrcode-meta a,
.qr-text {
  line-height: 1.55;
}

.detail-list {
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  max-width: 360px;
  padding: 10px 14px;
  color: #fff;
  background: #202a37;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1280px) {
  body {
    min-width: 1100px;
  }

  .app-shell {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .main {
    padding-right: 16px;
    padding-left: 16px;
  }

  .metric-card strong {
    font-size: 22px;
  }

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

  .chain-card-grid,
  .ownership-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .relation-chain {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .relation-chain .chain-link {
    display: none;
  }

  .filter-grid.four {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
  }
}
