/* 基础样式设置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Courier New", Courier, monospace;
}

/* 响应式媒体查询变量 */
:root {
  --padding-mobile: 15px;
  --padding-tablet: 30px;
  --padding-desktop: 40px;

  --header-size-mobile: 1.8rem;
  --header-size-tablet: 2.2rem;
  --header-size-desktop: 2.5rem;

  --text-size-mobile: 1rem;
  --text-size-tablet: 1.1rem;
  --text-size-desktop: 1.2rem;

  --button-size-mobile: 120px;
  --button-size-tablet: 140px;
  --button-size-desktop: 150px;
}

body {
  background-color: #0d1117;
  color: #58a6ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: var(--padding-mobile);
  position: relative;
}

/* 语言切换按钮 */
.language-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 5px 10px;
  color: #58a6ff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  z-index: 10;
}

.language-toggle:hover {
  background-color: #1f2937;
  transform: scale(1.05);
}

.language-toggle span {
  margin-left: 5px;
}

/* 语言隐藏类 */
.lang-zh,
.lang-en {
  display: block;
}

html[lang="zh-CN"] .lang-en {
  display: none;
}

html[lang="en"] .lang-zh {
  display: none;
}

/* 主标题样式 */
h1 {
  font-size: var(--header-size-mobile);
  margin-bottom: 15px;
  font-weight: bold;
  color: #7ee787;
  text-shadow: 0 0 5px rgba(126, 231, 135, 0.5);
}

/* 副标题样式 */
p {
  font-size: var(--text-size-mobile);
  margin-bottom: 10px;
  line-height: 1.5;
  color: #c9d1d9;
}

/* 代码行装饰 */
.code-line {
  position: relative;
  padding-left: 30px;
  text-align: left;
  width: 100%;
  max-width: 600px;
  margin: 5px 0;
}

.code-line::before {
  content: attr(data-line);
  position: absolute;
  left: 0;
  color: #484f58;
  font-size: 0.9rem;
}

/* 选择框容器 */
.checkbox-container {
  margin: 40px 0;
  width: 80%;
  max-width: 600px;
  text-align: left;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 15px;
  background-color: #161b22;
}

/* 选择框样式 */
.checkbox-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
  border-bottom: 1px dashed #30363d;
  padding-bottom: 10px;
}

.checkbox-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.checkbox-item input {
  margin-right: 10px;
  width: 20px;
  height: 20px;
  margin-top: 3px;
  accent-color: #ff7b72;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-item label {
  font-size: 1.2rem;
  line-height: 1.5;
  color: #c9d1d9;
  display: flex;
  align-items: center;
}

/* 按钮样式 */
button {
  background-color: #238636;
  color: #ffffff;
  border: none;
  padding: 15px 40px;
  font-size: 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.2s, background-color 0.2s;
  font-family: "Courier New", Courier, monospace;
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(35, 134, 54, 0.5);
}

button:hover {
  background-color: #2ea043;
  transform: scale(1.05);
}

button:active {
  transform: scale(0.98);
}

/* 投降按钮样式 */
.surrender-button {
  width: var(--button-size-mobile);
  height: var(--button-size-mobile);
  background-color: #f85149;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 30px auto;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(248, 81, 73, 0.5);
  transition: transform 0.3s, background-color 0.3s;
  position: relative;
  overflow: hidden;
}

.surrender-button::before {
  content: "RUN";
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
}

.surrender-button::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.1) 10px,
    transparent 10px,
    transparent 20px
  );
  animation: scan 2s linear infinite;
}

@keyframes scan {
  0% {
    top: 0;
  }
  100% {
    top: 100%;
  }
}

.surrender-button:hover {
  transform: scale(1.05);
  background-color: #ff6a64;
}

.surrender-button:active {
  transform: scale(0.95);
}

/* 点击提示 */
.click-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  font-size: 1rem;
  color: #8b949e;
  border: 1px dashed #30363d;
  padding: 10px;
  border-radius: 6px;
  background-color: #161b22;
}

.pointer-icon {
  font-size: 1.2rem;
  margin-left: 5px;
  animation: point 1s infinite alternate;
}

@keyframes point {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(5px);
  }
}

/* 结果页面样式 */
.success-page {
  display: none;
}

.success-title {
  font-size: 2.5rem;
  margin-bottom: 30px;
  color: #7ee787;
}

.success-message {
  margin-bottom: 50px;
  color: #c9d1d9;
}

.surrender-code {
  background-color: #161b22;
  width: 250px;
  height: 250px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid #30363d;
  border-radius: 6px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.qr-code {
  width: 180px;
  height: 180px;
  background-color: #0d1117;
  position: relative;
  margin-bottom: 15px;
  border: 1px solid #30363d;
}

.qr-bit {
  background-color: #58a6ff;
  position: absolute;
  border-radius: 1px;
  box-shadow: 0 0 3px rgba(88, 166, 255, 0.5);
}

.surrender-id {
  color: #58a6ff;
  font-size: 0.9rem;
  margin-top: 10px;
  font-weight: bold;
  letter-spacing: 1px;
  font-family: "Courier New", Courier, monospace;
  border-top: 1px dashed #30363d;
  padding-top: 10px;
  width: 100%;
  text-align: center;
}

/* 闪烁的QR码效果 */
@keyframes blink-bit {
  0%,
  97% {
    opacity: 1;
  }
  98%,
  100% {
    opacity: 0.5;
  }
}

/* 说明弹窗 */
.info-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #161b22;
  color: #c9d1d9;
  padding: 20px;
  border-radius: 6px;
  width: 80%;
  max-width: 500px;
  z-index: 100;
  display: none;
  border: 1px solid #30363d;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.info-title {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #ff7b72;
  border-bottom: 1px solid #30363d;
  padding-bottom: 10px;
}

.info-text {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 20px;
  color: #c9d1d9;
  background-color: #0d1117;
  padding: 15px;
  border-radius: 6px;
  border: 1px dashed #30363d;
}

.info-button {
  background-color: #238636;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  float: right;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 99;
  display: none;
}

/* 页面切换过渡效果 */
.page {
  transition: opacity 0.5s ease-in-out;
  width: 100%;
  max-width: 800px;
}

.hidden {
  display: none;
  opacity: 0;
}

.visible {
  display: block;
  opacity: 1;
}

/* 代码风格的装饰 */
.terminal-header {
  background-color: #161b22;
  width: 100%;
  max-width: 800px;
  padding: 10px 20px;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
  border: 1px solid #30363d;
  border-bottom: none;
}

.terminal-title {
  color: #8b949e;
  font-size: 0.9rem;
}

.terminal-controls {
  display: flex;
}

.control-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-left: 8px;
}

.dot-red {
  background-color: #f85149;
}

.dot-yellow {
  background-color: #e3b341;
}

.dot-green {
  background-color: #7ee787;
}

.code-container {
  background-color: #161b22;
  width: 100%;
  max-width: 800px;
  border: 1px solid #30363d;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  padding: 20px;
  margin-bottom: 30px;
}

/* 闪烁的光标 */
.cursor {
  display: inline-block;
  width: 10px;
  height: 18px;
  background-color: #58a6ff;
  margin-left: 5px;
  animation: blink 1s infinite;
}

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

/* 点击按钮时飘出的数字 */
.count-indicator {
  position: absolute;
  font-size: 1.5rem;
  font-weight: bold;
  color: #7ee787;
  text-shadow: 0 0 5px rgba(126, 231, 135, 0.8);
  pointer-events: none;
  user-select: none;
  z-index: 10;
  opacity: 0;
}

/* 数字飘出动画 */
@keyframes floatUp {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px);
    opacity: 0;
  }
}

/* 数字飘出时的颜色变化 */
.count-1 {
  color: #7ee787; /* 绿色 */
}

.count-2 {
  color: #e3b341; /* 黄色 */
}

.count-3 {
  color: #ff7b72; /* 红色 */
  font-size: 2rem;
  text-shadow: 0 0 10px rgba(255, 123, 114, 0.8);
}

/* 页脚样式 */
.footer {
  width: 100%;
  padding: 15px 0;
  text-align: center;
  border-top: 1px solid #30363d;
  margin-top: 20px;
  font-size: 0.9rem;
  color: #8b949e;
}

.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}

.social-link {
  color: #58a6ff;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: all 0.3s;
  padding: 5px 10px;
  border-radius: 4px;
  background-color: #161b22;
  border: 1px solid #30363d;
}

.social-link:hover {
  background-color: #1f2937;
  transform: scale(1.05);
  color: #7ee787;
}

.social-icon {
  width: 16px;
  height: 16px;
  margin-right: 5px;
  fill: currentColor;
}

/* 响应式媒体查询 - 小屏幕设备 */
@media screen and (max-width: 480px) {
  .checkbox-container {
    width: 100%;
    padding: 10px;
  }

  .checkbox-item label {
    font-size: var(--text-size-mobile);
    line-height: 1.4;
  }

  .code-container {
    padding: 15px;
  }

  .info-modal {
    width: 95%;
    padding: 15px;
  }

  .success-title {
    font-size: var(--header-size-mobile);
  }

  .surrender-code {
    width: 220px;
    height: 220px;
  }

  .qr-code {
    width: 160px;
    height: 160px;
  }

  button {
    padding: 12px 30px;
    font-size: 1.2rem;
  }

  .language-toggle {
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    font-size: 0.8rem;
  }
}

/* 响应式媒体查询 - 中等屏幕设备 */
@media screen and (min-width: 481px) and (max-width: 768px) {
  body {
    padding: var(--padding-tablet);
  }

  h1 {
    font-size: var(--header-size-tablet);
  }

  p {
    font-size: var(--text-size-tablet);
  }

  .surrender-button {
    width: var(--button-size-tablet);
    height: var(--button-size-tablet);
  }

  .surrender-button::before {
    font-size: 1.8rem;
  }

  .checkbox-item label {
    font-size: var(--text-size-tablet);
  }
}

/* 响应式媒体查询 - 大屏幕设备 */
@media screen and (min-width: 769px) {
  body {
    padding: var(--padding-desktop);
  }

  h1 {
    font-size: var(--header-size-desktop);
    margin-bottom: 20px;
  }

  p {
    font-size: var(--text-size-desktop);
  }

  .surrender-button {
    width: var(--button-size-desktop);
    height: var(--button-size-desktop);
  }

  .surrender-button::before {
    font-size: 2rem;
  }
}

/* 触摸设备优化 */
@media (hover: none) {
  .surrender-button:hover {
    transform: none;
    background-color: #f85149;
  }

  button:hover {
    transform: none;
    background-color: #238636;
  }

  .social-link:hover {
    transform: none;
    background-color: #161b22;
    color: #58a6ff;
  }
}

/* 新增每日投降相关样式 */
.daily-surrender {
  margin-top: 30px;
  background-color: #161b22;
  border: 1px dashed #30363d;
  border-radius: 6px;
  padding: 15px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.daily-surrender-title {
  color: #7ee787;
  font-size: 1.2rem;
  margin-bottom: 10px;
  font-weight: bold;
}

.daily-surrender-text {
  color: #c9d1d9;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 15px;
}

.daily-surrender-streak {
  display: flex;
  justify-content: center;
  margin: 15px 0;
}

.streak-day {
  width: 20px;
  height: 20px;
  margin: 0 3px;
  border-radius: 50%;
  background-color: #161b22;
  border: 1px solid #30363d;
  position: relative;
}

.streak-day.active {
  background-color: #58a6ff;
  border-color: #1f6feb;
  box-shadow: 0 0 5px rgba(88, 166, 255, 0.7);
}

.streak-day.today {
  background-color: #7ee787;
  border-color: #2ea043;
  box-shadow: 0 0 5px rgba(126, 231, 135, 0.7);
}

.streak-label {
  color: #8b949e;
  font-size: 0.75rem;
  margin-top: 5px;
  text-align: center;
}

.next-surrender-button {
  background-color: #238636;
  color: white;
  border: none;
  padding: 8px 15px;
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s;
}

.next-surrender-button:hover {
  background-color: #2ea043;
  transform: scale(1.05);
}

.streak-info {
  color: #ff7b72;
  font-size: 0.8rem;
  margin-top: 10px;
  font-style: italic;
}

@media screen and (max-width: 480px) {
  .daily-surrender {
    padding: 10px;
  }

  .daily-surrender-title {
    font-size: 1rem;
  }

  .daily-surrender-text {
    font-size: 0.85rem;
  }
}
