:root {
  --burn-duration: 3s;
  --smoke-duration: 5s;
}

* {
  margin: 0;
  padding: 0;

}

body {
  background: linear-gradient(135deg, #e6f0ff, #f1f2f3);
}

.container {
  box-sizing: border-box;
  width: 100%;
  max-width: 1560px;
  min-width: 1240px;
  margin: 20px auto;
  color: #333;
}

.container * {
  box-sizing: border-box;
}

header {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 25px;
}


header h1 {
  font-size: 30px;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  margin-bottom: 5px;
}


.date-display {
  font-size: 16px;
  opacity: 0.8;
}

.main-content {
  display: flex;
  min-height: 700px;
  border-radius: 20px;
  overflow: hidden;
}

/* 抽烟模拟器区域 */
.smoking-simulator {
  flex: 2.5;
  padding: 20px;
  background: linear-gradient(to bottom, #344757, #36414d);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.cigarette-container {
  position: relative;
  width: 500px;
  height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  top: 50px;
}

.cigarette {
  position: relative;
  width: 30px;
  height: 280px;
  background: linear-gradient(to right, #f5f5f5, #e0e0e0, #f5f5f5);
  border-radius: 15px;
  z-index: 10;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.filter {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 40px;
  background: linear-gradient(to right, #d7ccc8, #bcaaa4);
  border-radius: 0 0 15px 15px;
}

.glowing-tip {
  position: absolute;
  top: -10px;
  width: 30px;
  height: 30px;
  background: #ff6b00;
  border-radius: 50%;
  box-shadow: 0 0 20px #ff4500;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 5;
}

.smoke-particle {
  position: absolute;
  top: -120px;
  /* 调整初始位置 */
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0;
  z-index: 1;
  animation: smoke-particle-animation 3s ease-out forwards;
  transform-origin: center bottom;
}

.main-smoke {
  position: absolute;
  top: -120px;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  filter: blur(15px);
  opacity: 0;
  z-index: 2;
  animation: main-smoke-animation 4s ease-out forwards;
  transform-origin: center bottom;
}

/* 烟雾粒子动画 */
@keyframes smoke-particle-animation {
  0% {
    transform: translate(0, 0) scale(0.8);
    opacity: var(--opacity-start, 0.6);
  }

  50% {
    opacity: calc(var(--opacity-start, 0.6) * 0.5);
  }

  100% {
    transform: translate(var(--tx), var(--ty)) scale(1.8);
    opacity: 0;
  }
}

/* 主烟雾动画 */
@keyframes main-smoke-animation {
  0% {
    transform: translate(-50%, 0) scale(0.5);
    opacity: 0;
    width: 20px;
    height: 20px;
  }

  20% {
    opacity: 0.9;
    width: 50px;
    height: 70px;
  }

  50% {
    opacity: 0.6;
    width: 90px;
    height: 130px;
  }

  100% {
    transform: translate(-50%, -180px) scale(1.2);
    opacity: 0;
    width: 120px;
    height: 180px;
  }
}


.smoke {
  position: absolute;
  top: -30px;
  width: 20px;
  height: 100px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50% 50% 0 0;
  filter: blur(12px);
  opacity: 0;
  z-index: 2;
}

.controls {
  margin-top: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 25px;
}

.btn {
  padding: 15px 35px;
  font-size: 18px;
  font-weight: 500;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: linear-gradient(135deg, #ff7043, #f4511e);
  color: white;
  min-width: 180px;
}

.btn-secondary {
  background: linear-gradient(135deg, #5c6bc0, #3949ab);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #e53935, #c62828);
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, #66bb6a, #43a047);
  color: white;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(1px);
}

.btn span {
  font-size: 24px;
}

.time-control {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.7);
  padding: 12px 25px;
  border-radius: 50px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  width: 80%;
  max-width: 500px;
  justify-content: center;
}

.time-control label {
  font-size: 16px;
  font-weight: 500;
  color: #444;
}

.time-control input {
  width: 300px;
}

.time-display {
  font-weight: 700;
  color: #f4511e;
  min-width: 40px;
  text-align: center;
}

.stats-panel {
  flex: 2;
  padding: 20px;
  background: white;
  border-left: 1px solid #eee;
  display: flex;
  flex-direction: column;
}

.counter {
  background: #f8f9fa;
  border-radius: 15px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.counter-value {
  font-size: 72px;
  font-weight: 700;
  color: #f4511e;
  margin: 8px 0;
  text-shadow: 0 3px 6px rgba(244, 81, 30, 0.2);
}

.counter-label {
  font-size: 18px;
  color: #666;
}

#target-input {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
  font-size: 16px;
  margin: 0 5px;
}

#target-input:focus {
  outline: none;
  border-color: #5c6bc0;
}

.progress-container {
  width: 100%;
  height: 12px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(to right, #66bb6a, #43a047);
  border-radius: 10px;
  transition: width 0.5s ease;
}

.record-btn {
  width: 100%;
  padding: 15px 10px;
  background: linear-gradient(135deg, #5c6bc0, #3949ab);
  color: white;
  font-size: 16px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  margin-bottom: 20px;
}

.clear-btn {
  background: linear-gradient(135deg, #e53935, #c62828);
}

.record-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(67, 160, 71, 0.3);
}

.chart-container {
  background: #f8f9fa;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  flex: 1;
  margin-bottom: 40px;
}

.chart-title {
  font-size: 16px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart {
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 0 10px;
}

.bar {
  width: 40px;
  background: linear-gradient(to top, #5c6bc0, #3949ab);
  border-radius: 5px 5px 0 0;
  position: relative;
  transition: height 0.5s ease;
}

.today-bar {
  background: linear-gradient(to top, #1e9ef4, #7515d8);
}

.bar-label {
  position: absolute;
  width: 100%;
  left: 50%;
  bottom: -25px;
  text-align: center;
  transform: translateX(-50%);
  font-size: 14px;
  color: #666;
}

.bar-value {
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 500;
  color: #3949ab;
}

.today-bar .bar-value {
  color: #f4511e;
  font-weight: 700;
}

.tips {
  background: #fff8e1;
  border-radius: 15px;
  padding: 15px;
  border-left: 4px solid #ffca28;
}

.tips h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  margin-bottom: 5px;
  color: #5d4037;
}

.tips ul {
  padding-left: 15px;
}

.tips li {
  margin-bottom: 5px;
  line-height: 1.5;
  font-size: 14px;
  color: #666;
}

.burn-animation {
  animation: burn var(--burn-duration) linear forwards;
}

@keyframes burn {
  0% {
    height: 280px;
    transform: translateY(0);
  }

  100% {
    height: 40px;
    transform: translateY(90px);
  }
}

.smoke-animation {
  animation: smoke var(--smoke-duration) cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes smoke {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0;
    width: 20px;
    height: 20px;
  }

  20% {
    opacity: 0.8;
    width: 40px;
    height: 60px;
  }

  50% {
    opacity: 0.5;
    width: 80px;
    height: 120px;
  }

  100% {
    transform: translateY(-180px) scale(1.5);
    opacity: 0;
    width: 120px;
    height: 180px;
  }
}

.particle-animation {
  animation: particle 3s ease-out forwards;
}

@keyframes particle {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(var(--tx), var(--ty)) scale(2.5);
    opacity: 0;
  }
}

footer {
  text-align: center;
  padding: 25px;
  color: #666;
  font-size: 15px;
}

.motivation {
  font-style: italic;
  margin-top: 10px;
  color: #f4511e;
  font-weight: 500;
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 15px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal h2 {
  margin-bottom: 20px;
  color: #c62828;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.modal p {
  margin-bottom: 25px;
  font-size: 18px;
  line-height: 1.6;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.modal-btn {
  padding: 12px 30px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.confirm-btn {
  background: linear-gradient(135deg, #e53935, #c62828);
  color: white;
}

.cancel-btn {
  background: linear-gradient(135deg, #78909c, #546e7a);
  color: white;
}

.modal-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

@keyframes glow {
  0% {
    text-shadow: 0 0 5px rgba(255, 107, 0, 0.7);
  }

  100% {
    text-shadow: 0 0 20px rgba(255, 107, 0, 0.9), 0 0 30px rgba(255, 69, 0, 0.6);
  }
}

.progress-text {
  font-size: 16px;
  font-weight: 500;
  color: #43a047;
  margin-top: 5px;
  text-align: center;
}
