:root {
  color-scheme: light dark;
  --blue: #2f77ff;
  --blue-2: #6aa2ff;
  --orange: #ff922e;
  --purple: #7057ff;
  --green: #23b26d;
  --red: #e33d48;
  --gray: #9ba1ab;
  --bg: #f4f7fb;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-solid: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.56);
  --text: #10141f;
  --muted: #6b7280;
  --line: rgba(21, 27, 39, 0.09);
  --shadow: 0 20px 60px rgba(32, 42, 62, 0.12);
  --radius: 22px;
  --nav-h: 92px;
}

@media (prefers-color-scheme: dark) {
  body.theme-system {
    --bg: #03060c;
    --surface: rgba(20, 28, 40, 0.82);
    --surface-solid: #111827;
    --surface-soft: rgba(30, 41, 59, 0.7);
    --text: #f5f7fb;
    --muted: #9aa3b2;
    --line: rgba(255, 255, 255, 0.1);
    --shadow: 0 20px 70px rgba(0, 0, 0, 0.48);
  }
}

body.theme-dark {
  --bg: #03060c;
  --surface: rgba(20, 28, 40, 0.82);
  --surface-solid: #111827;
  --surface-soft: rgba(30, 41, 59, 0.7);
  --text: #f5f7fb;
  --muted: #9aa3b2;
  --line: rgba(255, 255, 255, 0.1);
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.48);
}

body.theme-light {
  --bg: #f4f7fb;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-solid: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.56);
  --text: #10141f;
  --muted: #6b7280;
  --line: rgba(21, 27, 39, 0.09);
  --shadow: 0 20px 60px rgba(32, 42, 62, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 12% 6%, rgba(47, 119, 255, 0.1), transparent 28rem),
    linear-gradient(180deg, var(--bg), var(--bg));
  color: var(--text);
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
  color: inherit;
}

.app-shell {
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px calc(var(--nav-h) + env(safe-area-inset-bottom));
}

.screen {
  display: none;
  animation: rise 0.22s ease;
}

.screen.active {
  display: block;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 76px;
}

.title {
  margin: 0;
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1.1;
  font-weight: 800;
}

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

.pill,
.icon-btn,
.primary-btn,
.ghost-btn,
.danger-btn {
  min-height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.pill,
.ghost-btn,
.icon-btn {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--blue);
}

.pill {
  padding: 0 18px;
  font-weight: 700;
}

.icon-btn {
  width: 44px;
  font-size: 22px;
}

.primary-btn {
  padding: 0 20px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #2369ff, #337dff);
  box-shadow: 0 12px 28px rgba(47, 119, 255, 0.28);
  white-space: nowrap;
}

.ghost-btn {
  padding: 0 16px;
  font-weight: 700;
}

.danger-btn {
  padding: 0 16px;
  background: rgba(227, 61, 72, 0.12);
  color: var(--red);
  font-weight: 700;
  white-space: nowrap;
}

.month-switch {
  display: grid;
  grid-template-columns: minmax(74px, 1fr) auto minmax(74px, 1fr);
  align-items: center;
  gap: 12px;
  margin: 8px 0 18px;
}

.month-switch strong {
  font-size: clamp(30px, 7vw, 42px);
  color: var(--blue);
  text-align: center;
}

.side-month {
  color: var(--muted);
  font-size: 18px;
  white-space: nowrap;
  text-align: left;
}

.side-month.next {
  text-align: right;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.calendar-card {
  padding: 16px 12px 18px;
}

.weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekdays {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  margin-bottom: 6px;
}

.weekdays span {
  padding: 8px 0;
}

.weekdays span:first-child,
.weekdays span:last-child {
  color: var(--red);
}

.day-cell {
  position: relative;
  min-height: clamp(82px, 13vw, 112px);
  padding: 8px 4px;
  border-radius: 18px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  color: var(--text);
  background: transparent;
}

.day-cell.outside {
  opacity: 0.42;
}

.day-cell.selected {
  outline: 2px solid var(--blue);
  background: rgba(47, 119, 255, 0.06);
}

.day-number {
  font-size: clamp(20px, 5vw, 32px);
  font-weight: 800;
  line-height: 1;
}

.day-cell.weekend .day-number {
  color: var(--red);
}

.lunar,
.holiday {
  max-width: 100%;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.holiday {
  color: var(--green);
  font-weight: 700;
}

.day-festival {
  color: var(--green);
  font-weight: 900;
  padding: 0 3px;
  border-radius: 7px;
  background: rgba(35, 178, 109, 0.12);
}

.shift-badge {
  min-width: 42px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.today-chip,
.workday-dot {
  position: absolute;
  right: 7px;
  top: 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
}

.today-chip {
  background: var(--blue);
  color: #fff;
}

.workday-dot {
  background: rgba(35, 178, 109, 0.18);
  color: var(--green);
}

.detail-card {
  margin-top: 18px;
  padding: 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}

.detail-date {
  font-size: clamp(26px, 6vw, 36px);
  font-weight: 800;
  color: var(--blue);
}

.detail-meta {
  margin-top: 8px;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.mini-label {
  color: var(--muted);
  font-size: 14px;
}

.mini-value {
  margin-top: 4px;
  font-weight: 800;
}

.section-title {
  margin: 26px 4px 12px;
  font-size: 26px;
  font-weight: 800;
}

.stats-hero {
  padding: 28px;
  margin-bottom: 6px;
}

.stats-hero .label {
  color: var(--muted);
  font-size: 22px;
}

.stats-number {
  margin: 12px 0 22px;
  font-size: clamp(72px, 18vw, 104px);
  font-weight: 900;
  line-height: 0.95;
}

.stats-number span {
  font-size: 24px;
  color: var(--muted);
}

.chip-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.info-chip {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(47, 119, 255, 0.1);
  color: var(--blue);
  font-weight: 800;
}

.info-chip.gray {
  background: rgba(148, 163, 184, 0.16);
  color: var(--muted);
}

.info-chip.orange {
  background: rgba(255, 146, 46, 0.14);
  color: var(--orange);
}

.list {
  display: grid;
  gap: 10px;
}

.row-card {
  padding: 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}

.shift-square {
  width: 66px;
  height: 66px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 32px;
  font-weight: 900;
}

.row-title {
  font-size: 22px;
  font-weight: 800;
}

.row-sub {
  color: var(--muted);
  margin-top: 4px;
}

.row-value {
  font-size: 24px;
  font-weight: 900;
  white-space: nowrap;
}

.chart-card {
  padding: 22px;
  margin-top: 16px;
}

.bars {
  height: 210px;
  display: grid;
  grid-template-columns: repeat(30, 1fr);
  align-items: end;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to top, transparent 49%, var(--line) 50%, transparent 51%),
    linear-gradient(to top, transparent 74%, var(--line) 75%, transparent 76%);
  padding-top: 18px;
}

.bar {
  min-width: 4px;
  border-radius: 999px 999px 2px 2px;
}

.rules {
  padding: 22px 26px;
  color: var(--muted);
  line-height: 1.9;
  margin-top: 16px;
}

.settings-card,
.rule-card {
  padding: 18px 22px;
}

.settings-card + .settings-card,
.rule-card + .section-title {
  margin-top: 16px;
}

.screen > .primary-btn,
.settings-card > .primary-btn,
.rule-card > .primary-btn,
.form-grid > .primary-btn {
  width: 100%;
}

.settings-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
}

.setting-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--line);
}

.setting-button {
  width: 100%;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.setting-button:hover,
.day-cell:hover,
.nav-item:hover,
.ghost-btn:hover,
.icon-btn:hover,
.pill:hover {
  transform: translateY(-1px);
}

.cycle-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0;
}

.cycle-arrow {
  color: var(--muted);
  font-size: 24px;
  font-weight: 800;
}

.rule-builder {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.rule-slot {
  min-height: 112px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 10px 6px;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.rule-slot:hover {
  transform: translateY(-2px);
}

.rule-slot.filled {
  color: var(--text);
  border-color: color-mix(in srgb, var(--slot-color), transparent 45%);
  background: color-mix(in srgb, var(--slot-color), transparent 86%);
}

.rule-week {
  font-size: 13px;
  font-weight: 800;
}

.rule-shift {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--slot-color, rgba(148, 163, 184, 0.65));
  font-size: 22px;
  font-weight: 900;
}

.rule-name {
  font-size: 12px;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rule-hint {
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.shift-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.palette-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.palette-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.confirm-hero {
  text-align: center;
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 6px 4px 12px;
}

.confirm-icon {
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: rgba(47, 119, 255, 0.14);
  color: var(--blue);
  font-size: 30px;
  font-weight: 900;
}

.confirm-hero h2 {
  margin: 0;
  font-size: 26px;
}

.confirm-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.confirm-hero strong {
  color: var(--text);
}

.confirm-sequence {
  min-height: 76px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
}

.confirm-shift {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.confirm-meta {
  min-height: 52px;
  margin-top: 12px;
  border-radius: 16px;
  background: rgba(47, 119, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  color: var(--muted);
}

.confirm-meta strong {
  color: var(--blue);
}

.cycle-card {
  display: grid;
  gap: 12px;
  padding: 20px 22px;
}

.cycle-card .settings-head {
  margin-bottom: 0;
}

.cycle-card .confirm-sequence {
  min-height: 64px;
  padding: 10px 12px;
  margin: 0;
}

.cycle-footer {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(47, 119, 255, 0.08);
}

.cycle-start-info {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.cycle-start-info span {
  color: var(--muted);
  font-size: 14px;
}

.cycle-start-info strong {
  color: var(--blue);
  font-weight: 900;
}

.cycle-edit-btn {
  min-width: 88px;
  flex: 0 0 auto;
}

.setting-row:first-of-type {
  border-top: 0;
}

.switch {
  width: 62px;
  height: 34px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.36);
  padding: 3px;
}

.switch::after {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: block;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.16s ease;
}

.switch.on {
  background: var(--blue);
}

.switch.on::after {
  transform: translateX(28px);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.segmented button {
  min-height: 54px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
}

.segmented button.active {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(47, 119, 255, 0.12);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  width: min(calc(100% - 36px), 840px);
  height: 76px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.nav-item {
  border-radius: 999px;
  display: grid;
  place-items: center;
  gap: 2px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  line-height: 1;
}

.nav-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

.nav-item.active {
  background: rgba(47, 119, 255, 0.1);
  color: var(--blue);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  padding: 0 12px;
}

.field textarea {
  padding: 12px;
  resize: vertical;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
}

.admin-side {
  position: sticky;
  top: 18px;
  align-self: start;
  padding: 18px;
}

.admin-side button {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0 14px;
  font-weight: 800;
}

.admin-side button.active {
  background: rgba(47, 119, 255, 0.12);
  color: var(--blue);
}

.admin-main {
  display: grid;
  gap: 14px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted);
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.42);
}

.modal {
  width: min(100%, 560px);
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 22px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
}

.modal-actions .primary-btn,
.modal-actions .ghost-btn,
.modal-actions .danger-btn {
  width: auto;
  min-width: 92px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.modal-actions .primary-btn {
  flex: 1 1 140px;
}

.modal-actions .danger-btn {
  flex: 0 0 92px;
}

.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 720px) {
  .app-shell {
    padding-inline: 14px;
  }

  .detail-card {
    grid-template-columns: auto 1fr;
  }

  .detail-card > .shift-square {
    grid-row: span 2;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-side {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .admin-side button {
    text-align: center;
    padding: 0 8px;
  }

  .side-month {
    font-size: 14px;
  }

  .rule-builder {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rule-slot {
    min-height: 96px;
  }

  .calendar-card {
    padding-inline: 8px;
  }

  .day-cell {
    min-height: 74px;
    border-radius: 14px;
  }

  .lunar,
  .holiday {
    font-size: 10px;
  }

  .shift-badge {
    min-width: 34px;
    height: 20px;
    font-size: 13px;
  }

  .row-card {
    grid-template-columns: auto 1fr;
  }

  .row-value {
    grid-column: 2;
    font-size: 20px;
  }
}


/* v8.2.4 手机浏览器适配优化 */
@media (max-width: 640px) {
  :root { --radius: 18px; --nav-h: 80px; }

  body {
    -webkit-text-size-adjust: 100%;
    background:
      radial-gradient(circle at 18% 2%, rgba(47, 119, 255, 0.08), transparent 18rem),
      linear-gradient(180deg, var(--bg), var(--bg));
  }

  .app-shell {
    width: 100%;
    padding: max(12px, env(safe-area-inset-top)) 10px calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  }

  .topbar {
    min-height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 6px;
  }

  .title {
    font-size: 28px;
    line-height: 1.12;
  }

  .toolbar {
    width: 100%;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .toolbar::-webkit-scrollbar { display: none; }

  .toolbar .pill,
  .toolbar .primary-btn,
  .toolbar .ghost-btn,
  .toolbar .danger-btn {
    min-height: 38px;
    padding-inline: 12px;
    font-size: 13px;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .toolbar .auth-pill { min-width: 58px; }

  .toolbar .icon-btn {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    font-size: 18px;
    flex: 0 0 38px;
  }

  .clean-month-switch,
  .month-switch {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    margin: 2px 0 10px;
    text-align: center;
  }

  .month-switch strong {
    font-size: 30px;
    line-height: 1.1;
  }

  .month-hint,
  .small-muted {
    font-size: 12px;
    line-height: 1.45;
  }

  .group-strip {
    margin-top: 0;
    padding: 0 0 10px;
    gap: 7px;
  }

  .group-chip {
    min-height: 34px;
    padding-inline: 13px;
    font-size: 13px;
  }

  .card {
    border-radius: var(--radius);
    box-shadow: 0 12px 36px rgba(32, 42, 62, 0.10);
  }

  .calendar-card {
    padding: 10px 6px 12px;
  }

  .weekdays span {
    padding: 5px 0 7px;
    font-size: 13px;
  }

  .day-cell {
    min-height: 64px;
    padding: 5px 2px 4px;
    border-radius: 12px;
    gap: 2px;
    overflow: hidden;
  }

  .day-number {
    font-size: 22px;
    line-height: 1;
  }

  .lunar-line,
  .lunar,
  .holiday {
    max-width: 100%;
    min-width: 0;
    font-size: 10px;
    line-height: 1.12;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .lunar-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
  }

  .day-lunar,
  .day-festival {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .day-lunar { flex: 0 1 auto; }
  .day-festival { flex: 0 0 auto; max-width: 3.8em; }

  .shift-badge {
    min-width: 30px;
    height: 18px;
    padding: 0 7px;
    font-size: 12px;
  }

  .today-mini,
  .corner-tag {
    top: 3px;
    right: 3px;
    min-height: 16px;
    padding: 0 4px;
    font-size: 9px;
    line-height: 16px;
  }

  .manual-dot {
    right: 3px;
    bottom: 3px;
    min-width: 17px;
    height: 16px;
    padding: 0 4px;
    font-size: 9px;
  }

  .detail-card {
    margin-top: 12px;
    padding: 14px;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
  }

  .detail-card > .shift-square {
    width: 54px;
    height: 54px;
    border-radius: 15px;
    font-size: 27px;
  }

  .detail-card > .ghost-btn {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 40px;
  }

  .detail-date {
    font-size: 23px;
    line-height: 1.2;
  }

  .detail-meta {
    margin-top: 5px;
    font-size: 13px;
  }

  .detail-badges {
    gap: 6px;
    margin-top: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .detail-badges::-webkit-scrollbar { display: none; }

  .detail-chip {
    min-height: 24px;
    padding-inline: 9px;
    font-size: 11px;
    flex: 0 0 auto;
  }

  .detail-grid {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
  }

  .mini-label { font-size: 12px; }
  .mini-value { font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }

  .section-title {
    margin: 18px 2px 10px;
    font-size: 22px;
  }

  .stats-hero {
    padding: 18px;
  }

  .stats-hero .label {
    font-size: 16px;
  }

  .stats-number {
    margin: 8px 0 14px;
    font-size: clamp(54px, 18vw, 74px);
  }

  .stats-number span {
    font-size: 18px;
  }

  .chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .chip-row::-webkit-scrollbar { display: none; }

  .info-chip {
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .stats-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .stats-mini-grid > div {
    min-height: 58px;
    padding: 10px;
    border-radius: 14px;
  }

  .stats-mini-grid span { font-size: 11px; }
  .stats-mini-grid strong { font-size: 13px; white-space: normal; }

  .row-card {
    min-height: 76px;
    padding: 13px 14px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
  }

  .shift-square {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    font-size: 26px;
  }

  .row-title {
    font-size: 18px;
    line-height: 1.2;
  }

  .row-sub {
    font-size: 12px;
    line-height: 1.35;
  }

  .row-value {
    grid-column: auto;
    font-size: 18px;
  }

  .shift-row-tags {
    gap: 5px;
    margin-top: 6px;
  }

  .shift-row-tags span {
    padding: 3px 7px;
    font-size: 11px;
  }

  .chart-card {
    padding: 16px 12px;
  }

  .chart-head {
    flex-direction: column;
    gap: 6px;
  }

  .chart-head .settings-head {
    margin-bottom: 2px;
    font-size: 20px;
  }

  .chart-legend {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  .bars {
    height: 150px;
    gap: 3px;
  }

  .interactive-bars { gap: 3px; }

  .chart-day .bar {
    width: min(100%, 10px);
  }

  .chart-day::after {
    display: none;
  }

  .chart-axis {
    font-size: 10px;
  }

  .stats-focus-card {
    margin-top: 12px;
    padding: 12px;
  }

  .stats-focus-main strong { font-size: 16px; }
  .stats-focus-main p { font-size: 12px; }

  .stats-focus-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-focus-meta span {
    min-height: 30px;
    padding-inline: 8px;
    font-size: 11px;
  }

  .settings-card,
  .rule-card {
    padding: 14px;
  }

  .settings-head {
    font-size: 20px;
    margin-bottom: 8px;
  }

  .setting-row {
    min-height: 56px;
    gap: 9px;
  }

  .segmented {
    gap: 6px;
  }

  .segmented button {
    min-height: 44px;
    border-radius: 14px;
    font-size: 13px;
  }

  .rule-builder {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .rule-slot {
    min-height: 86px;
    border-radius: 14px;
  }

  .cycle-line {
    gap: 8px;
    margin: 14px 0;
  }

  .confirm-sequence {
    min-height: 60px;
    gap: 8px;
    padding: 10px;
  }

  .confirm-shift {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 21px;
  }

  .bottom-nav {
    width: min(calc(100% - 20px), 840px);
    height: 66px;
    bottom: max(8px, env(safe-area-inset-bottom));
    padding: 6px;
  }

  .nav-item {
    font-size: 12px;
  }

  .nav-icon,
  .nav-icon svg {
    width: 23px;
    height: 23px;
  }

  .modal-backdrop {
    padding: 10px;
    place-items: end center;
  }

  .modal {
    width: 100%;
    max-height: min(86vh, 720px);
    padding: 16px;
    border-radius: 20px;
  }

  .confirm-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-size: 24px;
  }

  .confirm-hero h2 {
    font-size: 22px;
  }

  .confirm-hero p {
    font-size: 13px;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 42px;
    border-radius: 12px;
  }

  .modal-actions {
    gap: 8px;
  }

  .modal-actions.equal-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .modal-actions .primary-btn,
  .modal-actions .ghost-btn,
  .modal-actions .danger-btn,
  .modal-actions.equal-row .primary-btn,
  .modal-actions.equal-row .ghost-btn,
  .modal-actions.equal-row .danger-btn {
    min-width: 0;
    min-height: 40px;
    padding-inline: 8px;
    font-size: 13px;
  }

  .group-editor-row {
    grid-template-columns: 1fr;
  }

  .group-editor-row .ghost-btn,
  .group-editor-row .danger-btn {
    width: 100%;
  }

  .admin-layout { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .app-shell { padding-inline: 8px; }
  .title { font-size: 25px; }
  .toolbar .pill { padding-inline: 10px; }
  .month-switch strong { font-size: 27px; }
  .calendar-card { padding-inline: 4px; }
  .day-cell { min-height: 58px; border-radius: 10px; }
  .day-number { font-size: 19px; }
  .lunar-line { font-size: 9px; }
  .day-festival { max-width: 3.2em; }
  .shift-badge { min-width: 28px; height: 17px; font-size: 11px; padding-inline: 6px; }
  .detail-date { font-size: 20px; }
  .row-card { padding: 12px; gap: 8px; }
  .shift-square { width: 48px; height: 48px; font-size: 24px; }
  .row-title { font-size: 17px; }
  .row-value { font-size: 16px; }
  .stats-mini-grid { grid-template-columns: 1fr 1fr; }
  .modal-actions.equal-row .primary-btn,
  .modal-actions.equal-row .ghost-btn,
  .modal-actions.equal-row .danger-btn { font-size: 12px; padding-inline: 4px; }
}

/* v8.2.6 手机端角标与动效优化 */
.day-cell.today:not(.selected) {
  outline: 2px solid rgba(47, 119, 255, 0.72);
  outline-offset: -2px;
  background: rgba(47, 119, 255, 0.055);
}

.day-cell.today.selected {
  outline-width: 3px;
  box-shadow: 0 0 0 4px rgba(47, 119, 255, 0.10) inset;
}

.today-mini {
  display: none !important;
}

.screen.active.month-motion-next .calendar-card,
.screen.active.month-motion-next .detail-card,
.screen.active.month-motion-next .stats-hero,
.screen.active.month-motion-next .list,
.screen.active.month-motion-next .chart-card,
.screen.active.month-motion-next .rules {
  animation: monthSlideNext 0.32s cubic-bezier(.22,.9,.24,1) both;
}

.screen.active.month-motion-prev .calendar-card,
.screen.active.month-motion-prev .detail-card,
.screen.active.month-motion-prev .stats-hero,
.screen.active.month-motion-prev .list,
.screen.active.month-motion-prev .chart-card,
.screen.active.month-motion-prev .rules {
  animation: monthSlidePrev 0.32s cubic-bezier(.22,.9,.24,1) both;
}

@keyframes monthSlideNext {
  from { opacity: 0; transform: translateX(26px) scale(.992); filter: blur(2px); }
  to { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
}

@keyframes monthSlidePrev {
  from { opacity: 0; transform: translateX(-26px) scale(.992); filter: blur(2px); }
  to { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
}

.card,
.group-chip,
.nav-item,
.row-card,
.setting-row,
.chart-day,
.day-cell,
.shift-badge,
.detail-chip {
  transition: transform .20s cubic-bezier(.22,.9,.24,1), opacity .20s ease, background .20s ease, border-color .20s ease, box-shadow .20s ease;
}

@media (max-width: 640px) {
  .day-cell {
    min-height: 66px;
    padding-top: 7px;
    overflow: hidden;
  }

  .day-cell.has-corner .day-number {
    transform: translateY(2px);
  }

  .corner-tag {
    top: 2px !important;
    right: 2px !important;
    min-width: 15px !important;
    width: 15px !important;
    height: 15px !important;
    min-height: 15px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    font-size: 8px !important;
    line-height: 15px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
  }

  .corner-tag.off {
    background: rgba(238, 240, 243, 0.96) !important;
    color: #3f4855 !important;
  }

  .corner-tag.work {
    background: rgba(255, 244, 204, 0.98) !important;
    color: #d08a00 !important;
  }

  .day-number {
    font-size: 21px;
  }

  .lunar-line {
    max-width: calc(100% - 2px);
  }

  .shift-badge {
    min-width: 29px;
    height: 18px;
    font-size: 12px;
  }

  .manual-dot {
    transform: scale(.88);
    transform-origin: right bottom;
  }

  .screen.active {
    animation-duration: .20s;
  }
}

@media (max-width: 380px) {
  .corner-tag {
    min-width: 14px !important;
    width: 14px !important;
    height: 14px !important;
    min-height: 14px !important;
    font-size: 7px !important;
    line-height: 14px !important;
  }

  .day-cell {
    min-height: 60px;
    padding-top: 6px;
  }

  .day-number {
    font-size: 19px;
  }
}
