/* ==========================================================================
   Fridge Bridge · 纯视觉设计样式表 14.0 (最终收尾版)
   (隐藏滚动条 · 底部三Tab导航 · 软化冰箱装饰 · 纯文字卡片 · 紧凑生活感)
   ========================================================================== */

:root {
  /* 暖调奶油生活底色体系 */
  --bg-page: #FAF7F2;
  --bg-card: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-rail: #EFE9DF;

  /* 文字颜色体系 */
  --text-main: #362B20;
  --text-muted: #968A7E;
  --text-sub: #ABA094;

  /* 焦糖暖金主色调 */
  --accent-caramel: #CF8B57;
  --accent-caramel-hover: #BF7B47;
  --accent-gradient: linear-gradient(135deg, #DE9966 0%, #C37E49 100%);
  --accent-brown-icon: #BA8D65;

  /* 语义标签色彩 */
  --tag-cold-bg: #EFF5FA;
  --tag-cold-text: #4F7B9C;
  --tag-freeze-bg: #F4F2F9;
  --tag-freeze-text: #736C95;
  --tag-room-bg: #FAF5EA;
  --tag-room-text: #A68037;

  --tag-raw-bg: #F1F6F2;
  --tag-raw-text: #5F876E;
  --tag-cooked-bg: #FAF3EB;
  --tag-cooked-text: #B36829;
  --tag-opened-bg: #FDF2EC;
  --tag-opened-text: #D77E32;

  --tag-urgent-bg: #FDF0EC;
  --tag-urgent-text: #D8583E;
  --tag-warning-bg: #FEF6EC;
  --tag-warning-text: #D97D32;
  --tag-grey-bg: #F4EFE9;
  --tag-grey-text: #8E8378;

  /* 边框与阴影 */
  --border-card: rgba(226, 218, 206, 0.55);
  --border-delicate: rgba(226, 218, 206, 0.35);
  --shadow-card: 0 2px 8px rgba(60, 48, 36, 0.03), 0 1px 2px rgba(60, 48, 36, 0.015);
  --shadow-modal: 0 16px 40px rgba(45, 35, 25, 0.18);

  /* 圆角规范 */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 9999px;

  /* 动效 */
  --ease-snappy: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.15s;
  --dur-normal: 0.25s;
}

/* 全局重置与隐藏浏览器原生滚动条 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

*::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Webkit */
  width: 0;
  height: 0;
}

button, input, textarea, select {
  font: inherit;
}

button {
  color: inherit;
}

html, body {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background-color: #E6E1D6;
  color: var(--text-main);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* 手机视口容器：优先跟随浏览器真实可见高度，避免地址栏/键盘遮挡 */
.device-viewport {
  width: 100%;
  max-width: 430px;
  height: 100vh;
  max-height: 100vh;
  height: var(--app-viewport-height, 100dvh);
  max-height: var(--app-viewport-height, 100dvh);
  background-color: var(--bg-page);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(40, 30, 20, 0.08);
  margin: 0 auto;
  overflow: hidden;
}

/* 页面切换控制器 */
.view-page {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.view-page.active {
  display: flex;
}

/* ==========================================================================
   页面 1: 首页 (Home)
   ========================================================================== */

/* 固定的顶部控制台 (Header + 搜索 + 温区 + 今天注意) */
.home-fixed-top-console {
  flex-shrink: 0;
  background: var(--bg-page);
  z-index: 30;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(226, 218, 206, 0.2);
}

.app-hero-header {
  padding: max(10px, env(safe-area-inset-top)) 16px 4px 16px;
}

.hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.hero-text-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.hero-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* 右上角写实小冰箱与绿植微缩装饰（弱化尺寸与对比度，纯作为场景点缀） */
.fridge-hero-artwork {
  width: 76px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform var(--dur-fast);
}

.fridge-hero-artwork:active {
  transform: scale(0.96);
}

.hero-fridge-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.90;
  transition: opacity 0.2s ease;
}

.fridge-hero-artwork:hover .hero-fridge-img {
  opacity: 1.0;
}

/* 搜索胶囊框 */
.search-capsule {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border-radius: var(--r-full);
  padding: 0 14px;
  height: 38px;
  margin-bottom: 8px;
  border: 1px solid rgba(220, 210, 195, 0.45);
  box-shadow: 0 1px 4px rgba(60, 48, 36, 0.02);
}

.search-svg-icon {
  margin-right: 8px;
  flex-shrink: 0;
}

.search-capsule input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
}

.search-capsule input::placeholder {
  color: #ADA194;
}

.search-clear-btn {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
  display: none;
}

/* 温区分段切换 */
.storage-segment-rail {
  display: flex;
  background: transparent;
  border-radius: var(--r-full);
  padding: 0;
  gap: 4px;
}

.seg-item {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: var(--r-md);
  padding: 6px 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: all var(--dur-fast);
}

.seg-item.active {
  background: #EDE5DA;
  color: var(--text-main);
  font-weight: 700;
}

/* 今天需要注意 (固定在顶部) */
.attention-zone-pinned {
  padding: 6px 16px 2px 16px;
}

.zone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding: 0 2px;
}

.zone-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bell-glyph-icon {
  display: flex;
  align-items: center;
}

.zone-heading {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.btn-zone-more {
  background: none;
  border: none;
  font-size: 11.5px;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 2px 4px;
}

/* 横向 3 张纯文字焦点卡片（最紧急在左侧，无物品图片，无emoji） */
.attention-cards-carousel {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.att-card-item {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-card);
  padding: 10px 10px 8px 10px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: transform var(--dur-fast);
}

.att-card-item:active {
  transform: scale(0.97);
}

.att-name-qty-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
}

.att-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.att-item-qty {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.att-status-pill-mini {
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 5px;
  white-space: nowrap;
  line-height: 1.2;
  align-self: flex-start;
}

.att-status-pill-mini.urgent { background: #FDF0EC; color: #D8583E; }
.att-status-pill-mini.prioritize { background: #FEF6EC; color: #D97D32; }
.att-status-pill-mini.confirm { background: #F4EFE9; color: #8E8378; }

/* 核心滚动区域：【具体食物分类双列流上下滑动】 */
.food-stream-scrollable {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 16px calc(76px + env(safe-area-inset-bottom, 0px)) 16px;
  overscroll-behavior-y: contain;
}

/* 分类双列卡片流 */
.category-group-unit {
  margin-bottom: 14px;
}

.category-group-title-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  padding: 0 2px;
}

.cat-left-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.cat-pill-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cat-pill-icon.bg-protein { background: #FAF2EA; color: #BA8D65; }
.cat-pill-icon.bg-veg { background: #EEF6F0; color: #688F6D; }
.cat-pill-icon.bg-staple { background: #FAF4E8; color: #BA8D65; }
.cat-pill-icon.bg-fruit { background: #FDF0F0; color: #BA8D65; }
.cat-pill-icon.bg-dairy { background: #EFF5FA; color: #BA8D65; }
.cat-pill-icon.bg-snack { background: #F5F2F9; color: #BA8D65; }
.cat-pill-icon.bg-other { background: #F3EFE9; color: #BA8D65; }

.cat-title-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

/* 双列网格 */
.two-column-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* 核心食物卡片（纯文字：名字+数量一行，状态标签一行） */
.food-card-exact {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-card);
  padding: 12px 12px 10px 12px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 62px;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-snappy);
}

.food-card-exact:active {
  transform: scale(0.978);
}

/* 第一行：名字 + 数量 */
.card-name-qty-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.exact-food-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.exact-food-amount {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* 底部标签药丸行 */
.card-bottom-pills {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}

.tag-pill {
  font-size: 9.5px;
  font-weight: 500;
  padding: 1.5px 4.5px;
  border-radius: var(--r-xs);
  white-space: nowrap;
}

.pill-cold { background: var(--tag-cold-bg); color: var(--tag-cold-text); }
.pill-freeze { background: var(--tag-freeze-bg); color: var(--tag-freeze-text); }
.pill-room { background: var(--tag-room-bg); color: var(--tag-room-text); }

.pill-raw { background: var(--tag-raw-bg); color: var(--tag-raw-text); }
.pill-cooked { background: var(--tag-cooked-bg); color: var(--tag-cooked-text); }
.pill-opened { background: var(--tag-opened-bg); color: var(--tag-opened-text); }

.status-expiry-pill {
  font-size: 9.5px;
  padding: 1.5px 4.5px;
  border-radius: var(--r-xs);
  white-space: nowrap;
}

.status-expiry-pill.grey { background: var(--tag-grey-bg); color: var(--tag-grey-text); }
.status-expiry-pill.confirm { background: #F4EFE9; color: #8E8378; }
.status-expiry-pill.urgent { background: var(--tag-urgent-bg); color: var(--tag-urgent-text); font-weight: 600; }
.status-expiry-pill.prioritize { background: var(--tag-warning-bg); color: var(--tag-warning-text); font-weight: 600; }

.bottom-padding-spacer {
  height: 24px;
}

/* 空状态 */
.empty-state-card {
  text-align: center;
  padding: 36px 16px;
}

.empty-msg {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 12px;
}

.btn-reset-filter {
  background: #EDE5DA;
  border: none;
  border-radius: var(--r-full);
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}

/* ==========================================================================
   通用页面顶部返回栏
   ========================================================================== */
.page-top-nav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px 16px;
  background: var(--bg-page);
}

.align-left-nav {
  justify-content: flex-start;
  gap: 12px;
}

.nav-back-btn, .nav-round-back-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.nav-back-btn:active, .nav-round-back-btn:active {
  transform: scale(0.92);
}

.nav-title-box {
  display: flex;
  flex-direction: column;
}

.page-top-nav:not(.align-left-nav) .nav-title-box {
  align-items: center;
}

.nav-page-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.nav-page-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.nav-hero-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.nav-hero-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.nav-placeholder-right {
  width: 36px;
}

/* ==========================================================================
   页面 2: 详情与操作 (Detail & Action View)
   ========================================================================== */
.main-body-scroll {
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 10px 16px calc(84px + env(safe-area-inset-bottom, 0px)) 16px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.detail-summary-card {
  background: #FFFFFF;
  border-radius: var(--r-lg);
  border: 1px solid var(--border-card);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.summary-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-label {
  font-size: 11.5px;
  color: var(--text-muted);
}

.summary-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.summary-val.highlight-orange {
  color: #D18A56;
}

.summary-val.text-muted-val {
  color: var(--text-sub);
}

.detail-section-block {
  margin-bottom: 20px;
}

.section-block-heading {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  padding-left: 2px;
}

/* 4 个大动作卡片 (2x2 Grid) */
.actions-quad-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quad-act-card,
.quad-text-group {
  min-width: 0;
}

.quad-act-card {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  padding: 14px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  text-align: left;
  transition: transform var(--dur-fast);
}

.quad-act-card:active {
  transform: scale(0.96);
}

.quad-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bg-act-yellow { background: #FFF6E6; }
.bg-act-red { background: #FEEFEE; }
.bg-act-green { background: #EEF7F0; }
.bg-act-blue { background: #EDF5FB; }

.quad-text-group {
  display: flex;
  flex-direction: column;
}

.quad-main-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.quad-sub-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 变状态 4 小卡片 */
.state-quad-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.state-quad-row.state-three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.state-mini-card {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--r-md);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform var(--dur-fast);
}

.state-mini-card:active {
  transform: scale(0.95);
}

.state-mini-icon {
  margin-bottom: 4px;
}

.state-mini-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.state-mini-sub {
  font-size: 10px;
  color: var(--text-sub);
  margin-top: 1px;
}

/* 最近记录列表 */
.timeline-records-list {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-item {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
}

.timeline-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 12px;
  position: relative;
}

.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #BA8D65;
}

.timeline-line {
  position: absolute;
  top: 8px;
  width: 1px;
  height: 24px;
  background: #E8DFD3;
}

.timeline-content {
  flex: 1;
  font-size: 13px;
}

.timeline-time {
  color: #362B20;
  font-weight: 600;
}

.timeline-desc {
  color: var(--text-muted);
}

.timeline-arrow {
  color: var(--text-sub);
  font-size: 14px;
}

.bottom-save-bar {
  flex-shrink: 0;
  padding: 12px 16px calc(env(safe-area-inset-bottom, 12px) + 12px) 16px;
  background: var(--bg-page);
  border-top: 1px solid var(--border-delicate);
}

.btn-save-full-pill {
  width: 100%;
  height: 44px;
  background: var(--accent-gradient);
  color: #FFFFFF;
  border: none;
  border-radius: var(--r-full);
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(207, 139, 87, 0.35);
}

.btn-save-full-pill:active {
  transform: scale(0.97);
}

/* ==========================================================================
   页面 3: 添加食材 (Add Food View)
   ========================================================================== */
.clean-page-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.add-form-scroll-view {
  width: 100%;
  min-width: 0;
}

.form-row-card {
  width: 100%;
  min-width: 0;
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-card);
}

.form-block-card {
  width: 100%;
  min-width: 0;
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-card);
}

.card-lead-label, .block-card-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  min-width: 60px;
}

.opt-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.form-ghost-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--text-main);
  outline: none;
  padding-left: 8px;
}

.form-ghost-input::placeholder {
  color: #ADA194;
}

.align-right-date {
  text-align: right;
  padding-left: 0;
}

.expiry-row-card {
  align-items: flex-start;
}

.expiry-field-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.expiry-recommendation {
  max-width: 100%;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.35;
  text-align: right;
}

.form-two-col-grid {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-two-col-grid > * {
  min-width: 0;
}

.unit-dropdown-mock {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.drop-arrow {
  color: var(--text-sub);
  font-size: 11px;
  padding-right: 4px;
}

.chips-flex-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-chip-btn {
  background: #FAF7F2;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 7px 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--dur-fast);
}

.pill-chip-btn.active {
  background: #FFF8F2;
  border-color: rgba(207, 139, 87, 0.4);
  color: #CF8B57;
  font-weight: 700;
}

.segmented-grid-picker {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.segmented-grid-picker.four-cols {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segment-pill-item {
  min-width: 0;
  background: #FAF7F2;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 8px 4px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: all var(--dur-fast);
}

.segment-pill-item.active {
  background: #FFF8F2;
  border-color: rgba(207, 139, 87, 0.4);
  color: #CF8B57;
  font-weight: 700;
}

.form-ghost-textarea {
  width: 100%;
  min-width: 0;
  border: none;
  background: #FAF7F2;
  border-radius: var(--r-sm);
  padding: 10px;
  font-size: 13px;
  color: var(--text-main);
  resize: none;
  outline: none;
  font-family: inherit;
}

.form-ghost-textarea::placeholder {
  color: #ADA194;
}

.textarea-counter {
  text-align: right;
  font-size: 11px;
  color: var(--text-sub);
}

.form-btn-vertical-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding-bottom: 30px;
}

.btn-text-cancel {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

/* ==========================================================================
   页面 4: 我的 (Profile View)
   ========================================================================== */
.profile-header-block {
  flex-shrink: 0;
  padding: max(12px, env(safe-area-inset-top)) 16px 8px 16px;
}

.profile-top-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 14px;
}

.profile-card-top {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-card);
}

.profile-fridge-avatar {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #FAF2EA;
  border: 1px solid rgba(186, 141, 101, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-fridge-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-title-group {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.profile-motto {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-menu-section {
  margin-bottom: 20px;
}

/* 今天摘要 */
.today-summary-box {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 10px;
}

.today-summary-lead {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

.today-metrics-cols {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  text-align: center;
}

.metric-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px solid var(--border-delicate);
}

.metric-cell:last-child {
  border-right: none;
}

.metric-name {
  font-size: 11px;
  color: var(--text-muted);
}

.metric-number {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.metric-unit {
  font-size: 12px;
  font-weight: 500;
}

.profile-feature-card {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 10px;
}

.profile-feature-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.profile-feature-head > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.profile-feature-head strong {
  font-size: 13.5px;
  color: var(--text-main);
}

.profile-feature-head span {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

.favorite-add-row {
  display: flex;
  gap: 8px;
}

.profile-soft-input,
.reminder-time-input {
  min-width: 0;
  border: 1px solid var(--border-delicate);
  background: #FBF8F3;
  color: var(--text-main);
  outline: none;
  font: inherit;
}

.profile-soft-input {
  flex: 1;
  height: 38px;
  border-radius: 12px;
  padding: 0 11px;
  font-size: 13px;
}

.profile-small-btn {
  border: none;
  border-radius: 12px;
  padding: 0 14px;
  background: #EFE3D4;
  color: #6F5540;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.favorite-foods-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.favorite-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 6px 9px 6px 10px;
  background: #F8F1E8;
  color: #5E4938;
  font-size: 12px;
}

.favorite-chip button {
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(116, 91, 70, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  line-height: 18px;
}

.profile-empty-copy,
.profile-muted-copy {
  margin-top: 9px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.5;
}

.soft-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  cursor: pointer;
}

.soft-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.soft-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #DDD5CC;
  transition: 0.18s ease;
}

.soft-switch-track::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(60, 45, 32, 0.18);
  transition: 0.18s ease;
}

.soft-switch input:checked + .soft-switch-track {
  background: #BFA68D;
}

.soft-switch input:checked + .soft-switch-track::after {
  transform: translateX(18px);
}

.reminder-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-sub);
}

.reminder-time-input {
  height: 34px;
  border-radius: 10px;
  padding: 0 8px;
  font-size: 12.5px;
}

.about-app-card {
  background: #FFFFFF;
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

.about-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.menu-chevron {
  color: var(--text-sub);
  font-size: 15px;
}

/* ==========================================================================
   温区全景简报弹窗
   ========================================================================== */
.fridge-zones-report {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.zone-report-card {
  background: #FAF7F2;
  border: 1px solid rgba(226, 218, 206, 0.6);
  border-radius: var(--r-md);
  padding: 12px 14px;
}

.zone-report-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.zone-tag-label {
  font-size: 13.5px;
  font-weight: 700;
}

.zone-tag-label.cold { color: #4F7B9C; }
.zone-tag-label.freeze { color: #736C95; }
.zone-tag-label.room { color: #A68037; }

.zone-temp-badge {
  font-size: 11px;
  font-weight: 600;
  background: #FFFFFF;
  border: 1px solid rgba(226, 218, 206, 0.4);
  border-radius: var(--r-xs);
  padding: 2px 6px;
  color: var(--text-muted);
}

.zone-report-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   底部 Tab 导航栏 (首页 · ＋ 添加 · 我的)
   ========================================================================== */
.bottom-tab-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  min-height: 50px;
  height: calc(50px + env(safe-area-inset-bottom, 0px));
  background: rgba(250, 247, 242, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-delicate);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 5px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 45;
}

.tab-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #A89E92;
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  width: 64px;
  transition: color var(--dur-fast);
}

.tab-btn.active {
  color: var(--accent-caramel);
  font-weight: 700;
}

/* 中间「＋ 添加」Tab 稍微突出（温润小方圆角底块） */
.tab-btn-center-add .tab-add-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #FAF2EA;
  border: 1px solid rgba(207, 139, 87, 0.3);
  color: #CF8B57;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1px;
  transition: transform var(--dur-fast), background-color var(--dur-fast);
}

.tab-btn-center-add:active .tab-add-icon-box {
  transform: scale(0.92);
  background: #F4E5D4;
}

/* ==========================================================================
   弹窗与 Toast
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(30, 24, 18, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 120;
  display: none;
  opacity: 0;
  transition: opacity var(--dur-normal) ease;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.center-modal-dialog {
  width: 100%;
  max-width: 350px;
  background: #FFFFFF;
  border-radius: var(--r-xl);
  padding: 18px 20px;
  box-shadow: var(--shadow-modal);
}

.dialog-header-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.dialog-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dialog-title-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.btn-close-modal {
  background: #F3EDE4;
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  font-size: 12px;
  cursor: pointer;
}

.dialog-scroll-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.modal-record-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FAF7F2;
  border-radius: var(--r-md);
  padding: 10px 12px;
  cursor: pointer;
}

.modal-record-item:active {
  transform: scale(0.98);
}

.modal-item-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-item-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.dialog-footer-row {
  margin-top: 16px;
}

.btn-dialog-submit {
  width: 100%;
  height: 40px;
  background: var(--accent-gradient);
  color: #FFFFFF;
  border: none;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.reduce-stock-hint {
  margin: -4px 0 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.reduce-stock-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.reduce-stock-option {
  min-width: 0;
  padding: 14px 10px;
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
  background: #FAF7F2;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  cursor: pointer;
}

.reduce-stock-option strong {
  font-size: 13px;
}

.reduce-stock-option span {
  color: var(--text-muted);
  font-size: 10.5px;
}

.reduce-stock-option.danger {
  background: #FFF7F5;
  border-color: rgba(216, 88, 62, 0.16);
}

.quantity-dialog {
  max-width: 330px;
}

.quantity-modal-hint {
  margin: -4px 0 12px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.quantity-input-shell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: #FAF7F2;
  border: 1px solid var(--border-card);
  border-radius: var(--r-lg);
}

.quantity-input-shell > label {
  font-size: 12px;
  color: var(--text-muted);
}

.quantity-input-main {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
}

.quantity-input-main input {
  width: 100%;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  text-align: right;
  color: var(--text-main);
  font-size: 20px;
  font-weight: 750;
}

.quantity-unit {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.quantity-all-btn {
  flex-shrink: 0;
  border: 1px solid rgba(207, 139, 87, 0.22);
  background: #FAF2EA;
  color: var(--accent-caramel);
  border-radius: var(--r-full);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.quantity-max-hint {
  margin: 7px 2px 13px;
  color: var(--text-sub);
  font-size: 10.5px;
}

.quantity-confirm-btn {
  height: 42px;
}

.quantity-confirm-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

@media (max-width: 360px) {
  .form-two-col-grid {
    grid-template-columns: 1fr;
  }

  .segmented-grid-picker.four-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions-quad-grid {
    grid-template-columns: 1fr;
  }

  .main-body-scroll {
    padding-left: 12px;
    padding-right: 12px;
  }
}

.toast-popup-notice {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-28px);
  background: rgba(45, 36, 28, 0.94);
  color: #FFFFFF;
  padding: 7px 18px;
  border-radius: var(--r-full);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  opacity: 0;
  transition: all 0.25s var(--ease-snappy);
  z-index: 200;
}

.toast-popup-notice.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
