@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@300;400;500&display=swap');

:root {
  --bg: #fef2f5;
  --bg2: #fde8ee;
  --primary: #d95b74;
  --primary-dark: #c04865;
  --primary-light: #f7b8c8;
  --primary-pale: #fce4eb;
  --green: #6dbf82;
  --orange: #f0a050;
  --blue: #6aabcf;
  --text: #3d2030;
  --text-muted: #9a7080;
  --white: #ffffff;
  --card-shadow: 0 8px 32px rgba(217,91,116,0.12);
  --radius: 22px;
  --radius-sm: 14px;
  --bottom-bar: 64px;
}

* { box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent; }

body {
  font-family: 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-bar) + 16px);
  -webkit-overflow-scrolling: touch;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-bar);
  background: var(--white);
  border-top: 1px solid #f5dde4;
  display: flex;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(217,91,116,0.08);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: color 0.2s;
  color: var(--text-muted);
  font-size: 11px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item.active { color: var(--primary); }
.nav-item .nav-icon { font-size: 22px; line-height: 1; }

/* ===== PAGES ===== */
.page { display: none; animation: fadeIn 0.25s ease; }
.page.active { display: block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }

/* ===== HEADER ===== */
.header {
  background: linear-gradient(135deg, #d95b74 0%, #e87d93 55%, #f4a7ba 100%);
  padding: 52px 20px 28px;
  position: relative;
  overflow: hidden;
}
.header::before {
  content:''; position:absolute; top:-50px; right:-50px;
  width:200px; height:200px; background:rgba(255,255,255,0.07); border-radius:50%;
}
.header::after {
  content:''; position:absolute; bottom:-70px; left:-40px;
  width:240px; height:240px; background:rgba(255,255,255,0.05); border-radius:50%;
}
.header-inner { position:relative; z-index:1; }
.header-top { display:flex; justify-content:space-between; align-items:flex-start; }
.header-title { font-family:'Noto Serif SC',serif; font-size:26px; font-weight:700; color:#fff; letter-spacing:2px; }
.header-sub { font-size:12px; color:rgba(255,255,255,0.75); margin-top:4px; }
.mode-badge {
  background: rgba(255,255,255,0.22);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 100px;
  font-size: 12px;
  padding: 5px 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.mode-badge:active { background: rgba(255,255,255,0.35); }

/* ===== CONTAINER ===== */
.container { max-width: 480px; margin: 0 auto; padding: 0 14px; }

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 20px 20px;
  margin-bottom: 14px;
}
.card-title {
  font-family:'Noto Serif SC',serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}

/* ===== STATUS CARD ===== */
.status-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 22px 20px;
  margin: -18px 0 14px;
  position: relative;
  z-index: 2;
}
.phase-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-pale); color: var(--primary);
  font-size: 13px; font-weight: 500;
  padding: 5px 14px; border-radius: 100px; margin-bottom: 14px;
}
.days-row { display:flex; align-items:baseline; gap:6px; margin-bottom:6px; }
.days-num { font-family:'Noto Serif SC',serif; font-size:54px; font-weight:700; color:var(--primary); line-height:1; }
.days-unit { font-size:15px; color:var(--text-muted); }
.days-tip { font-size:13px; color:var(--text-muted); margin-bottom:18px; line-height:1.5; }
.info-chips { display:flex; gap:10px; flex-wrap:wrap; }
.chip {
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 10px 13px; flex:1; min-width:110px;
}
.chip-label { font-size:11px; color:var(--text-muted); margin-bottom:3px; }
.chip-value { font-size:13px; font-weight:500; color:var(--text); }

/* ===== CALENDAR ===== */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.cal-nav-btn {
  background: var(--bg); border: none; border-radius: 10px;
  width:34px; height:34px; font-size:16px;
  color: var(--primary); cursor: pointer;
  display:flex; align-items:center; justify-content:center;
  transition: background 0.15s;
}
.cal-nav-btn:active { background: var(--primary-pale); }
.cal-month-label { font-family:'Noto Serif SC',serif; font-size:16px; font-weight:600; }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7,1fr);
  text-align: center; margin-bottom: 6px;
}
.cal-weekday { font-size: 11px; color: var(--text-muted); padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.cal-day {
  aspect-ratio: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: 12px;
  font-size: 13px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
  user-select: none;
  gap: 1px;
}
.cal-day.has-tag { aspect-ratio: auto; min-height: 42px; padding: 2px 0; }
.cal-deviation-tag {
  font-size: 8px; line-height: 1; font-weight: 500;
  padding: 1px 4px; border-radius: 3px; white-space: nowrap;
  margin-top: 1px;
}
.cal-deviation-tag.early  { background:#fff3e0; color:#e67e22; }
.cal-deviation-tag.late   { background:#fde8ee; color:#d95b74; }
.cal-deviation-tag.ontime { background:#e8f5e9; color:#388e3c; }
.cal-day:active { opacity: 0.7; }
.cal-day.other-month { color: #ccc; }
.cal-day.today { font-weight: 700; color: var(--primary); }
.cal-day.today::after {
  content:''; position:absolute; bottom:4px;
  width:4px; height:4px; background:var(--primary); border-radius:50%;
}
.cal-day.period { background: #fde; color: var(--primary-dark); font-weight:600; }
.cal-day.period-start { background: var(--primary); color:#fff; border-radius:50%; }
.cal-day.period-start.has-tag { border-radius:14px; justify-content:flex-start; padding-top:4px; }
.cal-day.fertile { background: #fff0e8; }
.cal-day.ovulation { background: var(--orange); color:#fff; border-radius:50%; }
.cal-day.safe { }
.cal-dot {
  width: 5px; height: 5px; border-radius: 50%;
  position: absolute; bottom: 3px;
}
.cal-legend {
  display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px;
}
.legend-item { display:flex; align-items:center; gap:5px; font-size:11px; color:var(--text-muted); }
.legend-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }

/* ===== MOOD / SYMPTOM ===== */
.mood-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 14px; }
.mood-btn {
  background: var(--bg); border: 2px solid transparent;
  border-radius: var(--radius-sm); padding: 10px 4px;
  text-align: center; cursor: pointer;
  transition: all 0.15s;
  font-size: 11px; color: var(--text-muted);
}
.mood-btn .mood-emoji { font-size: 22px; display: block; margin-bottom: 4px; }
.mood-btn.selected { border-color: var(--primary); background: var(--primary-pale); color: var(--primary); }
.mood-btn:active { transform: scale(0.95); }

.symptom-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sym-btn {
  background: var(--bg); border: 2px solid transparent;
  border-radius: 100px; padding: 7px 13px;
  font-size: 12px; color: var(--text-muted);
  cursor: pointer; transition: all 0.15s;
}
.sym-btn.selected { border-color: var(--primary); background: var(--primary-pale); color: var(--primary); }
.sym-btn:active { opacity: 0.7; }

.note-input {
  width: 100%; border: 2px solid var(--primary-light);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 14px; font-family: 'Noto Sans SC', sans-serif;
  color: var(--text); background: var(--bg);
  outline: none; resize: none; min-height: 70px;
  transition: border-color 0.2s;
}
.note-input:focus { border-color: var(--primary); }

.btn-save {
  width: 100%;
  background: linear-gradient(135deg, #d95b74, #e87d93);
  color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 13px;
  font-size: 15px; font-weight: 500;
  font-family: 'Noto Sans SC', sans-serif;
  cursor: pointer; margin-top: 12px;
  box-shadow: 0 4px 14px rgba(217,91,116,0.3);
  transition: transform 0.1s, box-shadow 0.2s;
}
.btn-save:active { transform: scale(0.98); box-shadow: 0 2px 6px rgba(217,91,116,0.2); }

/* ===== ADD PERIOD ===== */
.input-row { display:flex; gap:10px; align-items:center; }
.date-input {
  flex:1; border: 2px solid var(--primary-light);
  border-radius: var(--radius-sm); padding: 11px 14px;
  font-size:15px; font-family:'Noto Sans SC',sans-serif;
  color:var(--text); background:var(--bg); outline:none;
  transition: border-color 0.2s; -webkit-appearance:none;
}
.date-input:focus { border-color: var(--primary); }
.btn-add {
  background: linear-gradient(135deg, #d95b74, #e87d93);
  color:#fff; border:none; border-radius:var(--radius-sm);
  padding: 11px 18px; font-size:14px; font-weight:500;
  font-family:'Noto Sans SC',sans-serif; cursor:pointer;
  box-shadow:0 4px 12px rgba(217,91,116,0.3); white-space:nowrap;
  transition: transform 0.1s;
}
.btn-add:active { transform: scale(0.96); }
.error-msg { font-size:12px; color:#e05c5c; margin-top:7px; min-height:16px; }

/* ===== HISTORY ===== */
.history-item {
  display:flex; justify-content:space-between; align-items:center;
  background:var(--bg); border-radius:var(--radius-sm);
  padding: 12px 14px; animation: fadeIn 0.2s ease;
}
.history-list { display:flex; flex-direction:column; gap:8px; }
.h-left { display:flex; flex-direction:column; gap:3px; }
.h-date { font-size:15px; font-weight:500; }
.h-meta { font-size:12px; color:var(--text-muted); }
.btn-del {
  background:none; border:none; color:var(--primary-light);
  font-size:20px; cursor:pointer; padding:2px 8px;
  border-radius:8px; transition:color 0.2s;
  line-height:1;
}
.btn-del:active { color:var(--primary); background:var(--primary-pale); }

/* ===== SETTINGS ===== */
.setting-row {
  display:flex; justify-content:space-between; align-items:center;
  padding: 14px 0; border-bottom: 1px solid var(--bg2);
}
.setting-row:last-child { border-bottom: none; }
.setting-label { font-size:14px; }
.setting-sub { font-size:12px; color:var(--text-muted); margin-top:2px; }

/* toggle */
.toggle {
  position:relative; width:48px; height:26px; cursor:pointer;
}
.toggle input { opacity:0; width:0; height:0; position:absolute; }
.toggle-track {
  position:absolute; inset:0;
  background:#e0c0c8; border-radius:100px;
  transition: background 0.2s;
}
.toggle input:checked ~ .toggle-track { background: var(--primary); }
.toggle-thumb {
  position:absolute; top:3px; left:3px;
  width:20px; height:20px; background:#fff;
  border-radius:50%; box-shadow:0 1px 4px rgba(0,0,0,0.2);
  transition: left 0.2s;
}
.toggle input:checked ~ .toggle-thumb { left:25px; }

/* select */
.setting-select {
  background:var(--bg); border:2px solid var(--primary-light);
  border-radius:10px; padding:6px 10px; font-size:13px;
  color:var(--text); font-family:'Noto Sans SC',sans-serif;
  outline:none;
}

/* ===== TOASTS ===== */
.toast {
  position:fixed; top:50%; left:50%;
  transform:translate(-50%,-50%) scale(0.9);
  background:rgba(60,20,30,0.88); color:#fff;
  padding:14px 28px; border-radius:16px; font-size:15px;
  opacity:0; transition:all 0.3s; pointer-events:none; z-index:999;
  white-space:nowrap; text-align:center;
}
.toast.show { opacity:1; transform:translate(-50%,-50%) scale(1); }

/* ===== MODAL ===== */
.modal-overlay {
  position:fixed; inset:0; background:rgba(61,32,48,0.45);
  display:flex; align-items:flex-end; justify-content:center;
  z-index:200; opacity:0; pointer-events:none;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity:1; pointer-events:auto; }
.modal {
  background:var(--white); border-radius:var(--radius) var(--radius) 0 0;
  padding:24px 20px 40px; width:100%; max-width:480px;
  transform: translateY(40px);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}
.modal-overlay.open .modal { transform:translateY(0); }
.modal-title { font-family:'Noto Serif SC',serif; font-size:17px; font-weight:600; margin-bottom:18px; }
.modal-btns { display:flex; gap:10px; margin-top:18px; }
.btn-modal {
  flex:1; border:none; border-radius:var(--radius-sm);
  padding:12px; font-size:14px; font-family:'Noto Sans SC',sans-serif;
  cursor:pointer; transition:opacity 0.15s;
}
.btn-modal:active { opacity:0.7; }
.btn-modal-cancel { background:var(--bg); color:var(--text-muted); }
.btn-modal-ok { background:var(--primary); color:#fff; }

/* ===== CYCLE BAR ===== */
.cycle-bar-wrap {
  position:relative; height:12px; background:var(--bg2);
  border-radius:100px; overflow:visible; margin:14px 0 8px;
}
.cycle-bar-fill {
  height:100%; border-radius:100px;
  transition:width 0.6s cubic-bezier(.4,0,.2,1);
}
.cycle-bar-cursor {
  position:absolute; top:-3px;
  width:18px; height:18px;
  background:var(--primary); border:3px solid #fff;
  border-radius:50%;
  box-shadow:0 2px 8px rgba(217,91,116,0.4);
  transform:translateX(-50%);
  transition:left 0.6s cubic-bezier(.4,0,.2,1);
}

/* ===== FIRST USE ===== */
.first-use { text-align:center; padding:8px 0; }
.first-use-emoji { font-size:38px; display:block; margin-bottom:10px; }
.first-use-text { font-size:14px; color:var(--text-muted); line-height:1.7; }

/* ===== FERTILITY MODE ===== */
.fertility-banner {
  background: linear-gradient(135deg, #f9e0ea, #fce4f0);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
  border-left: 4px solid var(--primary);
}
.fertility-title { font-size:14px; font-weight:500; color:var(--primary-dark); margin-bottom:4px; }
.fertility-text { font-size:12px; color:var(--text-muted); line-height:1.6; }

/* Progress ring */
.ring-wrap { display:flex; justify-content:center; margin:4px 0 16px; }
svg.ring circle { fill:none; stroke-linecap:round; }

/* ===== PROFILE PAGE ===== */

/* 个人信息卡片 —— 渐变背景 */
.profile-card {
  background: linear-gradient(180deg, #fff 0%, #fef5f7 40%, #fef2f5 100%);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 30px 20px 22px;
  margin-bottom: 14px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border: 1.5px solid var(--primary-pale);
}
.profile-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, var(--primary-pale) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.profile-avatar-wrap {
  position:relative; width:88px; height:88px; margin:0 auto 14px;
  border-radius:50%; overflow:visible; cursor:pointer;
}
.profile-avatar {
  width:88px; height:88px; border-radius:50%; object-fit:cover;
  border:3.5px solid var(--primary-pale);
}
.profile-avatar-placeholder {
  width:88px; height:88px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:36px; font-weight:700; color:#fff;
  border:3.5px solid var(--primary-pale);
}
.profile-avatar-badge {
  position:absolute; bottom:4px; right:4px;
  background:var(--primary); border-radius:50%;
  width:28px; height:28px; font-size:14px;
  display:flex; align-items:center; justify-content:center;
  border:2.5px solid #fff; box-shadow:0 2px 8px rgba(0,0,0,0.15);
  pointer-events:none;
}
.profile-name-display {
  font-size:21px; font-weight:600; color:var(--text);
  cursor:pointer; padding:4px 12px; border-radius:8px;
  display:inline-block; min-width:60px; margin-bottom:6px;
  transition: background 0.2s;
  font-family: 'Noto Serif SC', serif;
}
.profile-name-display:hover { background: var(--bg); }
.profile-name-display::after {
  content:' ✏️'; font-size:13px; opacity:0; transition: opacity 0.2s;
}
.profile-name-display:hover::after { opacity:0.5; }

.profile-name-input {
  border:none; background:var(--bg); padding:6px 10px;
  font-size:18px; font-weight:600; font-family:'Noto Sans SC',sans-serif;
  color:var(--text); text-align:center; outline:none;
  min-width:80px; max-width:180px; margin-bottom:6px;
  border-radius:8px; border:2px solid var(--primary-light);
}

.profile-name-saved {
  font-size:20px; font-weight:600; color:var(--text); margin-bottom:6px;
}

.profile-subtitle {
  font-size:13px; color:var(--text-muted);
  margin-bottom: 12px; line-height: 1.5;
}

/* 未登录大按钮 */
.profile-actions {
  display:flex; gap:8px; justify-content:center; flex-wrap:wrap;
  margin-top:2px;
}
.btn-profile-primary-lg {
  background: linear-gradient(135deg, #d95b74, #e87d93);
  color:#fff; border:none; border-radius:100px;
  padding: 11px 28px; font-size:15px; font-weight:500;
  font-family:'Noto Sans SC',sans-serif; cursor:pointer;
  box-shadow:0 4px 14px rgba(217,91,116,0.3);
  transition: transform 0.1s;
  min-height:44px;
}
.btn-profile-primary-lg:active { transform:scale(0.96); }
.btn-profile-outline-lg {
  background: transparent;
  color: var(--primary); border: 1.5px solid var(--primary);
  border-radius:100px;
  padding: 11px 28px; font-size:15px; font-weight:500;
  font-family:'Noto Sans SC',sans-serif; cursor:pointer;
  transition: transform 0.1s;
  min-height:44px;
}
.btn-profile-outline-lg:active { transform:scale(0.96); }

/* 统计概览行 */
.profile-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 16px 0;
  padding: 14px 8px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 10px rgba(217,91,116,0.06);
}
.profile-stat-item {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.profile-stat-num {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.profile-stat-label {
  font-size: 11px;
  color: var(--text-muted);
}
.profile-stat-divider {
  width: 1px;
  height: 30px;
  background: var(--bg2);
  flex-shrink: 0;
}

/* 小药丸按钮 */
.btn-profile-pill {
  border: none;
  border-radius: 100px;
  padding: 7px 16px;
  font-size: 12px;
  font-family: 'Noto Sans SC', sans-serif;
  cursor: pointer;
  font-weight: 500;
  background: var(--bg);
  color: var(--primary);
  transition: transform 0.1s, background 0.15s;
  min-height: 36px;
}
.btn-profile-pill:active { transform: scale(0.95); background: var(--primary-pale); }
.btn-profile-pill-danger { color: var(--text-muted); }
.btn-profile-pill-admin { background: #fef0e8; color: var(--orange); }

/* 旧样式兼容（保留以备其他用途） */
.login-info { font-size:13px; color:var(--text-muted); margin-bottom:10px; }
.login-uid { font-size:11px; color:var(--text-muted); margin-bottom:12px; }

.profile-btn-row { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin-top:4px; }
.btn-profile {
  border-radius:100px; border:none; padding:9px 20px;
  font-size:13px; font-family:'Noto Sans SC',sans-serif;
  cursor:pointer; font-weight:500;
  transition:opacity 0.15s, transform 0.1s;
  min-height:44px;
}
.btn-profile:active { transform:scale(0.96); }
.btn-profile-primary { background:var(--primary); color:#fff; }
.btn-profile-outline { background:transparent; color:var(--primary); border:1.5px solid var(--primary); }
.btn-profile-danger { background:transparent; color:var(--text-muted); border:1.5px solid #ddd; }
.btn-profile-admin { background:#f0a050; color:#fff; }

.admin-badge {
  display:inline-block; background:#f0a050; color:#fff;
  font-size:10px; padding:2px 8px; border-radius:100px;
  margin-left:6px; vertical-align:middle; font-weight:500;
}

/* admin panel */
.admin-user-row {
  display:flex; justify-content:space-between; align-items:center;
  padding:10px 0; border-bottom:1px solid var(--bg2);
}
.admin-user-row:last-child { border-bottom:none; }
.admin-user-info { flex:1; }
.admin-user-name { font-size:14px; font-weight:500; }
.admin-user-meta { font-size:11px; color:var(--text-muted); }
.btn-reset {
  background:var(--bg); border:none; border-radius:100px;
  padding:6px 14px; font-size:11px; color:var(--primary);
  cursor:pointer; font-family:'Noto Sans SC',sans-serif;
  min-height:36px; transition:background 0.15s;
}
.btn-reset:active { background:var(--primary-pale); }

/* login modal */
.login-input {
  width:100%; border:2px solid var(--primary-light);
  border-radius:var(--radius-sm); padding:12px 14px;
  font-size:15px; font-family:'Noto Sans SC',sans-serif;
  color:var(--text); background:var(--bg); outline:none;
  margin-bottom:10px; transition:border-color 0.2s;
  -webkit-appearance:none;
}
.login-input:focus { border-color:var(--primary); }
.login-error { font-size:12px; color:#e05c5c; min-height:16px; margin-bottom:6px; }

/* ===== DEVIATION / 提前推迟模块 ===== */
.deviation-list { display:flex; flex-direction:column; gap:7px; }
.deviation-item {
  display:flex; justify-content:space-between; align-items:center;
  background:var(--bg); border-radius:var(--radius-sm);
  padding:12px 14px; animation:fadeIn 0.2s ease;
}
.deviation-date { font-size:14px; font-weight:500; }
.deviation-badge {
  font-size:11px; padding:4px 10px; border-radius:100px; font-weight:500;
  white-space:nowrap;
}
.deviation-badge.early  { background:#fff3e0; color:#e67e22; }
.deviation-badge.late   { background:#fde8ee; color:#d95b74; }
.deviation-badge.ontime { background:#e8f5e9; color:#388e3c; }
.deviation-badge.first  { background:#f5f5f5; color:#999; }
.deviation-summary { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.deviation-stat {
  font-size:12px; color:var(--text-muted); background:var(--bg);
  padding:6px 10px; border-radius:10px; white-space:nowrap;
}

/* ===== PERIOD END CARD ===== */
.end-period-hint {
  font-size:13px; color:var(--primary); margin-bottom:10px;
  background:var(--primary-pale); padding:8px 12px; border-radius:10px;
  line-height:1.5;
}
.btn-end {
  background: linear-gradient(135deg, #6dbf82, #8fd4a0);
  color:#fff; border:none; border-radius:var(--radius-sm);
  padding:11px 18px; font-size:14px; font-weight:500;
  font-family:'Noto Sans SC',sans-serif; cursor:pointer;
  box-shadow:0 4px 12px rgba(109,191,130,0.3); white-space:nowrap;
  transition:transform 0.1s;
}
.btn-end:active { transform:scale(0.96); }

/* ===== PERIOD ACTION CARD (新版记录卡片) ===== */
.period-action-card {
  text-align: center;
  padding: 26px 20px 22px;
}

/* 一键记录大按钮 */
.btn-quick-record {
  width: 100%;
  border: none;
  border-radius: 20px;
  padding: 20px 16px 16px;
  cursor: pointer;
  font-family: 'Noto Sans SC', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.15s, box-shadow 0.2s;
  margin-bottom: 14px;
}
.btn-quick-record:active {
  transform: scale(0.96);
}
.btn-quick-icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 2px;
}
.btn-quick-label {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 2px;
}
.btn-quick-sub {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 2px;
}

/* 开始按钮 —— 粉色系 */
.btn-quick-start {
  background: linear-gradient(135deg, #d95b74 0%, #e87d93 60%, #f4a0b4 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(217,91,116,0.38);
}

/* 结束按钮 —— 绿色系 */
.btn-quick-end {
  background: linear-gradient(135deg, #5ca870 0%, #6dbf82 60%, #8fd4a0 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(109,191,130,0.38);
}

/* 展开/折叠：选择其他日期 */
.expand-toggle {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  user-select: none;
  display: inline-block;
  transition: color 0.2s;
}
.expand-toggle:hover {
  color: var(--primary);
}
.expand-arrow {
  font-size: 10px;
  margin-left: 3px;
}

/* 日期选择行（展开后） */
.expand-row {
  margin-top: 12px;
  animation: fadeIn 0.25s ease;
}

/* ===== 经期进行中卡片 ===== */
.period-active-card {
  background: linear-gradient(180deg, #fff 0%, #fef5f7 60%, #fef2f5 100%);
  border: 1.5px solid var(--primary-pale);
}

.period-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary-pale);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.period-day-counter {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
}

.period-day-num {
  font-family: 'Noto Serif SC', serif;
  font-size: 60px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.period-day-unit {
  font-size: 20px;
  color: var(--primary);
  font-weight: 500;
}

.period-active-info {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ===== STATS CARD ===== */
.stats-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-bottom:16px; }
.stats-item {
  background:var(--bg); border-radius:var(--radius-sm);
  padding:14px 10px; text-align:center;
}
.stats-value {
  font-family:'Noto Serif SC',serif; font-size:26px; font-weight:700;
  color:var(--primary); line-height:1.1;
}
.stats-value.green { color:var(--green); }
.stats-value.orange { color:var(--orange); }
.stats-label { font-size:11px; color:var(--text-muted); margin-top:4px; }

.trend-section { margin-top:14px; }
.trend-title { font-size:12px; font-weight:500; color:var(--text); margin-bottom:10px; }
.trend-chart { display:flex; align-items:flex-end; gap:4px; height:72px; padding:0 2px; position:relative; }
.trend-bar {
  flex:1; border-radius:4px 4px 0 0; min-width:5px;
  transition:height 0.5s cubic-bezier(.4,0,.2,1);
  position:relative; cursor:pointer;
}
.trend-bar.cycle-bar  { background:linear-gradient(180deg,#d95b74,#e88d9e); }
.trend-bar.duration-bar { background:linear-gradient(180deg,#6dbf82,#8fd4a0); }
.trend-bar:hover { opacity:0.8; }
.trend-bar-label {
  position:absolute; bottom:-16px; left:50%; transform:translateX(-50%);
  font-size:9px; color:var(--text-muted); white-space:nowrap;
}
.trend-avg-line {
  position:absolute; left:0; right:0; border-top:2px dashed var(--primary-light);
  pointer-events:none;
}
.trend-avg-label {
  position:absolute; right:2px; font-size:9px; color:var(--primary-light);
  transform:translateY(-50%); background:var(--white); padding:0 3px;
}
