* { box-sizing: border-box; }
:root { color-scheme: light; font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif; color: #202926; background: #f4f6f4; --line: #dce3df; --muted: #54645d; --accent: #24604c; }
[hidden] { display: none !important; }
body { margin: 0; }
main { max-width: 1320px; margin: auto; padding: 28px clamp(12px, 4vw, 48px) 72px; }
h1, h2, p { margin: 0; }
h1 { font-size: 26px; letter-spacing: .02em; }
h2 { font-size: 17px; }
.mast, .tools, .dialog-head, .row-actions, .person-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.mast, .dialog-head { justify-content: space-between; }
.mast { padding: 0 0 16px; border-bottom: 2px solid var(--accent); }
.mast p, .muted { font-size: 13px; color: var(--muted); margin-top: 6px; }
#account { display: flex; align-items: center; gap: 10px; }
.tools { background: #f4f6f4; position: sticky; top: 0; z-index: 1; padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.tools nav { display: flex; gap: 4px; flex-wrap: wrap; margin-right: auto; }
button, input, textarea, select { font: inherit; }
button { min-height: 34px; border: 1px solid var(--line); border-radius: 4px; padding: 4px 9px; color: #293b33; background: white; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary, button[aria-pressed="true"] { background: var(--accent); color: white; border-color: var(--accent); }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { width: 100%; min-height: 35px; padding: 6px; border: 1px solid #b8c6be; border-radius: 3px; background: white; color: inherit; }
input[type="checkbox"] { width: 17px; min-height: 17px; flex: none; accent-color: var(--accent); }
input[type="search"] { width: min(100%, 245px); }
label { display: grid; gap: 4px; margin: 9px 0; font-size: 13px; }
#login { margin: 34px auto; width: min(100%, 340px); background: white; border: 1px solid var(--line); padding: 22px; }
#login button { margin-top: 6px; width: 100%; }
#synced { margin: 10px 0 16px; }
[data-completion="pending"] { --completion-accent: #795231; --completion-fill: #f2e4d5; --completion-border: #d4b492; --completion-surface: #fcf6ee; }
[data-completion="urgent"] { --completion-accent: #9b2634; --completion-fill: #f6d9dd; --completion-border: #d68a93; --completion-surface: #fff1f2; }
[data-completion="done"] { --completion-accent: #246747; --completion-fill: #d9eee0; --completion-border: #a3cbb0; --completion-surface: #eef8f0; }
.team { margin: 13px 0; border: 1px solid var(--completion-border); border-left: 4px solid var(--completion-accent); border-radius: 7px; background: #fcfdfc; }
.team > summary { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(160px, .66fr) minmax(170px, .59fr); gap: 10px 15px; align-items: center; padding: 13px 16px; border-radius: 0 6px 6px 0; background: var(--completion-surface); cursor: pointer; list-style: none; }
.team > summary::-webkit-details-marker { display: none; }
.team > summary:hover { background: color-mix(in srgb, var(--completion-surface) 65%, var(--completion-fill)); }
.team[open] > summary { border-bottom: 1px solid var(--completion-border); border-radius: 0 6px 0 0; }
.team-toggle { display: grid; width: 34px; height: 34px; place-items: center; color: var(--completion-accent); background: var(--completion-fill); border-radius: 5px; }
.team-toggle::before { content: ''; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateX(-2px) rotate(-45deg); }
.team[open] .team-toggle::before { transform: translateY(-2px) rotate(45deg); }
.team-main { display: grid; gap: 6px; min-width: 0; }
.team-code { color: #172b23; font-size: 18px; font-weight: 700; line-height: 1.23; overflow-wrap: anywhere; }
.team-locations { display: flex; align-items: baseline; gap: 7px; }
.team-locations-label, .team-guide-label, .team-date-label { flex: none; color: #4e6056; font-size: 13px; line-height: 1.4; }
.team-venues { display: flex; flex-wrap: wrap; min-width: 0; gap: 4px 6px; }
.team-venue { color: #254739; font-size: 15px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; padding: 2px 6px; border-radius: 3px; background: #ebf1eb; }
.team-guide { display: grid; gap: 4px; min-width: 0; align-content: center; }
.team-guide-list { display: grid; gap: 4px; min-width: 0; }
.team-guide-person { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; color: #243d31; font-size: 15px; line-height: 1.35; }
.team-guide-person strong { overflow-wrap: anywhere; }
.team-guide-phone { font-variant-numeric: tabular-nums; }
.team-guide-status { color: #4e6056; font-size: 14px; }
.team-meta { display: grid; justify-items: end; gap: 6px; min-width: 0; }
.team-date { display: flex; flex-wrap: wrap; gap: 3px 6px; align-items: baseline; justify-content: end; font-variant-numeric: tabular-nums; }
.team-visit { color: #243d31; font-size: 15px; font-weight: 650; }
.team-meta .statuses { justify-content: end; }
.team-meta .status-pill { font-size: 13px; padding: 2px 6px; }
.venue-date { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.team-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: start; padding: 7px 12px 0; }
.team-itinerary { grid-column: 1; grid-row: 1; }
.team-toolbar > button { grid-column: 2; grid-row: 1; }
.team-itinerary[open] { grid-column: 1 / -1; }
.team-itinerary > summary { width: fit-content; min-height: 34px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px; background: #f4f8f4; color: #254739; font-size: 14px; font-weight: 650; cursor: pointer; }
.team-itinerary > summary:hover { border-color: var(--accent); }
.itinerary-caption { margin: 8px 0; color: var(--muted); font-size: 13px; }
.itinerary-days { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 4px; background: #f8faf7; }
.itinerary-days li { display: grid; grid-template-columns: 94px minmax(0,1fr); gap: 10px; padding: 8px 10px; font-size: 14px; line-height: 1.54; }
.itinerary-days li + li { border-top: 1px solid var(--line); }
.itinerary-date { display: flex; flex-wrap: wrap; align-items: center; align-content: start; gap: 3px 6px; }
.itinerary-days time { color: #254739; font-weight: 700; font-variant-numeric: tabular-nums; }
.itinerary-ticket-day { padding: 1px 5px; border-radius: 3px; background: #e4efe7; color: #305b46; font-size: 12px; }
.itinerary-days p { white-space: pre-wrap; overflow-wrap: anywhere; }
.itinerary-days mark { color: #352a0c; background: #f8e491; border-radius: 2px; font-weight: 700; }
.statuses { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.status-pill { display: inline-block; border: 1px solid #bfcfc6; border-radius: 3px; padding: 2px 5px; font-size: 12px; line-height: 1.3; white-space: nowrap; color: #315a49; background: #f4f8f5; }
.pill-urgent { color: #9b2634; background: #fff7f7; border-color: #deb2b7; }
.pill-roster { color: #6c4a15; background: #fff6de; border-color: #decb9d; }
.pill-done, .pill-muted { color: #4d5b55; background: #f3f4f3; border-color: #c6d0c9; }
.status-pill.completion-marker { color: var(--completion-accent); background: var(--completion-fill); border-color: var(--completion-border); font-weight: 700; }
.venue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 178px), 1fr)); gap: 8px; padding: 10px 12px 12px; }
.venue-card { min-height: 78px; display: grid; gap: 4px; align-content: start; text-align: left; padding: 8px 10px; color: #203127; border-color: var(--completion-border); border-left: 3px solid var(--completion-accent); background: var(--completion-surface); }
.venue-card strong { overflow-wrap: anywhere; font-size: 14px; }
.venue-card:hover { border-color: var(--completion-accent); }
.venue-card[aria-pressed="true"] { color: #203127; background: color-mix(in srgb, var(--completion-surface) 65%, var(--completion-fill)); border-color: var(--completion-accent); box-shadow: inset 0 0 0 1px var(--completion-accent); }
.venue-detail { border: 1px solid var(--line); border-radius: 3px; margin: 0 12px 12px; background: #fcfdfc; }
.ticket-choices { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.ticket-choices button { min-height: 29px; font-size: 13px; }
.ticket + .ticket { border-top: 1px solid var(--line); }
.fields { display: grid; grid-template-columns: minmax(190px, 1.35fr) minmax(160px, 1fr) minmax(125px, .9fr); gap: 5px 14px; padding: 10px 12px; align-items: start; }
.fields strong, .fields small { display: block; overflow-wrap: anywhere; }
.fields small { color: var(--muted); margin-top: 3px; font-size: 12px; }
.fields .k { font-size: 11px; color: var(--muted); margin: 0 0 3px; }
.fields .num { font-variant-numeric: tabular-nums; }
.done { color: #5c6a63; background: #f0f2f0; }
.done .fields strong { text-decoration: line-through; }
.attention { color: #8c3f1e; font-weight: 650; }
.ticket-body { padding: 0 12px 10px; }
.row-actions { margin-top: 6px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 5px 0 0; padding: 7px 11px; border: 1px solid #d89767; border-radius: 5px; background: #fff0e1; color: #793a12; font-size: 15px; font-weight: 700; line-height: 1.3; cursor: pointer; }
.check:hover { border-color: #a24d16; }
.check input[type="checkbox"] { width: 22px; height: 22px; margin: 0; cursor: pointer; }
.check:has(input:checked) { border-color: #8ab99d; background: #e5f4e9; color: #215a3d; }
.person-heading { margin: 8px 0 5px; font-size: 13px; }
.subtle { color: var(--muted); font-variant-numeric: tabular-nums; }
.roster-warning { margin: 3px 0 7px; padding: 5px 8px; border-left: 3px solid #cf9f49; color: #6c4a15; font-size: 13px; background: #fff8e9; }
.person-heading button:disabled { cursor: default; }
.table-wrap { overflow-x: auto; margin-bottom: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
td, th { text-align: left; padding: 5px 7px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; }
.ordinal { width: 1%; text-align: right; padding-right: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.person-actions { width: 1%; }
.purchase-cell { width: 52px; text-align: center; }
.purchase-cell input { vertical-align: middle; cursor: pointer; }
.purchase-cell input:disabled { cursor: default; }
.purchase-cell:has(input[data-bought]:checked) { background: #e5f0e9; }
.purchase-summary { color: var(--accent); font-variant-numeric: tabular-nums; }
.guide-replaced td:not(.guide-role) { text-decoration: line-through; color: #64726c; }
.guide-role { width: 1%; color: var(--muted); }
.current-guide { color: var(--accent); font-weight: 650; }
.person-actions button + button { margin-left: 5px; }
.remove-person { color: #873c31; }
td button.copy { border: 0; background: transparent; text-align: left; padding: 3px 0; min-height: 26px; color: inherit; }
td button.copy:hover { text-decoration: underline; }
.changes { border-left: 3px solid #a9bfb4; margin: 4px 0 8px 12px; }
.changes .fields { background: #f7f9f7; }
.changes .done .fields { background: #f0f2f0; }
.note { margin-top: 5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.notes-area { margin: 10px 0 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.order-notes { display: grid; gap: 5px; list-style: none; padding: 0; margin: 0 0 8px; }
.order-notes li { border-left: 2px solid #c4d8ce; background: #f7f9f7; border-radius: 2px; padding: 5px 8px; }
.order-notes .subtle { font-size: 12px; }
.order-notes p { margin-top: 2px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.order-note { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.order-note label { margin: 0; }
.order-note textarea { resize: vertical; }
.message:empty { display: none; }
.message { position: fixed; z-index: 4; bottom: 15px; right: 15px; max-width: min(420px, 90vw); padding: 9px 14px; border-radius: 4px; color: white; background: #203a30; }
dialog { width: min(720px, calc(100% - 24px)); max-height: 85vh; border: 1px solid var(--line); border-radius: 5px; padding: 16px; color: inherit; }
dialog::backdrop { background: #1227195e; }
#formats { width: min(480px, calc(100% - 24px)); }
#format-venue { margin-bottom: 10px; }
.format-heading, .format-column { display: grid; grid-template-columns: minmax(0,1fr) minmax(76px,.65fr) auto; gap: 8px; align-items: center; padding: 5px 6px; }
.format-heading { color: var(--muted); font-size: 13px; background: #edf3ee; }
.format-column { border-bottom: 1px solid var(--line); font-size: 14px; }
.format-column > span { text-align: center; }
.format-heading > span:nth-child(2) { text-align: center; }
.format-moves { display: flex; gap: 5px; }
.format-moves button { min-width: 33px; min-height: 30px; padding: 2px 6px; }
.format-moves button:disabled { cursor: default; }
#format-preview { margin: 11px 0 9px; }
#events { overflow-x: auto; margin: 10px 0; }
.person-fields { display: grid; grid-template-columns: 1.2fr 1fr 1fr .55fr auto; gap: 6px; align-items: end; margin-bottom: 7px; }
.person-fields label { margin: 0; }
.empty { padding: 16px 12px; border: 1px solid var(--line); color: var(--muted); background: white; }
@media (max-width: 990px) {
  .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 710px) {
  .team > summary { grid-template-columns: 30px minmax(0, 1fr); gap: 8px 11px; padding: 11px; align-items: start; }
  .team-toggle { width: 30px; height: 30px; }
  .team-guide { grid-column: 2; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 7px; }
  .team-meta { grid-column: 2; justify-items: start; }
  .team-date, .team-meta .statuses { justify-content: start; }
}
@media (max-width: 570px) {
  .itinerary-days li { grid-template-columns: minmax(0,1fr); gap: 3px; }
  .venue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  main { padding-top: 15px; }
  .person-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools { position: static; }
}

