:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #111318;
  background: #f4f6f8;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #f4f6f8;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: #eef1f4;
}

.login-panel {
  width: min(100%, 420px);
  padding: 38px;
  text-align: center;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(18, 24, 33, 0.08);
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  border-radius: 8px;
  background: #111318;
}

.brand-mark-small {
  width: 40px;
  height: 40px;
  margin: 0;
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #7d8794;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.login-panel h1 {
  margin-bottom: 10px;
  font-size: 28px;
  line-height: 1.3;
}

.login-copy {
  margin-bottom: 30px;
  color: #697482;
  font-size: 14px;
}

.login-form {
  display: grid;
  gap: 10px;
  text-align: left;
}

.login-form label {
  color: #3b424c;
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  color: #111318;
  outline: none;
  border: 1px solid #ccd2da;
  border-radius: 6px;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.login-form input:focus {
  border-color: #111318;
  box-shadow: 0 0 0 3px rgba(17, 19, 24, 0.09);
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: #b42318;
  font-size: 12px;
  text-align: center;
}

.security-note {
  margin: 18px 0 0;
  color: #8b94a0;
  font-size: 12px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px max(24px, calc((100vw - 1380px) / 2));
  border-bottom: 1px solid #e0e4e9;
  background: #fff;
}

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

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

.brand strong {
  font-size: 16px;
}

.brand span {
  margin-top: 2px;
  color: #7c8794;
  font-size: 11px;
}

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

.connection-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 8px;
  color: #5d6774;
  font-size: 12px;
}

.connection-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16803c;
}

.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  color: #fff;
  border-color: #111318;
  background: #111318;
}

.button-primary:hover:not(:disabled) {
  background: #292d35;
}

.button-secondary {
  color: #252a32;
  border-color: #d5dae1;
  background: #fff;
}

.button-secondary:hover:not(:disabled) {
  border-color: #9ea6b1;
  background: #f8f9fa;
}

.button-ghost {
  color: #656f7b;
  background: transparent;
}

.button-danger {
  color: #a51d16;
  border-color: #f1c5c1;
  background: #fff7f6;
}

.button-wide {
  width: 100%;
  margin-top: 2px;
}

.workspace {
  width: min(1380px, calc(100% - 48px));
  margin: 0 auto;
  padding: 38px 0 56px;
}

.view-tabs {
  width: fit-content;
  display: flex;
  gap: 4px;
  margin-bottom: 26px;
  padding: 4px;
  border: 1px solid #dfe3e8;
  border-radius: 7px;
  background: #fff;
}

.view-tabs button {
  min-width: 108px;
  height: 36px;
  padding: 0 16px;
  color: #697380;
  border: 0;
  border-radius: 5px;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}

.view-tabs button.is-active {
  color: #fff;
  background: #111318;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.page-heading h1 {
  margin-bottom: 8px;
  font-size: 30px;
  line-height: 1.2;
}

.page-heading > div > p:last-child {
  margin-bottom: 0;
  color: #66717f;
  font-size: 14px;
}

.page-date {
  min-width: 160px;
  text-align: right;
}

.page-date span,
.page-date strong {
  display: block;
}

.page-date span {
  color: #8a94a0;
  font-size: 11px;
}

.page-date strong {
  margin-top: 4px;
  font-size: 14px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card {
  min-width: 0;
  padding: 18px;
  text-align: left;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  background: #fff;
  transition: border-color 150ms ease, transform 150ms ease;
}

.summary-card:hover {
  transform: translateY(-1px);
  border-color: #aeb6c0;
}

.summary-card.is-active {
  color: #fff;
  border-color: #111318;
  background: #111318;
}

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

.summary-card span {
  font-size: 13px;
  font-weight: 700;
}

.summary-card strong {
  margin: 16px 0 7px;
  font-size: 30px;
  line-height: 1;
}

.summary-card small {
  color: #89939f;
  font-size: 11px;
}

.summary-card.is-active small {
  color: #b9c0c9;
}

.summary-card-alert:not(.is-active) strong {
  color: #b42318;
}

.review-panel {
  overflow: hidden;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  background: #fff;
}

.sample-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.setting-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  background: #fff;
}

.setting-card .button {
  justify-self: end;
}

.setting-status span,
.setting-status strong,
.setting-status small {
  display: block;
}

.setting-status span {
  color: #7c8794;
  font-size: 11px;
  font-weight: 700;
}

.setting-status strong {
  margin-top: 6px;
  font-size: 17px;
}

.setting-status small {
  margin-top: 5px;
  color: #7b8592;
  font-size: 11px;
  line-height: 1.5;
}

.setting-status strong.is-online {
  color: #176b37;
}

.setting-status strong.is-warning {
  color: #a52720;
}

.sample-toolbar {
  align-items: center;
}

.sample-filter {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sample-filter input {
  width: 170px;
  height: 38px;
  padding: 0 11px;
  color: #111318;
  outline: none;
  border: 1px solid #d5dae1;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}

.sample-filter input:focus {
  border-color: #111318;
  box-shadow: 0 0 0 3px rgba(17, 19, 24, 0.08);
}

.sample-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid #e7eaee;
  background: #fbfcfd;
}

.sample-type-tabs button {
  min-height: 34px;
  padding: 0 14px;
  color: #5f6975;
  border: 1px solid #dce2e8;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.sample-type-tabs button.is-active {
  color: #fff;
  border-color: #111318;
  background: #111318;
}

.sample-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.sample-section {
  overflow: hidden;
  border: 1px solid #e1e5ea;
  border-radius: 8px;
  background: #fff;
}

.sample-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #e7eaee;
  background: #fbfcfd;
}

.sample-section-copy h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.sample-section-copy p {
  margin-bottom: 0;
  color: #7b8592;
  font-size: 12px;
  line-height: 1.55;
}

.sample-section-count {
  flex: none;
  color: #66717f;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.sample-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.sample-section-empty {
  grid-column: 1 / -1;
  padding: 28px 20px;
  color: #7b8592;
  font-size: 12px;
  text-align: center;
  border: 1px dashed #dbe1e8;
  border-radius: 8px;
  background: #fafbfc;
}

.sample-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e1e5ea;
  border-radius: 8px;
  background: #fff;
}

.sample-card-ai {
  display: flex;
  flex-direction: column;
}

.sample-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: contain;
  border-bottom: 1px solid #e3e7ec;
  background: #eef1f4;
}

.sample-content {
  padding: 14px;
}

.sample-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sample-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.sample-topline strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-security {
  flex: none;
  padding: 3px 6px;
  color: #176b37;
  border: 1px solid #b8ddc5;
  border-radius: 5px;
  background: #f1fbf4;
  font-size: 10px;
  font-weight: 800;
}

.sample-preset {
  flex: none;
  padding: 3px 6px;
  color: #92400e;
  border: 1px solid #f6d7a9;
  border-radius: 5px;
  background: #fff7e8;
  font-size: 10px;
  font-weight: 800;
}

.sample-meta {
  margin: 8px 0 0;
  color: #707b88;
  font-size: 11px;
  line-height: 1.55;
}

.sample-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.sample-compare-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e2e7ed;
  border-radius: 8px;
  background: #f8fafc;
}

.sample-compare-item.is-empty {
  display: flex;
  flex-direction: column;
}

.sample-compare-label {
  display: block;
  padding: 9px 10px 7px;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  border-bottom: 1px solid #e2e7ed;
  background: #fff;
}

.sample-compare-preview,
.sample-compare-placeholder {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  object-fit: contain;
  background: #eef1f4;
}

.sample-compare-placeholder {
  padding: 14px;
  color: #8b94a0;
  font-size: 12px;
  text-align: center;
}

.sample-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 13px;
}

.sample-actions-ai {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sample-actions .button {
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px;
  border-bottom: 1px solid #e7eaee;
}

.panel-toolbar h2 {
  margin-bottom: 5px;
  font-size: 17px;
}

.panel-toolbar p {
  margin-bottom: 0;
  color: #7b8592;
  font-size: 12px;
}

.status-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #e0e4e9;
  border-radius: 7px;
  background: #f5f7f9;
}

.status-tabs button {
  height: 32px;
  padding: 0 13px;
  color: #697380;
  border: 0;
  border-radius: 5px;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.status-tabs button.is-active {
  color: #111318;
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.09);
}

.state-panel {
  min-height: 330px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 50px;
  color: #7d8793;
  text-align: center;
}

.state-panel strong {
  color: #3d444e;
  font-size: 16px;
}

.state-panel p {
  margin: 8px 0 0;
  font-size: 13px;
}

.loader {
  width: 24px;
  height: 24px;
  margin-bottom: 14px;
  border: 3px solid #e0e4e9;
  border-top-color: #111318;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.work-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.work-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
  border: 1px solid #e1e5ea;
  border-radius: 8px;
  background: #fff;
}

.work-preview {
  min-height: 150px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e2e6eb;
  border-radius: 6px;
  background: #f2f4f6;
}

.work-preview canvas {
  width: 100%;
  height: auto;
  max-height: 150px;
  image-rendering: pixelated;
}

.work-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.work-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.work-title {
  min-width: 0;
  overflow: hidden;
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  color: #5d6672;
  border: 1px solid #d8dde3;
  border-radius: 5px;
  background: #f8f9fa;
  font-size: 10px;
  font-weight: 800;
}

.status-badge.pending {
  color: #8a5700;
  border-color: #edd49d;
  background: #fff9e9;
}

.status-badge.approved {
  color: #176b37;
  border-color: #b8ddc5;
  background: #f1fbf4;
}

.status-badge.rejected,
.status-badge.blocked {
  color: #a52720;
  border-color: #efc3bf;
  background: #fff6f5;
}

.work-meta,
.work-owner,
.work-time {
  margin: 8px 0 0;
  color: #707b88;
  font-size: 12px;
  line-height: 1.5;
}

.work-owner {
  color: #414852;
}

.work-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 10px;
  color: #68727e;
  font-size: 11px;
}

.work-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: auto;
  padding-top: 14px;
}

.work-actions .button {
  min-height: 32px;
  padding: 0 11px;
  font-size: 11px;
}

.pagination {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 12px 20px;
  border-top: 1px solid #e7eaee;
}

.pagination span {
  min-width: 90px;
  color: #65707d;
  font-size: 12px;
  text-align: center;
}

.system-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.overview-card {
  min-width: 0;
  padding: 18px;
  text-align: left;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  background: #fff;
}

.overview-card-action {
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.overview-card-action:hover {
  transform: translateY(-1px);
  border-color: #111318;
  box-shadow: 0 8px 20px rgba(17, 19, 24, 0.08);
}

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

.overview-card span {
  color: #6f7986;
  font-size: 12px;
  font-weight: 700;
}

.overview-card strong {
  margin: 14px 0 8px;
  font-size: 28px;
  line-height: 1.1;
}

.overview-card small {
  color: #7f8995;
  font-size: 11px;
  line-height: 1.5;
}

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

.system-panel {
  overflow: hidden;
}

.system-panel-wide {
  grid-column: 1 / -1;
}

.kv-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 18px 22px 22px;
}

.kv-row {
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #e8ebef;
}

.kv-row dt {
  color: #8a94a0;
  font-size: 11px;
}

.kv-row dd {
  margin: 6px 0 0;
  color: #252a31;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.system-table-wrap {
  padding: 0 22px 22px;
  overflow-x: auto;
}

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

.system-table th,
.system-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e8ebef;
  text-align: left;
}

.system-table th {
  color: #6f7986;
  font-size: 11px;
  font-weight: 800;
}

.system-empty {
  padding: 18px 22px 22px;
  color: #7b8592;
  font-size: 12px;
}

.system-subtitle {
  margin: 0;
  padding: 0 22px;
  font-size: 13px;
}

.dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: auto;
  color: #111318;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(13, 18, 26, 0.28);
}

.dialog::backdrop {
  background: rgba(17, 19, 24, 0.58);
}

.dialog-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid #e5e8ec;
  background: #fff;
}

.dialog-header h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.icon-button {
  width: 36px;
  height: 36px;
  color: #5e6874;
  border: 1px solid #d9dee4;
  border-radius: 6px;
  background: #fff;
  font-size: 24px;
  line-height: 1;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 0;
}

.detail-preview {
  min-height: 520px;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef1f4;
}

.detail-preview canvas {
  width: 100%;
  height: auto;
  max-height: 650px;
  image-rendering: pixelated;
  background: #fff;
  box-shadow: 0 8px 26px rgba(20, 27, 36, 0.12);
}

.detail-info {
  padding: 22px;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 24px;
}

.detail-meta div {
  min-width: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #e8ebef;
}

.detail-meta dt {
  color: #858f9b;
  font-size: 10px;
}

.detail-meta dd {
  overflow: hidden;
  margin: 5px 0 0;
  color: #252a31;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-info h3 {
  margin: 20px 0 10px;
  font-size: 13px;
}

.material-list,
.report-list {
  display: grid;
  gap: 6px;
}

.material-row,
.report-row {
  display: grid;
  gap: 7px;
  padding: 9px 10px;
  border: 1px solid #e4e8ed;
  border-radius: 6px;
  background: #fafbfc;
  font-size: 11px;
}

.material-row {
  grid-template-columns: 58px minmax(0, 1fr) auto;
}

.material-row strong,
.material-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-row span {
  color: #7b8591;
}

.confirm-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 26px;
}

.user-dialog {
  width: min(1180px, calc(100vw - 32px));
}

.dialog-note {
  margin: 16px 22px 0;
  color: #697380;
  font-size: 12px;
  line-height: 1.6;
}

.user-list {
  padding: 16px 22px 6px;
}

.user-loading {
  min-height: 220px;
}

.user-table-wrap {
  overflow: auto;
  border: 1px solid #e0e5eb;
  border-radius: 8px;
}

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

.user-table th,
.user-table td {
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #edf0f3;
}

.user-table th {
  color: #6b7582;
  background: #f7f9fb;
  font-size: 11px;
  font-weight: 800;
}

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

.user-table strong,
.user-table span {
  display: block;
}

.user-table strong {
  color: #111318;
  line-height: 1.45;
}

.user-table span {
  margin-top: 4px;
  color: #74808d;
  line-height: 1.45;
}

.confirm-dialog h2 {
  margin-bottom: 10px;
  font-size: 20px;
}

.confirm-dialog > p:not(.eyebrow) {
  color: #66717e;
  font-size: 13px;
  line-height: 1.7;
}

.dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 48px));
  padding: 12px 16px;
  color: #fff;
  border-radius: 6px;
  background: #111318;
  box-shadow: 0 12px 36px rgba(14, 19, 26, 0.22);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: #a52720;
}

@media (max-width: 1050px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .system-grid {
    grid-template-columns: 1fr;
  }

  .work-list {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    padding: 12px 16px;
  }

  .connection-state {
    display: none;
  }

  .workspace {
    width: min(100% - 24px, 1380px);
    padding-top: 24px;
  }

  .page-heading {
    align-items: flex-start;
  }

  .page-date {
    display: none;
  }

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

  .panel-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .sample-settings {
    grid-template-columns: 1fr;
  }

  .sample-filter {
    width: 100%;
  }

  .sample-filter input {
    min-width: 0;
    flex: 1;
  }

  .sample-section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .sample-section-count {
    white-space: normal;
  }

  .status-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .status-tabs button {
    flex: 1 0 auto;
  }

  .work-card {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 13px;
    padding: 12px;
  }

  .work-preview {
    min-height: 112px;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-preview {
    min-height: 330px;
  }

  .setting-card {
    grid-template-columns: 1fr;
  }

  .setting-card .button {
    justify-self: stretch;
  }

  .kv-list {
    grid-template-columns: 1fr;
  }

  .sample-actions-ai {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .login-panel {
    padding: 30px 22px;
  }

  .brand span,
  .topbar .button-ghost {
    display: none;
  }

  .topbar-actions {
    gap: 4px;
  }

  .topbar-actions .button {
    padding: 0 10px;
  }

  .summary-grid {
    gap: 8px;
  }

  .system-overview {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .summary-card {
    padding: 14px;
  }

  .summary-card strong {
    margin-top: 12px;
    font-size: 25px;
  }

  .work-list {
    padding: 10px;
  }

  .work-card {
    grid-template-columns: 1fr;
  }

  .view-tabs {
    width: 100%;
  }

  .view-tabs button {
    min-width: 0;
    flex: 1;
  }

  .sample-list {
    padding: 10px;
  }

  .sample-section-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .work-preview {
    min-height: 210px;
    }

  .work-preview canvas {
    max-height: 210px;
  }
}
