/* 第二期返工规范：现有 C 版上统一密度，不依赖外部字体或脚本。 */
body[data-variant="C"] {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --radius: 8px;
  --bg: #f4f6f3;
  --paper: #ffffff;
  --ink: #203b31;
  --muted: #64766c;
  --accent: #25604a;
  --soft: #eaf0e9;
  --line: #dce4dc;
  --danger: #944528;
  --danger-bg: #fff2e9;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}
body *,
body *::before,
body *::after {
  font-variant-numeric: tabular-nums;
}
h1,
.page-head h1,
.login-form h2 {
  font-size: 24px;
  letter-spacing: -0.025em;
  font-weight: 650;
}
h2,
h3,
.brand,
.selected-product h3 {
  font-size: 16px;
  font-weight: 600;
}
small,
.helper,
.eyebrow,
.nav-note,
.nav-group-title,
th,
.badge,
.summary-line,
.page-head p,
.record-table .r-detail,
.user-mark {
  font-size: 12px;
}
label,
input,
select,
textarea,
table,
button,
.button {
  font-size: 14px;
}
button,
.button,
.text-button,
summary,
input,
select,
textarea {
  transition:
    background-color 150ms,
    border-color 150ms,
    color 150ms,
    transform 150ms;
}
body[data-variant="C"] button,
body[data-variant="C"] .button,
body[data-variant="C"] summary {
  min-height: 48px;
  border-radius: var(--radius);
  padding: 8px 16px;
}
button:active,
.button:active {
  transform: translateY(1px);
}
button:focus-visible,
a:focus-visible,
label.button:focus-within,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}
button[aria-busy="true"] {
  cursor: progress;
}
input,
select,
textarea {
  min-height: 48px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  accent-color: var(--accent);
}
textarea {
  min-height: 80px;
}
label {
  gap: 4px;
}
.text-button,
body[data-variant="C"] button.text-button,
.record-table button,
.account-list button,
.rate-table button {
  border: 0;
  background: transparent;
  color: var(--accent);
  box-shadow: none;
  padding: 4px 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.text-button:hover,
.record-table button:hover {
  background: var(--soft);
}
.topbar {
  height: 64px;
  padding: 0 24px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.brand {
  gap: 8px;
}
.brand svg {
  width: 24px;
  height: 24px;
}
.toplinks {
  gap: 16px;
}
.user-mark {
  padding-left: 16px;
}
.app-body {
  min-height: calc(100dvh - 64px);
}
.desktop-nav {
  width: 200px;
  padding: 24px 12px;
  gap: 24px;
  position: sticky;
  top: 0;
  height: calc(100dvh - 64px);
  background: #eef3ec;
}
.nav-group-title {
  color: var(--muted);
  padding: 0 12px;
  margin: 0 0 8px;
  letter-spacing: 0.08em;
}
.desktop-nav a {
  padding: 8px 12px;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
}
.desktop-nav a svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.desktop-nav a:hover {
  background: #e4ece2;
}
.desktop-nav a.active {
  background: #dce8dc;
}
.nav-count {
  margin-left: auto;
  padding: 0 4px;
  font-size: 12px;
  color: var(--accent);
}
.nav-note {
  margin: auto 12px 0;
  padding-top: 16px;
}
.main {
  margin: 0;
  padding: 24px 24px 48px;
  max-width: 1280px;
  min-width: 0;
}
.page-head {
  margin-bottom: 24px;
  gap: 16px;
}
.page-head p {
  margin-top: 4px;
}
.actions {
  gap: 8px;
}
.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}
.panel-title {
  gap: 12px;
  margin-bottom: 16px;
}
.spaced {
  margin-top: 24px;
}
.field-grid {
  gap: 16px;
}
.form-layout {
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 240px;
}
.form-section + .form-section {
  margin-top: 24px;
  padding-top: 24px;
}
.section-label {
  gap: 8px;
  margin-bottom: 16px;
}
.selected-product {
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
}
.product-art {
  background: #edf1eb;
  border: 1px solid var(--line);
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  color: #5e7666;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.product-art.large {
  height: 160px;
}
.product-art.large span {
  font-size: 32px;
}
.product-cell {
  gap: 12px;
}
.product-art img {
  object-fit: cover;
  border-radius: var(--radius);
}
.quick-operations {
  margin-bottom: 24px;
  gap: 12px;
}
.quick-operations a {
  min-height: 64px;
  min-width: 192px;
  font-size: 16px;
  padding: 12px 16px;
}
.quick-operations small {
  font-size: 12px;
}
.quick-operations span {
  font-size: 24px;
}
.metrics {
  grid-template-columns: 1fr 1fr 0.8fr;
  gap: 16px;
  margin-bottom: 24px;
}
.metric strong,
.metric:nth-child(2) strong {
  font-size: 32px;
  font-weight: 600;
}
.metric .label {
  font-size: 12px;
  margin-bottom: 8px;
}
.money-breakdown {
  margin-top: 8px;
  gap: 4px 12px;
}
.counts {
  gap: 24px;
  margin-top: 8px;
}
.counts strong {
  font-size: 24px;
}
.dashboard-grid {
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
}
.records-panel {
  padding: 16px;
}
.records-panel .panel-title {
  padding: 0 8px;
}
.low-row {
  gap: 12px;
  padding: 12px 0;
}
.low-row strong {
  font-size: 14px;
}
.low-row:nth-of-type(n + 5) {
  display: none;
}
.ask-entry {
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}
.ask-entry svg {
  width: 16px;
  height: 16px;
}
.ai-panel p {
  margin: 8px 0;
  font-size: 14px;
}
.ai-panel .panel-title {
  margin-bottom: 8px;
}
.table-wrap {
  min-width: 0;
  max-width: 100%;
}
table {
  table-layout: fixed;
}
th,
td {
  padding: 12px 8px;
}
th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f0f4ee;
  text-align: left;
}
td {
  overflow-wrap: anywhere;
}
.align-right {
  text-align: right;
}
.record-table th:first-child,
.record-table td:first-child {
  padding-left: 8px;
}
.record-table th:nth-child(1) {
  width: 112px;
}
.record-table th:nth-child(2) {
  width: auto;
}
.record-table th:nth-child(3) {
  width: 144px;
}
.record-table th:nth-child(4) {
  width: 148px;
}
.record-table th:nth-child(5) {
  width: 120px;
}
.record-table td {
  height: 88px;
}
.record-table td.record-actions {
  white-space: nowrap;
}
.record-actions .badge {
  margin-right: 4px;
}
.record-note {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record-operator {
  font-size: 12px;
}
.badge {
  border-radius: var(--radius);
  padding: 4px 8px;
  font-weight: 500;
}
.state-failed,
.state-abandoned {
  color: var(--danger);
  background: var(--danger-bg);
}
.state-queued,
.state-running {
  color: #5c681e;
  background: #f2f3dc;
}
.record-toolbar {
  margin-bottom: 16px;
  padding: 12px 16px;
}
.date-presets {
  display: flex;
  gap: 8px;
}
.date-presets button {
  border: 0;
  background: transparent;
  padding: 8px 16px;
}
.date-presets .selected {
  background: var(--soft);
  color: var(--accent);
}
#record-filter {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  align-items: end;
}
#record-filter .field-grid {
  flex: 1;
}
#record-filter .error-text {
  flex-basis: 100%;
}
.load-more {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}
.settings-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}
.settings-grid > section {
  min-width: 0;
}
.settings-grid .panel > p {
  margin: 8px 0 16px;
  font-size: 14px;
}
.settings-grid .actions {
  margin-top: 24px;
}
.account-name {
  display: block;
  margin-top: 16px;
  font-size: 24px;
}
.account-list article {
  padding: 16px 0;
  gap: 16px;
}
.account-list .actions {
  margin: 0;
}
.rate-table th:nth-child(1) {
  width: 42%;
}
.rate-table th:last-child {
  width: 56px;
}
.rate-table td {
  padding: 8px 4px;
}
.usage-stat {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin: 16px 0;
  gap: 16px;
}
.usage-stat strong {
  font-size: 32px;
}
.usage-stat small {
  margin-left: 8px;
  font-weight: 400;
}
progress {
  appearance: none;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--soft);
  margin: 8px 0;
}
progress::-webkit-progress-bar {
  background: var(--soft);
}
progress::-webkit-progress-value {
  background: var(--accent);
}
.empty,
.notice,
.error-text:not(:empty),
.warning,
.toast {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--soft);
}
.empty {
  text-align: left;
  display: grid;
  gap: 8px;
  color: var(--muted);
}
.empty strong {
  color: var(--ink);
}
.notice {
  margin-top: 12px;
}
.error-text:not(:empty),
.warning {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #edd2bd;
}
.error-text {
  margin-top: 12px;
}
.toast {
  background: var(--accent);
  color: white;
  bottom: 24px;
  padding: 12px 24px;
  box-shadow: none;
  z-index: 100;
}
.helper {
  margin-top: 8px;
}
.main[aria-busy="true"]::before {
  top: 80px;
  right: 24px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  box-shadow: none;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.upload-zone {
  border: 1px dashed #9cb4a3;
  background: #f7faf5;
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  gap: 16px;
  margin: 16px 0;
  text-align: center;
}
.upload-zone.dragging {
  border-color: var(--accent);
  background: var(--soft);
}
.upload-prompt strong {
  font-size: 16px;
}
.upload-prompt p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.upload-choices {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.upload-choices label {
  cursor: pointer;
}
.camera-choice,
.mobile-choice {
  display: none !important;
}
.file-preview {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  min-width: 0;
}
.file-preview:empty {
  display: none;
}
.file-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius);
}
.file-preview p {
  overflow-wrap: anywhere;
  font-size: 12px;
}
.check-label {
  margin: 16px 0;
  gap: 8px;
  min-height: 44px;
  font-weight: 400;
}
.document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px 64px;
  gap: 16px;
  padding: 16px 0;
  flex-wrap: initial;
}
.document-link {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.document-link small {
  display: block;
}
.document-thumb {
  width: 56px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  flex: none;
}
.document-error {
  color: var(--danger);
}
.document-actions {
  text-align: right;
}
.review-layout {
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.4fr);
  gap: 24px;
}
.original-image {
  position: sticky;
  top: 24px;
  padding: 16px;
}
.original-image summary {
  padding: 4px 0 !important;
  font-weight: 600;
  cursor: pointer;
}
.original-image img {
  max-height: calc(100dvh - 160px);
  width: 100%;
  object-fit: contain;
}
.original-image p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
#review-form {
  padding: 16px;
}
.review-line {
  padding: 16px 0;
}
.review-line-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.review-line-head .check-label {
  margin: 0;
  flex: none;
}
.review-product {
  margin: 4px 0 8px;
}
.review-line .field-grid {
  grid-template-columns: 0.7fr 1fr 0.8fr;
  gap: 8px;
}
.review-line label {
  font-size: 12px;
}
.review-line input,
.review-line select {
  padding: 8px;
  font-size: 14px;
}
.review-line.unmatched {
  border-left: 2px solid var(--danger);
  padding-left: 8px;
}
.review-line .warning:empty {
  display: none;
}
.line-warning:not(:empty) {
  margin-top: 8px;
  padding: 8px;
}
.review-rate {
  margin-top: 8px;
}
#review-form textarea {
  min-height: 64px;
}
.review-layout .actions {
  margin-top: 16px;
}
.question-examples {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 0;
}
.question-examples button {
  padding: 8px;
  font-size: 14px;
  font-weight: 400;
}
.question-composer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 16px;
}
.question-composer input {
  flex: 1;
  width: 0;
}
.question-composer .error-text {
  flex-basis: 100%;
}
.question-composer button {
  flex: none;
}
#question-result {
  margin-top: 16px;
}
#question-result > p {
  margin: 12px 0;
  font-size: 12px;
  color: var(--muted);
}
.candidate-choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.opening-row {
  padding: 8px 0;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 120px;
}
dialog {
  padding: 24px;
  border-radius: var(--radius);
  max-width: calc(100vw - 32px);
}
dialog h2 {
  margin-bottom: 16px;
}
dialog .actions {
  bottom: -24px;
  margin-top: 16px;
  padding: 12px 0;
  gap: 8px;
}
#dialog-form > .field-grid {
  margin-top: 16px;
}
.login-story {
  padding: 48px;
}
.login-story h1 {
  font-size: 32px;
  margin-top: 48px;
}
.login-story p {
  margin-top: 16px;
  font-size: 14px;
}
.login-form-side {
  padding: 48px;
}
.login-form label {
  margin: 16px 0;
}
.login-form > p {
  margin-bottom: 24px;
}
.login-illustration {
  margin: 32px 0;
}
.login-form .helper {
  margin: 16px 0;
}
@media (min-width: 1101px) {
  .entry-panel {
    padding: 24px;
    gap: 24px;
  }
  .entry-panel .form-section + .form-section {
    margin: 0;
    padding: 0;
  }
  .entry-panel .form-section[data-step="2"] {
    padding-left: 24px;
  }
  .entry-panel .form-section[data-step="3"] {
    padding-top: 16px;
    gap: 12px 24px;
  }
  .entry-panel .field-grid {
    gap: 12px;
  }
  .entry-panel .subtotal strong {
    font-size: 24px;
  }
  .entry-panel .form-footer .helper {
    font-size: 12px;
    margin-top: 4px;
  }
  .entry-panel .form-footer button {
    min-height: 48px;
  }
}
@media (max-width: 1200px) and (min-width: 761px) {
  .desktop-nav {
    width: 168px;
    padding: 24px 8px;
  }
  .desktop-nav a {
    padding: 8px;
    font-size: 12px;
  }
  .main {
    padding: 24px 16px 48px;
  }
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .records-panel {
    grid-row: auto;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .metric:last-child {
    grid-column: 1/-1;
  }
  .form-layout {
    grid-template-columns: 1fr;
  }
  .side-note {
    display: none;
  }
  .record-table th:nth-child(1) {
    width: 96px;
  }
  .record-table th:nth-child(3) {
    width: 120px;
  }
  .record-table th:nth-child(4) {
    width: 120px;
  }
  .record-table th:nth-child(5) {
    width: 100px;
  }
  .review-layout {
    gap: 16px;
    grid-template-columns: minmax(180px, 0.65fr) minmax(0, 1fr);
  }
  .settings-grid {
    gap: 16px;
  }
  .settings-grid > .panel {
    padding: 16px;
  }
}
@media (max-width: 900px) and (min-width: 761px) {
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .review-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .original-image {
    position: static;
  }
  .original-image img {
    max-height: 320px;
  }
  .record-table th:nth-child(4),
  .record-table td:nth-child(4) {
    display: none;
  }
  .question-examples {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 64px;
    padding: 0 16px;
    gap: 8px;
  }
  .brand {
    font-size: 16px !important;
  }
  .user-mark {
    font-size: 12px;
    max-width: 144px;
    text-align: right;
  }
  .main {
    padding: 24px 16px calc(96px + env(safe-area-inset-bottom));
    margin: 0;
    width: 100%;
  }
  .page-head {
    gap: 12px;
    margin-bottom: 16px;
  }
  .page-head h1 {
    font-size: 24px;
  }
  .page-head p {
    max-width: none;
    font-size: 12px;
  }
  .panel {
    padding: 16px;
  }
  .panel-title {
    margin-bottom: 12px;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
  }
  .metrics .metric {
    padding: 16px;
  }
  .metrics .metric.featured {
    grid-column: 1/-1;
  }
  .metrics .metric:nth-child(2),
  .metrics .metric:last-child {
    grid-column: auto;
    display: block;
  }
  .metric strong,
  .metric:nth-child(2) strong {
    font-size: 24px;
  }
  .metric.featured strong {
    font-size: 32px;
  }
  .counts {
    gap: 12px;
    margin-top: 8px;
  }
  .counts strong {
    font-size: 24px;
    display: block;
    margin: 0;
  }
  .counts small {
    display: block;
  }
  .money-breakdown {
    margin-top: 4px;
  }
  .quick-operations {
    gap: 12px;
    margin-bottom: 16px;
  }
  .quick-operations a {
    min-height: 80px;
    min-width: 0;
    padding: 16px;
    font-size: 24px;
  }
  .quick-operations small {
    margin-top: 4px;
    font-size: 12px;
  }
  .dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .dashboard-grid .ai-panel {
    order: -1;
  }
  .ai-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .ai-panel > .eyebrow,
  .ai-panel > p {
    display: none;
  }
  .ai-panel .panel-title {
    margin: 0;
  }
  .ask-entry {
    min-height: 44px;
  }
  .records-panel .record-table tr:nth-child(n + 4) {
    display: none;
  }
  .low-panel .low-row:nth-of-type(n + 4) {
    display: none;
  }
  .record-table,
  .record-table tbody {
    display: block;
  }
  .record-table thead {
    display: none;
  }
  .record-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 4px 8px;
    padding: 12px 0;
  }
  .record-table td {
    height: auto;
    padding: 0 !important;
    min-width: 0;
    border: 0;
  }
  .record-table td:first-child {
    grid-column: 1/-1;
    font-size: 12px;
  }
  .record-table td:first-child small {
    display: inline;
    margin-left: 8px;
  }
  .record-table td:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }
  .record-table td:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }
  .record-table td:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
    font-size: 12px;
    align-self: center;
  }
  .record-table td:nth-child(4) small {
    display: none;
  }
  .record-table td:last-child {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    justify-content: end;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
  }
  .record-table .r-detail {
    font-size: 12px;
  }
  .record-table .record-note {
    max-width: 100%;
  }
  .record-toolbar {
    padding: 8px;
  }
  .date-presets {
    gap: 4px;
  }
  .date-presets button {
    flex: 1;
    padding: 8px !important;
    white-space: nowrap;
  }
  #record-filter {
    flex-direction: column;
    align-items: stretch;
  }
  #record-filter .field-grid {
    grid-template-columns: 1fr 1fr;
  }
  .entry-panel {
    padding: 16px;
    display: block;
  }
  .entry-panel input,
  .entry-panel select,
  .entry-panel textarea {
    min-height: 48px;
    font-size: 16px;
  }
  .entry-panel label {
    font-size: 14px;
  }
  .entry-panel label:has(#entry-currency),
  .entry-panel label:has(#entry-rate):not([hidden]) {
    display: grid;
  }
  .entry-panel .form-section[data-step="2"] .field-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .entry-panel .field-grid .wide {
    grid-column: 1/-1;
  }
  .entry-panel label.rate-override {
    grid-column: 1/-1;
  }
  .mobile-step-heading {
    font-size: 24px;
    margin-bottom: 16px;
  }
  .step-indicator {
    margin-bottom: 16px;
    gap: 8px;
  }
  .step-indicator span {
    padding: 8px 4px;
    font-size: 12px;
  }
  .step-controls {
    gap: 8px;
    margin-top: 24px;
  }
  .step-controls button,
  .entry-panel .form-footer button {
    font-size: 16px;
    min-height: 48px;
  }
  .entry-panel .form-footer {
    margin-top: 16px;
  }
  .entry-panel .subtotal {
    padding-top: 16px;
    gap: 12px;
  }
  .entry-panel .subtotal strong {
    font-size: 24px;
  }
  .selected-product {
    margin-top: 16px;
  }
  .selected-product .product-art {
    width: 48px;
    height: 48px;
  }
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .settings-grid .field-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .settings-grid .actions {
    margin-top: 16px;
  }
  .account-list article {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .account-list .actions {
    width: auto;
  }
  .upload-zone {
    padding: 16px;
    gap: 12px;
  }
  .upload-choices {
    gap: 8px;
  }
  .upload-choices label {
    flex: 1;
  }
  .camera-choice,
  .mobile-choice {
    display: inline-flex !important;
  }
  .desktop-choice,
  .desktop-upload-hint {
    display: none !important;
  }
  .document-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px 0;
  }
  .document-link {
    gap: 12px;
    grid-row: 1/3;
  }
  .document-row .badge {
    justify-self: end;
  }
  .document-actions {
    grid-column: 2;
  }
  .document-thumb {
    width: 48px;
    height: 56px;
  }
  .review-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .original-image {
    position: static;
  }
  .original-image img {
    max-height: 320px;
  }
  .review-line .field-grid {
    grid-template-columns: 0.7fr 1fr 0.8fr;
    gap: 8px;
  }
  .review-line {
    padding: 12px 0;
  }
  .review-line input,
  .review-line select {
    font-size: 16px;
    min-height: 48px;
  }
  .check-label {
    gap: 8px;
    margin: 12px 0;
    font-size: 12px;
  }
  .question-examples {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
    margin-bottom: 0;
  }
  .question-examples button {
    width: auto;
    min-height: 48px;
    padding: 8px !important;
    font-size: 12px;
    text-align: left;
  }
  .question-composer {
    position: fixed;
    bottom: calc(72px + env(safe-area-inset-bottom));
    left: 16px;
    right: 16px;
    margin: 0;
    padding: 8px;
    z-index: 10;
  }
  .question-composer input {
    font-size: 16px;
  }
  .main:has(.question-composer) {
    padding-bottom: calc(176px + env(safe-area-inset-bottom));
  }
  .opening-row {
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 12px;
  }
  .opening-row span {
    font-size: 12px;
  }
  .mobile-nav {
    padding: 4px 8px max(4px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
  }
  .mobile-nav a,
  .mobile-nav button {
    min-height: 64px;
    font-size: 12px;
    padding: 4px 8px !important;
  }
  .mobile-nav .active {
    border-radius: var(--radius);
  }
  .toast {
    bottom: calc(160px + env(safe-area-inset-bottom));
  }
  .login-wrap {
    display: block;
  }
  .login-story {
    padding: 24px;
  }
  .login-story h1 {
    margin-top: 24px;
    font-size: 24px;
  }
  .login-illustration,
  .login-footer {
    display: none;
  }
  .login-form-side {
    padding: 24px;
  }
  .login-story p {
    margin-top: 12px;
  }
  .login-form {
    max-width: none;
  }
  .login-form input {
    font-size: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
@media (min-width: 761px) {
  .review-line {
    display: grid;
    grid-template-columns: 144px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
  }
  .review-line-head {
    flex-wrap: wrap;
    gap: 4px;
  }
  .review-line-head .check-label {
    min-height: 32px;
  }
  .review-product {
    margin: 0;
  }
  .review-line > .field-grid,
  .review-rate,
  .review-line > .helper,
  .review-line > .line-warning {
    grid-column: 1/-1;
  }
}

/* 清除历史 C 版残留字号，只保留 12 / 14 / 16 / 24 / 32 五级。 */
.toplinks,
.wide-link,
.error-text,
.login-form a,
.section-label span,
.side-note p,
.side-note dl div {
  font-size: 12px;
}
.panel h2,
.inventory-card h3,
.selected-product h3 {
  font-size: 16px;
}
.c-desktop-recent td,
.inventory-card .card-bottom {
  font-size: 14px;
}
.inventory-card .card-bottom strong,
.subtotal strong {
  font-size: 24px;
}
.c-desktop-recent {
  margin-top: 24px;
}
.table-note,
.toolbar {
  margin-bottom: 16px;
}
.toolbar {
  gap: 16px;
}
.inventory-card .card-bottom {
  gap: 8px;
  margin-top: 16px;
}
.side-note h3 {
  margin: 16px 0 8px;
}
.side-note dl {
  margin-top: 16px;
}
.form-footer {
  margin-top: 24px;
}
.section-label span {
  border-radius: var(--radius);
}
.review-line-head {
  flex-wrap: wrap;
}
.review-line-head > p {
  flex-basis: 100%;
}
.upload-zone:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.stock-desktop td button,
.product-desktop td button {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 4px 8px;
  min-height: 44px;
  white-space: nowrap;
}
.stock-desktop td button:hover,
.product-desktop td button:hover {
  background: var(--soft);
}
.stock-desktop th:last-child,
.product-desktop th:last-child {
  width: 200px;
}
.stock-desktop td:last-child,
.product-desktop td:last-child {
  white-space: nowrap;
}
@media (max-width: 1100px) and (min-width: 761px) {
  .stock-desktop th:last-child,
  .product-desktop th:last-child {
    width: 168px;
  }
  .stock-desktop td:last-child .badge.warn + .badge {
    display: none;
  }
}

.review-line .field-grid:has(.review-rate:not([hidden])) {
  grid-template-columns: 0.7fr 1fr 0.8fr 1fr;
}
.review-line .field-grid .review-rate {
  grid-column: auto;
  margin: 0;
}
@media (max-width: 760px) {
  .review-line .field-grid:has(.review-rate:not([hidden])) {
    grid-template-columns: 1fr 1fr;
  }
  .user-mark {
    white-space: nowrap;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .brand {
    flex-shrink: 0;
  }
}
.login-form > p {
  font-size: 14px;
}
.future-entry {
  margin-bottom: 16px;
}
.entry-panel .section-label {
  margin-bottom: 16px;
}
.entry-panel .field-grid {
  gap: 16px;
}
.entry-panel .step-controls {
  margin-top: 24px;
}
.stock-desktop td {
  padding-top: 12px;
  padding-bottom: 12px;
}
.settings-grid th {
  padding: 12px 8px;
}
input[type="checkbox"] {
  margin: 0;
}
/* 平板和窄桌面改用两列商品卡片，避免表格把型号名称挤成竖排。 */
@media (min-width: 761px) and (max-width: 1100px) {
  .stock-desktop,
  .product-desktop {
    display: none;
  }
  .stock-mobile,
  .product-mobile {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .inventory-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    padding: 16px;
    min-width: 0;
  }
  .inventory-card.low {
    background: var(--danger-bg);
  }
  .inventory-card .card-top {
    display: flex;
    gap: 12px;
    align-items: center;
  }
  .inventory-card .card-top > div {
    min-width: 0;
  }
  .inventory-card h3 {
    overflow-wrap: anywhere;
    font-size: 14px;
  }
  .inventory-card .product-art {
    width: 48px;
    flex: none;
  }
  .inventory-card .card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }
  .inventory-card .card-bottom strong {
    font-size: 24px;
  }
  .inventory-card button {
    min-height: 44px;
  }
}
@media (max-width: 760px) {
  .toplinks {
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
  }
  .user-mark {
    max-width: 100%;
    padding-left: 0;
  }
}

/* 明细表日期列的“第 N 笔 · 类型”不折行，避免被挤成两行 */
.record-table td:first-child small{white-space:nowrap}
