:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --line: #dce3e8;
  --text: #15202b;
  --muted: #667481;
  --green: #0f9f78;
  --green-dark: #08765a;
  --blue: #2f6fed;
  --amber: #e99518;
  --red: #e6484f;
  --nav: #0c2731;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; letter-spacing: 0; }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.download-button { display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border: 1px solid #cbd7e8; border-radius: 7px; background: #fff; color: #224a87; font-size: 13px; font-weight: 600; text-decoration: none; }
.download-button:hover { border-color: #4774d9; background: #f4f7ff; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 210px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--nav); color: #edf8f5; padding: 22px 14px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; background: var(--green); color: white; font-weight: 800; font-size: 18px; border-radius: 7px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 3px; color: #9bb3bb; font-size: 11px; }
nav { display: grid; gap: 4px; }
.nav-item { border: 0; background: transparent; color: #bdd0d5; padding: 11px 13px; text-align: left; border-radius: 6px; }
.nav-item span { display: inline-block; width: 28px; color: #8eabb2; }
.nav-item:hover { background: #123744; color: white; }
.nav-item.active { background: #155044; color: white; font-weight: 700; }
.nav-item.active span { color: #5ee0b6; }
.sidebar-summary { margin-top: auto; padding: 15px 12px; border-top: 1px solid #28434c; }
.sidebar-summary p { margin: 0 0 10px; color: #89a5ad; font-size: 12px; }
.sidebar-summary div { display: flex; justify-content: space-between; padding: 5px 0; color: #c8d8dc; font-size: 12px; }
.sidebar-summary strong { color: white; }
.local-badge { margin: 8px 12px 0; color: #9bb3bb; font-size: 11px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 7px; background: #98a3ad; }
.status-dot.online { background: #2ed394; box-shadow: 0 0 0 3px rgba(46,211,148,.12); }
main { min-width: 0; padding: 0 24px 32px; }
.topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.topbar h1 { margin: 0; font-size: 21px; }
.topbar p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.balance-chip { color: var(--green-dark); font-size: 12px; font-weight: 800; white-space: nowrap; }
.balance-chip.insufficient { color: var(--red) !important; }
.balance-chip.balance-low-warning, .balance-low-warning { color: #b36b00 !important; font-weight: 700; }
.balance-warning-text { color: var(--red) !important; font-weight: 800; }
.last-update { color: var(--muted); font-size: 12px; }
.icon-button { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); background: white; border-radius: 6px; font-size: 19px; }
.page { display: none; }
.page.active { display: block; }
.service-band { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); background: white; border: 1px solid var(--line); margin-bottom: 14px; }
.analytics-section { margin-bottom: 14px; }
.analytics-filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.analytics-filter input { min-height: 30px; padding: 4px 7px; }
.analytics-filter button { min-height: 30px; padding: 4px 9px; }
.analytics-cards { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 10px; margin-top: 13px; }
.analytics-card { min-height: 82px; padding: 14px; background: #f7faf9; border: 1px solid #dcebe6; border-radius: 6px; }
.analytics-card small { display: block; color: var(--muted); font-size: 11px; }
.analytics-card strong { display: block; margin-top: 8px; color: var(--green-dark); font-size: 19px; overflow-wrap: anywhere; }
.analytics-models { margin-top: 14px; }
.analytics-models h3 { margin: 0 0 8px; font-size: 13px; }
.analytics-models summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 700; user-select: none; }
.analytics-models summary span { margin-left: 8px; color: var(--muted); font-size: 11px; font-weight: 400; }
.analytics-models[open] summary { margin-bottom: 8px; color: var(--green-dark); }
.analytics-models[open] summary span { display: none; }
.analytics-model-row { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(65px, .6fr)) minmax(135px, 1fr) minmax(160px, 1.3fr) minmax(100px, .8fr); gap: 8px; padding: 9px 11px; border-top: 1px solid var(--line); font-size: 12px; }
.analytics-model-row > * { min-width: 0; overflow-wrap: anywhere; }
.analytics-model-row small { display: block; margin-top: 4px; }
.analytics-model-note { color: var(--muted); font-size: 12px; padding: 8px 11px; }
@media (max-width: 1150px) { .analytics-model-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } .analytics-model-row strong { grid-column: 1 / -1; } }
.analytics-model-row span { color: var(--muted); }
.analytics-empty { color: var(--muted); font-size: 12px; }
.service-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-right: 1px solid var(--line); }
.service-item:last-child { border-right: 0; }
.service-item .service-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: #edf4ff; color: var(--blue); font-weight: 800; }
.service-item.running .service-icon { background: #e7f8f2; color: var(--green); }
.service-info { min-width: 0; flex: 1; }
.service-info strong, .service-info small { display: block; }
.service-info small { color: var(--muted); margin-top: 3px; font-size: 11px; }
.service-action { border: 1px solid var(--line); background: white; border-radius: 5px; padding: 6px 10px; }
.service-item.running .service-action { color: var(--red); }
.toolbar, .model-toolbar, .log-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.toolbar-group { display: flex; gap: 8px; }
button, select, input { min-height: 34px; border: 1px solid #cfd9df; background: white; color: var(--text); border-radius: 5px; padding: 6px 11px; }
button:hover { border-color: #9eafb9; background: #f8fafb; }
button.primary { background: var(--blue); border-color: var(--blue); color: white; font-weight: 700; }
button.warning { background: var(--amber); border-color: var(--amber); color: white; font-weight: 700; }
button.danger { color: var(--red); border-color: #f1b4b8; }
.dialog-note { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 0; }
.resolved-folder { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.resolved-folder strong { color: var(--green-dark); font-weight: 600; }
input[type="search"] { width: 250px; }
.table-wrap { background: white; border: 1px solid var(--line); overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th { height: 42px; background: #f7f9fa; color: #53626e; font-size: 12px; text-align: left; border-bottom: 1px solid var(--line); padding: 0 12px; }
td { height: 54px; padding: 7px 12px; border-bottom: 1px solid #edf1f3; white-space: nowrap; }
tbody tr:hover { background: #f8fbfb; }
.check-col { width: 42px; text-align: center; }
input[type="checkbox"] { min-height: auto; accent-color: var(--green); }
.task-name { font-weight: 700; }
.task-name small { display: block; margin-top: 3px; color: var(--muted); font-weight: 400; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #99a4ad; }
.status.running { color: var(--green-dark); }
.status.running::before { background: var(--green); }
.status.error { color: var(--red); }
.status.error::before { background: var(--red); }
.status.balance-warning { color: var(--red); font-weight: 800; }
.status.balance-warning::before { background: var(--red); }
.progress { width: 108px; }
.progress-track { height: 7px; background: #e8edf0; border-radius: 4px; overflow: hidden; }
.progress-track span { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.progress.blue .progress-track span { background: var(--blue); }
.progress.amber .progress-track span { background: var(--amber); }
.progress small { display: block; margin-top: 4px; color: var(--muted); text-align: right; font-size: 10px; }
.row-actions { display: flex; gap: 5px; }
.row-actions button { min-height: 30px; padding: 4px 9px; }
.empty-state { padding: 70px 20px; text-align: center; color: var(--muted); }
.hidden { display: none !important; }
.model-toolbar { align-items: end; background: white; border: 1px solid var(--line); padding: 12px 14px; }
.model-toolbar label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.model-toolbar select { min-width: 180px; }
.global-policy-label strong, .global-policy-label small { display: block; }
.global-policy-label small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.segmented { display: flex; padding: 3px; background: #edf1f4; border-radius: 6px; }
.segmented button { border: 0; background: transparent; min-height: 30px; }
.segmented button.active { background: white; box-shadow: 0 1px 3px rgba(24,38,48,.12); color: var(--green-dark); font-weight: 700; }
.policy-layout { display: grid; grid-template-columns: minmax(420px, 1.2fr) minmax(340px, .8fr); gap: 14px; }
.plain-section { background: white; border: 1px solid var(--line); padding: 16px; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0; font-size: 15px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.collection-task-summary { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 8px 0; color: #62758d; font-size: 12px; border-bottom: 1px solid var(--line); }
.collection-task-summary span { color: #2a415f; font-weight: 700; }
.collection-task-summary strong { padding: 4px 9px; background: #eef8f8; color: #268f98; border-radius: 4px; font-size: 12px; }
.collection-task-summary small { margin-left: auto; color: #8090a4; }
.priority-list, .model-catalog { display: grid; gap: 8px; margin-top: 12px; }
.priority-item, .catalog-item { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid var(--line); padding: 10px; background: #fff; }
.priority-item { cursor: grab; position: relative; }
.priority-item:active { cursor: grabbing; }
.priority-item.dragging { opacity: .45; }
.priority-item.drop-before::before, .priority-item.drop-after::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--green); z-index: 2; }
.priority-item.drop-before::before { top: -6px; }
.priority-item.drop-after::after { bottom: -6px; }
.rank { width: 27px; height: 27px; display: grid; place-items: center; background: #eaf7f2; color: var(--green-dark); font-weight: 800; border-radius: 5px; }
.model-meta { min-width: 0; }
.model-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-meta small { display: block; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.priority-item .model-meta small { white-space: normal; overflow: visible; overflow-wrap: anywhere; text-overflow: clip; }
.priority-item details { margin-top: 6px; cursor: auto; }
.priority-item details[open] { max-height: 360px; overflow: auto; }
.priority-item summary { cursor: pointer; }
@media (max-width: 600px) {
  .priority-item { grid-template-columns: 24px minmax(0, 1fr); align-items: start; }
  .priority-item .item-tools { grid-column: 2; justify-content: flex-end; }
}
.provider { display: inline-block; margin-left: 6px; padding: 2px 5px; background: #eef2f6; color: #5a6974; border-radius: 3px; font-size: 9px; text-transform: uppercase; }
.item-tools { display: flex; gap: 4px; }
.item-tools button { width: 30px; min-height: 28px; padding: 0; }
.save-bar { width: 100%; margin-top: 12px; background: var(--green); border-color: var(--green); color: white; font-weight: 700; }
.catalog-section { max-height: calc(100vh - 175px); overflow: auto; }
.catalog-item { grid-template-columns: minmax(0, 1fr) auto; }
.log-toolbar { justify-content: flex-start; }
.switch-label { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.log-view { margin: 0; min-height: calc(100vh - 155px); max-height: calc(100vh - 155px); overflow: auto; background: #10191e; color: #d8e4e7; border: 1px solid #24343c; padding: 16px; font: 12px/1.65 Consolas, "Microsoft YaHei", monospace; white-space: pre-wrap; word-break: break-word; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.full-width { grid-column: 1 / -1; }
.settings-form { display: grid; gap: 10px; margin-top: 14px; }
.settings-form.two-column { grid-template-columns: 1fr 1fr; }
.settings-form label, #task-form > label, .two-fields label { display: grid; gap: 5px; color: #53626e; font-size: 11px; }
.settings-form input { width: 100%; }
.settings-form .cleanup-toggle { display: flex; align-items: center; gap: 8px; min-height: 34px; color: var(--text); font-size: 12px; }
.settings-form .cleanup-toggle input { width: auto; }
.xpath-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.xpath-toolbar .segmented { max-width: calc(100vw - 520px); overflow-x: auto; }
.xpath-editor { display: grid; gap: 10px; }
.xpath-block { background: white; border: 1px solid var(--line); }
.xpath-block summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #f8fafb; font-weight: 700; }
.xpath-block summary::after { content: "+"; color: var(--muted); font-size: 18px; }
.xpath-block[open] summary::after { content: "−"; }
.xpath-rows { display: grid; gap: 7px; padding: 12px 14px; border-top: 1px solid var(--line); }
.xpath-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 34px; gap: 7px; align-items: center; }
.xpath-row span { text-align: center; color: var(--muted); font-size: 11px; }
.xpath-row input { width: 100%; font-family: Consolas, "Microsoft YaHei", monospace; font-size: 12px; }
.xpath-row button { width: 34px; min-height: 34px; padding: 0; color: var(--red); }
.add-xpath { justify-self: start; }
#task-form { padding: 18px; display: grid; gap: 12px; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.project-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: stretch;
  gap: 10px 16px;
}
.project-options > small { grid-column: 1 / -1; color: var(--muted); line-height: 1.5; }
.path-list { margin: 12px 0 0; }
.path-list div { display: grid; grid-template-columns: 95px minmax(0, 1fr); padding: 10px 0; border-bottom: 1px solid #edf1f3; }
.path-list dt { color: var(--muted); }
.path-list dd { margin: 0; word-break: break-all; }
.notice-list p { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.notice-list span { width: 24px; height: 24px; display: grid; place-items: center; background: #eaf4ff; color: var(--blue); border-radius: 50%; font-weight: 800; }
dialog { width: min(520px, calc(100vw - 30px)); border: 0; padding: 0; box-shadow: 0 18px 60px rgba(13,31,40,.28); }
dialog::backdrop { background: rgba(7,24,32,.48); }
#user-modules-dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border-radius: 8px; overflow-x: hidden; overflow-y: auto; }
#user-modules-form { margin: 0; padding: 24px; gap: 14px; min-width: 0; }
#user-modules-form h2 { margin: 0; font-size: 19px; }
#user-modules-form p { margin: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.6; color: var(--muted); font-size: 13px; }
#user-modules-form .check-label,
#admin-create-user-form .user-module-options .check-label { display: flex; flex-direction: row; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; font-size: 14px; color: var(--text); }
#user-modules-form .check-label { border: 1px solid var(--line); border-radius: 6px; background: #f8fafb; }
#user-modules-form .check-label input,
#admin-create-user-form .user-module-options .check-label input { width: 16px; height: 16px; min-height: 0; flex: 0 0 16px; margin: 0; padding: 0; }
#user-modules-form .dialog-actions { flex-wrap: wrap; padding-top: 16px; margin-top: 2px; border-top: 1px solid var(--line); }
#admin-create-user-form .user-module-options { min-width: 0; border: 1px solid var(--line); border-radius: 6px; }
#admin-create-user-form .user-module-options p { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; color: var(--muted); }
#task-directories-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-x: hidden; overflow-y: auto; }
#task-directories-form { padding: 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; width: 100%; min-width: 0; }
#task-directories-form > label { display: grid; min-width: 0; gap: 7px; color: #42535d; font-size: 13px; font-weight: 600; }
#task-directories-form > label > input { width: 100%; min-height: 40px; padding: 8px 12px; font-size: 13px; }
#task-directories-form .dialog-header { margin-bottom: 2px; }
#task-directories-form .dialog-header > div { min-width: 0; overflow-wrap: anywhere; }
#task-directories-form .dialog-actions { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 2px; flex-wrap: wrap; }
#model-form { padding: 18px; display: grid; gap: 12px; }
#task-account-dialog { width: min(560px, calc(100vw - 30px)); }
#task-account-form { padding: 22px; display: grid; gap: 14px; }
#quick-recharge-dialog { width: min(460px, calc(100vw - 30px)); }
.quick-recharge-form { padding: 22px; display: grid; gap: 16px; }
.quick-recharge-form > label { display: grid; gap: 6px; color: #4f5e68; font-size: 12px; font-weight: 600; }
.quick-recharge-form input { width: 100%; }
#task-account-form > label { display: grid; gap: 6px; color: #4f5e68; font-size: 12px; font-weight: 600; }
#task-account-form > label > input,
#task-account-form > label > select { width: 100%; min-height: 38px; }
#task-account-form .dialog-actions { margin-top: 2px; padding-top: 14px; border-top: 1px solid var(--line); }
.dialog-header { display: flex; justify-content: space-between; align-items: start; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.dialog-header h2 { margin: 0; font-size: 18px; }
.dialog-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
#model-form > label { display: grid; gap: 5px; font-size: 12px; color: #4f5e68; }
#model-form > label small { color: var(--muted); font-weight: 400; line-height: 1.45; }
fieldset { border: 1px solid var(--line); display: flex; gap: 20px; }
legend { color: var(--muted); font-size: 11px; }
.check-label { display: flex; align-items: center; gap: 6px; }
#task-form > label.source-preference { display: flex; grid-template-columns: none; align-items: flex-start; gap: 8px; width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: #f8fbfa; color: var(--text); font-size: 12px; }
#task-form > label.source-preference input { width: auto; margin-top: 2px; }
#task-form > label.source-preference span { display: grid; gap: 4px; }
#task-form > label.source-preference small { color: var(--muted); line-height: 1.45; }
#task-form > label.start-now-preference { display: flex; grid-template-columns: none; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: #f8fbfa; color: var(--text); font-size: 12px; }
#task-form > label.start-now-preference input { width: auto; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }

.collection-flow-job { padding: 13px 16px 16px; border-bottom: 1px solid #e7edf5; }
.collection-flow-head { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 13px; }
.collection-flow-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collection-flow-head small { color: #61718a; white-space: nowrap; }
.collection-flow { display: flex; align-items: flex-start; width: 100%; }
.collection-flow-step { display: grid; justify-items: center; gap: 6px; min-width: 68px; color: #94a2af; font-size: 11px; }
.collection-flow-step i { width: 11px; height: 11px; border: 2px solid currentColor; border-radius: 50%; background: #fff; box-sizing: border-box; }
.collection-flow-step b { font-weight: 600; white-space: nowrap; }
.collection-flow-step.active { color: #4f7df3; }
.collection-flow-step.active i { background: currentColor; box-shadow: 0 0 0 4px rgba(79,125,243,.12); }
.collection-flow-step.done { color: #35a87c; }
.collection-flow-step.done i { background: currentColor; }
.collection-flow-step.failed { color: #dc5a5a; }
.collection-flow-step.failed i { background: currentColor; }
.collection-flow em { flex: 1; height: 2px; min-width: 18px; margin-top: 5px; background: #dbe4ec; }
.collection-flow em.done { background: #35a87c; }
.collection-total-line { height: 7px; min-width: 100%; border-radius: 999px; overflow: hidden; background: #dbe4ec; }
.collection-total-line span { display: block; height: 100%; border-radius: inherit; background: #35a87c; transition: width .35s; }

/* 公共采集箱：确认任务窗口独立排版，避免内容贴边、说明与按钮拥挤。 */
#collection-start-dialog { width: min(560px, calc(100vw - 30px)); border-radius: 8px; overflow: hidden; }
#collection-start-form { display: grid; gap: 13px; padding: 22px; }
#collection-start-form .dialog-header { margin: -22px -22px 2px; padding: 18px 22px 14px; }
#collection-start-form .check-label { min-height: 40px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
#collection-start-form .disabled-option { color: var(--muted); background: #f7f9fa; cursor: not-allowed; }
#collection-start-form .dialog-note { margin: 0; padding: 10px 12px; border-left: 3px solid #78b9ac; background: #f2faf8; color: #50616a; font-size: 12px; line-height: 1.55; }
#collection-start-form .dialog-actions { margin-top: 2px; padding-top: 15px; border-top: 1px solid var(--line); }
.toast { position: fixed; right: 22px; bottom: 22px; background: #18313a; color: white; padding: 11px 15px; border-radius: 6px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .18s ease; box-shadow: 0 8px 25px rgba(0,0,0,.2); }
.rule-options { display: flex; flex-wrap: wrap; gap: 12px 20px; padding: 14px 0; }
.translation-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.translation-columns label { display: flex; flex-direction: column; gap: 6px; }
.translation-columns small { color: #70818a; font-weight: 400; }
@media (max-width: 900px) { .translation-columns { grid-template-columns: 1fr; } }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #a92f36; }
.policy-actions { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.policy-actions label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.policy-actions input { width: 58px; min-height: 32px; padding: 4px 6px; text-align: center; }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding: 16px 8px; }
  .brand { padding: 0 10px 20px; }
  .brand div, .nav-item:not(.active)::after, .nav-item { font-size: 0; }
  .nav-item span { width: auto; font-size: 19px; text-align: center; display: block; }
  .sidebar-summary, .local-badge { display: none; }
  main { padding: 0 14px 24px; }
  .policy-layout, .settings-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
}
@media (max-width: 600px) {
  #task-directories-dialog { width: calc(100vw - 20px); }
  #task-directories-form { padding: 18px; }
}
@media (max-width: 700px) {
  #task-account-form { padding: 18px; }
  .service-band { grid-template-columns: 1fr; }
  .service-item { border-right: 0; border-bottom: 1px solid var(--line); }
  .toolbar, .model-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-group { width: 100%; }
  .toolbar-group input, .toolbar-group select { min-width: 0; flex: 1; }
  .last-update { display: none; }
  .settings-form.two-column, .two-fields { grid-template-columns: 1fr; }
  .xpath-toolbar { align-items: stretch; flex-direction: column; }
  .xpath-toolbar .segmented { max-width: 100%; }
}
.model-test-result { margin-top: 4px; font-weight: 600; }
.model-test-result.ok { color: #059669; }
.model-test-result.error { color: #dc2626; }
.parameter-hint { margin: 4px 0 14px; color: #64748b; font-size: 13px; }
.account-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.account-toolbar strong, .account-toolbar small { display: block; }
.account-toolbar small { margin-top: 4px; color: var(--muted); font-size: 11px; }
#total-browser-cache { align-self: center; color: var(--green-dark); font-weight: 700; font-size: 12px; }
.account-table { min-width: 1420px; }
.account-table td { height: 66px; }
.account-table input, .account-table select { width: 100%; min-width: 130px; }
.account-table td:nth-child(1) { min-width: 80px; }
.account-table td:nth-child(2) { min-width: 170px; }
.account-table td:nth-child(3) { min-width: 180px; }
.account-table td:nth-child(4) { min-width: 150px; }
.account-table td:nth-child(5) { min-width: 170px; }
.account-table td:nth-child(6), .account-table td:nth-child(7) { min-width: 110px; }
.account-table td small { display: block; max-width: 140px; margin-top: 4px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.running-label { color: var(--green-dark) !important; }
.storage-size, .cache-size { font-weight: 700; }
.cache-size { color: var(--amber); }
.row-actions { display: flex; gap: 6px; }
.row-actions button { min-height: 30px; padding: 4px 9px; }
.loading-cell { height: 110px; text-align: center; color: var(--muted); }
.account-safety-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
button:disabled { cursor: not-allowed; opacity: .48; }
@media (max-width: 700px) {
  .account-toolbar { align-items: stretch; flex-direction: column; }
}

/* 翻译设置里的图片 OCR 规则子区块 */
.nested-heading { margin-top: 22px; }
.nested-heading h3 { margin: 0; font-size: 14px; }
.nested-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }

/* ===================== 可配置运行步骤 / XPath 中文化 ===================== */
.workflow-help { margin: 0 0 12px; padding: 10px 12px; border: 1px solid #cfe6df; border-radius: 8px; background: #f4fbf9; color: #38635a; font-size: 12px; line-height: 1.65; }
.workflow-section, .xpath-rule-section { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.workflow-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.workflow-section-heading h2 { margin: 0; font-size: 15px; }
.workflow-section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.workflow-section-heading > span { white-space: nowrap; color: var(--muted); font-size: 11px; }
.workflow-timeline { display: grid; gap: 0; }
.workflow-insert { justify-self: stretch; min-height: 26px; margin: 3px 42px; border: 1px dashed #b7c9cf; background: #fbfdfd; color: #52717a; opacity: .72; }
.workflow-insert:hover { opacity: 1; border-color: var(--green); color: var(--green-dark); background: #f1fbf8; }
.workflow-insert span { font-weight: 900; }
.workflow-step { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; gap: 10px; align-items: center; min-height: 62px; padding: 10px 12px; border: 1px solid #dbe5e8; border-radius: 8px; background: #fff; }
.workflow-step.system { background: #f8fafb; }
.workflow-step.custom { border-color: #a8d8cb; box-shadow: inset 3px 0 0 #2f9b84; }
.workflow-step.disabled { opacity: .48; }
.workflow-step-number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #e8f3f0; color: var(--green-dark); font-size: 11px; font-weight: 800; }
.workflow-step-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.workflow-step-title strong { font-size: 13px; }
.workflow-step-main small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.workflow-action-badge { padding: 2px 7px; border-radius: 999px; background: #edf3f5; color: #4f6670; font-size: 10px; font-weight: 700; }
.workflow-step.custom .workflow-action-badge { background: #e8f7f2; color: #16705d; }
.workflow-step-tools { display: flex; align-items: center; gap: 5px; }
.workflow-step-tools button { min-height: 30px; padding: 4px 8px; font-size: 11px; }
.workflow-locked { padding: 3px 7px; border-radius: 6px; background: #eef2f4; color: #75858d; font-size: 10px; }
.danger-text { color: var(--red) !important; }
.xpath-rule-section { margin-top: 2px; }
.xpath-rule-list { display: grid; gap: 8px; }
.xpath-toolbar-actions { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.draft-status { padding: 5px 9px; border: 1px solid #d6e1e5; border-radius: 5px; background: #f8fafb; color: #62757d; font-size: 11px; white-space: nowrap; }
.draft-status.dirty { border-color: #f0c36f; background: #fff9e9; color: #a66500; font-weight: 700; }
.workflow-table-wrap, .xpath-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.workflow-table, .xpath-table { width: 100%; min-width: 940px; border-collapse: collapse; background: #fff; }
.workflow-table th, .xpath-table th { padding: 9px 10px; background: #eef6f4; color: #285b50; border-bottom: 1px solid #cfe0dc; font-size: 11px; font-weight: 800; text-align: left; white-space: nowrap; }
.workflow-table td, .xpath-table td { padding: 8px 10px; border-bottom: 1px solid #e4ecef; vertical-align: top; font-size: 12px; line-height: 1.45; }
.workflow-table tbody tr:last-child td, .xpath-table tbody tr:last-child td { border-bottom: 0; }
.workflow-table .system-row { background: #fbfcfd; }
.workflow-table .custom-row { background: #f7fcfa; }
.workflow-table .disabled-row { opacity: .5; }
.workflow-table td:nth-child(1) { width: 48px; color: var(--muted); text-align: center; }
.workflow-table td:nth-child(2) { width: 68px; }
.workflow-table td:nth-child(3) { min-width: 170px; }
.workflow-table td:nth-child(4) { min-width: 150px; }
.workflow-table td:nth-child(5) { min-width: 250px; color: #5d6c74; }
.workflow-table td:nth-child(6) { width: 170px; white-space: nowrap; }
.workflow-table small, .xpath-table small { display: block; margin-top: 3px; color: var(--muted); font: 10px/1.35 Consolas, "Microsoft YaHei", monospace; word-break: break-all; }
.workflow-table button, .xpath-table button { min-height: 28px; margin-right: 4px; padding: 3px 8px; font-size: 11px; }
.workflow-insert-row td { padding: 3px !important; background: #fff; }
.workflow-insert { width: 100%; min-height: 26px; margin: 0; border: 1px dashed #b7c9cf; background: #fbfdfd; color: #52717a; opacity: .72; }
.workflow-insert:hover { opacity: 1; border-color: var(--green); color: var(--green-dark); background: #f1fbf8; }
.xpath-table td:first-child { width: 250px; background: #fbfcfd; }
.xpath-table td:nth-child(2) { width: 72px; text-align: center; color: var(--muted); }
.xpath-table td:nth-child(3) { min-width: 510px; }
.xpath-table td:nth-child(4) { width: 170px; white-space: nowrap; }
.xpath-table input { width: 100%; min-width: 440px; font: 12px Consolas, "Microsoft YaHei", monospace; }
.xpath-sequence-table { min-width: 980px; }
.xpath-sequence-table td:first-child { width: 84px; background: #f7faf9; color: var(--green-dark); text-align: center; white-space: nowrap; }
.xpath-sequence-table td:nth-child(2) { width: 280px; min-width: 240px; text-align: left; color: inherit; }
.xpath-sequence-table td:nth-child(3) { min-width: 520px; }
.xpath-sequence-table td:nth-child(4) { width: 150px; white-space: nowrap; }
.xpath-sequence-table input { min-width: 500px; }
.xpath-sequence-table .xpath-name-input { min-width: 210px; font-family: "Microsoft YaHei", sans-serif; font-weight: 700; }
.xpath-sequence-table .custom-row { background: #f4fbf8; box-shadow: inset 3px 0 0 var(--green); }
.empty-cell { padding: 26px !important; color: var(--muted); text-align: center; }
.workflow-step-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
#workflow-step-form { padding: 20px; display: grid; gap: 14px; }
.workflow-action-picker { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; }
.workflow-action-picker button { min-height: 32px; padding: 5px 10px; }
.workflow-action-picker button.active { background: var(--green); border-color: var(--green); color: #fff; }
.workflow-step-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.workflow-step-form-grid > label { display: grid; gap: 5px; color: #53626e; font-size: 11px; font-weight: 600; }
.workflow-step-form-grid .span-2 { grid-column: 1 / -1; }
.workflow-step-form-grid input, .workflow-step-form-grid select { width: 100%; }
.workflow-step-form-grid .check-label { display: flex; align-items: center; gap: 8px; }
.workflow-step-form-grid .check-label input { width: auto; }
.field-muted { opacity: .48; }
.hidden { display: none !important; }
@media (max-width: 780px) {
  .workflow-step { grid-template-columns: 32px minmax(0,1fr); }
  .workflow-step-tools { grid-column: 2; flex-wrap: wrap; }
  .workflow-step-form-grid { grid-template-columns: 1fr; }
  .workflow-step-form-grid .span-2 { grid-column: 1; }
  .workflow-insert { margin-left: 20px; margin-right: 20px; }
  .workflow-insert { margin-left: 0; margin-right: 0; }
}

/* OCR 规则标签式编辑器 */
.ocr-rule-stack { display: grid; gap: 14px; }
.image-rule-tabs { width: max-content; margin-top: 4px; }
.image-rule-panel { display: none; }
.image-rule-panel.active { display: block; }
.rule-tag-editor { display: grid; gap: 8px; }
.rule-tag-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rule-tag-heading strong { display: block; font-size: 12px; color: #24434c; }
.rule-tag-heading small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.rule-tag-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.rule-tag-actions button { min-height: 30px; padding: 4px 9px; color: #147b70; border-color: #b9ded8; background: #f1fbf9; }
.rule-tag-box { min-height: 112px; display: flex; align-content: flex-start; align-items: flex-start; flex-wrap: wrap; gap: 7px; padding: 10px; border: 1px solid #ccdce5; border-radius: 7px; background: #fff; }
.rule-tag-box:focus-within { border-color: #6fb5aa; box-shadow: 0 0 0 2px rgba(47,155,132,.08); }
.rule-tag { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 5px 7px; border-radius: 6px; background: #f1f5f7; color: #354b55; font-size: 11px; }
.rule-tag > span { overflow-wrap: anywhere; }
.rule-tag button { min-width: auto; min-height: auto; padding: 0; border: 0; background: transparent; color: #6e818a; font-size: 13px; line-height: 1; }
.rule-tag button:hover { color: var(--red); }
.rule-tag-box > input { flex: 1 1 260px; min-width: 180px; min-height: 29px; border: 0; outline: 0; box-shadow: none; padding: 3px 4px; }
.rule-tag-count { justify-self: end; color: var(--muted); font-size: 10px; }
@media (max-width: 780px) {
  .rule-tag-heading { align-items: stretch; flex-direction: column; }
}
[hidden] {
  display: none !important;
}

.batch-task-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
}

.batch-task-type-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.batch-task-section {
  display: grid;
  gap: 10px;
}

.batch-task-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.batch-task-section-title strong {
  font-size: 13px;
}

.batch-task-section-title span {
  color: var(--muted);
  font-size: 11px;
}

.batch-project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.batch-project-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
  cursor: pointer;
}

.batch-project-option:has(input:checked) {
  border-color: var(--green);
  background: #eef9f5;
}

.batch-project-option input,
.batch-restart-option input {
  flex: 0 0 auto;
  margin-top: 3px;
}

.batch-project-option span,
.batch-restart-option span {
  display: grid;
  gap: 4px;
}

.batch-project-option strong,
.batch-restart-option strong {
  font-size: 12px;
}

.batch-project-option small,
.batch-restart-option small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.batch-run-settings {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

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

.batch-run-grid label {
  display: grid;
  gap: 6px;
  color: #53626e;
  font-size: 11px;
}

.batch-run-grid select,
.batch-run-grid input {
  width: 100%;
}

.batch-restart-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #cce4db;
  border-radius: 6px;
  background: #f2faf7;
  cursor: pointer;
}

.batch-task-type-form .dialog-actions {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

@media (max-width: 700px) {
  .project-options,
  .batch-project-grid,
  .batch-run-grid {
    grid-template-columns: 1fr;
  }

  .batch-task-section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}
/* 货源 ID 数据库 */
.source-id-toolbar, .source-id-actions, .source-id-stats { display: flex; align-items: center; gap: 10px; }
.source-id-toolbar { justify-content: space-between; margin-bottom: 12px; }
.source-id-toolbar strong, .source-id-toolbar small { display: block; }
.source-id-toolbar small { margin-top: 4px; color: var(--muted); }
.source-id-toolbar input, .source-id-actions input { min-width: 230px; }
.source-id-stats { margin-bottom: 12px; padding: 11px 14px; background: #f5f8fa; border: 1px solid var(--border); }
.source-id-stats span { padding-right: 18px; color: var(--muted); }
.source-id-stats strong { margin-left: 5px; color: var(--text); }
.source-id-actions { margin-bottom: 12px; flex-wrap: wrap; }
.source-id-table-wrap { max-height: calc(100vh - 320px); overflow: auto; }
.source-id-table { width: 100%; border-collapse: collapse; }
.source-id-table th, .source-id-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.source-id-status { display: inline-flex; align-items: center; min-width: 58px; color: #187c62; }
.source-id-status.processing { color: #b56a00; }
@media (max-width: 900px) {
  .source-id-toolbar { align-items: flex-start; flex-direction: column; }
  .source-id-toolbar input { min-width: min(100%, 320px); }
}

/* 多用户登录、余额与管理员视图 */
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef3f5; }
.auth-panel { width: min(420px, 100%); display: grid; gap: 16px; padding: 28px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 18px 45px rgba(18, 50, 60, .12); }
.auth-panel label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.auth-panel input { width: 100%; }
.auth-brand { color: #102f38; margin-bottom: 8px; }
.auth-submit { min-height: 40px; }
.auth-error { min-height: 20px; margin: 0; color: #bd3f3f; font-size: 12px; }
.user-chip { padding: 6px 9px; border: 1px solid var(--border); background: #fff; color: var(--text); font-size: 12px; }
.admin-grid { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(360px, 1.3fr); gap: 14px; }
.admin-grid .full-width { grid-column: 1 / -1; }
.admin-user-actions, .balance-adjust { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.balance-adjust input { width: 105px; }
.recharge-section { margin-bottom: 14px; }
.recharge-form, .recharge-card-admin-form { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.recharge-form input { width: min(420px, 100%); }
.recharge-card-admin-form label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.recharge-card-admin-form input { width: 150px; }
.recharge-card-table-wrap { margin-top: 14px; max-height: 360px; overflow: auto; }
.recharge-card-actions { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.recharge-card-actions .recharge-card-admin-form { flex: 1; margin-top: 14px; }
.recharge-card-code { cursor: copy; user-select: all; color: var(--text); }
.recharge-card-code:hover { color: var(--green-dark); text-decoration: underline; }
.pricing-summary { display: grid; gap: 4px; min-width: 205px; }
.pricing-summary span { color: var(--text); font-weight: 600; white-space: nowrap; }
.pricing-summary small { color: var(--muted); white-space: nowrap; }
.pricing-summary button { justify-self: start; margin-top: 2px; }
#pricing-dialog { width: min(640px, calc(100vw - 30px)); border-radius: 6px; overflow: hidden; }
#pricing-form { display: grid; gap: 20px; padding: 24px; }
#pricing-form .dialog-header { padding-bottom: 16px; }
#pricing-form .dialog-header h2 { font-size: 19px; }
.pricing-section { display: grid; gap: 12px; }
.pricing-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pricing-section-heading h3 { margin: 0; color: var(--text); font-size: 14px; }
.pricing-section-heading p { margin: 0; color: var(--muted); font-size: 12px; }

.memory-mode-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; margin-top: 12px; border: 1px solid var(--line); }
.memory-mode-list label { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 8px; min-height: 66px; padding: 9px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.memory-mode-list label > span { font-weight: 800; }
.memory-mode-list label small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }
.memory-summary { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); border: 1px solid var(--line); }
.memory-summary > div { min-height: 70px; padding: 13px; border-right: 1px solid var(--line); }
.memory-summary span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.memory-summary strong { color: #126f5d; font-size: 21px; }
.memory-toolbar { display: grid; grid-template-columns: 150px 150px minmax(240px, 1fr) auto; gap: 8px; margin: 13px 0 10px; }
.memory-record-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.memory-tabs { width: max-content; }
.memory-record-heading > button { min-height: 34px; }
.memory-record-heading > button:disabled { color: var(--muted) !important; cursor: default; opacity: .55; }
.memory-table-wrap .check-col { width: 44px; padding-right: 6px; padding-left: 6px; text-align: center; }
.memory-table-wrap .check-col input { width: 16px; height: 16px; margin: 0; }
.memory-panel { display: none; }
.memory-panel.active { display: block; }
.memory-table-wrap { max-height: calc(100vh - 420px); }
.memory-table-wrap table { min-width: 1120px; }
.memory-table-wrap td small { display: block; max-width: 360px; margin-top: 3px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.danger-text { color: #b63d3d; }

@media (max-width: 1000px) {
  .memory-summary { grid-template-columns: repeat(3, 1fr); }
  .memory-toolbar { grid-template-columns: 1fr 1fr; }
}
.pricing-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pricing-task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pricing-form-grid label { display: grid; grid-template-columns: 1fr auto; align-content: start; gap: 7px 10px; color: #42535d; font-size: 13px; font-weight: 600; }
.pricing-form-grid label > span { color: var(--muted); font-size: 11px; font-weight: 400; }
.pricing-form-grid input { grid-column: 1 / -1; align-self: start; width: 100%; height: 40px; min-height: 40px; padding: 8px 11px; font-size: 14px; }
.pricing-form-grid small { grid-column: 1 / -1; min-height: 18px; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.5; }
.pricing-note { padding: 10px 12px; border-left: 3px solid #83b8aa; background: #f4f8f7; }
#pricing-form .dialog-actions { margin-top: -2px; padding-top: 16px; border-top: 1px solid var(--line); }
.business-counts { color: var(--muted); line-height: 1.5; }
.revenue-breakdown { display: grid; gap: 2px; min-width: 105px; }
.revenue-breakdown strong { color: var(--green-dark); }
.revenue-breakdown small { color: var(--muted); white-space: nowrap; }
.admin-usage-row { display: grid; grid-template-columns: minmax(90px, .9fr) 64px minmax(150px, 1.5fr) 76px 76px 76px minmax(150px, 1.35fr) 72px; align-items: start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.admin-usage-row > * { min-width: 0; }
.admin-usage-header { color: var(--muted); font-weight: 600; }
.admin-usage-header > span { white-space: nowrap; }
.business-counts { line-height: 1.65; overflow-wrap: anywhere; }
.revenue-breakdown { min-width: 0; }
.profit-value { color: var(--green-dark); font-weight: 700; }
.balance-summary { border-color: #bcded3; background: #f2faf7; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  #pricing-form { gap: 16px; padding: 18px; }
  .pricing-section-heading { align-items: flex-start; flex-direction: column; gap: 3px; }
  .pricing-form-grid { grid-template-columns: 1fr; }
}
.platform-missing-detail-dialog { width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border-radius: 8px; overflow: hidden; }
.platform-missing-detail-dialog .dialog-header { padding: 18px 22px 14px; }
.platform-missing-detail-dialog #platform-missing-detail-content { padding: 0 22px; }
.platform-missing-detail-dialog .dialog-actions { padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.platform-missing-detail-dialog .dialog-note { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.platform-inspection-summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 18px; }
.platform-inspection-summary span { background: #eef6ff; border: 1px solid #d9e9fb; padding: 7px 10px; border-radius: 4px; color: #355070; }
.platform-attribute-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; max-height: 58vh; overflow: auto; padding: 4px 0 16px; }
.platform-attribute-field { min-width: 0; }
.platform-attribute-field label { display: block; }
.platform-attribute-field b { display: block; margin-bottom: 6px; color: #3b4350; }
.platform-attribute-field b::first-letter { color: #e34d59; }
.platform-attribute-field select { width: 100%; height: 34px; color: #334155; background: #fff; border: 1px solid #ff7c7c; border-radius: 4px; padding: 0 10px; }
.platform-attribute-field select option:first-child { color: #a7b0bd; }
.platform-attribute-field small { display: block; color: #f05a67; margin-top: 4px; }
.platform-attribute-field details { margin-top: 6px; color: #54708f; }
.platform-attribute-field summary { cursor: pointer; }
.platform-attribute-field details div { margin-top: 5px; max-height: 72px; overflow: auto; word-break: break-word; background: #f7f9fc; padding: 6px; }
@media (max-width: 760px) {
  .platform-missing-detail-dialog { width: calc(100vw - 20px); }
  .platform-missing-detail-dialog .dialog-header { padding: 15px 16px 12px; }
  .platform-missing-detail-dialog #platform-missing-detail-content { padding: 0 16px; }
  .platform-missing-detail-dialog .dialog-actions { padding: 12px 16px 15px; }
  .platform-attribute-grid { grid-template-columns: 1fr; gap: 12px; }
}

.execution-agent-list td { vertical-align: top; white-space: normal; }
.execution-agent-list td small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.5; }
.execution-agent-list .execution-device-id { max-width: 270px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.execution-agent-list td:nth-child(3) { min-width: 220px; max-width: 330px; }
.execution-agent-list td:nth-child(4), .execution-agent-list td:nth-child(5), .execution-agent-list td:nth-child(6) { white-space: nowrap; }
.execution-agent-list .check-label input { width: 16px; min-height: 0; margin: 0; }

/* Network workspace redesign. Keep functional visibility and permission classes authoritative. */
:root { --bg: #f4f7fb; --panel: #fff; --text: #203047; --muted: #68788e; --line: #e3eaf2; --nav: #172536; --green: #008d95; --green-dark: #00727a; --blue: #008d95; }
body { font-family: "Segoe UI", "Microsoft YaHei", sans-serif; }
.app-shell { grid-template-columns: 216px minmax(0,1fr); }
.sidebar { padding: 24px 12px 16px; overflow-y: auto; scrollbar-width: thin; }
.sidebar .brand { padding: 0 8px 20px; }
.sidebar .brand small { line-height: 1.6; }
.sidebar .brand-mark { flex-shrink: 0; background: #0099a2; border-radius: 10px; }
.nav-group-label { padding: 16px 14px 6px; color: #8ca0b9; font-size: 11px; letter-spacing: 1px; }
.nav-item { padding: 10px 13px; border-radius: 8px; color: #c5d2e2; }
.nav-item.active { background: #008991; color: #fff; }
.nav-item.active span { color: #fff; }
.nav-item:hover { background: #284057; }
.sidebar-summary { margin-top: 24px; }
main { padding: 0 28px 32px; }
.topbar { min-height: 96px; gap: 16px; }
.topbar h1 { font-size: 26px; letter-spacing: -.5px; }
.topbar p { line-height: 1.6; }
.top-actions { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
button, .download-button { border-radius: 7px; transition: background-color .15s, border-color .15s; }
button.primary, .primary { background: #008d95; border-color: #008d95; color: white; }
button.primary:hover { background: #00747c; border-color: #00747c; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #66cbd1; outline-offset: 3px; }
input, select, textarea { border-radius: 7px; }
.plain-section, .table-wrap, .service-band { border-radius: 10px; }
.plain-section { box-shadow: 0 2px 10px #19354d04; }
.admin-grid > .plain-section { min-width: 0; overflow-x: auto; }
.admin-usage-row { min-width: 900px; }
.settings-grid > *, .admin-grid > *, .policy-layout > * { min-width: 0; }
.section-heading { gap: 16px; flex-wrap: wrap; }
.section-heading h2 { font-size: 17px; }
.section-heading p { line-height: 1.65; }
.toolbar, .toolbar-group { flex-wrap: wrap; }
.toolbar-group label { max-width: 100%; }
.table-wrap { overflow-x: auto; }
th { background: #f5f8fc; color: #596d84; padding-top: 13px; padding-bottom: 13px; }
td { padding-top: 13px; padding-bottom: 13px; }
tbody tr:hover { background: #f5fbfc; }
.workspace-menu { display: none; }
.collection-workspace.plain-section { padding: 0; background: transparent; border: 0; box-shadow: none; }
.collection-workspace > .section-heading { padding: 0 0 12px; }
.collection-task-summary { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px; gap: 16px; margin-bottom: 20px; display: flex; flex-wrap: wrap; align-items: center; }
.collection-task-summary > span { color: var(--muted); }
.collection-task-summary > strong { color: var(--green-dark); padding: 5px 18px; border-left: 1px solid var(--line); font-size: 20px; }
#collection-timing-summary { flex-basis: 100%; line-height: 1.6; }
.collection-workspace-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; align-items: start; gap: 18px; }
.collection-list-card { min-width: 0; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.collection-list-card > .toolbar { margin-bottom: 14px; }
.collection-list-card .collection-claim-tab { border: 0; background: transparent; border-radius: 0; padding: 10px 16px; border-bottom: 2px solid transparent; }
.collection-list-card .collection-claim-tab.active { color: #007d86; background: #f1fbfc; border-bottom-color: #008d95; }
.collection-list-card > .toolbar:first-child { border-bottom: 1px solid var(--line); padding-bottom: 0; }
#collection-search { width: 300px; max-width: 100%; }
#collection-selection-scope { font-size: 12px; color: var(--muted); line-height: 1.6; }
.collection-batch-actions { padding: 12px; background: #f5f9fc; border-radius: 8px; }
.collection-batch-actions .toolbar-group { gap: 8px; }
.collection-batch-actions small { flex-basis: 100%; line-height: 1.6; }
.collection-list-card > .table-wrap { border: 0; border-radius: 6px; }
.collection-list-card table { min-width: 1100px; }
.collection-list-card > .table-wrap:not(.collection-all-fields) table { min-width: 720px; }
.collection-list-card > .table-wrap:not(.collection-all-fields) :is(th,td):nth-child(3),
.collection-list-card > .table-wrap:not(.collection-all-fields) :is(th,td):nth-child(7),
.collection-list-card > .table-wrap:not(.collection-all-fields) :is(th,td):nth-child(8),
.collection-list-card > .table-wrap:not(.collection-all-fields) :is(th,td):nth-child(9),
.collection-list-card > .table-wrap:not(.collection-all-fields) :is(th,td):nth-child(10) { display: none; }
#collection-product-table td { white-space: normal; vertical-align: top; line-height: 1.6; }
#collection-product-table td:nth-child(2) { min-width: 270px; max-width: 350px; }
#collection-product-table td:nth-child(2) strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#collection-product-table td:nth-child(2) small { color: var(--muted); }
#collection-product-table img { border-radius: 8px; }
#collection-product-table td:last-child { min-width: 255px; max-width: 330px; overflow-wrap: anywhere; }
#collection-product-table td:nth-child(10) { min-width: 100px; }
#collection-product-table tr:has(input:checked) { background: #eef9fb; }
.job-status { display: grid; gap: 5px; margin-bottom: 6px; }
.job-status > strong { color: #007f88; font-size: 12px; }
.job-status > span { color: #53687d; font-size: 12px; }
.job-status-error { padding: 9px 11px; border-left: 3px solid #e6a23c; background: #fff8eb; border-radius: 4px; }
.job-status-error > strong, .job-status-error > span { color: #966000; }
.job-details { margin: 8px 0 12px; font-size: 12px; }
.job-details summary { cursor: pointer; color: #007e88; }
.job-details[open] { background: #f6f8fb; border-radius: 6px; padding: 10px; }
#collection-settings-panel { margin: 0 0 18px; padding: 14px; background: #f8fafc; }
#collection-settings-panel > summary { cursor: pointer; color: #53687d; font-weight: 600; }
.collection-group-options { margin-top: 18px; align-items: end; }
.collection-group-options label { display: grid; gap: 6px; }
.collection-rail { min-width: 0; display: grid; gap: 16px; }
#image-queue-panel { margin: 0; padding: 18px; background: white; }
#image-queue-panel > summary { font-size: 17px; font-weight: 700; cursor: pointer; }
#image-queue-summary { font-size: 12px; line-height: 1.7; color: var(--muted); }
#image-queue-panel .toolbar { gap: 8px; }
#image-queue-panel .toolbar small { flex-basis: 100%; line-height: 1.7; color: var(--muted); }
#image-queue-panel table { min-width: 0; display: block; }
#image-queue-panel thead { display: none; }
#image-queue-panel tbody { display: grid; }
#image-queue-panel tr { display: grid; grid-template-columns: minmax(0,1fr) auto; padding: 12px 0; gap: 6px; border-bottom: 1px solid var(--line); }
#image-queue-panel td { display: block; height: auto; min-width: 0; padding: 0; border: 0; white-space: normal; font-size: 12px; overflow-wrap: anywhere; }
#image-queue-panel td:first-child { font-weight: 700; }
#image-queue-panel td:nth-child(2) { color: var(--muted); }
#image-queue-panel td:nth-child(3) { grid-column: 1 / -1; line-height: 1.7; }
#image-queue-panel td:nth-child(3) small { display: block; color: var(--muted); }
#image-queue-panel td:last-child { grid-column: 1 / -1; }
#image-queue-panel .table-wrap { border: 0; }
#image-queue-display-note { font-size: 12px; line-height: 1.7; color: #007d86; margin-bottom: 0; }
.queue-policy { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.queue-policy summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.queue-policy > small { display: block; margin-top: 10px; line-height: 1.7; }
.current-task-card { padding: 18px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.current-task-card h2 { margin: 0 0 16px; font-size: 17px; }
.current-task-card .collection-progress-panel { padding: 0; margin: 0; border: 0; background: transparent; }
.current-task-card .collection-flow-head { display: grid; gap: 7px; }
.current-task-card .collection-flow-head strong, .current-task-card .collection-flow-head small { white-space: normal; line-height: 1.6; }
.current-task-card .collection-flow:not(.collection-total-line) { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.current-task-card .collection-flow-step { display: flex; justify-content: flex-start; align-items: center; gap: 12px; }
.current-task-card .collection-flow em { min-width: 0; width: 2px; flex: none; height: 16px; margin: 0 0 0 4px; }
@media (min-width: 1700px) { .collection-workspace-grid { grid-template-columns: minmax(0,1fr) 360px; } }
@media (max-width: 1250px) {
  .collection-workspace-grid { grid-template-columns: minmax(0,1fr); }
  .collection-rail { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .topbar { align-items: flex-start; padding: 18px 0; }
}
@media (max-width: 800px) {
  .app-shell { display: block; }
  main { padding: 0 14px 24px; }
  .workspace-menu { display: inline-flex; flex-shrink: 0; }
  .sidebar { display: none; }
  .navigation-open .sidebar { display: flex; position: fixed; left: 0; top: 72px; bottom: 0; width: 260px; height: calc(100dvh - 72px); z-index: 50; box-shadow: 12px 0 32px #17253633; }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .topbar h1 { font-size: 22px; }
  .top-actions { width: 100%; justify-content: flex-start; }
  .collection-list-card { padding: 12px; }
  .collection-rail { grid-template-columns: 1fr; }
  .collection-task-summary { padding: 14px; gap: 10px; }
  .collection-task-summary > strong { font-size: 17px; padding: 4px 12px; }
  .service-band { grid-template-columns: 1fr; }
  .settings-grid, .two-fields, .pricing-form-grid { grid-template-columns: 1fr; }
  .toolbar-group { max-width: 100%; }
  .download-button { white-space: normal; }
  .collection-list-card > .toolbar .toolbar-group { width: 100%; gap: 8px; }
  #collection-search { flex: 1 1 100%; width: 100%; }
  #collection-local-group { flex: 1 1 140px; }
  .collection-list-card > .table-wrap table { display: block; min-width: 0 !important; }
  .collection-list-card > .table-wrap thead { display: block; }
  .collection-list-card > .table-wrap thead tr { display: flex; align-items: center; }
  .collection-list-card > .table-wrap th:not(:first-child):not(:nth-child(2)) { display: none; }
  #collection-product-table { display: grid; }
  #collection-product-table tr { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); padding: 14px 0; gap: 10px; border-bottom: 1px solid var(--line); }
  #collection-product-table td { min-width: 0 !important; max-width: none !important; height: auto; border: 0; padding: 0; }
  #collection-product-table td:first-child { grid-column: 1 / -1; }
  #collection-product-table td:nth-child(2), #collection-product-table td:last-child { grid-column: 1 / -1; }
  #collection-product-table td:nth-child(n+3):not(:last-child)::before { content: attr(data-column); display: block; color: var(--muted); font-size: 11px; }
}

.platform-collection-table { table-layout: fixed; width: 100%; }
.platform-collection-table th,
.platform-collection-table td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
  overflow: hidden;
}
.platform-collection-table .product-cell {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}
.platform-collection-table .product-cell > div {
  min-width: 0;
  flex: 1;
}
.platform-collection-table .product-cell strong,
.platform-collection-table .product-cell small,
.platform-collection-table .platform-inspection-summary,
.platform-collection-table .platform-inspection-summary span,
.platform-collection-table .platform-inspection-summary strong {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.platform-collection-table .platform-inspection-summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.45;
}
