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

html, body {
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #e8eff9;
  min-height: 100vh;
  color: #222831;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #4088f0 0%, #54c4f7 100%);
  border-radius: 22px;
  padding: 20px 30px;
  margin-bottom: 20px;
  box-shadow: 0 4px 18px rgba(64, 136, 240, 0.18);
}

.date-display {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  min-width: 200px;
}

.search-box {
  flex: 1;
  max-width: 420px;
  margin: 0 30px;
  position: relative;
}

/* 修复搜索框背景色错误，恢复半透明白色 */
.search-box input {
  width: 100%;
  padding: 12px 20px 12px 45px;
  border: none;
  border-radius: 26px;
  background: rgba(255,255,255,0.32);
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: 0.25s ease;
}

.search-box input::placeholder {
  color: rgba(255,255,255,0.75);
}
.search-box input:focus {
  background: rgba(255,255,255,0.45);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.75);
  font-size: 17px;
}

.login-btn {
  padding: 9px 26px;
  border: none;
  border-radius: 24px;
  background: #ffffff;
  color: #4088f0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}
.login-btn:hover {
  background: #f0f7ff;
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(64,136,240,0.2);
}

.main-content {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  height: calc(100vh - 140px);
  min-height: calc(100vh - 140px);
  align-items: stretch;
  overflow: hidden;
}

.main-content > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}

.calendar-panel {
  background: #f3f7fc;
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  flex-shrink: 0;
}

.version-panel {
  background: #f3f7fc;
  border-radius: 22px;
  padding: 12px 26px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  flex-grow: 1;
}
.version-tag {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.panel-title {
  font-size: 24px;
  font-weight: 700;
  color: #1a202c;
}

.panel-add {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #4088f0;
  color: white;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.25s ease;
  box-shadow: 0 3px 10px rgba(64,136,240,0.22);
}
.panel-add:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(64,136,240,0.3);
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.nav-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  color: #64748b;
  cursor: pointer;
  padding: 4px 14px;
  border-radius: 10px;
  transition: 0.2s ease;
}
.nav-btn:hover {
  background: rgba(64,136,240,0.08);
  color: #4088f0;
}
.current-month {
  font-size: 18px;
  font-weight: 700;
  color: #1a202c;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.weekday {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  padding: 7px 0;
}
.weekday.sunday { color: #e06c6c; }
.weekday.saturday { color: #4088f0; }

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.22s ease;
  position: relative;
}
.day-cell:hover {
  background: rgba(64,136,240,0.09);
}
.day-cell.other-month { color: #b0bccd; }

.day-cell.today {
  background: #4088f0;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(64,136,240,0.25);
}
.day-cell.selected {
  background: rgba(64,136,240,0.12);
  border: 2px solid #4088f0;
}

.day-cell.has-memo::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e06c6c;
}
.day-cell.sunday { color: #e06c6c; }
.day-cell.saturday { color: #4088f0; }

/* 备忘录面板 全浏览器隐藏滚动条（保留滚动能力） */
.memo-panel {
  background: #f3f7fc;
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.memo-panel::-webkit-scrollbar {
  display: none;
}

.memo-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.memo-list::-webkit-scrollbar {
  display: none;
}

.memo-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 14px 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.03);
  cursor: pointer;
  transition: 0.2s ease;
  width: 100%;
}
.memo-card:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.memo-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 3px;
}
.memo-title {
  font-size: 17px;
  font-weight: 600;
  color: #1a202c;
  line-height: 1.15;
}
.memo-add-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #dde2eb;
  background: #fff;
  color: #717e96;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
}
.memo-add-btn:hover {
  background: #4088f0;
  color: white;
  border-color: #4088f0;
}

.memo-date {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.15;
}
.memo-content-preview {
  display: none;
}

.fab {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4088f0, #54c4f7);
  color: white;
  border: none;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(64,136,240,0.32);
  transition: 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(64,136,240,0.4);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: 0.25s ease;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal {
  background: #ffffff;
  border-radius: 24px;
  padding: 30px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.93);
  transition: 0.25s ease;
  box-shadow: 0 14px 45px rgba(0,0,0,0.12);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.modal::-webkit-scrollbar {
  display: none;
}
.modal-overlay.active .modal { transform: scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a202c;
}
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f0f4fb;
  color: #64748b;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
}
.modal-close:hover {
  background: #e06c6c;
  color: white;
}

.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 8px;
}
.form-input, .form-textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  font-size: 15px;
  outline: none;
  transition: 0.22s ease;
  font-family: inherit;
}
.form-input:focus, .form-textarea:focus {
  border-color: #4088f0;
  box-shadow: 0 0 0 4px rgba(64,136,240,0.1);
}
.form-textarea { min-height: 150px; resize: vertical; }

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.btn {
  padding: 12px 28px;
  border-radius: 14px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.22s ease;
}
.btn-primary {
  background: #4088f0;
  color: white;
  box-shadow: 0 3px 10px rgba(64,136,240,0.22);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(64,136,240,0.3);
}
.btn-secondary {
  background: #f0f4fb;
  color: #4a5568;
}
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger {
  background: #e06c6c;
  color: white;
}
.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(224,108,108,0.22);
}

.login-form { display: flex; flex-direction: column; gap: 20px; }
.login-input {
  padding: 14px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  font-size: 15px;
  outline: none;
  transition: 0.22s ease;
}
.login-input:focus {
  border-color: #4088f0;
  box-shadow: 0 0 0 4px rgba(64,136,240,0.1);
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 14px;
  color: white;
  font-weight: 600;
  box-shadow: 0 5px 18px rgba(0,0,0,0.1);
  transform: translateX(400px);
  transition: 0.35s ease;
  z-index: 2000;
}
.toast.show { transform: translateX(0); }
.toast.success { background: #42b983; }
.toast.error { background: #e06c6c; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #b0bccd;
}
.empty-state-icon { font-size: 60px; margin-bottom: 20px; }
.empty-state-text { font-size: 18px; font-weight: 500; }

.memo-detail-content {
  font-size: 16px;
  line-height: 1.8;
  color: #1a202c;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.memo-detail-meta {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
  font-size: 13px;
  color: #8898aa;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 14px;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.logout-btn {
  padding: 6px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.4);
  background: transparent;
  color: white;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s ease;
}
.logout-btn:hover { background: rgba(255,255,255,0.15); }

.memo-loading {
  text-align: center;
  padding: 40px;
  color: #8898aa;
}

.month-picker-modal { max-width: 360px; }
.month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 10px 0;
}
.month-item {
  padding: 20px;
  border-radius: 14px;
  background: #f0f4fb;
  color: #1a202c;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: 0.22s ease;
}
.month-item:hover {
  background: #4088f0;
  color: white;
  transform: scale(1.04);
}
.month-item.active {
  background: #4088f0;
  color: white;
}

/* 平板手机适配 */
@media (max-width: 900px) {
  .main-content {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
    overflow: visible;
  }
  .version-panel { display: none !important; }
  .main-content > div:first-child { display: block; height: auto; }

  .calendar-panel { width: 100%; max-width: 100%; }
  .memo-panel { min-height: 400px; max-height: 600px; width: 100%; }
  .memo-list { max-height: 500px; }
  .memo-card { width: 100%; min-width: 0; }

  .header { flex-wrap: wrap; gap: 15px; }
  .search-box {
    order: 3;
    max-width: 100%;
    margin: 0;
    flex-basis: 100%;
  }
}

@media (max-width: 600px) {
  .container { padding: 10px; }
  .date-display { font-size: 20px; }
  .header { padding: 15px 20px; border-radius: 16px; }
  .calendar-panel, .memo-panel { border-radius: 16px; padding: 20px; }
  .fab { bottom: 20px; right: 20px; width: 52px; height: 52px; font-size: 24px; }
  .modal { padding: 20px; border-radius: 20px; }
  .form-actions { flex-wrap: wrap; }
  .btn { padding: 10px 20px; font-size: 14px; }
}

.memo-notify-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #4088f0;
  background: rgba(64,136,240,0.1);
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
}
/* 通知测试铃铛按钮 - 和头像36px同尺寸，无悬浮提示气泡 */
.memo-notify-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  background: transparent;
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
  margin: 0 4px;
  position: static;
}
/* 彻底禁用悬浮提示气泡 */
.memo-notify-btn::after {
  display: none !important;
}
.memo-notify-btn:hover {
  background: rgba(255,255,255,0.15);
  transform: scale(1.05);
}
.memo-notify-btn:active {
  transform: scale(0.95);
}
.memo-notify-btn.testing {
  animation: pulse 1s infinite;
  opacity: 0.7;
}
