:root {
  --ink: #15231f;
  --muted: #68756f;
  --line: #dfe7e2;
  --paper: #f4f7f4;
  --card: rgba(255, 255, 255, 0.9);
  --green: #176b52;
  --green-dark: #0e4e3b;
  --green-soft: #e2f2eb;
  --lime: #c7f36b;
  --red: #c74848;
  --red-soft: #fff0ef;
  --shadow: 0 24px 70px rgba(25, 56, 44, 0.09);
  font-family: "Manrope", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 1120px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  overflow-x: auto;
}

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

.ambient { position: fixed; border-radius: 999px; filter: blur(2px); pointer-events: none; z-index: -1; }
.ambient-one { width: 480px; height: 480px; top: -210px; right: 18%; background: radial-gradient(circle, rgba(199,243,107,.34), rgba(199,243,107,0) 70%); }
.ambient-two { width: 560px; height: 560px; bottom: -330px; left: 32%; background: radial-gradient(circle, rgba(120,199,172,.18), rgba(120,199,172,0) 70%); }

.topbar {
  height: 78px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(205, 216, 209, .75);
  background: rgba(248, 250, 248, .8);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; padding: 9px; border-radius: 12px; display: flex; gap: 3px; align-items: end; background: var(--ink); box-shadow: 0 8px 22px rgba(21,35,31,.16); }
.brand-mark span { display: block; width: 5px; border-radius: 4px; background: var(--lime); }
.brand-mark span:nth-child(1) { height: 11px; }
.brand-mark span:nth-child(2) { height: 20px; }
.brand-mark span:nth-child(3) { height: 15px; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -.02em; font-size: 16px; }
.brand small { margin-top: 1px; font-size: 11px; color: var(--muted); }
.brand-tabs { position: absolute; left: 50%; top: 17px; transform: translateX(-50%); padding: 4px; display: flex; align-items: center; gap: 3px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.82); box-shadow: 0 7px 22px rgba(30,55,45,.06); }
.brand-tab { height: 35px; padding: 0 15px; display: inline-flex; align-items: center; gap: 8px; border-radius: 9px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 650; transition: color .2s, background .2s, box-shadow .2s; }
.brand-tab i { width: 7px; height: 7px; border-radius: 50%; background: #aab4af; transition: background .2s, box-shadow .2s; }
.brand-tab[data-brand="luosen"] i { background: #3a9a72; }
.brand-tab[data-brand="chengguang"] i { background: #4c91d1; }
.brand-tab.active { color: var(--green); background: var(--green-soft); box-shadow: 0 2px 7px rgba(25,70,50,.08); }
.brand-tab.active i { background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 14%, transparent); }
.topbar-meta { display: flex; align-items: center; gap: 18px; }
.environment { color: #8b9691; font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.status-pill { height: 34px; padding: 0 13px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; background: #fff; border: 1px solid var(--line); }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: #9da7a2; }
.status-pill.online { color: var(--green); border-color: #c9e6d9; background: #eff9f4; }
.status-pill.online i { background: #30a778; box-shadow: 0 0 0 4px rgba(48,167,120,.12); }
.status-pill.offline { color: var(--red); background: var(--red-soft); border-color: #f2d2cf; }
.status-pill.offline i { background: var(--red); }
.status-pill.checking i { animation: pulse 1.4s infinite; }

.shell { display: grid; grid-template-columns: 330px minmax(740px, 1040px); gap: 42px; max-width: 1480px; margin: 0 auto; padding: 34px 34px 80px; align-items: start; }
.config-panel { position: sticky; top: 108px; padding: 28px; background: rgba(255,255,255,.66); border: 1px solid rgba(216,226,220,.9); border-radius: 24px; box-shadow: 0 18px 50px rgba(25,56,44,.05); backdrop-filter: blur(14px); }
.panel-heading { margin-bottom: 25px; }
.eyebrow { display: block; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .17em; }
.panel-heading h2, .hero-copy h1, .results-header h2 { margin: 7px 0 6px; letter-spacing: -.035em; }
.panel-heading h2 { font-size: 22px; }
.panel-heading p, .hero-copy p, .card-toolbar p { margin: 0; color: var(--muted); line-height: 1.7; font-size: 12px; }

.field-group { margin-top: 18px; min-width: 0; }
.field-group label, .request-prefix label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 650; }
.field-group label span { margin-left: 4px; color: #9aa49f; font-size: 10px; font-weight: 500; }
.field-row { display: grid; grid-template-columns: 1fr 94px; gap: 10px; }
.field-group input, .field-group select, .request-prefix input { width: 100%; height: 42px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 11px; outline: none; transition: border-color .2s, box-shadow .2s; }
.field-group input:focus, .field-group select:focus, .request-prefix input:focus, textarea:focus { border-color: #62a88d; box-shadow: 0 0 0 3px rgba(62,139,109,.1); }
.input-with-icon { position: relative; }
.input-with-icon > svg { position: absolute; left: 12px; top: 13px; width: 16px; height: 16px; stroke: #8a9690; fill: none; stroke-width: 1.8; }
.input-with-icon > input { padding-left: 37px; padding-right: 40px; }
.icon-button { width: 34px; height: 34px; padding: 8px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.icon-button:hover { background: #edf2ef; color: var(--ink); }
.icon-button svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; }
.input-with-icon .icon-button { position: absolute; right: 4px; top: 4px; }
.label-line, .range-labels { display: flex; justify-content: space-between; align-items: center; }
.label-line output { min-width: 26px; padding: 3px 7px; border-radius: 6px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 700; text-align: center; }
.range { width: 100%; accent-color: var(--green); }
.range-labels { margin-top: 3px; color: #9ba49f; font-size: 9px; }

.service-card { margin-top: 25px; padding: 14px; display: flex; align-items: center; gap: 11px; border: 1px solid #d7e9df; background: linear-gradient(135deg, #edf8f2, #f8fbf9); border-radius: 14px; }
.service-icon { width: 38px; height: 38px; padding: 9px; border-radius: 10px; color: var(--green); background: #d9eee4; }
.service-icon svg, .security-note svg, button svg, .drop-hint svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.service-card span, .service-card strong { display: block; }
.service-card span { margin-bottom: 3px; color: var(--muted); font-size: 10px; }
.service-card strong { font-size: 12px; }
.security-note { display: flex; gap: 8px; align-items: flex-start; margin: 16px 2px 0; color: #84908a; font-size: 10px; line-height: 1.6; }
.security-note svg { flex: 0 0 15px; margin-top: 1px; }

.workspace { min-width: 0; }
.hero-copy { padding: 15px 3px 24px; }
.hero-copy h1 { font-size: 38px; line-height: 1.15; }
.hero-copy p { max-width: 690px; font-size: 14px; }
.card { background: var(--card); border: 1px solid rgba(213,224,217,.92); border-radius: 22px; box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.input-card { padding: 25px; }
.card-toolbar, .run-row, .results-header, .progress-copy { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card-toolbar h3, .progress-copy h3, .url-dialog h3 { margin: 0 0 4px; font-size: 16px; letter-spacing: -.02em; }
.toolbar-actions, .results-actions { display: flex; align-items: center; gap: 8px; }
button { border: 0; }
.text-button { padding: 8px 10px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 600; }
.text-button:not(:disabled):hover { color: var(--green); }
.text-button:disabled { cursor: default; opacity: .4; }
.secondary-button, .danger-button { height: 38px; padding: 0 13px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; font-size: 12px; font-weight: 650; }
.secondary-button:hover { border-color: #b9cdc2; background: #f8fbf9; }
.secondary-button svg { width: 15px; height: 15px; }
.danger-button { color: var(--red); background: var(--red-soft); border-color: #f0d0cd; }

.sample-case { margin-top: 19px; padding: 10px 12px; display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid #d5e9df; border-radius: 14px; background: linear-gradient(105deg, #edf8f2, #f9fcfa); }
.sample-images { width: 90px; height: 50px; position: relative; }
.sample-case img { position: absolute; width: 52px; height: 46px; object-fit: cover; border: 2px solid #fff; border-radius: 9px; background: #dfe9e3; box-shadow: 0 4px 12px rgba(22,48,38,.12); }
.sample-case img:nth-child(1) { left: 0; top: 0; z-index: 3; }
.sample-case img:nth-child(2) { left: 19px; top: 2px; z-index: 2; }
.sample-case img:nth-child(3) { right: 0; top: 4px; z-index: 1; }
.sample-copy { min-width: 0; }
.sample-copy span, .sample-copy strong, .sample-copy small { display: block; }
.sample-copy span { margin-bottom: 2px; color: var(--green); font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.sample-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.sample-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.sample-button { height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border-radius: 9px; color: var(--green); background: #fff; border: 1px solid #cce2d7; font-size: 10px; font-weight: 700; }
.sample-button:hover { border-color: #83bca5; background: #f9fffb; }
.sample-button svg { width: 13px; height: 13px; }

.url-editor { margin-top: 12px; min-height: 190px; position: relative; border: 1px solid var(--line); border-radius: 15px; background: #fbfdfc; overflow: hidden; transition: border-color .2s, background .2s; }
.url-editor.dragging { border-color: var(--green); background: #f2faf6; box-shadow: inset 0 0 0 2px rgba(23,107,82,.09); }
textarea { width: 100%; min-height: 190px; padding: 18px 18px 48px; resize: vertical; border: 0; outline: 0; color: #30423b; background: transparent; font: 12px/1.8 "Manrope", monospace; }
textarea::placeholder { color: #a6afaa; }
.drop-hint { position: absolute; left: 16px; bottom: 13px; display: flex; gap: 6px; align-items: center; color: #98a29d; font-size: 10px; pointer-events: none; }
.drop-hint svg { width: 14px; height: 14px; }
.parse-bar { height: 50px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e8eeea; }
.parse-summary { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.count-badge { min-width: 27px; height: 23px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: var(--green); border-radius: 7px; font-size: 11px; font-weight: 700; }
.muted { color: #9ba59f; font-size: 10px; }
.run-row { padding-top: 20px; justify-content: flex-end; }
.request-prefix { margin-right: auto; }
.request-prefix label { display: inline; margin-right: 8px; color: var(--muted); font-size: 10px; }
.request-prefix input { width: 150px; height: 40px; }
.primary-button { min-width: 150px; height: 44px; padding: 0 20px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--green), var(--green-dark)); box-shadow: 0 10px 22px rgba(23,107,82,.22); font-size: 13px; font-weight: 700; transition: transform .2s, box-shadow .2s, opacity .2s; }
.primary-button:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 13px 28px rgba(23,107,82,.28); }
.primary-button:disabled { cursor: default; opacity: .45; box-shadow: none; }
.button-label, .button-loading { align-items: center; justify-content: center; gap: 8px; }
.button-label { display: flex; }
.button-label svg { width: 16px; height: 16px; }
.button-loading { display: none; }
.primary-button.loading .button-label { display: none; }
.primary-button.loading .button-loading { display: flex; }
.button-loading i { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }

.progress-card { margin-top: 18px; padding: 22px 25px; }
.progress-copy strong { font-size: 22px; color: var(--green); }
.progress-track { height: 8px; margin-top: 18px; border-radius: 99px; background: #e8eee9; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #6bb893, var(--lime)); transition: width .35s ease; }
.progress-stats { margin-top: 12px; display: flex; gap: 20px; color: var(--muted); font-size: 11px; }
.progress-stats span:last-child { margin-left: auto; font-variant-numeric: tabular-nums; }
.progress-stats b { color: var(--ink); }

.results-section { margin-top: 34px; }
.results-header { margin-bottom: 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.results-header h2 { font-size: 25px; }
.results-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.report-button { height: 38px; padding: 0 15px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--green); border-radius: 10px; color: #fff; background: var(--green); font-size: 10px; font-weight: 700; box-shadow: 0 8px 18px rgba(23,107,82,.16); }
.report-button:hover { background: var(--green-dark); }
.report-button:disabled { opacity: .55; cursor: wait; }
.report-button svg, .results-actions .secondary-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.theme-chengguang .report-button { box-shadow: 0 8px 18px rgba(37,99,169,.18); }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.summary-card { padding: 17px 18px; background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.summary-card span, .summary-card strong { display: block; }
.summary-card span { color: var(--muted); font-size: 10px; }
.summary-card strong { margin-top: 7px; font-size: 23px; letter-spacing: -.03em; }
.summary-card.success strong { color: var(--green); }
.summary-card.failed strong { color: var(--red); }
.summary-card.score-buckets-card { grid-column: 1 / -1; }
.score-buckets { display: grid; gap: 8px; margin-top: 10px; }
.score-bucket { display: grid; grid-template-columns: 64px 1fr 36px; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); }
.score-bucket i { display: block; height: 8px; border-radius: 999px; background: linear-gradient(90deg, #1f6feb var(--pct), #e8edf5 var(--pct)); }
.score-bucket em { font-style: normal; text-align: right; color: var(--ink); }
.results-list { display: grid; gap: 12px; }
.result-card { background: #fff; border: 1px solid var(--line); border-radius: 17px; overflow: hidden; box-shadow: 0 10px 30px rgba(28,57,46,.04); }
.result-card.failed { border-color: #efd0cd; }
.result-summary { min-height: 92px; padding: 14px 17px; display: grid; grid-template-columns: 68px minmax(0, 1fr) auto 30px; align-items: center; gap: 14px; cursor: pointer; list-style: none; }
.result-summary::-webkit-details-marker { display: none; }
.image-thumb { width: 68px; height: 62px; border-radius: 11px; object-fit: cover; background: #edf1ee; }
.result-main { min-width: 0; }
.result-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.result-main span { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.result-meta { display: flex; align-items: center; gap: 20px; }
.metric { min-width: 58px; text-align: right; }
.metric span, .metric strong { display: block; }
.metric span { color: var(--muted); font-size: 9px; }
.metric strong { margin-top: 3px; font-size: 13px; }
.state-chip { padding: 5px 9px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 700; }
.state-chip.error { color: var(--red); background: var(--red-soft); }
.chevron { width: 18px; height: 18px; color: #8d9993; transition: transform .2s; }
details[open] .chevron { transform: rotate(180deg); }
.result-detail { border-top: 1px solid #edf1ee; padding: 18px; }
.detection-result { display: grid; gap: 14px; }
.result-stats-bar { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #e5ebe7; border-radius: 13px; background: #f7f9f8; overflow: hidden; }
.result-stats-bar > div { padding: 12px 16px; border-right: 1px solid #e5ebe7; }
.result-stats-bar > div:last-child { border-right: 0; }
.result-stats-bar span, .result-stats-bar strong { display: block; }
.result-stats-bar span { color: var(--muted); font-size: 9px; }
.result-stats-bar strong { margin-top: 4px; font-size: 17px; }
.view-switch { width: fit-content; display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #f9fbfa; }
.view-tab { height: 30px; padding: 0 13px; border-radius: 7px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 650; }
.view-tab.active { color: var(--green); background: #e8f4ee; box-shadow: 0 1px 2px rgba(20,60,43,.08); }
.result-view { display: grid; grid-template-columns: minmax(430px, 1.32fr) minmax(410px, 1fr); gap: 13px; min-height: 540px; max-height: 72vh; }
.image-stage { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px; border-radius: 14px; background: linear-gradient(145deg, #13231f, #1a3029); overflow: auto; }
.annotated-image { position: relative; display: inline-block; max-width: 100%; line-height: 0; box-shadow: 0 18px 42px rgba(0,0,0,.22); }
.annotated-image img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(72vh - 72px); object-fit: contain; }
.annotated-image svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.detection-mark { cursor: pointer; }
.detection-box { fill: rgba(229, 62, 54, .045); stroke: #ef4037; stroke-width: 1.35; pointer-events: all; transition: fill .12s, stroke .12s; }
.detection-mark:hover .detection-box, .detection-mark.active .detection-box { fill: rgba(199, 243, 107, .2); stroke: var(--lime); stroke-width: 2.7; }
.box-number rect { fill: #ef4037; stroke: none; }
.box-number text { fill: #fff; font: 600 11px "Manrope", sans-serif; }
.detection-mark.active .box-number rect { fill: var(--green); }
.image-legend { width: 100%; margin-top: 9px; display: flex; align-items: center; justify-content: center; gap: 6px; color: rgba(255,255,255,.66); font-size: 9px; line-height: 1.4; }
.image-legend i { width: 12px; height: 8px; border: 1.5px solid #ef4037; }
.recall-panel { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.recall-title { height: 48px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #f7f9f8; font-size: 11px; font-weight: 650; }
.recall-title strong { min-width: 25px; padding: 3px 7px; border-radius: 7px; color: var(--green); background: var(--green-soft); font-size: 10px; text-align: center; }
.recall-table-wrap { min-height: 0; flex: 1; overflow: auto; }
.recall-table { width: 100%; min-width: 610px; border-collapse: collapse; font-size: 10px; }
.recall-table th { position: sticky; top: 0; z-index: 2; padding: 11px 9px; color: var(--muted); background: #f3f6f4; text-align: left; font-size: 9px; font-weight: 600; white-space: nowrap; }
.recall-table td { padding: 10px 9px; border-bottom: 1px solid #edf1ee; vertical-align: middle; }
.result-row { cursor: pointer; transition: background .12s; }
.result-row:hover, .result-row.active { background: #edf8f2; }
.result-row.active { box-shadow: inset 3px 0 var(--green); }
.row-index { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: #69756f; background: #eef2ef; font-size: 9px; font-weight: 700; }
.result-row.active .row-index { color: #fff; background: var(--green); }
.primary-key, .bbox-cell { color: #60716a; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.sku-image-url a { color: var(--green); font-weight: 650; text-decoration: none; white-space: nowrap; }
.sku-image-url a:hover { text-decoration: underline; }
.sku-image-cache { width: 66px; }
.sku-image-cache a { display: inline-flex; border-radius: 8px; }
.kb-image-thumb { width: 52px; height: 52px; display: block; border: 1px solid var(--line); border-radius: 8px; object-fit: contain; background: #f4f7f5; transition: transform .16s, box-shadow .16s; }
.kb-image-thumb:hover { transform: scale(1.08); box-shadow: 0 8px 20px rgba(18,48,37,.16); }
.kb-thumb-button {
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: zoom-in;
}
.image-preview-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  overflow: visible;
}
.image-preview-dialog::backdrop { background: rgba(12, 20, 17, .72); backdrop-filter: blur(8px); }
.image-preview-panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
  overflow: hidden;
}
.image-preview-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.image-preview-header strong { display: block; font-size: 15px; }
.image-preview-header p { margin: 4px 0 0; font-size: 12px; }
.image-preview-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.image-preview-stage {
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #101916;
  min-height: 360px;
}
.image-preview-stage img {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}
.sku-name { max-width: 165px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbox-cell { white-space: nowrap; font-size: 9px; }
.recall-table td.score { color: var(--green); font-variant-numeric: tabular-nums; font-weight: 700; }
.row-error { color: var(--red); background: var(--red-soft); }
.json-view { max-height: 68vh; margin: 0; padding: 18px; overflow: auto; border: 1px solid #dce5df; border-radius: 14px; color: #d9f6e8; background: #14251f; font: 10px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.error-message { margin: 0; padding: 15px; border-radius: 11px; color: #9f3939; background: var(--red-soft); font: 11px/1.6 monospace; }

.url-dialog { width: min(780px, 85vw); max-height: 72vh; padding: 0; border: 0; border-radius: 20px; box-shadow: 0 30px 90px rgba(14,39,30,.24); }
.url-dialog::backdrop { background: rgba(18,31,27,.38); backdrop-filter: blur(4px); }
.dialog-header { position: sticky; top: 0; padding: 21px 24px 16px; display: flex; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); }
.url-dialog ol { margin: 0; padding: 15px 24px 24px 50px; overflow-wrap: anywhere; color: #42524c; font: 11px/1.65 monospace; }
.url-dialog li { padding: 7px 8px; border-bottom: 1px solid #edf1ee; }
.toast { position: fixed; right: 25px; bottom: 25px; z-index: 40; padding: 12px 16px; color: #fff; background: #1d3029; border-radius: 11px; box-shadow: 0 15px 35px rgba(0,0,0,.18); font-size: 12px; transform: translateY(20px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.show { transform: translateY(0); opacity: 1; }
.hidden { display: none !important; }

/* Chenguang uses a cool blue visual identity while Lawson keeps the green theme. */
body.theme-chengguang {
  --ink: #17243a;
  --muted: #65738a;
  --line: #dce5f1;
  --paper: #f3f7fc;
  --green: #2563a9;
  --green-dark: #184578;
  --green-soft: #e4effb;
  --lime: #76c7f4;
  --shadow: 0 24px 70px rgba(35, 82, 137, 0.1);
}

.theme-chengguang .ambient-one {
  background: radial-gradient(circle, rgba(79, 151, 225, .25), rgba(79, 151, 225, 0) 70%);
}
.theme-chengguang .ambient-two {
  background: radial-gradient(circle, rgba(85, 191, 226, .18), rgba(85, 191, 226, 0) 70%);
}
.theme-chengguang .topbar {
  border-bottom-color: rgba(202, 216, 233, .8);
  background: rgba(247, 250, 254, .84);
}
.theme-chengguang .brand-tabs { box-shadow: 0 7px 22px rgba(35, 82, 137, .07); }
.theme-chengguang .brand-mark {
  background: #173f70;
  box-shadow: 0 8px 22px rgba(30, 78, 130, .2);
}
.theme-chengguang .status-pill.online {
  color: #2563a9;
  border-color: #c8dcf2;
  background: #eef6ff;
}
.theme-chengguang .status-pill.online i {
  background: #3988d5;
  box-shadow: 0 0 0 4px rgba(57, 136, 213, .13);
}
.theme-chengguang .config-panel {
  border-color: rgba(211, 224, 239, .95);
  box-shadow: 0 18px 50px rgba(35, 82, 137, .06);
}
.theme-chengguang .field-group input:focus,
.theme-chengguang .field-group select:focus,
.theme-chengguang .request-prefix input:focus,
.theme-chengguang textarea:focus {
  border-color: #6ba1d8;
  box-shadow: 0 0 0 3px rgba(55, 125, 196, .11);
}
.theme-chengguang .service-card {
  border-color: #d1e2f4;
  background: linear-gradient(135deg, #eaf3fd, #f8fbff);
}
.theme-chengguang .service-icon { background: #d8e9f9; }
.theme-chengguang .card { border-color: rgba(209, 222, 238, .94); }
.theme-chengguang .secondary-button:hover {
  border-color: #b8cee5;
  background: #f6faff;
}
.theme-chengguang .url-editor { background: #fbfdff; }
.theme-chengguang .url-editor.dragging {
  background: #eff7ff;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 169, .1);
}
.theme-chengguang .primary-button {
  box-shadow: 0 10px 22px rgba(37, 99, 169, .24);
}
.theme-chengguang .primary-button:not(:disabled):hover {
  box-shadow: 0 13px 28px rgba(37, 99, 169, .3);
}
.theme-chengguang .progress-track span {
  background: linear-gradient(90deg, #245d9d, #4b91d2, #76c7f4);
}
.theme-chengguang .view-tab.active { background: #e7f1fb; }
.theme-chengguang .result-row:hover,
.theme-chengguang .result-row.active { background: #edf5fd; }
.theme-chengguang .image-stage {
  background: linear-gradient(145deg, #14243a, #183552);
}
.theme-chengguang .json-view {
  color: #d8ecff;
  background: #14243a;
}
.theme-chengguang .toast { background: #183552; }

.main-nav {
  position: absolute;
  left: 50%;
  top: 22px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.84);
  box-shadow: 0 7px 22px rgba(30,55,45,.06);
}
.main-nav a {
  height: 34px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
}
.main-nav a.active,
.main-nav a:hover {
  color: var(--green);
  background: var(--green-soft);
}
.brand-tabs.compact {
  position: static;
  transform: none;
  margin-top: 14px;
}
.topbar.with-nav .brand-tabs {
  display: none;
}

.manage-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 34px 80px;
}
.manage-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.manage-header h1,
.detail-title-row h1 {
  margin: 8px 0 8px;
  font-size: 32px;
  letter-spacing: -.035em;
}
.manage-header p,
.detail-header p {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.manage-card { padding: 22px 24px; }
.manage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.manage-toolbar input[type="search"],
.manage-toolbar select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.manage-toolbar input[type="search"] { min-width: 240px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.manage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.manage-table th,
.manage-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e8eeea;
  text-align: left;
  vertical-align: top;
}
.manage-table th {
  color: var(--muted);
  background: #f7faf8;
  font-size: 11px;
  font-weight: 700;
}
.manage-table tr:last-child td { border-bottom: 0; }
.table-sub { margin-top: 4px; color: var(--muted); font-size: 11px; }
.table-empty { text-align: center; color: var(--muted); padding: 36px 14px !important; }
.table-actions { white-space: nowrap; }
.manage-table code {
  font-family: "Manrope", monospace;
  font-size: 11px;
  color: #345247;
}
.kb-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}
.kb-badge.system { color: #245d9d; background: #e7f1fb; }
.kb-badge.user { color: var(--green); background: var(--green-soft); }
.kb-badge.available { color: #176b52; background: #e2f2eb; }
.kb-badge.updating { color: #9a6b12; background: #fff4d8; }
.kb-badge.unavailable { color: var(--red); background: var(--red-soft); }
.kb-badge.empty { color: #68756f; background: #edf1ef; }
.danger-text { color: var(--red) !important; }
.detail-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-actions { display: flex; gap: 8px; }
.back-link { display: inline-flex; margin-bottom: 8px; padding-left: 0; }
.detail-summary { margin-bottom: 18px; }
.form-dialog {
  width: min(560px, calc(100vw - 40px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(25, 56, 44, 0.18);
}
.form-dialog::backdrop { background: rgba(18, 28, 24, .35); }
.form-dialog form { padding: 22px; }
.form-grid { display: grid; gap: 14px; margin-top: 8px; }
.form-grid label { display: grid; gap: 7px; font-size: 12px; font-weight: 650; }
.form-grid input,
.form-grid textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
.form-hint { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.dialog-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 600 !important;
}
.checkbox-row input { width: auto; }
.library-select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.library-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.field-caption {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.kb-current-card {
  margin-top: 8px;
  padding: 16px;
  border: 1px solid #d7e9df;
  border-radius: 16px;
  background: linear-gradient(145deg, #edf8f2, #f8fbf9);
}

.kb-current-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.kb-current-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.kb-current-card > strong {
  display: block;
  font-size: 18px;
  letter-spacing: -.02em;
  line-height: 1.3;
}

.kb-current-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.kb-current-stats {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #d5e5dc;
  color: #345247;
  font-size: 12px;
  font-weight: 650;
}

.kb-current-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.library-picker-dialog {
  width: min(640px, calc(100vw - 48px));
  max-height: min(80vh, 720px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(14, 39, 30, .24);
  overflow: hidden;
}
.library-picker-dialog[open] {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
  max-height: min(80vh, 720px);
}
.library-picker-dialog::backdrop {
  background: rgba(18, 31, 27, .38);
  backdrop-filter: blur(4px);
}
.library-picker-dialog .dialog-header {
  flex: 0 0 auto;
  align-items: flex-start;
  padding: 20px 22px 14px;
}
.library-picker-dialog .dialog-header h3 {
  margin: 4px 0 0;
  font-size: 18px;
  letter-spacing: -.02em;
}
.picker-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
}
.picker-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 22px 8px;
}
.picker-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px 108px;
  gap: 8px;
  flex: 0 0 auto;
}
.picker-toolbar input,
.picker-toolbar select {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
.library-picker-list {
  flex: 1 1 auto;
  min-height: 180px;
  max-height: none;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding: 2px 2px 8px;
}
.picker-item {
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: inherit;
  box-shadow: none;
}
.picker-item:hover:not(:disabled) {
  border-color: #9fcbb7;
  background: #f7fcf9;
}
.picker-item.selected {
  border-color: #62a88d;
  box-shadow: 0 0 0 3px rgba(62, 139, 109, .12);
  background: #f2faf6;
}
.picker-item:disabled,
.picker-item.disabled {
  opacity: .55;
  cursor: not-allowed;
}
.picker-item-main {
  min-width: 0;
  flex: 1 1 auto;
}
.picker-item-main strong,
.picker-item-main span {
  display: block;
}
.picker-item-main strong {
  margin-bottom: 4px;
  font-size: 14px;
}
.picker-item-main span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.picker-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}
.picker-item-side small {
  color: var(--muted);
  font-size: 10px;
}
.picker-empty {
  padding: 48px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.picker-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
  background: #fbfdfc;
}
@media (max-width: 720px) {
  .picker-toolbar {
    grid-template-columns: 1fr;
  }
}

.jobs-panel {
  margin-bottom: 18px;
  padding: 20px 22px;
}
.jobs-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}
.job-row {
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
}
.job-row:hover { border-color: #9fcbb7; background: #f7fcf9; }
.job-row.active {
  border-color: #62a88d;
  box-shadow: 0 0 0 3px rgba(62, 139, 109, .1);
  background: #f2faf6;
}
.job-row strong,
.job-row span { display: block; }
.job-row strong { font-size: 13px; margin-bottom: 3px; }
.job-row span { color: var(--muted); font-size: 11px; }
.job-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.job-row-side small { color: var(--muted); font-size: 11px; }

.theme-chengguang .kb-current-card {
  border-color: #c9ddf2;
  background: linear-gradient(145deg, #eef5fc, #f8fbfe);
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .3; } }

@media (max-width: 1200px) {
  .shell { grid-template-columns: 300px minmax(720px, 1fr); gap: 24px; padding-left: 24px; padding-right: 24px; }
  .config-panel { padding: 23px; }
}

@media (max-width: 1380px) {
  .result-view { grid-template-columns: minmax(400px, 1.15fr) minmax(360px, 1fr); }
}

.csv-import-hint{margin:0 0 14px;font-size:13px}
.csv-import-hint code{font-size:12px}
