:root{
  --bg:#F7F3EC; --card:#FFFFFF; --ink:#211E1B; --sub:#7C7369; --line:#EDE5D9;
  --brand:#C0503C; --brand-soft:#FBEDE8; --brand-deep:#96392A;
  --green:#3F7B5C; --green-soft:#E9F2EC; --amber:#B57B22; --amber-soft:#FBF1DC;
  --red:#B8432F; --red-soft:#FBEAE6;
  --shadow:0 1px 2px rgba(64,45,30,.05), 0 8px 24px -12px rgba(64,45,30,.18);
  --radius:18px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;
  background:#E9E2D7; color:var(--ink); font-size:15px; line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
button{font-family:inherit;font-size:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
input,select,textarea{font-family:inherit;font-size:16px;color:inherit}
#app{position:relative;max-width:480px;min-height:100dvh;margin:0 auto;background:var(--bg);
  box-shadow:0 0 60px rgba(60,40,20,.12);overflow-x:hidden}
#screen{min-height:100dvh;padding-bottom:calc(84px + env(safe-area-inset-bottom))}
#screen.no-tabs{padding-bottom:0}
.hidden{display:none!important}

/* ---------- 认证 ---------- */
.auth{min-height:100dvh;padding:48px 24px 40px;display:flex;flex-direction:column;
  background:radial-gradient(120% 60% at 50% 0%,#FBF0E4 0%,var(--bg) 60%)}
.brand{text-align:center;margin-bottom:26px}
.logo{width:64px;height:64px;border-radius:20px;background:var(--brand);color:#fff;font-size:30px;
  display:flex;align-items:center;justify-content:center;margin:0 auto 14px;
  box-shadow:0 10px 24px -10px rgba(192,80,60,.65);font-weight:600}
.brand h1{margin:0;font-size:26px;letter-spacing:.06em}
.brand p{margin:6px 0 0;color:var(--sub);font-size:13px;letter-spacing:.02em}
.auth-card{background:var(--card);border-radius:24px;padding:22px 18px;box-shadow:var(--shadow)}
.seg{display:flex;background:#F1EBE1;border-radius:14px;padding:4px;margin-bottom:18px}
.seg button{flex:1;padding:9px 0;border-radius:11px;color:var(--sub);font-size:14px;font-weight:500;transition:.18s}
.seg button.on{background:#fff;color:var(--ink);box-shadow:0 1px 4px rgba(0,0,0,.08)}
.field{margin-bottom:14px}
.field label{display:block;font-size:12.5px;color:var(--sub);margin-bottom:6px;font-weight:500}
.field input,.field textarea,.field select{width:100%;border:1px solid var(--line);background:#FCFAF7;
  border-radius:13px;padding:12px 13px;outline:none;transition:.15s}
.field input:focus,.field textarea:focus,.field select:focus{border-color:var(--brand);background:#fff}
.field .hint{font-size:11.5px;color:#A29890;margin-top:5px}
.auth-foot{text-align:center;font-size:12px;color:#A29890;margin-top:18px;line-height:1.7}
.who-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:14px 0 4px}
.who{display:flex;flex-direction:column;align-items:center;gap:6px;padding:14px 6px 12px;border-radius:16px;
  border:1px solid var(--line);background:#fff;transition:.15s}
.who:active{transform:scale(.97);border-color:var(--brand)}
.who .avatar{width:46px;height:46px;border-radius:16px;font-size:18px}
.who .nm{font-size:13px;font-weight:600;color:var(--ink)}
.who .ro{font-size:10px;color:var(--sub)}
.who-title{font-size:12px;color:var(--sub);margin:14px 0 8px;letter-spacing:.02em}
.auth-hint{font-size:11.5px;color:#A29890;text-align:center;margin-top:14px;line-height:1.7}
.cond-grid{display:flex;gap:8px;flex-wrap:wrap}
.cond{flex:1;min-width:88px;border:1px solid var(--line);border-radius:13px;padding:9px 6px;text-align:center;
  font-size:13px;color:var(--sub);background:#FCFAF7;transition:.15s}
.cond.on{border-color:var(--brand);background:var(--brand-soft);color:var(--brand-deep);font-weight:600}

/* ---------- 通用 ---------- */
.page{padding:0 16px}
.topbar{position:sticky;top:0;z-index:20;padding:14px 16px 10px;display:flex;align-items:center;
  justify-content:space-between;background:rgba(247,243,236,.92);backdrop-filter:blur(12px)}
.topbar .greet{font-size:12px;color:var(--sub)}
.topbar .name{font-size:19px;font-weight:600;letter-spacing:.02em;line-height:1.25}
.icon-btn{width:38px;height:38px;border-radius:50%;background:#fff;display:flex;align-items:center;
  justify-content:center;border:1px solid var(--line);position:relative;box-shadow:0 1px 2px rgba(0,0,0,.03)}
.icon-btn svg{width:19px;height:19px;fill:none;stroke:var(--ink);stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.dot{position:absolute;top:7px;right:8px;width:8px;height:8px;border-radius:50%;background:var(--brand);border:2px solid #fff}
.card{background:var(--card);border-radius:var(--radius);padding:16px;box-shadow:var(--shadow);margin-bottom:14px}
.card-tight{padding:13px 14px}
.section-title{display:flex;align-items:center;justify-content:space-between;margin:20px 2px 10px}
.section-title h2{font-size:15px;margin:0;font-weight:600;letter-spacing:.01em}
.section-title .more{font-size:12.5px;color:var(--sub)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border-radius:13px;
  padding:11px 16px;font-size:14.5px;font-weight:600;transition:.15s;border:1px solid transparent}
.btn:active{transform:scale(.98)}
.btn-primary{background:var(--brand);color:#fff;box-shadow:0 8px 18px -10px rgba(192,80,60,.8)}
.btn-soft{background:var(--brand-soft);color:var(--brand-deep)}
.btn-ghost{background:#fff;border-color:var(--line);color:var(--ink)}
.btn-block{width:100%;padding:14px}
.btn-sm{padding:7px 12px;font-size:12.5px;border-radius:10px}
.btn-danger{background:#fff;border-color:#F0D6D0;color:var(--red)}
.disabled{opacity:.5;pointer-events:none}
.muted{color:var(--sub)}
.tiny{font-size:12px}

/* ---------- 日期条 ---------- */
.datebar{display:flex;align-items:center;gap:10px;margin:4px 0 12px}
.datebar .arrow{width:34px;height:34px;border-radius:50%;background:#fff;border:1px solid var(--line);
  display:flex;align-items:center;justify-content:center;color:var(--sub);font-size:16px}
.datebar .mid{flex:1;text-align:center}
.datebar .d1{font-size:17px;font-weight:600}
.datebar .d2{font-size:11.5px;color:var(--sub);margin-top:1px}
.today-tag{display:inline-block;font-size:10.5px;padding:1px 7px;border-radius:20px;background:var(--green-soft);
  color:var(--green);margin-left:6px;vertical-align:2px}

/* ---------- 控制卡 ---------- */
.ctrl{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 14px}
.ctrl+.ctrl{border-top:1px solid var(--line)}
.ctrl .label{font-size:14px;font-weight:500}
.ctrl .sub{font-size:11.5px;color:var(--sub);margin-top:2px}
.stepper{display:flex;align-items:center;gap:2px;background:#F5F0E8;border-radius:12px;padding:3px}
.stepper button{width:32px;height:32px;border-radius:9px;background:#fff;color:var(--ink);font-size:18px;
  display:flex;align-items:center;justify-content:center;box-shadow:0 1px 2px rgba(0,0,0,.06);line-height:1}
.stepper .val{min-width:34px;text-align:center;font-size:16px;font-weight:600}
.notice{display:flex;gap:8px;align-items:flex-start;background:var(--amber-soft);color:#7A5413;
  border-radius:13px;padding:10px 12px;font-size:12.5px;line-height:1.5;margin-bottom:12px}
.notice.green{background:var(--green-soft);color:#2C5B44}
.notice .ico{font-size:14px;line-height:1.35}

/* ---------- 菜品 ---------- */
.dish{display:flex;gap:12px;padding:13px 0;border-top:1px solid var(--line)}
.dish:first-child{border-top:0;padding-top:4px}
.cat-tag{flex:0 0 auto;width:26px;height:26px;border-radius:9px;font-size:11px;font-weight:700;
  display:flex;align-items:center;justify-content:center;margin-top:2px}
.cat-meat{background:var(--red-soft);color:var(--red)}
.cat-veg{background:var(--green-soft);color:var(--green)}
.cat-soup{background:#EEF1F8;color:#4A6591}
.dish-body{flex:1;min-width:0}
.dish-name{font-size:15.5px;font-weight:600;letter-spacing:.01em;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.dish-sub{font-size:11.5px;color:var(--sub);margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dish-tip{font-size:11.5px;color:#8B7B62;margin-top:5px;line-height:1.45}
.hp-row{display:flex;gap:5px;margin-top:7px;flex-wrap:wrap}
.hp{font-size:10.5px;padding:2px 7px;border-radius:7px;background:#F4EFE7;color:var(--sub);letter-spacing:.02em}
.hp.good{background:var(--green-soft);color:var(--green)}
.hp.mid{background:var(--amber-soft);color:var(--amber)}
.hp.bad{background:var(--red-soft);color:var(--red)}
.swap{flex:0 0 auto;align-self:center;font-size:12px;color:var(--brand-deep);background:var(--brand-soft);
  border-radius:11px;padding:8px 10px;font-weight:600;white-space:nowrap}
.swap:active{transform:scale(.96)}
.swap.spin svg{animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.empty{text-align:center;padding:34px 16px;color:var(--sub)}
.empty .emoji{font-size:40px;margin-bottom:10px}
.empty h3{margin:0 0 6px;font-size:15px;color:var(--ink);font-weight:600}
.empty p{margin:0;font-size:12.5px;line-height:1.7}

/* ---------- 购物清单 ---------- */
.shop-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}
.progress{height:6px;background:#F0E9DE;border-radius:6px;overflow:hidden;margin:8px 0 12px}
.progress i{display:block;height:100%;background:linear-gradient(90deg,#4E8A68,#3F7B5C);border-radius:6px;transition:.3s}
.shop-group{margin-top:12px}
.shop-group h4{margin:0 0 6px;font-size:12px;color:var(--sub);font-weight:600;letter-spacing:.06em}
.shop-item{display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:1px dashed #F0E9DE}
.shop-item:last-child{border-bottom:0}
.check{width:21px;height:21px;border-radius:7px;border:1.5px solid #D9CFC0;flex:0 0 auto;display:flex;
  align-items:center;justify-content:center;transition:.15s;background:#fff}
.check svg{width:12px;height:12px;stroke:#fff;stroke-width:2.6;fill:none;opacity:0}
.check.on{background:var(--green);border-color:var(--green)}
.check.on svg{opacity:1}
.shop-item .nm{flex:1;font-size:13.5px}
.shop-item.done .nm{text-decoration:line-through;color:#B3A99D}
.shop-item .qt{font-size:12.5px;color:var(--sub);font-variant-numeric:tabular-nums}
.season{font-size:12px;color:var(--sub);line-height:1.7;margin-top:10px;background:#FCFAF7;
  padding:9px 11px;border-radius:11px}

/* ---------- 菜谱池 ---------- */
.search{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid var(--line);
  border-radius:14px;padding:10px 13px;margin-bottom:10px}
.search svg{width:16px;height:16px;stroke:var(--sub);fill:none;stroke-width:2}
.search input{border:0;background:none;outline:none;flex:1;font-size:14px}
.chips{display:flex;gap:7px;overflow-x:auto;padding:2px 0 12px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:0 0 auto;padding:7px 13px;border-radius:99px;background:#fff;border:1px solid var(--line);
  font-size:12.5px;color:var(--sub);white-space:nowrap}
.chip.on{background:var(--ink);border-color:var(--ink);color:#fff;font-weight:500}
.pool-item{display:flex;gap:11px;padding:11px 0;border-top:1px solid var(--line);align-items:flex-start}
.pool-item:first-child{border-top:0}
.pool-item .dish-name{font-size:14.5px}
.pool-item .ops{display:flex;gap:6px;flex-shrink:0}
.op{width:32px;height:32px;border-radius:10px;display:flex;align-items:center;justify-content:center;
  background:#F6F1E9;color:var(--sub)}
.op svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round}
.op.warn{color:var(--red)}
.stat-line{font-size:11.5px;color:var(--sub);margin:0 2px 8px}
.add-fab{position:fixed;bottom:calc(96px + env(safe-area-inset-bottom));right:calc(50% - 240px + 16px);
  width:52px;height:52px;border-radius:50%;background:var(--brand);color:#fff;font-size:26px;
  display:flex;align-items:center;justify-content:center;box-shadow:0 10px 24px -8px rgba(192,80,60,.75);z-index:30}
@media(max-width:520px){.add-fab{right:16px}}

/* ---------- 家庭 ---------- */
.qr-card{text-align:center;padding:20px 16px}
.qr-wrap{background:#fff;border:1px solid var(--line);border-radius:18px;padding:10px;width:196px;margin:0 auto 12px}
.qr-wrap img{width:100%;display:block;border-radius:8px}
.invite-code{font-size:24px;letter-spacing:.32em;font-weight:700;margin:6px 0 2px;font-variant-numeric:tabular-nums}
.member{display:flex;align-items:center;gap:11px;padding:11px 0;border-top:1px solid var(--line)}
.member:first-of-type{border-top:0}
.avatar{width:40px;height:40px;border-radius:14px;background:#EFE7DA;color:#7A6A55;display:flex;
  align-items:center;justify-content:center;font-weight:600;font-size:15px;flex:0 0 auto;position:relative}
.avatar.master{background:var(--brand-soft);color:var(--brand-deep)}
.online-dot{position:absolute;right:-1px;bottom:-1px;width:11px;height:11px;border-radius:50%;
  background:var(--green);border:2px solid #fff}
.member .info{flex:1;min-width:0}
.member .nm{font-size:14.5px;font-weight:600;display:flex;align-items:center;gap:6px}
.member .meta{font-size:11.5px;color:var(--sub);margin-top:2px}
.tag-mini{font-size:10px;padding:1px 6px;border-radius:6px;background:#F4EFE7;color:#8B7B62;font-weight:500}
.tag-mini.master{background:var(--brand-soft);color:var(--brand-deep)}
.cond-mini{display:flex;gap:4px;margin-top:4px;flex-wrap:wrap}
.cond-mini span{font-size:10px;padding:1px 6px;border-radius:6px;background:#F6F1E9;color:#8B7B62}
.tag-mini.cook{background:#EEF1F8;color:#4A6591}
.tag-mini.off{background:#F4EFE7;color:#B3A99D}
.member.off{opacity:.62}
.switch{position:relative;width:46px;height:27px;display:inline-block;flex:0 0 auto}
.switch input{position:absolute;opacity:0;width:0;height:0}
.switch i{position:absolute;inset:0;background:#E4DACB;border-radius:99px;transition:.2s}
.switch i:after{content:'';position:absolute;width:21px;height:21px;border-radius:50%;background:#fff;top:3px;left:3px;transition:.2s;box-shadow:0 1px 3px rgba(0,0,0,.18)}
.switch input:checked+i{background:var(--green)}
.switch input:checked+i:after{transform:translateX(19px)}

/* ---------- 通知 / sheet / toast ---------- */
.sheet-backdrop{position:fixed;inset:0;background:rgba(30,22,15,.42);z-index:60;opacity:0;transition:.2s;
  display:flex;align-items:flex-end;justify-content:center}
.sheet-backdrop.show{opacity:1}
.sheet{width:100%;max-width:480px;background:var(--bg);border-radius:24px 24px 0 0;padding:10px 18px
  calc(24px + env(safe-area-inset-bottom));max-height:88dvh;overflow-y:auto;transform:translateY(18px);transition:.24s}
.sheet-backdrop.show .sheet{transform:none}
.sheet-handle{width:38px;height:4px;border-radius:3px;background:#DDD3C4;margin:6px auto 12px}
.sheet h3{margin:0 0 12px;font-size:17px}
.list-item{display:flex;gap:10px;padding:12px 0;border-top:1px solid var(--line)}
.list-item:first-child{border-top:0}
.list-item .li-body{flex:1}
.list-item .li-title{font-size:13.5px;font-weight:600}
.list-item .li-text{font-size:12px;color:var(--sub);margin-top:3px;line-height:1.55}
.list-item .li-time{font-size:10.5px;color:#B3A99D;margin-top:5px}
.list-item.unread .li-title::before{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;
  background:var(--brand);margin-right:6px;vertical-align:2px}
#toast-root{position:fixed;left:0;right:0;bottom:calc(96px + env(safe-area-inset-bottom));z-index:90;
  display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;padding:0 18px}
.toast{background:rgba(33,30,27,.94);color:#fff;font-size:13px;padding:11px 15px;border-radius:14px;
  max-width:420px;line-height:1.5;box-shadow:0 12px 30px -12px rgba(0,0,0,.5);animation:up .28s ease}
.toast.ok{background:#2F6B4F}
.toast.warn{background:#8A4B19}
@keyframes up{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* ---------- 导航 ---------- */
.tabbar{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:480px;z-index:40;
  display:flex;background:rgba(252,249,244,.94);backdrop-filter:blur(16px);border-top:1px solid var(--line);
  padding:6px 6px calc(6px + env(safe-area-inset-bottom))}
.tab{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 0;color:#A79D92;
  font-size:10.5px;border-radius:12px;transition:.15s}
.tab svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.tab.active{color:var(--brand)}
.tab.active svg{stroke-width:2}

/* ---------- 其它 ---------- */
.row{display:flex;gap:10px;align-items:center}
.row-sb{display:flex;align-items:center;justify-content:space-between;gap:10px}
.link{color:var(--brand-deep);font-weight:600;font-size:13px}
.hr{height:1px;background:var(--line);margin:12px 0}
.hero{padding:2px 0 8px}
.hero h1{font-size:22px;margin:0 0 4px;letter-spacing:.01em}
.hero p{margin:0;font-size:12.5px;color:var(--sub)}
.skeleton{background:linear-gradient(90deg,#F1EBE1 25%,#F8F4EE 37%,#F1EBE1 63%);
  background-size:400% 100%;animation:sk 1.3s infinite;border-radius:12px;height:64px;margin-bottom:10px}
@keyframes sk{0%{background-position:100% 50%}100%{background-position:0 50%}}
input[type=range]{accent-color:var(--brand)}
