/* ============================================================
 * 趣漫古·运营宝典 v3 UI 层
 * 新信息架构 + 操作感（音效/动效/反馈）+ 高级视觉
 * ============================================================ */

/* ---------- 顶栏 ---------- */
.v3-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: linear-gradient(135deg, #0FA377 0%, #0D7C5F 55%, #085C46 100%);
  color: #fff;
  box-shadow: 0 4px 18px rgba(13,124,95,.25);
}
.v3-header-left { display: flex; flex-direction: column; gap: 1px; }
.v3-header-title { font-size: 18px; font-weight: 800; letter-spacing: .5px; text-shadow: 0 1px 2px rgba(0,0,0,.12); }
.v3-header-sub { font-size: 11.5px; opacity: .92; }
.v3-icon-btn {
  width: 38px; height: 38px; border: none; border-radius: 12px;
  background: rgba(255,255,255,.16); color: #fff; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.v3-icon-btn:active { transform: scale(.9); background: rgba(255,255,255,.28); }

/* ---------- 页面容器 ---------- */
.container-v3 { padding-top: 14px; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); }

/* ---------- 分段控件 ---------- */
.v3-seg {
  display: flex; gap: 6px; padding: 5px; margin: 0 0 12px;
  background: #EAF2EE; border-radius: 14px;
  box-shadow: inset 0 1px 2px rgba(22,52,42,.06);
}
.v3-seg-btn {
  flex: 1; border: none; border-radius: 11px; padding: 12px 6px;
  min-height: 44px;
  font-size: 14px; font-weight: 700; color: var(--text-sub);
  background: transparent; transition: all .18s ease;
}
.v3-seg-btn.active {
  background: var(--grad-primary); color: #fff;
  box-shadow: 0 3px 10px var(--primary-glow);
}
.v3-seg-btn:active { transform: scale(.96); }
.v3-seg-pane { animation: v3FadeIn .22s ease; }
@keyframes v3FadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 底部导航（毛玻璃 + 6宫格感） ---------- */
.v3-tabbar {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 6px);
  background: rgba(255,255,255,.92) !important;
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 22px rgba(22,52,42,.08);
}
.v3-tab {
  position: relative; flex: 1;
}
.v3-tab .tab-icon { font-size: 21px; transition: transform .18s ease; }
.v3-tab.active .tab-icon { transform: translateY(-2px) scale(1.12); }
.v3-tab.active::after {
  content: ''; position: absolute; top: 2px; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 3px;
  background: var(--grad-primary);
}

/* ---------- 首页 Hero ---------- */
.home-hero {
  border-radius: 20px; padding: 18px 18px 16px; color: #fff;
  background: var(--grad-primary);
  box-shadow: 0 10px 26px var(--primary-glow);
  position: relative; overflow: hidden;
}
.home-hero::after {
  content: ''; position: absolute; right: -36px; top: -46px;
  width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 70%);
}
.home-hero-label { font-size: 13px; opacity: .92; display: flex; justify-content: space-between; }
.home-hero-row { display: flex; align-items: center; gap: 8px; margin: 8px 0 10px; }
.home-hero-input {
  flex: 1; min-width: 0; border: none; background: transparent; color: #fff;
  font-size: 34px; font-weight: 800; outline: none;
  font-variant-numeric: tabular-nums;
}
.home-hero-input::placeholder { color: rgba(255,255,255,.6); }
.home-hero-currency { font-size: 22px; font-weight: 800; }
.home-hero-sub { font-size: 12px; opacity: .85; }
.home-save-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: #fff;
  background: rgba(255,255,255,.22); border-radius: 999px; padding: 3px 10px;
  animation: v3Pop .25s ease;
}
@keyframes v3Pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }

/* ---------- 首页进度卡 ---------- */
.home-progress { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.home-stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 13px 14px; box-shadow: var(--shadow-card);
  transition: transform .15s ease;
}
.home-stat-card:active { transform: scale(.97); }
.home-stat-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-sub); }
.home-stat-num { font-size: 26px; font-weight: 800; color: var(--text); margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.home-stat-bar { height: 6px; border-radius: 6px; background: #EAF2EE; overflow: hidden; margin-top: 6px; }
.home-stat-bar > i { display: block; height: 100%; border-radius: 6px; background: var(--grad-primary); transition: width .4s ease; }

/* ---------- 首页宫格 ---------- */
.home-grid-title { font-size: 14px; font-weight: 800; color: var(--text); margin: 18px 4px 10px; letter-spacing: .3px; }
.home-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.home-cell {
  background: var(--card); border: 1px solid var(--border); border-radius: 15px;
  padding: 12px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  box-shadow: var(--shadow-card); transition: transform .15s ease;
}
.home-cell:active { transform: scale(.93); }
.home-cell-ico { font-size: 24px; }
.home-cell-name { font-size: 11.5px; font-weight: 700; color: var(--text-sub); text-align: center; }

/* ---------- 盘点行（含确认按钮） ---------- */
.stock-card .stock-ok {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 34px; border-radius: 10px; border: none;
  background: var(--primary-light); color: var(--primary);
  font-size: 15px; font-weight: 800; flex-shrink: 0;
  transition: all .15s ease;
}
.stock-card .stock-ok:active { transform: scale(.86); background: var(--primary); color: #fff; }
.stock-card .stock-ok.done { background: var(--primary); color: #fff; }
.stock-save-line {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
}
.stock-save-line .stock-input { flex: 1; }

/* ---------- 清空按钮 ---------- */
.v3-clear-btn {
  border: none; background: rgba(255,255,255,.22); color: #fff;
  width: 26px; height: 26px; border-radius: 50%; font-size: 12px; line-height: 1;
  display: none; align-items: center; justify-content: center;
}
.revenue-input-wrap:focus-within .v3-clear-btn, .v3-clear-btn.show { display: inline-flex; }

/* ---------- 保存条（页面底部浮动） ---------- */
#saveBarRoot { position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 74px); z-index: 60; display: flex; justify-content: center; pointer-events: none; }
.save-bar {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  background: #17251F; color: #fff; border-radius: 16px;
  padding: 10px 12px 10px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.28);
  animation: v3SlideUp .22s ease; max-width: 92%;
}
@keyframes v3SlideUp { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.save-bar .sb-msg { font-size: 13px; font-weight: 600; }
.save-bar .sb-btn {
  border: none; border-radius: 11px; padding: 8px 16px; font-size: 13.5px; font-weight: 800;
}
.save-bar .sb-save { background: var(--grad-primary); color: #fff; }
.save-bar .sb-cancel { background: rgba(255,255,255,.14); color: #fff; }

/* ---------- 金额/数量徽标 ---------- */
.v3-qty-badge {
  display: inline-block; background: var(--primary-light); color: var(--primary);
  font-size: 12px; font-weight: 800; border-radius: 999px; padding: 2px 9px;
}

/* ---------- 通用按钮反馈 ---------- */
.action-btn, .chip-toggle, .menu-card, .admin-btn, .admin-btn-sm {
  transition: transform .13s ease, box-shadow .13s ease !important;
}
button:active, .menu-card:active { transform: scale(.97); }

/* ---------- Toast 强化 ---------- */
#toastRoot .toast {
  animation: v3ToastIn .22s cubic-bezier(.2,.9,.3,1.2) !important;
  border-radius: 14px !important;
  font-weight: 600 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.18) !important;
  background: rgba(23,37,31,.94) !important;
  color: #fff !important;
}
@keyframes v3ToastIn { from { transform: translateY(8px) scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 空状态 ---------- */
.empty-state { border-radius: 16px; }

/* ---------- 排班日历优化 ---------- */
.cal-cell { transition: transform .12s ease; }
.cal-cell:active { transform: scale(.92); }

/* ---------- 首页提醒条 ---------- */
.home-alert {
  display: flex; align-items: center; gap: 9px;
  background: #FFF7EB; border: 1px solid #F5DFC0; border-radius: 14px;
  padding: 10px 12px; margin-top: 12px; font-size: 13px; color: #9A6B1F;
}
.home-alert b { color: #C77B12; }
