/**
 * til.re 主样式
 * 全局重置和基础布局
 */

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

/* 根元素 */
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 应用容器 */
#app {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 倒计时容器 */
#countdown-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

/* 标题 */
.title {
  font-size: 1.5rem;
  font-weight: 300;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.title:empty {
  display: none;
}

/* 计时器 */
.timer {
  display: flex;
  align-items: baseline;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.time-part {
  font-weight: 200;
}

.separator {
  font-weight: 200;
  opacity: 0.6;
}

/* 消息 */
.message {
  font-size: 1.25rem;
  font-weight: 300;
  margin-top: 1rem;
  opacity: 0.8;
}

.message:empty {
  display: none;
}

/* 状态类 */
.state-rest .timer {
  opacity: 0.7;
}

.state-finished .timer {
  opacity: 0.5;
}

.state-paused .timer {
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 响应式 */
@media (max-width: 480px) {
  .title {
    font-size: 1.25rem;
  }

  .message {
    font-size: 1rem;
  }
}
