:root {
  --bg-color: #ffffff;
  --sidebar-bg: #ffffff;
  --border-color: #e3e3e3;
  --text-color: #000000;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

p.pageTitle {
  height: 45px;
}

h2 {
  margin-bottom: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: rgb(243, 243, 243);
  color: var(--text-color);
  height: 100vh;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.allowS {
  user-select: all;
}

/* 顶部菜单栏 */
.menu-bar {
  height: 52px;
  background: rgb(243, 243, 243);
  display: flex;
  align-items: center;
  padding: 0 1rem;
}

.menu-bar button {
  background: none;
  border: none;
  color: var(--text-color);
  padding: 8px;
  cursor: pointer;
}

.menu-bar button:hover {
  background: #d3d3d3;
}

.topbarBtnGroup {
  background-color: rgb(225 225 225 / 45%);
  margin: 10px;
  display: flex;
  padding: 2px;
  gap: 2px;
  border-radius: 5px;
}

.pageTitle {
  border-bottom: rgba(220, 220, 220, 0.5) solid 1px;
  padding: 8px 10px 10px 10px;
  margin-bottom: 5px;
}

.pageTitle_main {
  margin-top: -11px;
  width: calc(100vw - 328px);
  margin-left: -12px;
  margin-bottom: 10px;
}

.pageTitle_main2 {
  margin-top: -11px;
  margin-left: -12px;
  margin-bottom: 10px;
  width: calc(100vw - 80px);
}

/* 主容器 */
.container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 左侧功能栏 */
/* .activity-bar {
  width: 260px;
  background: rgb(243, 243, 243);
  display: flex;
  flex-direction: column;
  outline: none;
  padding: 5px;
  gap: 2px;
}

.activity-item {
  width: 100%;
  cursor: pointer;
  display: flex;
} */

.activity-bar {
  position: relative;
  bottom: 0;
  /* width: 100%; */
  background: rgb(243, 243, 243);
  border-top: 1px solid var(--border-color);
  justify-content: flex-start;
  padding: 0 2.5px;
  z-index: 1;
  gap: 2px;
}

.activity-bar > button {
  display: flex;
  background-color: transparent;
  flex-direction: column;
  border: none;
  padding: 6px 18px;
  padding-top: 5px;
  border-radius: 5px;
  text-align: center;
  gap: 2px;
}

.activity-bar > button > i {
  font-size: 20px;
  width: 100%;
}

.activity-bar > button:hover {
  background-color: #dadadab4;
}

.activity-bar > button.selected {
  background-color: #dadada8f;
}

.activity-bar .selected::before {
  content: "";
  display: block;
  position: absolute;
  margin-top: 11px;
  width: 4px;
  height: 24px;
  background: rgb(3, 106, 196);
  border-radius: 20px;
  margin-left: -16.5px;
}

.activity-bar > button:active::before {
  content: "";
  display: block;
  position: absolute;
  margin-top: 13px;
  width: 4px;
  height: 20px;
  background: rgb(3, 106, 196);
  border-radius: 20px;
  margin-left: -16.5px;
}

.activity-bar > button:focus {
  box-shadow: none;
}

/* 资源管理器 */
.explorer {
  width: 250px;
  background: rgb(246, 246, 246);
  border: 1px solid var(--border-color);
  border-right: none;
  overflow-y: auto;
  border-radius: 10px 0 0 0;
  padding: 5px;
  gap: 2px;
}

.explorer-item {
  cursor: pointer;
  width: 100%;
}

/* 编辑区域 */
.editor-area {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  background: rgb(249, 249, 249);
  border: 1px solid var(--border-color);
}

/* 课程卡片 */
.class-card {
  /* background: #2d2d2d; */
  padding: 1rem;
  margin-bottom: 8px;
  border-radius: 4px;
  cursor: move;
}

.time-input {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 4px;
  margin: 0 4px;
}

/* 拖拽区域 */
#class-list {
  min-height: 300px;
  padding: 10px;
  /* border: 1px solid var(--border-color); */
  border-radius: 4px;
}

/* YAML编辑器 */
#yaml-editor {
  width: 100%;
}

#yaml-editor::part(control) {
  height: 500px;
}

button,
input,
select,
textarea {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
}

button:hover {
  background-color: #dadada2d;
}

button:active {
  background-color: #dadada8f;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #007acc;
  box-shadow: 0 0 0 1px #007acc;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

#subject-form {
  display: block;
}

#subject-form input {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
}

#subject-list,
#schedule-list {
  width: 100%;
}

fluent-listbox {
  border: none;
  outline: none;
}

.activity-bar {
  border: none;
}

fluent-option {
  padding-left: 10px;
}

fluent-listbox fluent-option {
  padding-left: 10px;
  background-color: transparent;
}

fluent-listbox fluent-option:hover {
  background-color: rgba(223, 223, 223, 0.445);
}

fluent-listbox fluent-option.selected {
  background-color: rgb(223, 223, 223);
}

fluent-text-field {
  width: 100%;
  margin-bottom: 10px;
}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

.mobile-only-flex {
  display: none;
}

#mobile-bottomBar {
  position: relative;
  bottom: 0;
  width: 100%;
  background: rgb(243, 243, 243);
  border-top: 1px solid var(--border-color);
  justify-content: space-around;
  padding: 10px 0;
  z-index: 1;
}

#mobile-bottomBar > button {
  display: flex;
  background-color: transparent;
  flex-direction: column;
  border: none;
  padding: 10px;
  padding-top: 5px;
  border-radius: 7px;
  text-align: center;
}

#mobile-bottomBar > button > i {
  font-size: 20px;
  width: 100%;
}

#mobile-bottomBar > button:hover {
  background-color: #dadadab4;
}

#mobile-bottomBar > button.selected {
  background-color: #dadada8f;
}

#mobile-bottomBar .selected::before {
  content: "";
  display: block;
  position: absolute;
  bottom: 15px;
  width: 30px;
  height: 4px;
  background: rgb(3, 106, 196);
  border-radius: 20px;
  margin-left: 13.5px;
}

#mobile-bottomBar > button:active::before {
  content: "";
  display: block;
  position: absolute;
  bottom: 15px;
  width: 22px;
  height: 4px;
  background: rgb(3, 106, 196);
  border-radius: 20px;
  margin-left: 17px;
}

#mobile-bottomBar > button:focus {
  box-shadow: none;
}

.settings-card {
  display: flex;
  width: 100%;
  padding: 12px;
  border: 1px solid #eaeaea;
  border-radius: 4px;
  background-color: #fff;
  margin-top: 5px;
  margin-bottom: 5px;
}

.settings-card i {
  font-size: 22px;
  margin: auto 14px;
  margin-left: 5px;
}

.settings-card .left-section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.settings-card .title {
  font-size: 15px;
}

.settings-card .description {
  font-size: 12px;
  font-weight: 400;
  color: #666;
  line-height: 1.5;
}

.settings-card .right-section {
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: block;
  }

  .mobile-only-flex {
    display: flex;
  }

  .explorer {
    width: 100vw;
  }

  .activity-bar {
    width: 100vw;
  }

  .editor-area {
    width: 100vw;
  }

  .menu-bar {
    /* display: block; */
    height: auto;
  }

  .menu-bar #titleArea {
    width: 100%;
    margin: 10px;
  }

  .menu-bar #separator {
    display: none;
  }

  .menu-bar #clearButton {
    width: 56px;
    margin-right: 0;
  }

  .menu-bar #fileArea {
    margin-left: auto;
  }

  .activity-bar {
    display: none;
  }

  .container {
    flex-direction: column;
  }

  .editor-area {
    /* display: none; */
    flex: 1;
  }

  .explorer {
    border-radius: 0;
    padding: 16px;
    flex: 1;
  }

  .pageTitle {
    margin-top: -11px;
    width: calc(100vw - 25px);
    margin-left: -12px;
  }

  .pageTitle_main {
    width: calc(100vw - 30px);
  }

  .pageTitle_main2 {
    width: calc(100vw - 14px);
  }

  .settings-card {
    display: block;
  }

  .menu-bar button {
    padding: 8px;
  }

  .editor-left {
    max-width: 100% !important;
  }

  .quick-add-panel {
    display: none;
  }
}

.editor-layout {
  display: flex;
  gap: 20px;
}

.editor-left {
  flex: 1;
  max-width: 50%;
}

.quick-add-panel {
  flex: 1;
  border-left: 1px solid #eee;
  padding-left: 20px;
}

.subject-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.class-controls {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

#webTitle {
  margin: 0;
}

.darkmode--activated .activity-bar,
.darkmode--activated #mobile-bottomBar {
  background-color: #0c0c0c;
  color: white;
}

.darkmode--activated #mobile-bottomBar {
  border-color: #151515;
}

.darkmode--activated button,
.darkmode--activated select,
.darkmode--activated textarea {
  color: white;
}

.darkmode--activated .activity-bar > button.selected,
.darkmode--activated fluent-listbox fluent-option.selected,
 .darkmode--activated #mobile-bottomBar > button.selected {
  background-color: #3333338f;
}

.darkmode--activated .activity-bar > button:hover,
.darkmode--activated fluent-listbox fluent-option:hover,
.darkmode--activated #mobile-bottomBar > button:hover {
  background-color: #28282863;
}

.darkmode--activated .topbarBtnGroup > button,
.pageTitle > button {
  color: black;
}

.darkmode--activated fluent-dialog {
  color: white;
}

.darkmode--activated fluent-tab-panel .settings-card {
  background-color: #000;
  border-color: #151515;
  color: white;
}

.darkmode--activated .activity-bar .selected::before,
.darkmode--activated #mobile-bottomBar .selected::before {
  background: rgb(96, 201, 252);
}

.darkmode--activated .subject-selector2 {
  background-color: #000!important;
  color: white;
  border-color: #151515!important;
}

.modal-content {
    color: black;
}

.darkmode--activated .modal-content {
    background-color: #000000;
    border: solid 0.2px rgb(115 115 115 / 10%);
    color: white;
}
