:root {
  --canvas-width: 2560px;
  --canvas-height: 1440px;
  --header-height: 58px;
  --sidebar-width: 178px;
  --header-padding: 38px;
  --workspace-x: 34px;
  --workspace-y: 20px;
  --panel-padding: 18px;
  --panel-gap: 12px;
  --grid-gap: 14px;
  --barcode-columns: 3;
  --barcode-min-width: 300px;
  --ground: #f8f9fa;
  --surface: #ffffff;
  --surface-muted: #f3f4f5;
  --surface-hover: #edeeef;
  --ink: #191c1d;
  --muted: #5d6070;
  --faint: #7a7d89;
  --line: #c4c5d5;
  --line-strong: #aeb1c4;
  --blue: #1e40af;
  --blue-deep: #00288e;
  --blue-soft: #e8eeff;
  --green: #00714e;
  --green-soft: #dff7e9;
  --danger: #ba1a1a;
  --shadow: 0 1px 2px rgb(22 28 45 / 8%);
  --ui: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; height: 100%; margin: 0; overflow: hidden; }
body { display: grid; place-items: center; color: var(--ink); background: #e7e8e9; font-family: var(--ui); font-size: 11px; line-height: 1.5; letter-spacing: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid rgb(30 64 175 / 35%); outline-offset: 2px; }
.app-canvas { display: grid; grid-template-rows: var(--header-height) minmax(0, 1fr); width: min(100vw, var(--canvas-width)); height: min(100dvh, var(--canvas-height)); overflow: hidden; background: var(--ground); box-shadow: 0 0 0 1px rgb(25 28 29 / 6%); }
.app-header { position: relative; z-index: 3; display: grid; grid-template-columns: minmax(300px, 1fr) auto minmax(300px, 1fr); align-items: center; height: var(--header-height); padding: 0 var(--header-padding); border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 98%); }
.brand { display: flex; align-items: center; min-width: 0; gap: 10px; }
.brand-mark { display: grid; width: 25px; height: 25px; place-items: center; color: var(--blue-deep); }
.brand-mark svg { width: 24px; height: 24px; stroke-width: 2.1; }
.brand-name { color: var(--blue-deep); font-size: 19px; font-weight: 700; line-height: 25px; white-space: nowrap; }
.version { padding-left: 3px; color: var(--muted); font-family: var(--mono); font-size: 10px; font-weight: 500; white-space: nowrap; }
.product-nav { align-self: stretch; display: flex; align-items: stretch; }
.product-nav span { display: flex; align-items: center; padding: 0 14px; border-bottom: 2px solid var(--blue); color: var(--blue-deep); font-size: 12px; font-weight: 700; white-space: nowrap; }
.header-tools { display: flex; align-items: center; justify-content: flex-end; gap: 17px; min-width: 0; }
.clock { color: var(--muted); font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.account-area { position: relative; }
.account-trigger { display: inline-flex; align-items: center; min-height: 30px; gap: 7px; padding: 0; border: 0; color: var(--ink); background: transparent; font-size: 11px; font-weight: 700; white-space: nowrap; }
.avatar { display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--blue-deep); background: var(--blue-soft); }
.avatar svg { width: 15px; height: 15px; }
.account-trigger > svg { width: 12px; height: 12px; color: var(--muted); }
.account-menu { position: absolute; top: calc(100% + 7px); right: 0; display: none; width: 214px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: 0 12px 28px rgb(25 28 29 / 15%); }
.account-menu.is-open { display: block; }
.account-summary { display: flex; align-items: center; gap: 10px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.account-summary .avatar { width: 32px; height: 32px; }
.account-summary .avatar svg { width: 18px; height: 18px; }
.account-name { display: block; color: var(--ink); font-size: 12px; font-weight: 700; }
.account-email { display: block; margin-top: 1px; color: var(--faint); font-family: var(--mono); font-size: 9px; }
.menu-button { display: flex; align-items: center; width: 100%; min-height: 30px; gap: 8px; margin-top: 10px; padding: 0 8px; border: 1px solid transparent; border-radius: 4px; color: var(--blue-deep); background: transparent; font-size: 10px; font-weight: 700; text-align: left; }
.menu-button:hover { border-color: #cbd7ff; background: var(--blue-soft); }
.menu-button svg { width: 14px; height: 14px; }
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 0; }
.rule-rail { display: flex; min-height: 0; flex-direction: column; padding: var(--workspace-y) 18px 20px; border-right: 1px solid var(--line); background: var(--surface-muted); }
.limit-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 700; }
.limit-list { display: grid; gap: 8px; }
.limit-list p { display: grid; gap: 2px; margin: 0; color: var(--ink); font-size: 10px; line-height: 14px; }
.limit-list strong { color: var(--blue-deep); font-size: 11px; }
.limit-list span { font-weight: 700; }
.limit-unlimited { color: var(--green) !important; font-weight: 700; }
.limit-current { margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; font-weight: 700; line-height: 14px; }
.single-tool { display: flex; align-items: center; min-height: 38px; gap: 10px; margin-top: 16px; padding: 0 11px; border: 1px solid #cbd7ff; border-radius: 4px; color: var(--blue-deep); background: var(--blue-soft); font-size: 10px; font-weight: 700; }
.single-tool svg { width: 17px; height: 17px; }
.workspace { display: flex; min-width: 0; min-height: 0; flex-direction: column; padding: var(--workspace-y) var(--workspace-x); }
.work-panel { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.input-panel { flex: 0 0 auto; padding: var(--panel-padding); }
.panel-head { display: flex; align-items: center; justify-content: space-between; min-height: 22px; gap: 12px; margin-bottom: 10px; }
.panel-head h1, .panel-head h2 { margin: 0; color: var(--ink); font-size: 16px; font-weight: 700; line-height: 22px; }
.detected-count, .valid-count { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); background: var(--surface-muted); font-family: var(--mono); font-size: 9px; font-weight: 600; white-space: nowrap; }
.valid-count { border-color: #8fd9b4; color: var(--green); background: var(--green-soft); }
.barcode-input { display: block; width: 100%; height: 74px; resize: none; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink); background: #fbfcff; font-family: var(--mono); font-size: 10px; font-weight: 500; line-height: 17px; }
.barcode-input::placeholder { color: #8a8e9d; opacity: 1; }
.barcode-input:focus { border-color: var(--blue); background: #fff; }
.input-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.button, .icon-button { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink); background: #fff; font-size: 9px; font-weight: 700; transition: background-color .15s ease, border-color .15s ease; }
.button { min-width: 88px; gap: 5px; padding: 0 11px; }
.button:hover, .icon-button:hover { border-color: var(--blue); color: var(--blue-deep); background: var(--surface-muted); }
.button.primary { min-width: 96px; border-color: var(--blue); color: #fff; background: var(--blue); }
.button.primary:hover { color: #fff; background: var(--blue-deep); }
.button svg, .icon-button svg { width: 12px; height: 12px; }
.icon-button { width: 28px; padding: 0; color: var(--muted); }
.results-panel { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; margin-top: var(--panel-gap); padding: var(--panel-padding); }
.results-toolbar { display: flex; align-items: center; flex: 0 0 auto; flex-wrap: wrap; gap: 9px 16px; min-height: 30px; margin-bottom: 9px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.switch-field, .range-field { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.switch-field input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; display: block; width: 31px; height: 17px; border-radius: 9px; background: #a9acb6; transition: background-color .15s ease; }
.switch-track::after { position: absolute; top: 3px; left: 3px; width: 11px; height: 11px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 22%); content: ""; transition: transform .15s ease; }
.switch-field input:checked + .switch-track { background: var(--blue); }
.switch-field input:checked + .switch-track::after { transform: translateX(14px); }
.range-field { gap: 7px; }
.range-field output { min-width: 31px; color: var(--blue-deep); font-family: var(--mono); font-size: 9px; font-weight: 600; text-align: right; }
input[type="range"] { width: 116px; height: 14px; margin: 0; appearance: none; border: 0; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(to right, var(--blue) 0 var(--range-fill, 50%), #c8cad6 var(--range-fill, 50%) 100%); }
input[type="range"]::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4.5px; appearance: none; border: 2px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.columns-field { display: inline-flex; align-items: center; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; color: var(--muted); font-size: 10px; font-weight: 700; }
.columns-field legend { float: left; padding: 0; }
.segmented-control { display: inline-flex; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 4px; }
.segment { width: 26px; height: 24px; padding: 0; border: 0; border-right: 1px solid var(--line-strong); color: var(--muted); background: #fff; font-family: var(--mono); font-size: 10px; font-weight: 700; }
.segment:last-child { border-right: 0; }
.segment:hover, .segment.is-selected { color: #fff; background: var(--blue); }
.batch-download { min-width: 114px; color: var(--blue-deep); }
.results-scrollport { min-width: 0; min-height: 0; flex: 1 1 auto; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding: 1px 7px 5px 1px; scroll-behavior: auto; }
.barcode-grid { display: grid; width: 100%; min-width: 0; grid-template-columns: repeat(var(--barcode-columns), minmax(0, 1fr)); gap: var(--grid-gap); }
.barcode-grid[data-columns="1"] { --barcode-max-width: 920px; }
.barcode-grid[data-columns="2"] { --barcode-max-width: 680px; }
.barcode-grid[data-columns="3"] { --barcode-max-width: 462px; }
.barcode-tile { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; box-shadow: var(--shadow); }
.barcode-paper { display: grid; min-height: 92px; place-items: center; overflow: hidden; padding: 9px; border: 1px solid #d9dadb; background: #fff; }
.barcode-canvas { display: grid; width: 100%; min-width: 0; place-items: center; overflow: hidden; }
.barcode-canvas svg { display: block; width: min(100%, var(--barcode-max-width, 462px)); min-width: min(var(--barcode-min-width), 100%); max-width: 100%; height: auto; shape-rendering: crispEdges; }
.barcode-number { margin: 8px 0 0; overflow: hidden; color: var(--ink); font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 1.5px; line-height: 15px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.modal-backdrop { position: fixed; z-index: 10; inset: 0; display: none; place-items: center; padding: 20px; background: rgb(17 24 39 / 32%); }
.modal-backdrop.is-open { display: grid; }
.dialog { width: min(100%, 640px); max-height: calc(100dvh - 40px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 20px 50px rgb(0 0 0 / 22%); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding: 0 28px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; color: var(--ink); font-size: 21px; font-weight: 700; }
.dialog-body { padding: 22px 28px 24px; }
.dialog-section + .dialog-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.dialog-section h3 { margin: 0 0 16px; color: var(--blue-deep); font-size: 14px; font-weight: 700; }
.auth-notice { margin: 0 0 12px; padding: 10px 13px; border: 1px solid #f0c36d; border-radius: 5px; color: #6d4300; background: #fff8e8; font-size: 12px; font-weight: 700; line-height: 18px; }
.field-label { display: block; margin: 0 0 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.form-input { width: 100%; min-height: 40px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); background: #fff; font-size: 13px; }
.form-input:focus { border-color: var(--blue); }
.form-row + .form-row { margin-top: 12px; }
.form-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.verification-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.verification-row .icon-button { width: 40px; height: 40px; }
.verification-hint { margin: 5px 0 0; color: var(--faint); font-size: 10px; line-height: 15px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.registration-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.button.secondary { min-width: 76px; }
.button.small { min-width: 110px; min-height: 40px; padding: 0 17px; font-size: 13px; }
.button:disabled { cursor: not-allowed; opacity: .58; }
.password-field { position: relative; display: flex; align-items: center; }
.password-field .form-input { padding-right: 46px; }
.password-toggle { position: absolute; right: 4px; width: 36px; min-height: 32px; border-color: transparent; }
.verification-step { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.verification-step strong { display: block; color: var(--ink); font-size: 14px; }
.step-number { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); font-family: var(--mono); font-size: 12px; font-weight: 700; }
.code-input { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: 5px; text-align: center; }
.is-hidden { display: none !important; }
.registration-page { position: fixed; z-index: 8; inset: 0; overflow: auto; color: var(--ink); background: var(--ground); }
.registration-header { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-height); padding: 0 var(--header-padding); border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 98%); }
.registration-back { min-width: 110px; color: var(--blue-deep); }
.registration-main { display: grid; min-height: calc(100dvh - var(--header-height)); place-items: start center; padding: 54px 20px 72px; }
.registration-card { width: min(100%, 620px); padding: 34px 38px 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 12px 30px rgb(25 28 29 / 8%); }
.registration-heading { margin-bottom: 26px; }
.registration-kicker { display: block; margin-bottom: 7px; color: var(--blue); font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.registration-heading h1 { margin: 0; color: var(--ink); font-size: 28px; line-height: 34px; }
.registration-heading p { max-width: 470px; margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 19px; }
.feedback-drawer { position: fixed; top: 76px; right: 18px; z-index: 30; display: flex; width: min(390px, calc(100vw - 36px)); align-items: flex-start; gap: 11px; padding: 14px 12px 14px 14px; border: 1px solid #8fd9b4; border-radius: 6px; color: #005137; background: #edfff5; box-shadow: 0 16px 32px rgb(25 28 29 / 18%); transform: translateX(calc(100% + 24px)); transition: transform .24s ease; }
.feedback-drawer.is-open { transform: translateX(0); }
.feedback-drawer.is-error { border-color: #f0aaa5; color: #93000a; background: #ffebe8; }
.feedback-icon { display: grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; }
.feedback-icon svg { width: 18px; height: 18px; }
.feedback-copy { min-width: 0; flex: 1 1 auto; }
.feedback-copy strong { display: block; font-size: 12px; line-height: 17px; }
.feedback-copy p { margin: 2px 0 0; font-size: 11px; line-height: 16px; }
.feedback-drawer > .icon-button { flex: 0 0 auto; border-color: transparent; color: inherit; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 20; display: none; max-width: 360px; padding: 10px 13px; border: 1px solid #8fd9b4; border-radius: 4px; color: #005137; background: #edfff5; box-shadow: var(--shadow); font-size: 10px; font-weight: 600; }
.toast.is-visible { display: block; }
.toast.is-error { border-color: #f0aaa5; color: #93000a; background: #ffebe8; }
@media (max-width: 960px) { html, body { overflow: auto; } body { display: block; } .app-canvas { display: block; width: 100%; height: auto; min-height: 100dvh; overflow: visible; } .app-header { position: sticky; top: 0; grid-template-columns: 1fr auto; padding: 0 18px; } .product-nav, .clock { display: none; } .app-shell { display: block; } .rule-rail { display: flex; flex-direction: row; align-items: center; gap: 18px; padding: 14px 20px; border-right: 0; border-bottom: 1px solid var(--line); } .workspace { display: block; padding: 20px; } .results-panel { min-height: 620px; margin-top: 17px; } .modal-backdrop { padding: 12px; } .dialog { max-height: calc(100dvh - 24px); } .dialog-head { padding: 0 24px; } .dialog-body { padding: 24px; } }
@media (max-width: 620px) { .brand-name { font-size: 16px; } .version { display: none; } .account-trigger > span:not(.avatar), .account-trigger > svg { display: none; } .rule-rail { display: block; } .single-tool { margin-top: 12px; } .panel-head { align-items: flex-start; flex-direction: column; gap: 7px; } .results-toolbar { align-items: flex-start; flex-direction: column; } .barcode-grid { grid-template-columns: 1fr; } .form-two-col { grid-template-columns: 1fr; } .dialog { width: 100%; border-radius: 6px; } .dialog-head { min-height: 58px; padding: 0 18px; } .dialog-head h2 { font-size: 18px; } .dialog-body { padding: 18px; } .auth-tabs { gap: 8px; } .auth-tabs .button { font-size: 12px; } .form-input { min-height: 42px; font-size: 13px; } .field-label { font-size: 11px; } .dialog-actions { flex-wrap: wrap; } }
