* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
body { background: #f4f6fb; padding-bottom: 88px; color: #1f2937; }
.top-nav {
    display: flex; justify-content: center; gap: 2px; padding: 12px 12px;
    background: #fff; position: sticky; top: 0; z-index: 50;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: transform .26s cubic-bezier(.22,.61,.36,1);
}
/* 向下滚时整条顶栏上移收起（粘性定位，收起后不留占位，正文立刻顶上），
   向上滚或回到顶部立刻放出来。参考 iOS Safari / 安卓 Chrome / 微信的工具栏行为。 */
.top-nav.nav-hidden { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) { .top-nav { transition: none; } }
.nav-btn {
    padding: 7px 14px; border-radius: 7px; border: none;
    background: transparent; color: #6b7280; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.2s; min-height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    white-space: nowrap;
}
.nav-btn.active { background: #eef2ff; color: #6366f1; font-weight: 600; }
.page { display: none; padding: 16px; max-width: 1100px; margin: 0 auto; }
.page.active { display: block; }
.card {
    background: #fff; border-radius: 16px; padding: 18px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04); margin-bottom: 16px;
}
.card-head {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px;
    flex-wrap: wrap; gap: 8px;
}
.card-title { font-size: 16px; font-weight: 700; color: #111827; }
/* ---------- 卡片内分区标题（次级交互条） ----------
   同一张卡片里再分组的小标题，不参与 theme.css 的 .card-title::before 渐变竖条，
   改用左侧小圆点 + 浅色分隔线，层级靠字号/颜色区分，避免框内出现多条彩色竖线。 */
.section-head {
    display: flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 700; color: #374151;
    padding: 15px 0 9px; margin-top: 4px;
    border-top: 1px solid #f1f2f6;
    letter-spacing: .2px;
}
.section-head:first-child { border-top: none; padding-top: 2px; margin-top: 0; }
.section-head::before {
    content: ""; width: 5px; height: 5px; border-radius: 50%;
    background: #c7d2fe; flex-shrink: 0;
}
.section-head .section-count {
    font-size: 11px; font-weight: 600; color: #9ca3af;
    background: #f3f4f6; border-radius: 999px; padding: 1px 7px;
}
/* 分区标题与其后的列表之间留出统一间隔 */
.section-head + .empty { padding: 16px 0 10px; }
.record-list { display: flex; flex-direction: column; }
.btn { border: none; border-radius: 10px; padding: 9px 18px; font-size: 14px; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff; }
.btn-default { background: #f3f4f6; color: #374151; }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-small { padding: 5px 10px; font-size: 12px; border-radius: 6px; border: none; cursor: pointer; }
.btn-small.primary { background: #e0e7ff; color: #4338ca; }
.btn-small.danger { background: #fee2e2; color: #dc2626; }
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 13px; color: #4b5563; margin-bottom: 6px; }
.form-input, .form-select {
    width: 100%; padding: 9px 12px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 14px; outline: none; background: #f9fafb;
}
.form-input:focus, .form-select:focus { border-color: #6366f1; background: #fff; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: none;
    align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 16px; width: 100%; max-width: 480px;
    padding: 22px; max-height: 85vh; overflow-y: auto;
}
.modal-title {
    font-size: 18px; font-weight: 700; color: #111827; margin-bottom: 16px;
    display: flex; justify-content: space-between; align-items: center;
}
.modal-delete-btn { color: #dc2626; font-size: 15px; font-weight: 600; cursor: pointer; background: none; border: none; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.empty { text-align: center; color: #9ca3af; padding: 30px 0; font-size: 14px; }
.toast {
    position: fixed; top: 20px; right: 20px; background: #111827; color: #fff;
    padding: 12px 20px; border-radius: 10px; font-size: 14px; z-index: 999;
    opacity: 0; transform: translateY(-20px); transition: all 0.3s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.welcome-card {
    background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 100%);
    border-radius: 16px; padding: 20px; margin-bottom: 18px;
    display: flex; justify-content: space-between; align-items: center;
}
.welcome-text h2 { font-size: 22px; color: #111827; margin-bottom: 6px; }
.welcome-text p { font-size: 14px; color: #6366f1; }
.welcome-icon { font-size: 48px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card {
    background: #fff; border-radius: 12px; padding: 16px; text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04); cursor: pointer; transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-num { font-size: 24px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: #6b7280; }
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-item {
    display: flex; align-items: center; justify-content: space-between;
    background: #f9fafb; border-radius: 10px; padding: 12px 14px;
    border: 1px solid #eef0f4; cursor: pointer; transition: all 0.2s;
}
.task-item:hover { background: #f3f4f6; }
.task-info { display: flex; align-items: center; gap: 10px; }
.task-icon { font-size: 20px; }
.task-name { font-size: 14px; font-weight: 600; }
.task-desc { font-size: 12px; color: #6b7280; margin-top: 2px; }
.check-btn {
    width: 28px; height: 28px; border-radius: 50%; border: 2px solid #d1d5db;
    background: #fff; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: transparent; transition: all 0.2s;
}
.check-btn.finished { background: #22c55e; border-color: #22c55e; color: #fff; }
.archive-layout { display: flex; gap: 12px; min-height: 560px; }
.archive-sidebar {
    width: 220px; background: #fff; border-radius: 16px; padding: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04); flex-shrink: 0;
    display: flex; flex-direction: column; gap: 10px;
}
.search-input {
    width: 100%; padding: 8px 12px; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 13px; outline: none; background: #f9fafb;
}
.search-input:focus { border-color: #6366f1; }
.sidebar-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.tree-box { flex: 1; overflow-y: auto; }
.tree-node { user-select: none; }
.tree-label {
    display: flex; align-items: center; padding: 8px 10px; cursor: pointer;
    font-size: 13px; border-left: 3px solid transparent; border-radius: 6px;
    transition: all 0.15s;
}
.tree-label:hover { background: #f9fafb; }
.tree-label.active { background: #eef2ff; border-left-color: #6366f1; color: #4338ca; font-weight: 600; }
.tree-arrow { width: 14px; margin-right: 4px; transition: transform 0.2s; color: #9ca3af; }
.tree-node.expanded > .tree-label .tree-arrow { transform: rotate(90deg); }
.tree-children { display: none; padding-left: 18px; }
.tree-node.expanded > .tree-children { display: block; }
.character-card { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.character-main-img {
    width: 180px; aspect-ratio: 3/4; border-radius: 12px;
    background: #f3f4f6; overflow: hidden; position: relative; cursor: pointer;
}
.character-main-img img { width: 100%; height: 100%; object-fit: cover; }
.character-info { flex: 1; min-width: 240px; }
.character-info-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 13px;
}
.character-info-item label { color: #6b7280; margin-right: 4px; font-weight: 500; }
.character-info-item span { color: #111827; font-weight: 600; }
.character-gallery {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px;
}
.gallery-item {
    aspect-ratio: 1; border-radius: 10px; background: #f3f4f6;
    overflow: hidden; position: relative; cursor: pointer;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-label {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.6); color: #fff; font-size: 11px;
    text-align: center; padding: 3px 0;
}
.img-upload-add {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #9ca3af; border: 1px dashed #d1d5db; border-radius: 10px;
}
.record-item {
    background: #f9fafb; border-radius: 10px; padding: 12px 14px;
    border: 1px solid #eef0f4; margin-bottom: 12px; cursor: pointer; transition: all 0.2s;
}
.record-item:hover { background: #f3f4f6; }
.record-item:last-child { margin-bottom: 4px; }
/* 同屏多条记录时项与项之间留足呼吸感（孵化记录条目较多，单独给更宽的间隔） */
.record-list .record-item { margin-bottom: 14px; }
.record-list .record-item:last-child { margin-bottom: 2px; }
.record-item-head {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 10px;
}
.record-item-title { font-weight: 600; font-size: 14px; }
.record-item-date { font-size: 12px; color: #6b7280; flex: 0 0 auto; white-space: nowrap; }
.record-item-info {
    font-size: 12px; color: #4b5563; display: grid;
    grid-template-columns: repeat(2, 1fr); gap: 4px 12px;
}
.record-item-actions {
    margin-top: 8px; display: flex; gap: 6px; justify-content: flex-end;
}
.day-warning { color: #dc2626; font-weight: 600; }
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-select {
    padding: 6px 10px; border: 1px solid #e5e7eb;
    border-radius: 6px; font-size: 12px; outline: none; background: #f9fafb;
}
.stats-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px;
}
.stats-card {
    background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.stats-card h4 { font-size: 14px; margin-bottom: 10px; color: #374151; }
.chart-bar-wrap { display: flex; align-items: end; gap: 8px; height: 120px; padding: 0 4px; }
.chart-bar {
    flex: 1; background: linear-gradient(to top, #6366f1, #818cf8);
    border-radius: 4px 4px 0 0; position: relative; min-height: 4px;
    transition: height 0.5s ease;
}
.chart-bar-label {
    position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
    font-size: 11px; color: #6b7280; white-space: nowrap;
}
.chart-bar-value {
    position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
    font-size: 11px; color: #111827; font-weight: 600;
}
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06); z-index: 50;
}
.bottom-nav-item {
    text-align: center; font-size: 11px; color: #6b7280;
    pointer-events: auto; cursor: pointer; padding: 4px 0;
}
.bottom-nav-item .icon { display: block; font-size: 18px; margin-bottom: 2px; }
.bottom-nav-item.active { color: #4f46e5; font-weight: 600; }
.template-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px;
}
/* 图标选择器：与模板卡片同一套格子，选中的那格高亮成主色 */
.icon-grid {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
}
.icon-pick {
    display: flex; align-items: center; justify-content: center;
    height: 40px; border-radius: 9px; border: 1px solid #e5e7eb; background: #f9fafb;
    font-size: 19px; cursor: pointer; transition: all .15s; line-height: 1;
}
.icon-pick:hover { background: #eef2ff; border-color: #c7d2fe; }
.icon-pick.active {
    background: #6366f1; border-color: #6366f1;
    box-shadow: 0 3px 10px rgba(99,102,241,.32);
}
/* 计划设置卡顶部：当前图标 + 名称预览 */
.plan-preview {
    display: flex; align-items: center; gap: 10px;
    background: #f8f9fc; border-radius: 12px; padding: 10px 12px; margin-bottom: 12px;
}
.plan-preview .plan-icon { background: #fff; box-shadow: 0 1px 4px rgba(17,24,39,.06); }
.template-card {
    background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px;
    padding: 10px; cursor: pointer; transition: all 0.2s; text-align: center;
    font-size: 12px; line-height: 1.35;
}
.template-card:hover { background: #eef2ff; border-color: #c7d2fe; }
.recycle-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 12px; background: #fef2f2; border-radius: 8px; margin-bottom: 6px;
}
.recycle-info { font-size: 13px; }
.recycle-type { font-size: 11px; color: #6b7280; margin-left: 8px; }
.growth-chart {
    position: relative; height: 140px; border-bottom: 1px solid #e5e7eb;
    border-left: 1px solid #e5e7eb; margin: 20px 0 20px 30px;
}
.growth-point {
    position: absolute; width: 8px; height: 8px; background: #6366f1; border-radius: 50%;
    transform: translate(-50%, 50%);
}
.growth-point-label {
    position: absolute; font-size: 10px; color: #6b7280; transform: translateX(-50%);
    bottom: -20px;
}
.growth-point-value {
    position: absolute; font-size: 10px; color: #111827; font-weight: 600;
    transform: translate(-50%, -100%); top: -4px;
}
.stock-warning {
    background: #fef3c7; border-left: 4px solid #f59e0b;
    padding: 10px 12px; border-radius: 6px; margin-bottom: 12px;
    font-size: 13px;
}
.stock-warning.danger { background: #fee2e2; border-left-color: #dc2626; }
@media (max-width: 768px) {
    .stat-row { grid-template-columns: repeat(2, 1fr); }
    .archive-layout { flex-direction: column; }
    .archive-sidebar { width: 100%; }
    .character-card { flex-direction: column; }
    .character-main-img { width: 100%; max-width: 240px; margin: 0 auto; }
    .character-info-grid { grid-template-columns: 1fr; }
    .character-gallery { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .record-item-info { grid-template-columns: 1fr; }
    .template-grid { grid-template-columns: repeat(2, 1fr); }
}
.preview-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: none;
    align-items: center; justify-content: center; z-index: 200;
}
.preview-mask.show { display: flex; }
.preview-mask img { max-width: 90%; max-height: 90%; border-radius: 8px; }

/* 返回按钮（蛋明细等子视图左上角） */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    margin-bottom: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #4b5563;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}
.back-btn:hover {
    background: #f3f4f6;
    color: #111827;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ===== 档案树分页器（每页5条，翻页无感） ===== */
.pager {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; padding: 10px 0 4px;
}
.pager-btn {
    width: 34px; height: 34px;
    border: 1px solid #e5e7eb; background: #fff; border-radius: 10px;
    font-size: 16px; color: #4b5563; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    touch-action: manipulation;
}
.pager-btn:disabled { opacity: .35; cursor: not-allowed; }
.pager-btn:not(:disabled):hover { background: #eef2ff; border-color: #6366f1; color: #4338ca; }
.pager-info { font-size: 12px; color: #6b7280; min-width: 56px; text-align: center; }

/* ===== 出壳转录对话框 ===== */
.egg-row {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
    padding: 12px; background: #f9fafb; border-radius: 12px; margin-bottom: 12px;
}
.egg-chip {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 12px; background: #fff;
    border: 2px solid #e5e7eb; border-radius: 12px;
    cursor: pointer; min-width: 56px;
    transition: transform .15s, border-color .15s, background .15s;
    touch-action: manipulation;
}
.egg-chip:hover { border-color: #6366f1; transform: translateY(-2px); }
.egg-chip .egg-ico { font-size: 24px; line-height: 1; }
.egg-chip .egg-no { font-size: 11px; color: #6b7280; }
.egg-chip.done {
    opacity: .45; cursor: default; background: #f3f4f6;
    border-color: #e5e7eb; transform: none;
}
.egg-chip.done:hover { transform: none; border-color: #e5e7eb; }
.egg-chip.in-basket { border-color: #6366f1; background: #eef2ff; }
.egg-basket {
    border: 2px dashed #e5e7eb; border-radius: 12px;
    padding: 12px; margin-bottom: 12px;
}
.egg-basket-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.egg-basket-body { display: flex; flex-wrap: wrap; gap: 8px; min-height: 56px; align-items: center; }
.egg-basket-empty { font-size: 12px; color: #9ca3af; }

/* ===== 手机端优先适配（为安卓 APP 打包预构建） ===== */
@media (max-width: 768px) {
    .egg-row { gap: 8px; padding: 10px; }
    .egg-chip { min-width: 52px; padding: 7px 10px; }
    .egg-basket-body { min-height: 50px; }
    .pager-btn { width: 40px; height: 40px; }   /* 手机上按钮加大，方便点按 */
    /* 触控目标统一 ≥44px（含内边距） */
    .btn-small, .btn { min-height: 40px; }
    .nav-btn { min-height: 44px; }
    .tree-label, .record-item { min-height: 44px; }
}

/* ===== APP 化通用触感/安全区（全平台生效） ===== */
* { -webkit-tap-highlight-color: transparent; }   /* 去掉安卓点按蓝块 */
html, body { overscroll-behavior-y: contain; }    /* 阻止下拉整页橡皮筋 */
body {
    /* 固定底部导航约 60px：这里必须留出等量内边距，否则页面最后一张卡（如产蛋孵化统计的
       记录区）会被底部导航压住，永远差一截看不到。原先只写 env(safe-area-inset-bottom)，
       在安卓上该值为 0，等于没有留白 —— 已修正。 */
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}
.bottom-nav {
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0));
}
button, .nav-btn, .bottom-nav-item, .tree-label, .egg-chip, .record-item {
    touch-action: manipulation;                     /* 双击不缩放，点按零延迟 */
    user-select: none;
}

/* ===== 龟只医疗区（病历卡） ===== */
.med-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.med-tab {
    flex: 1; padding: 9px 4px; border: 1px solid #e5e7eb; background: #f9fafb;
    border-radius: 10px; font-size: 13px; font-weight: 600; color: #6b7280;
    cursor: pointer; transition: all .15s;
}
.med-tab.active { background: #6366f1; border-color: #6366f1; color: #fff; }
.med-exam-head, .med-exam-row {
    display: grid; grid-template-columns: 1.3fr 1fr 1.1fr; gap: 8px; align-items: center;
}
.med-exam-head { font-size: 12px; color: #9ca3af; padding: 2px 2px 6px; }
.med-exam-row { margin-bottom: 7px; }
.med-exam-label { font-size: 13px; font-weight: 600; color: #374151; }
.med-exam-label em { display: block; font-style: normal; font-size: 11px; color: #9ca3af; font-weight: 400; }
.med-exam-input { padding: 7px 8px !important; font-size: 13px !important; }
.med-exam-ref { font-size: 12px; color: #6b7280; }
.med-photo-box {
    width: 120px; height: 120px; border: 2px dashed #d1d5db; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; overflow: hidden; background: #f9fafb;
}
.med-photo-box .img-upload-add { font-size: 26px; color: #9ca3af; line-height: 1; }
.med-photo-box .gallery-label { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.med-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #374151; margin: 4px 14px 4px 0; min-height: 28px; cursor: pointer; }
.med-check input { width: 17px; height: 17px; accent-color: #6366f1; }
.med-check-group { display: flex; flex-wrap: wrap; }
.med-tag {
    display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
    background: #eef2ff; color: #6366f1; margin-right: 4px;
}
.med-disclaimer { font-size: 11px; color: #9ca3af; line-height: 1.6; margin-top: 6px; }
@media (max-width: 768px) {
    .med-exam-input { min-height: 38px; }
    .med-photo-box { width: 108px; height: 108px; }
    .med-tab { padding: 11px 4px; }  /* 触控目标加大 */
}

/* ===== 今日照料计划 + 孵化预警滚动区 ===== */
.scroll-area { max-height: 340px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-right: 2px; }
.plan-item {
    display: flex; align-items: center; gap: 12px; padding: 11px 10px;
    border-bottom: 1px solid #f3f4f6; cursor: pointer; min-height: 58px;
}
.plan-item:last-child { border-bottom: none; }
.plan-item.done .plan-name { color: #9ca3af; text-decoration: line-through; }
.plan-item.done .plan-icon { background: #f3f4f6; filter: grayscale(1); opacity: .7; }
.plan-icon {
    width: 40px; height: 40px; border-radius: 11px; background: #eef2ff;
    display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
    line-height: 1;
}
.plan-info { flex: 1; min-width: 0; }
.plan-name { font-size: 14px; font-weight: 600; color: #111827; }
.plan-desc { font-size: 12px; color: #9ca3af; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.egg-urgent { border-left: 4px solid #dc2626; }
.egg-progress { height: 6px; border-radius: 999px; background: #e5e7eb; margin-top: 6px; overflow: hidden; }
.egg-progress-bar { height: 100%; border-radius: 999px; background: #6366f1; transition: width .3s; }
.egg-progress-bar.urgent { background: #dc2626; }
@media (max-width: 768px) {
    .scroll-area { max-height: 300px; }
    .plan-item { padding: 12px 6px; }  /* 触控目标加大 */
}

/* ========== 账号登录遮罩 ========== */
.auth-mask{position:fixed;inset:0;z-index:2000;display:flex;align-items:center;justify-content:center;background:linear-gradient(160deg,#eef2ff 0%,#e0f2fe 100%);padding:24px;}
.auth-card{width:100%;max-width:360px;background:#fff;border-radius:16px;box-shadow:0 10px 40px rgba(79,70,229,.15);padding:28px 22px;text-align:center;}
.auth-logo{font-size:44px;line-height:1;}
.auth-title{margin:6px 0 16px;font-size:20px;color:#1f2937;}
.auth-tabs{display:flex;gap:0;margin-bottom:16px;border:1px solid #e5e7eb;border-radius:10px;overflow:hidden;}
.auth-tabs span{flex:1;padding:9px 0;font-size:14px;color:#6b7280;cursor:pointer;background:#f9fafb;transition:.15s;}
.auth-tabs span.active{background:#4f46e5;color:#fff;font-weight:600;}
.auth-input{width:100%;box-sizing:border-box;margin-bottom:12px;}
.auth-btn{width:100%;margin-top:4px;padding:11px 0;font-size:15px;}
.auth-msg{min-height:18px;margin-top:10px;font-size:13px;color:#dc2626;}

/* ========== 首页状态行：常驻状态 ↔ 版本更新播报 ========== */
/* ========== 首页头卡：简报式三行 + 圆形头像位 ========== */
/* 状态行不做成药丸：一个状态点 + 一句话 + 一个淡箭头，滚动播报时两端淡出。 */
.welcome-text { min-width: 0; flex: 1; position: relative; z-index: 1; }
.welcome-text { min-width: 0; flex: 1; position: relative; z-index: 1; }
.welcome-text h2 { font-size: 21px; margin-bottom: 0; }
.wc-eyebrow {
    font-size: 11px; font-weight: 600; letter-spacing: .04em;
    color: #8b93a7; margin-bottom: 3px;
}
.wc-eyebrow .wc-wk { margin-left: 5px; font-weight: 500; color: #a8afbe; }

/* 龟的头像位：给 emoji 一个"舞台"，而不是让它裸着浮在渐变上 */
.wc-avatar {
    position: relative; flex: 0 0 auto; margin-left: 14px;
    width: 56px; height: 56px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; line-height: 1;
    /* 默认态（还没设头像，显示乌龟 emoji）：保留柔光舞台，emoji 才不会裸浮在渐变上 */
    background: radial-gradient(circle at 34% 28%, #ffffff 0%, rgba(255, 255, 255, .62) 68%, rgba(255, 255, 255, .34) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 6px 14px rgba(79, 70, 229, .10);
    transform-origin: 50% 80%;
    transition: transform .35s cubic-bezier(.34, 1.4, .64, 1);
    /* 从纯装饰的龟升级成「我的头像」入口：去掉 button 默认外观，保留圆形舞台 */
    border: 0; padding: 0; overflow: hidden; cursor: pointer;
    font-family: inherit; color: inherit;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none; appearance: none;
}
/* 设过头像：照片满幅，靠「2px 白环 + 1px 淡靛蓝描边」把形状托出来。
   之前这里是 background:#fff —— 用户照片多数自带浅底，白底叠白底等于没有边界，
   整块头像会糊进淡紫卡片里，远看像一块白斑。白环必须用非 inset 的 box-shadow，
   inset 会被图片盖住（图片是子元素，永远画在内阴影之上）。 */
.wc-avatar.has-img {
    background: transparent;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .95),
                0 0 0 3px rgba(79, 70, 229, .10),
                0 6px 14px rgba(79, 70, 229, .14);
}
.wc-avatar.has-img img {
    width: 100%; height: 100%; display: block;
    object-fit: cover;
    /* 人像的视觉重心一般在上三分之一，居中裁容易切到额头或只剩肩膀 */
    object-position: center 30%;
}
.wc-avatar:active { transform: scale(.94); }
.wc-avatar:focus-visible { outline: 2px solid #6366f1; outline-offset: 3px; }
@media (hover: hover) {
    .welcome-card:hover .wc-avatar { transform: rotate(-7deg) scale(1.04); }
}
@media (max-width: 380px) {
    .wc-avatar { width: 50px; height: 50px; font-size: 26px; margin-left: 12px; }
}

.welcome-status {
    display: flex; align-items: center; gap: 7px;
    margin-top: 7px; max-width: 100%;
    font-size: 12.5px; line-height: 18px; color: #5b6478;
    white-space: nowrap; overflow: hidden;
    transition: color .15s;
}
/* 播报时整行让位给跑道（宽度已满，仅为兼容保留） */
.welcome-status.playing { width: 100%; max-width: 100%; }
.welcome-status.clickable { cursor: pointer; }
.welcome-status.clickable:hover { color: #3f4757; }
.welcome-status.clickable:active { opacity: .72; }
.welcome-status.is-alert { color: #7c5a2e; }

/* 状态点：平稳=绿，有待办/临期=琥珀呼吸 */
.wc-dot {
    width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px;
    background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .14);
    transition: background .2s, box-shadow .2s;
}
.welcome-status.is-alert .wc-dot {
    background: #f59e0b;
    animation: wcDotPulse 2.2s ease-in-out infinite;
}
@keyframes wcDotPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(245, 158, 11, .16); }
    50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, .05); }
}

.wc-go {
    flex: 0 0 auto; font-size: 15px; line-height: 1; color: #b8bfcd;
    margin-left: 2px;
    visibility: hidden; transition: transform .18s, color .18s;
}
.welcome-status.clickable .wc-go { visibility: visible; color: #aab1c0; }
.welcome-status.clickable:hover .wc-go { transform: translateX(2px); color: #4f46e5; }

.ws-viewport { position: relative; display: block; flex: 1 1 auto; min-width: 0; height: 18px; overflow: hidden; }
.ws-rest {
    display: block; height: 18px; line-height: 18px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.welcome-status.playing .ws-rest { visibility: hidden; }
/* 播报时左右各留一段淡出区，字不会硬切在边界上 */
.welcome-status.playing .ws-viewport {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 18px), transparent 100%);
}
.ws-flow {
    position: absolute; top: 0; left: 0; height: 18px; line-height: 18px;
    white-space: nowrap; will-change: transform; pointer-events: none;
}
.ws-flow .ut-tag { margin-right: 5px; }

@media (prefers-reduced-motion: reduce) {
    .welcome-status.is-alert .wc-dot { animation: none; }
    .welcome-card:hover .wc-avatar { transform: none; }
}

.ut-tag {
    display: inline-block; font-size: 10px; line-height: 15px; padding: 0 5px;
    border-radius: 4px; margin-right: 5px; vertical-align: 1px; font-weight: 600;
}
.ut-tag.新增 { background: #dcfce7; color: #15803d; }
.ut-tag.修复 { background: #fee2e2; color: #b91c1c; }
.ut-tag.优化 { background: #dbeafe; color: #1d4ed8; }
.ut-tag.升级 { background: #ede9fe; color: #6d28d9; }
/* 实时提醒类标签（优先级从高到低：临期 > 逾期 > 库存 > 更新） */
.ut-tag.临期 { background: #fee2e2; color: #b91c1c; }
.ut-tag.逾期 { background: #ffedd5; color: #c2410c; }
.ut-tag.库存 { background: #fef3c7; color: #a16207; }
.ut-tag.更新 { background: #e0e7ff; color: #4338ca; }
.ut-tag.汇总 { background: #f3f4f6; color: #6b7280; }
@keyframes utPulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* 今日提醒清单弹窗 */
.alert-group { padding: 8px 0 4px; border-bottom: 1px dashed #eef0f4; }
.alert-group:last-of-type { border-bottom: none; }
.alert-group-title {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; color: #4b5563; margin-bottom: 6px;
}
.alert-count {
    font-size: 10px; font-weight: 700; color: #fff; background: #818cf8;
    border-radius: 999px; padding: 0 6px; line-height: 15px;
}
.alert-row {
    display: flex; align-items: flex-start; gap: 6px;
    font-size: 12.5px; color: #374151; line-height: 1.75; padding: 3px 0;
}
.alert-row .ut-tag { flex-shrink: 0; margin-right: 0; }
.stock-low-tag {
    display: inline-block; font-size: 10px; line-height: 15px; padding: 0 5px;
    border-radius: 4px; background: #fee2e2; color: #b91c1c; font-weight: 600;
    vertical-align: 1px; margin-left: 2px;
}

/* 更新日志弹窗 */
.changelog-item { padding: 10px 0; border-bottom: 1px dashed #eef0f4; }
.changelog-item:last-child { border-bottom: none; }
.changelog-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.changelog-ver {
    font-size: 12px; font-weight: 700; color: #4f46e5;
    background: #eef2ff; border-radius: 6px; padding: 1px 7px;
}
.changelog-date { font-size: 11px; color: #9ca3af; }
.changelog-title { font-size: 13px; font-weight: 600; color: #374151; }
.changelog-line { font-size: 12.5px; color: #4b5563; line-height: 1.9; display: flex; gap: 6px; align-items: flex-start; }
.changelog-line .ut-tag { margin-right: 0; flex-shrink: 0; }

/* ========== 新手引导（聚光灯 + 说明卡） ========== */
.onboard-mask { position: fixed; inset: 0; z-index: 3000; pointer-events: none; }
.onboard-hole {
    position: absolute; border-radius: 14px; pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(17,24,39,.58), 0 0 0 3px rgba(99,102,241,.9) inset;
    transition: top .28s cubic-bezier(.4,0,.2,1), left .28s cubic-bezier(.4,0,.2,1),
                width .28s cubic-bezier(.4,0,.2,1), height .28s cubic-bezier(.4,0,.2,1);
}
.onboard-card {
    position: absolute; pointer-events: auto; width: min(320px, calc(100vw - 32px));
    background: #fff; border-radius: 14px; padding: 16px 16px 12px;
    box-shadow: 0 16px 50px rgba(17,24,39,.28); transition: top .28s, left .28s;
}
.onboard-card h3 { margin: 0 0 6px; font-size: 15px; color: #111827; }
.onboard-card p { margin: 0 0 12px; font-size: 13px; color: #4b5563; line-height: 1.7; }
.ob-step { font-size: 11px; color: #6366f1; font-weight: 600; margin-bottom: 4px; }
.ob-actions { display: flex; align-items: center; gap: 8px; }
.ob-actions .spacer { flex: 1; }
.ob-btn {
    border: 1px solid #e5e7eb; background: #fff; color: #4b5563;
    border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.ob-btn:hover { background: #f9fafb; }
.ob-btn.primary { background: #4f46e5; border-color: #4f46e5; color: #fff; font-weight: 600; }
.ob-btn.primary:hover { background: #4338ca; }
.ob-btn.ghost { border: none; background: transparent; color: #9ca3af; padding: 6px 4px; }
.onboard-card.center { left: 50% !important; top: 50% !important; transform: translate(-50%,-50%); }

/* ===== 统计卡跳转到今日照料时的聚焦反馈 ===== */
#today-care-card.flash-focus { animation: cardFlash 1.5s ease-out; }
@keyframes cardFlash {
    0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, .32); }
    100% { box-shadow: 0 0 0 14px rgba(79, 70, 229, 0); }
}
.plan-item.plan-hint { box-shadow: inset 0 0 0 2px rgba(79, 70, 229, .35); border-radius: 12px; }

/* ============================================================
   指纹 / 面容登录 + 微信换头像引导（2026-11-05）
   颜色统一走 theme.css 的变量，跟随 4 套主题；缺失变量时有兜底色。
   ============================================================ */
/* 登录页次级按钮：主按钮仍是密码登录，指纹只是"少打字"的快捷方式 */
.auth-alt{width:100%;margin-top:10px;padding:10px 0;display:none;align-items:center;justify-content:center;gap:7px;
  background:var(--brand-soft,#eef2ff);border:1px solid var(--brand-softer,#e0e7ff);border-radius:10px;
  color:var(--brand-deep,#4338ca);font-size:14px;font-weight:600;font-family:inherit;cursor:pointer;
  -webkit-tap-highlight-color:transparent;transition:background .15s,border-color .15s,transform .12s;}
.auth-alt:active{transform:scale(.985);}
@media (hover:hover){ .auth-alt:hover{background:var(--brand-softer,#e0e7ff);border-color:var(--brand,#6366f1);} }
.auth-alt-ico{width:17px;height:17px;flex:0 0 auto;}

/* 指纹管理面板 */
.pk-tip{font-size:12.5px;color:var(--text-muted,#6b7280);line-height:1.75;margin-bottom:12px;}
.pk-list{display:flex;flex-direction:column;gap:8px;}
.pk-item{display:flex;align-items:center;gap:10px;padding:10px 12px;
  background:var(--bg-page,#f5f7fb);border:1px solid var(--border-soft,#eef0f5);border-radius:10px;}
.pk-name{flex:1;font-size:13.5px;color:var(--text-strong,#111827);font-weight:600;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.pk-meta{font-size:11.5px;color:var(--text-faint,#9ca3af);flex:0 0 auto;}
.pk-empty{padding:14px;background:var(--bg-page,#f5f7fb);border:1px dashed var(--border,#e5e7eb);
  border-radius:10px;font-size:12.5px;color:var(--text-muted,#6b7280);line-height:1.75;}

/* ============================================================
   登录页视觉优化 + 账号安全 + 额度提示（2026-11-05）
   颜色一律走 theme.css 变量，保证四套主题都不串色
   ============================================================ */
.auth-mask{
  background:
    radial-gradient(900px 520px at 50% -8%, var(--brand-soft,#eef2ff) 0%, transparent 70%),
    radial-gradient(700px 420px at 50% 112%, var(--brand-softer,#e0e7ff) 0%, transparent 68%),
    var(--bg-page,#f5f7fb);
}
.auth-card{
  border:1px solid var(--border-soft,#eef0f5);
  box-shadow:0 18px 50px -12px var(--brand-glow,rgba(99,102,241,.28)), 0 2px 8px rgba(17,24,39,.04);
}
.auth-brand{text-align:center;margin-bottom:18px;}
.auth-logo{
  display:inline-flex;align-items:center;justify-content:center;
  width:66px;height:66px;border-radius:22px;font-size:38px;line-height:1;
  background:linear-gradient(145deg,var(--brand-soft,#eef2ff),#fff);
  box-shadow:0 8px 20px -8px var(--brand-glow,rgba(99,102,241,.35)), inset 0 1px 0 #fff;
}
.auth-title{margin:10px 0 0;font-size:21px;font-weight:700;letter-spacing:.5px;color:var(--text-strong,#111827);}
.auth-sub{margin-top:6px;font-size:12.5px;color:var(--text-muted,#6b7280);letter-spacing:.3px;}
/* 输入框左侧图标：把 margin 挪到外层，图标才能垂直居中 */
.auth-field{position:relative;margin-bottom:12px;}
.auth-field .auth-input{margin-bottom:0;padding-left:38px;}
.auth-field-ico{
  position:absolute;left:13px;top:50%;transform:translateY(-50%);
  width:16px;height:16px;color:var(--text-faint,#9ca3af);pointer-events:none;
}
.auth-links{display:flex;justify-content:center;margin-top:2px;}
.auth-links span{font-size:12.5px;color:var(--brand-deep,#4338ca);cursor:pointer;padding:4px 8px;border-radius:8px;}
@media (hover:hover){ .auth-links span:hover{background:var(--brand-soft,#eef2ff);} }
.auth-foot{margin-top:14px;font-size:11.5px;line-height:1.7;color:var(--text-faint,#9ca3af);}
.auth-msg{margin-top:8px;}

/* 额度用完的提示（不弹 alert，避免像报错） */
.quota-limit-lead{font-size:14px;line-height:1.8;color:var(--text-body,#374151);margin-bottom:10px;}
.quota-limit-tip{font-size:12.5px;line-height:1.9;color:var(--text-muted,#6b7280);
  background:var(--bg-page,#f5f7fb);border:1px solid var(--border-soft,#eef0f5);border-radius:10px;padding:11px 13px;}
.quota-limit-tip b{color:var(--brand-deep,#4338ca);}

/* 修改密码 / 忘记密码 */
.pwd-tip{margin-top:4px;font-size:12.5px;line-height:1.8;color:var(--text-muted,#6b7280);
  background:var(--bg-page,#f5f7fb);border-radius:10px;padding:10px 12px;}
.pwd-tip b{color:var(--text-strong,#111827);}
.pwd-help{font-size:13px;line-height:1.85;color:var(--text-body,#374151);}
.pwd-help p{margin:0 0 8px;}
.pwd-help ol{margin:0 0 10px;padding-left:20px;}
.pwd-help li{margin-bottom:6px;}
.pwd-help b{color:var(--brand-deep,#4338ca);}
.pwd-help code{background:var(--bg-page,#f5f7fb);border:1px solid var(--border-soft,#eef0f5);
  border-radius:5px;padding:1px 5px;font-size:12px;word-break:break-all;}
.pwd-help-note{font-size:12px;color:var(--text-faint,#9ca3af);margin-top:10px !important;}

/* 注销账号：红色语义固定，不跟品牌色走 —— 危险提示必须是红的 */
.danger-box{background:#fef2f2;border:1px solid #fecaca;border-radius:12px;
  padding:12px 14px;margin-bottom:14px;font-size:13px;line-height:1.7;color:#7f1d1d;}
.danger-box p{margin:0 0 8px;}
.danger-box ul{margin:0 0 8px;padding-left:18px;}
.danger-box li{margin:2px 0;}
.danger-box b{color:#991b1b;}
.danger-box .danger-note{margin:0;padding-top:8px;border-top:1px dashed #fecaca;
  font-size:12px;color:#b91c1c;}

/* __ICP_FOOTER__ 备案号悬挂：更新前端时严禁删除，详见长期记忆 */
.icp-footer { text-align:center; padding:14px 0 6px; font-size:11px; color:#9ca3af; }
.icp-footer a { color:#9ca3af; text-decoration:none; }
.icp-footer a:hover, .icp-footer a:focus-visible { color:#4f46e5; text-decoration:underline; }
/* 登录卡内那一份：遮罩是 fixed 全屏层，文档流末尾的备案块会被盖住，故卡内再挂一份 */
.auth-card .icp-footer { padding:10px 0 0; margin-top:2px; }
/* __ICP_FOOTER_END__ */

/* ===== 病历结局 + 退出档案（2026-11-06）===== */
/* 三档结局各有自己的颜色：治愈=绿、好转=蓝、死亡=灰。未填写不着色，保持中性。 */
/* 结局的入口在病历列表行上（治疗结束回来点一下就好）；卡内只有只读摘要 + 结果日期。
   列表行：症状一行 + 右侧三档点选，点一次就落库，不需要进卡保存。
   用 grid + minmax(0,1fr) 而不是 flex：症状是 nowrap 长句，flex 的 min-content 会把卡片撑破
   （实测 390px 宽下日期被挤出屏幕）。 */
.med-row-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.med-row-label {
  min-width: 0; font-size: 12px; color: #4b5563;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.med-row-empty { color: #9ca3af; }
.med-oc-inline {
  display: inline-flex; gap: 4px; margin-left: auto; padding: 3px;
  background: #fff; border: 1px solid #eef0f4; border-radius: 999px;
}
.med-oc-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid transparent; background: transparent; font: inherit; font-size: 12px; line-height: 1.2;
  color: #6b7280; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.med-oc-pill i { width: 7px; height: 7px; border-radius: 50%; background: #d1d5db; transition: background .15s; }
.med-oc-pill:hover { border-color: var(--oc); color: var(--oc); }
.med-oc-pill.is-on { background: var(--ob); border-color: var(--oc); color: var(--oc); font-weight: 600; }
.med-oc-pill.is-on i { background: var(--oc); }
.med-oc-readonly { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: #6b7280; }
.med-oc-ro-label { font-size: 12px; color: #6b7280; }
.med-oc-ro-input { width: auto; padding: 5px 8px; font-size: 12px; }
.med-oc-ro-empty { color: #9ca3af; font-size: 12px; }
/* 窄屏：点选区掉到下一行右对齐，症状独占一行不被挤成两个字 */
@media (max-width: 520px) {
  .med-row-body { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .med-oc-inline { margin-left: auto; }
}

/* 已退出（死亡/售出）的龟：名字变灰划横线 + 状态徽标；记录本身永不删除 */
.turtle-exit-badge {
  display:inline-block; margin-left:6px; padding:1px 7px; border-radius:9px;
  font-size:11px; font-weight:600; vertical-align:middle; text-decoration:none; white-space:nowrap;
}
.turtle-gone-node { opacity:.72; }
