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

:root {
  --bg-color: #f9f9f9;
  --text-color-primary: #474747;
  --text-color-secondary: #7b7b7b;
  --text-color-header: #3f3f3f;
  --container-bg: rgba(255, 255, 255, 0.2);
  --container-shadow: 2px 4px 3px 2px rgba(0, 0, 0, 0.06);
  --tab-bg: #f0f0f0;
  --tab-border: #d8d8d8;
  --tab-text: #888;
  --tab-text-hover: #000;
  --tab-hover-bg: #e5e5e5;
  --tab-active-bg: rgba(255, 255, 255, 0.75);
  --theme-color-primary: #777;
  --theme-color-secondary: #888;
  --table-border: #e0e0e0;
  --table-header-bg: #f7f7f7;
  --info-box-border: rgba(137, 137, 137, 0.3);
  --info-box-bg: rgba(138, 138, 138, 0.05);
  --info-box-text: #4f4f4f;
  --link-color: #4e4e4e;
  --strong-color: rgb(76, 76, 76);
  --del-color: gray;
}

html.dark {
  --bg-color: #121212;
  --text-color-primary: #bbb;
  --text-color-secondary: #888;
  --text-color-header: #ccc;
  --container-bg: rgba(30, 30, 30, 0.5);
  --container-shadow: 0px 2px 5px 1px rgba(0, 0, 0, 0.5);
  --tab-bg: #2a2a2a;
  --tab-border: #444;
  --tab-text: #aaa;
  --tab-text-hover: #fff;
  --tab-hover-bg: #3a3a3a;
  --tab-active-bg: rgba(30, 30, 30, 0.75);
  --theme-color-primary: #d1d1d1;
  --theme-color-secondary: #c8c8c8;
  --table-border: #444;
  --table-header-bg: #2c2c2c;
  --info-box-border: rgba(213, 213, 213, 0.3);
  --info-box-bg: rgba(213, 213, 213, 0.08);
  --info-box-text: #ccc;
  --link-color: #c8c8c8;
  --strong-color: #ddd;
  --del-color: #888;
}

body {
  max-width: 800px;
  margin: 0px auto 10px;
  padding: 0 10px;
  font-family: "Maple Mono", "PingFang SC", "Microsoft YaHei", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv01", "cv02", "cv05", "cv35", "cv40", "cv42", "cv43",
    "cv61", "cv62", "cv63", "ss01", "ss03", "ss04", "ss05", "ss06";
  line-height: 1.35;
  color: var(--text-color-primary);
  background-color: transparent;
  transition: color 0.3s;
}

/* 日期切换器样式 */
.date-switcher {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 6px 0;
  user-select: none;
}

.date-display {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-color-header);
  padding: 0 15px;
  min-width: 120px;
  text-align: center;
}

.date-switcher-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.date-switcher-btn:hover {
  background-color: var(--tab-hover-bg);
}

.date-switcher-btn svg {
  width: 24px;
  height: 24px;
  color: var(--theme-color-primary);
}

.date-switcher-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.3;
}

/* 每日数据容器的显示/隐藏 */
.day-content {
  display: none;
}

.day-content.active {
  display: block;
  animation: fadeIn 0.3s;
}

.tab-container {
  width: 100%;
  margin-top: 10px;
  margin-bottom: 16px;
  background-color: var(--container-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid var(--info-box-border);
  box-shadow: var(--container-shadow);
  overflow: hidden;
  text-align: center;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.tab-buttons {
  display: flex;
  background-color: var(--tab-bg);
  border-bottom: 1px solid var(--tab-border);
}

.tab-button {
  padding: 6px 10px;
  cursor: pointer;
  border: none;
  background-color: transparent;
  color: var(--tab-text);
  font-family: "Maple Mono", "PingFang SC", "Microsoft YaHei", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv01", "cv02", "cv05", "cv35", "cv40", "cv42", "cv43",
    "cv61", "cv62", "cv63", "ss01", "ss03", "ss04", "ss05", "ss06";
  font-size: 17px;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease;
  outline: none;
  flex-grow: 1;
  text-align: center;
  border-right: 1px solid var(--tab-border);
}

.tab-button:last-child {
  border-right: none;
}

.tab-button:hover {
  background-color: var(--tab-hover-bg);
  color: var(--tab-text-hover);
}

.tab-button.active {
  background-color: var(--tab-active-bg);
  color: var(--theme-color-primary);
  border-bottom: 2px solid var(--theme-color-primary);
  font-size: 17px;
}

.tab-content {
  display: none;
  padding: 0 10px 10px 10px;
  border-top: none;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 12px;
}

th,
td {
  border: 1px solid var(--table-border);
  padding: 4px;
  text-align: center;
  vertical-align: middle;
}

th {
  background-color: var(--table-header-bg);
  font-weight: bold;
  font-size: 12px;
  text-align: center;
}

td {
  font-size: 14px;
  text-align: center;
}

/* 工学馆楼层列样式 */
.gxg-table td:first-child {
  font-weight: bold;
  width: 30px;
  font-size: 14px;
  text-align: center;
}

/* 本部其它和南校区表格的教学楼名称行样式 */
.campus-table .building-name-row td {
  font-weight: bold;
  text-align: center;
  background-color: var(--table-header-bg);
  font-size: 13px;
}

/* 本部其它和南校区表格的教室号行样式 */
.campus-table .classroom-row td {
  text-align: center;
  min-height: 50px;
  word-break: break-word;
  white-space: pre-wrap;
}

/* 页面标题和信息文本样式 */
h1 {
  text-align: center;
  margin-bottom: 1px;
  font-size: 22px;
  color: var(--text-color-header);
}

.info-text {
  font-family: "Maple Mono", "LXGW Wenkai";
  text-align: center;
  margin-top: 4px;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--text-color-secondary);
}

.info-text.update-time {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0;
}

.info-text a {
  color: var(--link-color);
  text-decoration: none;
}

.info-text a:hover {
  text-decoration: underline;
}

/* 时间段标题样式 */
.timeslot-title {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  text-align: center;
  margin-top: 10px;
  margin-bottom: 4px;
  color: var(--theme-color-primary);
  cursor: pointer;
  user-select: none;
}

/* 临时信息通知框样式 */
.emergency-info {
  padding: 3px 8px 4px 6px;
  margin: 8px auto;
  border: 1px solid var(--info-box-border);
  border-radius: 10px;
  background-color: var(--info-box-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--info-box-text);
  font-size: 13px;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

.emergency-info p {
  margin: 0;
  font-family: "New Computer Modern", "Source Han Serif", serif;
  font-feature-settings: normal;
  text-align: justify;
  max-width: 100%;
}

/* 应用于格言的斜体专用字体 已弃用
        i {
            font-family: "New Computer Modern", "LXGW Wenkai", serif;
            font-style: italic;
        }
        */

/* 当父元素语言为中文时 i 显示为正体 已弃用
        p:lang(zh) i {
            font-style: normal;
        }
        */

/* 为下划线、加粗和删除线添加样式 */
u {
  text-decoration: underline;
  text-decoration-color: var(--link-color);
  text-decoration-thickness: 1.25px;
}

strong, b {
  font-weight: bold;
  color: var(--strong-color);
}

del {
  text-decoration: line-through;
  text-decoration-color: var(--del-color);
  text-decoration-thickness: 0.75px;
}

center {
  text-align: center;
  font-family: inherit;
  font-feature-settings: inherit;
}

/* 状态徽章样式 */
.status-badge {
  margin-left: 8px;
  padding: 1.2px 6px 1px;
  font-size: 10px;
  font-weight: bold;
  border-radius: 18px;
  text-transform: uppercase;
  opacity: 0.67;
}

.badge-updated {
  background-color: var(--text-color-secondary);
  color: var(--bg-color);
}

.badge-not-updated {
  background-color: var(--text-color-secondary);
  color: var(--bg-color);
}

.badge-not-found {
  background-color: var(--text-color-secondary);
  color: var(--bg-color);
}

/* 折叠按钮图标样式 */
.toggle-icon {
  margin-right: 4px;
  transition: transform 0.4s ease-in-out;
}

.toggle-icon.collapsed {
  transform: rotate(-90deg);
}

hr {
  border: none;
  border-top: 1px solid var(--tab-border);
  margin: 12px 0;
}

/* 折叠容器样式 */
.collapsible-container {
  margin: 10px 0 10px;
  border: 1px solid var(--tab-border);
  border-radius: 12px;
  background-color: var(--container-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--container-shadow);
  overflow: hidden;
  transition: background-color 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.collapsible-toggle {
  width: 100%;
  padding: 6px 6px 6px 10px;
  background-color: var(--container-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-color-primary);
  font-family: inherit;
}

.collapsible-toggle:hover {
  color: var(--text-color-primary);
}

.collapsible-toggle .toggle-icon {
  transition: transform 0.3s ease-in-out;
}

.collapsible-container.expanded .toggle-icon {
  transform: rotate(90deg);
}

.collapsible-content {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
}

.collapsible-container.expanded .collapsible-content {
  max-height: max-content;
}

.collapsible-inner {
  padding: 4px 10px 4px 10px;
  border-top: 1px solid var(--tab-border);
  margin: 0;
}

.collapsible-inner p {
  margin: 6px 0;
  font-size: 14px;
  text-align: center;
  color: var(--text-color-secondary);
}

.collapsible-inner a {
  color: var(--link-color);
}
