.training-plans-page .plans-sticky-sentinel {
  height: 1px;
  margin: 0;
  pointer-events: none;
  visibility: hidden;
}

.training-plans-page .plans-sticky-bar {
  position: sticky;
  top: 0;
  z-index: 12;
  margin: 0 -16px 16px;
  padding: 4px 16px 8px;
  background: transparent;
}

.plans-top-cover {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 58px;
  z-index: 17;
  background: var(--screen-bg);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

.plans-top-cover.is-visible {
  opacity: 1;
  visibility: visible;
}

.training-plans-page .plans-sticky-bar.is-stuck {
  background: var(--screen-bg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.training-plans-page .plans-sticky-bar .segment-bar {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .plans-top-cover {
    display: none !important;
  }

  .training-plans-page .plans-sticky-bar.is-stuck {
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
  }
}

.page-top--with-action {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.page-top--with-action .page-top-main {
  flex: 1;
  min-width: 0;
}

.page-top--with-action .screen-subtitle {
  margin-bottom: 0;
}

.page-top-action {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin-top: 2px;
  border-radius: 12px;
  background: var(--brand-muted);
  border: 1px solid rgba(217, 255, 0, 0.28);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  text-decoration: none;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.page-top-action:active {
  transform: scale(0.94);
  background: rgba(217, 255, 0, 0.14);
}

.page-top-action--text {
  width: auto;
  min-width: 72px;
  padding: 0 12px;
  font-family: var(--font-family-base);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
}

.plan-card-cancel {
  flex-shrink: 0;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-family-base);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease,
    transform 0.12s ease;
}

.plan-card-cancel:active {
  transform: scale(0.96);
  border-color: rgba(255, 69, 58, 0.35);
  color: #ff453a;
  background: rgba(255, 69, 58, 0.08);
}

#cancel-plan-confirm-sheet.sheet-overlay {
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

#cancel-plan-confirm-sheet .sheet-backdrop {
  inset: -4px;
  background: rgba(0, 0, 0, 0.78);
}

#cancel-plan-confirm-sheet .sheet-panel--confirm {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 8px 20px 28px;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px 20px 0 0;
  background: #141414;
  box-sizing: border-box;
}

#cancel-plan-confirm-sheet .sheet-panel--confirm h3 {
  margin-bottom: 8px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.cancel-plan-confirm-msg {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}

#cancel-plan-confirm-sheet .confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#cancel-plan-confirm-sheet .confirm-actions .btn-primary-block {
  background: #ff453a;
  color: #ffffff;
}

#cancel-plan-confirm-sheet .confirm-actions .btn-primary-block:active {
  background: #e63e34;
}

.plan-list {
  display: flex;
  flex-direction: column;
}

.plan-week-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.plan-week-tag--today {
  background: var(--brand-muted);
  border-color: rgba(217, 255, 0, 0.2);
  color: var(--brand);
}

.plan-week-tag--scheduled {
  background: rgba(217, 255, 0, 0.08);
  border-color: rgba(217, 255, 0, 0.18);
  color: var(--brand);
}

.plan-week-tag--record {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.plan-badge--done {
  background: rgba(217, 255, 0, 0.1);
  border: 1px solid rgba(217, 255, 0, 0.22);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.workout-record-card {
  cursor: default;
}

.workout-record-card:active {
  transform: none;
}

.plan-card--scheduled {
  border-color: rgba(217, 255, 0, 0.18);
}

/* 今日计划卡片：背景透光 + 品牌光晕 */
.training-plans-page .plan-card--today {
  overflow: hidden;
  background: rgba(26, 26, 26, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: rgba(217, 255, 0, 0.24);
  box-shadow:
    0 0 0 1px rgba(217, 255, 0, 0.1),
    0 12px 40px rgba(217, 255, 0, 0.1),
    var(--shadow-card);
}

.training-plans-page .plan-card--today::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    145deg,
    rgba(217, 255, 0, 0.16) 0%,
    rgba(217, 255, 0, 0.04) 32%,
    transparent 58%
  );
  pointer-events: none;
  z-index: 0;
}

.training-plans-page .plan-card--today::after {
  content: "";
  position: absolute;
  top: -56px;
  right: -32px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(217, 255, 0, 0.42) 0%,
    rgba(217, 255, 0, 0.12) 42%,
    transparent 72%
  );
  filter: blur(32px);
  opacity: 0.88;
  pointer-events: none;
  z-index: 0;
}

.training-plans-page .plan-card--today .plan-card-head,
.training-plans-page .plan-card--today .plan-card-meta,
.training-plans-page .plan-card--today .plan-card-actions {
  position: relative;
  z-index: 1;
}

.plan-badge--scheduled {
  background: rgba(217, 255, 0, 0.1);
  color: var(--brand);
}

.plan-list-empty {
  margin: 24px 0;
  padding: 20px 16px;
  border-radius: 16px;
  background: var(--surface-section);
  border: 1px dashed var(--border-subtle);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* 设置计划 Sheet */
#schedule-sheet.sheet-overlay {
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

#schedule-sheet .sheet-backdrop {
  inset: -4px;
  background: rgba(0, 0, 0, 0.78);
}

#schedule-sheet .sheet-panel {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 8px 20px 32px;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px 20px 0 0;
  background: #141414;
  box-sizing: border-box;
}

#schedule-sheet .sheet-handle {
  width: 40px;
  height: 5px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.16);
}

#schedule-sheet .sheet-panel h3 {
  margin-bottom: 6px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.schedule-sheet-plan {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.schedule-sheet-plan-name {
  font-weight: 700;
  color: #ffffff;
}

.week-day-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(48vh, 340px);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.week-day-picker::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.week-day-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  box-sizing: border-box;
  font-family: var(--font-family-base);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.15s ease;
}

.week-day-option:active {
  transform: scale(0.985);
}

.week-day-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.week-day-label {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.week-day-chip {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--brand-muted);
  font-size: 10px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1.4;
}

.week-day-sub {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.week-day-free {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.week-day-plan-name {
  max-width: 100%;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-day-option.is-today {
  border-color: rgba(217, 255, 0, 0.22);
  background: rgba(217, 255, 0, 0.03);
}

.week-day-option.is-today .week-day-label {
  color: var(--brand);
}

.week-day-option.is-free:hover,
.week-day-option.is-free:focus-visible {
  border-color: rgba(217, 255, 0, 0.28);
  background: rgba(217, 255, 0, 0.05);
}

.week-day-option.is-occupied {
  background: rgba(255, 255, 255, 0.03);
}

.week-day-option.is-occupied .week-day-plan-name {
  color: #d4d4d4;
}

.week-day-option.is-selected {
  border-color: var(--brand);
  background: rgba(217, 255, 0, 0.1);
  box-shadow:
    0 0 0 1px rgba(217, 255, 0, 0.15),
    0 8px 24px rgba(217, 255, 0, 0.12);
}

.week-day-option.is-selected .week-day-label {
  color: var(--brand);
}

.week-day-option.is-selected .week-day-plan-name {
  color: #ffffff;
  font-weight: 700;
}

/* 设置模板状态 Sheet */
#status-sheet.sheet-overlay {
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

#status-sheet .sheet-backdrop {
  inset: -4px;
  background: rgba(0, 0, 0, 0.78);
}

#status-sheet .sheet-panel {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 8px 20px 32px;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px 20px 0 0;
  background: #141414;
  box-sizing: border-box;
}

#status-sheet .sheet-handle {
  width: 40px;
  height: 5px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.16);
}

#status-sheet .sheet-panel h3 {
  margin-bottom: 6px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.status-sheet-plan {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.status-sheet-plan-name {
  font-weight: 700;
  color: #ffffff;
}

.status-option-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  box-sizing: border-box;
  font-family: var(--font-family-base);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.15s ease;
}

.status-option:active {
  transform: scale(0.985);
}

.status-option-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.status-option-label {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.status-option-chip {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--brand-muted);
  font-size: 10px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1.4;
}

.status-option-hint {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: right;
}

.status-option.is-selected {
  border-color: var(--brand);
  background: rgba(217, 255, 0, 0.1);
  box-shadow:
    0 0 0 1px rgba(217, 255, 0, 0.15),
    0 8px 24px rgba(217, 255, 0, 0.12);
}

.status-option.is-selected .status-option-label {
  color: var(--brand);
}

/* 底部 Sheet（首页 / 计划页） */
#change-plan-sheet.sheet-overlay,
#weight-sheet.sheet-overlay {
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

#change-plan-sheet .sheet-backdrop,
#weight-sheet .sheet-backdrop {
  inset: -4px;
  background: rgba(0, 0, 0, 0.78);
}

#change-plan-sheet .sheet-panel {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 8px 20px 32px;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px 20px 0 0;
  background: #141414;
  box-sizing: border-box;
}

#change-plan-sheet .sheet-handle {
  width: 40px;
  height: 5px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.16);
}

#change-plan-sheet .sheet-panel h3 {
  margin-bottom: 6px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.change-plan-sheet-hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.change-plan-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 380px);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.change-plan-picker::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.change-plan-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  box-sizing: border-box;
  font-family: var(--font-family-base);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.15s ease;
}

.change-plan-option:active {
  transform: scale(0.985);
}

.change-plan-main {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.change-plan-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.change-plan-chip {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--brand-muted);
  font-size: 10px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1.4;
}

.change-plan-meta {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.4;
}

.change-plan-option:hover,
.change-plan-option:focus-visible {
  border-color: rgba(217, 255, 0, 0.28);
  background: rgba(217, 255, 0, 0.05);
}

.change-plan-option.is-selected {
  border-color: var(--brand);
  background: rgba(217, 255, 0, 0.1);
  box-shadow:
    0 0 0 1px rgba(217, 255, 0, 0.15),
    0 8px 24px rgba(217, 255, 0, 0.12);
}

.change-plan-option.is-selected .change-plan-title {
  color: var(--brand);
}

.change-plan-option.is-selected .change-plan-meta {
  color: var(--text-secondary);
}

#plans-toast.page-toast,
#home-toast.page-toast {
  bottom: 40px;
  z-index: 55;
}
