body {
  font-family: 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 15px;
  margin: 0;
  color: #333;
  min-height: 100vh;
  box-sizing: border-box;
}
/* 轻提示 */
.toast{
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%) scale(0);
  background: rgba(0,0,0,.75);
  color: #fff;
  padding: 10px 18px;
  font-size: 16px;
  border-radius: 6px;
  z-index: 9999;
  white-space: nowrap;
  transition: transform .25s;
}
.toast.show{
  transform: translate(-50%,-50%) scale(1);
}
.container {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

h2 {
  color: #4a69bd;
  text-align: center;
  margin-bottom: 10px;
  font-size: 1.5rem;
}

p {
  text-align: center;
  margin: 8px 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.input-area {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
  justify-content: center;
  align-items: center;
}

input[type="text"] {
  /* width: 80px; */
  font-size: 18px;
  text-align: center;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 8px;
  box-sizing: border-box;
}

button {
  padding: 10px 16px;
  background: #4a69bd;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
  min-width: 80px;
}

button:hover {
  background: #1e3799;
}

#songInfo {
  text-align: center;
  margin-bottom: 15px;
  font-style: italic;
  font-size: 0.9rem;
}

/* 标题行样式 */
.title-line {
  font-size: 1.3rem !important;
  font-weight: bold !important;
  color: #4a69bd !important;
  margin-bottom: 5px !important;
  text-align: left !important;
}

/* 标题行样式 - 但仍然显示为问号 */
.title-line {
  font-size: 1.3rem !important;
  font-weight: bold !important;
  margin-bottom: 5px !important;
  text-align: left !important;
}

.give-up-btn {
  background-color: #ff6b6b;
  color: white;
}

.give-up-btn:hover {
  background-color: #ff5252;
}

/* 歌手行样式 - 但仍然显示为问号 */
.singer-line {
  font-size: 1rem !important;
  font-style: italic !important;
  margin-bottom: 15px !important;
  text-align: left !important;
}

/* 隐藏滚动条但保持滚动功能 */
.lyric-line::-webkit-scrollbar {
  display: none;
}
/* 歌词行样式 */
.lyric-line {
  margin: 10px 0;
  text-align: left;
  font-size: 1rem;
  line-height: 1.6;
  display: block;
  padding: 5px 0;
  white-space: normal;
}
/* 英文单词容器：整词不换行 */
.word {
  display: inline-flex;
  flex-wrap: nowrap;
}

/* 字符方块样式 */
.char {
  display: inline-block;
  margin: 2px;
  padding: 3px 6px;
  background: #dfe6e9;
  color: transparent;
  border-radius: 4px;
  cursor: default;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  min-width: 18px;
  text-align: center;
  height: 24px;
  line-height: 24px;
  box-sizing: border-box;
}

.char.revealed {
  background: #74b9ff;
  color: white;
  transform: scale(1.03);
}

/* 单词间的空隙样式 */
.word-space {
  display: inline-block;
  width: 12px;
  height: 24px;
}

#message {
  margin-top: 20px;
  font-weight: bold;
  text-align: center;
  min-height: 24px;
  font-size: 0.9rem;
}

.success-message {
  color: #2ecc71;
  font-size: 1.1rem;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* 错误猜测区域样式 */
#wrongGuessesArea {
  margin-top: 20px;
  text-align: center;
}

#wrongGuessesArea p {
  margin-bottom: 8px;
  font-weight: bold;
  font-size: 0.9rem;
}

#wrongGuesses {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.wrong-char {
  display: inline-block;
  padding: 4px 8px;
  background: #ff7675;
  color: white;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.9rem;
}

/* 平板设备响应式设计 */
@media (min-width: 768px) {
  body {
    padding: 30px;
  }
  
  .container {
    padding: 30px;
    max-width: 700px;
  }
  
  h2 {
    font-size: 2rem;
    margin-bottom: 15px;
  }
  
  p {
    font-size: 1rem;
    margin: 10px 0;
  }
  
  input[type="text"] {
    width: 60px;
    font-size: 20px;
    padding: 12px;
  }
  
  button {
    padding: 12px 20px;
    font-size: 16px;
    min-width: 100px;
  }
  
  #songInfo {
    font-size: 1rem;
  }
  
  .lyric-line {
    font-size: 1.1rem;
    margin: 12px 0;
  }
  
  .char {
    padding: 4px 7px;
    font-size: 0.9rem;
    margin: 2px;
    min-width: 20px;
    height: 26px;
    line-height: 26px;
  }
  
  #message {
    font-size: 1rem;
  }
  
  .success-message {
    font-size: 1.3rem;
  }
  
  #wrongGuessesArea p {
    font-size: 1rem;
  }
  
  .wrong-char {
    padding: 5px 10px;
    font-size: 1rem;
  }
}

/* 手机横屏模式 */
@media (max-height: 500px) and (orientation: landscape) {
  .container {
    padding: 15px;
  }
  
  h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }
  
  p {
    font-size: 0.8rem;
    margin: 5px 0;
  }
  
  .input-area {
    margin: 12px 0;
  }
  
  .lyric-line {
    margin: 8px 0;
    font-size: 0.9rem;
  }
  
  .char {
    padding: 3px 5px;
    font-size: 0.8rem;
    margin: 1px;
    min-width: 16px;
    height: 22px;
    line-height: 22px;
  }
}

/* 超大手机屏幕 */
@media (min-width: 400px) and (max-width: 767px) {
  .container {
    padding: 25px;
  }
  
  h2 {
    font-size: 1.8rem;
  }
  
  .char {
    min-width: 18px;
  }
}

/* 防止输入法覆盖输入框 */
@media (max-height: 600px) {
  .input-area {
    position: relative;
    z-index: 10;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  button {
    padding: 12px 16px;
    min-height: 44px;
  }
  
  input[type="text"] {
    min-height: 44px;
  }
  
  .char {
    padding: 5px 8px;
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
  }
  
  .container {
    background: #2c3e50;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }
  
  input[type="text"] {
    background: #34495e;
    border-color: #4a69bd;
    color: #ecf0f1;
  }
  
  .char {
    background: #34495e;
  }
  
  .char.revealed {
    background: #74b9ff;
  }
}

/* 特别针对长歌词的优化 */
@media (max-width: 480px) {
  .char {
    padding: 2px 4px;
    font-size: 0.8rem;
    min-width: 16px;
    height: 22px;
    line-height: 22px;
    margin: 1px;
  }
  
  .lyric-line {
    font-size: 0.9rem;
    margin: 8px 0;
  }
}

/* 确保歌词行不会换行 */
.lyrics-container {
  width: 100%;
  overflow-x: hidden;
}
