* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #e0f7fa, #b2ebf2);
  color: #333;
  transition: background 1s ease;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.main-container {
  text-align: center;
  padding: 2rem;
  border-radius: 20px;
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 100%;
  position: relative;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

h1 {
  font-weight: 300;
  font-size: 2.2rem;
  color: #00796b;
  flex: 1;
}

.settings-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #00796b;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-btn:hover {
  background-color: rgba(0, 121, 107, 0.1);
  transform: rotate(90deg);
}

.current-method {
  background-color: #e0f2f1;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #009688;
}

.method-name {
  font-weight: 600;
  color: #00796b;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.method-timing {
  font-size: 0.9rem;
  color: #546e7a;
}

.circle {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  margin: 2rem auto;
  background-color: #e0f2f1;
  transition: transform 0.5s ease, background-color 1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.circle::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  animation: breathe 4s ease-in-out infinite;
  opacity: 0.3;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.inhale {
  background-color: #b2dfdb;
}

.hold {
  background-color: #80cbc4;
}

.exhale {
  background-color: #4db6ac;
}

.timer {
  font-size: 3rem;
  font-weight: 300;
  transition: all 0.3s ease;
  z-index: 1;
}

.instruction {
  font-size: 1.8rem;
  margin: 1.5rem 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.start-btn {
  margin-top: 1.5rem;
  padding: 1rem 2.5rem;
  font-size: 1.2rem;
  background-color: #009688;
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-weight: 500;
}

.start-btn:hover {
  background-color: #00796b;
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.start-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.info {
  margin-top: 1.5rem;
  font-size: 1rem;
  color: #546e7a;
  line-height: 1.6;
}

/* 设置模态框 */
.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
}

.settings-modal.show {
  display: flex;
}

.settings-content {
  background-color: white;
  border-radius: 20px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e0f2f1;
}

.settings-title {
  font-size: 1.8rem;
  color: #00796b;
  font-weight: 500;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #546e7a;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background-color: rgba(84, 110, 122, 0.1);
  color: #00796b;
}

.presets {
  margin-bottom: 2rem;
}

.presets h3 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
  color: #00796b;
  font-weight: 500;
}

.preset-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.preset-card {
  padding: 1rem;
  border: 2px solid #e0f2f1;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: white;
}

.preset-card:hover {
  border-color: #009688;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.preset-card.active {
  border-color: #009688;
  background-color: #e0f2f1;
}

.preset-title {
  font-weight: 600;
  color: #00796b;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.preset-description {
  font-size: 0.9rem;
  color: #546e7a;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.preset-timing {
  font-size: 0.85rem;
  color: #009688;
  font-weight: 500;
}

.custom-settings {
  padding: 1.5rem;
  background-color: #f8f9fa;
  border-radius: 12px;
  border: 1px solid rgba(0, 150, 136, 0.2);
}

.custom-settings h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: #00796b;
  font-weight: 500;
}

.time-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
}

.input-group label {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: #546e7a;
  font-weight: 500;
}

.input-group input {
  padding: 0.75rem;
  border: 2px solid #e0f2f1;
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
  background-color: white;
  transition: border-color 0.3s ease;
}

.input-group input:focus {
  outline: none;
  border-color: #009688;
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.1);
}

.settings-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.apply-btn,
.start-practice-btn {
  flex: 1;
  padding: 0.75rem;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-weight: 500;
}

.apply-btn {
  background-color: #00acc1;
  color: white;
}

.apply-btn:hover {
  background-color: #0097a7;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.start-practice-btn {
  background-color: #009688;
  color: white;
}

.start-practice-btn:hover {
  background-color: #00796b;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* PWA 安装提示 */
.install-prompt {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #009688;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: none;
  align-items: center;
  gap: 1rem;
  z-index: 1000;
  max-width: 90%;
}

.install-btn {
  background-color: white;
  color: #009688;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 15px;
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
}

.install-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .main-container {
    padding: 1.5rem;
    margin: 0.5rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  .circle {
    width: 150px;
    height: 150px;
  }

  .timer {
    font-size: 2.5rem;
  }

  .instruction {
    font-size: 1.5rem;
    height: 50px;
  }

  .settings-content {
    padding: 1.5rem;
    margin: 0.5rem;
  }

  .time-inputs {
    grid-template-columns: 1fr 1fr;
  }

  .settings-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .main-container {
    padding: 1rem;
  }

  .circle {
    width: 120px;
    height: 120px;
  }

  .timer {
    font-size: 2rem;
  }

  .instruction {
    font-size: 1.3rem;
  }

  .time-inputs {
    grid-template-columns: 1fr;
  }
}

.hidden {
  display: none;
}