* { box-sizing: border-box; }
:root {
  color-scheme: light;
  font: 16px/1.55 "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: #1b3028;
  background: #f3f6f3;
  --green: #22664e;
  --receipt-error: #b4232c;
  --line: #dce5de;
  --muted: #53675d;
}
body { margin: 0; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible, .stream:focus-visible { outline: 3px solid #588e75; outline-offset: 3px; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
.shell { width: min(1200px, calc(100% - 64px)); margin: 0 auto; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.brand-row { height: 64px; display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 750; letter-spacing: .035em; }
.connection { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.connection i { width: 8px; height: 8px; border-radius: 50%; background: #ac803d; }
.connection.online i { background: #31835c; }
.page-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 26px 0 18px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(25px, 2.5vw, 32px); line-height: 1.3; letter-spacing: -.035em; }
h2 { font-size: 18px; font-weight: 700; line-height: 1.4; }
.page-heading time, .meta { font-size: 14px; color: var(--muted); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(265px, 310px); gap: 20px; align-items: start; padding-bottom: 24px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 3px 12px #203b2906; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 23px; }
.chat { display: flex; flex-direction: column; height: clamp(480px, calc(100dvh - 180px), 850px); min-width: 0; overflow: hidden; }
.chat .panel-head { border-bottom: 1px solid var(--line); }
.stream { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; background: #fbfcfa; padding: 18px 22px; }
.empty { min-height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 12px; }
.empty-art { width: 74px; height: 63px; position: relative; margin-bottom: 15px; }
.bubble-back, .bubble-front { position: absolute; width: 48px; height: 36px; border-radius: 12px 12px 12px 4px; }
.bubble-back { left: 3px; top: 6px; background: #d6e7db; transform: rotate(-12deg); }
.bubble-front { right: 4px; top: 17px; background: var(--green); transform: rotate(6deg); display: flex; gap: 4px; align-items: center; justify-content: center; box-shadow: 0 3px 0 2px #fbfcfa; }
.bubble-front i { width: 4px; height: 4px; border-radius: 50%; background: #eef8ee; }
.empty h3 { font-size: 21px; }
.empty p { color: var(--muted); margin: 6px 0 16px; }
.examples { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; }
.examples button, .older { background: #fff; border: 1px solid #cddcd2; border-radius: 8px; color: var(--green); padding: 5px 11px; font-size: 14px; }
.examples button:hover, .older:hover, .report-action button:hover { background: #edf5ef; }
.older { display: block; margin: 0 auto 14px; }
.composer { padding: 14px 19px 13px; border-top: 1px solid var(--line); }
textarea { display: block; width: 100%; min-height: 54px; max-height: 150px; resize: vertical; padding: 4px 3px; border: 0; border-radius: 4px; color: #1b3028; background: white; line-height: 1.5; }
textarea::placeholder { color: #75857b; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.shortcut { color: var(--muted); font-size: 13px; }
kbd { font-family: inherit; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; background: #f9faf8; }
.send { min-width: 75px; padding: 7px 18px; border: 0; border-radius: 8px; font-weight: 600; color: #fff; background: var(--green); }
.send:hover:enabled { background: #194e3c; }
.send:disabled { background: #dce8de; color: #5d7263; }
.sidebar { display: grid; gap: 15px; }
.draw-panel { min-width: 0; padding: 15px; }
.draw-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.draw-heading h2 { margin: 0; }
.draw-heading button.secondary { padding: 4px 10px; font-size: 14px; }
.draw-row { display: grid; grid-template-columns: 3.3rem minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.draw-row + .draw-row { margin-top: 7px; }
.draw-row input { width: 100%; min-width: 0; height: 34px; padding: 4px 6px; border: 1px solid #c8d8cd; border-radius: 6px; background: #fff; color: inherit; font: inherit; font-size: 14px; }
.draw-row input[name="name"] { background: #f4f8f5; font-weight: 600; text-overflow: ellipsis; }
.draw-row input[name="numbers"] { font-variant-numeric: tabular-nums; }
.draw-row input:focus-visible { outline: 2px solid #588e75; outline-offset: 1px; }
.draw-row button.secondary { padding: 5px 8px; height: 34px; font-size: 14px; }
.draw-hint { margin-top: 9px; color: var(--muted); font-size: 12px; }
.draw-panel .form-message:not(:empty) { margin-top: 6px; }
#draw-history { margin-top: 10px; border-top: 1px solid var(--line); }
#draw-history a { display: inline-block; margin-top: 6px; color: var(--green); font-size: 13px; }
#draw-history-scroll { max-height: 260px; overflow: auto; margin-top: 6px; }
.draw-history-table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.draw-history-table th, .draw-history-table td { text-align: left; padding: 4px; overflow-wrap: anywhere; }
.draw-history-table thead { color: var(--muted); }
.draw-history-table .draw-date { background: #edf5ef; }
.draw-history-table strong { color: var(--green); white-space: nowrap; }
.summary { overflow: hidden; }
.total-block { position: relative; overflow: hidden; margin: 0 16px; padding: 19px 20px; border-radius: 11px; background: #205341; color: #fff; }
.total-block::after { content: ""; position: absolute; width: 115px; height: 115px; right: -44px; top: 10px; transform: rotate(-24deg); border: 1px solid #49745d; border-radius: 13px; box-shadow: 0 0 0 9px #205341, 0 0 0 10px #3d6953, 0 0 0 19px #205341, 0 0 0 20px #375e4b; }
.total-label, .booked { position: relative; z-index: 1; font-size: 14px; color: #e0f1e5; }
.grand-total { position: relative; display: block; z-index: 1; font: 650 clamp(32px, 3.3vw, 44px)/1.22 "Segoe UI", "Microsoft YaHei", sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -.045em; margin: 3px 0 7px; overflow-wrap: anywhere; }
.breakdown { padding: 9px 20px 4px; }
.lottery { display: flex; align-items: center; gap: 9px; padding: 9px 0; }
.lottery + .lottery { border-top: 1px solid #edf1ec; }
.lottery::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: #2b7957; }
.lottery:nth-child(2)::before { background: #937342; }
.lottery:nth-child(3)::before { background: #597a99; }
.lottery strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.report-action { padding: 5px 16px 16px; display: grid; gap: 7px; }
.receipt.summary { width: min(100%, 680px); max-width: 100%; }
.sheet-versions { display: inline-flex; margin-top: 9px; border: 1px solid #bfcfc4; border-radius: 7px; }
.sheet-versions button { border: 0; border-radius: 5px; padding: 4px 12px; background: white; color: var(--green); font-size: 14px; }
.sheet-versions button[aria-pressed="true"] { background: var(--green); color: white; }
.sheet-preview { display: block; max-height: 430px; overflow: auto; margin: 12px 0 5px; background: #f4f7f4; border: 1px solid var(--line); }
.sheet-preview img { display: block; width: 100%; height: auto; }
.sheet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 13px; }
.sheet-actions span { flex: 1 1 auto; color: var(--muted); }
.sheet-actions a { color: var(--green); }
.report-action button { width: 100%; background: #f7faf7; color: var(--green); border: 1px solid #cbdccf; padding: 7px; border-radius: 8px; font-weight: 600; }
.commands { padding: 18px 20px; }
.play-guide { padding: 14px 20px; }
.play-guide summary { cursor: pointer; font-size: 16px; font-weight: 650; }
.play-guide select { width: 100%; margin-top: 12px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: white; color: inherit; }
.play-guide p { margin: 8px 0; color: var(--muted); font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.play-guide button { padding: 5px 10px; border: 1px solid #cbdccf; border-radius: 6px; color: var(--green); background: #f7faf7; }
.play-guide :is(summary, select):focus-visible { outline: 3px solid #588e75; outline-offset: 3px; }
.commands dl { margin: 14px 0; }
.commands dl div { display: flex; align-items: baseline; gap: 10px; margin: 8px 0; }
.commands dt { flex-shrink: 0; padding: 1px 5px; min-width: 39px; text-align: center; border-radius: 4px; background: #edf4ee; font-weight: 600; font-size: 14px; color: #305a43; }
.commands dd, .commands p { color: var(--muted); font-size: 14px; }
.commands p { border-top: 1px solid var(--line); padding-top: 12px; }
.exchange { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.exchange:last-child { margin-bottom: 2px; }
.exchange[id] { scroll-margin-block: 8px; }
.exchange[id]:focus { outline: 2px solid #4d8970; outline-offset: 4px; border-radius: 6px; }
.user-line { align-self: flex-end; max-width: min(84%, 620px); text-align: right; }
.user-line time { font-size: 12px; color: var(--muted); display: block; margin-bottom: 3px; }
.user-bubble, .receipt { white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 12px; padding: 9px 14px; }
.user-bubble { text-align: left; display: inline-block; border-bottom-right-radius: 3px; background: #dbece1; color: #173d2a; }
.receipt { align-self: flex-start; max-width: 93%; background: white; border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.receipt.note, .receipt.partial, .receipt.insert_error { border-color: var(--receipt-error); }
.receipt strong { font-size: 15px; font-weight: 650; color: #2a5840; }
.receipt .amount { margin-left: 8px; font-variant-numeric: tabular-nums; color: #1c6543; }
.receipt .amount.negative { color: #98422d; }
.receipt p { font-size: 14px; color: var(--muted); margin-top: 2px; }
.receipt.note > strong, .fix-order.needs-correction { color: var(--receipt-error); }
.receipt.partial strong:first-child,
.receipt.insert_error strong, .receipt.vacant strong { color: #886021; }
.fix-order { margin-top: 8px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 5px; background: white; color: #23543e; cursor: pointer; }
.fix-order + .fix-order { margin-left: 6px; }
.receipt pre { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.65 Consolas, "Microsoft YaHei", monospace; }
.play-report { margin: 10px 0; width: 100%; min-width: 12em; border-collapse: collapse; font-size: 14px; }
.play-report caption { padding-bottom: 4px; text-align: left; color: #2a5840; font-weight: 650; }
.play-report th, .play-report td { padding: 3px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.play-report th { background: #edf5ef; }
.play-report :is(th, td):last-child { text-align: right; font-variant-numeric: tabular-nums; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff5e4; color: #754d1a; padding: 8px 20px; font-size: 14px; }
.notice button { color: inherit; background: none; border: 0; text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 780px) {
  .shell { width: min(100% - 28px, 650px); }
  .brand-row { height: 52px; }
  .brand { font-size: 18px; }
  .brand img { width: 30px; height: 30px; }
  .page-heading { margin: 15px 0 12px; }
  .workspace { grid-template-columns: 1fr; gap: 14px; }
  .chat { height: clamp(382px, calc(100dvh - 145px), 680px); }
  .panel-head { padding: 12px 16px; }
  .stream { padding: 12px 14px; }
  .composer { padding: 10px 14px; }
  .empty { padding: 7px; }
  .empty p { font-size: 14px; }
  .sidebar { gap: 12px; }
}
@media (max-width: 410px) {
  .shortcut-extra { display: none; }
  .page-heading time { font-size: 13px; }
}
