/* ============== ��ɫ�������ϵͳ ============== */
:root {
  /* ��ɫ - �Ƽ��� */
  --primary: #4A90E2;
  --primary-light: #74B0F0;
  --primary-dark: #2E6FBF;
  --primary-soft: #E8F2FC;
  --primary-bg: #F0F6FC;

  /* ����ɫ */
  --accent: #FFB347;
  --success: #4CAF50;
  --danger: #F5365C;
  --warning: #FF9500;

  /* ���� */
  --text-1: #1A2B4E;
  --text-2: #4A5876;
  --text-3: #8B95AD;
  --text-inverse: #FFFFFF;

  /* ���� */
  --bg: #F5F8FC;
  --bg-card: #FFFFFF;
  --bg-soft: #F0F4F9;
  --border: #E5EAF2;

  /* ��Ӱ */
  --shadow-sm: 0 2px 8px rgba(74, 144, 226, 0.08);
  --shadow-md: 0 4px 16px rgba(74, 144, 226, 0.12);
  --shadow-lg: 0 8px 32px rgba(74, 144, 226, 0.16);

  /* Բ�� */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 999px;

  /* ���� */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;
}

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

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: var(--fs-base);
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
}

input, textarea, button, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button { cursor: pointer; }
input, textarea { -webkit-appearance: none; appearance: none; }

::-webkit-scrollbar { width: 0; height: 0; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 2px; }

/* ============== ��¼ҳ������ȫ���� ============== */
.login-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #4A90E2 0%, #2E6FBF 50%, #1A4F8F 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden;
}

/* Ĭ��������Ӧ�ã���ʾ��¼ҳ */
#app { display: none; }
body.logged-in #app { display: flex !important; }
body.logged-in .login-screen { display: none !important; }

.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bg-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(40px);
}
.shape-1 {
  width: 400px; height: 400px;
  top: -100px; right: -100px;
  animation: float 12s ease-in-out infinite;
}
.shape-2 {
  width: 300px; height: 300px;
  bottom: -50px; left: -50px;
  background: rgba(255, 255, 255, 0.06);
  animation: float 10s ease-in-out infinite reverse;
}
.shape-3 {
  width: 200px; height: 200px;
  top: 40%; left: 30%;
  background: rgba(116, 176, 240, 0.3);
  animation: float 14s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(30px, -30px); }
  66% { transform: translate(-20px, 20px); }
}

.login-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 32px 24px;
  text-align: center;
  color: white;
}

.login-logo {
  margin-bottom: 48px;
  animation: slideDown 0.6s var(--ease-out, ease);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.logo-icon {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 32px rgba(0,0,0,0.2); }
  50% { transform: scale(1.05); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }
}

.logo-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.logo-subtitle {
  font-size: 14px;
  opacity: 0.85;
  letter-spacing: 1px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideUp 0.6s var(--ease-out, ease);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.input-box {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--r-md);
  padding: 0 16px;
  height: 54px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s;
}
.input-box:focus-within {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
}

.input-icon {
  font-size: 18px;
  margin-right: 12px;
  opacity: 0.8;
}

.input-box input {
  flex: 1;
  height: 100%;
  font-size: 16px;
  color: white;
  letter-spacing: 4px;
}
.input-box input::placeholder {
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0;
}

.toggle-pwd {
  font-size: 18px;
  opacity: 0.7;
  padding: 4px 8px;
  transition: opacity 0.2s;
}
.toggle-pwd:hover { opacity: 1; }

.login-btn {
  height: 54px;
  background: white;
  color: var(--primary-dark);
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
  letter-spacing: 2px;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,0.25); }
.login-btn:active { transform: scale(0.98); }
.login-btn .arrow { font-size: 18px; transition: transform 0.2s; }
.login-btn:hover .arrow { transform: translateX(4px); }

.login-error {
  color: #FFD0D0;
  font-size: 13px;
  min-height: 20px;
  opacity: 0;
  transition: opacity 0.2s;
}
.login-error.show { opacity: 1; }

.login-tips {
  margin-top: 48px;
  font-size: 12px;
  opacity: 0.7;
}
.login-tips p { margin: 4px 0; }
.login-version { font-size: 11px; opacity: 0.5; }

/* ============== ��Ӧ�ò��� ============== */
#app {
  flex: 1;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* ============== ҳ�� ============== */
.page {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 70px; /* ���� tab �� */
  display: none;
  overflow: hidden;
  background: var(--bg);
}
.page.active {
  display: flex;
  flex-direction: column;
}

.page-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* 留出 footer 位置（~70px）避免最后内容被备案信息遮住 */
  padding-bottom: 70px;
}

/* 备案 footer：fixed 到底部，不遮挡 page-scroll */
footer {
  position: fixed !important;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  z-index: 5;
  margin: 0 !important;
  padding: 8px 12px 10px !important;
  font-size: 11px !important;
  line-height: 1.5 !important;
}

/* ============== �ֲ�ͼ ============== */
.banner-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  background: rgba(255,255,255,0.1);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-slide-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white;
}

.carousel-slide-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.carousel-slide-desc {
  font-size: 12px;
  opacity: 0.9;
}

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: all 0.3s;
  cursor: pointer;
}

.carousel-dot.active {
  background: white;
  width: 18px;
  border-radius: 3px;
}

.carousel-edit {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
}

/* ============== �ü� Modal ============== */
#crop-stage {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  background: #111;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#crop-img {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  max-width: none;
  will-change: transform;
  pointer-events: none;
}

#crop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 2;
}

#crop-box {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
  cursor: move;
  z-index: 3;
  background: transparent;
}

.crop-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(255,255,255,0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.4) 1px, transparent 1px);
  background-size: 33.33% 33.33%;
}

.crop-tip {
  font-size: 12px;
  color: #4A5876;
  text-align: center;
  padding: 8px;
}
  background: rgba(0,0,0,0.4);
  color: white;
  padding: 6px 12px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 500;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 3;
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.2s;
}
.carousel-edit:active { transform: scale(0.95); background: rgba(0,0,0,0.6); }

.carousel-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  background: linear-gradient(135deg, #74B0F0, #4A90E2);
}
.carousel-empty-icon { font-size: 48px; margin-bottom: 8px; opacity: 0.7; }

/* �ֲ�ͼ���� */
.carousel-manager {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.carousel-manager-item {
  aspect-ratio: 16/9;
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  background: var(--bg-soft);
  cursor: pointer;
  transition: transform 0.2s;
  border: 2px solid transparent;
}
.carousel-manager-item.active {
  border-color: var(--primary);
}
.carousel-manager-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.carousel-manager-item .manager-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 1;
}
.carousel-manager-item .manager-order {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 11px;
}

.carousel-add {
  margin-top: 12px;
}

.carousel-tip {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 8px;
  line-height: 1.5;
}

/* �����ڵ��ֲ�ͼ���� */
.carousel-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.carousel-list-item {
  aspect-ratio: 16/9;
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  background: var(--bg-soft);
}
.carousel-list-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.carousel-list-item .list-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* ============== �ײ� Tab �� ============== */
.tab-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: white;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s;
  position: relative;
  padding: 8px 0;
}

.tab-item.active {
  color: var(--primary);
}

.tab-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

.tab-icon {
  font-size: 22px;
  transition: transform 0.2s;
}

.tab-item.active .tab-icon {
  transform: scale(1.1);
}

.tab-text {
  font-size: 11px;
  font-weight: 500;
}

/* ============== ��ҳͷ�� ============== */
.home-header {
  position: relative;
  background: var(--bg);
  padding: 20px 20px 20px;
  border-radius: 0 0 24px 24px;
  overflow: hidden;
  color: var(--text-1);
  margin-bottom: 16px;
}

.header-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(116,176,240,0.3) 0%, transparent 50%);
  pointer-events: none;
}

.header-top {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.header-time {
  font-size: 13px;
  opacity: 0.9;
}

.header-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.header-icon-btn:hover { background: rgba(255, 255, 255, 0.25); }

.header-main {
  position: relative;
  text-align: center;
  margin-bottom: 14px;
}

.baby-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.baby-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-1);
  text-shadow: none;
}

.baby-tag {
  font-size: 13px;
  opacity: 0.7;
  color: var(--text-2);
}

.age-card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--r-lg);
  padding: 12px 16px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}

.age-main {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: 1px;
}

.age-sub {
  font-size: 13px;
  opacity: 0.9;
}

.age-sub b {
  font-size: 16px;
  font-weight: 700;
}

/* ============== ���� ============== */
.container {
  padding: 0 16px 100px;
}

/* ============== ͳ���� ============== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: white;
  border-radius: var(--r-lg);
  padding: 16px 8px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.stat-item {
  text-align: center;
  padding: 8px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.2s;
}
.stat-item:active { background: var(--primary-soft); }

.stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ============== ���� ============== */
.section {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
}

.section-more {
  font-size: 13px;
  color: var(--primary);
  padding: 4px 8px;
}

/* ============== ��ݲ��� ============== */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: white;
  border-radius: var(--r-lg);
  padding: 16px 8px;
  box-shadow: var(--shadow-sm);
}

.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-radius: var(--r-md);
  transition: all 0.2s;
}
.quick-btn:active {
  background: var(--primary-soft);
  transform: scale(0.95);
}

.quick-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.quick-text {
  font-size: 12px;
  color: var(--text-2);
}

/* ============== ����б� ============== */
.recent-list {
  background: white;
  border-radius: var(--r-lg);
  padding: 8px 16px;
  box-shadow: var(--shadow-sm);
}

.recent-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--bg-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}
.recent-item:last-child { border-bottom: none; }

.recent-mood {
  font-size: 24px;
  flex-shrink: 0;
}

.recent-body {
  flex: 1;
  min-width: 0;
}

.recent-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-date {
  font-size: 12px;
  color: var(--text-3);
}

.empty-mini {
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  padding: 24px 16px;
}

.recent-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.recent-photo {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  background: var(--bg-soft);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}
.recent-photo:active { transform: scale(0.95); }

.recent-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============== ��ҳ��ͷ ============== */
.sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: white;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

.sub-header h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-1);
}

.header-add {
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 6px 12px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 2px;
  transition: all 0.2s;
}
.header-add:active { transform: scale(0.95); }
.header-add span { font-size: 16px; font-weight: 700; }

/* ============== �ռ��б� ============== */
.diary-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
}

.diary-card {
  background: white;
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.diary-card:active { transform: scale(0.99); }
.diary-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
}

.diary-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.diary-mood {
  font-size: 28px;
  flex-shrink: 0;
}

.diary-info {
  flex: 1;
  min-width: 0;
}

.diary-date {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 2px;
}

.diary-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diary-content {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-left: 40px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}

.empty-icon {
  font-size: 56px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-text {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 4px;
}

.empty-tip {
  font-size: 12px;
  color: var(--text-3);
}

/* ============== ��� ============== */
.album-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  overflow-x: auto;
  padding-bottom: 4px;
}

.album-tab {
  padding: 6px 14px;
  border-radius: var(--r-full);
  background: white;
  color: var(--text-2);
  font-size: 13px;
  white-space: nowrap;
  border: 1px solid var(--border);
  transition: all 0.2s;
  flex-shrink: 0;
}
.album-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding-bottom: 16px;
}

.photo-item {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  background: var(--bg-soft);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.photo-item:active { transform: scale(0.97); }
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-item .photo-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 8px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: white;
  font-size: 11px;
  line-height: 1.3;
}

/* ============== ʱ���� ============== */
.timeline {
  position: relative;
  padding: 16px 0 16px 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: var(--primary-soft);
  border-radius: 1px;
}

.tl-item {
  position: relative;
  margin-bottom: 16px;
  cursor: pointer;
}

.tl-dot {
  position: absolute;
  left: -26px;
  top: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: var(--shadow-sm);
  z-index: 1;
}

.tl-card {
  background: white;
  border-radius: var(--r-lg);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.tl-card:active { transform: scale(0.99); }

.tl-date {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 2px;
}

.tl-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
}

.tl-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ============== ��Ƭ / ���� ============== */
.card {
  background: white;
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bg-soft);
}

/* ����ģʽ���� */
.quality-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
}
.quality-info { flex: 1; min-width: 0; }
.quality-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 2px;
}
.quality-desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #d0d7e2;
  border-radius: 26px;
  transition: 0.3s;
}
.switch .slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(20px); }

/* ���豸ͬ�� */
.sync-token-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.sync-token-label {
  font-size: 14px;
  color: var(--text-2);
  white-space: nowrap;
}
.sync-token-row .text-input {
  flex: 1;
  min-width: 0;
}
.sync-status {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 10px;
  min-height: 18px;
}
.sync-status.ok { color: #4CAF50; }
.sync-status.err { color: #f44336; }
.sync-btns {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.sync-btns .btn { flex: 1; font-size: 14px; padding: 10px 8px; }
.sync-tip {
  font-size: 12px;
  color: var(--text-2);
  text-align: center;
}
.text-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text-1);
  width: 100%;
  box-sizing: border-box;
}
.text-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* �Զ�ͬ��״̬���� */
.auto-sync-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text-2);
  margin-left: 6px;
  font-weight: 500;
  vertical-align: middle;
}
.auto-sync-badge.ok {
  background: #E8F5E9;
  color: #2E7D32;
}

.form-item {
  margin-bottom: 14px;
}
.form-item:last-child { margin-bottom: 0; }

.form-item label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 500;
}

.text-input,
input[type="text"],
input[type="password"],
input[type="date"],
textarea {
  width: 100%;
  background: var(--bg-soft);
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-size: 14px;
  border: 1.5px solid transparent;
  transition: all 0.2s;
  font-family: inherit;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
.text-input:focus,
textarea:focus {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

textarea {
  resize: none;
  line-height: 1.6;
}

.avatar-uploader {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--bg-soft);
  border-radius: var(--r-md);
}

.avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  cursor: pointer;
  overflow: hidden;
  border: 2px dashed var(--primary-light);
  transition: all 0.2s;
  flex-shrink: 0;
  position: relative;
}
.avatar-preview:hover { border-color: var(--primary); }
.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-preview span {
  display: block;
  line-height: 1;
}

.avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.avatar-actions .ghost-btn {
  font-size: 12px;
  padding: 5px 10px;
  white-space: nowrap;
}

.emoji-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.emoji-item {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.emoji-item:hover { background: var(--primary-soft); }
.emoji-item.selected {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: var(--r-md);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(74, 144, 226, 0.4); }
.primary-btn:active { transform: scale(0.98); }
.primary-btn.full { width: 100%; }

.action-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

.action-name {
  font-size: 14px;
  color: var(--text-1);
  margin-bottom: 2px;
}

.action-desc {
  font-size: 12px;
  color: var(--text-3);
}

.danger-text { color: var(--danger) !important; }

.ghost-btn {
  padding: 7px 14px;
  border-radius: var(--r-md);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--primary-light);
  transition: all 0.2s;
}
.ghost-btn:active { transform: scale(0.95); }
.ghost-btn.danger {
  background: white;
  color: var(--danger);
  border-color: var(--danger);
}

.about-block {
  text-align: center;
  padding: 16px 0;
}

.about-logo {
  font-size: 40px;
  margin-bottom: 8px;
}

.about-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
}

.about-version {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 8px;
}

.about-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.logout-btn {
  width: 100%;
  height: 44px;
  background: white;
  color: var(--danger);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--danger);
  transition: all 0.2s;
  margin-top: 0;
  margin-bottom: 24px;
}
.logout-btn:active { background: var(--danger); color: white; }

.profile-card {
  background: white;
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.profile-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 2px;
}

.profile-desc {
  font-size: 12px;
  color: var(--text-3);
}

.profile-edit {
  padding: 6px 12px;
  border-radius: var(--r-full);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 500;
}

/* ============== ���� ============== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none !important;
}
.modal.active { display: flex !important; align-items: flex-end; justify-content: center; }

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease;
}
.modal-mask.dark { background: rgba(0, 0, 0, 0.92); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 88%;
  background: white;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-bar {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 8px auto 4px;
  flex-shrink: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--bg-soft);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
}

.modal-cancel {
  font-size: 14px;
  color: var(--text-3);
  padding: 6px 8px;
}
.modal-save {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
  padding: 6px 8px;
}
.modal-save:active { transform: scale(0.95); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.mood-item {
  background: var(--bg-soft);
  border-radius: var(--r-md);
  padding: 10px 4px;
  text-align: center;
  font-size: 24px;
  line-height: 1.3;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.mood-item small {
  font-size: 11px;
  color: var(--text-3);
}
.mood-item:hover { background: var(--primary-soft); }
.mood-item.selected {
  background: var(--primary-soft);
  border-color: var(--primary);
  transform: scale(1.05);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-item {
  padding: 7px 12px;
  background: var(--bg-soft);
  border-radius: var(--r-full);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1.5px solid transparent;
  color: var(--text-2);
}
.tag-item:hover { background: var(--primary-soft); }
.tag-item.selected {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 500;
}

.upload-box {
  border: 2px dashed var(--primary-light);
  border-radius: var(--r-lg);
  padding: 24px 16px;
  text-align: center;
  background: var(--primary-soft);
  cursor: pointer;
  transition: all 0.2s;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-box:active { background: white; }

.upload-icon {
  font-size: 40px;
  margin-bottom: 6px;
}

.upload-text {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
  margin-bottom: 2px;
}

.upload-hint {
  font-size: 11px;
  color: var(--text-3);
}

.photo-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: var(--r-md);
}

.url-fallback {
  margin-top: 10px;
  font-size: 13px;
}
.url-fallback summary {
  color: var(--primary);
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
}
.url-fallback[open] summary { margin-bottom: 4px; }

/* ============== �鿴�� ============== */
.viewer-box {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  padding: 20px;
  animation: fadeIn 0.25s;
}

.viewer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.viewer-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--r-md);
}

.viewer-info {
  margin-top: 16px;
  color: white;
  font-size: 14px;
  text-align: center;
  padding: 0 20px;
}

/* ============== Toast ============== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 12px 24px;
  border-radius: var(--r-md);
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 80%;
  text-align: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ============== ����ģ�� ============== */
.love-card {
  background: linear-gradient(135deg, #FFF0F3 0%, #FFE3EC 100%);
  border-radius: var(--r-lg);
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(255, 107, 129, 0.15);
  margin-bottom: 20px;
}
.love-avatars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}
.love-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
}
.love-avatar img { width: 100%; height: 100%; object-fit: cover; }
.love-heart { font-size: 22px; animation: heartBeat 1.4s infinite; }
@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.love-names {
  font-size: 18px;
  font-weight: 700;
  color: #E0457B;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-bottom: 14px;
}
.love-and { font-size: 14px; opacity: 0.6; }
.love-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  position: relative;
}
.love-stat-num {
  font-size: 24px;
  font-weight: 800;
  color: #E0457B;
}
.love-stat-label {
  font-size: 12px;
  color: #B0657F;
  margin-top: 2px;
}
.love-edit-btn {
  position: absolute;
  top: -8px;
  right: 0;
  background: rgba(255,255,255,0.8);
  border: none;
  color: #E0457B;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 10px;
  cursor: pointer;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 4px 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
}
.section-add {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.section-more {
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
}
.anni-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.anni-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border-radius: var(--r-md);
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.anni-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #FFF0F3;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.anni-info { flex: 1; min-width: 0; }
.anni-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}
.anni-date {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}
.anni-days {
  font-size: 13px;
  color: #E0457B;
  font-weight: 600;
  white-space: nowrap;
}
.anni-del {
  color: #ccc;
  font-size: 16px;
  padding: 4px 6px;
  cursor: pointer;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-1);
  cursor: pointer;
}
.checkbox-label input { width: 18px; height: 18px; }
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  color: var(--text-2);
}
.upload-area:active { border-color: var(--primary); }
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-text { font-size: 13px; }
.preview-img {
  width: 100%;
  border-radius: var(--r-md);
  margin-top: 8px;
}
.photo-item-desc {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: #fff;
  font-size: 11px;
  padding: 14px 6px 5px;
  border-radius: 0 0 12px 12px;
}

/* ============== ��Ӧʽ ============== */
/* ====== ��ҳ����Ԫ�� ====== */
/* �ɵ� home-love-* ��ʽ�����ã��� .love-clock-card ��� */
/* ===== ������ʱ��Ƭ��ë���� + ���룩 ===== */
.love-clock-card {
  position: relative;
  margin: 12px 16px 0;
  padding: 24px 12px 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,255,255,0.55), rgba(255,255,255,0.32));
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 8px 32px rgba(74, 144, 226, 0.12);
  overflow: hidden;
}
.love-clock-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(155, 200, 150, 0.28), transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(180, 220, 160, 0.22), transparent 55%),
    radial-gradient(ellipse at 50% 10%, rgba(255, 220, 200, 0.25), transparent 60%);
  z-index: 0;
  pointer-events: none;
}
.love-clock-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  padding: 0 4px;
}
.love-clock-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.love-clock-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  border: 3px solid #fff;
  cursor: pointer;
  transition: transform 0.2s;
  overflow: hidden;
}
.love-clock-avatar:active { transform: scale(0.95); }
.love-clock-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
.love-clock-name {
  font-size: 15px;
  font-weight: 600;
  color: #5a4a4a;
  letter-spacing: 1px;
}
.love-heart-anim {
  position: relative;
  width: 70px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}
.love-heart-icon {
  font-size: 36px;
  color: #ff4d6d;
  filter: drop-shadow(0 0 10px rgba(255, 77, 109, 0.7));
  animation: heartBeat 1.4s ease-in-out infinite;
  z-index: 3;
  position: relative;
}
.love-heart-pulse {
  position: absolute;
  top: 50%; left: 50%;
  width: 24px; height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 50%;
  background: rgba(255, 77, 109, 0.5);
  animation: heartPulse 1.4s ease-out infinite;
  z-index: 1;
}
.love-heart-pulse-2 {
  animation-delay: 0.7s;
}
@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.25); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
  60% { transform: scale(1); }
}
@keyframes heartPulse {
  0%   { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.8); opacity: 0; }
}
.love-sparkles {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.love-sparkles span {
  position: absolute;
  color: #ff8aa3;
  font-size: 12px;
  animation: sparkle 2.4s ease-in-out infinite;
}
.love-sparkles span:nth-child(1) { top: 8%;  left: 18%;  animation-delay: 0s;   }
.love-sparkles span:nth-child(2) { top: 78%; left: 22%;  animation-delay: 0.4s; }
.love-sparkles span:nth-child(3) { top: 20%; right: 12%; animation-delay: 0.8s; }
.love-sparkles span:nth-child(4) { top: 70%; right: 8%;  animation-delay: 1.2s; }
.love-sparkles span:nth-child(5) { top: 45%; left: -2%;  animation-delay: 1.6s; }
.love-sparkles span:nth-child(6) { top: -4%; right: 22%; animation-delay: 2.0s; }
@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  50%      { opacity: 1; transform: scale(1.1); }
}
.love-clock-divider {
  position: relative;
  z-index: 1;
  text-align: center;
  margin: 18px 0 8px;
  color: #6a5a5a;
  font-size: 13px;
  letter-spacing: 2px;
}
.love-clock-counter {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #3a2a2a;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}
.love-clock-num {
  font-size: 26px;
  font-weight: 700;
  color: #ff4d6d;
  font-family: Georgia, "Times New Roman", serif;
  display: inline-block;
  min-width: 30px;
  text-align: center;
  text-shadow: 0 1px 2px rgba(255, 77, 109, 0.15);
  letter-spacing: 0;
}
.love-clock-unit {
  font-size: 14px;
  color: #7a6a6a;
  margin: 0 4px 0 2px;
}
.home-next-anni {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: var(--r-md);
  padding: 12px 16px; margin: 10px 16px;
  border: 1px solid var(--border); box-shadow: var(--shadow-1);
}
.home-next-anni-icon { font-size: 28px; }
.home-next-anni-info { flex: 1; }
.home-next-anni-title { font-size: 14px; font-weight: 600; color: var(--text-1); }
.home-next-anni-count { font-size: 12px; color: var(--primary); margin-top: 2px; }
.home-next-anni-btn { font-size: 20px; background: none; border: none; cursor: pointer; padding: 4px; }.home-next-anni-info { cursor: pointer; }
.love-clock-edit-btn {
  background: rgba(255,255,255,0.6); border: none; border-radius: 50%;
  width: 24px; height: 24px; font-size: 12px; cursor: pointer;
  margin-left: 8px; vertical-align: middle; transition: all 0.2s;
}
.love-clock-edit-btn:hover { background: rgba(255,255,255,0.9); transform: scale(1.1); }
.love-clock-counter { cursor: pointer; }
.love-clock-counter:hover { opacity: 0.8; }
.icon-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.icon-option {
  width: 40px; height: 40px; font-size: 20px; border-radius: 10px;
  border: 2px solid transparent; background: #f5f5f7; cursor: pointer;
  transition: all 0.15s; padding: 0;
}
.icon-option:hover { background: #e8e8ed; }
.icon-option.selected {
  background: var(--primary-soft); border-color: var(--primary);
  transform: scale(1.08);
}
.form-row { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 12px; font-size: 15px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
  outline: none; transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--primary); }
.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-check input { width: 18px; height: 18px; cursor: pointer; }
.form-btn {
  width: 100%; padding: 12px; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.form-btn.primary { background: var(--primary); color: #fff; }
.form-btn.primary:hover { background: var(--primary-hover); }

.home-baby-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0;
}
.home-baby-info { flex: 1; min-width: 0; }
.home-baby-name { font-size: 17px; font-weight: 700; color: var(--text-1); }
.home-baby-age { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.home-baby-stats { display: flex; gap: 16px; }
.home-baby-stat { text-align: center; }
.home-baby-stat-num { font-size: 18px; font-weight: 700; color: var(--primary); }
.home-baby-stat-label { font-size: 11px; color: var(--text-2); }

/* ====== ����Tab ====== */
.profile-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border-radius: var(--r-lg);
  padding: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-1);
  margin-bottom: 12px;
}
.profile-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-name { font-size: 20px; font-weight: 700; color: var(--text-1); }
.profile-age { font-size: 14px; color: var(--text-2); margin-top: 4px; }
.recent-list {
  background: var(--surface); border-radius: var(--r-md);
  border: 1px solid var(--border); overflow: hidden;
}
.diary-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.diary-item:last-child { border-bottom: none; }
.diary-item .diary-date { font-size: 12px; color: var(--text-2); flex-shrink: 0; }
.diary-item .diary-title { font-size: 14px; color: var(--text-1); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.photo-thumb {
  aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden;
  background: var(--primary-soft); display: flex; align-items: center; justify-content: center;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 768px) {
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .recent-photos { grid-template-columns: repeat(6, 1fr); }
  .quick-grid { max-width: 600px; margin: 0 auto; }
  .modal-box {
    left: 50%;
    transform: translateX(-50%);
    max-width: 480px;
    border-radius: 20px;
    bottom: 50%;
    margin-bottom: -40vh;
  }
}

@media (min-width: 1024px) {
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
  .tab-bar { max-width: 600px; margin: 0 auto; left: 0; right: 0; }
}

/* ���䰲ȫ���� */
@supports (padding: env(safe-area-inset-bottom)) {
  .tab-bar { padding-bottom: env(safe-area-inset-bottom); }
  .container { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
}

/* ===== �ײ����� ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #fff;
  display: flex;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* �ռ�ͼƬ����ͼ���� */
.diary-imgs {
  display: flex;
  flex-wrap: wrap;
  margin-top: 8px;
}
.diary-imgs img {
  transition: transform .15s ease;
}
.diary-imgs img:hover {
  transform: scale(1.03);
}
/* ============== �ռ��������ͼ�� ============== */
.diary-item--rich {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.diary-item-thumb {
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.diary-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.diary-item-thumb--emoji {
  font-size: 28px;
}
.diary-item-body {
  flex: 1;
  min-width: 0;
}
.diary-item-body .diary-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.diary-item-body .diary-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.diary-item-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.diary-item--clickable { cursor: pointer; transition: background 0.15s ease; border-radius: 8px; padding-left: 8px; margin-left: -8px; padding-right: 8px; margin-right: -8px; }
.diary-item--clickable:hover { background: var(--bg-soft); }
.diary-item--clickable:active { background: #e8eef7; }


/* ============== �ռ�ֻ�����������Ȧʽ�� ============== */
/* ǿ�Ƹ���ȫ�� .modal.active �� flex-end��iOS ���ײ����룩����Ϊ���� */
#diary-viewer-modal { align-items: center !important; justify-content: center !important; }
.diary-viewer-box {
  width: 92vw;
  max-width: 720px;
  max-height: 88vh;
  margin: auto;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.diary-viewer-body { padding: 18px 26px 28px; overflow-y: auto; }
.diary-viewer-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.diary-viewer-type-badge { display: inline-block; padding: 4px 12px; border-radius: 14px; background: var(--bg-soft); color: var(--text-muted); font-size: 13px; font-weight: 500; }
.diary-viewer-mood { display: inline-block; padding: 4px 12px; border-radius: 14px; background: #fff5e0; color: #b97a00; font-size: 13px; }
.diary-viewer-title { font-size: 22px; font-weight: 700; color: var(--text); margin: 6px 0 14px; line-height: 1.4; }
.diary-viewer-content { font-size: 16px; color: var(--text); line-height: 1.85; white-space: pre-wrap; word-break: break-word; padding: 4px 0; }
.diary-viewer-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 18px; }
.diary-viewer-imgs:empty { display: none; }
.diary-viewer-img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: zoom-in; transition: transform 0.15s ease; background: var(--bg-soft); display: block; }
.diary-viewer-img:hover { transform: scale(1.04); }
.modal-save-spacer { display: inline-block; width: 60px; }
