/**
 * Sage & Cream · 鼠尾草绿 + 暖白
 * 宁静 · 克制 · 护眼
 * 设计原则：单一主色 + 中性灰 / 纯色背景不渐变 / 高对比文字 / 极轻中性阴影
 */

/* ===== 全局氛围：纯色，不渐变 ===== */
body.page-app {
    background: var(--bg);
}

.main-content {
    background: var(--bg);
}

.page-login {
    background: #F2F0EA;
    position: relative;
    overflow: hidden;
}

/* 登录页柔和氛围装饰：极淡的圆形光晕，不喧宾夺主 */
.page-login::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -80px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: var(--primary-light);
    opacity: 0.6;
    pointer-events: none;
}

.page-login::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: #EEF2F4;
    opacity: 0.5;
    pointer-events: none;
}

.page-login .login-wrap {
    position: relative;
    z-index: 1;
}

.page-help {
    background: var(--bg);
}

/* ===== 顶栏：纯净暖白，简洁克制 ===== */
.app-header {
    background: var(--header-bg);
    color: var(--text);
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
}

.app-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0;
}

.user-greeting {
    color: var(--text-secondary);
    font-weight: 400;
}

.header-tagline {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 3px;
    font-weight: 400;
    letter-spacing: 0;
}

.btn-help-sm {
    background: var(--primary-light);
    color: var(--primary-dark);
    box-shadow: none;
    border: 1px solid var(--border);
}

.date-compact {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 10px;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.btn-date-sm {
    background: transparent;
    color: var(--primary);
    border-radius: 50%;
}

.btn-date-sm:active {
    background: var(--primary-light);
}

.btn-back-today {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
}

.hp-chip {
    background: var(--card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-weight: 500;
    box-shadow: none;
}

.progress-bar-sm .progress-fill,
.progress-bar-card .progress-fill {
    background: var(--primary);
}

.progress-text {
    color: var(--text-secondary);
}

/* ===== 底部导航：纯色，无毛玻璃 ===== */
.bottom-nav {
    background: var(--card);
    backdrop-filter: none;
    border-top: 1px solid var(--border);
    box-shadow: none;
}

.nav-item {
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-item.active {
    color: var(--primary);
    font-weight: 600;
}

/* ===== 卡片：纯白 + 清晰边框 + 极轻阴影 ===== */
.quick-cards {
    padding: 14px;
    gap: 12px;
}

.quick-card,
.grid-cell,
.mine-section,
.recent-list,
.chart-block,
.modal-body,
.slot-card,
.calendar-wrap,
.help-card {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.quick-card {
    border-radius: var(--radius);
    padding: 16px;
    background: var(--card);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.card-stat strong {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.card-stat {
    color: var(--text-secondary);
}

/* ===== 喝水 ===== */
.btn-water-primary {
    background: #E4EDF2;
    color: #4A7088;
    border-radius: var(--radius-sm);
    box-shadow: none;
    border: 1px solid #D6E2EA;
}

.btn-water-more {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    background: var(--card);
}

.btn-quick,
.btn-quick.water {
    background: #EAF0F4;
    color: #4A7088;
    border-radius: var(--radius-xs);
    font-weight: 600;
    border: 1px solid #DCE5EB;
}

/* ===== 用药快卡 ===== */
.medicine-quick-card {
    border-left: 3px solid var(--primary);
    background: var(--card);
}

.medicine-quick-card.done {
    border-left-color: var(--success);
    background: var(--card);
}

.med-quick-check {
    background: var(--card) !important;
    border: 2px solid var(--primary) !important;
    box-shadow: none;
}

.med-quick-check:active {
    background: var(--primary-light) !important;
}

.btn-med-more {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
}

/* ===== 主按钮：纯色克制 ===== */
.btn-primary {
    background: var(--primary);
    border-radius: var(--radius-sm);
    box-shadow: none;
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-ghost {
    color: var(--text-secondary);
}

.btn-big-action {
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.count-card .btn-big-action {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #D8E8DC;
}

.timer-card .btn-big-action.start {
    background: var(--warning-bg);
    color: #9A7A3A;
    border: 1px solid #E8D9B8;
}

.timer-card .btn-big-action.stop {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #E8D0D0;
}

.timer-card.running {
    border-color: #E8D9B8;
    background: #FCFAF4;
}

/* ===== 厕所 / 网格 ===== */
.btn-grid {
    background: var(--bg);
    color: var(--text-secondary);
    border-radius: var(--radius-xs);
    font-weight: 600;
    border: 1px solid var(--border);
}

.btn-grid.stop {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: #E8D0D0;
}

.btn-grid-text {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
}

.grid-cell {
    background: var(--card);
    border-radius: var(--radius-sm);
}

/* ===== 心情 ===== */
.mood-quick-btn,
.mood-quick-btn.sm {
    background: #F4F1F8;
    border: 1px solid #E5E0EE;
    border-radius: var(--radius-xs);
    transition: transform 0.15s ease, background 0.15s ease;
}

.mood-quick-btn:active,
.mood-quick-btn.sm:active {
    background: #E8E2F0;
    transform: scale(0.95);
}

.mood-compact .mood-slot-summary {
    color: var(--text-muted);
}

.mood-picker {
    background: #F4F1F8;
    border-radius: var(--radius-xs);
}

.body-home-slot {
    background: var(--primary-light);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
}

.body-home-slot.recorded {
    background: var(--success-bg);
    border-color: #D8E8DC;
}

.body-home-slot .value {
    color: var(--primary-dark);
}

/* ===== 运动 ===== */
.ex-quick-chip,
.ex-quick-chip.sm {
    background: #F5EAEA;
    color: #A87878;
    border: 1px solid #E8D8D8;
    border-radius: var(--radius-xs);
}

.exercise-compact .btn-grid-text.exercise-start {
    background: #F5EAEA;
    color: #A87878;
    border-color: #E8D8D8;
}

/* ===== 月经 ===== */
.period-card .btn-period-single,
.btn-period.start,
.btn-period.day {
    border-radius: var(--radius-xs);
    font-weight: 600;
}

.btn-period.start,
.btn-period-single.start {
    background: #F5E8EC;
    color: #A87888;
    border: 1px solid #E8D8DE;
}

.btn-period.day,
.btn-period-single.day {
    background: #F4F1F8;
    color: #8878A8;
    border: 1px solid #E5E0EE;
}

/* ===== 最近记录 ===== */
.recent-section h3 {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.recent-list {
    border-radius: var(--radius);
    background: var(--card);
}

.recent-item {
    border-bottom-color: var(--border);
}

.recent-item.tappable:active {
    background: var(--bg);
}

.recent-time {
    color: var(--text-muted);
}

/* 撤销二次确认状态 */
.recent-item.confirming {
    background: #FFF4F0;
    border-left: 3px solid #E09080;
}

.recent-time.confirming {
    color: #C06050;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.recent-confirm-actions {
    display: inline-flex;
    gap: 6px;
}

.recent-confirm-btn {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
}

.recent-confirm-btn:active {
    transform: scale(0.95);
}

.recent-confirm-btn.cancel {
    background: var(--bg);
    color: var(--text-secondary);
}

/* ===== 用药 Tab ===== */
.slot-card {
    border-radius: var(--radius);
    overflow: hidden;
}

.slot-header {
    background: var(--primary-light);
}

.slot-card.checked .slot-header {
    background: var(--success-bg);
}

.slot-card.checked {
    border-left: 3px solid var(--success);
}

.slot-check-btn {
    border: 2px solid var(--primary);
    background: var(--card);
}

.slot-check-btn.checked {
    background: var(--success);
    border-color: var(--success);
}

.vitamin-hint-bar {
    background: var(--warning-bg);
    border-bottom-color: #E8D9B8;
    color: #8A7A4A;
}

/* ===== 统计 ===== */
.stat-chip {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: none;
}

.stat-val {
    color: var(--primary);
}

.btn-range {
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-secondary);
}

.btn-range.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.chart-bar {
    border-radius: 4px 4px 0 0;
    opacity: 0.85;
}

/* ===== 我的 ===== */
.mine-section {
    border-radius: var(--radius);
    background: var(--card);
}

.btn-add-sm,
.btn-goal.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: var(--radius-xs);
}

.btn-goal {
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-secondary);
}

.custom-item-row {
    border-bottom-color: var(--border);
}

/* ===== 弹窗 ===== */
.modal-mask {
    background: rgba(45, 51, 48, 0.35);
    backdrop-filter: none;
}

.modal-body {
    border-radius: 20px 20px 0 0;
    background: var(--card);
}

.modal-body h3 {
    font-weight: 600;
    color: var(--text);
}

/* ===== 登录 ===== */
.login-card {
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.login-card h1 {
    font-weight: 600;
    color: var(--text);
}

.form-group input {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--card);
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 156, 142, 0.12);
}

/* ===== 帮助页 ===== */
.help-header {
    background: var(--header-bg);
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.help-header h1 {
    color: var(--text);
    font-weight: 600;
}

.help-sub {
    color: var(--text-secondary);
}

.help-back {
    color: var(--primary-dark);
}

.help-card {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
}

.help-card.highlight {
    background: var(--primary-light);
    border-color: var(--border);
}

.help-tip {
    background: var(--primary-light) !important;
    border-radius: var(--radius-xs);
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
    transform: translateX(-50%);
    background: rgba(45, 51, 48, 0.92);
    color: #fff;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 1000;
    white-space: nowrap;
    box-shadow: var(--shadow);
}

/* ===== 鼓励气泡：温暖、柔和、有呼吸感 ===== */
.encouragement {
    position: fixed;
    left: 50%;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 24px);
    transform: translateX(-50%) translateY(20px);
    background: var(--card);
    color: var(--text);
    padding: 14px 22px;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 500;
    z-index: 1001;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 90vw;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.encouragement.show {
    opacity: 1;
}

.encouragement.animate {
    transform: translateX(-50%) translateY(0);
}

.enc-emoji {
    font-size: 20px;
    line-height: 1;
}

.enc-text {
    line-height: 1.4;
}

@media (max-width: 360px) {
    .encouragement {
        font-size: 14px;
        padding: 12px 18px;
    }
}

/* ===== 空状态 / 加载 ===== */
.loading,
.empty-hint {
    color: var(--text-muted);
}

.all-done {
    color: var(--success);
}

/* ===== 日历圆点：低饱和 ===== */
.dot.water { background: #A8C0D4; }
.dot.pee { background: #B8D0E0; }
.dot.poop { background: #C8B8A8; }
.dot.period { background: #D8B0C0; }
.dot.med { background: var(--primary); }
.dot.exercise { background: #D8B0A0; }
.dot.mood { background: #B8A8C8; }

/* ===== 选中态 ===== */
.ex-feeling-chip.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

.body-slot-tab.active,
.ex-cat-tab.active,
.ex-cat-pick.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* ===== 用药方案编辑 ===== */
.schedule-slot-edit {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.schedule-preview-title {
    color: var(--primary-dark);
}

/* ===== 微动效 ===== */
.btn-quick:active,
.btn-water-primary:active,
.med-quick-check:active {
    transform: scale(0.97);
}

.form-group label,
.ex-feeling-label,
.mood-hint {
    font-weight: 500;
    color: var(--text-secondary);
}

/* ===== 顶栏退出按钮 ===== */
.btn-logout {
    color: var(--primary-dark);
    border: 1px solid var(--border);
    background: var(--card);
}

/* ===== 首页视觉精修 ===== */
/* 顶栏：呼吸感留白 */
.app-header {
    padding: 18px 18px 12px;
}

.header-top {
    margin-bottom: 10px;
}

.app-header h1 {
    font-size: 19px;
    line-height: 1.3;
}

.header-tagline {
    margin-top: 6px;
    font-size: 12.5px;
    line-height: 1.5;
    max-width: 200px;
}

/* 进度 chips：更精致 */
.home-progress-chips {
    gap: 6px;
    margin-top: 4px;
}

.hp-chip {
    padding: 5px 11px;
    font-size: 12px;
    line-height: 1.2;
}

/* 主内容区：上下留白 */
.quick-cards {
    padding: 14px 14px 8px;
    gap: 10px;
}

/* 卡片：呼吸感 */
.quick-card {
    padding: 16px;
}

/* 2x2 网格：间距更舒服 */
.home-grid {
    gap: 10px !important;
}

.grid-cell {
    padding: 14px 12px;
}

.grid-cell-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.grid-cell-title strong {
    color: var(--primary);
    font-weight: 700;
    margin-left: 2px;
}

.grid-cell-stat {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* 心情卡片：选中动效 */
.mood-quick-btn.sm {
    height: 40px;
    font-size: 22px;
    border-radius: var(--radius-xs);
    transition: transform 0.2s ease, background 0.2s ease;
}

.mood-quick-btn.pulse,
.ex-quick-chip.pulse,
.btn-ex-dur.pulse {
    animation: pulseSoft 0.5s ease;
}

@keyframes pulseSoft {
    0% { transform: scale(1); }
    40% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

.mood-slot-summary {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

/* 运动卡片：图标更精致 */
.ex-quick-chip.sm {
    height: 40px;
    font-size: 18px;
    border-radius: var(--radius-xs);
}

.ex-quick-row.compact {
    gap: 6px;
    margin-bottom: 8px;
}

/* 体重卡片：左右分槽更清晰 */
.body-home-slots.compact {
    gap: 8px;
}

.body-home-slot {
    padding: 10px 8px;
    text-align: center;
}

.body-home-slot .label {
    font-size: 11px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}

.body-home-slot .value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
}

.body-home-slot .value small {
    font-size: 11px;
    font-weight: 500;
    margin-left: 1px;
}

.body-home-slot .value.muted {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

/* 最近记录：更柔和 */
.recent-section {
    padding: 8px 14px 24px;
}

.recent-section h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text);
}

.recent-section .hint {
    font-size: 11px;
    color: var(--text-muted);
}

.recent-item {
    padding: 13px 14px;
    border-bottom-color: var(--border);
}

.recent-icon {
    font-size: 20px;
}

.recent-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.recent-time {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* 用药快卡：更精致 */
.medicine-quick-card {
    padding: 14px 16px;
}

.med-quick-main {
    gap: 12px;
}

.med-quick-info {
    flex: 1;
    min-width: 0;
}

.med-quick-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.med-quick-check {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    font-size: 20px;
}

/* 喝水卡片：进度条更柔和 */
.water-card .card-stat strong {
    font-size: 22px;
}

.water-primary-row {
    gap: 8px;
    margin-top: 10px;
}

.btn-water-primary {
    flex: 1;
    height: 44px;
    font-size: 14px;
}

.btn-water-more {
    width: 56px;
    height: 44px;
    font-size: 13px;
}

/* 空状态：温暖 */
.empty-hint {
    color: var(--text-muted);
    font-size: 13px;
    padding: 20px 14px;
    text-align: center;
}

.loading {
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== AI 每日寄语卡 ===== */
.ai-daily-card {
    margin: 0 14px 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #F2F5F0 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.ai-daily-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.ai-daily-icon {
    font-size: 16px;
}

.ai-daily-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-dark);
    letter-spacing: 0.5px;
}

.ai-daily-refresh {
    margin-left: auto;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-daily-refresh:active {
    background: rgba(255, 255, 255, 0.9);
}

.ai-daily-text {
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 10px;
}

.ai-daily-chat {
    border: none;
    background: transparent;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
}

.ai-daily-chat:active {
    opacity: 0.6;
}

/* ===== 首页 AI 陪伴入口 ===== */
.ai-companion-entry {
    margin: 0 14px 14px;
    padding: 14px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ai-companion-entry:active {
    background: var(--bg);
}

.ai-entry-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.ai-entry-text {
    flex: 1;
    min-width: 0;
}

.ai-entry-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.ai-entry-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.ai-entry-arrow {
    font-size: 22px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ===== 首页陪伴小屋入口 ===== */
.companion-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 14px 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #FCE8F0 0%, #F8E8F0 100%);
    border: 1px solid #F0D8E0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease;
}

.companion-entry:active {
    transform: scale(0.98);
}

.companion-entry-emoji {
    font-size: 32px;
    flex-shrink: 0;
    animation: petFloat 3s ease-in-out infinite;
}

@keyframes petFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.companion-entry-text {
    flex: 1;
    min-width: 0;
}

.companion-entry-title {
    font-size: 15px;
    font-weight: 700;
    color: #A05070;
}

.companion-entry-sub {
    font-size: 12px;
    color: #B07090;
    margin-top: 2px;
}

.companion-entry-points {
    background: rgba(255, 255, 255, 0.7);
    color: #C07090;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 14px;
    flex-shrink: 0;
}

/* ===== 心情低落"聊聊"邀请 ===== */
.mood-offer {
    position: fixed;
    left: 50%;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 24px);
    transform: translateX(-50%) translateY(20px);
    z-index: 1002;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    width: 92vw;
    max-width: 360px;
}

.mood-offer.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.mood-offer-inner {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mood-offer-icon {
    font-size: 22px;
}

.mood-offer-text {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: var(--text);
    line-height: 1.4;
}

.mood-offer-btn {
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 7px 16px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.mood-offer-btn:active {
    background: var(--primary-dark);
}

.mood-offer-close {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-xs);
    font-size: 13px;
    cursor: pointer;
}

/* ===== AI 聊天弹窗 ===== */
.ai-chat-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.ai-chat-mask {
    position: absolute;
    inset: 0;
    background: rgba(45, 51, 48, 0.4);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.ai-chat-modal:not(.hidden) .ai-chat-mask {
    opacity: 1;
}

.ai-chat-panel {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 88vh;
    height: 88dvh;
    background: var(--bg);
    border-radius: 20px 20px 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.ai-chat-modal:not(.hidden) .ai-chat-panel {
    transform: translateY(0);
}

.ai-chat-header {
    flex-shrink: 0;
    padding: 14px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-chat-avatar {
    font-size: 26px;
}

.ai-chat-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.ai-chat-status {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 1px;
}

.ai-chat-close {
    border: none;
    background: var(--bg);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
}

.ai-chat-close:active {
    background: var(--border);
}

.ai-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    -webkit-overflow-scrolling: touch;
}

.ai-msg {
    display: flex;
    margin-bottom: 14px;
    gap: 8px;
    max-width: 100%;
}

.ai-msg-avatar {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1.2;
}

.ai-msg-bubble {
    padding: 11px 14px;
    border-radius: 16px;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text);
    word-break: break-word;
}

.ai-msg-bot .ai-msg-bubble {
    background: var(--card);
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
}

.ai-msg-user {
    flex-direction: row-reverse;
}

.ai-msg-user .ai-msg-bubble {
    background: var(--primary);
    color: #fff;
    border-top-right-radius: 4px;
    border: none;
}

/* 打字动效 */
.ai-typing .ai-msg-bubble {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 14px 16px;
}

.ai-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: aiDotBounce 1.2s infinite ease-in-out;
}

.ai-dot:nth-child(2) { animation-delay: 0.15s; }
.ai-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes aiDotBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-5px); opacity: 1; }
}

.ai-chat-input-bar {
    flex-shrink: 0;
    padding: 10px 12px calc(10px + var(--safe-bottom));
    background: var(--card);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.ai-chat-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    line-height: 1.4;
    background: var(--bg);
    color: var(--text);
    outline: none;
}

.ai-chat-input:focus {
    border-color: var(--primary);
}

.ai-chat-send {
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.ai-chat-send:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
}

.ai-chat-send:not(:disabled):active {
    background: var(--primary-dark);
}

/* ===== 打卡奖励气泡 ===== */
.reward-bubble {
    position: fixed;
    left: 50%;
    bottom: 30%;
    transform: translate(-50%, 20px) scale(0.8);
    background: linear-gradient(135deg, #FFD4E5, #FFB8D1);
    color: #8A4060;
    padding: 12px 22px;
    border-radius: 28px;
    box-shadow: 0 6px 20px rgba(216, 128, 160, 0.35);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
    white-space: nowrap;
}

.reward-bubble.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.reward-bubble.hide {
    opacity: 0;
    transform: translate(-50%, -50px) scale(0.95);
    transition: opacity 0.45s ease, transform 0.5s ease;
}

.reward-heart {
    font-size: 18px;
    animation: rewardHeartPop 0.6s ease;
}

@keyframes rewardHeartPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}

.reward-points {
    font-size: 17px;
    font-weight: 700;
    color: #C04878;
}

.reward-text {
    font-weight: 500;
}
