/* 全局基础 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", sans-serif;
}

body {
  background: #f7f8fa;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.white-window {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* 主页面文字 */
.title {
  text-align: center;
  font-size: 24px;
  color: #222;
  margin-bottom: 28px;
  font-weight: bold;
}

.cycle-text {
  font-size: 16px;
  color: #666;
  margin-bottom: 14px;
  text-align: center;
}

.total-wage-line {
  font-size: 22px;
  color: #333;
  margin-bottom: 22px;
  font-weight: 500;
  text-align: center;
}

.total-wage-line span {
  color: #00c851;
  font-weight: bold;
  font-size: 26px;
}

.sub-title {
  font-size: 17px;
  margin: 20px 0 12px;
  color: #333;
}

.hidden {
  display: none !important;
}

/* 首页工资卡片 */
.total-wage-box {
  text-align: center;
  margin-top: 10px;
  padding: 20px;
  background: #fcfcfc;
  border-radius: 12px;
  border: 1px solid #f0f0f0;
}

.btn-detail {
  padding: 14px 28px;
  font-size: 16px;
  background: #409eff;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  font-weight: 500;
}

.btn-detail:hover {
  background: #338ee5;
}

/* 日历样式（日期上显示班次） */
.calendar-wrap {
  background: #fafbfc;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.calendar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-head button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: #409eff;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  color: #888;
  font-weight: bold;
  margin-bottom: 8px;
}

.calendar-body {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-day {
  aspect-ratio: 1/1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  background: #f1f3f5;
  font-weight: 500;
  padding: 4px;
  position: relative;
}

/* 日期上的班次文字：小字号、浅色 */
.calendar-day .shift-tag {
  font-size: 11px;
  color: #8b939f;
  margin-top: 2px;
  line-height: 1;
}

.calendar-day.has-record {
  background: #e3f2fd !important;
  color: #1976d2 !important;
}

.calendar-day.selected {
  background: #409eff !important;
  color: #fff !important;
}

.calendar-day.other {
  color: #ccc;
  background: #fafafa;
}

/* 表单 */
.form-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #fafbfc;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.form-input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
}

/* 修复：加长时间下拉框 */
.time-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-row label {
  width: 95px;
  font-size: 14px;
  color: #444;
}

.time-select {
  flex: 1; /* 让下拉框占满剩余宽度 */
  height: 44px; /* 和输入框一样高 */
  padding: 0 12px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  background: #fff;
}

.time-tip {
  color: #666;
  font-size: 14px;
}

.btn-primary {
  height: 46px;
  background: #00c851;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 500;
}

.btn-back {
  text-align: center;
  margin: 10px 0;
}

.btn-back button {
  padding: 10px 20px;
  border-radius: 8px;
  background: #909399;
  color: #fff;
  border: none;
  cursor: pointer;
}

/* 列表 */
.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item {
  padding: 16px;
  background: #fafbfc;
  border-radius: 10px;
  border-left: 4px solid #409eff;
}

.item-date {
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 6px;
}

.item-money {
  color: #00c851;
  font-weight: bold;
  margin: 6px 0;
}

.item-op {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.btn-sm {
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  color: white;
  cursor: pointer;
}

.btn-edit {
  background: #409eff;
}

.btn-del {
  background: #f56c6c;
}

/* 管理员入口 */
.admin-entrance {
  text-align: center;
  color: #999;
  margin-top: 20px;
  cursor: pointer;
}

/* ========================== */
/* 全局轻量弹窗 + 修复动画 */
/* ========================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.28s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: #fff;
  width: 90%;
  max-width: 380px;
  padding: 24px;
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transform: translateY(10px) scale(0.95);
  transition: transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-overlay.show .modal-box {
  transform: translateY(0) scale(1);
}

.modal-title {
  text-align: center;
  font-size: 18px;
  color: #333;
  margin-bottom: 20px;
  font-weight: 600;
}

/* 登录弹窗输入框 */
.modal-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e5e6eb;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 20px;
  outline: none;
}

.modal-btn-group {
  display: flex;
  gap: 10px;
}

.modal-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
}

.modal-btn.cancel {
  background: #f5f7fa;
  color: #666;
}

.modal-btn.confirm {
  background: #409eff;
  color: #fff;
}

/* 详情弹窗数字蓝色加粗 */
.detail-item {
  font-size: 15px;
  line-height: 2;
  color: #333;
}

.detail-item span {
  color: #409eff;
  font-weight: bold;
}

/* 周期分组 */
.cycle-group {
  margin: 10px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #eee;
}

.cycle-header {
  background: #f5f7fa;
  padding: 12px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ========================== */
/* 周期明细子弹窗 */
/* ========================== */
#cycle-detail-overlay .modal-box {
  border-top: 4px solid #409eff;
  background: #f8fbff;
  max-width: 420px;
}

#cycle-detail-record-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.cycle-detail-item {
  background: #f0f7ff;
  border-radius: 10px;
  padding: 12px;
  border-left: 4px solid #409eff;
}

.cycle-detail-item .date-text {
  font-size: 15px;
  font-weight: 700;
  color: #2377d9;
  display: block;
  margin-bottom: 6px;
}

.cycle-detail-item .info-line {
  font-size: 14px;
  color: #444;
  line-height: 1.5;
}

.cycle-detail-item .money {
  color: #00c851;
  font-weight: 500;
}

#cycle-detail-close {
  background-color: #409eff !important;
}

/* Toast 轻提示 */
.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 14px;
  border-radius: 8px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}