:root {
  --primary: #e91e63;
  --primary-light: #f8bbd0;
  --primary-bg: #fff0f5;
  --accent: #9c27b0;
  --accent-light: #e1bee7;
  --accent-bg: #fce4ec;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --white: #ffffff;
  --border: #f0e0e8;
  --shadow: 0 4px 24px rgba(233, 30, 99, 0.10);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s ease;
}

html, body, main, header, footer {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 50%, #fff0f5 100%);
  min-height: 100vh;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px 20px;
  min-height: calc(100vh - 100px);
}

div#app {
  width: 100%;
  max-width: 480px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
}

#title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 8px 0;
  letter-spacing: 1px;
}

.subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-light);
  margin: 0 0 24px 0;
}

.mode-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.mode-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
}

.mode-btn.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.15);
}

.mode-btn:hover:not(.active) {
  color: var(--primary);
}

.input-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#input-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.date-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
  box-sizing: border-box;
  outline: none;
  font-family: inherit;
}

.date-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

.error-msg {
  font-size: 13px;
  color: #e53935;
  margin: 0;
  padding: 0;
}

.error-msg.hidden {
  display: none;
}

.calc-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 1px;
}

.calc-btn:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.calc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.result-section {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-section.hidden {
  display: none;
}

.result-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.result-label {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
}

.result-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.progress-section {
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.progress-section .result-label {
  display: block;
  margin-bottom: 10px;
}

.progress-bar-container {
  position: relative;
  width: 100%;
  height: 24px;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary), var(--accent-light));
  border-radius: 12px;
  transition: width 0.6s ease;
  width: 0%;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.phase-info {
  text-align: center;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
}

.phase-early {
  background: #e8f5e9;
  color: #2e7d32;
}

.phase-mid {
  background: #fff8e1;
  color: #f57f17;
}

.phase-late {
  background: #fce4ec;
  color: #c62828;
}

footer {
  text-align: center;
  padding: 20px 16px;
}

.page-info {
  font-size: 12px;
  color: var(--text-muted);
}

.page-info a {
  color: var(--primary);
  text-decoration: none;
}

.page-info a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .card {
    padding: 24px 18px;
  }

  #title {
    font-size: 20px;
  }

  .mode-btn {
    font-size: 13px;
    padding: 8px 10px;
  }

  .result-value {
    font-size: 16px;
  }
}

#intro-section,
#scenario-section {
  margin-top: 20px;
}

#intro-title,
#scenario-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 14px 0;
}

#intro-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-light);
  margin: 0;
}

#scenario-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#scenario-list li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-light);
  padding-left: 16px;
  position: relative;
}

#scenario-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-light);
}

#scenario-list li strong {
  color: var(--text);
}
