/* 03 锦红票据：正式工作台。 */
:root {
  --ink: #2d2c27;
  --muted: #887663;
  --line: #dfcebb;
  --paper: #f3e9dc;
  --card: #fffaf0;
  --red: #9f302c;
  --soft: #f3e8d7;
  --green: #3b6550;
  --amber: #896327;
  --serif: "Songti SC","STSong",Georgia,serif;
  --sans: -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  --mono: "SFMono-Regular",Consolas,"Liberation Mono",monospace
}

* {
  box-sizing: border-box
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 20px
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 14px/1.55 var(--sans)
}

a {
  color: inherit;
  text-decoration: none
}

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

button {
  cursor: pointer
}

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

button:focus-visible,a:focus-visible,summary:focus-visible,select:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px
}

h1,h2,p {
  margin: 0
}

h1 {
  font: 600 28px/1.2 var(--serif)
}

h2 {
  font: 600 23px/1.3 var(--serif)
}

.hidden {
  display: none!important
}

.shell {
  width: min(1280px,calc(100% - 96px));
  margin: auto
}

.red-banner {
  background: var(--red);
  border-bottom: 5px solid #ba885c;
  color: #fff0d7
}

.banner-inner {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  white-space: nowrap
}

.brand-seal {
  width: 43px;
  height: 45px;
  display: grid;
  place-items: center;
  border: 1px solid #ead1a0;
  border-radius: 3px;
  color: #ead1a0;
  font: 29px var(--serif)
}

.brand-caption {
  display: block;
  margin-top: 8px;
  font: 8px/1.3 var(--sans);
  letter-spacing: .16em;
  color: #ecc9ac
}

.navigation {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 12px
}

.navigation a,.navigation button {
  padding: 10px 0;
  color: #e4bcb0;
  background: none;
  border: 0;
  white-space: nowrap
}

.navigation .active,.navigation a:hover,.navigation button:hover {
  color: #fff4d9
}

.navigation .active {
  font-weight: 600
}

.red-banner button:focus-visible,.red-banner a:focus-visible {
  outline-color: #fff4d9
}

.banner-right {
  display: flex;
  align-items: center;
  gap: 20px
}

.banner-date {
  font: 11px var(--mono);
  letter-spacing: .06em;
  text-align: right
}

.banner-date small {
  display: block;
  margin-top: 6px;
  font: 9px var(--sans);
  color: #e8c4aa
}

.logout-button {
  padding: 7px 0 7px 16px;
  border: 0;
  border-left: 1px solid #e5c8ad60;
  background: transparent;
  color: #e4bcb0;
  font-size: 10px;
  white-space: nowrap
}

.section-kicker {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .17em;
  margin-bottom: 4px
}

.muted {
  color: var(--muted);
  font-size: 11px
}

.button {
  min-height: 41px;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 10px 14px;
  font-size: 12px;
  transition: background .15s
}

.button-primary {
  background: var(--red);
  color: #fff7e9
}

.button-primary:hover:not(:disabled) {
  background: #882622
}

.button-quiet {
  background: transparent;
  border-color: var(--line)
}

.button-quiet:hover:not(:disabled) {
  background: var(--soft)
}

.text-button {
  background: none;
  border: 0;
  padding: 5px 0;
  color: var(--red);
  font-size: 11px;
  white-space: nowrap
}

.text-button:hover {
  text-decoration: underline
}

.login-panel {
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 36px;
  margin: 60px auto
}

.login-panel h2 {
  margin-top: 12px;
  font-size: 26px;
  line-height: 1.5
}

.login-panel .muted {
  margin-top: 9px;
  font-size: 12px
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 27px
}

.login-form label {
  font-size: 11px;
  color: var(--muted)
}

.login-form input {
  border: 1px solid var(--line);
  background: #fffdf8;
  padding: 10px 12px;
  border-radius: 3px;
  min-width: 0
}

.login-form input:focus {
  outline: 2px solid #9f302c30;
  border-color: var(--red)
}

.login-form .button {
  margin-top: 8px
}

.login-note {
  color: var(--muted);
  font-size: 10px;
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 16px
}

.error-message {
  min-height: 1.6em;
  color: var(--red);
  font-size: 11px;
  margin-top: 12px;
  overflow-wrap: anywhere
}

.ticket-workspace {
  display: grid;
  grid-template-columns: 218px minmax(0,1fr);
  align-items: stretch;
  margin-top: 28px;
  background: var(--card);
  border: 1px solid var(--line)
}

.ticket-stub {
  padding: 25px 23px;
  position: relative;
  border-right: 1px dashed #c8ac8e
}

.ticket-stub::before,.ticket-stub::after {
  content: "";
  position: absolute;
  right: -9px;
  width: 16px;
  height: 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper)
}

.ticket-stub::before {
  top: -9px
}

.ticket-stub::after {
  bottom: -9px
}

.date-block {
  display: flex;
  flex-direction: column;
  gap: 4px
}

.date-block>span {
  font-size: 10px;
  color: var(--muted)
}

.date-block>span:first-child {
  font: 10px var(--mono)
}

.date-block strong {
  font: 500 88px/1 var(--serif);
  letter-spacing: -.04em;
  color: var(--red)
}

.vertical-rule {
  display: block;
  width: 25px;
  border-top: 2px solid var(--red);
  margin: 23px 0
}

.stub-title h2 {
  font-size: 38px;
  line-height: 1.4;
  margin-top: 8px;
  color: var(--red)
}

.stub-copy {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.9;
  margin-top: 14px
}

.stub-metrics {
  display: flex;
  gap: 24px;
  margin-top: 24px
}

.stub-metrics>div>span {
  font-size: 10px;
  color: var(--muted)
}

.stub-metrics strong {
  display: block;
  font: 500 28px/1.3 var(--mono);
  margin-top: 3px;
  letter-spacing: -.04em
}

.stub-metrics small {
  font: 10px var(--sans);
  margin-left: 6px;
  color: var(--muted)
}

.stub-actions {
  display: grid;
  gap: 9px;
  margin-top: 25px
}

.stub-actions .button {
  padding-left: 8px;
  padding-right: 8px
}

.stub-bottom {
  margin-top: 27px;
  font-size: 9px;
  line-height: 1.8;
  color: var(--muted)
}

.stub-bottom p+p {
  margin-top: 14px
}

.stub-bottom>span {
  display: block;
  margin-top: 16px;
  color: var(--red);
  font: 8px var(--mono);
  letter-spacing: .03em
}

.ticket-main {
  padding: 0 23px 20px;
  min-width: 0
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 10px
}

.section-heading h2 {
  font-size: 21px
}

.heading-date {
  margin-left: 14px;
  font: 10px var(--mono);
  color: var(--muted);
  white-space: nowrap
}

.empty-state {
  font-size: 12px;
  color: var(--muted);
  padding: 25px 0
}

.current-panel>.section-heading {
  padding-top: 23px
}

.badge {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px
}

.badge::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%
}

.badge-success {
  color: var(--red)
}

.badge-running {
  color: var(--amber)
}

.badge-error {
  color: #b52820
}

.batch-card {
  border: 1px solid var(--line);
  min-width: 0
}

.current-card {
  border: 0
}

.batch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: var(--soft)
}

.batch-header strong {
  font-size: 13px;
  font-weight: 500
}

.batch-meta {
  font-size: 9px;
  color: var(--muted)
}

.batch-controls {
  display: flex;
  align-items: center;
  gap: 12px
}

.current-card>.batch-header {
  background: transparent;
  padding: 0 0 10px
}

.current-card>.batch-header .batch-meta {
  font-size: 10px
}

.progress-box {
  padding: 9px 12px 12px
}

.current-card>.progress-box {
  padding: 0 0 10px
}

.progress-line,.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px
}

.progress-line {
  font-size: 10px
}

.progress-line strong {
  color: var(--red);
  font-weight: 600
}

.progress-line>span,.progress-meta {
  font-size: 9px;
  color: var(--muted)
}

.progress-track {
  height: 3px;
  background: var(--line);
  margin: 6px 0 5px
}

.progress-track>span {
  display: block;
  height: 100%;
  background: var(--red);
  transition: width .25s
}

.progress-warning {
  margin-top: 6px;
  font-size: 10px;
  color: var(--amber)
}

.column-head {
  display: grid;
  grid-template-columns: 190px 1fr 194px;
  padding: 7px 0 7px 26px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-size: 9px;
  color: var(--muted)
}

.column-head>span:last-child {
  text-align: right
}

.plan-list {
  min-width: 0
}

.plan-row {
  display: grid;
  grid-template-columns: 17px 181px minmax(0,1fr) 194px;
  gap: 9px;
  align-items: center;
  border-bottom: 1px dashed var(--line);
  min-height: 55px;
  padding: 7px 0
}

.plan-row:last-child {
  border-bottom: 0
}

.row-index {
  color: var(--muted);
  font: 9px var(--mono)
}

.plan-ident {
  min-width: 0
}

.source-label {
  display: block;
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted)
}

.plan-label {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600
}

.plan-detail {
  font-size: 9px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
  border-left: 1px solid var(--line);
  padding-left: 6px
}

.pool-detail {
  display: block;
  font-size: 8px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 1px
}

.numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  color: #111;
  font: 600 19px/1.4 var(--mono);
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums
}

.numbers>span {
  display: inline-block
}

.numeric-text {
  font-variant-numeric: tabular-nums
}

.numbers-placeholder {
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere
}

.numbers-placeholder.error {
  color: var(--red)
}

.plan-side {
  display: grid;
  justify-items: end;
  align-items: center;
  gap: 3px;
  min-width: 0
}

.plan-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 9px
}

.tiny-button {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 3px 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
  background: transparent;
  white-space: nowrap
}

.tiny-button:hover {
  color: var(--red);
  border-color: var(--red)
}

.retry-button {
  color: var(--red)
}

.settlement,.source-history {
  max-width: 100%;
  font-size: 9px;
  line-height: 1.4;
  color: var(--muted);
  overflow-wrap: anywhere;
  text-align: right
}

.settlement strong {
  font-weight: 500;
  color: var(--ink)
}

.settlement.error,.source-history.warning {
  color: var(--red)
}

.settlement.pending {
  color: var(--muted)
}

.source-history.saved {
  color: var(--green)
}

.source-history.pending {
  color: var(--amber)
}

.batch-footer {
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 9px;
  color: var(--muted)
}

.history-panel {
  margin-top: 22px;
  scroll-margin-top: 20px
}

.history-toolbar {
  padding-top: 0;
  padding-bottom: 10px
}

.history-toolbar h2 {
  font-size: 19px
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 18px
}

.toolbar-actions select {
  min-width: 0;
  max-width: 150px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 5px 15px 5px 0;
  font-size: 10px
}

#settle-message:not(:empty) {
  padding: 5px 0 12px;
  font-size: 10px
}

.batch-list {
  display: grid
}

.archive-node {
  min-width: 0
}

.archive-year {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line)
}

.archive-year+.archive-year {
  border-top: 0
}

.archive-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  padding: 12px 0
}

.archive-summary::-webkit-details-marker {
  display: none
}

.archive-summary::after {
  content: "＋";
  font: 16px var(--sans);
  color: var(--red);
  transition: transform .15s
}

.archive-node[open]>.archive-summary::after {
  transform: rotate(45deg)
}

.archive-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500
}

.archive-count {
  font-size: 10px;
  color: var(--muted)
}

.archive-year>.archive-summary .archive-name {
  font: 500 22px var(--serif)
}

.archive-months,.archive-days {
  padding: 0 8px 8px
}

.archive-month>.archive-summary,.archive-day>.archive-summary {
  border-top: 1px solid var(--line);
  padding: 10px 0
}

.archive-batches {
  display: grid;
  gap: 12px;
  padding: 0 0 10px
}

.archive-batches .plan-row {
  padding: 8px 10px;
  grid-template-columns: 17px 166px minmax(0,1fr) 194px
}

.archive-batches .column-head {
  padding-left: 36px;
  padding-right: 10px;
  grid-template-columns: 175px 1fr 194px;
  border-top-color: var(--line);
  border-bottom-color: var(--line)
}

.archive-batches .numbers {
  font-size: 17px;
  gap: 7px
}

.archive-batches .batch-footer {
  padding: 9px 12px
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  color: var(--muted);
  font-size: 9px;
  padding: 23px 0
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  padding: 10px;
  background: var(--card);
  z-index: 100
}

.skip-link:focus {
  top: 12px
}

.exit-photo {
  position: fixed;
  right: 18px;
  top: 12px;
  background: #302e27;
  color: #fff7e9;
  border: 0;
  border-radius: 3px;
  padding: 9px 12px;
  font-size: 10px;
  z-index: 30
}

/* 拍照视图只保留当前批次，目标日期绑定该批次。 */
.photo-mode .navigation,.photo-mode .banner-right,.photo-mode .ticket-stub,.photo-mode .history-panel,.photo-mode .page-footer,.photo-mode .plan-side,.photo-mode .column-head,.photo-mode .progress-box,.photo-mode .batch-controls,.photo-mode #current-status {
  display: none!important
}

.photo-mode .red-banner {
  background: transparent;
  color: var(--ink);
  border: 0
}

.photo-mode .brand-seal {
  color: var(--red);
  border-color: var(--line)
}

.photo-mode .brand-caption {
  color: var(--muted)
}

.photo-mode .banner-inner {
  min-height: 90px
}

.photo-mode .shell {
  width: min(1120px,calc(100% - 48px))
}

.photo-mode .ticket-workspace {
  display: block;
  margin-top: 0
}

.photo-mode .ticket-main {
  padding: 0 24px 18px
}

.photo-mode .plan-row {
  grid-template-columns: 20px 220px minmax(0,1fr);
  min-height: 64px;
  padding: 12px 0
}

.photo-mode .numbers {
  font-size: 24px;
  gap: 14px
}

.photo-mode .current-card>.batch-header {
  padding-bottom: 13px
}

@media(min-width:1550px) {
  .shell {
    width: min(1360px,calc(100% - 120px))
  }

  .numbers {
    font-size: 20px;
    gap: 12px
  }

}

@media(max-width:1190px) and (min-width:761px) {
  .shell {
    width: calc(100% - 48px)
  }

  .ticket-workspace {
    grid-template-columns: 175px minmax(0,1fr)
  }

  .ticket-stub {
    padding: 23px 16px
  }

  .ticket-main {
    padding-left: 17px;
    padding-right: 17px
  }

  .stub-title h2 {
    font-size: 33px
  }

  .stub-metrics {
    gap: 15px
  }

  .stub-metrics strong {
    font-size: 25px
  }

  .stub-actions .button {
    font-size: 10px
  }

  .banner-date {
    display: none
  }

  .navigation {
    gap: 20px
  }

  .plan-row,.archive-batches .plan-row {
    grid-template-columns: 145px minmax(0,1fr) 150px;
    padding-left: 0;
    padding-right: 0
  }

  .row-index {
    display: none
  }

  .column-head,.archive-batches .column-head {
    grid-template-columns: 154px 1fr 150px;
    padding-left: 0;
    padding-right: 0
  }

  .numbers,.archive-batches .numbers {
    font-size: 17px;
    gap: 6px
  }

  .plan-actions {
    gap: 6px
  }

  .plan-actions .badge,.tiny-button {
    font-size: 8px
  }

  .photo-mode .row-index {
    display: block
  }

}

@media(max-width:760px) {
  .shell {
    width: calc(100% - 30px)
  }

  .banner-inner {
    min-height: 0;
    flex-wrap: wrap;
    gap: 18px;
    padding: 20px 0 17px
  }

  .brand {
    gap: 10px
  }

  .brand h1 {
    font-size: 24px
  }

  .brand-seal {
    width: 34px;
    height: 37px;
    font-size: 25px
  }

  .brand-caption {
    font-size: 7px;
    letter-spacing: .1em;
    margin-top: 6px
  }

  .navigation {
    order: 3;
    width: 100%;
    gap: 26px;
    font-size: 11px
  }

  .navigation a,.navigation button {
    padding: 0
  }

  .banner-right {
    margin-left: auto
  }

  .banner-date {
    display: none
  }

  .logout-button {
    border: 0;
    padding: 5px 0;
    font-size: 9px
  }

  .login-panel {
    padding: 27px 24px;
    margin: 30px 0
  }

  .login-panel h2 {
    font-size: 23px
  }

  .ticket-workspace {
    display: block;
    margin-top: 18px
  }

  .ticket-stub {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 0 16px;
    padding: 18px;
    border-right: 0;
    border-bottom: 1px dashed #c8ac8e
  }

  .ticket-stub::before,.ticket-stub::after {
    top: auto;
    bottom: -9px
  }

  .ticket-stub::before {
    left: -9px;
    right: auto
  }

  .date-block {
    grid-column: 1;
    grid-row: 1
  }

  .date-block strong {
    font-size: 58px
  }

  .date-block>span,.date-block>span:first-child {
    font-size: 8px
  }

  .stub-title {
    grid-column: 2;
    grid-row: 1
  }

  .vertical-rule {
    display: none
  }

  .stub-title h2 {
    font-size: 26px;
    margin-top: 2px
  }

  .stub-title h2 br,.stub-copy br {
    display: none
  }

  .stub-copy {
    font-size: 9px;
    margin-top: 5px
  }

  .stub-metrics {
    grid-column: 1/-1;
    gap: 33px;
    margin-top: 17px
  }

  .stub-metrics>div>span {
    font-size: 9px
  }

  .stub-metrics strong {
    font-size: 25px
  }

  .stub-actions {
    grid-column: 1/-1;
    display: flex;
    margin-top: 15px;
    gap: 9px
  }

  .stub-actions .button {
    font-size: 11px;
    padding: 9px 12px;
    min-height: 38px
  }

  .stub-bottom {
    grid-column: 1/-1;
    margin-top: 13px;
    font-size: 8px
  }

  .stub-bottom p {
    display: inline
  }

  .stub-bottom p+p {
    display: none
  }

  .stub-bottom p br {
    display: none
  }

  .stub-bottom>span {
    display: none
  }

  .ticket-main {
    padding: 0 13px 16px
  }

  .current-panel>.section-heading {
    padding-top: 19px
  }

  .section-heading {
    gap: 9px;
    padding-bottom: 11px
  }

  .section-heading h2 {
    font-size: 20px
  }

  .heading-date {
    margin-left: 9px;
    font-size: 9px
  }

  .current-card>.batch-header {
    padding-bottom: 11px;
    gap: 5px
  }

  .current-card>.batch-header .batch-meta {
    font-size: 8px
  }

  .batch-controls {
    gap: 7px
  }

  .batch-meta {
    font-size: 8px
  }

  .progress-line,.progress-meta {
    gap: 6px
  }

  .progress-line {
    font-size: 10px
  }

  .progress-line>span,.progress-meta {
    font-size: 8px
  }

  .progress-line strong {
    max-width: 70%;
    overflow-wrap: anywhere
  }

  .progress-meta {
    align-items: flex-start
  }

  .progress-meta>span:first-child {
    flex: 1;
    min-width: 0
  }

  .column-head {
    display: none
  }

  .plan-row,.archive-batches .plan-row {
    grid-template-columns: 17px minmax(0,1fr);
    gap: 5px 8px;
    min-height: 0;
    padding: 12px 0
  }

  .row-index {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    margin-top: 3px
  }

  .plan-ident {
    grid-column: 2;
    grid-row: 1
  }

  .source-label {
    font-size: 10px;
    display: inline;
    margin-right: 7px
  }

  .plan-label {
    font-size: 12px;
    display: inline
  }

  .plan-detail {
    font-size: 8px;
    margin-left: 5px;
    padding-left: 5px
  }

  .pool-detail {
    font-size: 8px
  }

  .numbers,.archive-batches .numbers {
    grid-column: 2;
    grid-row: 2;
    font-size: 18px;
    gap: 7px;
    line-height: 1.5;
    margin-top: 3px
  }

  .numbers-placeholder {
    grid-column: 2;
    grid-row: 2;
    font-size: 10px
  }

  .plan-side {
    grid-column: 2;
    grid-row: 3;
    justify-items: start;
    gap: 3px
  }

  .plan-actions {
    justify-content: flex-start;
    gap: 11px
  }

  .plan-actions .badge,.tiny-button {
    font-size: 9px
  }

  .settlement,.source-history {
    font-size: 9px;
    text-align: left
  }

  .batch-footer {
    font-size: 8px;
    display: block;
    padding-top: 12px
  }

  .batch-footer>span {
    display: block
  }

  .batch-footer>span+span {
    margin-top: 3px
  }

  .history-panel {
    margin-top: 25px
  }

  .history-toolbar {
    flex-wrap: wrap
  }

  .history-toolbar h2 {
    font-size: 20px
  }

  .toolbar-actions {
    gap: 13px;
    width: 100%;
    justify-content: space-between
  }

  .toolbar-actions select {
    max-width: 150px;
    font-size: 10px
  }

  .text-button {
    font-size: 10px
  }

  .archive-year>.archive-summary .archive-name {
    font-size: 21px
  }

  .archive-summary {
    gap: 7px
  }

  .archive-count {
    font-size: 9px
  }

  .archive-months,.archive-days {
    padding-left: 4px;
    padding-right: 4px
  }

  .archive-batches .plan-row {
    padding: 12px 8px
  }

  .archive-batches .source-label {
    font-size: 9px
  }

  .archive-batches .plan-label {
    font-size: 11px
  }

  .archive-batches .numbers {
    font-size: 16px;
    gap: 6px
  }

  .batch-header {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    padding: 9px
  }

  .page-footer {
    font-size: 8px;
    display: block;
    line-height: 1.9;
    padding: 18px 0
  }

  .page-footer>span {
    display: block
  }

  .photo-mode .shell {
    width: calc(100% - 24px)
  }

  .photo-mode .banner-inner {
    min-height: 0;
    padding: 24px 0
  }

  .photo-mode .brand-seal {
    display: none
  }

  .photo-mode .brand h1 {
    font-size: 23px
  }

  .photo-mode .ticket-main {
    padding: 0 12px 14px
  }

  .photo-mode .plan-row {
    grid-template-columns: 16px minmax(0,1fr);
    min-height: 0;
    padding: 9px 0;
    gap: 2px 6px
  }

  .photo-mode .numbers {
    font-size: 17px;
    gap: 6px;
    margin-top: 2px
  }

  .photo-mode .source-label {
    font-size: 9px;
    margin-right: 6px
  }

  .photo-mode .plan-label {
    font-size: 10px
  }

  .photo-mode .pool-detail {
    display: none
  }

  .photo-mode .plan-detail {
    font-size: 8px
  }

  .photo-mode .row-index {
    font-size: 8px
  }

  .photo-mode .batch-meta {
    font-size: 8px
  }

  .exit-photo {
    top: 10px;
    right: 12px;
    padding: 7px 9px;
    font-size: 9px
  }

}

@media(max-width:350px) {
  .shell {
    width: calc(100% - 24px)
  }

  .brand h1 {
    font-size: 22px
  }

  .brand-caption {
    font-size: 6px
  }

  .brand {
    gap: 8px
  }

  .numbers {
    font-size: 17px;
    gap: 6px
  }

  .source-label {
    font-size: 9px
  }

  .plan-label {
    font-size: 11px
  }

  .photo-mode .numbers {
    font-size: 15px;
    gap: 4px
  }

  .photo-mode .source-label {
    font-size: 8px
  }

  .photo-mode .plan-label {
    font-size: 9px
  }

  .stub-actions .button {
    padding: 9px 10px;
    font-size: 10px
  }

}

@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior: auto
  }

  *,*::before,*::after {
    transition: none!important
  }

}

@media print {
  body {
    background: white
  }

  .navigation,.banner-right,.ticket-stub,.history-panel,.page-footer,.exit-photo,.plan-side,.batch-controls,.progress-box,.column-head,#current-status {
    display: none!important
  }

  .red-banner {
    background: transparent;
    color: black;
    border: 0
  }

  .brand-seal,.brand-caption {
    color: #555
  }

  .shell {
    width: 100%
  }

  .ticket-workspace {
    display: block;
    margin-top: 0
  }

  .plan-row {
    grid-template-columns: 20px 200px minmax(0,1fr);
    break-inside: avoid
  }

  .numbers {
    color: black
  }

}

/* 2026-10-13: cumulative reference profit and compact per-plan results. */
.profit-summary { margin-bottom: 25px }
.profit-total { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--card) }
.profit-total h2 { font: 600 15px var(--sans) }
.profit-summary-note { margin-top: 6px; font-size: 11px; color: var(--muted) }
.profit-total-value { font-size: 32px; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; color: #60564b }
.profit-sources-heading { font-size: 12px; font-weight: 600; margin: 16px 0 9px; color: var(--muted) }
.profit-source-list { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px }
.profit-source-card { padding: 14px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); min-width: 0 }
.profit-source-card h4 { margin: 0; font-size: 11px; font-weight: 600; min-height: 33px; line-height: 1.5; overflow-wrap: anywhere }
.profit-source-value { display: block; font-size: 23px; line-height: 1.4; margin: 6px 0; color: #60564b; font-variant-numeric: tabular-nums; overflow-wrap: anywhere }
.profit-source-card p { font-size: 10px; color: var(--muted); line-height: 1.6 }
.profit-source-positive,.plan-row-positive { background: #fbf1d6 }
.positive { color: #855900 }
.profit-source-unconfirmed { color: #998a78; font-size: 18px }
.profit-summary-scope { font-size: 10px; color: var(--muted); margin-top: 9px }
.plan-row { min-height: 86px; padding-top: 12px; padding-bottom: 12px }
.plan-result-actions { display: flex; justify-content: flex-end; align-items: center; gap: 18px; width: 100% }
.plan-result { text-align: right; min-width: 0 }
.result-profit { font-size: 26px; font-weight: 750; line-height: 1.2; color: #60564b; white-space: nowrap; font-variant-numeric: tabular-nums }
.result-profit.positive { color: #855900 }
.result-detail { font-size: 13px; color: #75695c; margin-top: 5px; white-space: nowrap }
.result-pending,.result-unconfirmed { font-size: 19px; font-weight: 600; color: #998a78; text-align: right }
.result-note { font-size: 9px; color: var(--amber); margin-top: 4px; overflow-wrap: anywhere }
.plan-copy-button { font: 14px var(--sans); border: 1px solid #ceb592; border-radius: 7px; background: #fffaf0; min-width: 64px; min-height: 40px; padding: 8px 12px; white-space: nowrap; flex-shrink: 0 }
.plan-copy-button:hover { background: #f5e9d7 }
.plan-result-actions .settlement { text-align: right; white-space: normal }
.photo-mode .profit-summary { display: none }
.photo-mode .plan-row-positive { background: transparent }
.photo-mode .plan-row { min-height: 64px }
@media(max-width:1100px) {
  .profit-source-list { grid-template-columns: repeat(3,minmax(0,1fr)) }
  .plan-result-actions { gap: 12px }
  .result-profit { font-size: 23px }
  .result-detail { font-size: 11px }
  .plan-copy-button { min-width: 58px; font-size: 13px }
}
@media(max-width:760px) {
  .profit-total { padding: 16px; gap: 10px; flex-wrap: wrap }
  .profit-total h2 { font-size: 13px }
  .profit-total-value { font-size: 27px; margin-left: auto; white-space: normal; overflow-wrap: anywhere }
  .profit-summary-note { font-size: 10px }
  .profit-source-list { grid-template-columns: repeat(2,minmax(0,1fr)) }
  .profit-source-card:last-child:nth-child(odd) { grid-column: 1/-1 }
  .profit-source-card h4 { min-height: 0 }
  .profit-source-value { font-size: 23px }
  .profit-source-unconfirmed { font-size: 18px }
  .plan-side { justify-items: stretch; justify-self: stretch; margin-top: 6px }
  .plan-result-actions { justify-content: flex-end; gap: 20px }
  .result-profit { font-size: 26px }
  .result-detail { font-size: 13px }
  .result-unconfirmed { font-size: 19px }
  .plan-copy-button { min-width: 64px; font-size: 14px }
  .photo-mode .plan-row { min-height: 0; padding-top: 9px; padding-bottom: 9px }
}

/* Today's generation reminder: approved Demo style. */
.today-generation-status { padding: 0; margin: 16px 0 18px; color: var(--muted); font: 400 12px/1.6 var(--sans) }
.today-generation-status::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: currentColor; vertical-align: middle }
.today-generation-status.today-not-generated { color: var(--red); font-family: "Songti SC","STSong",serif; font-size: 38px; font-weight: 800; line-height: 1.4; animation: today-reminder 1.8s ease-in-out infinite }
.today-generation-status.today-generated { color: var(--green) }
@keyframes today-reminder { 0%,100% { opacity: 1 } 50% { opacity: .3 } }
@media(max-width:1190px) and (min-width:761px) { .today-generation-status.today-not-generated { font-size: 33px } }
@media(max-width:760px) { .today-generation-status.today-not-generated { font-size: 26px } }
@media(prefers-reduced-motion:reduce) { .today-generation-status.today-not-generated { animation: none } }
.photo-mode .today-generation-status { display: none }
