:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --surface-strong: #eef2f5;
  --line: #dce3ea;
  --line-strong: #c8d2dc;
  --text: #18212f;
  --muted: #687386;
  --muted-strong: #465366;
  --brand: #0f766e;
  --brand-strong: #0b5f59;
  --brand-soft: #e4f5f2;
  --accent: #5b6ee1;
  --amber: #b7791f;
  --ok: #15803d;
  --bad: #b42318;
  --bad-soft: #fff1f0;
  --radius: 8px;
  --shadow: 0 18px 46px rgba(24, 33, 47, .12);
  --shadow-soft: 0 8px 24px rgba(24, 33, 47, .08);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .76), rgba(243, 245, 247, .88)),
    radial-gradient(circle at 12% 0%, rgba(15, 118, 110, .11), transparent 30%),
    radial-gradient(circle at 90% 8%, rgba(91, 110, 225, .10), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(24, 33, 47, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 33, 47, .035) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .75), transparent 70%);
}

.hidden,
.locked {
  display: none !important;
}

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

button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 13px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
}

button:hover {
  border-color: rgba(15, 118, 110, .55);
  box-shadow: 0 7px 18px rgba(15, 118, 110, .14);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button.primary {
  border-color: var(--brand);
  background: linear-gradient(180deg, #12877f, var(--brand));
  color: #fff;
  font-weight: 700;
}

button.primary:hover {
  background: linear-gradient(180deg, #0f766e, var(--brand-strong));
}

button.ghost {
  background: var(--surface-soft);
  color: var(--muted-strong);
}

button.danger {
  border-color: rgba(180, 35, 24, .88);
  background: #fff7f6;
  color: var(--bad);
  font-weight: 700;
}

button.danger:hover {
  background: var(--bad);
  color: #fff;
  box-shadow: 0 7px 18px rgba(180, 35, 24, .18);
}

input,
select,
textarea {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(15, 118, 110, .78);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .12);
}

textarea::placeholder,
input::placeholder {
  color: #98a3b3;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-box {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.login-box::before {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #111827, #0f766e);
  color: #fff;
  content: "A";
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 13px 28px rgba(15, 118, 110, .24);
}

.login-box h1 {
  margin: 4px 0 0;
  font-size: 25px;
  letter-spacing: 0;
}

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

.login-box input {
  height: 46px;
  border-radius: 7px;
  padding: 0 13px;
}

.login-note {
  padding-top: 2px;
  color: #7c8798;
  font-size: 12px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(16px, 2.6vw, 34px);
  border-bottom: 1px solid rgba(220, 227, 234, .86);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 10px 28px rgba(24, 33, 47, .07);
  backdrop-filter: blur(18px);
}

.topbar > div:first-child {
  position: relative;
  min-width: 280px;
  padding-left: 58px;
}

.topbar > div:first-child::before {
  position: absolute;
  left: 0;
  top: 50%;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #18212f;
  color: #fff;
  content: "ID";
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  transform: translateY(-50%);
  box-shadow: 0 12px 24px rgba(24, 33, 47, .18);
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.topbar p {
  max-width: 780px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.top-actions,
.import-actions,
.filters,
.segmented {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.top-actions {
  justify-content: flex-end;
}

.top-actions button {
  min-width: 82px;
}

.workspace {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  width: min(1720px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 2.6vw, 34px) 30px;
}

section {
  border: 1px solid rgba(220, 227, 234, .94);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-soft);
}

.import-panel,
.preview-panel {
  grid-column: 1 / -1;
}

.manual-panel,
.view-switch-panel,
.map-panel,
.asset-panel {
  grid-column: 1 / -1;
}

.import-panel,
.preview-panel,
.manual-panel,
.view-switch-panel,
.map-panel,
.asset-panel {
  padding: 16px;
}

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

.panel-title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-title h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.panel-title h2::before {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  content: "";
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .12);
}

.import-panel .panel-title h2::before {
  content: "+";
}

.preview-panel .panel-title h2::before {
  content: "#";
}

.manual-panel .panel-title h2::before {
  content: "M";
}

.map-panel .panel-title h2::before {
  content: "R";
}

.asset-panel .panel-title h2::before {
  content: "T";
}

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

.panel-subtitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-subtitle h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

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

.collapse-toggle {
  position: relative;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 7px;
}

.collapse-toggle::before {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: translateY(2px) rotate(225deg);
  transition: transform .16s ease;
}

.collapse-toggle[aria-expanded="false"]::before {
  transform: translateY(-2px) rotate(45deg);
}

.collapsible-body {
  display: block;
}

.collapsible-body.smart-workflow-body {
  display: grid;
}

.collapsible-body.collapsed {
  display: none;
}

.segmented {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.segmented label {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.segmented label:has(input:checked) {
  background: #fff;
  color: var(--brand-strong);
  box-shadow: 0 4px 12px rgba(24, 33, 47, .08);
}

.segmented input {
  accent-color: var(--brand);
}

textarea {
  width: 100%;
  min-height: 192px;
  resize: vertical;
  border-radius: var(--radius);
  padding: 14px;
  background: linear-gradient(180deg, #fbfdff, #f8fafc);
  line-height: 1.62;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

#pasteInput {
  min-height: 238px;
  font-family: var(--mono);
  font-size: 13px;
}

.smart-workflow-body {
  display: grid;
  grid-template-columns: minmax(360px, .92fr) minmax(420px, 1fr);
  gap: 14px;
  align-items: start;
}

.smart-input-area {
  min-width: 0;
}

.smart-input-area .segmented {
  width: max-content;
  margin-bottom: 10px;
}

.smart-preview-area {
  min-width: 0;
}

.smart-preview-area .table-wrap {
  max-height: 328px;
}

.manual-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
}

.manual-grid input,
.manual-grid select,
.manual-grid textarea {
  min-height: 39px;
  border-radius: 7px;
  padding: 8px 10px;
  background: #fbfcfd;
}

.manual-grid textarea {
  grid-column: span 5;
  min-height: 74px;
}

.view-switch-panel {
  padding: 0 16px;
  box-shadow: none;
  background: transparent;
  border-color: transparent;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.view-tab {
  position: relative;
  min-height: 46px;
  border: 0;
  border-radius: 0;
  padding: 0 18px;
  background: transparent;
  color: #667085;
  font-weight: 800;
  box-shadow: none;
}

.view-tab:hover {
  border-color: transparent;
  box-shadow: none;
  color: var(--brand-strong);
  transform: none;
}

.view-tab.active {
  color: var(--brand-strong);
}

.view-tab.active::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--brand);
  content: "";
}

.tab-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.table-icon::before,
.table-icon::after,
.mind-icon::before,
.mind-icon::after {
  content: "";
}

.table-icon {
  grid-template-rows: repeat(2, 1fr);
}

.table-icon::before,
.table-icon::after {
  background: currentColor;
  border-radius: 2px;
  box-shadow: 6px 0 0 currentColor, 12px 0 0 currentColor;
}

.mind-icon {
  position: relative;
  display: inline-block;
}

.mind-icon::before {
  position: absolute;
  left: 1px;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 10px -6px 0 currentColor, 10px 6px 0 currentColor;
}

.mind-icon::after {
  position: absolute;
  left: 6px;
  top: 9px;
  width: 10px;
  height: 1px;
  background: currentColor;
  box-shadow: 4px -5px 0 currentColor, 4px 5px 0 currentColor;
  transform: rotate(0deg);
}

.map-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.topology-map {
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  display: flex;
  align-items: stretch;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.mind-cluster {
  position: relative;
  min-width: 430px;
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(190px, 1fr);
  gap: 24px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(220, 227, 234, .72);
  border-radius: var(--radius);
  background: #fff;
}

.mind-center {
  position: relative;
  display: grid;
  align-items: center;
}

.mind-center::after {
  position: absolute;
  right: -24px;
  top: 50%;
  width: 24px;
  height: 2px;
  background: var(--line-strong);
  content: "";
}

.mind-branches {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 18px;
}

.mind-branches::before {
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background: var(--line-strong);
  content: "";
}

.map-node {
  position: relative;
  min-height: 34px;
  max-width: 100%;
  text-align: left;
  overflow-wrap: anywhere;
  white-space: normal;
}

.map-node.root {
  border-color: var(--brand);
  background: linear-gradient(180deg, #f0fdfa, #d9f6f1);
  color: var(--brand-strong);
  font-weight: 700;
}

.map-node.child {
  justify-content: flex-start;
  background: #fff;
}

.map-node.child::before {
  position: absolute;
  left: -19px;
  top: 50%;
  width: 18px;
  height: 2px;
  background: var(--line-strong);
  content: "";
}

.map-node.platform {
  border-color: rgba(91, 110, 225, .32);
  background: #f3f5ff;
  color: #3538cd;
}

.map-node.recovery,
.map-node.chain {
  border-color: rgba(15, 118, 110, .24);
  background: #f0fdfa;
  color: var(--brand-strong);
}

.map-node.temp {
  border-color: rgba(183, 121, 31, .28);
  background: #fff7ed;
  color: #b54708;
}

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

.filters {
  justify-content: flex-end;
}

.filters input,
.filters select,
.import-actions input[type="date"] {
  height: 36px;
  border-radius: 7px;
  padding: 0 10px;
}

.filters input {
  width: min(380px, 42vw);
}

.selection-count {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.asset-check,
#selectVisibleAssets {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

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

.stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 34px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.stat {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted-strong);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  max-height: 430px;
}

.preview-panel .table-wrap {
  max-height: 365px;
}

.table-wrap.assets {
  max-height: 58vh;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 9px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th:last-child,
td:last-child {
  border-right: 0;
}

tbody tr:last-child td {
  border-bottom: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f2f5f8;
  color: #39475b;
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
  box-shadow: inset 0 -1px 0 var(--line-strong);
}

tbody tr {
  transition: background .15s ease;
}

tbody tr:hover td {
  background: #fbfdff;
}

td[contenteditable="true"] {
  min-width: 110px;
  background: #fff;
}

td[contenteditable="true"]:focus {
  position: relative;
  z-index: 1;
  background: var(--brand-soft);
  outline: 2px solid rgba(15, 118, 110, .24);
  outline-offset: -2px;
}

.asset-main-row td {
  background: #fff;
}

.cell-value {
  position: relative;
  min-height: 48px;
  padding: 6px 7px 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.cell-value:hover {
  border-color: rgba(15, 118, 110, .48);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .10);
}

.cell-value.copied {
  outline: 2px solid rgba(21, 128, 61, .25);
  background: #ecfdf3;
}

.value-text {
  max-width: 320px;
  white-space: pre-wrap;
  word-break: break-word;
}

.search-hit {
  border-radius: 4px;
  padding: 0 2px;
  background: #fff2a8;
  color: #7a4b00;
  box-shadow: 0 0 0 1px rgba(183, 121, 31, .16);
}

td:nth-child(3) .value-text {
  max-width: 220px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.collapsed-value .value-text {
  display: inline-block;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  vertical-align: top;
}

.empty-value .value-text {
  color: var(--muted);
}

.cookie .value-text,
.notes .value-text {
  max-height: 96px;
  overflow: auto;
}

.icon-btn,
.detail-toggle {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 7px;
  font-size: 13px;
  line-height: 1;
}

.copy-btn.copied {
  border-color: var(--ok);
  background: var(--ok);
  color: #fff;
}

.cell-tools {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.corner-hint {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 3px;
  color: #98a2b3;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edit-corner {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 11px;
}

.edit-corner:hover {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.confidence {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 26px;
  border-radius: 999px;
  font-weight: 800;
}

.confidence.high {
  background: #ecfdf3;
  color: var(--ok);
}

.confidence.medium {
  background: #fffaeb;
  color: var(--amber);
}

.confidence.low {
  background: var(--bad-soft);
  color: var(--bad);
}

.totp {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 118px;
  padding: 6px 7px;
  border-radius: 7px;
  cursor: pointer;
  border-left: 4px solid var(--totp-color, var(--ok));
}

.totp:hover {
  background: var(--brand-soft);
}

.totp.copied {
  outline: 2px solid rgba(21, 128, 61, .25);
  background: #ecfdf3;
}

.totp-code {
  color: var(--totp-color, var(--brand-strong));
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0;
}

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

.status-select {
  width: 116px;
  padding: 7px;
  border-radius: 7px;
  border-color: transparent;
  color: var(--muted-strong);
  font-weight: 800;
  cursor: pointer;
}

.status-select:hover {
  border-color: rgba(24, 33, 47, .18);
}

.status-ok {
  background: #ecfdf3;
  color: #067647;
}

.status-pending {
  background: #eff4ff;
  color: #3538cd;
}

.status-warn {
  background: #fffaeb;
  color: #b54708;
}

.status-bad {
  background: #fff1f0;
  color: #b42318;
}

.status-grow {
  background: #f0fdf4;
  color: #15803d;
}

.status-muted {
  background: #f2f4f7;
  color: #667085;
}

.status-priority {
  background: #fff7ed;
  color: #c2410c;
}

.status-empty {
  background: #f8fafc;
  color: #98a2b3;
}

.plain-cell {
  min-height: 32px;
  padding: 6px;
  white-space: nowrap;
}

.select-index-head,
.select-index-cell {
  min-width: 64px;
  text-align: center;
  vertical-align: middle;
}

.select-index-head {
  white-space: nowrap;
}

.select-index-head span {
  margin-left: 6px;
}

.select-index-cell {
  padding: 7px 8px;
}

.select-index-cell .asset-check {
  display: block;
  margin: 0 auto 7px;
}

.row-control {
  text-align: center;
  vertical-align: middle;
}

.row-control .detail-toggle {
  margin: 0 auto;
}

.row-index {
  min-width: 0;
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
  line-height: 1;
}

.editable-index {
  cursor: pointer;
  border-radius: 7px;
}

.editable-index:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.asset-detail-row td {
  padding: 12px;
  background: #f8fafc;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.detail-item {
  min-height: 94px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.detail-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  padding: 9px 14px;
  border-radius: 7px;
  background: #19202a;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .15s ease, transform .15s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 33, 47, .36);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(680px, 88vh);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

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

.modal-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-strong);
  cursor: pointer;
}

.check-line input,
.rule-item input {
  accent-color: var(--brand);
}

.rule-list {
  min-height: 180px;
  overflow: auto;
  padding: 10px;
}

.rule-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}

.rule-item + .rule-item {
  margin-top: 8px;
}

.rule-item:hover {
  border-color: rgba(15, 118, 110, .28);
  background: var(--brand-soft);
}

.rule-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.rule-main strong {
  font-size: 14px;
}

.rule-main span {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rule-item time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.empty {
  padding: 38px 24px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1180px) {
  .preview-panel .table-wrap {
    max-height: 380px;
  }

  .smart-workflow-body {
    grid-template-columns: 1fr;
  }

  .smart-preview-area .table-wrap {
    max-height: 380px;
  }

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

  .manual-grid textarea {
    grid-column: span 3;
  }
}

@media (max-width: 980px) {
  .topbar,
  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-title-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .topbar > div:first-child {
    min-width: 0;
  }

  .top-actions,
  .import-actions,
  .filters {
    width: 100%;
  }

  .filters {
    justify-content: flex-start;
  }

  .filters input {
    width: 100%;
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    font-size: 13px;
  }

  .login-screen {
    padding: 14px;
  }

  .login-box {
    padding: 22px;
  }

  .topbar {
    padding: 14px;
  }

  .topbar > div:first-child {
    padding-left: 52px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .workspace {
    padding: 12px;
  }

  .import-panel,
  .preview-panel,
  .manual-panel,
  .view-switch-panel,
  .map-panel,
  .asset-panel {
    padding: 12px;
  }

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

  .manual-grid textarea {
    grid-column: span 1;
  }

  .mind-cluster {
    min-width: 320px;
    grid-template-columns: 1fr;
  }

  .mind-center::after,
  .mind-branches::before,
  .map-node.child::before {
    display: none;
  }

  .mind-branches {
    padding-left: 0;
  }

  button,
  .filters select {
    flex: 1 1 auto;
  }

  .modal-head,
  .modal-tools,
  .rule-item {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .modal-head,
  .modal-tools {
    flex-direction: column;
  }

  .rule-item {
    gap: 8px;
  }

  .rule-item time {
    white-space: normal;
  }

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