:root { --ink: #21332e; --sage: #738f80; --cream: #f5f2e9; --panel: #fff; --amber: #d99a4e; --line: #e6e5de; --green: #4b9d72; }
* { box-sizing: border-box; }
html,body { overflow-x: hidden; scrollbar-width: none; }
::-webkit-scrollbar { display: none; }
body { margin: 0; background: #dfe4df; color: var(--ink); font-family: Inter,-apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif; }
.home-shell { width: min(100%,520px); min-height: 100vh; margin: auto; padding: 0 14px 100px; background: var(--cream); }
button { font: inherit; }
.home-head { display: flex; height: 68px; align-items: center; justify-content: space-between; }
.home-logo { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.home-logo>i { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 12px; background: var(--ink); color: #fff; }
.home-logo span { font-size: 14px; font-weight: 800; }
.home-logo small { display: block; color: #8d978f; font-size: 6px; letter-spacing: .2em; }
.home-head>div { display: flex; align-items: center; gap: 5px; }
.home-head>div>span { margin-right: 5px; color: var(--sage); font-size: 6px; font-weight: 800; letter-spacing: .1em; }
.home-head button { position: relative; border: 0; background: transparent; color: #57675f; font-size: 18px; }
.home-head button b { position: absolute; right: 2px; top: 1px; width: 6px; height: 6px; border: 1px solid var(--cream); border-radius: 50%; background: #e46c55; }
.family-hero { position: relative; min-height: 285px; overflow: hidden; border-radius: 25px; background: url("assets/home.webp") center/cover; color: #fff; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(0deg,#162822d9 0,#16282255 55%,transparent); }
.family-copy { position: absolute; z-index: 2; right: 20px; bottom: 21px; left: 20px; }
.family-copy>span { font-size: 7px; }
.family-copy>span i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: #75d697; box-shadow: 0 0 8px #75d697; }
.family-copy h1 { margin: 8px 0 4px; font-family: "Songti SC",serif; font-size: 23px; }
.family-copy p { margin: 0; color: #d5dfd9; font-size: 8px; }
.family-copy button { margin-top: 14px; padding: 8px 11px; border: 1px solid #ffffff55; border-radius: 9px; background: #ffffff16; color: #fff; font-size: 7px; backdrop-filter: blur(8px); }
.home-weather { position: absolute; right: 15px; top: 15px; display: grid; grid-template-columns: 20px 1fr; align-items: center; padding: 8px 10px; border-radius: 12px; background: #1b2d276b; backdrop-filter: blur(12px); }
.home-weather>i { grid-row: 1/3; font-size: 18px; }
.home-weather strong { font-size: 14px; }
.home-weather span { font-size: 6px; }
.env-strip { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; padding: 10px 0; }
.env-strip article { display: flex; align-items: center; gap: 6px; padding: 9px 7px; border-radius: 12px; background: #fff; }
.env-strip>article>i { color: var(--sage); font-size: 15px; }
.env-strip span,.env-strip strong,.env-strip em { display: block; }
.env-strip span { color: #87918b; font-size: 5px; }
.env-strip strong { margin: 2px 0; color: var(--ink); font-size: 9px; }
.env-strip em { color: var(--green); font-size: 5px; font-style: normal; }
.scene-section,.room-section { padding-top: 19px; }
.scene-section>header,.room-section>header,.energy-home>header { display: flex; align-items: end; justify-content: space-between; margin-bottom: 11px; }
.scene-section header small,.energy-home header small { color: var(--sage); font-size: 6px; font-weight: 800; letter-spacing: .16em; }
.scene-section h2,.room-section h2,.energy-home h2 { margin: 2px 0 0; font-size: 17px; }
.scene-section header button { border: 0; background: transparent; color: #859088; font-size: 7px; }
.scenes { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.scene { display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); text-align: left; }
.scene>i { grid-row: 1/3; display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: #edf1ec; color: var(--sage); font-size: 16px; }
.scene span { font-size: 9px; font-weight: 700; }
.scene small { color: #949d97; font-size: 5px; }
.scene.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.scene.active>i { background: #ffffff17; color: #f0c387; }
.scene.active small { color: #9caea5; }
.room-section>header>span { color: #7d8b83; font-size: 6px; }
.room-section>header>span i { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: var(--green); }
.room-grid { display: grid; gap: 7px; }
.room-grid article { display: grid; grid-template-columns: 64px 1fr 34px; align-items: center; gap: 10px; padding: 10px; border-radius: 15px; background: #fff; }
.room-icon { display: grid; width: 64px; height: 72px; place-items: center; border-radius: 12px; font-size: 26px; }
.room-icon.living { background: #eadfc9; color: #926d3d; }
.room-icon.bedroom { background: #dde6e3; color: #5d8074; }
.room-grid h3 { margin: 0 0 2px; font-size: 11px; }
.room-grid p { margin: 0 0 7px; color: #929b95; font-size: 6px; }
.room-grid>article>div:nth-child(2)>span { display: inline-block; margin-right: 7px; color: #65746c; font-size: 6px; }
.toggle { position: relative; width: 33px; height: 19px; border: 0; border-radius: 20px; background: #d8dcd9; }
.toggle i { position: absolute; left: 3px; top: 3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: .2s; }
.toggle.on { background: var(--green); }
.toggle.on i { left: 17px; }
.energy-home { margin-top: 18px; padding: 13px; border-radius: 15px; background: var(--ink); color: #fff; }
.energy-home header strong { color: #f3c985; font-size: 17px; text-align: right; }
.energy-home header strong small { display: block; color: #9aaca3; font-size: 5px; }
.energy-bars { display: flex; height: 80px; align-items: end; gap: 9px; padding: 9px 6px 0; background: repeating-linear-gradient(to bottom,transparent 0,transparent calc(33% - 1px),#ffffff10 33%); }
.energy-bars i { flex: 1; border-radius: 4px 4px 0 0; background: linear-gradient(#e9c276,#8e7140); }
.energy-home footer { display: flex; justify-content: space-between; margin-top: 8px; color: #98aaa1; font-size: 5px; }
.energy-home footer b { color: #f0ca82; }
.home-nav { position: fixed; z-index: 9; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4,1fr); width: min(100%,520px); margin: auto; padding: 10px 8px calc(9px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.home-nav button { display: grid; gap: 3px; place-items: center; border: 0; background: transparent; color: #909991; font-size: 7px; }
.home-nav i { font-size: 18px; }
.home-nav .active { color: var(--green); }
.home-toast { position: fixed; z-index: 20; bottom: 82px; left: 50%; padding: 9px 13px; border-radius: 8px; background: #22352e; color: #fff; font-size: 8px; opacity: 0; transform: translate(-50%,8px); transition: .2s; }
.home-toast.show { opacity: 1; transform: translate(-50%,0); }
@media (min-width:600px) {
  body { padding: 28px; }
  .home-shell { box-shadow: 0 24px 70px #26342c33; }
}
.family-segment { position: absolute; z-index: 3; left: 16px; top: 15px; padding: 5px 8px; border-radius: 8px; background: #1b2d276b; color: #fff; font-size: 6px; font-weight: 800; letter-spacing: .12em; backdrop-filter: blur(10px); }
/*独立预览(桌面直接打开 ≥600px): 与首页一致的自适应手机外框, 仅本模板使用(原共享 ../frame.css 合并而来, 级联顺序保持最后)*/
@media (min-width: 600px) {
  html { min-height: 100%; }
  body { display: grid; min-height: 100dvh; place-items: center; margin: 0; padding: 0 1.5rem; }
  .home-shell { width: min(100%, 26rem); height: 100dvh; min-height: 0; overflow-x: hidden; overflow-y: auto; border: .625rem solid #151b26; border-radius: 2.2rem; box-shadow: 0 1.8rem 3.5rem rgba(24, 39, 68, .3); scrollbar-width: none; }
  .home-shell::-webkit-scrollbar { display: none; }
  .home-nav { width: min(calc(100% - 3.75rem), 24.75rem); bottom: .625rem; border-radius: 0 0 1.5rem 1.5rem; }
  .home-toast { bottom: 5.9rem; }
  body:has(.home-shell) { background: radial-gradient(circle at 50% 15%, #fff 0, transparent 38%), #dfe4df; }
}

/* Improve tab-bar readability and tap targets in the mini-app preview. */
.home-nav { min-height: 4.4rem; padding: .55rem .5rem max(.65rem,env(safe-area-inset-bottom)); }
.home-nav button { min-height: 2.9rem; gap: .22rem; font-size: .69rem; font-weight: 600; line-height: 1.2; }
.home-nav i { font-size: 1.3rem; }