/* ==========================================================================
   待产包清单 - 离线优化与生产样式表 (Zero External Dependencies)
   ========================================================================== */

/* 1. CSS 变量与设计令牌 (Design Tokens) */
:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "WenQuanYi Micro Hei", sans-serif;
    
    /* 品牌粉色调 (Brand Rose) */
    --brand-50: #fff1f2;
    --brand-100: #ffe4e6;
    --brand-200: #fecdd3;
    --brand-300: #fda4af;
    --brand-400: #fb7185;
    --brand-500: #f43f5e;
    --brand-600: #e11d48;
    
    /* 中性灰度 (Slate) */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-card: 0 8px 30px -4px rgba(0, 0, 0, 0.05);
    --shadow-soft: 0 4px 20px -2px rgba(244, 63, 94, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* 2. 基础重置 (Reset & Base) */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: #fafaf9;
    color: var(--slate-800);
    font-family: var(--font-sans);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
    padding-bottom: max(6rem, env(safe-area-inset-bottom, 6rem));
}

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

/* 隐藏滚动条让移动端视觉更干净 */
::-webkit-scrollbar {
    width: 0px;
    height: 0px;
    background: transparent;
}

/* 3. 布局工具类 (Layout Utilities) */
.max-w-2xl { max-width: 42rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1 1 0%; }
.block { display: block; }
.hidden { display: none; }
.overflow-hidden { overflow: hidden; }

/* 间距 */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.pt-0\.5 { padding-top: 0.125rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

/* 4. 文本与排版 (Typography) */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-\[15px\] { font-size: 15px; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.leading-snug { line-height: 1.375; }
.leading-normal { line-height: 1.5; }

/* 文本颜色 */
.text-slate-400 { color: var(--slate-400); }
.text-slate-500 { color: var(--slate-500); }
.text-slate-600 { color: var(--slate-600); }
.text-slate-700 { color: var(--slate-700); }
.text-slate-800 { color: var(--slate-800); }
.text-brand-500 { color: var(--brand-500); }
.text-brand-600 { color: var(--brand-600); }
.text-rose-500  { color: #f43f5e; }
.text-white     { color: #ffffff; }

/* 5. 边框与圆角 (Borders & Rounded) */
.border { border-width: 1px; border-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-brand-100 { border-color: var(--brand-100); }
.border-slate-100 { border-color: var(--slate-100); }
.rounded-full { border-radius: 9999px; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }

.divide-y > * + * {
    border-top: 1px solid var(--slate-100);
}

/* 6. 背景与阴影 (Backgrounds & Shadows) */
.bg-white { background-color: #ffffff; }
.bg-white\/60 { background-color: rgba(255, 255, 255, 0.6); }
.bg-white\/80 { background-color: rgba(255, 255, 255, 0.8); }
.bg-slate-50 { background-color: var(--slate-50); }
.bg-slate-100 { background-color: var(--slate-100); }
.bg-slate-800 { background-color: var(--slate-800); }
.bg-brand-100 { background-color: var(--brand-100); }
.bg-brand-400 { background-color: var(--brand-400); }
.bg-brand-500 { background-color: var(--brand-500); }
.bg-rose-100 { background-color: #ffe4e6; }

/* 卡片包主题背景与边框 */
.bg-rose-50 { background-color: #fff1f2; }
.border-rose-200 { border-color: #fecdd3; }

.bg-blue-50 { background-color: #eff6ff; }
.border-blue-200 { border-color: #bfdbfe; }

.bg-amber-50 { background-color: #fffbeb; }
.border-amber-200 { border-color: #fde68a; }

.bg-emerald-50 { background-color: #ecfdf5; }
.border-emerald-200 { border-color: #a7f3d0; }

.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--brand-400), var(--brand-500));
}

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-card { box-shadow: var(--shadow-card); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-brand-200 { box-shadow: 0 4px 12px 0 rgba(254, 205, 211, 0.6); }

.opacity-60 { opacity: 0.6; }

/* 7. 定位与层级 (Position & Z-index) */
.sticky { position: sticky; }
.fixed { position: fixed; }
.top-0 { top: 0; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-50 { z-index: 50; }
.z-\[100\] { z-index: 100; }

/* 8. 交互与动画过渡 (Transitions & States) */
.transition-colors {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}
.transition-opacity {
    transition-property: opacity;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
.transition-transform {
    transition-property: transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
.duration-200 { transition-duration: 200ms; }
.cursor-pointer { cursor: pointer; }

.hover\:bg-brand-50:hover { background-color: var(--brand-50); }
.hover\:bg-brand-600:hover { background-color: var(--brand-600); }
.hover\:bg-slate-50:hover { background-color: var(--slate-50); }
.hover\:bg-slate-200:hover { background-color: var(--slate-200); }
.hover\:text-brand-500:hover { color: var(--brand-500); }

.active\:bg-brand-700:active { background-color: #be123c; }
.active\:bg-slate-300:active { background-color: var(--slate-300); }

/* 毛玻璃滤镜 */
.backdrop-blur-md {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* 9. 专属组件样式 (Custom Components) */

/* 头部安全区域适配 */
header {
    padding-top: max(1rem, env(safe-area-inset-top, 1rem));
}

/* 自定义复选框 (Custom Checkbox) */
.custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.5em;
    height: 1.5em;
    border: 2px solid var(--brand-300);
    border-radius: 0.45em;
    display: grid;
    place-content: center;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
    cursor: pointer;
}

.custom-checkbox::before {
    content: "";
    width: 0.85em;
    height: 0.85em;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    transform: scale(0);
    transform-origin: bottom left;
    transition: 120ms transform ease-in-out;
    background-color: white;
}

.custom-checkbox:checked {
    background-color: var(--brand-400);
    border-color: var(--brand-400);
}

.custom-checkbox:checked::before {
    transform: scale(1);
}

/* 条目已勾选状态 */
.item-checked {
    background-color: rgba(248, 250, 252, 0.7);
}

.item-checked .item-name {
    text-decoration: line-through;
    color: var(--slate-400);
}

.item-checked .item-desc {
    color: var(--slate-300);
}

/* 进度条平滑过渡 */
.h-1\.5 { height: 0.375rem; }
.h-2\.5 { height: 0.625rem; }
.h-3 { height: 0.75rem; }
.w-1 { width: 0.25rem; }

.progress-bar-fill {
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 对话框与遮罩层动画 */
.bg-slate-900\/40 {
    background-color: rgba(15, 23, 42, 0.4);
}

.opacity-0 { opacity: 0; }
.scale-95 { transform: scale(0.95); }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.max-w-sm { max-width: 24rem; }

/* 离线状态标识条 (Offline Badge) */
.offline-banner {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 41, 59, 0.9);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    box-shadow: var(--shadow-card);
    z-index: 60;
    display: none;
    pointer-events: none;
}
.offline-banner.active {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
