/* ===== 宝宝成长记 App 全局样式（奶油底 + 粉色主调 + 圆角卡片） ===== */

:root {
  --pink: #F76C8A;
  --pink-light: #FF9EB5;
  --pink-deep: #E75D82;
  --pink-bg: #FFE9EE;
  --cream: #FFF7F0;
  --cream-2: #FAF3ED;
  --cream-3: #FAF5F0;
  --mint: #2BB3A3;
  --text: #4A3F3A;
  --text-2: #6B5E57;
  --text-3: #9C8F88;
  --text-4: #BDB0A8;
  --line: #F6EEE8;
  --danger: #F0554E;
  --content-max: 860px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* 可视区尺寸：js/ui.js 里的 visualViewport 监听实时更新，
     键盘弹起时 --vvh 变小，居中弹层据此限高，不被键盘盖住 */
  --vvh: 100vh;
  --vv-top: 0px;
}

* {
  box-sizing: border-box;
}

/* 覆盖 display:flex 等规则对 hidden 属性的影响 */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "HarmonyOS Sans SC", "PingFang SC",
    "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior-y: contain;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  outline: none;
  margin: 0;
  padding: 0;
}

button {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

img {
  display: block;
}

/* ===== 顶部标题栏 ===== */
#appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  padding: calc(var(--safe-top) + 8px) max(16px, calc(50% - var(--content-max) / 2)) 8px;
  background: rgba(255, 247, 240, 0.94);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(246, 238, 232, 0.9);
}

#appbar-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appbar-back {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  color: var(--pink);
  border-radius: 50%;
  margin-left: -6px;
  padding-bottom: 4px;
}

.appbar-back:active {
  background: var(--pink-bg);
}

/* ===== 页面容器 ===== */
.page {
  padding: 16px 16px calc(32px + var(--safe-bottom));
  max-width: var(--content-max);
  margin: 0 auto;
}

body.with-tabbar .page {
  padding-bottom: calc(122px + var(--safe-bottom));
}

/* 卡片 */
.card {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(247, 108, 138, 0.08);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}

/* 按钮 */
.btn-primary {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #FF9EB5, #F76C8A);
  color: #FFFFFF;
  border-radius: 999px;
  text-align: center;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(247, 108, 138, 0.3);
}

.btn-primary:active {
  filter: brightness(0.96);
}

.btn-ghost {
  display: block;
  width: 100%;
  border: 1px solid var(--pink);
  color: var(--pink);
  background: #FFFFFF;
  border-radius: 999px;
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
}

.btn-ghost:active {
  background: var(--pink-bg);
}

.btn-danger {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #FFA6A6, #F0554E);
  color: #FFFFFF;
  border-radius: 999px;
  text-align: center;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(240, 85, 78, 0.28);
}

.add-inline {
  color: var(--pink);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
}

.add-inline:active {
  opacity: 0.7;
}

/* 次级危险操作（页面底部删除按钮） */
.btn-delete {
  display: block;
  width: 100%;
  text-align: center;
  color: var(--danger);
  font-size: 14px;
  padding: 12px 0;
  margin-top: 10px;
}

.btn-delete:active {
  opacity: 0.7;
}

/* 分段器 */
.seg {
  display: flex;
  background: #F6EEE8;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 14px;
}

.seg-item {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  border-radius: 999px;
  color: var(--text-3);
  font-size: 14px;
}

.seg-item.active {
  background: #FFFFFF;
  color: var(--pink);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* chip 选择项 */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--cream-2);
  color: var(--text-3);
  font-size: 13px;
  margin: 0 8px 8px 0;
  border: 1px solid transparent;
}

.chip.active {
  background: var(--pink-bg);
  color: var(--pink-deep);
  border-color: var(--pink);
  font-weight: 500;
}

.chip.disabled {
  opacity: 0.45;
}

/* 小标签 */
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 999px;
  margin-right: 6px;
  white-space: nowrap;
}

.tag.pink { background: var(--pink-bg); color: var(--pink-deep); }
.tag.green { background: #E0F5EF; color: #2BB3A3; }
.tag.orange { background: #FFF0D9; color: #E8A23D; }
.tag.grey { background: #F2EEEB; color: var(--text-3); }
.tag.red { background: #FFE3E3; color: var(--danger); }

/* 表单 */
.form-item {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 6px;
}

.input-box {
  background: var(--cream-3);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-box input,
.input-box textarea {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  background: none;
}

.input-box textarea {
  resize: none;
  line-height: 1.6;
  font-family: inherit;
}

.input-box input::placeholder,
.input-box textarea::placeholder {
  color: #C4B8B1;
}

/* 原生日期控件：去掉系统外观，保持与其它输入一致 */
input[type="date"].plain-input,
.plain-input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  width: 100%;
  color: inherit;
}

input[type="date"].plain-input::-webkit-calendar-picker-indicator {
  opacity: 0.55;
}

input[type="date"].plain-input::-webkit-date-and-time-value {
  text-align: left;
}

/* 应用内日历的触发按钮（放在 .input-box 里，外观与其它输入框一致） */
.date-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: none;
  padding: 0;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.date-btn:active .date-btn-text {
  color: var(--pink-deep);
}

.date-btn-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.date-btn-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-btn-text.is-empty {
  color: #C4B8B1;
}

/* ===== 自制日历选择器 ===== */

.cal {
  padding: 18px 14px 16px;
}

.cal-title {
  font-size: 14px;
  color: var(--text-3);
  text-align: center;
  margin-bottom: 10px;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cal-month {
  font-size: 16px;
  font-weight: 700;
  color: var(--pink-deep);
  background: var(--pink-bg);
  padding: 6px 20px;
  border-radius: 999px;
}

.cal-nav-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: var(--cream-2);
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
  color: var(--pink-deep);
  cursor: pointer;
  font-family: inherit;
}

.cal-nav-btn:active {
  background: var(--pink-bg);
  transform: scale(0.92);
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 2px;
}

.cal-week span {
  padding: 4px 0;
}

.cal-week .cal-wkend {
  color: var(--pink-light);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day {
  position: relative;
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.cal-day:active:not(.dis) {
  background: var(--pink-bg);
}

/* 选中：粉色渐变圆 */
.cal-day.sel {
  background: linear-gradient(135deg, var(--pink), var(--pink-light));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(247, 108, 138, 0.35);
}

/* 今天：描边 + 底部小圆点 */
.cal-day.today:not(.sel) {
  color: var(--pink-deep);
  font-weight: 700;
  box-shadow: inset 0 0 0 1.5px var(--pink-light);
}

.cal-day.today:not(.sel)::after {
  content: '';
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--pink);
}

.cal-day.dis {
  color: var(--text-4);
  opacity: 0.45;
  cursor: default;
}

.cal-foot {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.cal-today {
  display: block;
  margin: 0 auto;
  border: none;
  background: var(--cream-2);
  color: var(--text-2);
  font-size: 12px;
  padding: 7px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}

.cal-today:active {
  background: var(--pink-bg);
  color: var(--pink-deep);
}

.cal-input-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-2);
}

.cal-input-label {
  flex-shrink: 0;
  margin-right: 2px;
  color: var(--text-3);
}

.cal-num {
  width: 44px;
  min-width: 0;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 8px 2px;
  text-align: center;
  font-size: 14px;
  background: var(--cream-3);
  color: var(--text);
  font-family: inherit;
}

.cal-num.cal-y {
  width: 56px;
}

.cal-num:focus {
  border-color: var(--pink);
  outline: none;
  background: #fff;
}

.cal-ok {
  margin-left: auto;
  flex-shrink: 0;
  border: none;
  background: linear-gradient(135deg, var(--pink), var(--pink-light));
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 10px rgba(247, 108, 138, 0.3);
}

.cal-ok:active {
  transform: scale(0.94);
}

/* ===== 时间滚轮选择器（tw-*，与 cal-* 同层） ===== */
.tw {
  width: min(320px, 86vw);
}

.tw-title {
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  padding: 4px 0 2px;
}

.tw-preview {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--pink);
  font-variant-numeric: tabular-nums;
  padding: 2px 0 8px;
}

.tw-cols {
  display: flex;
  height: 200px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.tw-col {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.tw-band {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  height: 36px;
  transform: translateY(-50%);
  background: #FFF3F5;
  border-radius: 10px;
  pointer-events: none;
}

.tw-list {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.tw-list::-webkit-scrollbar {
  display: none;
}

.tw-item {
  height: 36px;
  line-height: 36px;
  text-align: center;
  font-size: 16px;
  color: #6B5E57;
  font-variant-numeric: tabular-nums;
  background: none;
  border: none;
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  scroll-snap-align: center;
}

.tw-item.sel {
  color: var(--pink);
  font-weight: 800;
  font-size: 18px;
}

.tw-foot {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.tw-foot .btn-ghost,
.tw-foot .btn-primary {
  flex: 1;
}

.picker-value {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}

.picker-value.placeholder {
  color: #C4B8B1;
}

/* 开关 */
.switch {
  position: relative;
  width: 50px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 999px;
  background: #E5D9D0;
  transition: background 0.2s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s;
}

.switch.on {
  background: var(--pink);
}

.switch.on::after {
  transform: translateX(20px);
}

/* 通用小件 */
.empty {
  text-align: center;
  color: var(--text-4);
  font-size: 13px;
  padding: 36px 0;
}

.empty-emoji {
  font-size: 44px;
  margin-bottom: 10px;
  text-align: center;
  line-height: 1.2;
}

.empty-btn {
  margin: 18px 40px 0;
  /* button 不会像 div 那样自动撑满，这里显式算宽度，避免左右 40px 外边距溢出 */
  width: calc(100% - 80px);
}

.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.flex-1 { flex: 1; min-width: 0; }

.sub-text {
  color: var(--text-3);
  font-size: 12px;
  margin-top: 4px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

/* 悬浮添加按钮 */
.fab {
  position: fixed;
  right: 20px;
  bottom: calc(96px + var(--safe-bottom));
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF9EB5, #F76C8A);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  padding-bottom: 3px;
  box-shadow: 0 8px 18px rgba(247, 108, 138, 0.4);
  z-index: 10;
}

.fab:active {
  filter: brightness(0.95);
}

body:not(.with-tabbar) .fab {
  bottom: calc(24px + var(--safe-bottom));
}

/* ===== 底部导航（悬浮圆角条） ===== */
#tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 0 12px calc(10px + var(--safe-bottom));
  z-index: 99;
  pointer-events: none;
}

.tabbar {
  pointer-events: auto;
  display: flex;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: 0 6px 24px rgba(74, 63, 58, 0.12);
  padding: 8px 10px;
  width: 100%;
  max-width: 520px;
}

.tab-item {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 4px 0;
  border-radius: 18px;
}

.tab-item .tab-icon {
  display: block;
  font-size: 22px;
  line-height: 1.2;
}

.tab-item .tab-text {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}

.tab-item.active {
  background: var(--pink-bg);
}

.tab-item.active .tab-text {
  color: var(--pink);
  font-weight: 600;
}

/* 本地图片占位：图片与占位层重叠，加载完成前显示 [data-img-holder] 里的 emoji 占位 */
[data-img-wrap] {
  position: relative;
  background: var(--cream-2);
  overflow: hidden;
}

[data-img-wrap] > img[data-img-id],
[data-img-wrap] > [data-img-holder] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

[data-img-wrap] > img[data-img-id] {
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s ease;
}

[data-img-wrap].img-ready > img[data-img-id] {
  opacity: 1;
}

[data-img-wrap].img-ready > [data-img-holder] {
  display: none;
}

/* 横向滑动条（菜谱分组 / 衣物尺码）：隐藏滚动条，靠滑动或换行展示 */
.group-scroll,
.size-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.group-scroll::-webkit-scrollbar,
.size-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* ===== 弹层体系 ===== */
/* 弹层必须盖在底部导航之上（导航 z-index: 99），否则弹层底部按钮会被导航挡住 */
#layer-root {
  position: relative;
  z-index: 120;
}

/* 弹层打开时收起底部导航 */
body.has-layer #tabbar {
  display: none;
}

/* 原生选图：把透明的 file input 铺满整块区域，
   手机上由浏览器直接唤起拍照/相册，比 JS 触发 input.click() 可靠得多 */
.pick-host {
  position: relative;
}

.pick-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* 不用 opacity:0：个别手机浏览器会跳过完全透明元素上的点击命中 */
  opacity: 0.011;
  z-index: 5;
  cursor: pointer;
}

/* 选图区里的「直接拍照」胶囊按钮（capture 属性让系统直接开相机） */
.pick-cam {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 6;
}

.pick-cam-inline {
  position: relative;
  right: auto;
  bottom: auto;
  margin-left: auto;
  flex-shrink: 0;
}

.pick-cam > span {
  display: block;
  background: rgba(255, 255, 255, 0.94);
  color: var(--pink-deep);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(74, 63, 58, 0.18);
}

.layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.layer-in {
  opacity: 1;
}

.mask {
  position: absolute;
  inset: 0;
  background: rgba(74, 63, 58, 0.45);
}

.modal,
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #FFFFFF;
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  max-height: 82vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.2s;
  box-shadow: 0 -8px 30px rgba(74, 63, 58, 0.16);
}

.layer-in .modal,
.layer-in .sheet {
  transform: translateY(0);
  opacity: 1;
}

/* 居中编辑弹层：位置和高度都相对「可视区域」（键盘弹起时 --vvh 变小），
   整个弹层始终完整落在键盘上方的可见区内 */
.modal.modal-center {
  left: 50%;
  right: auto;
  bottom: auto;
  top: calc(var(--vv-top) + (var(--vvh) / 2));
  width: min(92vw, 560px);
  max-height: calc(var(--vvh) - 24px);
  border-radius: 24px;
  padding: 20px 16px;
  transform: translate(-50%, -50%) scale(0.94);
  box-shadow: 0 12px 40px rgba(74, 63, 58, 0.22);
}

.layer-in .modal.modal-center {
  transform: translate(-50%, -50%) scale(1);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  margin-top: 18px;
}

.modal-actions .btn-ghost {
  flex: 1;
  margin-right: 10px;
}

.modal-actions .btn-primary {
  flex: 1;
}

/* 居中确认框 */
.dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(320px, calc(100vw - 48px));
  transform: translate(-50%, -50%) scale(0.94);
  opacity: 0;
  background: #FFFFFF;
  border-radius: 18px;
  padding: 22px 18px 18px;
  text-align: center;
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.18s;
  box-shadow: 0 12px 40px rgba(74, 63, 58, 0.22);
}

.layer-in .dialog {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.dialog-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.dialog-content {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

.dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.dialog-actions > * {
  flex: 1;
}

.dialog-ok {
  flex: 1;
}

/* 动作菜单 */
.sheet-flat {
  padding-top: 8px;
}

.sheet-title {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  padding: 10px 0;
}

.sheet-item {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.sheet-item:active {
  background: var(--cream-2);
}

.sheet-cancel {
  font-weight: 600;
  color: var(--text-3);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(140px + var(--safe-bottom));
  transform: translateX(-50%);
  background: rgba(74, 63, 58, 0.9);
  color: #FFFFFF;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 999px;
  z-index: 200;
  max-width: 80vw;
  text-align: center;
  animation: toast-in 0.18s ease;
}

.toast-ok::before {
  content: "✓ ";
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* 启动画面 */
#splash {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.3s ease;
}

#splash.gone {
  opacity: 0;
  pointer-events: none;
}

.splash-logo {
  font-size: 56px;
  line-height: 1;
}

.splash-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}

.splash-sub {
  font-size: 12px;
  color: var(--text-3);
}

/* ===== 折叠屏展开态 / 平板宽屏适配 ===== */
@media (min-width: 700px) {
  .page {
    padding: 24px 24px calc(40px + var(--safe-bottom));
  }

  body.with-tabbar .page {
    padding-bottom: calc(130px + var(--safe-bottom));
  }

  .card {
    padding: 22px 20px;
  }

  .seg-item {
    font-size: 15px;
  }

  .tabbar {
    max-width: 560px;
  }

  .modal,
  .sheet {
    left: 50%;
    right: auto;
    transform: translate(-50%, 16px);
    width: min(560px, calc(100vw - 48px));
    border-radius: 20px;
    margin-bottom: 24px;
  }

  .layer-in .modal,
  .layer-in .sheet {
    transform: translate(-50%, 0);
  }
}

/* 超宽屏时悬浮按钮跟随内容区右缘，而不是贴屏幕边 */
@media (min-width: 920px) {
  .fab {
    right: calc(50% - var(--content-max) / 2 + 4px);
  }
}

/* ===== 应用内拍照取景层（不经过系统文件选择器） ===== */
.camera {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.layer-in .camera {
  opacity: 1;
}

.camera-video {
  flex: 1;
  width: 100%;
  min-height: 0;
  object-fit: contain;
  background: #000000;
}

.camera-tip {
  color: #FFE9EE;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  padding: 10px 22px;
}

.camera-tip:empty {
  display: none;
}

.camera-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px calc(18px + var(--safe-bottom));
  background: #111111;
}

.camera-btn {
  min-width: 64px;
  color: #FFFFFF;
  font-size: 15px;
  padding: 8px 6px;
}

.camera-shutter {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 4px #111111;
}

.camera-shutter:active {
  opacity: 0.82;
}

/* 表单字段的小提示 */
.form-hint {
  color: #C4B8B1;
  font-size: 12px;
  margin-left: 6px;
}

/* 选图区下方的按钮行 */
.picker-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.picker-actions > * {
  flex: 1;
}

/* 「在浏览器里打开」入口（独立窗口模式下用，设置页与选图区共用） */
.pick-browser {
  display: block;
  text-decoration: none;
  margin-top: 10px;
  padding: 12px 0;
  font-weight: 600;
}
