/**
 * ABDL 尿布日历 - 旗舰视觉样式库 (v4.2 合并版)
 * 核心风格：Neumorphism (新拟态) + Glassmorphism (毛玻璃)
 * 适配：PC 全功能版 + 手机 App 触控版
 * 说明：此版本已合并重复模块，以最后一次定义为准
 */

/* ============================================================
   关键帧动画
   ============================================================ */

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

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

@keyframes activePulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 143, 163, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(255, 143, 163, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 143, 163, 0); }
}

@keyframes activePulseDark {
    0% { box-shadow: 0 0 0 0 rgba(255, 143, 163, 0.2); }
    70% { box-shadow: 0 0 0 10px rgba(255, 143, 163, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 143, 163, 0); }
}

/* ============================================================
   1. 变量定义 (主题系统)
   ============================================================ */

:root {
    --bg-primary: #FFF9F5; --bg-secondary: #FFF2EA; --bg-card: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.72); --bg-modal: rgba(0, 0, 0, 0.45);
    --accent-pink: #FFB7C5; --accent-pink-soft: #FFD1DC; --accent-pink-deep: #FF8FA3;
    --accent-blue: #B5E4F0; --accent-blue-soft: #D4F1F9; --accent-blue-deep: #8DD4E8;
    --accent-yellow: #FFE5B4; --accent-purple: #E0D4F0; --text-primary: #4A4A4A;
    --text-secondary: #757575; --text-muted: #BDBDBD; --text-inverse: #FFFFFF;
    --border: rgba(255, 183, 197, 0.2); --border-strong: rgba(255, 183, 197, 0.5);
    --nm-shadow-out: 8px 8px 16px rgba(163, 177, 198, 0.2), -8px -8px 16px rgba(255, 255, 255, 0.9);
    --nm-shadow-in: inset 4px 4px 8px rgba(163, 177, 198, 0.2), inset -4px -4px 8px rgba(255, 255, 255, 0.9);
    --nm-shadow-sm: 4px 4px 8px rgba(163, 177, 198, 0.15), -4px -4px 8px rgba(255, 255, 255, 0.8);
    --radius-sm: 12px; --radius-md: 20px; --radius-lg: 30px; --radius-full: 999px;
    --transition: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --safe-bottom: env(safe-area-inset-bottom);
}

[data-theme="dark"] {
    --bg-primary: #1A1A2E; --bg-secondary: #16213E; --bg-card: #24243E;
    --bg-glass: rgba(30, 30, 62, 0.8); --bg-modal: rgba(0, 0, 0, 0.7);
    --text-primary: #E0E0E0; --text-secondary: #A0A0B0; --text-muted: #606070;
    --border: rgba(255, 255, 255, 0.05);
    --nm-shadow-out: 8px 8px 16px rgba(0, 0, 0, 0.5), -4px -4px 12px rgba(255, 255, 255, 0.03);
    --nm-shadow-in: inset 6px 6px 12px rgba(0, 0, 0, 0.5), inset -4px -4px 12px rgba(255, 255, 255, 0.03);
}

/* ============================================================
   2. 基础复位与全局样式
   ============================================================ */

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

html, body {
    width: 100%; min-height: 100vh; scroll-behavior: smooth;
}

body {
    background: var(--bg-primary); color: var(--text-primary);
    font-family: 'PingFang SC', 'SF Pro Display', 'Microsoft YaHei', sans-serif;
    line-height: 1.6; overflow-x: hidden;
}

svg {
    width: 20px; height: 20px; stroke-width: 2; stroke: currentColor; fill: none;
    transition: var(--transition);
}

a {
    text-decoration: none; color: inherit;
}

button {
    border: none; background: none; font-family: inherit; cursor: pointer;
    color: inherit;
}

/* ============================================================
   3. 顶部导航栏 (Glass Navbar)
   ============================================================ */

.top-nav {
    position: fixed; top: 0; left: 0; right: 0; height: 75px; display: grid;
    grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 25px;
    z-index: 2000;
}

.glass {
    background: var(--bg-glass); backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

.nav-left {
    display: flex; align-items: center; gap: 12px;
}

.brand-logo svg {
    width: 32px; height: 32px; color: var(--accent-pink-deep);
}

.nav-title {
    font-weight: 900; font-size: 1.25rem; color: var(--accent-pink-deep);
    letter-spacing: -0.5px;
}

.date-selector-wrap {
    background: var(--bg-card); padding: 10px 25px; border-radius: var(--radius-full);
    box-shadow: var(--nm-shadow-out); display: flex; align-items: center; gap: 12px;
    cursor: pointer; font-weight: 800; transition: var(--transition);
}

.date-selector-wrap:active {
    transform: scale(0.96); box-shadow: var(--nm-shadow-in);
}

.date-selector-wrap .chevron {
    width: 14px; color: var(--accent-pink-deep);
}

.nav-right {
    display: flex; align-items: center; justify-content: flex-end; gap: 18px;
}

/* ============================================================
   4. 用户菜单与下拉框
   ============================================================ */

.user-menu-wrap {
    position: relative;
}

.user-avatar {
    width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--bg-card);
    box-shadow: var(--nm-shadow-out); object-fit: cover; cursor: pointer;
    transition: var(--transition);
}

.user-avatar:hover {
    transform: rotate(5deg) scale(1.05);
}

.user-dropdown {
    position: absolute; top: 65px; right: 0; width: 220px; padding: 15px; opacity: 0;
    visibility: hidden; transform: translateY(10px); transition: var(--transition);
    z-index: 2100; background: var(--bg-card) !important;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--nm-shadow-out), 0 10px 30px rgba(0,0,0,0.1); pointer-events: none;
    display: block !important;
}

.user-dropdown.active {
    opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}

.dropdown-user-info {
    padding: 10px 10px 15px;
}

.user-name-label {
    font-weight: 900; font-size: 16px; color: var(--text-primary);
}

.user-uid-label {
    font-size: 12px; color: var(--text-muted);
}

.dropdown-divider {
    border: none; height: 1px; background: var(--border); margin: 5px 0;
}

.dropdown-item {
    display: flex; align-items: center; gap: 15px; padding: 12px 15px;
    border-radius: var(--radius-sm); font-weight: 700; font-size: 14px; transition: 0.2s;
}

.dropdown-item:hover {
    background: var(--bg-secondary); color: var(--accent-pink-deep);
    box-shadow: var(--nm-shadow-in);
}

.dropdown-item.danger:hover {
    background: #FFF0F0; color: #FF6B6B;
}

/* ============================================================
   5. 主体布局与工具栏
   ============================================================ */

.main-container {
    max-width: 1300px; margin: 0 auto; padding: 100px 25px 50px;
}

.calendar-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 30px; margin-bottom: 25px;
}

.toolbar-side {
    display: flex; align-items: center; flex: 1;
}

.btn-arrow {
    width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; background: var(--bg-card);
    box-shadow: var(--nm-shadow-out); transition: var(--transition);
}

.btn-arrow:active {
    transform: scale(0.9); box-shadow: var(--nm-shadow-in);
}

.btn-arrow svg {
    width: 18px; color: var(--accent-pink-deep);
}

.view-toggle {
    display: flex; padding: 6px; gap: 10px;
}

.card-neumorphic-in {
    background: var(--bg-primary); box-shadow: var(--nm-shadow-in);
    border-radius: var(--radius-full);
}

.view-btn {
    padding: 8px 30px; border-radius: var(--radius-full); font-size: 14px;
    font-weight: 800; color: var(--text-muted); transition: var(--transition);
}

.view-btn.active {
    background: var(--bg-card); color: var(--accent-pink-deep);
    box-shadow: var(--nm-shadow-out);
}

/* ============================================================
   6. 日历网格核心 (Grid System)
   ============================================================ */

.calendar-wrapper {
    padding: 25px;
}

.weekdays-header {
    display: grid; grid-template-columns: repeat(7, 1fr); text-align: center;
    font-size: 13px; font-weight: 900; color: var(--text-muted); margin-bottom: 20px;
    letter-spacing: 2px;
}

.calendar-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 15px;
}

.day-cell {
    min-height: 130px; background: var(--bg-card); border-radius: var(--radius-md);
    padding: 12px; box-shadow: var(--nm-shadow-out); border: 2.5px solid transparent;
    transition: transform 0.2s, border-color 0.2s; position: relative;
}

.day-cell:hover {
    transform: translateY(-3px); border-color: var(--accent-pink-soft);
}

.day-cell.today {
    border-color: var(--accent-blue); background: var(--accent-blue-soft);
}

.day-cell.empty {
    opacity: 0.4; box-shadow: none; background: transparent;
}

.day-number {
    font-size: 16px; font-weight: 900; color: var(--text-secondary); margin-bottom: 10px;
    opacity: 0.8;
}

.gantt-container {
    display: flex; flex-direction: column; gap: 5px;
}

.gantt-bar {
    height: 28px; border-radius: 8px; font-size: 11px; font-weight: 800; color: white;
    display: flex; align-items: center; padding: 0 8px; gap: 6px; cursor: pointer;
    overflow: hidden; white-space: nowrap; box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.gantt-bar:hover {
    transform: scale(1.02); filter: brightness(1.1);
}

.gantt-bar.continued {
    border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -12px;
    padding-left: 15px;
}

.gantt-bar.ongoing {
    border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: -12px;
    padding-right: 15px;
}

.bar-thumb {
    width: 18px; height: 18px; border-radius: 5px; object-fit: cover;
    border: 1.5px solid rgba(255,255,255,0.4);
}

/* ============================================================
   7. 电脑端侧边面板 (Ongoing Side Panel)
   ============================================================ */

.ongoing-wears {
    position: fixed; top: 100px; right: 30px; width: 280px;
    max-height: calc(100vh - 150px); padding: 25px; border-radius: var(--radius-lg);
    box-shadow: var(--nm-shadow-out); overflow-y: auto; z-index: 100;
}

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

.ongoing-title-wrap {
    display: flex; align-items: center; gap: 10px;
}

.ongoing-title {
    font-weight: 900; font-size: 15px; color: var(--accent-pink-deep);
}

.ongoing-count {
    background: var(--accent-pink-deep); color: white; padding: 3px 10px;
    border-radius: 12px; font-size: 12px; font-weight: 800;
}

.ongoing-item {
    display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 12px;
    position: relative;
}

.ongoing-item img {
    width: 48px; height: 48px; border-radius: 12px; object-fit: cover;
}

.ongoing-info {
    flex: 1;
}

.ongoing-name {
    font-size: 13px; font-weight: 800;
}

.ongoing-time {
    font-size: 11px; color: var(--text-muted); margin-top: 2px;
}

.btn-takeoff-quick {
    width: 32px; height: 32px; border-radius: 50%; background: var(--bg-primary);
    box-shadow: var(--nm-shadow-sm); display: flex; align-items: center;
    justify-content: center; color: #FF6B6B; transition: 0.2s;
}

.btn-takeoff-quick:hover {
    transform: scale(1.1); background: #FFF0F0;
}

.empty-ongoing {
    text-align: center; padding: 40px 0; color: var(--text-muted); font-size: 14px;
    font-weight: 700;
}

/* ============================================================
   8. 手机端底部导航栏 (Bottom Tab Bar)
   ============================================================ */

.mobile-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; height: 75px;
    padding-bottom: var(--safe-bottom); justify-content: space-around;
    align-items: center; z-index: 2000; border-top: 1px solid var(--border);
}

.m-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
    color: var(--text-muted); transition: 0.2s;
}

.m-nav-item span {
    font-size: 10px; font-weight: 900;
}

.m-nav-item svg {
    width: 24px; height: 24px;
}

.m-nav-item.active {
    color: var(--accent-pink-deep);
}

.m-nav-fab {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-pink-deep));
    display: flex; align-items: center; justify-content: center; margin-top: -50px;
    box-shadow: 0 10px 25px rgba(255, 143, 163, 0.45);
    border: 6px solid var(--bg-primary); transition: 0.3s;
}

.m-nav-fab:active {
    transform: scale(0.9) rotate(90deg);
}

/* ============================================================
   9. 通用组件 (Buttons, Modals, Inputs)
   ============================================================ */

.btn {
    padding: 12px 28px; border-radius: var(--radius-md); font-weight: 800;
    font-size: 14px; display: inline-flex; align-items: center; justify-content: center;
    gap: 10px; transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-pink-deep));
    color: white; box-shadow: 0 8px 20px rgba(255, 143, 163, 0.3);
}

.btn-primary:active {
    transform: scale(0.96); box-shadow: none;
}

.btn-secondary {
    background: var(--bg-card); color: var(--text-primary);
    box-shadow: var(--nm-shadow-out);
}

.btn-secondary:active {
    box-shadow: var(--nm-shadow-in);
}

.input-neumorphic {
    width: 100%; padding: 14px 18px; border-radius: var(--radius-sm);
    background: var(--bg-primary); box-shadow: var(--nm-shadow-in);
    color: var(--text-primary); font-size: 14px; font-weight: 600;
}

.modal {
    position: fixed; inset: 0; background: var(--bg-modal); display: none;
    align-items: center; justify-content: center; padding: 20px; z-index: 4000;
    backdrop-filter: blur(8px);
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%; max-width: 500px; padding: 30px; max-height: 90vh; overflow-y: auto;
    animation: modalSlideUp 0.4s cubic-bezier(0.2, 1, 0.3, 1);
    background: var(--bg-card); border-radius: 28px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--border); border: none;
    position: relative; z-index: 4001; scrollbar-width: none; -ms-overflow-style: none;
}

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

.modal-header h3 {
    font-weight: 900; font-size: 1.3rem; color: var(--accent-pink-deep);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block; font-weight: 800; font-size: 13px; margin-bottom: 8px;
    color: var(--text-secondary);
}

/* ============================================================
   10. 日历内尿布微型卡片
   ============================================================ */

.wear-icon-stack {
    display: flex; flex-direction: column; gap: 6px; margin-top: 5px;
}

.wear-mini-card {
    display: flex; align-items: center; gap: 8px; padding: 4px;
    background: var(--bg-primary); border-radius: 10px; box-shadow: var(--nm-shadow-sm);
    cursor: pointer; transition: 0.2s; border: 1px solid transparent;
}

.wear-mini-card:hover {
    transform: translateX(3px); border-color: var(--accent-pink-soft);
}

.wear-thumb-box {
    position: relative; width: 28px; height: 28px; flex-shrink: 0;
}

.wear-thumb-box img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 6px;
}

.indicator-left {
    position: absolute; left: -5px; top: 50%; transform: translateY(-50%);
    font-size: 8px; color: var(--accent-pink-deep); text-shadow: 0 0 2px white;
}

.wear-brief-info {
    display: flex; flex-direction: column; overflow: hidden;
}

.wear-time-label {
    font-size: 9px; font-weight: 800; color: var(--text-muted); line-height: 1;
}

.wear-duration-tag {
    font-size: 10px; font-weight: 700; color: var(--text-primary); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}

.is-active-pulse {
    border-color: var(--accent-pink); animation: activePulse 2s infinite;
}

/* ============================================================
   11. 特殊视觉反馈与动画
   ============================================================ */

.loading-spinner {
    width: 35px; height: 35px; border: 4px solid var(--bg-secondary);
    border-top-color: var(--accent-pink-deep); border-radius: 50%;
    animation: rotate 1s linear infinite; margin: 60px auto;
}

.size-chips {
    display: flex; flex-wrap: wrap; gap: 10px;
}

.size-chip {
    padding: 8px 16px; border-radius: var(--radius-full); background: var(--bg-card);
    box-shadow: var(--nm-shadow-out); font-size: 12px; font-weight: 800; cursor: pointer;
}

.size-chip.active {
    background: var(--accent-pink-soft); color: var(--accent-pink-deep);
    box-shadow: var(--nm-shadow-in);
}

.size-chip.disabled {
    opacity: 0.4; cursor: not-allowed; box-shadow: none;
}

#toast-container {
    position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
    z-index: 9999;
}

/* ============================================================
   12. 核心视觉修复与优化
   ============================================================ */

.datepicker-card {
    background: var(--bg-card) !important; border-radius: var(--radius-lg);
    box-shadow: var(--nm-shadow-out), 0 20px 50px rgba(0,0,0,0.15);
    border: 1px solid var(--border); padding: 25px; width: 340px; z-index: 3100;
}

.dp-item {
    background: var(--bg-card); box-shadow: var(--nm-shadow-sm); margin: 4px;
}

.dp-item.active {
    background: var(--accent-pink); color: white; box-shadow: var(--nm-shadow-in);
}

.takeoff-card {
    background: var(--bg-primary); padding: 20px; border-radius: var(--radius-md);
    margin-bottom: 25px; box-shadow: var(--nm-shadow-in); text-align: center;
}

.takeoff-card img {
    margin-bottom: 15px; border: 3px solid var(--bg-card);
    box-shadow: var(--nm-shadow-out); width: 100px; height: 100px; aspect-ratio: 1 / 1;
    object-fit: cover; border-radius: 15px;
}

.modal-close {
    position: absolute; top: 20px; right: 20px; width: 32px; height: 32px; display: flex;
    align-items: center; justify-content: center; border-radius: 50%;
    background: var(--bg-secondary); color: var(--text-secondary); transition: 0.2s;
    z-index: 10;
}

.modal-close:hover {
    background: var(--accent-pink-soft); color: var(--accent-pink-deep);
    transform: rotate(90deg);
}

.modal-close svg {
    pointer-events: none;
}

.diaper-card img {
    width: 100% !important; height: auto !important; aspect-ratio: 1 / 1 !important;
    object-fit: cover !important; border-radius: 16px; margin-bottom: 15px;
    border: 4px solid var(--bg-primary); box-shadow: var(--nm-shadow-sm);
    transition: transform 0.3s ease;
}

.chart-box {
    position: relative !important; height: 350px !important; width: 100% !important;
    overflow: hidden;
}

.chart-box canvas {
    position: absolute; left: 0; top: 0; width: 100% !important; height: 100% !important;
}

/* ============================================================
   13. 弹窗细节优化
   ============================================================ */

.diaper-selector-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px;
    max-height: 300px; overflow-y: auto; padding: 10px 5px;
}

.diaper-select-item {
    cursor: pointer; transition: var(--transition); text-align: center; padding: 8px;
}

.diaper-select-item img {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px;
    background: var(--bg-primary); box-shadow: var(--nm-shadow-sm);
    border: 2px solid transparent;
}

.diaper-select-item.selected img {
    border-color: var(--accent-pink); box-shadow: 0 0 15px var(--accent-pink-soft);
}

.diaper-select-item p {
    font-size: 11px; font-weight: 800; margin-top: 5px; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============================================================
   14. 深色模式细节优化
   ============================================================ */

[data-theme="dark"] .day-cell.today {
    background: rgba(255, 183, 197, 0.05) !important;
    border: 2px solid var(--accent-pink-deep) !important;
    box-shadow: 0 0 15px rgba(255, 143, 163, 0.2), var(--nm-shadow-in) !important;
}

[data-theme="dark"] .day-cell.today .day-number {
    color: var(--accent-blue-deep) !important;
    text-shadow: 0 0 8px rgba(141, 212, 232, 0.5);
}

[data-theme="dark"] .wear-mini-card {
    background: rgba(30, 30, 46, 0.8) !important;
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .is-active-pulse {
    border-color: var(--accent-pink-deep) !important;
    animation: activePulseDark 2.5s infinite !important;
}

[data-theme="dark"] .wear-mini-card:hover {
    background: rgba(45, 45, 65, 1) !important; transform: translateY(-2px);
}

/* ============================================================
   15. 设置中心面板
   ============================================================ */

.settings-panel {
    position: absolute; top: 65px; right: 0; width: 280px; padding: 25px;
    opacity: 0 !important; visibility: hidden !important;
    transform: translateY(15px) !important;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease !important;
    z-index: 9999 !important; background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--nm-shadow-out), 0 20px 50px rgba(0,0,0,0.2) !important;
    background-color: var(--bg-card) !important; backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important; height: max-content !important;
    min-height: max-content !important; max-height: none !important;
    display: flex !important; flex-direction: column !important;
    overflow: visible !important; padding-bottom: 25px !important;
}

.settings-panel.active {
    opacity: 1 !important; visibility: visible !important;
    transform: translateY(0) !important; pointer-events: auto !important;
}

.settings-row {
    display: flex !important; align-items: center !important;
    justify-content: space-between !important; margin: 0 !important; margin-bottom: 20px;
    background: transparent !important; width: 100% !important;
    padding: 12px 0 !important; flex-shrink: 0 !important;
}

.settings-label-group {
    display: flex; flex-direction: column;
}

.settings-label {
    font-size: 14px; font-weight: 800; color: var(--text-primary);
}

.settings-label-group small {
    font-size: 10px; color: var(--text-muted); font-weight: 700;
}

select:disabled {
    opacity: 0.4; cursor: not-allowed; background: var(--bg-secondary) !important;
}

.nm-switch {
    position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0;
}

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

.nm-slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-primary); box-shadow: var(--nm-shadow-in);
    transition: .4s; border-radius: 34px;
}

.nm-slider:before {
    position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
    background-color: var(--bg-card); box-shadow: var(--nm-shadow-sm); transition: .4s;
    border-radius: 50%;
}

input:checked + .nm-slider {
    background-color: var(--accent-pink-soft);
}

input:checked + .nm-slider:before {
    transform: translateX(20px); background-color: var(--accent-pink-deep);
}

[data-theme="dark"] .settings-panel {
    background: var(--bg-card) !important; border-color: rgba(255,255,255,0.05);
    background-color: var(--bg-card) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* ============================================================
   其他规则
   ============================================================ */

[data-theme="dark"] .modal-content {
    background: var(--bg-card); box-shadow: var(--nm-shadow-out);
}

#image-preview-box {
    position: relative; width: 100%; height: 180px; background: var(--bg-primary);
    border: 2px dashed var(--accent-pink-soft); border-radius: 20px; display: flex;
    flex-direction: column; align-items: center; justify-content: center;
    transition: all 0.3s ease; overflow: hidden; color: var(--text-secondary);
}

#image-preview-box.dragging {
    background: var(--accent-pink-soft); border-color: var(--accent-pink-deep);
    transform: scale(1.02);
}

.modal-content::-webkit-scrollbar {
    width: 0px;
}

.diaper-card:hover img {
    transform: scale(1.03);
}

.mobile-only {
    display: none !important;
}

.nav-icon-btn svg {
    pointer-events: none;
}

[data-theme="dark"] .nm-slider:before {
    background: var(--bg-card) !important;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.6), -1px -1px 3px rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .btn-takeoff-quick svg {
    color: var(--accent-pink-deep); opacity: 0.8;
}

[data-theme="dark"] .alert-item {
    background: var(--bg-card) !important;
    box-shadow: 6px 6px 15px rgba(0, 0, 0, 0.5), -2px -2px 10px rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .alert-section {
    background: rgba(255, 107, 107, 0.05) !important;
    border: 1px dashed rgba(255, 107, 107, 0.3) !important; box-shadow: none !important;
}

[data-theme="dark"] .input-neumorphic {
    background: var(--bg-primary) !important;
    box-shadow: inset 4px 4px 10px rgba(0, 0, 0, 0.4), inset -1px -1px 5px rgba(255, 255, 255, 0.02) !important;
    border: none !important;
}

[data-theme="dark"] .diaper-card img {
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    background: var(--bg-secondary) !important;
}

[data-theme="dark"] .summary-value {
    text-shadow: 0 0 10px rgba(255, 143, 163, 0.3);
}

[data-theme="dark"] .nav-icon-btn {

    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4), -1px -1px 5px rgba(255, 255, 255, 0.05) !important;
}

/* ============================================================
   响应式布局覆盖 (Breakpoints)
   ============================================================ */

@media (max-width: 1100px) {
    .ongoing-wears {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    .mobile-nav {
        display: flex;
    }
    .top-nav {
        grid-template-columns: auto 1fr auto !important; height: 60px !important;
        padding: 0 10px !important;
    }
    .brand-logo svg {
        width: 24px; height: 24px;
    }
    .nav-title {
        font-size: 1.1rem;
    }
    .date-selector-wrap {
        padding: 6px 12px; font-size: 13px; margin-left: 10px;
    }
    .main-container {
        padding: 80px 10px 100px; padding-top: 75px !important; padding-left: 5px !important;
        padding-right: 5px !important; width: 100vw !important; overflow-x: hidden;
    }
    .calendar-toolbar {
        padding: 10px; margin-bottom: 10px; border-radius: var(--radius-md); flex-wrap: wrap;
    }
    .view-btn {
        padding: 6px 15px; font-size: 12px;
    }
    .btn-arrow {
        width: 38px; height: 38px;
    }
    .calendar-wrapper {
        padding: 5px !important; border-radius: 0; box-shadow: none; background: transparent;
    }
    .weekdays-header {
        margin-bottom: 5px; font-size: 10px; letter-spacing: 1px;
    }
    .calendar-grid {
        gap: 4px !important; grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    }
    .day-cell {
        min-height: 90px !important; padding: 4px !important; border-radius: 8px;
    }
    .day-number {
        font-size: 11px; margin-bottom: 2px;
    }
    .gantt-bar {
        height: 18px; font-size: 9px; padding: 0 4px; border-radius: 5px;
    }
    .bar-thumb {
        width: 12px; height: 12px; border-radius: 3px;
    }
    .modal-content {
        padding: 25px; border-radius: var(--radius-lg);
    }
    .mobile-only {
        display: flex !important;
    }
    .page-header-title {
        font-size: 14px; font-weight: 800; color: var(--accent-pink-deep);
    }
    .gantt-bar.continued {
        margin-left: -7px; padding-left: 7px; border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }
    .gantt-bar.ongoing {
        margin-right: -7px; padding-right: 7px; border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }
    .wear-time-label {
        display: none;
    }
    .wear-mini-card {
        gap: 4px; padding: 2px;
    }
    .wear-thumb-box {
        width: 22px; height: 22px;
    }
    .settings-panel {
        position: fixed !important; top: 75px !important; bottom: 85px;
        right: 15px !important; left: 15px !important; width: auto !important;
        z-index: 3000 !important; border: 1px solid var(--border);
        background-color: var(--bg-card) !important;
        box-shadow: 0 15px 40px rgba(0,0,0,0.2) !important; display: block !important;
        background: var(--bg-card) !important; padding: 25px 20px 30px !important;
    }
    .settings-row {
        padding: 5px 0;
    }
}

/* ============================================================
   终极视觉修复：卡片辨识度与暗色模式光晕消除
   ============================================================ */

/* 1. 补全暗色模式遗漏的 nm-shadow-sm 变量 (解决小按钮和图片的刺眼白光) */
[data-theme="dark"] {
    --nm-shadow-sm: 4px 4px 8px rgba(0, 0, 0, 0.6), 
                   -2px -2px 4px rgba(255, 255, 255, 0.02) !important;
}

/* 2. 增强亮色模式下的卡片辨识度 (让卡片从背景中清晰地"凸"出来) */
.card-neumorphic, .diaper-card {
    background: var(--bg-card) !important;
    /* 加入纯白色的高光边框，这是新拟态增强立体感的灵魂 */
    border: 1.5px solid rgba(255, 255, 255, 0.9) !important; 
    box-shadow: 8px 8px 20px rgba(163, 177, 198, 0.25), 
               -8px -8px 20px rgba(255, 255, 255, 1) !important;
}

/* 3. 暗色模式下卡片边框调暗，阴影加深 */
[data-theme="dark"] .card-neumorphic, 
[data-theme="dark"] .diaper-card {
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 8px 8px 20px rgba(0, 0, 0, 0.6), 
               -3px -3px 10px rgba(255, 255, 255, 0.02) !important;
}

/* 4. 修复左上角编辑小按钮 (.edit-btn-abs) 的质感 */
.edit-btn-abs {
    background: var(--bg-card) !important; 
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: var(--nm-shadow-sm) !important;
}
[data-theme="dark"] .edit-btn-abs {
    background: var(--bg-secondary) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--text-primary) !important;
}

/* 5. 彻底去除库图片的光晕，改为内敛的“画框”效果 */
.card-img-wrap, 
.diaper-card > img {
    border: 4px solid var(--bg-primary) !important; /* 制造画框内衬感 */
    box-shadow: inset 3px 3px 6px rgba(0,0,0,0.05), 
                var(--nm-shadow-sm) !important;
}

[data-theme="dark"] .card-img-wrap, 
[data-theme="dark"] .diaper-card > img {
    border-color: var(--bg-secondary) !important;
    box-shadow: 4px 4px 12px rgba(0,0,0,0.6) !important; /* 纯黑阴影，彻底拒绝发光 */
}
/* 1. 外部大卡片的圆角 (极其圆润) */
.card-neumorphic, 
.diaper-card, 
.public-card {
    border-radius: 28px !important; /* 28px的大圆角 */
}

/* ============================================================
   智能胶囊 (Smart Pill) - 视觉收敛版与新版按钮
   ============================================================ */

.smart-pill-wrap {
    position: fixed; bottom: 30px; right: 30px; display: flex;
    flex-direction: column; gap: 12px; z-index: 1500; pointer-events: none;
}

.smart-pill {
    pointer-events: auto; display: flex; align-items: center;
    background: var(--bg-glass); backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px); border-radius: 50px;
    padding: 6px; padding-right: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), var(--nm-shadow-in);
    border: 1px solid rgba(255, 255, 255, 0.6);
    /* 🚀 收敛动画：从反弹改为平滑过渡 */
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    max-width: 320px; overflow: hidden; cursor: pointer;
}

.pill-avatar-box { position: relative; width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; z-index: 2; }
.pill-avatar-box img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg-card); box-shadow: var(--nm-shadow-out); }

/* 🚀 收敛呼吸灯：扩散变小，边缘更柔和 */
.pill-pulse {
    position: absolute; inset: -2px; border-radius: 50%;
    border: 1.5px solid var(--accent-pink-deep);
    animation: pillPulseRing 2.5s infinite cubic-bezier(0.2, 0.6, 0.3, 1);
}
@keyframes pillPulseRing {
    0% { transform: scale(0.95); opacity: 0.6; }
    100% { transform: scale(1.2); opacity: 0; }
}

.pill-info {
    display: flex; flex-direction: column; justify-content: center;
    margin-left: 12px; margin-right: 15px; white-space: nowrap;
    transition: opacity 0.2s ease 0.1s, max-width 0.4s ease;
    max-width: 160px; opacity: 1;
}
.pill-title { font-size: 13px; font-weight: 900; color: var(--text-primary); }
.pill-time { font-size: 11px; font-weight: 800; color: var(--accent-pink-deep); }

/* 🚀 重绘脱下按钮：融入胶囊的极简按键 */
.pill-action {
    height: 28px; padding: 0 12px; border-radius: 14px;
    background: var(--bg-primary); box-shadow: var(--nm-shadow-in);
    display: flex; align-items: center; justify-content: center; gap: 4px;
    color: #ff6b6b; font-size: 11px; font-weight: 800;
    transition: 0.2s; flex-shrink: 0; border: 1px solid transparent;
}
.pill-action:hover { background: #fff0f0; border-color: #ffb3b3; }
.pill-action:active { transform: scale(0.95); }

/* 收缩状态：隐藏右侧，仅保留头像 */
.smart-pill.collapsed {
    padding-right: 6px; max-width: 55px; /* 仅头像尺寸 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.smart-pill.collapsed .pill-info,
.smart-pill.collapsed .pill-action {
    max-width: 0; opacity: 0; margin: 0; pointer-events: none; padding: 0;
    transition: opacity 0.1s ease, max-width 0.4s ease, margin 0.4s ease;
}

@media (max-width: 768px) { .smart-pill-wrap { bottom: 85px; right: 15px; } }

/* 黑暗模式修正 */[data-theme="dark"] .smart-pill { background: rgba(30, 30, 46, 0.85); border-color: rgba(255, 255, 255, 0.1); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), var(--nm-shadow-in); }
[data-theme="dark"] .pill-action { background: rgba(0,0,0,0.2); box-shadow: inset 1px 1px 3px rgba(0,0,0,0.5); border-color: rgba(255, 107, 107, 0.2); }
[data-theme="dark"] .pill-action:hover { background: rgba(255, 107, 107, 0.1); }

/* ============================================================
   标签 (Badge) 全模式视觉修复 - 兼顾明亮与黑暗
   ============================================================ */

/* 1. 基础样式：明亮模式 (浅蓝底 + 深蓝字) */
.badge {
    display: inline-block;
    padding: 2px 10px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    
    /* 明亮模式配色：使用有辨识度的浅蓝色背景 */
    background-color: var(--accent-blue-soft) !important; 
    color: #4A8C9C !important; /* 稍微加深一点蓝色，提高文字对比度 */
    border: 1.5px solid rgba(141, 212, 232, 0.4) !important;
    
    line-height: 1.4;
    vertical-align: middle;
}

/* 2. 黑暗模式适配 (深色半透明底 + 亮蓝字) */
[data-theme="dark"] .badge {
    /* 黑暗模式配色：背景更深，文字更亮 */
    background-color: rgba(133, 224, 250, 0.12) !important; 
    color: var(--accent-blue) !important; 
    border: 1px solid rgba(133, 224, 250, 0.3) !important;
    
    text-shadow: 0 0 5px rgba(181, 228, 240, 0.2);
}

/* 3. 同理修复粉色标签（如果有用到的地方） */
.badge-pink {
    background-color: var(--accent-pink-soft) !important;
    color: var(--accent-pink-deep) !important;
    border: 1.5px solid rgba(255, 183, 197, 0.4) !important;
}

[data-theme="dark"] .badge-pink {
    background-color: rgba(255, 143, 163, 0.12) !important;
    color: var(--accent-pink) !important;
    border: 1px solid rgba(255, 143, 163, 0.3) !important;
}


















/* ============================================================
   修复：智能胶囊脱下按钮靠右对齐与上下等宽
   ============================================================ */

/* 1. 确保展开状态下，所有胶囊有一个统一的最小宽度，看起来更整齐 */
.smart-pill:not(.collapsed) {
    min-width: 260px; /* 保证上下几个胶囊宽度一致 */
}

/* 2. 核心修复：让中间的信息区占据所有剩余空间，把按钮强制挤到最右边 */
.pill-info {
    flex: 1;          /* 核心属性：撑满空间 */
    min-width: 0;     /* 防止名字太长撑破胶囊 */
}

/* 3. 防止尿布名字太长换行，超出部分显示省略号 */
.pill-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

