:root {
  --ink: #302c2b;
  --muted: #706966;
  --accent: #ad493f;
  --line: #dedbd8;
  --sheet: #fcfbfa;
  --canvas: #f2f1ef;
  --city-bg: #ece9e6;
  --pending-bg: #e2e2e2;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
a:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; }
.workspace { max-width: 800px; margin: 0 auto; padding: 24px 28px calc(96px + env(safe-area-inset-bottom)); }
.site-header { padding: 4px 0 20px; }
.monthly-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 12px; }
.identity { min-width: 0; }
.product-title { font-size: 36px; font-weight: 800; letter-spacing: .02em; line-height: 1.3; margin: 0; }
.product-title #artist, .day-header #artist {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: #d8b2a6;
  text-decoration-thickness: 3px;
  text-underline-offset: 7px;
}
.title-tail { font-size: 19px; font-weight: 450; color: var(--ink); margin-left: 6px; white-space: nowrap; }
.updated { margin: 7px 0 0; font-size: 12px; color: var(--muted); }
.information-notice { margin: 0; font-size: 12px; line-height: 1.7; color: var(--muted); }
.load-status { border: 1px solid var(--line); padding: 20px; overflow-wrap: anywhere; }
.load-status[role="alert"] { border-color: var(--accent); }
.back-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: var(--accent); margin-bottom: 16px; }

/* 主屏幕添加引导 */
.header-meta { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; column-gap: 16px; margin-top: 7px; }
.header-meta .updated { margin: 0; }
.install-entry { padding: 5px 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.install-dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 16px 20px 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); color: var(--ink); overflow-y: auto; }
.install-dialog::backdrop { background: rgb(30 25 23 / 40%); }
body:has(.install-dialog[open]) { overflow: hidden; }
.install-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.install-dialog-header h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; }
.install-close { width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 26px; cursor: pointer; }
.install-native { margin-top: 14px; min-height: 44px; padding: 8px 16px; border: 0; border-radius: 4px; background: var(--accent); color: white; font: inherit; cursor: pointer; }
.install-steps { font-size: 13px; line-height: 1.8; }
.install-steps h3 { margin: 14px 0 4px; font-size: 14px; text-wrap: initial; }
.install-steps ol { margin: 0; padding-left: 1.5em; }
.install-steps .menu-label { padding: 2px 3px; border-radius: 3px; background: #f2eeeb; white-space: nowrap; }
.install-manual { margin: 14px 0 0; }
.install-intro { margin: 0; color: var(--muted); }
.install-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
@media (display-mode: standalone) { .install-entry { display: none; } }

.announcement-button { border: 0; padding: 0; background: none; font: inherit; cursor: pointer; }
.announcement-dialog { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); color: var(--ink); overflow: hidden; }
.announcement-dialog[open] { display: flex; flex-direction: column; }
.announcement-dialog::backdrop { background: rgb(30 25 23 / 50%); }
body:has(.announcement-dialog[open]) { overflow: hidden; }
.announcement-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px 8px 16px; flex-shrink: 0; }
.announcement-header h2 { margin: 0; font-size: 17px; }
.announcement-content { overflow-y: auto; min-height: 0; }
.announcement-content img { display: block; width: 100%; height: auto; }
.announcement-content p { margin: 16px; font-size: 13px; }

/* 月历：日期、城市颜色、活动类型 */
.calendar-section { background: var(--sheet); border-radius: 5px; padding: 10px 20px; }
.month-picker { position: relative; }
.month-picker::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  pointer-events: none;
}
.month-select {
  appearance: none;
  font: inherit;
  font-size: 17px;
  font-weight: 650;
  color: var(--ink);
  width: 100%;
  min-height: 44px;
  padding: 8px 32px 8px 10px;
  border: 1px solid #baa69b;
  border-radius: 6px;
  background: var(--sheet);
  cursor: pointer;
}
.month-select:disabled { color: var(--muted); cursor: default; }
.calendar-legends { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; margin-bottom: 12px; }
.legend-row { display: flex; align-items: baseline; justify-content: flex-end; gap: 12px; max-width: 100%; }
.legend { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.swatch { display: block; width: 24px; height: 14px; border: 1px solid #00000012; }
.type-legend { display: flex; gap: 12px; font-size: 12px; }
.type-legend > span { display: flex; align-items: center; gap: 5px; }
.type-dot { display: inline-block; width: 8px; height: 8px; border: 1.5px solid #4e4440; border-radius: 50%; flex-shrink: 0; }
.type-dot.performance { background: #4e4440; }
.type-dot.meetup { background: transparent; }
.weekdays, .calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.weekdays { background: #eeeae6; border-bottom: 2px solid #c9c1bb; padding: 7px 0; color: #514b47; text-align: center; font-size: 12px; font-weight: 600; }
.calendar { margin-top: 6px; }
.day { min-width: 0; min-height: 46px; display: flex; flex-direction: column; padding: 3px 7px; border-bottom: 1px solid var(--line); }
.day time { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted); }
.day time[aria-current="date"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.day.active { background: var(--city-bg); border-radius: 2px; transition: box-shadow .15s; }
.day.active time { font-weight: 700; color: var(--ink); }
.pending-swatch, .day.pending-day, .city-tag.pending-city { background: var(--pending-bg); }
.day.pending-day { border-radius: 2px; }
.day.pending-day time { font-weight: 700; color: var(--ink); }
.pending-label { display: inline-block; margin-top: 4px; padding: 1px 5px; border-radius: 2px; background: var(--pending-bg); color: #514b47; font-size: 12px; }
.day strong { font-size: 12px; font-weight: 600; margin-top: auto; line-height: 1.4; overflow-wrap: anywhere; }
.day-city { display: block; white-space: nowrap; }
.day.empty { border: 0; }
.day-top { display: flex; align-items: center; justify-content: space-between; gap: 2px; min-width: 0; flex-wrap: wrap; }
.type-dots { display: flex; gap: 2px; flex-shrink: 0; }
.calendar-hint { color: var(--accent); font-size: 12px; font-weight: 400; margin: 0 0 10px; }

/* 本月行程表格 */
.agenda { margin-top: 22px; }
.section-heading { margin-bottom: 12px; }
.section-heading h2 { font-size: 19px; margin: 0; }
.empty-month, .empty-day { padding: 20px 16px; margin: 0; background: var(--sheet); color: var(--muted); font-size: 14px; }
.itinerary-table { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--sheet); font-size: 13px; }
.date-col { width: 16%; }
.city-col { width: 16%; }
.time-col { width: 22%; }
.event-col { width: 46%; }
.itinerary-table thead th { text-align: left; background: #eeeae6; border-top: 1px solid var(--line); border-bottom: 1px solid #c9c1bb; font-size: 12px; font-weight: 550; color: var(--muted); padding: 9px 8px; }
.itinerary-table td, .table-date { border-bottom: 1px solid #e9e6e3; padding: 12px 8px; vertical-align: top; text-align: left; }
.itinerary-table tr.date-group-start:not(:first-child) > * { border-top: 2px solid #c9c1bb; }
.itinerary-table tbody tr:focus-within { background: #f1ece8; }
.table-date a, .date-entry { display: flex; flex-direction: column; min-height: 44px; gap: 3px; }
.table-date strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.table-date small { font-size: 12px; font-weight: 400; color: var(--muted); }
.city-tag { display: inline-block; background: var(--city-bg); color: #302f35; padding: 3px 10px; font-size: 12px; line-height: 1.5; font-weight: 600; border-radius: 2px; overflow-wrap: anywhere; }
.itinerary-table .city-tag { padding: 2px 6px; }
.table-time strong { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.table-time > span { display: flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 12px; color: var(--muted); margin-top: 4px; }
.table-activity a { position: relative; display: block; min-height: 44px; padding-right: 18px; overflow-wrap: anywhere; }
.pending-activity { min-height: 44px; overflow-wrap: anywhere; }
.row-chevron { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.table-activity a strong, .pending-activity strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.55; text-wrap: balance; }
.table-activity a span { display: block; font-size: 13px; font-weight: 400; color: var(--muted); line-height: 1.6; margin-top: 4px; }

/* 首页今日入口与当天活动详情 */
.today-shortcut { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding: 14px 16px; border: 1px solid #d6b3a8; border-radius: 6px; background: #f8eee9; }
.today-copy { min-width: 0; }
.today-copy strong { display: block; color: var(--accent); font-size: 15px; }
.today-part { white-space: nowrap; }
#today-times { display: block; margin-top: 4px; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.today-action { color: var(--accent); font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.day-header { padding-top: 4px; margin-bottom: 24px; }
.day-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--muted); font-size: 13px; }
.day-header .product-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.day-identity { white-space: nowrap; }
.day-navigation { margin-top: 8px; }
.day-header #day-title { font-size: 18px; font-weight: 650; letter-spacing: normal; white-space: nowrap; }
.day-events { padding: 0; }
.activity-detail { position: relative; padding: 0 0 24px 28px; }
.activity-detail::before { content: ""; position: absolute; left: 6px; top: 17px; bottom: -17px; width: 1px; background: #cbb9b1; }
.activity-detail::after { content: ""; position: absolute; left: 1px; top: 12px; width: 11px; height: 11px; border: 2px solid var(--accent); border-radius: 50%; background: var(--canvas); }
.activity-detail:last-child { padding-bottom: 0; }
.activity-detail:last-child::before { display: none; }
.activity-heading { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.activity-time { font-size: 28px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.3; color: var(--accent); }
.activity-body { padding: 16px 18px 18px; background: var(--sheet); border-radius: 4px; }
.type-label { font-size: 14px; color: var(--ink); }
.activity-detail h2 { font-size: 19px; line-height: 1.5; margin: 0 0 12px; overflow-wrap: anywhere; }
.activity-detail dl { margin: 0; }
.activity-detail dl > div { display: grid; grid-template-columns: 2em minmax(0, 1fr); gap: 12px; align-items: baseline; margin-top: 12px; font-size: 14px; }
.activity-detail dt { color: #514b47; font-weight: 600; line-height: 1.7; }
.activity-detail dd { line-height: 1.7; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.venue-line { display: inline; }
.copy-venue { position: relative; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; width: 28px; height: 28px; margin: -2px 0 -2px 3px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--accent); cursor: pointer; }
.copy-venue::after { content: ""; position: absolute; inset: -8px; }
.copy-venue:disabled { cursor: wait; }
.copy-status { display: block; color: var(--accent); font-size: 12px; }
.copy-status:empty { display: none; }
.official-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--accent); font-size: 14px; }
.official-link-label { text-decoration: underline; text-underline-offset: 3px; }
.information-footer, .day-footer { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.day-footer .information-notice { flex-basis: 100%; }
.day-footer { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (hover: hover) {
  .day-back:hover, .copy-venue:hover { background: #e9e4e0; }
  .month-select:not(:disabled):hover { border-color: var(--accent); }
  .day.active:hover { box-shadow: inset 0 0 0 2px var(--accent); }
  .itinerary-table a:hover { color: var(--accent); }
  .itinerary-table tbody tr:has(.table-activity a):hover { background: #f1ece8; }
}

@media (max-width: 540px) {
  .workspace { padding: 18px 14px calc(120px + env(safe-area-inset-bottom)); }
  .site-header { padding-bottom: 20px; }
  .product-title { font-size: 32px; }
  .title-tail { font-size: 17px; margin-left: 4px; }
  .calendar-section { padding: 8px 10px 10px; }
  .month-select { font-size: 16px; }
  .swatch { width: 22px; height: 13px; }
  .legend-row { gap: 10px; }
  .weekdays, .calendar { gap: 3px; }
  .day { min-height: 44px; padding: 2px; }
  .day time { font-size: 15px; }
  .agenda { margin-top: 23px; }
  .date-col { width: 44px; }
  .city-col { width: 44px; }
  .time-col { width: 68px; }
  .event-col { width: auto; }
  .itinerary-table thead th { padding: 8px 4px; }
  .itinerary-table thead th:nth-child(3) { white-space: nowrap; }
  .itinerary-table td, .table-date { padding: 10px 4px; }
  .table-activity a { padding-right: 14px; }
  .row-chevron { right: 3px; }
  .table-date strong, .table-time strong { font-size: 13px; }
  .itinerary-table .city-tag { padding: 2px 4px; }
  .day-header { margin-bottom: 22px; }
  .activity-detail { padding-left: 24px; }
  .activity-body { padding: 14px; }
  .activity-detail dl > div { gap: 8px; }
  .activity-time { font-size: 26px; }
  .back-link { margin-bottom: 8px; }
}

@media (max-width: 360px) {
  .monthly-header { gap: 8px; }
  .month-select { font-size: 14px; }
  .product-title { font-size: 28px; }
  .title-tail { font-size: 16px; }
  .today-action-label { display: none; }
  .today-shortcut { gap: 8px; padding: 12px; }
  .day { min-height: 62px; }
  .day-top { flex-direction: column; align-items: flex-start; gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
