* {
  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: 1080px;
  margin: 0 auto;
  padding: 16px;
}

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

.date-display {
  font-size: 18px;
  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: 10px 16px 10px 40px;
  border: none;
  border-radius: 22px;
  background: rgba(255,255,255,0.32);
  color: #fff;
  font-size: 14px;
  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: 14px;
}

.login-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 20px;
  background: #ffffff;
  color: #4088f0;
  font-size: 14px;
  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: 340px 1fr;
  gap: 6px;
  height: calc(100vh - 120px);
  min-height: calc(100vh - 120px);
  align-items: stretch;
  overflow: visible;
}

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

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

.version-panel {
  background: #f3f7fc;
  border-radius: 18px;
  padding: 12px 26px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: flex;
  align-items: center;
  flex-grow: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.version-panel-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.version-panel-link {
  font-size: 13px;
  color: #4088f0;
  text-decoration: none;
}

.version-panel-text {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.version-panel-loading {
  font-size: 13px;
  color: #64748b;
}

.version-tag {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

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

.panel-add {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #4088f0;
  color: white;
  font-size: 19px;
  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: 12px;
}
.nav-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  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: 16px;
  font-weight: 700;
  color: #1a202c;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.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: 6px;
}
.day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 14px;
  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: 18px;
  padding: 20px;
  box-shadow: 0 2px 8px 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: 6px;
  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: 12px 16px;
  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: 14px;
  font-weight: 600;
  color: #1a202c;
  line-height: 1.15;
}
.memo-add-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #dde2eb;
  background: #fff;
  color: #717e96;
  font-size: 14px;
  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: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4088f0, #54c4f7);
  color: white;
  border: none;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(64,136,240,0.28);
  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: 20px;
  padding: 24px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.93);
  transition: 0.25s ease;
  box-shadow: 0 10px 36px rgba(0,0,0,0.10);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.modal::-webkit-scrollbar {
  display: none;
}
.modal-overlay.active .modal { transform: scale(1); }

.modal-login {
  max-width: 400px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.modal-title {
  font-size: 19px;
  font-weight: 700;
  color: #1a202c;
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f0f4fb;
  color: #64748b;
  font-size: 18px;
  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: 14px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 8px;
}
.form-input, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  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: 6px;
  justify-content: flex-end;
}

.form-actions-detail {
  margin-top: 14px;
}

.btn {
  padding: 10px 22px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  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);
}

.btn-login {
  width: 100%;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.login-form { display: flex; flex-direction: column; gap: 6px; }
.login-input {
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  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: 14px 20px;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  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: 48px 16px;
  color: #b0bccd;
}
.empty-state-icon { font-size: 48px; margin-bottom: 14px; }
.empty-state-text { font-size: 16px; 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: 12px;
  margin-top: 14px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
  font-size: 13px;
  color: #8898aa;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  font-size: 14px;
}
#authSection {
  display: flex;
  align-items: center;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.logout-btn {
  padding: 5px 12px;
  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: 6px;
  padding: 10px 0;
}
.month-item {
  padding: 16px;
  border-radius: 12px;
  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;
}

.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: 3px;
}

.memo-notify-btn {
  width: 32px;
  height: 32px;
  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;
  position: relative;
  flex-shrink: 0;
  -webkit-user-select: none;
  user-select: none;
}

.memo-notify-btn:hover {
  background: rgba(255,255,0,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;
}

.memo-notify-btn::before {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: #1a202c;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 1000;
}
.memo-notify-btn::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  border: 6px solid transparent;
  border-top-color: #1a202c;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 1000;
}
.memo-notify-btn:hover::before,
.memo-notify-btn:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.memo-repeat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #42b983;
  background: rgba(66, 185, 131, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 3px;
}

.repeat-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 15px;
  margin-top: 10px;
}

#memoRepeatInterval {
  width: 100%;
}

.memo-detail-repeat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #42b983;
  margin-top: 6px;
}

/* ============================================
   自定义日期/时间选择器样式
   ============================================ */

.input-picker { position: relative; }
.input-picker-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 10px; border: none;
  background: transparent; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: 0.2s ease;
}
.input-picker-btn:hover { background: rgba(64,136,240,0.1); }

/* 居中弹出的选择器 - 相对于输入框容器居中，随页面滚动 */
.input-picker {
  position: relative;
}
.input-picker-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px) scale(0.95);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  padding: 16px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: 0.2s ease;
  min-width: 260px;
}
.input-picker-popover.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* 日期选择器专用：更宽 */
.input-picker-popover.date-popover {
  min-width: 300px;
}

/* 时间选择器专用 */
.input-picker-popover.time-popover {
  min-width: 200px;
}

/* 时间列 */
.time-column {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  max-height: 200px; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none;
  padding: 4px; border-radius: 12px; background: #f8fafc; width: 60px;
}
.time-column::-webkit-scrollbar { display: none; }
.time-column .time-item {
  width: 100%; text-align: center; padding: 7px 4px;
  border-radius: 10px; cursor: pointer; font-size: 14px;
  font-weight: 500; color: #4a5568; transition: 0.15s ease;
}
.time-column .time-item:hover { background: rgba(64,136,240,0.08); color: #4088f0; }
.time-column .time-item.selected {
  background: #4088f0; color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(64,136,240,0.25);
}

/* 选择器底部按钮区 */
.popover-footer {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

/* 时间选择器中间冒号 */
.time-separator {
  font-size: 18px;
  font-weight: 700;
  color: #1a202c;
  display: flex;
  align-items: center;
}

/* 时间选择器行布局 */
.time-picker-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 12px;
}

/* 通知设置行 */
.notify-setting-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.notify-setting-row .input-picker {
  flex: 1;
}

/* 输入框右侧留出按钮空间 */
.input-picker input {
  padding-right: 40px;
}

/* 通知渠道选择 */
.notify-channel-select {
  margin-bottom: 8px;
}

/* 邮箱输入 */
.notify-email-input {
  display: none;
}

/* 重复间隔 */
.repeat-interval-wrap {
  display: none;
  margin-bottom: 8px;
}

/* 重复类型选择 */
.repeat-type-select {
  margin-bottom: 8px;
}

/* 详情通知 */
.detail-notify {
  display: none;
}

/* 删除按钮 */
.delete-btn {
  display: none;
}

/* 通知设置标签 */
.notify-setting-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 8px;
}

/* 日历导航（选择器内） */
.popover-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

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

  .calendar-panel { 
    width: 100%; 
    max-width: 100%; 
    height: auto;
    flex-shrink: unset;
    margin-bottom: 14px;
  }
  .memo-panel { 
    min-height: auto; 
    max-height: none; 
    width: 100%; 
    height: auto;
    overflow: visible;
    margin-top: 0;
  }
  .memo-list { 
    max-height: none; 
    overflow: visible;
  }
  .memo-card { width: 100%; min-width: 0; }

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

  /* 移动端选择器适配 */
  .input-picker-popover {
    min-width: auto;
    width: 90vw;
    max-width: 340px;
    left: 50%;
    transform: translateX(-50%) translateY(-6px) scale(0.95);
  }
  .input-picker-popover.active {
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

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

  .notify-setting-row {
    flex-direction: column;
  }
}
/* app.js 迁移的内联样式 */
.login-prompt-btn {
  margin-top: 14px;
}

.memo-card-actions {
  display: flex;
}

.memo-repeat-badge {
  background: rgba(66,185,131,0.1);
  color: #42b983;
}

.user-info-guest {
  gap: 4px;
}

.memo-notify-btn-disabled {
  opacity: 0.4;
  pointer-events: none;
}
