/* ============================================
   家庭每日任务 · 卡通风样式
   ============================================ */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { font-family: -apple-system, "PingFang SC", "HarmonyOS Sans", "Microsoft YaHei", sans-serif; background: #FFF8F0; color: #333; }
body { min-height: 100vh; padding-bottom: 100px; }
a { text-decoration: none; color: inherit; }
button, input, select { font-family: inherit; font-size: inherit; }

:root {
    --main-color: #FF9EC5;
    --bg: #FFF8F0;
    --card: #fff;
    --shadow: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-hover: 0 6px 20px rgba(0,0,0,0.1);
}

/* ============ 身份选择页 ============ */
.picker-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.picker { width: 100%; max-width: 640px; }
.picker h1 { text-align: center; font-size: 32px; margin-bottom: 32px; color: #333; }
.picker-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.picker-card {
    background: var(--card); border-radius: 20px; padding: 32px 20px;
    box-shadow: var(--shadow); text-align: center;
    border: 4px solid transparent; transition: all 0.2s;
    cursor: pointer;
}
.picker-card:active { transform: scale(0.96); }
.picker-card:hover { border-color: var(--c); box-shadow: var(--shadow-hover); }
.picker-emoji { font-size: 64px; margin-bottom: 12px; }
.picker-name { font-size: 24px; font-weight: 600; color: #333; }
.picker-role { font-size: 14px; color: #999; margin-top: 4px; }

/* ============ 顶栏 ============ */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; background: var(--main-color); color: #fff;
    position: sticky; top: 0; z-index: 100;
}
.who { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 600; }
.who-emoji { font-size: 28px; }
.btn-icon {
    background: rgba(255,255,255,0.25); border: none; width: 40px; height: 40px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff; cursor: pointer;
}

/* ============ 日期栏 ============ */
.date-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px; background: #fff; box-shadow: var(--shadow);
}
.date-nav {
    width: 44px; height: 44px; border-radius: 50%; background: #f0f0f0;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #666; cursor: pointer;
}
.date-nav:active { background: #ddd; }
.date-current { text-align: center; flex: 1; }
.date-title { font-size: 22px; font-weight: 600; }
.date-badge {
    display: inline-block; background: var(--main-color); color: #fff;
    padding: 2px 10px; border-radius: 10px; font-size: 12px; margin-top: 4px;
}

/* ============ 进度条 ============ */
.progress { padding: 12px 20px; background: #fff; }
.progress-bar { height: 10px; background: #f0f0f0; border-radius: 5px; overflow: hidden; }
.progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--main-color), #FFB347);
    transition: width 0.4s ease; border-radius: 5px;
}
.progress-text { text-align: right; font-size: 14px; color: #888; margin-top: 6px; }

/* ============ 任务列表 ============ */
.task-list { padding: 12px 16px; }
.cat-block { background: #fff; border-radius: 16px; padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.cat-title { font-size: 18px; color: #555; margin-bottom: 12px; }
.task-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 12px; border-radius: 12px; margin-bottom: 8px;
    background: #FAF6F0; cursor: pointer; transition: all 0.2s;
    position: relative;
}
.task-item:active { transform: scale(0.98); }
.task-check { font-size: 32px; user-select: none; flex-shrink: 0; }
.task-text { flex: 1; font-size: 20px; color: #333; word-break: break-all; }
.task-del { padding: 8px; opacity: 0.5; font-size: 18px; }
.task-item.done { background: #E8F5E9; }
.task-item.done .task-text { color: #2E7D32; text-decoration: line-through; opacity: 0.75; }

/* 完成后的飘星星动画 */
.floating-star {
    position: absolute; right: 60px; top: 50%; font-size: 24px;
    animation: floatUp 1s ease-out forwards; pointer-events: none;
}
@keyframes floatUp {
    0%   { transform: translateY(0) scale(0.5); opacity: 0; }
    30%  { transform: translateY(-10px) scale(1.4); opacity: 1; }
    100% { transform: translateY(-60px) scale(1); opacity: 0; }
}

/* ============ 空状态 ============ */
.empty { text-align: center; padding: 60px 20px; }
.empty-emoji { font-size: 80px; margin-bottom: 16px; }
.empty-text { font-size: 20px; color: #999; margin-bottom: 24px; }
.btn-add-first {
    background: var(--main-color); color: #fff; border: none;
    padding: 14px 32px; border-radius: 30px; font-size: 18px; cursor: pointer;
    box-shadow: var(--shadow);
}
.empty-small { padding: 20px; color: #999; text-align: center; }

/* ============ 悬浮按钮 ============ */
.fab-group {
    position: fixed; bottom: 20px; right: 20px;
    display: flex; flex-direction: column; gap: 12px; z-index: 90;
}
.fab {
    padding: 14px 24px; border-radius: 30px; background: var(--main-color);
    color: #fff; border: none; font-size: 18px; font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15); cursor: pointer;
}
.fab:active { transform: scale(0.95); }
.fab-admin { background: #607D8B; }

/* ============ 弹窗 ============ */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 200; padding: 20px;
}
.modal-body {
    background: #fff; border-radius: 16px; padding: 24px;
    width: 100%; max-width: 400px; max-height: 90vh; overflow-y: auto;
}
.modal-large { max-width: 600px; }
.modal-body h3 { margin-bottom: 20px; font-size: 22px; }
.modal-body h4 { margin: 16px 0 8px; font-size: 16px; color: #555; }
.modal-body label {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 16px; font-size: 14px; color: #666;
}
.modal-body input, .modal-body select {
    padding: 12px; border: 2px solid #eee; border-radius: 10px;
    font-size: 16px; outline: none; transition: border-color 0.2s;
}
.modal-body input:focus, .modal-body select:focus { border-color: var(--main-color); }
.modal-btns { display: flex; gap: 12px; margin-top: 20px; }
.modal-btns button { flex: 1; padding: 14px; border: none; border-radius: 10px; font-size: 16px; cursor: pointer; }
.btn-cancel { background: #f0f0f0; color: #666; }
.btn-ok { background: var(--main-color); color: #fff; }

/* ============ 管理页 ============ */
.admin-page { --main-color: #607D8B; background: #F5F7FA; }
.admin-main { padding: 20px; }
.admin-section { background: #fff; border-radius: 16px; padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.admin-section h2 { font-size: 20px; margin-bottom: 16px; }

.overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.over-card { border-radius: 12px; padding: 16px; background: #FAFAFA; border-left: 4px solid var(--c); }
.over-head { font-size: 18px; margin-bottom: 8px; }
.over-nums { font-size: 22px; font-weight: 700; color: var(--c); margin-bottom: 8px; }

.plan-list { display: grid; gap: 12px; margin-top: 16px; }
.plan-card { border: 2px solid #eee; border-radius: 12px; padding: 16px; }
.plan-head { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.plan-count { font-size: 12px; background: #e0e0e0; padding: 2px 8px; border-radius: 8px; color: #666; margin-left: 8px; font-weight: normal; }
.plan-date { color: #888; font-size: 14px; margin-bottom: 10px; }
.plan-btns { display: flex; gap: 8px; }
.btn-mini { padding: 6px 12px; border: 1px solid #ddd; border-radius: 8px; background: #fff; font-size: 13px; cursor: pointer; }
.btn-primary { padding: 12px 20px; background: var(--main-color); color: #fff; border: none; border-radius: 10px; font-size: 15px; cursor: pointer; }
.btn-secondary { padding: 8px 16px; background: #f0f0f0; color: #333; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; margin-top: 8px; }

.item-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.item-row .item-cat, .item-row .item-text { padding: 10px; border: 2px solid #eee; border-radius: 8px; }

/* ============ 响应式（大屏）============ */
@media (min-width: 900px) {
    body { max-width: 720px; margin: 0 auto; box-shadow: 0 0 30px rgba(0,0,0,0.05); }
}

/* ============ 电视/学习机大屏优化 ============ */
@media (min-width: 1200px) {
    body { max-width: 900px; }
    .task-text { font-size: 24px; }
    .task-check { font-size: 40px; }
    .cat-title { font-size: 22px; }
}
