/* ===== 记事打卡 — 马卡龙暖色系 (与 pet-personality 一致) ===== */

html, body { background: #f5f5f5; }
.tab-bar { position: relative; top: auto; left: auto; right: auto; display: flex; align-items: center; }
.tab-bar .tab-btn.active::after { background: rgb(242, 170, 110); opacity: 0.75; }
.tab-back {
    position: absolute; left: 0.32rem; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; color: #666;
    padding: 0.16rem 0.1rem; cursor: pointer; line-height: 1;
    display: flex; align-items: center; text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.tab-back svg { width: 0.52rem; height: 0.52rem; }
body {
    margin: 0;
    padding-bottom: 0.5rem; box-sizing: border-box;
}
#scroll-root {
    display: block;
    overflow-y: visible; background: #f5f5f5;
    padding-bottom: 0; height: auto;
}
#scroll-root::-webkit-scrollbar { display: none; }
.container {
    max-width: 23.52rem; width: 100%; margin: 0 auto;
    padding: 0.21rem 0.42rem 1.2rem 0.42rem; box-sizing: border-box;
}

.card {
    background: #fff; border-radius: 0.47rem;
    padding: 0.31rem; margin-bottom: 0.42rem;
}
.card-title {
    font-size: 0.37rem; font-weight: 600; color: #333;
    margin-bottom: 0.16rem; display: flex; align-items: center; gap: 0.16rem;
}
.card-title::before {
    content: ''; width: 0.08rem; height: 0.37rem;
    background: #FFB080; border-radius: 0.04rem; display: inline-block;
}

/* 简介卡片 */
.intro-card {
    display: flex; align-items: center; gap: 0.31rem;
    background: linear-gradient(135deg, #FFF0E5, #FFF8F0);
    border: 0.02rem solid #FFCFA0;
    border-radius: 0.47rem; padding: 0.31rem;
}
.intro-text h2 { margin: 0 0 0.1rem; font-size: 0.42rem; color: #E88850; }
.intro-text p { margin: 0; font-size: 0.29rem; color: #666; line-height: 1.6; }
.intro-disclaimer { margin-top: 0.16rem !important; font-size: 0.28rem !important; color: #9E9E9E !important; word-break: break-all; }
.intro-text .intro-brand { margin: 0.31rem 0 0; font-size: 0.28rem; color: #E88850; text-align: right; }

/* 宠物管理 */
.pet-tabs {
    display: flex; gap: 0.16rem; overflow-x: auto;
    padding: 0.24rem 0 0.08rem; scrollbar-width: none; align-items: center;
}
.pet-tabs.empty { flex-wrap: wrap; }
.pet-tabs::-webkit-scrollbar { display: none; }
.pet-tab {
    position: relative; flex: 0 0 auto; cursor: pointer;
    padding: 0.21rem 0.31rem; border-radius: 9999px;
    font-size: 0.34rem; color: #666; background: #f5f5f5;
    white-space: nowrap; text-align: center; border: none;
    font-family: inherit; min-width: 0; transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.pet-tab.active {
    background: #F0A060; color: #fff; font-weight: 600;
    box-shadow: 0 0.08rem 0.21rem rgba(240,160,96,0.3);
}
.pet-tab .pet-tab-del {
    position: absolute; top: -0.14rem; right: -0.14rem;
    width: 0.44rem; height: 0.44rem; border-radius: 50%;
    background: #E85C5C; color: #fff; font-size: 0.28rem;
    display: none; align-items: center; justify-content: center;
    line-height: 1; box-shadow: 0 0.04rem 0.1rem rgba(0,0,0,0.2);
}
.pet-tabs.manage .pet-tab .pet-tab-del { display: flex; }
.pet-tab-add {
    flex: 0 0 auto; cursor: pointer; padding: 0.21rem 0.31rem;
    border-radius: 9999px; font-size: 0.34rem; color: #E88850;
    background: #FFF0E5; border: 0.02rem dashed #FFCFA0;
    white-space: nowrap; text-align: center; font-family: inherit;
    transition: all 0.2s; -webkit-tap-highlight-color: transparent;
}
.pet-empty {
    flex: 0 0 100%;
    text-align: center; color: #aaa; font-size: 0.3rem; padding: 0.31rem 0;
}
.manage-toggle {
    flex: 0 0 auto; cursor: pointer; border: none; background: transparent;
    color: #999; font-size: 0.28rem; font-family: inherit;
    padding: 0.1rem 0.05rem; white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

/* 今日打卡 */
.checkin-meta {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.21rem;
}
.checkin-date { font-size: 0.32rem; color: #E88850; font-weight: 600; }
.checkin-summary { font-size: 0.28rem; color: #999; }
.checkin-progress {
    height: 0.16rem; border-radius: 999px; background: #f0f0f0;
    overflow: hidden; margin-bottom: 0.31rem;
}
.checkin-progress-bar {
    height: 100%; width: 0; border-radius: 999px;
    background: linear-gradient(90deg, #FFB080, #F0A060);
    transition: width 0.3s ease;
}
.checkin-list { display: flex; flex-direction: column; gap: 0.31rem; }

/* 宠物分组 */
.pet-group-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.14rem 0.08rem 0.18rem; margin-bottom: 0.1rem;
    border-bottom: 0.02rem solid #f5f5f5;
}
.pet-group-name { font-size: 0.36rem; font-weight: 600; color: #E88850; }
.pet-group-count { font-size: 0.28rem; color: #999; }

.checkin-item {
    border: 0.02rem solid #f0f0f0; border-radius: 0.31rem;
    padding: 0.26rem 0.26rem 0.21rem; background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.checkin-item.done { border-color: #CBE8D0; background: #FBFFFB; }
.checkin-item-head {
    display: flex; align-items: center; gap: 0.16rem; margin-bottom: 0.16rem;
}
.checkin-emoji {
    font-size: 0.5rem; width: 0.84rem; height: 0.84rem; flex-shrink: 0;
    border-radius: 50%; background: #FFF0E5;
    display: flex; align-items: center; justify-content: center;
}
.checkin-label { flex: 1; font-size: 0.34rem; font-weight: 600; color: #333; }
.checkin-status {
    font-size: 0.24rem; padding: 0.08rem 0.18rem; border-radius: 999px;
    font-weight: 600; white-space: nowrap;
}
.checkin-status.pending { background: #f2f2f2; color: #aaa; }
.checkin-status.done { background: #E8F5E9; color: #43A047; }

.checkin-note {
    width: 100%; box-sizing: border-box; min-height: 1.2rem;
    padding: 0.16rem 0.21rem; border-radius: 0.21rem;
    border: 0.02rem solid #eee; background: #fafafa;
    font-size: 0.3rem; font-family: inherit; color: #555;
    resize: vertical; line-height: 1.5; outline: none;
    -webkit-appearance: none; transition: border-color 0.2s, background 0.2s;
}
.checkin-note:focus { border-color: #FFCFA0; background: #fff; }
.checkin-note::placeholder { color: #ccc; }
.checkin-note:disabled {
    background: #f5f5f5; color: #999; border-color: #f0f0f0;
    resize: none; cursor: not-allowed; -webkit-text-fill-color: #999;
}

.checkin-item-actions { margin-top: 0.16rem; text-align: right; }
.checkin-btn {
    width: 100%; padding: 0.22rem 0; border-radius: 9999px;
    font-size: 0.32rem; font-weight: 600; font-family: inherit; cursor: pointer;
    border: none; color: #fff; background: linear-gradient(135deg, #FFB080, #F0A060);
    box-shadow: 0 0.06rem 0.16rem rgba(240,160,96,0.25);
    transition: transform 0.12s, opacity 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.checkin-btn:active { transform: scale(0.98); opacity: 0.9; }
.checkin-btn.cancel {
    background: #f5f5f5; color: #999; box-shadow: none;
    border: 0.02rem solid #eee;
}

/* 历史记录 - 日期格子 */
.history-week {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.1rem;
    margin-bottom: 0.1rem;
}
.history-week span {
    text-align: center; font-size: 0.24rem; color: #bbb;
}
.history-month { margin-bottom: 0.21rem; }
.history-month-title {
    font-size: 0.28rem; font-weight: 600; color: #999;
    margin-bottom: 0.12rem; padding-left: 0.05rem;
}
.history-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.1rem;
}
.history-cell {
    position: relative; aspect-ratio: 1; border-radius: 0.18rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #fafafa; border: 0.02rem solid #f0f0f0;
    font-size: 0.3rem; color: #bbb; cursor: default;
}
.history-cell .cell-day { line-height: 1; }
.history-cell.blank { background: transparent; border: none; }
.history-cell.has { cursor: pointer; color: #333; border-color: #FFE0C0; background: #FFF7F0; }
.history-cell.has.all-done { background: #E8F5E9; border-color: #C8E6C9; color: #2E7D32; }
.history-cell .cell-badge {
    margin-top: 0.05rem; font-size: 0.2rem; color: #E88850; font-weight: 600; line-height: 1;
}
.history-cell.all-done .cell-badge { color: #43A047; }

.history-detail {
    display: none; margin-top: 0.21rem; border: 0.02rem solid #f0f0f0;
    border-radius: 0.31rem; overflow: hidden;
}
.history-detail.show { display: block; }
.history-detail-head {
    display: flex; align-items: center; gap: 0.16rem;
    padding: 0.21rem 0.26rem; background: #fafafa;
}
.history-detail-date { flex: 1; font-size: 0.32rem; font-weight: 600; color: #333; }
.history-detail-close {
    font-size: 0.4rem; color: #bbb; cursor: pointer; line-height: 1; padding: 0 0.05rem;
    -webkit-tap-highlight-color: transparent;
}
.history-detail-body { padding: 0 0.26rem 0.21rem; }
.history-row {
    display: flex; align-items: flex-start; gap: 0.16rem;
    padding: 0.14rem 0; border-bottom: 0.02rem solid #fafafa;
    font-size: 0.29rem; color: #666; line-height: 1.5;
}
.history-row:last-child { border-bottom: none; }
.history-row .h-emoji { flex-shrink: 0; }
.history-row .h-label { flex-shrink: 0; font-weight: 600; color: #333; }
.history-row .h-note { color: #999; word-break: break-all; }
.history-empty { text-align: center; color: #bbb; font-size: 0.29rem; padding: 0.31rem 0; }

/* 添加宠物弹窗 */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4); z-index: 9999;
    align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 0.47rem; padding: 0.52rem 0.37rem 0.42rem;
    width: 88%; max-width: 9rem; box-shadow: 0 0.31rem 1.05rem rgba(0,0,0,0.15);
    overflow-y: auto; position: relative; display: flex; flex-direction: column;
}
.modal-box h3 { margin: 0.16rem 0 0.31rem; font-size: 0.44rem; color: #333; text-align: center; }
.modal-close {
    position: absolute; top: 0.16rem; right: 0.31rem;
    font-size: 0.58rem; color: #bbb; cursor: pointer;
    line-height: 1; padding: 0.1rem;
    -webkit-tap-highlight-color: transparent;
}
.modal-field { margin-bottom: 0.31rem; }
.modal-field label { display: block; font-size: 0.3rem; color: #666; margin-bottom: 0.14rem; }
.modal-input {
    width: 100%; box-sizing: border-box; padding: 0.26rem 0.31rem;
    border-radius: 0.26rem; border: 0.02rem solid #e0e0e0; background: #fafafa;
    font-size: 0.36rem; font-family: inherit; color: #333; outline: none;
    -webkit-appearance: none; text-align: center;
}
.modal-input:focus { border-color: #FFCFA0; background: #fff; }
.emoji-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.14rem; }
.emoji-option {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.08rem; font-size: 0.62rem; padding: 0.16rem 0; border-radius: 0.21rem;
    border: 0.02rem solid #e8e8e8; background: #fafafa; cursor: pointer;
    text-align: center; transition: all 0.2s; line-height: 1;
    -webkit-tap-highlight-color: transparent;
}
.emoji-option .emoji-option-ico { font-size: 0.56rem; line-height: 1; }
.emoji-option .emoji-option-label { font-size: 0.24rem; color: #999; line-height: 1; }
.emoji-option.active .emoji-option-label { color: #D08050; font-weight: 600; }
.emoji-option.active {
    background: #FFF0E5; border-color: #FFCFA0;
    box-shadow: 0 0.04rem 0.1rem rgba(240,160,96,0.2);
}
.modal-btns { display: flex; gap: 0.21rem; margin-top: 0.31rem; }
.btn-cancel, .btn-primary {
    flex: 1; padding: 0.24rem 0; border-radius: 9999px;
    font-size: 0.34rem; font-weight: 600; font-family: inherit; cursor: pointer;
    border: none; transition: transform 0.12s, opacity 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.btn-cancel { background: #f2f2f2; color: #777; }
.btn-primary { background: linear-gradient(135deg, #FFB080, #F0A060); color: #fff; box-shadow: 0 0.06rem 0.16rem rgba(240,160,96,0.25); }
.btn-cancel:active, .btn-primary:active { transform: scale(0.98); opacity: 0.9; }

/* Toast */
.toast-wrap {
    position: fixed; top: 1.2rem; left: 50%; transform: translateX(-50%);
    z-index: 99999; pointer-events: none;
}
.toast-msg {
    background: rgba(0,0,0,0.75); color: #fff;
    font-size: 0.3rem; padding: 0.21rem 0.37rem;
    border-radius: 999px; margin-bottom: 0.16rem;
    white-space: nowrap; text-align: center;
    animation: checkinToastIn 0.2s ease;
}
@keyframes checkinToastIn {
    from { opacity: 0; transform: translateY(-0.16rem); }
    to { opacity: 1; transform: translateY(0); }
}

/* 数据备份 */
#backupCard { margin-bottom: 0.3rem; }
.backup-head {
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.backup-head .card-title { margin-bottom: 0; }
.backup-arrow {
    width: 0.2rem; height: 0.2rem;
    border-right: 0.05rem solid #bbb; border-bottom: 0.05rem solid #bbb;
    transform: rotate(-45deg); transition: transform 0.2s; flex: none;
}
.backup-bar { display: none; gap: 0.21rem; margin-top: 0.24rem; }
#backupCard.expanded .backup-bar { display: flex; }
#backupCard.expanded .backup-arrow { transform: rotate(45deg); }
.backup-btn {
    flex: 1; padding: 0.22rem 0; border-radius: 9999px;
    font-size: 0.32rem; font-weight: 600; font-family: inherit; cursor: pointer;
    border: 0.02rem dashed #FFCFA0; background: #FFF0E5; color: #E88850;
    transition: transform 0.12s, opacity 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.backup-btn:active { transform: scale(0.98); opacity: 0.9; }

/* 恢复备份弹窗 */
.restore-import label {
    display: block; width: 100%; padding: 0.31rem; border: 0.03rem dashed #ccc;
    border-radius: 0.26rem; text-align: center; color: #999; font-size: 0.32rem;
    cursor: pointer; box-sizing: border-box;
}
.restore-divider { font-size: 0.28rem; color: #999; margin: 0.26rem 0 0.18rem; text-align: center; }
.restore-list { max-height: 30vh; overflow-y: auto; margin-bottom: 0.21rem; }
.restore-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.21rem 0; border-bottom: 0.02rem solid #f0f0f0;
}
.restore-item-info { font-size: 0.32rem; color: #333; }
.restore-item-sub { font-size: 0.32rem; color: #999; margin-left: 0.15rem; }
.restore-item-btns { display: flex; gap: 0.15rem; }
.restore-item-btn {
    font-size: 0.3rem; border-radius: 9999px; padding: 0.08rem 0.26rem;
    background: #fff; cursor: pointer; font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.restore-item-btn.restore { color: #2196f3; border: 0.02rem solid #2196f3; }
.restore-item-btn.del { color: #e53935; border: 0.02rem solid #e53935; }
.restore-tip { font-size: 0.27rem; color: #999; line-height: 1.6; margin-bottom: 0.31rem; }
.restore-empty { text-align: center; color: #bbb; font-size: 0.29rem; padding: 0.21rem 0; }

/* ===== 打卡事项（事项为中心） ===== */
.task-list { display: flex; flex-direction: column; gap: 0.31rem; }
.task-card {
    border: 0.02rem solid #f0f0f0; border-radius: 0.37rem;
    padding: 0.21rem; background: #fff;
}
.task-head {
    display: flex; align-items: center; gap: 0.16rem;
    margin-bottom: 0.18rem; flex-wrap: wrap;
}
.task-emoji {
    font-size: 0.52rem; width: 0.84rem; height: 0.84rem; flex-shrink: 0;
    border-radius: 50%; background: #FFF0E5;
    display: flex; align-items: center; justify-content: center;
}
.task-name { flex: 1; font-size: 0.38rem; font-weight: 600; color: #333; }
.task-pet-count { font-size: 0.26rem; color: #999; }
.task-edit, .task-del {
    border: none; cursor: pointer; font-family: inherit;
    font-size: 0.26rem; color: #E88850; background: #FFF0E5;
    padding: 0.1rem 0.21rem; border-radius: 999px;
    -webkit-tap-highlight-color: transparent;
}
.task-del {
    color: #fff; background: #E85C5C;
    width: 0.52rem; height: 0.52rem; padding: 0; border-radius: 50%;
    font-size: 0.32rem; line-height: 1;
}
.task-pets { display: flex; flex-direction: column; }
.task-pets-empty { text-align: center; color: #bbb; font-size: 0.28rem; padding: 0.21rem 0; }
.task-pet-switcher {
    display: flex; gap: 0.16rem; overflow-x: auto;
    padding: 0.18rem 0 0.05rem; margin-bottom: 0.21rem; scrollbar-width: none;
}
.task-pet-switcher::-webkit-scrollbar { display: none; }
.pet-switch {
    flex: 0 0 auto; position: relative; display: flex; align-items: center; gap: 0.1rem;
    padding: 0.09rem 0.24rem 0.09rem 0.11rem; border-radius: 999px;
    border: 0.02rem solid #eee; background: #fafafa; cursor: pointer;
    font-family: inherit; transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.pet-switch-emoji {
    width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.4rem; line-height: 1;
}
.pet-switch-name { font-size: 0.28rem; color: #666; font-weight: 600; white-space: nowrap; }
.pet-switch.active { border-color: #FFCFA0; background: #FFF0E5; }
.pet-switch.active .pet-switch-name { color: #E88850; }
.pet-switch-dot {
    position: absolute; top: -0.11rem; right: -0.08rem;
    width: 0.38rem; height: 0.38rem; border-radius: 50%;
    background: #43A047; color: #fff; font-size: 0.24rem;
    display: flex; align-items: center; justify-content: center; line-height: 1;
    box-shadow: 0 0.03rem 0.08rem rgba(67,160,71,0.35);
}
.task-pet-row {
    padding: 0 0 0.05rem;
    border-top: 0.02rem solid #f5f5f5;
    padding-top: 0.21rem;
}
.task-pet-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.16rem;
}
.task-pet-name { font-size: 0.32rem; font-weight: 600; color: #555; }
.task-add {
    width: 100%; margin-top: 0.31rem; margin-bottom: 0.42rem; padding: 0.24rem 0;
    border-radius: 9999px; font-size: 0.34rem; font-weight: 600;
    font-family: inherit; cursor: pointer; color: #E88850;
    background: #FFF0E5; border: 0.02rem dashed #FFCFA0;
    -webkit-tap-highlight-color: transparent; transition: transform 0.12s, opacity 0.12s;
}
.task-add:active { transform: scale(0.98); opacity: 0.9; }

/* 事项弹窗宠物多选 */
.pet-multi-select { display: flex; flex-wrap: wrap; gap: 0.16rem; }
.pet-select-option {
    padding: 0.16rem 0.26rem; border-radius: 999px;
    border: 0.02rem solid #e8e8e8; background: #fafafa;
    font-size: 0.3rem; font-family: inherit; cursor: pointer;
    color: #666; transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.pet-select-option.active {
    background: #FFF0E5; border-color: #FFCFA0; color: #D08050; font-weight: 600;
}
.pet-select-option b { color: #E88850; }
.task-pet-select-empty { color: #bbb; font-size: 0.29rem; padding: 0.16rem 0; }
