/* ========================================
   萌宝护理日记 - 全局样式
   母婴温暖风格 | 移动优先 | V1.5 完整版
   ======================================== */

/* CSS变量 - 明亮清新母婴风 */
:root {
    --primary: #2192EB;
    --primary-light: #FAC1D7;
    --primary-dark: #2192EB;
    --accent: #FFB6C1;
    --bg: #F0F7FC;
    --bg-card: #FFFFFF;
    --text: #2C3E50;
    --text-secondary: #5A7D9A;
    --text-light: #95B8D0;
    --border: #D6E8F5;
    --success: #52C41A;
    --warning: #FAAD14;
    --danger: #FF6B6B;
    --vip-gold: #D4A843;
    --vip-gradient: linear-gradient(135deg, #FFD700, #FFA500);
    --shadow: 0 2px 12px rgba(91, 155, 213, 0.10);
    --shadow-lg: 0 4px 24px rgba(91, 155, 213, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: all 0.3s ease;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* 夜间模式变量 */
.night-mode {
    --bg: #0D1117;
    --bg-card: #161B22;
    --text: #E6EDF3;
    --text-secondary: #8B949E;
    --text-light: #6E7681;
    --border: #30363D;
    --shadow: 0 2px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 4px 24px rgba(0,0,0,0.5);
}

/* 基础重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg);
}

.app-shell {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    overflow-x: hidden;
    box-shadow: none;
}

/* ========== 顶部状态栏 ========== */
.app-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    padding: env(safe-area-inset-top) 12px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    min-height: 36px;
}

.header-left, .header-right {
    width: auto;
    min-width: 60px;
    display: flex;
    align-items: center;
}

.header-left {
    justify-content: flex-start;
    padding-left: 12px;
}

.header-right {
    justify-content: flex-end;
    gap: 10px;
    padding-right: 12px;
}

.header-back {
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
}

.header-back:active {
    background: rgba(255,255,255,0.2);
}

.header-title {
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    letter-spacing: 0.3px;
}

.header-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
    flex-shrink: 0;
}

.vip-badge {
    background: var(--vip-gradient);
    color: #7B5B00;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    letter-spacing: 0.5px;
}

/* 只在首页显示顶部状态栏，其他页面隐藏 */
.app-header {
    display: none;
    transform: translateY(-100%);
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.home-active .app-header {
    display: flex;
    transform: translateY(0);
}

/* 首页内容顶部留白由 .page-container 的 padding-top 统一处理 */

/* 首页标题栏高度CSS变量，动态避免遮挡宝贝信息栏（纯CSS方案 + JS兜底） */
.home-active .page-container {
    /* safe-area-inset-top: iPhone刘海屏约47-59px，普通屏约20-24px */
    /* 标题栏内容高度约50-56px（含padding），继续减小padding-top让内容上移 */
    padding-top: calc(env(safe-area-inset-top, 20px) + 20px);
    /* JS动态更新此值作为微调兜底 */
    --header-h: calc(env(safe-area-inset-top, 20px) + 20px);
}


/* 记录/统计导航SVG图标 */
.nav-icon-record,
.nav-icon-stats {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.nav-icon-record svg,
.nav-icon-stats svg {
    width: 22px;
    height: 22px;
}
.nav-item.active .nav-icon-record,
.nav-item.active .nav-icon-stats {
    transform: scale(1.12);
}
.nav-item.active .nav-icon-record svg,
.nav-item.active .nav-icon-stats svg {
    stroke: #2192EB;
}
/* 非首页顶部安全空白栏，防止被手机状态栏遮挡 */
.safe-area-top {
    width: 100%;
    height: env(safe-area-inset-top, 24px);
    min-height: 24px;
    background: var(--bg);
    flex-shrink: 0;
}

/* 各页面顶部安全栏跟随页面背景色 */
.page-record .safe-area-top { background: linear-gradient(180deg, #F7FAFC 0%, #F7FAFC 100%); }
.page-stats .safe-area-top { background: linear-gradient(180deg, #F5F8FA 0%, #F5F8FA 100%); }
.page-ai .safe-area-top { background: linear-gradient(180deg, #FFF8FA 0%, #FFF8FA 100%); }
.page-mine .safe-area-top { background: var(--bg); }

.night-mode .page-record .safe-area-top,
.night-mode .page-stats .safe-area-top,
.night-mode .page-ai .safe-area-top,
.night-mode .page-mine .safe-area-top {
    background: var(--bg);
}

/* 页面容器：绝对定位填满 app-shell，底部留出导航栏空间 */
.page-container {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 82px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg);
}
.page-container.active {
    display: block;
    opacity: 1;
    animation: pageFadeIn 0.32s ease-out forwards;
}

/* ===== 各页面独立背景 ===== */
/* 首页：柔和天蓝白 */
.page-home.active {
    background: linear-gradient(180deg, #B1E0F6 0%, #FFE4EC 50%, #FAC1D7 100%);
}
/* 记录页：清透冷白 */
.page-record.active {
    background: linear-gradient(180deg, #F7FAFC 0%, #F0F4F8 50%, #F5F8FA 100%);
}
/* 统计页：浅灰白 clean */
.page-stats.active {
    background: linear-gradient(180deg, #F5F8FA 0%, #EEF4F8 50%, #F0F5FA 100%);
}
/* AI顾问页：浅粉紫暖调 */
.page-ai.active {
    background: linear-gradient(180deg, #FFF8FA 0%, #FFF0F5 40%, #F8F0FF 100%);
}
/* 知识库页：薄荷绿白 */
.page-knowledge.active {
    background: linear-gradient(180deg, #F0FAF5 0%, #E8F5EE 50%, #F0FFF8 100%);
}
/* AI顾问页：flex布局，输入框始终贴在底部 */
.page-ai.active {
    display: flex !important;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    animation: pageFadeIn 0.32s ease-out forwards;
}
/* 聊天消息区：占满剩余空间并独立滚动 */
.page-ai .ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 0 16px 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.page-ai .ai-chat-messages::-webkit-scrollbar { display: none; }
/* AI输入框：默认隐藏，仅在AI顾问页内显示，不用fixed定位 */
#aiInputBar {
    display: none;
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    max-width: 100%;
    margin: 0;
    z-index: auto;
    flex-shrink: 0;
}
.page-ai.active #aiInputBar {
    display: flex !important;
}

/* 首页有顶部状态栏时，内容下移 */
.home-active .page-home {
    top: calc(48px + env(safe-area-inset-top));
}
.sub-page {
    display: none;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 82px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg);
    z-index: 50;
}

.sub-page.active {
    display: block;
}

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


/* 首页导航SVG图标 */
.nav-icon-home {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.nav-icon-home svg {
    width: 22px;
    height: 22px;
}
.nav-item.active .nav-icon-home {
    transform: scale(1.12);
}
.nav-item.active .nav-icon-home svg {
    stroke: #2192EB;
}
/* ========== 底部导航 ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    max-width: 480px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 0 var(--safe-bottom);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 12px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.nav-item .nav-icon {
    font-size: 22px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-mascot-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    transition: var(--transition);
}

.nav-item.active .nav-mascot-icon {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(255, 150, 170, 0.3);
}

.nav-item .nav-label {
    font-size: 11px;
    color: var(--text-light);
    transition: var(--transition);
}

.nav-item.active .nav-label {
    color: #2192EB;
    font-weight: 700;
}

.nav-item.active .nav-icon {
    transform: scale(1.12);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -6px;
    width: 24px;
    height: 3px;
    background: #2192EB;
    border-radius: 0 0 3px 3px;
}

.nav-item:active {
    opacity: 0.85;
}

.nav-item.active {
    background: linear-gradient(180deg, rgba(91,155,213,0.08), transparent);
    border-radius: 14px;
}

/* ========== 天气日期时间栏 ========== */
.weather-bar {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}

.weather-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.weather-icon {
    font-size: 28px;
}

.weather-temp {
    font-size: 22px;
    font-weight: 700;
    color: #1565C0;
}

.weather-desc {
    font-size: 13px;
    color: #5A7D9A;
}

.weather-right {
    text-align: right;
}

.weather-date {
    font-size: 14px;
    font-weight: 600;
    color: #2C3E50;
}

.weather-time {
    font-size: 24px;
    font-weight: 300;
    color: #1565C0;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

/* 夜间天气栏 */
.night-mode .weather-bar {
    background: linear-gradient(135deg, #161B22, #1C2128);
}

.night-mode .weather-temp {
    color: #64B5F6;
}

.night-mode .weather-desc {
    color: #8899A6;
}

.night-mode .weather-date {
    color: #E1E8ED;
}

.night-mode .weather-time {
    color: #64B5F6;
}
.baby-card {
    background: linear-gradient(135deg, #FFF8E1, #FFECB3);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    position: relative;
}

.baby-card:active {
    transform: scale(0.98);
}

.baby-avatar {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.baby-info {
    flex: 1;
}

.baby-name {
    font-size: 18px;
    font-weight: 700;
    color: #6D4C00;
}

.baby-meta {
    font-size: 13px;
    color: #9A7B2C;
    margin-top: 2px;
}

.baby-arrow {
    font-size: 24px;
    color: #9A7B2C;
}

/* 宝宝卡片右上角按钮组 */
.baby-card-actions {
    position: absolute;
    bottom: 18px;
    right: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.growth-icon-btn,
.sleep-icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 2px 10px rgba(0,0,0,0.10);
    cursor: pointer;
    transition: all 0.25s ease;
}

.growth-svg-icon {
    width: 26px;
    height: 26px;
    color: #7dd3c0;
}

.growth-icon-label {
    font-size: 10px;
    color: #666;
    font-weight: 600;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.sleep-svg-icon {
    width: 26px;
    height: 26px;
    color: #b088f9;
}

.sleep-icon-label {
    font-size: 10px;
    color: #666;
    font-weight: 600;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.growth-icon-btn:active,
.sleep-icon-btn:active {
    transform: scale(0.92);
    background: #f8f9fa;
}

.night-mode .growth-icon-btn,
.night-mode .sleep-icon-btn {
    background: #2d3748;
    border-color: rgba(255,255,255,0.08);
}
.night-mode .growth-icon-label,
.night-mode .sleep-icon-label {
    color: #e2e8f0;
}

/* ========== 生长发育卡片（首页） ========== */
.growth-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 14px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    position: relative;
}

.growth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 20px 20px 0 0;
}

.growth-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    background: linear-gradient(135deg, rgba(102,126,234,0.04) 0%, rgba(118,75,162,0.04) 100%);
    border-bottom: 1px solid rgba(102,126,234,0.08);
}

.growth-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 6px;
}

.growth-card-link {
    font-size: 13px;
    color: #667eea;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 8px;
}

.growth-card-link:hover {
    background: rgba(102,126,234,0.1);
}

.growth-card-link:active {
    transform: scale(0.96);
}

.growth-card-body {
    padding: 16px 18px 18px;
    min-height: 60px;
}

.growth-empty {
    text-align: center;
    padding: 20px 0;
    color: #a0aec0;
    font-size: 13px;
}

.growth-empty-icon {
    font-size: 36px;
    margin-bottom: 8px;
    opacity: 0.6;
}

.growth-empty-text {
    font-size: 13px;
    color: #a0aec0;
}

/* 生长数据指标行 */
.growth-metric {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f7fafc;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.growth-metric:last-child {
    margin-bottom: 0;
}

.growth-metric:hover {
    background: #edf2f7;
    transform: translateX(2px);
}

.growth-metric-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 12px;
    flex-shrink: 0;
}

.growth-metric-icon.weight {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.growth-metric-icon.height {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.growth-metric-icon.head {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

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

.growth-metric-label {
    font-size: 12px;
    color: #718096;
    margin-bottom: 2px;
    font-weight: 500;
}

.growth-metric-value {
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.growth-metric-unit {
    font-size: 12px;
    color: #a0aec0;
    font-weight: 500;
}

.growth-metric-percentile {
    font-size: 11px;
    color: #667eea;
    font-weight: 600;
    background: rgba(102,126,234,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* 夜间模式 */
.night-mode .growth-card {
    background: #2d3748;
    border-color: rgba(102,126,234,0.2);
}

.night-mode .growth-card-header {
    background: linear-gradient(135deg, rgba(102,126,234,0.1) 0%, rgba(118,75,162,0.1) 100%);
    border-bottom-color: rgba(102,126,234,0.15);
}

.night-mode .growth-card-title {
    color: #e2e8f0;
}

.night-mode .growth-card-link {
    color: #90cdf4;
}

.night-mode .growth-card-body {
    background: #2d3748;
}

.night-mode .growth-empty-text {
    color: #718096;
}

.night-mode .growth-metric {
    background: #4a5568;
}

.night-mode .growth-metric:hover {
    background: #5a6578;
}

.night-mode .growth-metric-label {
    color: #a0aec0;
}

.night-mode .growth-metric-value {
    color: #e2e8f0;
}

.night-mode .growth-metric-unit {
    color: #718096;
}

.night-mode .growth-metric-percentile {
    color: #90cdf4;
    background: rgba(144,205,244,0.15);
}

/* ========== 今日概览 ========== */
.section-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.overview-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.overview-item:active {
    transform: scale(0.95);
}

.overview-icon {
    font-size: 26px;
    margin-bottom: 6px;
}

.overview-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
}

.overview-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ========== 快捷记录按钮 ========== */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.quick-btn {
    padding: 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: white;
}

.quick-btn:active {
    transform: scale(0.95);
}

/* 夜间模式快捷按钮 - 莫兰迪配色 */
.night-mode .feed-btn { background: linear-gradient(135deg, #7BA8C4, #9DBFD4); }
.night-mode .sleep-btn { background: linear-gradient(135deg, #A093B8, #B8A9CC); }
.night-mode .diaper-btn { background: linear-gradient(135deg, #C4B47A, #D4C998); color: #4A3A1A; }
.night-mode .temp-btn { background: linear-gradient(135deg, #6DA89E, #8FBFB8); }

.feed-btn { background: linear-gradient(135deg, #2192EB, #B1E0F6); }
.sleep-btn { background: linear-gradient(135deg, #A18CD1, #C4B5E0); }
.diaper-btn { background: linear-gradient(135deg, #F9A825, #FFCC02); color: #5D3A1A; }
.temp-btn { background: linear-gradient(135deg, #26A69A, #80CBC4); }

/* ========== AI日报卡片 ========== */
.ai-daily-card, .ai-weekly-card {
    background: linear-gradient(135deg, #2192EB, #FAC1D7);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    color: white;
    margin-bottom: 12px;
}

.ai-daily-icon, .ai-weekly-icon {
    font-size: 32px;
}

.ai-daily-text, .ai-weekly-text {
    flex: 1;
}

.ai-daily-title, .ai-weekly-title {
    font-size: 15px;
    font-weight: 600;
}

.ai-daily-desc, .ai-weekly-desc {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

.vip-lock {
    font-size: 18px;
}

/* ========== 记录页 ========== */
.record-tabs {
    display: flex;
    gap: 6px;
    padding: 12px 16px 8px;
    background: transparent;
}

.record-tab {
    flex: 1;
    padding: 14px 8px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    background: var(--bg-card);
    box-shadow: var(--shadow);
}

.record-tab.active {
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    color: white;
    font-weight: 600;
}

.record-form {
    padding: 4px 16px 100px;
}

.record-form-card {
    background: var(--bg-card);
    border-radius: 18px;
    padding: 20px 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.record-form-card .form-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 18px;
}

.record-form-card label {
    display: block;
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
}

.record-form-card input[type="number"],
.record-form-card input[type="time"] {
    width: 100%;
    max-width: 200px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 2px solid var(--border);
    font-size: 14px;
    outline: none;
    background: var(--bg);
    color: var(--text);
}

.record-form-card input[type="number"]::placeholder,
.record-form-card input[type="time"]::placeholder {
    color: var(--text-light);
}

.record-form-card .form-option {
    flex: 1;
    padding: 16px 8px;
    border-radius: 14px;
    border: 2px solid var(--border);
    background: var(--bg);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.record-form-card .form-option.active {
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    color: white;
    border-color: transparent;
}

.record-form-card .form-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.record-form-card .form-actions .photo-btn,
.record-form-card .form-actions .secondary-btn {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    border: 2px solid var(--border);
    background: var(--bg);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.record-form-card .form-actions .save-btn {
    flex: 2;
    padding: 18px;
    border-radius: 14px;
    border: none;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.record-form-card .sleep-toggle-btn {
    width: 100%;
    padding: 18px;
    border-radius: 16px;
    border: 2px solid #2192EB;
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(123, 104, 238, 0.25);
}

.record-form-card .sleep-timer-box {
    display: none;
    margin-top: 16px;
    text-align: center;
    padding: 22px;
    background: var(--bg);
    border-radius: 16px;
    border: 2px solid var(--border);
}

.record-form-card .sleep-timer-box.active {
    display: block;
}

.record-form-card .sleep-duration {
    font-size: 32px;
    font-weight: 800;
    color: var(--text);
}

.record-form-card .sleep-start-time {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 6px;
}

.record-form-card .sleep-status-text {
    font-size: 15px;
    color: var(--text-light);
    margin: 8px 0 14px;
}

/* 记录页夜间模式 */
.night-mode .record-tab:not(.active) {
    background: var(--bg-card) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border) !important;
}

.night-mode .record-tab.active {
    color: #fff !important;
}

.night-mode .record-form-card {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
    box-shadow: var(--shadow) !important;
}

.night-mode .record-form-card .form-title,
.night-mode .record-form-card label,
.night-mode .record-form-card .sleep-status-text {
    color: var(--text) !important;
}

.night-mode .record-form-card input[type="number"],
.night-mode .record-form-card input[type="time"] {
    background: var(--bg) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.night-mode .record-form-card .form-option:not(.active) {
    background: var(--bg) !important;
    border-color: var(--border) !important;
    color: var(--text-secondary) !important;
}

.night-mode .record-form-card .form-option.active {
    background: var(--bg) !important;
    color: var(--text) !important;
    border-color: var(--primary) !important;
}

.night-mode .record-form-card .form-actions .photo-btn,
.night-mode .record-form-card .form-actions .secondary-btn {
    background: var(--bg) !important;
    border-color: var(--border) !important;
    color: var(--text-secondary) !important;
}

.night-mode .record-form-card .sleep-timer-box {
    background: var(--bg) !important;
    border-color: var(--border) !important;
}

.night-mode .record-form-card .sleep-duration {
    color: var(--text) !important;
}

.night-mode .record-form-card .sleep-start-time {
    color: var(--text-light) !important;
}

/* 语音录入条 */
.voice-record-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.voice-btn {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    user-select: none;
    -webkit-user-select: none;
}

.voice-btn:active, .voice-btn.recording {
    background: linear-gradient(135deg, #E55, #F44);
    transform: scale(0.97);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,107,0.4); }
    50% { box-shadow: 0 0 0 12px rgba(255,107,107,0); }
}

.voice-limit {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
}

/* ========== 记录面板 ========== */
.record-panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.record-panel.active {
    display: block;
}

/* 喂养类型选择 */
.feed-type-select {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.feed-type-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.feed-type-btn.active {
    border-color: #2192EB;
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    color: white;
    font-weight: 600;
}

/* 母乳计时 */
.breast-side {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.side-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.side-btn.active {
    border-color: #2192EB;
    background: #FAC1D7;
    color: #2C3E50;
    font-weight: 600;
}

.timer-display {
    text-align: center;
    font-size: 48px;
    font-weight: 300;
    color: #2192EB;
    margin: 16px 0;
    font-variant-numeric: tabular-nums;
}

.timer-btn {
    width: 100%;
    padding: 14px;
    background: #2192EB;
    color: white;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.timer-btn.running {
    background: var(--danger);
}

/* 奶瓶输入 */
.amount-input {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin: 12px 0;
}

.amount-input button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: white;
    font-size: 20px;
    cursor: pointer;
    color: var(--primary);
    transition: var(--transition);
}

.amount-input button:active {
    background: var(--primary-light);
}

.amount-input input {
    width: 100px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    border: none;
    background: var(--bg);
    border-radius: var(--radius-xs);
    padding: 8px;
    color: var(--primary-dark);
}

.quick-amounts {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 12px 0;
}

.quick-amounts span {
    padding: 6px 14px;
    background: var(--bg);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.quick-amounts span.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

/* 睡眠卡片 */
.sleep-card {
    text-align: center;
    padding: 24px;
}

.sleep-status {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.sleep-toggle-btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, #A18CD1, #C4B5E0);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.sleep-toggle-btn.sleeping {
    background: linear-gradient(135deg, #43E97B, #38F9D7);
    color: #1A5C3A;
}

.sleep-duration {
    font-size: 36px;
    font-weight: 300;
    color: var(--primary-dark);
    margin: 12px 0;
}

.sleep-start {
    font-size: 13px;
    color: var(--text-light);
}

/* 排泄 */
.diaper-type {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.diaper-type-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.diaper-type-btn.active {
    border-color: #FCCB90;
    background: #FFF3E0;
    font-weight: 600;
}

.poop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 10px 0 16px;
}

.poop-option {
    text-align: center;
    padding: 12px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition);
}

.poop-option.active {
    border-color: #FCCB90;
    background: #FFF3E0;
}

.poop-emoji {
    font-size: 24px;
    margin-bottom: 4px;
}

.poop-option span {
    font-size: 11px;
    color: var(--text-secondary);
}

/* 健康记录 */
.health-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.health-tab {
    padding: 8px 14px;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: var(--bg);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.health-tab.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.quick-temps {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.quick-temps span {
    padding: 8px 16px;
    background: var(--bg);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.quick-temps span.warn {
    background: #FFF3E0;
    color: #E65100;
}

.quick-temps span.danger {
    background: #FFEBEE;
    color: #C62828;
}

/* ========== 通用表单 ========== */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.input-group input, .input-group textarea, .input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 15px;
    background: var(--bg);
    transition: var(--transition);
    color: var(--text);
    font-family: inherit;
}

.input-group input:focus, .input-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    background: white;
}

.input-group textarea {
    min-height: 80px;
    resize: vertical;
}

.input-row {
    display: flex;
    gap: 12px;
}

.input-row .input-group {
    flex: 1;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    color: white;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.submit-btn:active {
    transform: scale(0.98);
}

.camera-btn {
    width: 100%;
    padding: 12px;
    background: var(--bg);
    border: 2px dashed var(--primary);
    border-radius: var(--radius-xs);
    color: var(--primary-dark);
    font-size: 14px;
    cursor: pointer;
    margin-top: 10px;
    transition: var(--transition);
}

.camera-btn:active {
    background: var(--primary-light);
}

/* ========== 数据统计页 ========== */
.stats-header h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

.period-select {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.period-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.period-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.stats-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.stats-card h3 {
    font-size: 15px;
    margin-bottom: 12px;
}

.chart-placeholder {
    height: 180px;
    background: var(--bg);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 14px;
    border: 2px dashed var(--border);
}

/* PDF导出 */
.pdf-export-card {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.pdf-icon { font-size: 36px; }

.pdf-info { flex: 1; }

.pdf-title {
    font-size: 15px;
    font-weight: 600;
    color: #2E7D32;
}

.pdf-desc {
    font-size: 12px;
    color: #4CAF50;
    margin-top: 2px;
}

.pdf-export-btn {
    padding: 10px 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.pdf-export-btn:active { transform: scale(0.95); }

/* ========== AI助手页 ========== */
.ai-chat-header {
    background: linear-gradient(135deg, #FFB5C2, #FFD6E0, #E8D5F5);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #6B3A5A;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(255, 181, 194, 0.3);
    position: relative;
    overflow: hidden;
}

.ai-chat-header::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -10px;
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
}

.ai-chat-header::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 60px;
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
}

.ai-avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFF0F3, #FFE0E8);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(255, 150, 170, 0.3);
    border: 2px solid white;
    flex-shrink: 0;
    z-index: 1;
    overflow: hidden;
}

.ai-mascot-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.ai-avatar-face {
    font-size: 28px;
    animation: aiBounce 2s ease-in-out infinite;
}

@keyframes aiBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    30% { transform: translateY(-6px) scale(1.1); }
    50% { transform: translateY(0) scale(1); }
    70% { transform: translateY(-3px) scale(1.05); }
}

.ai-intro { z-index: 1; }

.ai-name { font-size: 16px; font-weight: 700; color: #6B3A5A; }

.ai-quota { font-size: 11px; opacity: 0.7; margin-top: 3px; color: #8B5E7A; }

.ai-chat-messages {
    min-height: 280px;
    max-height: 380px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.ai-welcome {
    text-align: center;
    padding: 28px 20px;
    background: linear-gradient(180deg, #FFF8FA, #FFF0F5);
    border-radius: 20px;
    border: 2px dashed #FFD6E0;
    box-shadow: 0 2px 12px rgba(255, 200, 210, 0.15);
}

.ai-welcome-icon { 
    font-size: 52px; 
    margin-bottom: 10px; 
    animation: aiBounce 2s ease-in-out infinite;
    display: inline-block;
}

.ai-welcome-mascot {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(255, 150, 170, 0.3);
}

.ai-welcome-title {
    font-size: 18px;
    font-weight: 700;
    color: #C75C5C;
    margin-bottom: 12px;
}

.ai-welcome-text p {
    color: #8B6B7A;
    font-size: 14px;
    margin-bottom: 6px;
    line-height: 1.6;
}

.ai-welcome-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 16px 0;
}

.ai-feature-item {
    padding: 6px 14px;
    background: white;
    border-radius: 14px;
    font-size: 13px;
    color: #C75C5C;
    border: 1.5px solid #FFD6E0;
    font-weight: 500;
    transition: all 0.2s;
}

.ai-feature-item:active {
    background: #FFF0F3;
    transform: scale(0.95);
}

.ai-disclaimer {
    background: #FFF8E1;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 12px;
    color: #E6A817;
    margin-top: 14px;
    text-align: left;
    line-height: 1.5;
    border: 1px solid #FFE082;
}

.ai-quick-questions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    justify-content: center;
}

.ai-quick-questions span {
    padding: 10px 18px;
    background: linear-gradient(135deg, #FFF5F7, #FFE8EE);
    border: 1.5px solid #FFCCD5;
    border-radius: 22px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    color: #C75C5C;
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(255, 180, 200, 0.15);
}

.ai-quick-questions span:active {
    background: linear-gradient(135deg, #FFB5C2, #FFD6E0);
    border-color: #FF9AB2;
    color: white;
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(255, 150, 170, 0.3);
}

.ai-input-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    background: white;
    padding: 8px 12px;
    border-radius: 28px;
    border: 2px solid #FFD6E0;
    box-shadow: 0 2px 12px rgba(255, 200, 210, 0.2);
    margin-top: 4px;
}

.ai-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--text);
    background: transparent;
    padding: 4px 0;
}

.ai-input::placeholder { color: #CCB0BB; }

.ai-camera-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #FFB5C2, #FF9AB2);
    color: white;
    font-size: 22px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(255, 150, 170, 0.35);
}

.ai-voice-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #FAC1D7, #B1E0F6);
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(126, 200, 227, 0.35);
}

.ai-voice-btn.recording {
    animation: voiceBtnPulse 1.2s ease-in-out infinite;
}

@keyframes voiceBtnPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 2px 8px rgba(126, 200, 227, 0.3); }
    50% { transform: scale(1.08); box-shadow: 0 4px 14px rgba(126, 200, 227, 0.5); }
}

.ai-voice-btn:active { transform: scale(0.9); }

.ai-camera-btn:active { transform: scale(0.9); }

.ai-send-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #FF9AB2, #FF6B8A);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 107, 138, 0.3);
}

.ai-send-btn:active { transform: scale(0.95); opacity: 0.9; }

/* ========== AI聊天消息气泡 ========== */
/* AI聊天消息 */
.ai-message {
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
}

.ai-message.user {
    flex-direction: row-reverse;
}

.ai-message-bubble {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.55;
}

.ai-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    overflow: hidden;
}

.ai-message.assistant .ai-message-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.ai-message.user .ai-message-bubble {
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    color: white;
    border-bottom-right-radius: 4px;
}

/* AI顾问页 - 水平头部布局 */
.ai-page-header {
    padding: 16px 16px 0;
    flex-shrink: 0;
}

.ai-header-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 14px;
}

.ai-header-avatar-wrap {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0f4ff, #e8f0fe);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.ai-header-avatar-wrap img {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 50%;
}

.ai-header-meta {
    flex: 1;
    min-width: 0;
}

.ai-header-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.ai-header-quota {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 3px;
}

.ai-header-voice {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #ffe0eb;
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.ai-header-voice:active {
    transform: scale(0.92);
    background: #fff5f8;
}

.ai-header-voice.active svg {
    stroke: #FF6B8A;
    fill: #FF6B8A;
}

.ai-quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.ai-quick-tag {
    font-size: 12px;
    padding: 7px 14px;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.ai-quick-tag:hover,
.ai-quick-tag:active {
    transform: scale(0.95);
    background: #f5f9ff;
}

.ai-quick-tag.tag-blue { color: var(--primary); }
.ai-quick-tag.tag-purple { color: #2192EB; }
.ai-quick-tag.tag-orange { color: #F5A623; }
.ai-quick-tag.tag-green { color: var(--success); }

.ai-welcome-bubble {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 14px;
}

.ai-welcome-bubble-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.ai-welcome-bubble-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 12px;
}

.ai-try-voice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #FFF0F5, #FFE4EC);
    color: #A61E5A;
    border-radius: 18px;
    cursor: pointer;
    border: 1px solid #FFD6E5;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.ai-try-voice:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, #FFD6E5, #FFC2D6);
}

.ai-feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.ai-feature-grid .ai-feature-item {
    font-size: 12px;
    padding: 10px;
    text-align: center;
    background: #f8f9ff;
    border-radius: var(--radius-sm);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.ai-feature-grid .ai-feature-item:nth-child(2) { background: #f8f7ff; color: #2192EB; }
.ai-feature-grid .ai-feature-item:nth-child(3) { background: #fff9f0; color: #F5A623; }
.ai-feature-grid .ai-feature-item:nth-child(4) { background: #f0fff4; color: var(--success); }

.ai-feature-grid .ai-feature-item:active {
    transform: scale(0.96);
    border-color: var(--border);
}

.ai-disclaimer {
    font-size: 11px;
    color: var(--text-light);
    padding: 10px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    line-height: 1.6;
}

/* AI语音通话浮层 */
.ai-voice-overlay {
    display: none;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid #ffe0eb;
    z-index: 10000;
    text-align: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 48px);
    max-width: 320px;
}

.ai-voice-overlay.active {
    display: block;
    animation: voiceOverlayIn 0.28s ease-out;
}

@keyframes voiceOverlayIn {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.ai-voice-avatar-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #FFC2D6;
    box-shadow: 0 4px 16px rgba(255, 194, 214, 0.5);
    margin: 0 auto 14px;
}

.ai-voice-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-voice-hint {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 18px;
}

.ai-voice-waves {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 36px;
}

.ai-voice-wave {
    width: 4px;
    border-radius: 2px;
    background: linear-gradient(180deg, #FFC2D6, #FF9EBB);
}

.ai-voice-wave:nth-child(1) { animation: bar1 0.8s ease-in-out infinite; height: 14px; }
.ai-voice-wave:nth-child(2) { animation: bar2 0.8s ease-in-out infinite; height: 20px; }
.ai-voice-wave:nth-child(3) { animation: bar3 0.8s ease-in-out infinite; height: 16px; }
.ai-voice-wave:nth-child(4) { animation: bar4 0.8s ease-in-out infinite; height: 22px; }
.ai-voice-wave:nth-child(5) { animation: bar5 0.8s ease-in-out infinite; height: 12px; }

/* 夜间模式适配 */
.night-mode .ai-header-card,
.night-mode .ai-welcome-bubble,
.night-mode .ai-voice-overlay {
    background: var(--bg-card);
    border-color: var(--border);
}

.night-mode .ai-header-avatar-wrap {
    background: #2a3a50;
}

.night-mode .ai-quick-tag {
    background: var(--bg-card);
    border-color: var(--border);
}

.night-mode .ai-try-voice {
    background: linear-gradient(135deg, #3a2a35, #4a303d);
    border-color: #5a3a4d;
    color: #ffb5c5;
}

.night-mode .ai-feature-grid .ai-feature-item:nth-child(1) { background: #1a2a40; color: #8ab4e8; }
.night-mode .ai-feature-grid .ai-feature-item:nth-child(2) { background: #252040; color: #b0a0f0; }
.night-mode .ai-feature-grid .ai-feature-item:nth-child(3) { background: #2a2520; color: #f0c070; }
.night-mode .ai-feature-grid .ai-feature-item:nth-child(4) { background: #1a3020; color: #90e0a0; }

.night-mode .ai-disclaimer {
    background: rgba(255,255,255,0.05);
    color: var(--text-light);
}


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

.knowledge-header h2 { font-size: 20px; }

.knowledge-ai-entry {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    color: white;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.knowledge-section { margin-bottom: 20px; }

.knowledge-section-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

.article-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.article-item:active { transform: scale(0.98); }

.article-item.locked { opacity: 0.7; }

.article-icon { font-size: 28px; }

.article-info { flex: 1; }

.article-title {
    font-size: 14px;
    font-weight: 600;
}

.article-desc {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.article-badge {
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.article-badge.free {
    background: #E8F5E9;
    color: #2E7D32;
}

.article-badge.vip {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #7B5B00;
}

.disclaimer {
    background: #FFF8E1;
    padding: 12px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    color: #F57F17;
    text-align: center;
    margin-top: 16px;
}

/* ========== 我的页面 ========== */
.member-card {
    background: linear-gradient(135deg, #FFF8E1, #FFECB3);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    margin-bottom: 16px;
    transition: var(--transition);
}

.member-avatar {
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.member-info { flex: 1; }

.member-name { font-size: 17px; font-weight: 600; color: #6D4C00; }

.member-status { font-size: 13px; color: #9A7B2C; margin-top: 2px; }

.member-arrow { font-size: 24px; color: #9A7B2C; }

/* 菜单列表 */
.menu-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.menu-item {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.menu-item:last-child { border-bottom: none; }

.menu-item:active { background: var(--bg); }

.menu-icon { font-size: 20px; }

.menu-item > span:nth-child(2) { flex: 1; }

.menu-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
}

.menu-badge.hot { background: #FFEBEE; color: #C62828; }
.menu-badge.new { background: #E8F5E9; color: #2E7D32; }

.vip-lock-small { font-size: 12px; }

.menu-arrow { color: var(--text-light); }

.app-version {
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
    padding: 20px 0;
}

/* ========== 子页面通用 ========== */
.sub-page-header {
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.back-btn:active { background: rgba(255,255,255,0.3); }

.form-card {
    padding: 20px;
    margin: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.avatar-upload {
    text-align: center;
    padding: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
}

.avatar-preview {
    width: 72px;
    height: 72px;
    background: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 8px;
    border: 3px dashed var(--border);
}

.gender-select {
    display: flex;
    gap: 10px;
}

.gender-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.gender-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: white;
    font-weight: 600;
}

.privacy-note {
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
    margin-top: 12px;
}

/* ========== 智能提醒 ========== */
.reminder-list {
    padding: 16px;
}

.reminder-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}

.reminder-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reminder-icon { font-size: 28px; }

.reminder-name { font-size: 14px; font-weight: 600; }

.reminder-time { font-size: 12px; color: var(--text-light); }

/* Toggle开关 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #CCC;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider { background: var(--primary); }
input:checked + .toggle-slider::before { transform: translateX(20px); }
input:disabled + .toggle-slider { opacity: 0.5; cursor: not-allowed; }

.pause-all-btn {
    display: block;
    margin: 20px auto;
    padding: 12px 24px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 24px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.pause-all-btn:active { background: var(--bg); }

/* ========== 会员中心 ========== */
.vip-hero {
    text-align: center;
    padding: 32px 16px;
    background: linear-gradient(135deg, #FFF8E1, #FFE082);
}

.vip-crown { font-size: 56px; margin-bottom: 8px; }

.vip-hero h2 { font-size: 20px; color: #7B5B00; }

.vip-hero p { font-size: 14px; color: #8D6E00; margin-top: 4px; }

.vip-plans {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vip-plan {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.vip-plan.recommended {
    border-color: #FFD700;
    background: linear-gradient(135deg, #FFFDE7, #FFF9C4);
    transform: scale(1.02);
}

.plan-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
    color: white;
}

.plan-badge.best {
    background: linear-gradient(135deg, #2192EB, #2192EB);
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plan-name { font-size: 16px; font-weight: 600; }

.plan-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
}

.plan-price small { font-size: 13px; font-weight: 400; color: var(--text-light); }

.plan-save {
    font-size: 12px;
    color: var(--success);
    margin-top: 4px;
}

.vip-benefits {
    padding: 0 16px 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.page-ai .ai-chat-messages::-webkit-scrollbar { display: none; }

.vip-benefits h3 { font-size: 16px; margin-bottom: 12px; }

.benefit-item {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.benefit-item:last-child { border-bottom: none; }

.vip-subscribe-btn {
    display: block;
    margin: 16px;
    padding: 16px;
    width: calc(100% - 32px);
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #7B5B00;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.vip-subscribe-btn:active { transform: scale(0.98); }

/* ========== 成长相册 ========== */
.album-grid {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.album-add {
    aspect-ratio: 1;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-light);
}

.album-add-icon { font-size: 32px; }

.album-add span { font-size: 12px; margin-top: 4px; }

/* ========== 家人协同 ========== */
.family-list { padding: 16px; }

.family-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}

.family-avatar { font-size: 32px; }

.family-info { flex: 1; }

.family-name { font-size: 14px; font-weight: 600; }

.family-role { font-size: 12px; color: var(--text-light); }

.family-permission {
    font-size: 12px;
    padding: 4px 10px;
    background: var(--bg);
    border-radius: 10px;
    color: var(--text-secondary);
}

.family-item.admin .family-permission {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #7B5B00;
}

.invite-btn {
    display: block;
    margin: 16px;
    padding: 14px;
    width: calc(100% - 32px);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

/* ========== 好物商城 ========== */
.shop-grid {
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.shop-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.shop-item:active { transform: scale(0.97); }

.shop-img { font-size: 48px; margin-bottom: 8px; }

.shop-name { font-size: 14px; font-weight: 600; }

.shop-price {
    font-size: 13px;
    color: var(--danger);
    font-weight: 600;
    margin-top: 4px;
}

/* ========== 系统设置 ========== */
.settings-list {
    padding: 16px;
}

.setting-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
    font-size: 14px;
}

.setting-desc {
    font-size: 12px;
    color: var(--text-light);
    flex: 1;
}

.clear-btn {
    padding: 6px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 13px;
    cursor: pointer;
    color: var(--text-secondary);
}

/* ========== 模态层 ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 82px;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    position: fixed;
    bottom: 82px;
    left: 50%;
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border-radius: var(--radius) var(--radius) 0 0;
    z-index: 201;
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1),
                opacity 0.3s ease,
                visibility 0.35s ease;
}

.modal-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Toast */
.toast {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 300;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show { opacity: 1; }

/* 隐私弹窗 */
.privacy-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.privacy-modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    max-width: 340px;
    width: 100%;
}

.privacy-modal-icon { font-size: 48px; margin-bottom: 12px; }

.privacy-modal-content h3 { font-size: 17px; margin-bottom: 8px; }

.privacy-modal-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.privacy-modal-btns {
    display: flex;
    gap: 12px;
}

.privacy-deny, .privacy-agree {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.privacy-deny {
    background: var(--bg);
    color: var(--text-secondary);
}

.privacy-agree {
    background: var(--primary);
    color: white;
}

/* 夜间模式指示器 */
.night-mode-indicator {
    position: fixed;
    top: 48px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26,26,46,0.9);
    color: #FFD700;
    padding: 6px 16px;
    border-radius: 0 0 12px 12px;
    font-size: 12px;
    z-index: 99;
    text-align: center;
    width: max-content;
    max-width: 90vw;
}

/* 空状态 */
.empty-state {
    text-align: center;
    color: var(--text-light);
    padding: 24px;
    font-size: 14px;
}

/* 滚动条 */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* 夜间模式适配 */
.night-mode .ai-welcome { background: linear-gradient(180deg, #2A2030, #252030); border-color: #4A3050; }
.night-mode .ai-welcome-title { color: #FF9AB2; }
.night-mode .ai-welcome-text p { color: #C0A0B0; }
.night-mode .ai-feature-item { background: #2A2030; border-color: #4A3050; color: #FF9AB2; }
.night-mode .ai-quick-questions span { background: #2A2030; border-color: #4A3050; color: #C090A0; }
.night-mode .ai-quick-questions span:active { background: #4A3040; color: #FF9AB2; border-color: #6A4050; }
.night-mode .ai-disclaimer { background: #332A00; color: #FFD54F; border-color: #554400; }
.night-mode .ai-input-bar { background: #252030; border-color: #4A3050; box-shadow: 0 2px 12px rgba(74, 48, 80, 0.2); }
.night-mode .ai-input { color: #D0C0D0; }
.night-mode .ai-input::placeholder { color: #6A5A70; }
.night-mode .ai-chat-header { background: linear-gradient(135deg, #5A3050, #4A3050, #3A2540); color: #FFCCD5; box-shadow: 0 4px 16px rgba(90, 48, 80, 0.3); }
.night-mode .ai-name { color: #FFCCD5; }
.night-mode .ai-quota { color: #C0A0B0; }
.night-mode .ai-avatar-circle { background: linear-gradient(135deg, #3A2030, #4A3050); border-color: #5A4050; }
.night-mode .quick-amounts span { background: #3A3050; }
.night-mode .article-item { background: var(--bg-card); }
.night-mode .vip-plan { background: var(--bg-card); }
.night-mode .vip-plan.recommended { background: #3A3020; }
.night-mode .pdf-export-card { background: #1A3020; }
.night-mode .pdf-title { color: #81C784; }
.night-mode .pdf-desc { color: #66BB6A; }
.night-mode .baby-card { background: linear-gradient(135deg, #1C2128, #21262D); }
.night-mode .baby-name { color: #FFD54F; }
.night-mode .baby-meta { color: #BCAAA4; }
.night-mode .member-card { background: linear-gradient(135deg, #3A3020, #4A3828); }
.night-mode .member-name { color: #FFD54F; }
.night-mode .member-status { color: #BCAAA4; }
.night-mode .ai-chat-header { background: linear-gradient(135deg, #5A3050, #4A3050, #3A2540); color: #FFCCD5; box-shadow: 0 4px 16px rgba(90, 48, 80, 0.3); }
.night-mode .ai-daily-card, .night-mode .ai-weekly-card { background: linear-gradient(135deg, #2A4A6A, #3A5A80); }
.night-mode .bottom-nav { background: #1E1E30; border-color: #3A3050; }
.night-mode .app-header { background: linear-gradient(135deg, #3A6BA0, #4A80B8); }
.night-mode .sub-page-header { background: linear-gradient(135deg, #3A6BA0, #4A80B8); }
.night-mode .sleep-toggle-btn { background: linear-gradient(135deg, #7060A0, #9080C0); }
.night-mode .sleep-toggle-btn.sleeping { background: linear-gradient(135deg, #307040, #289060); }
.night-mode .modal-container { background: #252540; }
.night-mode .privacy-modal-content { background: #252540; }
.night-mode .voice-btn { background: linear-gradient(135deg, #D04040, #C06060); }
.night-mode .shop-item { background: var(--bg-card); }

/* ========== AI宝宝写真生图 ========== */
.aigen-header {
    text-align: center;
    padding: 8px 0 16px;
}

.aigen-header h2 { font-size: 20px; margin-bottom: 4px; }
.aigen-header p { font-size: 13px; color: var(--text-light); }

/* 步骤1：上传区 */
.aigen-upload-area {
    border: 3px dashed #BBDEFB;
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: #F5F9FD;
    margin-bottom: 16px;
}

.aigen-upload-area:active { background: #E3F2FD; border-color: #2192EB; }

.aigen-upload-icon { font-size: 56px; margin-bottom: 12px; }
.aigen-upload-text { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.aigen-upload-hint { font-size: 12px; color: var(--text-light); }

.aigen-preview-area {
    text-align: center;
    margin-bottom: 16px;
}

.aigen-preview-area img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

.aigen-reupload-btn {
    display: block;
    margin: 10px auto 0;
    padding: 8px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-secondary);
}

/* 分类Tab */
.aigen-category-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.aigen-category-tabs::-webkit-scrollbar { display: none; }

.aigen-cat-tab {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    color: var(--text-secondary);
}

.aigen-cat-tab.active {
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    color: white;
    border-color: transparent;
    font-weight: 600;
}

/* 风格卡片 */
.aigen-style-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.aigen-style-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    border: 2px solid transparent;
}

.aigen-style-card:active { transform: scale(0.97); }
.aigen-style-card.selected { border-color: #2192EB; box-shadow: 0 0 0 3px rgba(91,155,213,0.2); }

.aigen-card-preview {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    position: relative;
}

.aigen-card-preview.french { background: linear-gradient(135deg, #FFF8E1, #FFECB3); }
.aigen-card-preview.korean { background: linear-gradient(135deg, #FCE4EC, #F8BBD0); }
.aigen-card-preview.forest { background: linear-gradient(135deg, #E8F5E9, #C8E6C9); }
.aigen-card-preview.nordic { background: linear-gradient(135deg, #ECEFF1, #CFD8DC); }
.aigen-card-preview.festival { background: linear-gradient(135deg, #FFF3E0, #FFCCBC); }

.aigen-card-info { padding: 10px 12px; }
.aigen-card-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.aigen-card-desc { font-size: 11px; color: var(--text-light); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.aigen-vip-badge {
    position: absolute; top: 6px; right: 6px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #7B5B00; font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 10px;
}

/* 结果 */
.aigen-result h3 { font-size: 16px; margin-bottom: 12px; }

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

.aigen-image-item {
    aspect-ratio: 3/4;
    background: var(--bg);
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.aigen-image-item img {
    width: 100%; height: 100%; object-fit: cover;
}

/* Loading */
.aigen-loading {
    text-align: center; padding: 48px 16px;
}

.aigen-loading-icon {
    font-size: 56px;
    animation: aigenSpin 2s linear infinite;
}

@keyframes aigenSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.aigen-loading p { font-size: 16px; font-weight: 600; color: var(--text); margin-top: 16px; }
.aigen-loading-sub { font-size: 13px; color: var(--text-light); font-weight: 400; margin-top: 4px; }

/* 历史写真网格 */
.aigen-history-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 4px;
}
.aigen-history-item {
    border-radius: 12px;
    overflow: hidden;
    background: #eef2f7;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* 夜间 */
.night-mode .aigen-upload-area { background: #1A2A3A; border-color: #2A4A6A; }
.night-mode .aigen-style-card { background: var(--bg-card); }

/* ========== 语音识别结果弹窗 ========== */
.voice-result-modal {
    padding: 8px 0;
    margin: 0 auto;
}

.voice-result-modal h3 {
    font-size: 17px;
    margin-bottom: 16px;
    text-align: center;
}

.voice-raw, .voice-corrected {
    margin-bottom: 12px;
}

.voice-raw label, .voice-corrected label {
    font-size: 12px;
    color: var(--text-light);
    display: block;
    margin-bottom: 4px;
}

.voice-raw p {
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    line-height: 1.5;
}

.voice-corrected p {
    font-size: 15px;
    color: var(--text);
    background: #E8F5E9;
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    font-weight: 500;
    line-height: 1.5;
}

.voice-category {
    font-size: 13px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.voice-cat-tag {
    background: var(--primary);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
}

.voice-parsed {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.voice-tag {
    background: #E3F2FD;
    color: #1565C0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.voice-result-btns {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.voice-result-btns button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.voice-btn-save {
    background: var(--primary);
    color: white;
}

.voice-btn-edit {
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.voice-btn-cancel {
    background: transparent;
    color: var(--text-light);
}

.voice-result-btns button:active {
    transform: scale(0.96);
}

/* 单张结果 */
.aigen-result-single { text-align: center; }
.aigen-result-single img { max-width: 100%; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.12); cursor: pointer; }
.aigen-result-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.aigen-save-btn { padding: 12px 24px; background: linear-gradient(135deg, #2192EB, #B1E0F6); color: white; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }

/* ========== 首页中央醒目语音按钮 ========== */
.home-voice-center {
    text-align: center;
    margin: 20px 0 8px;
}

.voice-btn-big {
    width: 100%;
    padding: 22px 16px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 6px 24px rgba(255, 107, 107, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.voice-btn-big::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
    animation: voicePulse 2.5s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
}

.voice-btn-big:active {
    transform: scale(0.96);
    box-shadow: 0 3px 12px rgba(255, 107, 107, 0.4);
}

.voice-btn-big-icon {
    font-size: 36px;
    animation: voiceBounce 1.5s ease-in-out infinite;
}

@keyframes voiceBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.voice-btn-big-text {
    font-size: 18px;
    letter-spacing: 2px;
}

.voice-btn-hint {
    text-align: center;
    color: #8E9BAA;
    font-size: 12px;
    margin: 8px 0 0;
    line-height: 1.5;
}

/* 按住按钮时禁用文本选择（避免长按选中文字） */
.voice-btn-big {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* 夜间模式中央语音按钮 */
.night-mode .voice-btn-big {
    background: linear-gradient(135deg, #C44B4B, #CC6B3D);
    box-shadow: 0 6px 24px rgba(196, 75, 75, 0.25);
}

.night-mode .voice-btn-big:active {
    box-shadow: 0 3px 12px rgba(196, 75, 75, 0.3);
}

.night-mode .voice-btn-hint {
    color: #667788;
}

/* 语音录制中状态 */
.voice-btn-big.recording-active {
    background: linear-gradient(135deg, #E53935, #FF5722);
    animation: voiceRecordPulse 0.8s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(229, 57, 53, 0.6);
}

@keyframes voiceRecordPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(229, 57, 53, 0.4); }
    50% { box-shadow: 0 0 40px rgba(229, 57, 53, 0.8), 0 0 60px rgba(255, 87, 34, 0.4); }
}

.voice-btn-big.recording-active .voice-btn-big-icon {
    animation: voiceRecordShake 0.3s ease-in-out infinite;
}

@keyframes voiceRecordShake {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ========== 首页语音记事按钮（旧，已废弃） ========== */
/* .voice-btn-quick 已移除，语音按钮改为首页中央大按钮 */

/* 夜间概览数字加深 */
.night-mode .overview-value {
    color: #FAC1D7;
}

/* AI写真入口（在AI顾问页内） */
.ai-aigen-entry {
    background: linear-gradient(135deg, #E8F5FE, #D6EAF8);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.ai-aigen-entry:active {
    transform: scale(0.98);
}

.ai-aigen-entry-icon {
    font-size: 32px;
}

.ai-aigen-entry-text {
    flex: 1;
}

.ai-aigen-entry-title {
    font-size: 15px;
    font-weight: 600;
    color: #2C3E50;
}

.ai-aigen-entry-desc {
    font-size: 12px;
    color: #5A7D9A;
    margin-top: 2px;
}

.ai-aigen-entry-arrow {
    font-size: 20px;
    color: #5A7D9A;
}

.night-mode .ai-aigen-entry {
    background: linear-gradient(135deg, #1A2A40, #243447);
}

.night-mode .ai-aigen-entry-title { color: #E1E8ED; }
.night-mode .ai-aigen-entry-desc { color: #8899A6; }
.night-mode .ai-aigen-entry-arrow { color: #8899A6; }

/* AI写真面板（在AI顾问页内） */
.aigen-panel {
    padding: 0;
}

.aigen-panel-header {
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.aigen-panel-header .back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    font-size: 14px;
    cursor: pointer;
}

.aigen-panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

/* 天气栏隐藏 */
.weather-bar { display: none; }
.aigen-regenerate-btn { padding: 12px 24px; background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }

/* ========== 子页面 ========== */
.sub-page {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 82px; /* 留出底部导航栏空间，确保导航栏始终可见 */
    background: var(--bg);
    z-index: 50; /* 低于底部导航栏的 z-index:100，确保导航栏不被覆盖 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px; /* 内容底部留一些间距即可 */
    box-sizing: border-box;
}

.sub-page.active {
    display: block;
}

.sub-page-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 12px 16px;
    /* 防止状态栏遮挡头部文字：头部自身承担安全区域 */
    padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 101;
}

.sub-page-header .back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    font-size: 14px;
    cursor: pointer;
}

.sub-page-header h3 {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

/* ========== 宝宝档案页专用 ========== */
.baby-profile-form .gender-btn.active {
    border-color: #2192EB !important;
    background: linear-gradient(135deg, #e8f4fc, #d4ebf7) !important;
    color: #2192EB !important;
}
.baby-profile-form input:focus {
    border-color: #2192EB !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(91,155,213,0.15);
}
.baby-profile-form textarea:focus {
    border-color: #2192EB !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(91,155,213,0.15);
}

/* ========== 首页UI升级样式 ========== */
/* 语音按钮动画 */
.voice-btn-big.recording-active {
    background: linear-gradient(145deg,#ee5a52,#c0392b) !important;
    box-shadow:0 6px 40px rgba(238,90,82,0.6),0 2px 12px rgba(238,90,82,0.4) !important;
    animation: pulse-voice 1.5s ease-in-out infinite;
}

@keyframes pulse-voice {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* 底部导航优化 */
.bottom-nav {
    box-shadow: 0 -2px 20px rgba(0,0,0,0.06);
}
.nav-item {
    transition: all 0.2s ease;
}
.nav-item.active .nav-label {
    color: #2192EB;
    font-weight: 600;
}
.nav-item.active .nav-icon {
    transform: scale(1.1);
}

/* 宝宝卡片hover效果 */
.baby-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.baby-card:active {
    transform: scale(0.98);
}

/* 概览卡片点击反馈 */
.overview-grid > div {
    transition: all 0.15s ease;
}
.overview-grid > div:active {
    transform: scale(0.95);
    opacity: 0.8;
}

/* 快捷按钮点击反馈 */
.quick-actions button {
    transition: all 0.15s ease;
}
.quick-actions button:active {
    transform: scale(0.96);
    filter: brightness(0.9);
}

/* AI入口卡 */
.ai-daily-card, .ai-weekly-card {
    transition: all 0.2s ease;
}
.ai-daily-card:active, .ai-weekly-card:active {
    transform: scale(0.97);
    filter: brightness(0.95);
}

/* ========== 顶部我的入口 ========== */
.mine-badge {
    background: rgba(255,255,255,0.22);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 0.2px;
    border: 1px solid rgba(255,255,255,0.28);
    transition: all 0.2s ease;
    min-width: 32px;
    text-align: center;
}

.mine-badge:active {
    background: rgba(255,255,255,0.34);
    transform: scale(0.93);
}

/* ========== 悬浮双FAB按钮 ========== */
.fab-container {
    position: fixed;
    bottom: calc(70px + var(--safe-bottom) + 12px);
    right: 16px;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 14px;
    z-index: 90;
    pointer-events: none;
}

.fab-container .fab-btn {
    pointer-events: auto;
}

.fab-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.fab-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.35);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.fab-btn:active::after {
    width: 120%;
    height: 120%;
}

.fab-btn:active {
    transform: scale(0.92);
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}

.fab-voice {
    background: linear-gradient(135deg, rgba(91,155,213,0.85), rgba(126,200,227,0.85));
    color: white;
}

.fab-photo {
    background: linear-gradient(135deg, rgba(255,154,162,0.85), rgba(255,183,178,0.85));
    color: white;
}

.fab-icon {
    font-size: 22px;
    line-height: 1;
    z-index: 1;
}

.fab-label {
    font-size: 10px;
    font-weight: 600;
    z-index: 1;
}

.fab-recording-ring {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 3px solid rgba(231,76,60,0.4);
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

#homeVoiceBtn.recording .fab-recording-ring {
    opacity: 1;
    animation: fabPulse 1.2s ease-in-out infinite;
}

@keyframes fabPulse {
    0%, 100% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 0; }
}

/* ========== 最近记录模块 ========== */
.home-recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.home-recent-item:last-child {
    border-bottom: none;
}

.home-recent-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

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

.home-recent-title {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.home-recent-extra {
    font-size: 12px;
    color: #888;
    margin-top: 1px;
}

.home-recent-time {
    font-size: 12px;
    color: #bbb;
    flex-shrink: 0;
}

/* ========== 统一按钮动效 ========== */
.quick-record-btn {
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.quick-record-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.quick-record-btn:active::after {
    width: 150%;
    height: 150%;
}

.quick-record-btn:active {
    transform: scale(0.96);
}

/* ========== QUICK更多弹窗 ========== */
.quick-more-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
}

.quick-more-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 4px;
    border-radius: 14px;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid #f0f2f5;
}

.quick-more-item:active {
    transform: scale(0.95);
    background: #eef1ff;
}

.quick-more-icon {
    font-size: 26px;
}

.quick-more-text {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

/* ========== 护理提醒 ========== */
.reminder-bell {
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.reminder-bell-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ff6b6b;
    color: #fff;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.reminder-item {
    display: flex;
    align-items: center;
    padding: 14px;
    background: #f8fafc;
    border-radius: 14px;
    margin-bottom: 10px;
    border: 1px solid #f0f2f5;
}

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

.reminder-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.reminder-item-desc {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
}

.reminder-item-switch {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: #d0d5dd;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.reminder-item-switch.on {
    background: #2192EB;
}

.reminder-item-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.reminder-item-switch.on::after {
    transform: translateX(20px);
}

.reminder-item-actions {
    display: flex;
    gap: 8px;
    margin-left: 10px;
}

.reminder-item-actions span {
    font-size: 13px;
    color: #2192EB;
    cursor: pointer;
    padding: 4px;
}

.reminder-item-actions span.delete {
    color: #ff6b6b;
}

/* 夜间模式适配 */
.night-mode .fab-voice {
    background: linear-gradient(135deg, rgba(74,123,168,0.9), rgba(95,160,182,0.9));
}

.night-mode .fab-photo {
    background: linear-gradient(135deg, rgba(190,118,125,0.9), rgba(195,145,142,0.9));
}

.night-mode .home-recent-title { color: #E1E8ED; }
.night-mode .home-recent-extra { color: #8899A6; }
.night-mode .home-recent-time { color: #657786; }

/* ========================================
   首页优化新增样式 V1782700000
   ======================================== */

/* 优雅标题 */
.elegant-title {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.title-deco {
    font-size: 16px;
    opacity: 0.9;
    margin-right: 4px;
}

.title-logo {
    width: 55px;
    height: 55px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.install-btn {
    width: 28px;
    height: 28px;
    margin-left: 6px;
    padding: 0;
    border: none;
    background: rgba(255,255,255,0.25);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease, background 0.15s ease;
}

.install-btn svg {
    width: 18px;
    height: 18px;
}

.install-btn:active {
    transform: scale(0.92);
    background: rgba(255,255,255,0.4);
}

/* 卡通铃铛 */
.reminder-bell {
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}
.reminder-bell:active {
    transform: scale(0.88);
    background: rgba(255,255,255,0.18);
}
.cartoon-bell {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.12));
}
.reminder-bell-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #FF4D4F;
    border-radius: 50%;
    border: 1.5px solid #2192EB;
    animation: bellPulse 1.5s ease-in-out infinite;
}
@keyframes bellPulse {
    0%,100%{transform:scale(1)}
    50%{transform:scale(1.25)}
}

/* 全局按钮点击动效 */
button, .nav-item, .overview-card, .quick-record-btn, .recent-record-card,
.baby-card, .quick-entry-btn, .fab-btn, .menu-item, .article-item {
    transition: transform 0.12s ease, box-shadow 0.2s ease;
}
button:active, .nav-item:active, .overview-card:active, .quick-record-btn:active,
.recent-record-card:active, .baby-card:active, .quick-entry-btn:active, .fab-btn:active,
.menu-item:active, .article-item:active {
    transform: scale(0.96);
}
button, .nav-item, .overview-card, .quick-record-btn, .recent-record-card,
.baby-card, .quick-entry-btn, .fab-btn {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* 宝宝引导卡片 */
.baby-card {
    margin: 6px 16px 10px;
    border-radius: 16px;
    padding: 14px;
    background: linear-gradient(145deg, #ffffff, #f0f2f8);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.6);
    cursor: pointer;
    overflow: hidden;
}
.baby-card.baby-guide {
    background: linear-gradient(145deg, #ffffff, #f5f7fd);
    border: 1px solid rgba(255,255,255,0.6);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
}
.baby-guide-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 100px; /* 为右侧按钮组留出空间，避免遮挡宝宝信息 */
}
.baby-guide-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #FFF0F5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    border: 2px solid #FFE4EC;
}
.baby-guide-text {
    flex: 1;
    min-width: 0;
}
.baby-guide-title {
    font-size: 16px;
    font-weight: 700;
    color: #5B6B8A;
}
.baby-guide-desc {
    font-size: 12px;
    color: #A0AEC0;
    margin-top: 2px;
}
.baby-card:not(.baby-guide) .baby-guide-title {
    font-size: 17px;
    color: #2C3E50;
}
.baby-card:not(.baby-guide) .baby-guide-desc {
    color: #7A8BA5;
}
.baby-age-badge {
    flex-shrink: 0;
    padding: 5px 10px;
    background: linear-gradient(135deg, #FFE4EC, #FFF0F5);
    color: #C75C5C;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    margin-left: 6px;
}
.baby-arrow {
    color: #D0D5DD;
    font-size: 18px;
    margin-left: 4px;
}

/* TODAY 概览 */
.overview-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 14px 4px 12px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 1px 8px rgba(0,0,0,0.03);
    border: 1px solid #f0f2f5;
    transition: transform 0.12s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 130px;
}
.overview-card:active {
    transform: scale(0.95);
}
.overview-icon {
    font-size: 24px;
    margin-bottom: 4px;
    opacity: 0.9;
    line-height: 1;
}
.overview-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-bottom: 2px;
}
.overview-value {
    font-size: 18px;
    font-weight: 800;
    transition: color 0.3s ease;
    line-height: 1.2;
}
.overview-trend {
    font-size: 11px;
    font-weight: 700;
    margin-left: 1px;
}
.overview-trend.up { color: #FF4D4F; }
.overview-trend.down { color: #52C41A; }
.overview-trend.same { color: #8899A6; }
.overview-status {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    margin-bottom: 3px;
    line-height: 1.3;
}
.overview-status.status-normal { color: #389E0D; background: rgba(82, 196, 26, 0.12); }
.overview-status.status-warn { color: #D48806; background: rgba(245, 166, 35, 0.14); }
.overview-status.status-danger { color: #CF1322; background: rgba(255, 77, 79, 0.12); }
.overview-last {
    font-size: 10px;
    color: #8899A6;
    line-height: 1.2;
    margin-bottom: 2px;
}
.overview-label {
    font-size: 12px;
    color: #8899A6;
    margin-top: auto;
    font-weight: 500;
    line-height: 1.2;
}
.status-normal { color: #2192EB; }
.status-warn { color: #F5A623; }
.status-danger { color: #FF4D4F; }

/* 建议下次时间标签 */
.overview-card::after {
    content: attr(data-next);
    display: block;
    width: fit-content;
    min-width: 36px;
    padding: 2px 6px;
    border-radius: 8px;
    margin: 4px auto 0;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.2px;
    background: rgba(91, 155, 213, 0.10);
    color: #2192EB;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.overview-card[data-next=""]::after { display: none; }
.overview-card.status-dot-normal::after { background: rgba(82, 196, 26, 0.10); color: #52C41A; }
.overview-card.status-dot-warn::after { background: rgba(245, 166, 35, 0.10); color: #F5A623; }
.overview-card.status-dot-danger::after { background: rgba(255, 77, 79, 0.10); color: #FF4D4F; }

/* QUICK 区域 */
.quick-section {
    padding: 0 16px 10px;
}
.quick-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.quick-section-title {
    font-size: 11px;
    color: #A0AEC0;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.quick-more-toggle {
    font-size: 12px;
    color: #2192EB;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 12px;
    background: #F0F7FF;
    font-weight: 600;
    transition: all 0.2s ease;
}
.quick-more-toggle.open {
    background: #E1EFFF;
}
.quick-more-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}
.quick-more-toggle.open .quick-more-arrow {
    transform: rotate(180deg);
}
.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.quick-record-btn {
    padding: 14px 2px;
    border: none;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #4A5568;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.qri {
    font-size: 20px;
}
/* 马卡龙低饱和底色 */
.macaron-feed { background: #E3F2FD; color: #1565C0; }
.macaron-sleep { background: #EDE7F6; color: #5E35B1; }
.macaron-diaper { background: #FFF3E0; color: #E65100; }
.macaron-change { background: #FCE4EC; color: #C2185B; }
.macaron-water { background: #E0F7FA; color: #00838F; }
.macaron-burp { background: #F3E5F5; color: #7B1FA2; }
.macaron-vomit { background: #FBE9E7; color: #BF360C; }
.macaron-temp { background: #E8F5E9; color: #2E7D32; }
.macaron-fever { background: #FFF8E1; color: #F9A825; }
.macaron-bath { background: #E0F2F1; color: #00695C; }
.macaron-skin { background: #F3E5F5; color: #7B1FA2; }
.macaron-jaundice { background: #FFFDE7; color: #FBC02D; }
.macaron-weight { background: #ECEFF1; color: #455A64; }
.macaron-vaccine { background: #E8EAF6; color: #3949AB; }

.quick-more-dropdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #E2E8F0;
    animation: slideDown 0.25s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 快速记录入口条 */
.quick-entry-bar {
    margin: 0 16px 14px;
    background: rgba(255,255,255,0.55);
    border-radius: 22px;
    padding: 18px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(91, 155, 213, 0.08);
}
.quick-entry-btns {
    display: flex;
    gap: 28px;
}
.quick-entry-btn {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 8px !important;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    position: relative;
    overflow: hidden;
}
.quick-entry-btn:active {
    transform: scale(0.92);
}
.quick-entry-btn .qeb-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.quick-entry-btn .qeb-icon svg {
    width: 28px;
    height: 28px;
}
.voice-entry-btn {
    background: rgba(255, 194, 214, 0.55);
    color: #A61E5A;
    box-shadow: 0 6px 18px rgba(166, 30, 90, 0.16);
    border: 1.5px solid rgba(255, 194, 214, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
}
.voice-entry-btn:active {
    background: rgba(255, 179, 201, 0.65);
    box-shadow: 0 3px 10px rgba(166, 30, 90, 0.22);
}
.photo-entry-btn {
    background: rgba(179, 224, 255, 0.55);
    color: #0D5C96;
    box-shadow: 0 6px 18px rgba(13, 92, 150, 0.12);
    border: 1.5px solid rgba(179, 224, 255, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.photo-entry-btn:active {
    background: rgba(140, 210, 255, 0.65);
    box-shadow: 0 3px 10px rgba(13, 92, 150, 0.18);
}
.voice-entry-btn.recording {
    background: #FF9AAE !important;
    color: #8B1538 !important;
    box-shadow: 0 0 24px rgba(139, 21, 56, 0.28) !important;
    animation: breathPulse 1.6s ease-in-out infinite;
}
.voice-entry-btn.recording::before {
    content: '';
    position: absolute;
    top: -6px; left: -6px; right: -6px; bottom: -6px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 154, 174, 0.55);
    animation: pulseRing 1.6s ease-out infinite;
    pointer-events: none;
}

/* 最近记录 */
.recent-section {
    padding: 0 16px 110px;
}
.recent-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.recent-section-title {
    font-size: 11px;
    color: #A0AEC0;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.recent-section-tip {
    font-size: 11px;
    color: #CBD5E0;
}
.recent-list {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 8px 12px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.03);
    border: 1px solid #f0f2f5;
    min-height: 80px;
}
.recent-empty {
    text-align: center;
    padding: 24px 10px;
    color: #CBD5E0;
    font-size: 13px;
}
.recent-empty-icon {
    font-size: 32px;
    margin-bottom: 6px;
    opacity: 0.6;
}
.recent-record-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-bottom: 1px solid #F7F8FA;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
    transition: transform 0.2s ease;
}
.recent-record-card:last-child {
    border-bottom: none;
}
.recent-record-card.swiped {
    transform: translateX(-60px);
}
.recent-record-delete {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 60px;
    background: #FF4D4F;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    transform: translateX(100%);
    transition: transform 0.2s ease;
}
.recent-record-card.swiped .recent-record-delete {
    transform: translateX(0);
}
.recent-record-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.recent-record-body {
    flex: 1;
    min-width: 0;
}
.recent-record-title {
    font-size: 14px;
    font-weight: 500;
    color: #2D3748;
    margin-bottom: 3px;
}
.recent-record-meta {
    font-size: 12px;
    color: #A0AEC0;
}
.recent-record-time {
    font-size: 13px;
    color: #718096;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}
.recent-record-time small {
    display: block;
    font-size: 10px;
    color: #CBD5E0;
    font-weight: 400;
    margin-top: 1px;
}

/* 长按复制提示 */
.long-press-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}
.long-press-hint.show {
    opacity: 1;
}

/* 悬浮按钮 */
.fab-container {
    position: fixed;
    right: 16px;
    bottom: calc(70px + var(--safe-bottom) + 12px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 90;
}
.fab-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.fab-icon {
    font-size: 24px;
}
.fab-photo {
    background: linear-gradient(135deg, #82B1FF, #448AFF);
}
.fab-voice {
    background: linear-gradient(135deg, #FF8A80, #FF5252);
}
.fab-home .fab-btn {
    width: 66px;
    height: 66px;
}
.fab-home .fab-icon {
    font-size: 28px;
}

/* 底部导航 */
.nav-item.active .nav-icon {
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 18px;
    box-shadow: 0 3px 10px rgba(91,155,213,0.3);
    transform: translateY(-2px);
}
.nav-item.active .nav-label {
    color: #2192EB;
    font-weight: 700;
}
.nav-item .nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: all 0.2s ease;
}
.nav-icon-sister {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #E8F0FE;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}
.sister-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}
.nav-item.active .sister-avatar {
    width: 36px;
    height: 36px;
}
.nav-item.active .nav-icon-sister {
    background: linear-gradient(135deg, #E8F0FF, #D0E4FF);
    border-color: rgba(91,155,213,0.3);
}

/* 夜间模式增强 */
.night-mode .baby-card,
.night-mode .overview-card,
.night-mode .quick-record-btn,
.night-mode .recent-list,
.night-mode .quick-entry-bar {
    background: #161B22 !important;
    border-color: #30363D !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25), 0 1px 4px rgba(0,0,0,0.15) !important;
}
.night-mode .app-header {
    background: linear-gradient(135deg, #161B22, #1C2128);
}
.night-mode .page-home.active,
.night-mode .page-record.active,
.night-mode .page-stats.active,
.night-mode .page-ai.active,
.night-mode .page-knowledge.active,
.night-mode .page-mine.active,
.night-mode .page-family.active,
.night-mode .page-growth.active {
    background: var(--bg) !important;
}
.night-mode .baby-guide {
    background: linear-gradient(135deg, #161B22, #1C2128);
    border-color: #30363D;
}
.night-mode .baby-guide-title,
.night-mode .quick-entry-title,
.night-mode .recent-record-title {
    color: #E1E8ED;
}
.night-mode .baby-guide-desc,
.night-mode .overview-label,
.night-mode .recent-section-tip,
.night-mode .recent-record-meta,
.night-mode .recent-record-time small {
    color: #8899A6;
}
.night-mode .recent-record-time {
    color: #A0AEC0;
}
.night-mode .quick-record-btn {
    color: #E1E8ED;
}
.night-mode .voice-entry-btn {
    background: #21262D;
    color: #E1E8ED;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.night-mode .photo-entry-btn {
    background: #21262D;
    color: #E1E8ED;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.night-mode .quick-more-toggle {
    background: #21262D;
    color: #8B949E;
}
.night-mode .macaron-feed { background: #1A2230; color: #90CAF9; }
.night-mode .macaron-sleep { background: #1A2230; color: #B39DDB; }
.night-mode .macaron-diaper { background: #1A2230; color: #FFCC80; }
.night-mode .macaron-change { background: #1A2230; color: #F48FB1; }
.night-mode .macaron-water { background: #1A2230; color: #80DEEA; }
.night-mode .macaron-burp { background: #1A2230; color: #CE93D8; }
.night-mode .macaron-vomit { background: #1A2230; color: #FFAB91; }
.night-mode .macaron-temp { background: #1A2230; color: #A5D6A7; }
.night-mode .macaron-fever { background: #1A2230; color: #FFF59D; }
.night-mode .macaron-bath { background: #1A2230; color: #80CBC4; }
.night-mode .macaron-skin { background: #1A2230; color: #CE93D8; }
.night-mode .macaron-jaundice { background: #1A2230; color: #FFF59D; }
.night-mode .macaron-weight { background: #1A2230; color: #B0BEC5; }
.night-mode .macaron-vaccine { background: #1A2230; color: #9FA8DA; }

/* 小萌姐姐语音通话按钮 */
#aiVoiceBtn {
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#aiVoiceBtn:active,
#aiVoiceBtn.recording {
    transform: scale(0.92);
    box-shadow: 0 0 0 4px rgba(255, 194, 214, 0.35);
}
#aiVoiceBtn.recording {
    animation: breathPulse 1.6s ease-in-out infinite;
}
#aiVoiceBtn.recording::before {
    content: '';
    position: absolute;
    top: -5px; left: -5px; right: -5px; bottom: -5px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 194, 214, 0.5);
    animation: pulseRingSister 1.6s ease-out infinite;
    pointer-events: none;
}
#aiVoicePanel {
    transition: opacity 0.25s ease, transform 0.25s ease;
}
#aiVoicePanel.show {
    opacity: 1;
    transform: translate(-50%, -50%) !important;
}

/* ========== 哄睡音乐面板 ========== */
.sleep-music-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 82px; /* 留出底部导航栏空间 */
    background: var(--bg, #f7f9fc);
    z-index: 200;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.sleep-music-header {
    padding: env(safe-area-inset-top) 16px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 17px;
    font-weight: 700;
    color: #333;
    background: #fff;
    border-bottom: 1px solid #f0f2f5;
}

.sleep-music-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    padding-bottom: 20px; /* 减少底部padding，因为panel已经留出导航栏空间 */
}

.sleep-music-visual {
    background: linear-gradient(135deg, #E8F5FE, #FFF0F5);
    border-radius: 20px;
    padding: 28px 20px;
    text-align: center;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}

.sleep-music-wave {
    width: 80px;
    height: 80px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: rgba(91, 155, 213, 0.15);
    position: relative;
}

.sleep-music-wave.playing::before,
.sleep-music-wave.playing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(91, 155, 213, 0.35);
    animation: sleepWave 2.5s ease-out infinite;
}

.sleep-music-wave.playing::after {
    animation-delay: 1.2s;
}

@keyframes sleepWave {
    0% { width: 100%; height: 100%; opacity: 1; }
    100% { width: 240%; height: 240%; opacity: 0; }
}

.sleep-music-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
}

.sleep-music-status {
    font-size: 13px;
    color: #888;
}

.sleep-music-tracks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}

.sleep-track {
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 1px 6px rgba(0,0,0,0.03);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sleep-track:active {
    transform: scale(0.97);
}

.sleep-track.active {
    border-color: #2192EB;
    box-shadow: 0 4px 16px rgba(91, 155, 213, 0.15);
}

.sleep-track .track-icon {
    font-size: 28px;
}

.sleep-track .track-info {
    flex: 1;
}

.sleep-track .track-name {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
}

.sleep-track .track-desc {
    font-size: 11px;
    color: #999;
}

.sleep-track .track-play {
    font-size: 13px;
    color: #2192EB;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f4ff;
    border-radius: 50%;
    align-self: flex-end;
}

.sleep-music-controls {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 18px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.03);
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 14px;
    color: #333;
}

.control-row:last-child {
    margin-bottom: 0;
}

.control-row input[type="range"] {
    flex: 1;
    margin-left: 16px;
    accent-color: #2192EB;
}

.sleep-timers {
    display: flex;
    gap: 8px;
}

.sleep-timer {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 14px;
    background: #f5f7fa;
    color: #666;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.sleep-timer.active {
    background: #2192EB;
    color: #fff;
}

.sleep-music-actions {
    display: flex;
    justify-content: center;
}

.sleep-play-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(91, 155, 213, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sleep-play-btn:active {
    transform: scale(0.95);
}

.sleep-play-btn.playing {
    background: linear-gradient(135deg, #FFC2D6, #FF9EBB);
    box-shadow: 0 8px 24px rgba(166, 30, 90, 0.35);
}

/* ========== 我的音频（自定义录音 + 上传音乐）========== */
.my-audio-section {
    background: var(--bg-card, #fff);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
    animation: fadeIn 0.3s ease;
}

.my-audio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 700;
    color: var(--text, #333);
    margin-bottom: 14px;
}

.my-audio-close {
    cursor: pointer;
    font-size: 18px;
    color: #999;
    padding: 4px;
}

.my-audio-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.my-audio-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 8px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.my-audio-btn:active {
    transform: scale(0.96);
}

.my-audio-btn.record {
    background: linear-gradient(135deg, #FF9EBB, #FF7AAE);
}

.my-audio-btn.record.recording {
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
    animation: pulseRecord 1.2s ease-in-out infinite;
}

.my-audio-btn.upload {
    background: linear-gradient(135deg, #B1E0F6, #2192EB);
}

.my-audio-btn-icon {
    font-size: 26px;
}

.my-audio-btn-label {
    font-size: 13px;
}

.my-audio-recording {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: #FFF0F3;
    border-radius: 14px;
    margin-bottom: 14px;
    color: #D45A7A;
    font-weight: 600;
    font-size: 14px;
}

.my-audio-recording-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff4757;
    animation: pulseRecord 1s ease-in-out infinite;
}

.my-audio-list {
    max-height: 260px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.my-audio-empty {
    text-align: center;
    padding: 28px 12px;
    color: #999;
    font-size: 13px;
}

.my-audio-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: var(--bg, #f8fafc);
    margin-bottom: 8px;
    transition: transform 0.1s ease;
    cursor: pointer;
}

.my-audio-item:active {
    transform: scale(0.98);
}

.my-audio-item.active {
    background: linear-gradient(135deg, #E8F5FE, #FFF0F5);
    border: 1px solid rgba(91, 155, 213, 0.2);
}

.my-audio-item-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E8F5FE, #FFF0F5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.my-audio-item-info {
    flex: 1;
    min-width: 0;
}

.my-audio-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.my-audio-item-meta {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.my-audio-item-play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #2192EB;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
}

.my-audio-item-play.playing {
    background: #FF9EBB;
}

.my-audio-item-delete {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
}

.my-audio-playbar {
    position: sticky;
    bottom: 0;
    background: var(--bg-card, #fff);
    border-radius: 16px;
    padding: 12px;
    margin-top: 12px;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
    text-align: center;
}

.my-audio-now-playing {
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #333);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.my-audio-playbar-btns {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.my-audio-playbar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #f0f2f5;
    color: #555;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease;
}

.my-audio-playbar-btn:active {
    transform: scale(0.92);
}

.my-audio-playbar-btn.play {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    color: #fff;
    font-size: 18px;
}

.my-audio-loop-row {
    display: flex;
    justify-content: center;
}

.my-audio-loop-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #888;
    cursor: pointer;
}

.my-audio-loop-label input {
    width: 16px;
    height: 16px;
    accent-color: #2192EB;
}

/* 深色模式适配 */
.night-mode .sleep-music-header {
    background: #1a1a2e;
    border-color: #2d2d44;
    color: #fff;
}

.night-mode .sleep-track {
    background: #1e1e32;
}

.night-mode .sleep-track .track-name {
    color: #f0f0f0;
}

.night-mode .sleep-track .track-desc {
    color: #888;
}

.night-mode .sleep-music-controls {
    background: #1e1e32;
}

.night-mode .control-row {
    color: #f0f0f0;
}

.night-mode .sleep-timer {
    background: #2d2d44;
    color: #ccc;
}

.night-mode .sleep-timer.active {
    background: #2192EB;
    color: #fff;
}

.night-mode .my-audio-section {
    background: var(--bg-card, #161B22);
    border-color: var(--border, #38444D);
}

.night-mode .my-audio-header {
    color: var(--text, #E1E8ED);
}

.night-mode .my-audio-item {
    background: var(--bg, #0D1117);
}

.night-mode .my-audio-item.active {
    background: linear-gradient(135deg, #1a2d3d, #2d1f2f);
}

.night-mode .my-audio-item-name {
    color: var(--text, #E1E8ED);
}

.night-mode .my-audio-playbar {
    background: var(--bg-card, #161B22);
    border-color: var(--border, #38444D);
}

.night-mode .my-audio-now-playing {
    color: var(--text, #E1E8ED);
}

.night-mode .my-audio-playbar-btn {
    background: #2d2d44;
    color: #ccc;
}

.night-mode .my-audio-recording {
    background: #2d1f2f;
    color: #ff9eb5;
}

/* ========= 哄睡音乐播放设置底部面板 ========= */
.sleep-settings-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35);
    z-index: 299;
    animation: fadeIn 0.25s ease;
}

.sleep-settings-sheet {
    position: fixed;
    left: 0; right: 0;
    bottom: 82px; /* 底部导航栏上方 */
    z-index: 300;
    background: #fff;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: sheetSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    padding-bottom: env(safe-area-inset-bottom);
}

@keyframes sheetSlideUp {
    0% { transform: translateY(100%); opacity: 0.5; }
    100% { transform: translateY(0); opacity: 1; }
}

.sleep-sheet-handle {
    width: 40px;
    height: 5px;
    border-radius: 3px;
    background: #d0d5dd;
    margin: 10px auto 6px;
}

.sleep-sheet-header {
    display: flex;
    align-items: center;
    padding: 10px 20px 14px;
    gap: 14px;
}

.sleep-sheet-icon {
    font-size: 38px;
    line-height: 1;
    flex-shrink: 0;
}

.sleep-sheet-info {
    flex: 1;
}

.sleep-sheet-name {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.sleep-sheet-desc {
    font-size: 13px;
    color: #888;
    margin-top: 2px;
}

.sleep-sheet-close {
    font-size: 22px;
    color: #bbb;
    cursor: pointer;
    flex-shrink: 0;
    padding: 4px 8px;
    border-radius: 50%;
    transition: background 0.15s;
}
.sleep-sheet-close:hover {
    background: #f0f2f5;
}

.sleep-sheet-body {
    padding: 0 20px 10px;
}

.sleep-sheet-row {
    margin-bottom: 18px;
}

.sleep-sheet-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.sleep-sheet-range {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, #2192EB 60%, #e8ecf0 60%);
    border-radius: 3px;
    outline: none;
    margin-bottom: 4px;
}
.sleep-sheet-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2192EB;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(91,155,213,0.35);
    cursor: pointer;
}

.sleep-sheet-val {
    font-size: 13px;
    color: #2192EB;
    font-weight: 600;
    float: right;
}

.sleep-sheet-timers {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sleep-sheet-timer {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: #f0f2f5;
    color: #666;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 2px solid transparent;
}
.sleep-sheet-timer.active {
    background: #e8f4fd;
    color: #2192EB;
    border-color: #2192EB;
}

.sleep-sheet-record-btn {
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    background: #f0f2f5;
    color: #666;
    border: none;
    cursor: pointer;
    margin-right: 8px;
    transition: all 0.15s;
}
.sleep-sheet-record-btn:active {
    transform: scale(0.96);
}

.sleep-sheet-actions {
    padding: 10px 20px 20px;
}

.sleep-sheet-btn {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    border: none;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 6px 20px rgba(91,155,213,0.3);
}
.sleep-sheet-btn.play {
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    color: #fff;
}
.sleep-sheet-btn.stop {
    background: linear-gradient(135deg, #FF9EBB, #FFC2D6);
    color: #fff;
}
.sleep-sheet-btn:active {
    transform: scale(0.97);
}

/* 深色模式 */
.night-mode .sleep-settings-sheet {
    background: #1a1a2e;
}
.night-mode .sleep-sheet-name { color: #f0f0f0; }
.night-mode .sleep-sheet-desc { color: #888; }
.night-mode .sleep-sheet-close { color: #666; }
.night-mode .sleep-sheet-close:hover { background: #2d2d44; }
.night-mode .sleep-sheet-label { color: #bbb; }
.night-mode .sleep-sheet-range { background: linear-gradient(90deg, #2192EB 60%, #2d2d44 60%); }
.night-mode .sleep-sheet-timer { background: #2d2d44; color: #ccc; }
.night-mode .sleep-sheet-timer.active { background: #1a3a5c; color: #7EB8E3; border-color: #2192EB; }
.night-mode .sleep-sheet-record-btn { background: #2d2d44; color: #ccc; }

/* ========= 宝宝档案-生长发育摘要卡片 ========= */
#growthSummaryCard {
    transition: box-shadow 0.2s;
}
#growthSummaryCard:hover {
    box-shadow: 0 4px 16px rgba(91,155,213,0.12);
}
.growth-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 8px;
}
.growth-summary-item {
    background: linear-gradient(135deg, #f8fbff, #f0f6ff);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #e8f0ff;
}
.growth-summary-item .gs-label {
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
}
.growth-summary-item .gs-value {
    font-size: 20px;
    font-weight: 700;
    color: #2192EB;
    line-height: 1.2;
}
.growth-summary-item .gs-unit {
    font-size: 11px;
    color: #aaa;
    margin-left: 1px;
}
.growth-summary-item .gs-percentile {
    font-size: 10px;
    color: #8BC34A;
    margin-top: 2px;
}
.growth-summary-meta {
    font-size: 11px;
    color: #bbb;
    text-align: center;
    padding-top: 6px;
    border-top: 1px solid #f0f2f5;
}
.night-mode .growth-summary-item {
    background: #2a2a40;
    border-color: #3a3a55;
}
.night-mode .growth-summary-item .gs-value {
    color: #7DB8FF;
}
.night-mode .growth-summary-meta {
    border-color: #333;
}

/* ========== 快捷记录信息页通用样式 ========== */
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 101;
}
.sub-page-header .back-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: var(--radius-xs);
    font-size: 16px;
    cursor: pointer;
}
.sub-page-header h3 {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
}

.qf-option {
    padding: 14px 8px;
    border-radius: 12px;
    border: 2px solid #e8ecf0;
    background: #fafbfc;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}
.qf-option.active {
    border-color: var(--primary);
    background: #eef6fc;
    color: var(--primary-dark);
}

.qf-sleep-btn.recording {
    background: linear-gradient(135deg, #FF6B6B, #FF8E8E) !important;
    border-color: #FF6B6B !important;
    animation: sleepBtnPulse 1.2s ease-in-out infinite;
}

@keyframes sleepBtnPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* ========== 语音录音高级动画浮层 ========== */
#voiceAnimOverlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9990;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px 20px;
}
.night-mode #voiceAnimOverlay {
    background: linear-gradient(145deg, rgba(22,27,34,0.98), rgba(13,17,23,0.98));
    border-color: rgba(255,255,255,0.08);
    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}
#voiceAnimOverlay.show {
    display: flex;
    animation: voiceOverlayIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes voiceOverlayIn {
    from { opacity: 0; transform: translate(-50%, -45%) scale(0.92); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.voice-overlay-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}
.voice-rec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4d4f;
    box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.5);
    animation: voiceRecDot 1.2s ease-out infinite;
}
@keyframes voiceRecDot {
    0% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(255, 77, 79, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0); }
}
.voice-icon-wrap {
    position: relative;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.voice-mic-icon {
    width: 44px;
    height: 44px;
    color: var(--primary);
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 4px 10px rgba(91,155,213,0.25));
}
.voice-pulse-ring {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    border: 2px solid rgba(91,155,213,0.35);
    animation: voicePulseRing 1.8s ease-out infinite;
}
.voice-pulse-ring:nth-child(2) { animation-delay: 0.6s; }
.voice-pulse-ring:nth-child(3) { animation-delay: 1.2s; }
@keyframes voicePulseRing {
    0% { transform: scale(0.85); opacity: 0.55; }
    60% { opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}
.voice-timer {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    margin-bottom: 12px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.voice-waveform {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
    height: 36px;
    margin-bottom: 14px;
}
.voice-waveform .vwb {
    width: 5px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--primary-light), var(--primary));
    opacity: 0.75;
    transform-origin: bottom;
    animation: voiceWaveBarAnim 1.1s ease-in-out infinite;
}
.voice-waveform .vwb:nth-child(1) { height: 18%; animation-delay: 0.0s; }
.voice-waveform .vwb:nth-child(2) { height: 45%; animation-delay: 0.1s; }
.voice-waveform .vwb:nth-child(3) { height: 70%; animation-delay: 0.2s; }
.voice-waveform .vwb:nth-child(4) { height: 55%; animation-delay: 0.15s; }
.voice-waveform .vwb:nth-child(5) { height: 85%; animation-delay: 0.25s; }
.voice-waveform .vwb:nth-child(6) { height: 60%; animation-delay: 0.1s; }
.voice-waveform .vwb:nth-child(7) { height: 40%; animation-delay: 0.3s; }
.voice-waveform .vwb:nth-child(8) { height: 75%; animation-delay: 0.2s; }
.voice-waveform .vwb:nth-child(9) { height: 30%; animation-delay: 0.05s; }
@keyframes voiceWaveBarAnim {
    0%, 100% { transform: scaleY(0.55); opacity: 0.6; }
    50% { transform: scaleY(1.0); opacity: 1; }
}
.voice-hint {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.voice-max-time {
    font-size: 11px;
    color: var(--text-light);
}

/* ========== 语音结果弹窗：播放器 / 纠正 chips / 重录 ========== */
.voice-audio-player {
    background: #f5f7fa;
    border-radius: 12px;
    padding: 12px;
}
.voice-play-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #2192EB, #2192EB);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    min-width: 80px;
}
.voice-play-btn:active { transform: scale(0.96); }
.voice-progress-wrap {
    width: 100%;
    height: 5px;
    background: #e1e8ed;
    border-radius: 3px;
    overflow: hidden;
}
.voice-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2192EB, #2192EB);
    border-radius: 3px;
    transition: width 0.1s linear;
}
.voice-correction-wrap { }
.voice-correction-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.voice-chip {
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid #e8ecf0;
    background: #fff;
    color: #2192EB;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.voice-chip:hover {
    background: #2192EB;
    color: #fff;
    border-color: #2192EB;
}
.voice-chip:active { transform: scale(0.95); }

.voice-btn-retry {
    padding: 12px 18px;
    border-radius: 10px;
    border: 1.5px solid #F5A623;
    background: #fff;
    color: #F5A623;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.voice-btn-retry:hover { background: #FFF8E6; }
.voice-btn-retry:active { transform: scale(0.96); }

/* ========== 生长发育测评页面 ========== */
.macaron-growth { background: linear-gradient(135deg, #a8e063, #56ab2f); color: #fff; }

.gr-tabs {
    display: flex;
    gap: 0;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid #e8ecf0;
    position: sticky;
    top: 48px;
    z-index: 5;
}
.gr-tab {
    flex: 1;
    padding: 12px 0;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: #999;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.gr-tab.active {
    color: #6C8EBF;
    border-bottom-color: #6C8EBF;
    font-weight: 600;
}

.gr-panel {
    display: none;
    padding: 16px;
    animation: grFadeIn 0.25s ease;
}
.gr-panel.active { display: block; }
@keyframes grFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 记录录入 */
.gr-record-form {
    background: #fff;
    border-radius: 16px;
    padding: 20px 16px;
    box-shadow: 0 2px 12px rgba(108,142,191,0.08);
}
.gr-form-group {
    margin-bottom: 14px;
}
.gr-form-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}
.gr-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e0e6ef;
    border-radius: 10px;
    font-size: 15px;
    background: #f8f9fc;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.gr-input:focus {
    border-color: #6C8EBF;
    outline: none;
    background: #fff;
}
.gr-save-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #6C8EBF, #8FAACB);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.gr-save-btn:active {
    transform: scale(0.97);
}

.gr-recent-list {
    margin-top: 20px;
}
.gr-recent-title {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    padding-left: 2px;
}
.gr-recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
    font-size: 13px;
}
.gr-recent-item .gri-date { color: #999; min-width: 90px; }
.gr-recent-item .gri-values { color: #333; flex: 1; text-align: right; padding: 0 8px; }
.gr-recent-item .gri-del {
    background: none; border: none; color: #e74c3c; font-size: 16px;
    cursor: pointer; padding: 0 4px;
}

/* 生长曲线 */
.gr-chart-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}
.gr-chart-btn {
    padding: 8px 20px;
    border: 1.5px solid #e0e6ef;
    border-radius: 20px;
    background: #fff;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}
.gr-chart-btn.active {
    background: #6C8EBF;
    color: #fff;
    border-color: #6C8EBF;
}

.gr-chart-canvas-wrap {
    background: #fff;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 2px 12px rgba(108,142,191,0.08);
    margin-bottom: 16px;
}
#grChartCanvas {
    width: 100%;
    height: auto;
    display: block;
}

.gr-percentile-info {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}
.gr-pi-item {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.gr-pi-label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}
.gr-pi-value {
    font-size: 18px;
    font-weight: 700;
    color: #6C8EBF;
}

.gr-who-ref {
    font-size: 11px;
    color: #bbb;
    text-align: center;
    margin-top: 4px;
}

/* 发育里程碑 */
.gr-milestone-intro {
    background: linear-gradient(135deg, #f8f9fc, #e8ecf0);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
}
.gr-mi-age {
    font-size: 15px;
    font-weight: 600;
    color: #6C8EBF;
    margin-bottom: 6px;
}
.gr-mi-age span { font-size: 20px; }
.gr-mi-desc {
    font-size: 13px;
    color: #888;
}

.gr-milestone-group {
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}
.gr-mg-title {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}
.gr-mg-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: #444;
    cursor: pointer;
    transition: background 0.15s;
}
.gr-mg-item:hover { background: #f8f9fc; }
.gr-mg-item input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #6C8EBF;
}
.gr-mg-item.checked { color: #6C8EBF; }
.gr-mg-item.checked::after {
    content: ' ✅';
    font-size: 12px;
}

.gr-assess-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #a8e063, #56ab2f);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: transform 0.15s;
}
.gr-assess-btn:active { transform: scale(0.97); }

.gr-assess-result {
    margin-top: 16px;
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(108,142,191,0.08);
}
.gr-ar-title {
    font-size: 15px;
    font-weight: 600;
    color: #6C8EBF;
    margin-bottom: 10px;
}
.gr-ar-score {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    margin: 12px 0;
}
.gr-ar-detail {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

/* 深色模式 */
.night-mode .gr-tabs { background: #1e1e2e; border-bottom-color: #2d2d44; }
.night-mode .gr-tab { color: #888; }
.night-mode .gr-tab.active { color: #8FAACB; border-bottom-color: #8FAACB; }
.night-mode .gr-record-form,
.night-mode .gr-recent-item,
.night-mode .gr-chart-canvas-wrap,
.night-mode .gr-pi-item,
.night-mode .gr-milestone-group,
.night-mode .gr-assess-result { background: #1e1e2e; }
.night-mode .gr-input { background: #2d2d44; color: #eee; border-color: #3d3d55; }
.night-mode .gr-form-group label { color: #aaa; }
.night-mode .gr-recent-title { color: #ccc; }
.night-mode .gri-values { color: #ddd; }
.night-mode .gr-mi-desc { color: #aaa; }
.night-mode .gr-mg-title { color: #ccc; border-bottom-color: #2d2d44; }
.night-mode .gr-mg-item { color: #ccc; }

/* ===== 全局按钮统一动效 ===== */
/* 水波纹动效 */
.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out forwards;
    pointer-events: none;
    z-index: 1;
}
@keyframes rippleAnim {
    0%   { transform: scale(0); opacity: 0.6; }
    100% { transform: scale(4); opacity: 0; }
}

/* 按钮类元素：相对定位+溢出隐藏（水波纹容器） */
button,
.quick-entry-btn,
.quick-record-btn,
.record-tab,
.form-option,
.submit-btn,
.back-btn,
.send-btn,
.fab-btn,
.gr-assess-btn,
.growth-icon-btn,
.quick-more-toggle,
.aigen-reupload-btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

/* 卡片/导航类：相对定位（不需要overflow:hidden，避免裁剪内容） */
.nav-item,
.overview-card,
.aigen-upload-area,
.baby-card {
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

/* 按压状态：统一缩放开合 */
button:active:not(:disabled),
.quick-entry-btn:active,
.quick-record-btn:active,
.record-tab:active,
.form-option:active,
.nav-item:active,
.overview-card:active,
.submit-btn:active,
.back-btn:active,
.send-btn:active,
.fab-btn:active,
.gr-assess-btn:active,
.growth-icon-btn:active,
.quick-more-toggle:active,
.baby-card:active {
    transform: scale(0.93) !important;
    opacity: 0.88;
}

/* 加载状态：脉冲呼吸+禁用点击 */
.btn-loading,
button[disabled].btn-loading {
    pointer-events: none;
    opacity: 0.65;
    animation: btnLoadingPulse 1.4s ease-in-out infinite;
}
@keyframes btnLoadingPulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 0.85; }
}

/* AI快捷标签和宝宝卡片按压效果 */
.baby-card,
.page-ai span[onclick],
.page-ai div[onclick] {
    position: relative;
    transition: transform 0.18s ease, opacity 0.18s ease;
}
.baby-card:active,
.page-ai span[onclick]:active,
.page-ai div[onclick]:active {
    transform: scale(0.95) !important;
    opacity: 0.85;
}

/* 深色按钮水波纹颜色加深 */
.quick-record-btn .btn-ripple,
.record-tab .btn-ripple,
.form-option .btn-ripple {
    background: rgba(255, 255, 255, 0.35);
}
.nav-item .btn-ripple,
.overview-card .btn-ripple {
    background: rgba(91, 155, 213, 0.25);
}

/* 录音呼吸脉冲动画 */
@keyframes breathPulse {
    0%, 100% {
        box-shadow: 0 0 12px rgba(139, 21, 56, 0.18), 0 0 28px rgba(255, 154, 174, 0.12);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(139, 21, 56, 0.32), 0 0 44px rgba(255, 154, 174, 0.22);
        transform: scale(1.06);
    }
}
@keyframes pulseRing {
    0% {
        transform: scale(0.85);
        opacity: 0.7;
        border-color: rgba(255, 154, 174, 0.6);
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
        border-color: rgba(255, 154, 174, 0);
    }
}
@keyframes pulseRingSister {
    0% {
        transform: scale(0.85);
        opacity: 0.7;
        border-color: rgba(255, 194, 214, 0.6);
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
        border-color: rgba(255, 194, 214, 0);
    }
}

/* ========== 环形加载进度条 ========== */
.ring-loader {
    width: 48px;
    height: 48px;
    position: relative;
    margin: 0 auto;
}
.ring-loader svg {
    width: 48px;
    height: 48px;
    transform: rotate(-90deg);
}
.ring-loader .ring-bg {
    fill: none;
    stroke: #f0f0f0;
    stroke-width: 4;
}
.ring-loader .ring-fg {
    fill: none;
    stroke: #FFB3C6;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 113.1;
    stroke-dashoffset: 113.1;
    animation: ringProgress 1.8s ease-in-out infinite;
}
@keyframes ringProgress {
    0%   { stroke-dashoffset: 113.1; }
    50%  { stroke-dashoffset: 28.3; }
    100% { stroke-dashoffset: 113.1; }
}
.ring-loader .ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    color: #A61E5A;
    font-weight: 700;
}
/* 页面切入动画 */
@keyframes pageFadeIn {
    0%   { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ========================================
   统一弹窗过渡动画 V2024062708
   ======================================== */

/* ---- 通用内联弹窗动画 ---- */
/* 遮罩层淡入 */
.anim-overlay-in {
    animation: animOverlayFadeIn 0.28s ease forwards !important;
}
/* 遮罩层淡出 */
.anim-overlay-out {
    animation: animOverlayFadeOut 0.28s ease forwards !important;
}
@keyframes animOverlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes animOverlayFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 内容层弹入（从下方滑入+缩放+淡入） */
.anim-content-in {
    animation: animContentSlideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1) forwards !important;
}
/* 内容层弹出（向下滑出+缩放+淡出） */
.anim-content-out {
    animation: animContentSlideDown 0.28s cubic-bezier(0.4, 0, 0.6, 1) forwards !important;
}
@keyframes animContentSlideUp {
    0%   { transform: translateY(30px) scale(0.96); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes animContentSlideDown {
    0%   { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(30px) scale(0.96); opacity: 0; }
}

/* ---- Toast 提示动画升级 ---- */
#toast {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---- 首页卡片入场交错动画 ---- */
.page-home.active .baby-card {
    animation: cardStaggerIn 0.45s cubic-bezier(0.32, 0.72, 0, 1) forwards;
    animation-delay: 0.05s;
    opacity: 0;
}
.page-home.active .overview-grid .overview-card {
    animation: cardStaggerIn 0.45s cubic-bezier(0.32, 0.72, 0, 1) forwards;
    opacity: 0;
}
.page-home.active .overview-grid .overview-card:nth-child(1) { animation-delay: 0.10s; }
.page-home.active .overview-grid .overview-card:nth-child(2) { animation-delay: 0.15s; }
.page-home.active .overview-grid .overview-card:nth-child(3) { animation-delay: 0.20s; }
.page-home.active .overview-grid .overview-card:nth-child(4) { animation-delay: 0.25s; }

.page-home.active .quick-section {
    animation: cardStaggerIn 0.45s cubic-bezier(0.32, 0.72, 0, 1) forwards;
    animation-delay: 0.20s;
    opacity: 0;
}
.page-home.active .quick-entry-bar {
    animation: cardStaggerIn 0.5s cubic-bezier(0.32, 0.72, 0, 1) forwards;
    animation-delay: 0.28s;
    opacity: 0;
}
.page-home.active .ai-daily-card,
.page-home.active .ai-weekly-card {
    animation: cardStaggerIn 0.45s cubic-bezier(0.32, 0.72, 0, 1) forwards;
    animation-delay: 0.35s;
    opacity: 0;
}
.page-home.active .recent-section {
    animation: cardStaggerIn 0.45s cubic-bezier(0.32, 0.72, 0, 1) forwards;
    animation-delay: 0.40s;
    opacity: 0;
}

@keyframes cardStaggerIn {
    0%   { opacity: 0; transform: translateY(16px) scale(0.97); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- QUICK 更多下拉动画增强 ---- */
.quick-more-dropdown {
    transform-origin: top;
    animation: quickMoreExpand 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes quickMoreExpand {
    0%   { opacity: 0; transform: scaleY(0.8) translateY(-8px); }
    100% { opacity: 1; transform: scaleY(1) translateY(0); }
}

/* ---- DAU 活跃用户脉冲点 ---- */
@keyframes dauPulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
    50%      { opacity: 0.7; transform: scale(1.3); box-shadow: 0 0 0 3px rgba(76, 175, 80, 0); }
}

/* ---- 子页面标题栏滑入 ---- */
.sub-page.active .sub-page-header {
    animation: headerSlideDown 0.3s ease-out;
}
@keyframes headerSlideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ---- 子页面滑入/滑出 ---- */
.sub-page.sub-page-slide-in {
    animation: subPageSlideIn 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes subPageSlideIn {
    from { transform: translateX(100%); opacity: 0.3; }
    to   { transform: translateX(0); opacity: 1; }
}
.sub-page.sub-page-slide-out {
    animation: subPageSlideOut 0.28s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}
@keyframes subPageSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(100%); opacity: 0.3; }
}

/* ---- 夜间模式弹窗动画适配 ---- */
.night-mode .anim-overlay-in,
.night-mode .anim-overlay-out {
    background: rgba(0,0,0,0.6);
}

/* ========== 全局输入框聚焦样式 ========== */
input:focus, textarea:focus, select:focus {
    border-color: var(--primary, #2192EB) !important;
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.12) !important;
    background: #fff !important;
}
.night-mode input:focus, .night-mode textarea:focus, .night-mode select:focus {
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.2) !important;
}

/* ========== 知识库卡片 ========== */
.knowledge-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.03);
    border: 1px solid #f0f2f5;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.knowledge-card:active {
    transform: scale(0.97);
    background: #f8f9fb;
}
.knowledge-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #2192EB, #B1E0F6);
    opacity: 0;
    transition: opacity 0.2s;
}
.knowledge-card:active::before {
    opacity: 1;
}
.knowledge-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}
.knowledge-card-desc {
    font-size: 12px;
    color: #aaa;
}

/* ========== "我的"页面 ========== */
.mine-user-card {
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    border-radius: 16px;
    padding: 22px 18px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 16px rgba(91, 155, 213, 0.2);
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.mine-user-card::after {
    content: '';
    position: absolute;
    right: -20px; top: -20px;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}
.mine-user-card::before {
    content: '';
    position: absolute;
    right: 20px; bottom: -30px;
    width: 60px; height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
}
.mine-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.3);
}
.night-mode .mine-user-card {
    background: linear-gradient(135deg, #3A6BA0, #4A80B8);
}

.mine-menu-list {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.03);
    border: 1px solid #f0f2f5;
    overflow: hidden;
}
.night-mode .mine-menu-list {
    background: #2a2d3e;
    border-color: #3a3d4e;
}

/* 我的页面 */
.page-mine {
    padding-bottom: 90px !important;
    background: linear-gradient(180deg, #f3f0ff 0%, #ede9fe 50%, #f8f7ff 100%);
    min-height: 100%;
    box-sizing: border-box;
}
.page-mine.active {
    display: block !important;
}

/* 子页面返回按钮 */
.sub-page-back-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border: none;
    border-bottom: 1px solid #e8ecf4;
    font-size: 15px;
    font-weight: 600;
    color: #5b9bd5;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    margin: 0;
}

.sub-page-back-btn:active {
    background: linear-gradient(135deg, #e8ecf4 0%, #d8e0f0 100%);
    transform: scale(0.98);
}

.night-mode .sub-page-back-btn {
    background: linear-gradient(135deg, #2a2d3e 0%, #33364a 100%);
    border-bottom-color: #3a3d4e;
    color: #7ab3e8;
}

.night-mode .sub-page-back-btn:active {
    background: linear-gradient(135deg, #33364a 0%, #3a3d4e 100%);
}

.mine-menu-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #f5f7fa;
    cursor: pointer;
    transition: background 0.15s ease;
}
.mine-menu-item:active {
    background: #f0f4f8;
}
.night-mode .mine-menu-item {
    border-bottom-color: #3a3d4e;
}
.night-mode .mine-menu-item:active {
    background: #333648;
}

.mine-menu-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.mine-menu-text {
    flex: 1;
    font-size: 14px;
    color: #333;
    margin-left: 12px;
    font-weight: 500;
}
.night-mode .mine-menu-text {
    color: #e0e0e0;
}
.mine-menu-arrow {
    color: #c5cad3;
    font-size: 18px;
    transition: transform 0.15s;
}
.mine-menu-item:active .mine-menu-arrow {
    transform: translateX(3px);
    color: #2192EB;
}

/* ========== 统计页面 ========== */
.stats-period-select {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid #e8ecf0;
    background: #fff;
    color: #666;
    outline: none;
    cursor: pointer;
    font-weight: 500;
}

.stats-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #f0f2f5;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s;
}
.stats-card:active {
    transform: scale(0.96);
}
.stats-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 8px;
}
.stats-card-label {
    font-size: 11px;
    color: #999;
    letter-spacing: 0.3px;
    font-weight: 500;
}
.stats-card-value {
    font-size: 28px;
    font-weight: 800;
    margin-top: 2px;
    line-height: 1.2;
}
.stats-card-unit {
    font-size: 10px;
    color: #bbb;
    margin-top: 2px;
}

.stats-chart-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid #f0f2f5;
    margin-bottom: 14px;
}
.stats-chart-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.night-mode .stats-card,
.night-mode .stats-chart-card {
    background: #2a2d3e;
    border-color: #3a3d4e;
}
.night-mode .stats-chart-title {
    color: #e0e0e0;
}
.night-mode .stats-card-label,
.night-mode .stats-card-unit {
    color: #888;
}

/* ========== 家庭圈样式 ========== */
@keyframes modalSlideUp {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.family-circle-card {
    background: linear-gradient(135deg, #2192EB, #B1E0F6);
    border-radius: 16px;
    padding: 20px 18px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(91,155,213,0.25);
    position: relative;
    overflow: hidden;
}
.family-circle-card::after {
    content: '';
    position: absolute;
    right: -15px; top: -15px;
    width: 70px; height: 70px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}
.night-mode .family-circle-card {
    background: linear-gradient(135deg, #2a3a5a, #3a4a6a);
}

.family-member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid #f0f2f5;
    transition: transform 0.15s;
}
.family-member-card:active { transform: scale(0.98); }
.night-mode .family-member-card {
    background: #2a2d3e;
    border-color: #3a3d4e;
}

.family-member-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.family-online-dot {
    position: absolute;
    bottom: 0; right: 0;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #52C41A;
    border: 2px solid #fff;
}
.family-offline-dot {
    position: absolute;
    bottom: 0; right: 0;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #d0d5dd;
    border: 2px solid #fff;
}

.family-role-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
}
.family-role-badge.owner {
    background: #FFF7E6;
    color: #D48806;
}
.family-role-badge.editor {
    background: #E6F7FF;
    color: #1890FF;
}
.family-role-badge.viewer {
    background: #F5F5F5;
    color: #999;
}
.night-mode .family-role-badge.owner {
    background: #3a2e1a;
    color: #D48806;
}
.night-mode .family-role-badge.editor {
    background: #1a2a3a;
    color: #69C0FF;
}
.night-mode .family-role-badge.viewer {
    background: #333;
    color: #777;
}

/* 记录者标签 */
.record-creator-tag {
    display: inline-block;
    font-size: 10px;
    padding: 0px 5px;
    border-radius: 4px;
    background: #f0f7ff;
    color: #2192EB;
    font-weight: 600;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1.6;
}
.night-mode .record-creator-tag {
    background: #1a2a3a;
    color: #69C0FF;
}

/* 夜间模式适配 */
.night-mode #familyPageContent .family-member-card {
    background: #2a2d3e;
    border-color: #3a3d4e;
}
.night-mode #familyInviteOverlay > div,
.night-mode #familyRegisterOverlay > div,
.night-mode #familyJoinOverlay > div {
    background: #2a2d3e;
}

/* ========== 马卡龙色系悬浮窗/面板背景 ========== */
:root {
    --macaron-pink: #FFF5F7;
    --macaron-pink-dot: rgba(255, 194, 214, 0.45);
    --macaron-blue: #F0F9FF;
    --macaron-blue-dot: rgba(179, 224, 255, 0.5);
    --macaron-mint: #F0FFF7;
    --macaron-mint-dot: rgba(167, 243, 208, 0.45);
    --macaron-lavender: #F5F3FF;
    --macaron-lavender-dot: rgba(196, 181, 253, 0.4);
    --macaron-peach: #FFF7ED;
    --macaron-peach-dot: rgba(254, 215, 170, 0.5);
    --macaron-lemon: #FFFBEB;
    --macaron-lemon-dot: rgba(253, 230, 138, 0.45);
}

/* 柔和模糊的圆点图案 */
.macaron-pattern {
    background-image:
        radial-gradient(circle at 18% 22%, var(--dot) 0, transparent 18%),
        radial-gradient(circle at 82% 18%, var(--dot) 0, transparent 16%),
        radial-gradient(circle at 12% 78%, var(--dot) 0, transparent 14%),
        radial-gradient(circle at 88% 82%, var(--dot) 0, transparent 17%),
        radial-gradient(circle at 52% 52%, var(--dot) 0, transparent 12%);
    background-size: 120% 120%;
    background-blend-mode: multiply;
}

/* AI语音通话浮层：蜜桃粉 */
.ai-voice-overlay {
    background: var(--macaron-pink);
    --dot: var(--macaron-pink-dot);
}
.ai-voice-overlay.macaron-pattern {
    border-color: rgba(255, 194, 214, 0.85);
}

/* 底部弹窗容器：婴儿蓝 */
.modal-container {
    background: var(--macaron-blue);
    --dot: var(--macaron-blue-dot);
}

/* 哄睡音乐面板：薰衣草紫 */
.sleep-music-panel {
    background: var(--macaron-lavender);
    --dot: var(--macaron-lavender-dot);
}
.sleep-music-visual {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* AI写真面板：薄荷绿 */
.aigen-panel {
    background: var(--macaron-mint);
    --dot: var(--macaron-mint-dot);
}
.aigen-step,
.aigen-upload-area,
.aigen-preview-area,
.aigen-scene-grid,
.aigen-result-area,
.aigen-result-actions {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.85);
}

/* 隐私弹窗：柠檬黄 */
.privacy-modal-content {
    background: var(--macaron-lemon);
    --dot: var(--macaron-lemon-dot);
}

/* 应用锁屏：淡粉 */
.app-lock-content {
    background: var(--macaron-pink);
    --dot: var(--macaron-pink-dot);
}

/* 夜间模式下的马卡龙面板统一压暗 */
.night-mode .ai-voice-overlay,
.night-mode .modal-container,
.night-mode .sleep-music-panel,
.night-mode .aigen-panel,
.night-mode .privacy-modal-content,
.night-mode .app-lock-content {
    background: #252030;
    --dot: rgba(255, 255, 255, 0.06);
    background-image: none;
}
.night-mode .sleep-music-visual,
.night-mode .aigen-step,
.night-mode .aigen-upload-area,
.night-mode .aigen-preview-area,
.night-mode .aigen-scene-grid,
.night-mode .aigen-result-area,
.night-mode .aigen-result-actions {
    background: #2a2d3e;
    border-color: #3a3d4e;
}

/* ========== 首页天气栏紧凑版 ========== */
.weather-bar {
    padding: 6px 14px 8px;
}
.weather-bar .weather-top-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: nowrap;
}
.weather-bar .weather-main-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #f0f7ff, #e8f5e9);
    border-radius: 14px;
    padding: 8px 12px;
    cursor: pointer;
    box-shadow: 0 1px 8px rgba(91, 155, 213, 0.12);
}
.weather-bar .weather-icon {
    font-size: 28px;
    line-height: 1;
}
.weather-bar .weather-temp {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    line-height: 1;
    min-width: 58px;
}
.weather-bar .weather-desc {
    font-size: 12px;
    color: #666;
}
.weather-bar .weather-tip {
    margin-top: 6px;
    padding: 6px 10px;
    background: linear-gradient(135deg, #fff9c4, #fff3e0);
    border-radius: 10px;
    font-size: 12px;
    color: #c25e00;
    line-height: 1.4;
}
.weather-bar .weather-quote {
    font-size: 10px;
    color: #b0bfcf;
    font-style: italic;
    margin-top: 5px;
    text-align: center;
}
.weather-bar .weather-refreshing .weather-icon {
    animation: weatherSpin 1s linear infinite;
}
@keyframes weatherSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========== 首页语音/拍照入口更醒目 ========== */
.quick-entry-bar {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 24px rgba(91, 155, 213, 0.1);
}
.quick-entry-btn {
    width: 92px;
    height: 92px;
    gap: 5px;
    font-size: 14px;
}
.quick-entry-btn .qeb-icon {
    width: 38px;
    height: 38px;
}
.quick-entry-btn .qeb-icon svg {
    width: 30px;
    height: 30px;
}
.voice-entry-btn {
    background: rgba(255, 194, 214, 0.75);
    box-shadow: 0 8px 24px rgba(166, 30, 90, 0.18);
}
.photo-entry-btn {
    background: rgba(179, 224, 255, 0.75);
    box-shadow: 0 8px 24px rgba(13, 92, 150, 0.14);
}



/* ========== 记录详情弹窗（QUICK项目详情） ========== */
.record-detail-modal {
    max-width: 380px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
}

.record-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.record-detail-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.record-detail-title {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary, #1a1a2e);
}

.record-detail-subtitle {
    font-size: 12px;
    color: var(--text-secondary, #999);
}

.record-detail-body {
    margin-bottom: 14px;
}

.record-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color, #f0f2f5);
}

.record-detail-label {
    font-size: 13px;
    color: var(--text-secondary, #999);
}

.record-detail-value {
    font-size: 14px;
    color: var(--text-primary, #333);
    font-weight: 500;
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

.record-detail-section {
    margin-top: 14px;
}

.record-detail-voice,
.record-detail-note {
    margin-top: 6px;
    font-size: 14px;
    color: var(--text-primary, #333);
    background: var(--bg-card, #f5f7fa);
    border-radius: 10px;
    padding: 12px;
    word-break: break-all;
}

.record-detail-photo {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 8px;
}

.record-detail-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
}

.record-detail-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
    background: var(--primary, #2192EB);
    color: #fff;
    transition: opacity 0.2s;
}

.record-detail-btn:active {
    opacity: 0.7;
}

/* 夜间模式 - 记录详情弹窗 */
.dark-mode .record-detail-modal {
    background: var(--bg-card, #161B22);
}

.dark-mode .record-detail-title {
    color: var(--text-primary, #e6edf3);
}

.dark-mode .record-detail-subtitle {
    color: var(--text-secondary, #8b949e);
}

.dark-mode .record-detail-row {
    border-bottom-color: var(--border-color, #30363d);
}

.dark-mode .record-detail-label {
    color: var(--text-secondary, #8b949e);
}

.dark-mode .record-detail-value {
    color: var(--text-primary, #e6edf3);
}

.dark-mode .record-detail-voice,
.dark-mode .record-detail-note {
    background: var(--bg, #0D1117);
    color: var(--text-primary, #e6edf3);
}

.dark-mode .record-detail-btn {
    background: var(--primary, #58a6ff);
}
