*,
::after,
::before {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

:root {
  --schedule-bg: var(--bg-color, #171c21);
  --schedule-surface: rgba(255, 255, 255, 0.04);
  --schedule-surface-hover: rgba(255, 255, 255, 0.08);
  --schedule-border: rgba(255, 255, 255, 0.08);
  --schedule-border-strong: rgba(255, 255, 255, 0.18);
  --schedule-text: var(--f-color, #eeeeee);
  --schedule-text-muted: rgba(238, 238, 238, 0.6);
  --schedule-accent: var(--网站风格颜色, #2a978c);
  --schedule-accent-soft: rgba(42, 151, 140, 0.15);
  --schedule-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --schedule-shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.25);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

body {
  min-height: 100vh;
  background: radial-gradient(
      1200px 600px at 15% -10%,
      rgba(42, 151, 140, 0.18),
      transparent 60%
    ),
    radial-gradient(
      900px 500px at 110% 10%,
      rgba(158, 42, 43, 0.14),
      transparent 60%
    ),
    var(--schedule-bg);
}

#重置按钮 {
  position: fixed;
  top: 10vh;
  right: 3vw;
  min-width: 120px;
  height: 46px;
  padding: 0 22px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid var(--schedule-border-strong);
  border-radius: 999px;
  color: var(--schedule-text);
  font-size: 15px;
  letter-spacing: 2px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--schedule-shadow-soft);
  transition: all 0.25s ease;
  z-index: 20;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

#重置按钮 i {
  font-size: 15px;
  opacity: 0.85;
}

#重置按钮:hover {
  background: linear-gradient(
    135deg,
    rgba(42, 151, 140, 0.35),
    rgba(42, 151, 140, 0.1)
  );
  border-color: var(--schedule-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(42, 151, 140, 0.25);
}

#重置按钮:active {
  transform: translateY(0);
}

#重置按钮 p {
  font-size: inherit;
  letter-spacing: inherit;
}

.main {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 6vh 4vw 4vh;
  gap: 3vw;
}

.left {
  width: 22%;
  min-width: 260px;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.right {
  flex: 1;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ========== 面板容器 ========== */
.面板容器 {
  width: 100%;
  height: 100%;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid var(--schedule-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--schedule-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.面板容器::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  pointer-events: none;
}

/* ========== 选项卡栏 ========== */
.选项卡栏 {
  display: flex;
  position: relative;
  padding: 6px;
  margin: 12px 12px 0;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--schedule-border);
  border-radius: 14px;
  flex-shrink: 0;
}

.选项卡 {
  flex: 1;
  position: relative;
  z-index: 2;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--schedule-text-muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: color 0.3s ease;
  white-space: nowrap;
  font-family: inherit;
}

.选项卡 i {
  font-size: 14px;
}

.选项卡:hover {
  color: var(--schedule-text);
}

.选项卡.active {
  color: #fff;
}

.选项卡指示器 {
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc(50% - 6px);
  height: calc(100% - 12px);
  background: linear-gradient(
    135deg,
    var(--schedule-accent),
    rgba(42, 151, 140, 0.7)
  );
  border-radius: 10px;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 4px 14px rgba(42, 151, 140, 0.35);
  z-index: 1;
}

.选项卡栏[data-active="custom"] .选项卡指示器 {
  transform: translateX(100%);
}

/* ========== 选项卡内容 ========== */
.选项卡内容 {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.面板 {
  position: absolute;
  inset: 0;
  padding: 16px 14px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateX(12px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s;
}

.面板.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s;
}

/* ========== 科目区（科目面板） ========== */
.科目区 {
  width: 100%;
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: minmax(56px, auto);
  gap: 10px;
  align-content: start;
  padding-bottom: 8px;
}

.科目 {
  width: 100%;
  min-height: 56px;
  padding: 12px 14px 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: grab;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.25s ease, border-color 0.25s ease, filter 0.25s ease;
  user-select: none;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.科目::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9),
    rgba(255, 255, 255, 0.3)
  );
  pointer-events: none;
  z-index: 1;
}

.科目::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(255, 255, 255, 0.02) 60%
  );
  pointer-events: none;
  z-index: 0;
}

.科目:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.3);
  filter: brightness(1.12);
  z-index: 2;
}

.科目:active {
  cursor: grabbing;
  transform: translateY(0) scale(0.97);
}

.科目.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.科目名称,
.老师名称 {
  position: relative;
  z-index: 1;
  line-height: 1.2;
  width: 100%;
}

.科目名称 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.老师名称 {
  font-size: 12px;
  opacity: 0.8;
  letter-spacing: 0.5px;
  font-family: var(--代码字体, Consolas, monospace);
}

/* ========== 自定义面板 ========== */
.自定义头部 {
  text-align: center;
  padding: 8px 0 14px;
  border-bottom: 1px solid var(--schedule-border);
  margin-bottom: 14px;
  position: relative;
}

.自定义头部::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--schedule-accent),
    transparent
  );
  border-radius: 2px;
}

.自定义头部 h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--schedule-text);
}

.自定义头部 p {
  font-size: 12px;
  color: var(--schedule-text-muted);
  margin-top: 4px;
  letter-spacing: 1px;
}

.添加表单 {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.表单组 {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.表单组 label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--schedule-text-muted);
  text-transform: uppercase;
}

.表单组 input[type="text"] {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--schedule-border);
  border-radius: var(--radius-sm);
  color: var(--schedule-text);
  font-size: 14px;
  letter-spacing: 1px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  font-family: inherit;
}

.表单组 input[type="text"]::placeholder {
  color: rgba(238, 238, 238, 0.3);
}

.表单组 input[type="text"]:focus {
  outline: none;
  border-color: var(--schedule-accent);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px var(--schedule-accent-soft);
}

.颜色选择器 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

input[type="color"] {
  width: 38px;
  height: 38px;
  border: 1px solid var(--schedule-border);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  padding: 3px;
  transition: border-color 0.25s ease, transform 0.2s ease;
}

input[type="color"]:hover {
  border-color: var(--schedule-border-strong);
  transform: scale(1.05);
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

.预设颜色 {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.预设颜色 span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.预设颜色 span:hover {
  transform: scale(1.15);
}

.预设颜色 span.selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--schedule-accent);
}

.添加按钮 {
  width: 100%;
  height: 44px;
  margin-top: 4px;
  background: linear-gradient(
    135deg,
    var(--schedule-accent),
    rgba(42, 151, 140, 0.85)
  );
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
  font-family: inherit;
}

.添加按钮:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(42, 151, 140, 0.4);
  filter: brightness(1.08);
}

.添加按钮:active {
  transform: translateY(0) scale(0.98);
}

.添加按钮 i {
  font-size: 14px;
}

.自定义列表头 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 8px;
  border-top: 1px solid var(--schedule-border);
  margin-top: 4px;
}

.自定义列表头 h4 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--schedule-text-muted);
}

.计数 {
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  background: var(--schedule-accent-soft);
  color: var(--schedule-accent);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

.自定义列表 {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 16px;
}

.空状态 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 16px;
  color: var(--schedule-text-muted);
  text-align: center;
  gap: 6px;
}

.空状态 i {
  font-size: 32px;
  opacity: 0.4;
  margin-bottom: 4px;
}

.空状态 p {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
}

.空状态 span {
  font-size: 12px;
  opacity: 0.6;
}

.自定义科目项 {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--schedule-border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  animation: slideIn 0.3s ease;
}

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

.自定义科目项:hover {
  border-color: var(--schedule-border-strong);
  background: rgba(0, 0, 0, 0.35);
}

.自定义颜色预览 {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.自定义信息 {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.自定义名称 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--schedule-text);
}

.自定义老师 {
  font-size: 11px;
  color: var(--schedule-text-muted);
  letter-spacing: 0.5px;
}

.自定义删除 {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 82, 82, 0.12);
  border-radius: 8px;
  color: #ff6b6b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.自定义删除:hover {
  background: rgba(255, 82, 82, 0.25);
  color: #ff4040;
  transform: scale(1.08);
}

.自定义删除:active {
  transform: scale(0.95);
}

/* ========== 表格 ========== */
table {
  width: min(88%, 1100px);
  height: 100%;
  border-collapse: separate;
  border-spacing: 10px 12px;
  table-layout: fixed;
}

thead th {
  padding: 10px 8px;
  font-size: 14px;
  letter-spacing: 4px;
  font-weight: 500;
  color: var(--schedule-text-muted);
  background: transparent;
  border: none;
}

tbody th {
  padding: 0 6px 0 0;
  font-size: 13px;
  letter-spacing: 3px;
  font-weight: 500;
  color: var(--schedule-text-muted);
  text-align: right;
  vertical-align: middle;
  background: transparent;
  border: none;
}

td {
  height: 72px;
  border: 1px dashed var(--schedule-border-strong);
  border-radius: var(--radius-md);
  text-align: center;
  background: var(--schedule-surface);
  transition: background-color 0.2s ease, border-color 0.2s ease,
    transform 0.18s ease, box-shadow 0.2s ease;
  padding: 6px;
  cursor: pointer;
  vertical-align: middle;
}

td:nth-child(1) {
  width: 70px;
}

td:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: var(--schedule-surface-hover);
}

td.drag-over {
  border-style: solid;
  border-color: rgba(42, 151, 140, 0.85);
  box-shadow: 0 0 0 3px rgba(42, 151, 140, 0.18),
    inset 0 0 20px rgba(42, 151, 140, 0.18);
  transform: scale(0.985);
}

td.已经放置 {
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--schedule-shadow-soft);
}

td.已经放置::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.18),
    rgba(255, 255, 255, 0)
  );
  pointer-events: none;
}

td.已经放置:hover {
  filter: brightness(1.08);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

td.已经放置 .单元格盒子 {
  position: relative;
  z-index: 1;
  height: 100%;
  justify-content: center;
  gap: 4px;
}

.单元格盒子 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  padding: 4px 6px;
  text-align: center;
}

.科目名称区 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.2;
}

.老师区 {
  font-size: 12px;
  opacity: 0.88;
  letter-spacing: 1px;
  font-family: var(--代码字体, Consolas, monospace);
}

.午休 {
  border: none !important;
  background: transparent !important;
  text-align: center !important;
  color: var(--schedule-text-muted) !important;
  letter-spacing: 10px !important;
  font-weight: 500 !important;
  font-size: 18px !important;
  height: 28px !important;
  padding: 0 !important;
  border-radius: 0 !important;
  cursor: default !important;
}

.午休:hover {
  background: transparent !important;
  border: none !important;
}

.提示 {
  position: fixed;
  left: 50%;
  bottom: 8vh;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 24px;
  background: rgba(20, 24, 28, 0.85);
  border: 1px solid var(--schedule-border-strong);
  border-radius: 999px;
  color: var(--schedule-text);
  font-size: 14px;
  letter-spacing: 2px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 999;
}

.提示.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@supports not (backdrop-filter: blur(10px)) {
  .面板容器,
  #重置按钮,
  .提示 {
    background: rgba(30, 35, 40, 0.9);
  }
}

/* ========== 响应式 ========== */
@media (max-width: 1080px) {
  .main {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    padding: 14vh 4vw 4vh;
    gap: 24px;
  }

  .left {
    width: 100%;
    height: auto;
    min-width: 0;
  }

  .面板容器 {
    min-height: 400px;
  }

  .科目区 {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .科目 {
    min-height: 48px;
    padding: 10px 12px 10px 14px;
  }

  .right {
    width: 100%;
    height: auto;
  }

  table {
    width: 100%;
    height: auto;
    border-spacing: 6px;
  }

  td {
    height: 56px;
  }

  td:nth-child(1) {
    width: 54px;
  }

  .午休 {
    height: 22px !important;
    letter-spacing: 6px !important;
    font-size: 15px !important;
  }
}

@media (max-width: 640px) {
  #重置按钮 {
    top: 8vh;
    right: 50%;
    transform: translateX(50%);
  }

  #重置按钮:hover {
    transform: translateX(50%) translateY(-2px);
  }

  thead th {
    font-size: 12px;
    letter-spacing: 2px;
    padding: 8px 2px;
  }

  tbody th {
    font-size: 11px;
    letter-spacing: 2px;
  }

  td {
    height: 48px;
    padding: 3px;
  }

  .科目区 {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .科目 {
    min-height: 46px;
    padding: 10px 14px;
  }

  .科目名称 {
    font-size: 14px;
  }

  .老师名称 {
    font-size: 12px;
  }

  .选项卡 {
    font-size: 12px;
    padding: 8px 8px;
    letter-spacing: 1px;
  }

  .选项卡 i {
    font-size: 13px;
  }

  .选项卡 span {
    display: none;
  }

  .选项卡 {
    gap: 0;
  }
}

@media (min-width: 1081px) and (max-width: 1440px) {
  .left {
    width: 26%;
  }

  table {
    width: 92%;
  }
}

@media (min-width: 1441px) {
  table {
    width: 85%;
  }
}