@import url('https://fonts.googleapis.com/css2?family=ZCOOL+XiaoWei&family=Roboto:wght@400;700&display=swap');

body, html {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'SimSun', '宋体', 'STSong', 'NSimSun', 'Microsoft YaHei', '微软雅黑', sans-serif;
  background: url('hw.jpg') no-repeat center center/cover;
  box-sizing: border-box;
}

/* 统一所有非标题字体，使用更兼容的字体栈 */
.main-container, .subtitle, .digit-glass, .digit-red, .digit-blue, .digit-sep {
  font-family: 'SimSun', '宋体', 'STSong', 'NSimSun', 'Microsoft YaHei', '微软雅黑', sans-serif !important;
}

.editable-title, .editable-title-input {
  font-family: 'KaiTi', '楷体', 'STKaiti', '楷体_GB2312', 'SimKai', cursive !important;
}

#fireworks-canvas {
  position: fixed;
  left: 0; top: 0; width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 1;
}
.background {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh;
  background: url('hw.png') no-repeat center center/cover;
  z-index: 0;
  filter: brightness(0.7) blur(2px);
}

.main-container {
  width: 100vw;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3vh 0;
  background: rgba(0,0,0,0.10);
  position: relative;
  z-index: 2;
}

.title {
  color: #fff;
  font-size: 9.2rem;
  font-family: 'ZCOOL XiaoWei', 'SimSun', '宋体', 'STSong', 'NSimSun', 'Microsoft YaHei', '微软雅黑', sans-serif;
  font-weight: bold;
  margin-bottom: 2.2rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.25);
  letter-spacing: 2px;
  text-align: center;
}

.subtitle {
  color: #eee;
  font-size: 2.8rem;
  margin-bottom: 4rem;
  text-align: center;
  line-height: 2.1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.letter-container {
  margin: 0 auto 2.5rem auto;
  max-width: 700px;
  width: 90vw;
  padding: 2.5rem 2rem;
  border-radius: 24px;
  box-shadow: 0 8px 40px 0 rgba(0,0,0,0.28);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(18px) saturate(1.7);
  color: #222;
  font-size: 1.25rem;
  line-height: 2.1;
  letter-spacing: 1.2px;
  text-align: justify;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.85);
}

.letter {
  width: 100%;
  text-indent: 2em;
  color: #222;
  text-shadow: 0 2px 8px rgba(255,255,255,0.18), 0 1px 0 #fff;
}

.countdown {
  display: flex;
  gap: 1.5vw;
  justify-content: center;
  align-items: center;
  margin-top: 3rem;
  margin-bottom: 3rem;
  min-height: 120px;
}

.digit-glass {
  min-width: 160px;
  min-height: 200px;
  font-size: 7.5rem;
  font-weight: 900;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 32px 0 rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0.1vw;
  border: none;
  transition: background 0.3s;
}

.digit-red {
  color: #e53935;
  font-weight: 900;
}

.digit-blue {
  color: #1976d2;
  font-weight: 900;
}

.digit-sep {
  font-size: 4.5rem;
  color: #bbb;
  margin: 0 0.1vw;
  align-self: center;
  opacity: 0.7;
  font-weight: bold;
  background: transparent;
  box-shadow: none;
}

#nameInput {
  border: none;
  border-bottom: 2px solid #aaa;
  background: transparent;
  outline: none;
  font-size: 1.35rem;
  width: 80px;
  text-align: center;
  color: #1a1a1a;
  margin: 0 4px;
  transition: border-color 0.2s;
}

#nameInput:focus {
  border-color: #0078ff;
}

.editable-title {
  color: #fff;
  font-size: 9.2rem;
  font-family: 'ZCOOL XiaoWei', 'SimSun', '宋体', 'STSong', 'NSimSun', 'Microsoft YaHei', '微软雅黑', sans-serif;
  font-weight: bold;
  margin-bottom: 2.2rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.25);
  letter-spacing: 2px;
  text-align: center;
  display: inline-block;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0 2px;
}
.editable-title:hover,
.editable-title:focus {
  color: #ffd700;
  border-bottom: 1.5px solid #ffd700;
  text-shadow: 2px 2px 6px rgba(255, 215, 0, 0.5);
  outline: 2px solid #ffd700;
  outline-offset: 2px;
}

.editable-title:focus {
  outline: 2px solid #ffd700;
  outline-offset: 2px;
}
.editable-title-input {
  font-size: 9.2rem;
  font-family: 'ZCOOL XiaoWei', 'SimSun', '宋体', 'STSong', 'NSimSun', 'Microsoft YaHei', '微软雅黑', sans-serif;
  font-weight: bold;
  color: #fff;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid #fff;
  outline: none;
  padding: 0 2px;
  width: 5em;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

@media (max-width: 600px) {
  .main-container {
    padding: 1vh 0;
  }
  .title {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
  }
  .subtitle {
    font-size: 1.7rem;
    line-height: 1.5;
    margin-bottom: 2rem;
  }
  .letter-container {
    padding: 1.2rem 0.7rem;
    font-size: 1rem;
    border-radius: 14px;
  }
  .digit-glass {
    min-width: 60px;
    min-height: 80px;
    font-size: 2.8rem;
  }
  .countdown {
    gap: 1vw;
    min-height: 60px;
    margin-top: 2rem;
  }
  .digit-sep {
    font-size: 1.8rem;
    margin: 0 0.05vw;
  }
  .editable-title, .editable-title-input {
    font-size: 2.8rem;
  }
}

@media (min-width: 1200px) {
  .title, .editable-title, .editable-title-input {
    font-size: 9.2rem;
  }
  .subtitle {
    font-size: 2.8rem;
  }
}
@media (max-width: 1199px) and (min-width: 768px) {
  .title, .editable-title, .editable-title-input {
    font-size: 5.4rem;
  }
  .subtitle {
    font-size: 2.4rem;
  }
}
@media (max-width: 767px) {
  .title, .editable-title, .editable-title-input {
    font-size: 2.8rem;
  }
  .subtitle {
    font-size: 1.7rem;
  }
  body {
    padding: 0 8px;
  }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
  .title, .editable-title, .editable-title-input {
    font-size: 2.4rem;
  }
  .subtitle {
    font-size: 1.5rem;
    line-height: 1.4;
  }
  .digit-glass {
    min-width: 50px;
    min-height: 70px;
    font-size: 2.2rem;
  }
  .digit-sep {
    font-size: 1.4rem;
  }
  .countdown {
    gap: 0.8vw;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .editable-title {
    border: 2px solid #fff;
  }
  .editable-title:hover,
  .editable-title:focus {
    border: 2px solid #000;
    background: #fff;
    color: #000;
  }
  .digit-glass {
    border: 2px solid #000;
  }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .editable-title {
    transition: none;
  }
  .digit-glass {
    transition: none;
  }
}

/* 打印样式 */
@media print {
  .background,
  #fireworks-canvas {
    display: none;
  }
  .main-container {
    background: white;
    color: black;
  }
  .title, .editable-title {
    color: black;
  }
  .subtitle {
    color: #333;
  }
}
