* {
  margin: 0;
  padding: 0;
}

body {
  background-color: #f1f2f3;

}

.container {
  box-sizing: border-box;
  max-width: 1540px;
  min-width: 1240px;
  width: 100%;
  margin: 20px auto;
  color: #333;
}

.container *{
  box-sizing: border-box;
}

header {
  text-align: center;
  position: relative;
  margin-bottom: 25px;
}

header h1 {
  font-size: 2.4rem;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

header p{
  font-size: 1rem;
  opacity: 0.9;
  max-width: 90%;
  margin: 0 auto;
  line-height: 1.6;
}

.input-section {
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 20px;
}

.input-group {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
  margin-bottom: 20px;
}

.input-item {
  display: flex;
  flex-direction: column;
  min-width: 300px;
}

.input-item label {
  font-weight: bold;
  margin-bottom: 12px;
  font-size: 1.15rem;
  color: #5a3e7c;
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-item input,
.input-item select {
  padding: 14px 18px;
  border: 2px solid #e0d6eb;
  border-radius: 10px;
  font-size: 1.15rem;
  background: white;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.input-item input:focus,
.input-item select:focus {
  border-color: #9c27b0;
  outline: none;
  box-shadow: 0 0 0 4px rgba(156, 39, 176, 0.2);
}

.calculate-btn {
  display: block;
  margin: 30px auto 10px;
  padding: 16px 60px;
  background: linear-gradient(135deg, #9c27b0, #673ab7);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.3rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 5px 15px rgba(156, 39, 176, 0.3);
  letter-spacing: 1px;
}

.calculate-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(156, 39, 176, 0.4);
}

.result-section {
  padding: 20px;
  background: #Fff;
  border-radius: 12px;
  margin-bottom: 25px;
  text-align: center;
  position: relative;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding: 0 10px;
}

.calendar-title {
  font-size: 1.6rem;
  color: #333;
  font-weight: bold;
  text-align: center;
  flex: 1;
}

.nav-btn {
  background: #f1e8ff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 1.1rem;
  font-weight: bold;
  color: #673ab7;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nav-btn:hover {
  background: #e0d6f0;
  transform: translateY(-2px);
}

.today-btn {
  background: linear-gradient(135deg, #7e57c2, #5e35b1);
  color: white;
}

.calendar-container {
  background: white;
  border-radius: 16px;
  padding: 15px;
  margin-top: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid #eee;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.day-header {
  background: #f5f1ff;
  padding: 16px 5px;
  font-weight: bold;
  text-align: center;
  border-radius: 10px;
  color: #7e57c2;
  font-size: 1.1rem;
}

.day {
  height: 100px;
  padding: 12px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
  border: 2px solid #f5f1ff;
}

.day:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.day-date {
  font-weight: bold;
  font-size: 1.2rem;
  z-index: 2;
  align-self: flex-start;
}

.day-status {
  font-size: 0.9rem;
  padding: 4px 8px;
  border-radius: 6px;
  align-self: flex-end;
  z-index: 2;
  font-weight: bold;
}

.period-bg {
  background: linear-gradient(135deg, #f8bbd0, #f48fb1);
}

.ovulation-bg {
  background: linear-gradient(135deg, #fff9c4, #ffecb3);
}

.safe-bg {
  background: linear-gradient(135deg, #c8e6c9, #a5d6a7);
}

.period-text .day-status {
  background: rgba(244, 143, 177, 0.8);
  color: #880e4f;
}

.ovulation-text .day-status {
  background: rgba(255, 213, 79, 0.8);
  color: #ff6f00;
}

.safe-text .day-status {
  background: rgba(165, 214, 167, 0.8);
  color: #1b5e20;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 35px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 10px;
  background: #f9f5ff;
}

.legend-color {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.period-color {
  background: linear-gradient(135deg, #f8bbd0, #f48fb1);
}

.ovulation-color {
  background: linear-gradient(135deg, #fff9c4, #ffecb3);
}

.safe-color {
  background: linear-gradient(135deg, #c8e6c9, #a5d6a7);
}

.info-section {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 25px;
}

.info-section h2 {
  color: #7e57c2;
  margin-bottom: 25px;
  text-align: center;
  font-size: 1.5rem;
  position: relative;
  padding-bottom: 10px;
}

.info-section h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, #9c27b0, #673ab7);
  border-radius: 2px;
}

.info-content {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
}

.info-card {
  flex: 1;
  min-width: 320px;
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
  transition: all 0.4s;
  border-top: 4px solid #7e57c2;
}

.info-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.info-card h3 {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  color: #7e57c2;
  font-size: 1.2rem;
}

.info-card p {
  line-height: 1.7;
  color: #555;
  font-size: 1rem;
}

.hidden {
  display: none;
}

.current-day {
  position: relative;
  border: 2px solid #4d94ff !important;
}

.current-day::after {
  content: "今天";
  position: absolute;
  top: 8px;
  right: 8px;
  background: #4d94ff;
  color: white;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: bold;
}

.other-month {
  background-color: #fafafa;
  color: #aaa;
}

.day.empty-day {
  background: #fafafa;
  border: 2px dashed #e0e0e0;
}

.footer {
  text-align: center;
  padding: 10px;
  color: #777;
  font-size: 1rem;
}

.warning-note {
  background: #fff8e1;
  border-left: 4px solid #ffc107;
  padding: 15px 20px;
  margin: 20px auto;
  max-width: 100%;
  border-radius: 0 8px 8px 0;
  text-align: left;
  font-size: 1rem;
}

.calculate-btn:active {
  transform: translateY(0);
  box-shadow: 0 5px 15px rgba(156, 39, 176, 0.3);
}

.nav-btn:active {
  transform: translateY(0);
}
