/* 班表页面样式 */
:root {
  --column-width: 111px;
  --column-height: 55px;
  --header-height: 80px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: #f5f7fa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.duty-container {
  width: 100%;
  min-height: 100vh;
  background-color: #f5f7fa;
  padding-top: 20px;
  padding-bottom: 20px;
}

/* 固定在顶部的区域 */
.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: #f5f7fa;
  padding-top: env(safe-area-inset-top, 0);
}

/* 头部区域 */
.header-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px;
  gap: 12px;
  background-color: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  position: relative;
  z-index: 1001;
}

/* 占位区域 */
.header-placeholder {
  height: calc(10px + env(safe-area-inset-top, 0));
  width: 100%;
}

/* 日期选择器样式 */
.date-picker-section {
  flex-shrink: 1;
  overflow: hidden;
}

.date-picker-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.date-nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 48px;
  background-color: transparent;
  border: none;
  transition: all 0.2s;
  cursor: pointer;
  font-size: 28px;
  color: #666;
  font-weight: 600;
}

.date-nav-button:active {
  background-color: rgba(0, 0, 0, 0.05);
  transform: scale(0.95);
}

.date-picker {
  font-size: 28px;
  color: #333;
  padding: 12px 24px;
  background-color: transparent;
  border-radius: 6px;
  white-space: nowrap;
}

/* 班组选择器样式 */
.group-picker-section {
  flex-shrink: 1;
  overflow: hidden;
}

.group-select {
  font-size: 24px;
  color: #333;
  padding: 10px 20px;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
}

.group-select:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.group-select:active {
  transform: scale(0.98);
}

/* 按钮样式 */
.table__tool__line__item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 16px;
  background-color: #fff;
  border-radius: 6px;
  font-size: 26px;
  color: #333;
  border: 1px solid #e0e0e0;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
  flex-shrink: 0;
}

.table__tool__line__item:active {
  background-color: #f5f5f5;
  transform: scale(0.95);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.table__tool__line__item.weui-btn_primary {
  background-color: #fff;
  color: #333;
  border: 1px solid #e0e0e0;
}

/* 加载提示 */
.loading {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 10px;
  font-size: 14px;
  color: #666;
}

/* 班表容器 */
.zoom-box {
  transition: transform 0.3s ease;
}

.table__box {
  width: 100%;
  height: auto;
  position: relative;
  top: 120px;
  z-index: 999;
  border: 1px solid #E4E4E4;
}

.table__scroll {
  overflow: auto;
  background: #FFF;
  max-height: calc(100vh - 200px);
}

.table__scroll__view {
  display: inline-block;
  min-width: 100%;
}

/* 表头样式 */
.table__header {
  position: sticky;
  top: 0;
  z-index: 999;
  display: grid;
  grid-auto-flow: column;
  font-size: 26px;
  font-weight: bold;
  color: #333333;
  background: #F4F6FF;
}

.table__header__item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 26px;
  text-align: center;
  background: #F4F6FF;
  width: var(--column-width);
  height: var(--header-height);
  position: relative;
  z-index: 888;
  border: 1px solid #E4E4E4;
  border-left: 0;
  border-top: 0;
}

.table__header__item:nth-child(1) {
  width: var(--column-width);
  position: sticky;
  left: 0;
  z-index: 999;
}

/* 检修圆点 */
.maintenance-dots {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}

.maintenance-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-zhongyang {
  background-color: #4a90e2;
}

.dot-chezai {
  background-color: #ff9500;
}

/* 表格内容 */
.table__content {
  background-color: #fff;
}

.table__content__line {
  display: grid;
  grid-auto-flow: column;
  position: relative;
}

.table__content__line__item {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: #fff;
  width: var(--column-width);
  height: var(--column-height);
  border: 1px solid #E4E4E4;
  border-left: 0;
  border-top: 0;
  font-size: 26px;
  line-height: 26px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.table__content__line__item:nth-child(1) {
  width: var(--column-width);
  position: sticky;
  left: 0;
  line-height: 26px;
  background-color: #fff;
  z-index: 1;
}

.table__content__line__item:active {
  background-color: #f0f0f0;
}

/* 高亮样式 */
.toDay {
  background: #07c160 !important;
  color: #fff;
}

.offDay {
  background: #9dd1e9 !important;
  color: #000;
}

.highlightUserCode {
  background: #e2ffbe !important;
  color: #000;
}

.highlightSecondary {
  background: #ddffc8 !important;
  color: #000;
}

.workTeamLeader {
  background: #b8ffb6 !important;
  color: #000;
}

.hours {
  background: #a6e7bf !important;
  color: #000;
}

.even {
  background: #fff;
}

.odd {
  background: #f5f5f5;
}

/* 检修弹窗 */
.maintenance-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.maintenance-popup {
  width: 85%;
  max-width: 600px;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.maintenance-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f8f8;
}

.maintenance-popup-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.maintenance-popup-close {
  width: 30px;
  height: 30px;
  font-size: 24px;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.maintenance-popup-content {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.maintenance-detail-item {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
}

.maintenance-detail-item:last-child {
  border-bottom: none;
}

.maintenance-detail-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}

.maintenance-detail-value {
  font-size: 14px;
  color: #333;
  line-height: 1.6;
  word-wrap: break-word;
  word-break: break-all;
  white-space: pre-wrap;
}

.maintenance-popup-bottom-space {
  height: 20px;
}

/* 自定义菜单 */
.custom-menu {
  position: fixed;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  min-width: 150px;
}

.custom-menu-item {
  padding: 12px 16px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}

.custom-menu-item:last-child {
  border-bottom: none;
}

.custom-menu-item:active {
  background-color: #f5f5f5;
}

/* 自定义提示 */
.custom-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10001;
  animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; }
}
