/*
 * default
 */
* {
  margin: 0;
  padding: 0;
}

/* 网页字体及背景 */
html {
  background: #333 fixed center url("https://ooo.0x0.ooo/2025/04/03/O01fAt.jpg");
  background-size: cover;
  color: #fff;
  font-size: 48px;
  font-size: 2.7vw;
  font-family: Ubuntu, 'Genshin65W', sans-serif;
}

body {
  background: transparent fixed center;
  background-size: cover;
}

/* 分散对齐 */
.space-between {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

#msg {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: baseline;
}

.space {
  margin: 0 -.2em;
}

.space>* {
  margin: 0 .2em;
}

/* 一级淡文本（保留字体颜色） */
.dim {
  opacity: .75;
  font-size: .75em;
}

/* 二级淡文本 */
.sub {
  color: rgb(255 255 255 / 75%);
  font-size: .6em;
}

/* 页脚文本 */
footer {
  color: rgb(255 255 255 / 50%);
  font-size: .3rem;
}

/* 选中 */
::selection {
  background: rgb(255 255 255 / 10%);
  text-shadow: #7af -.05em -.01em .1em, #a7f .05em .01em .1em;
}

/*
 * elements
 */

/* 主体排版 */
#main {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgb(0 0 0 / 50%);
  min-height: 100vh;
}

/* 主体元素间距 */
#main>* {
  margin: .5rem 1rem;
}

/* 通知气泡 */
.notify {
  top: 0;
  z-index: 1;
}

/* 通知气泡元素 */
.notify>div {
  display: none;
  animation: fade .5s;
  margin: .2rem auto;
  border-radius: .2rem;
  padding: .2rem;
  font-size: .5rem;
}

.hilit {
  animation: hilit 60s infinite alternate;
}

@keyframes hilit {
  50% {
    color: #fff;
    text-shadow: 0 0 .1em #fff;
  }

  100% {
    color: auto;
  }
}

/* 等宽图标 */
.fa-solid,
.fa-regular,
.fa-brands,
.fa-width {
  min-width: 1.2em;
  text-align: center;
}

/* 带注释的图标 */
[data-sub] {
  display: inline-block;
  vertical-align: middle;
  padding: .1em;
  text-align: center;
}

[data-sub]::after {
  display: block;
  margin-top: .2em;
  content: attr(data-sub);
  font: normal normal .5em Ubuntu, 'Genshin65W', sans-serif;
}

/* 进度条 */
.bar {
  margin: .5rem auto;
  height: .2rem;
}

#bar {
  transition: linear 2s;
  background: linear-gradient(to right, transparent, #fff);
  height: 100%;
}

/* 卡片排版 */
.card {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: .5rem -1rem;
  max-width: 100vw;
}

/* 淡色背景阴影 */
.notify>div,
.bar,
.card>* {
  transition: .2s;
  box-shadow: .2em .2em 1em rgb(0 0 0 / 20%);
  background: rgb(255 255 255 / 10%);
  text-shadow: .1em .1em .2em rgb(0 0 0 / 20%);
}

/* 卡片元素字体间距等 */
.card>* {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  margin: .2rem;
  border-radius: .5rem;
  padding: .2rem .75rem;
  text-align: center;
}

/* 语音提醒卡片 */
.voice-reminder-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.voice-reminder-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 1.1em;
  color: #000;
}

.voice-reminder-header i {
  font-size: 1.2em;
  color: #ff9a3c;
}

.voice-reminder-switch {
  margin: 12px 0;
}

.voice-reminder-switch label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.voice-reminder-switch input {
  display: none;
}

.voice-reminder-switch .slider {
  position: relative;
  width: 50px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  transition: 0.4s;
}

.voice-reminder-switch .slider:before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: 0.4s;
}

.voice-reminder-switch input:checked + .slider {
  background: #ff9a3c;
}

.voice-reminder-switch input:checked + .slider:before {
  transform: translateX(26px);
}

.voice-reminder-label {
  font-size: 0.9em;
  color: #000;
}

.voice-reminder-buttons {
  display: flex;
  gap: 10px;
  margin: 16px 0;
}

.voice-reminder-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #000;
  font-size: 0.9em;
  cursor: pointer;
  transition: 0.2s;
}

.voice-reminder-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.voice-reminder-btn i {
  font-size: 1.1em;
}

.voice-reminder-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.8em;
  color: rgba(0, 0, 0, 0.7);
}

.voice-reminder-footer i {
  color: rgba(255, 255, 255, 0.5);
}

:hover .notify>div,
:hover .bar,
:hover .card>* {
  backdrop-filter: blur(.1rem);
}

.notify>div:hover,
.bar:hover,
.card>*:hover {
  backdrop-filter: blur(0);
  background: rgb(255 255 255 / 20%);
}

/* 时钟字体 */
#clock {
  font-size: 5em;
}

#subject,
#timer {
  width: 100%;
  font-size: 3em;
}

#duration,
#activity {
  color: rgb(255 255 255 / 75%);
  font-size: 1.5em;
}

/* 适配竖屏 */
@media (aspect-ratio <=8/7) {
  html {
    align-items: flex-start;
    font-size: 5vw;
  }

  nav.space-between,
  .card {
    flex-direction: column;
    margin: auto;
  }
}

/*
 * functional
 */

/* 下拉元素定位 */
[data-title],
.dropdown {
  display: inline-block;
  position: relative;
}

/* 下拉正文定位（未下拉） */
[data-title]::after,
.dropdown> :last-child {
  display: none;
  position: absolute;
  z-index: 1;
  cursor: auto;
}

[data-title]::after {
  right: 0;
  bottom: 1em;
  padding: .1em;
  width: 12em;
  content: attr(data-title);
}

/* 下拉正文定位（已下拉） */
[data-title]:hover::after,
.dropdown:hover> :last-child {
  display: block;
  animation: fade .2s;
}

@keyframes fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* 菜单展开定位 */
#menu .dropdown> :last-child {
  bottom: 0;
  left: 5em;
  min-width: 12em;
  max-height: 20em;
}

/* 下拉/点击文本 */
.dropdown>a {
  display: inline-block;
}

a {
  cursor: pointer;
  border-radius: .2rem;
  color: inherit;
  text-decoration: none;
}

a:hover {
  box-shadow: .2em .2em .5em rgb(0 0 0 / 20%);
  background: linear-gradient(120deg, #7af, #a7f);
  color: #fff !important;
}

/* 高亮/菜单/下拉正文颜色 */
.btn,
#menu,
[data-title]::after,
.dropdown> :last-child {
  backdrop-filter: blur(.5em);
  box-shadow: .2rem .2rem 1rem rgb(0 0 0 / 20%);
  border-radius: .2rem;
  background: rgb(255 255 255 / 75%);
  color: #000;
}

/* 高亮按钮/菜单元素/下拉正文元素边距 */
a.btn,
#menu>*,
.dropdown> :last-child>* {
  display: block;
  box-sizing: border-box;
  padding: .2em;
}

/* 标签 */
.shield,
.shieldlist>* {
  display: inline-block;
  vertical-align: middle;
  margin: .1em;
  outline: .1em solid rgb(255 255 255 / 20%);
  border-radius: 1em;
  background: rgb(0 0 0 / 50%);
  padding: .1em .2em;
  color: #fff;
  font-size: .6em;
}
