:root {
  --paper: #f4f1ea;
  --forest: #1a3c2b;
  --forest-2: #244a36;
  --ink: #161814;
  --muted: #5c6158;
  --line: rgba(58, 58, 56, 0.16);
  --gold: #c9a227;
  --coral: #c44536;
  --mint: #2f6f4e;
  --white: #fffcf7;
  --shadow: 0 10px 28px rgba(26, 60, 43, 0.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; }
html, body {
  min-height: 100%;
  background: #d8d3c8;
  font-family: "SF Pro Text", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--ink);
  scrollbar-width: none;
}
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.phone {
  width: 390px;
  height: 844px;
  background: var(--paper);
  border-radius: 36px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 80px rgba(22, 24, 20, 0.28);
  border: 10px solid #1c1c1a;
  display: flex;
  flex-direction: column;
}
.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }
.status {
  height: 44px;
  padding: 14px 22px 0;
  display: flex;
  justify-content: space-between;
  color: #fff;
  text-shadow: 0 1px 8px rgba(22, 24, 20, 0.55);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 3;
}
.status.dark { color: var(--forest); text-shadow: none; }
.hero {
  height: 228px;
  position: relative;
  background: linear-gradient(180deg, #8a9488 0%, #b7b8ad 42%, var(--paper) 100%);
}
.hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  opacity: 0.34;
  filter: grayscale(0.12) saturate(0.8) contrast(0.98);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(40,46,42,.42) 0%, rgba(90,96,90,.28) 36%, rgba(244,241,234,.88) 100%);
  pointer-events: none;
}
.hero-top {
  position: absolute;
  z-index: 2;
  left: 20px; right: 20px; top: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-shadow: 0 1px 10px rgba(22, 24, 20, 0.5);
}
.brand .logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
.brand small {
  display: block;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.82;
  margin-bottom: 4px;
}
.brand h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.03em; }
.offline {
  position: absolute;
  z-index: 2;
  left: 20px; top: 118px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  background: rgba(255,252,247,.62);
  color: var(--forest);
  font-size: 11px;
  backdrop-filter: blur(8px);
}
.body { position: relative; z-index: 2; margin-top: -72px; padding: 0 16px 96px; }
.body.plain { margin-top: 0; padding-top: 8px; }
.search, .field {
  height: 48px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  box-shadow: var(--shadow);
}
.search input, .field input {
  border: 0; outline: 0; width: 100%;
  background: transparent;
  font-size: 15px;
  color: var(--ink);
}
.search input::placeholder, .field input::placeholder { color: #8a8e84; }
.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 14px 0 18px; }
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 10px 10px;
  min-height: 72px;
}
.stat b { display: block; font-size: 22px; letter-spacing: -0.04em; line-height: 1.1; }
.stat span { display: block; margin-top: 6px; font-size: 11px; color: var(--muted); }
.stat.warn b { color: var(--coral); }
.stat.ok b { color: var(--mint); }
.section { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 2px 10px; }
.section h2 { font-size: 16px; font-weight: 650; }
.section a { font-size: 12px; color: var(--forest); font-weight: 600; }
.areas { display: grid; grid-template-columns: 1.2fr 1fr; grid-template-rows: 118px 86px 86px; gap: 8px; }
.areas.level1 { grid-template-columns: 1fr 1fr; grid-template-rows: 148px 148px; }
.area { position: relative; overflow: hidden; border-radius: 14px; color: var(--white); }
.area.wide { grid-row: 1 / 3; }
.area img { width: 100%; height: 100%; object-fit: cover; }
.area .mask { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(22,24,20,.08), rgba(22,24,20,.72)); }
.area .meta { position: absolute; left: 12px; right: 12px; bottom: 10px; }
.area h3 { font-size: 16px; font-weight: 650; }
.area p { margin-top: 2px; font-family: ui-monospace, monospace; font-size: 10px; letter-spacing: 0.04em; opacity: .88; }
.cta, .btn {
  margin-top: 14px;
  height: 52px;
  border: 0;
  border-radius: 14px;
  width: 100%;
  background: var(--forest);
  color: var(--white);
  font-size: 16px;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn.ghost {
  background: var(--white);
  color: var(--forest);
  border: 1px solid var(--line);
}
.btn.danger { background: #8d2f28; }
.tabbar {
  position: absolute;
  left: 12px; right: 12px; bottom: 14px;
  height: 64px;
  background: rgba(255,252,247,.92);
  border: 1px solid var(--line);
  border-radius: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  backdrop-filter: blur(16px);
  z-index: 4;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.tab.active { color: var(--forest); }
.tab-icon {
  width: 22px;
  height: 22px;
  display: none;
}
.tab .tab-off { display: block; }
.tab.active .tab-off { display: none; }
.tab.active .tab-on { display: block; }
.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.bar {
  height: 88px;
  padding: 44px 12px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
}
.bar h1 { font-size: 17px; font-weight: 650; flex: 1; }
.bar .sub { display: block; font-family: ui-monospace, monospace; font-size: 11px; color: var(--muted); font-weight: 500; }
.icon-btn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  color: var(--ink);
  border-radius: 12px;
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 12px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
}
.chip.on { background: var(--forest); color: #fff; border-color: var(--forest); }
/* 装置筛选：方角浅底，和上排状态胶囊区分 */
.chips.plants {
  gap: 6px;
  padding-top: 2px;
}
.chips.plants .chip {
  height: 30px;
  border-radius: 8px;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.chips.plants .chip.on {
  background: #e7efe9;
  color: var(--forest);
  border-color: #c5d4c9;
}
.list { padding: 0 16px 96px; display: flex; flex-direction: column; gap: 8px; }
.list.has-bulk { padding-bottom: 148px; }
.bulk-up {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 88px;
  z-index: 5;
  height: 44px;
  border-radius: 14px;
  background: var(--forest);
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(26, 60, 43, .18);
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  min-height: 76px;
}
.thumb {
  width: 64px; height: 64px;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 64px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-main {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.row h3 { font-family: ui-monospace, monospace; font-size: 14px; font-weight: 700; }
.row p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.row-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
}
.up-mini {
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--forest);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
}
.up-mini.retry { background: var(--coral); }
.rpt {
  width: 100%;
  min-width: 300px;
  border-collapse: collapse;
  font-size: 10px;
  font-family: ui-monospace, monospace;
}
.rpt th, .rpt td {
  border: 1px solid var(--line);
  padding: 5px 3px;
  text-align: center;
}
.rpt th { background: #e8eee9; color: var(--forest); font-weight: 650; }
.chart-card { padding: 12px 8px 10px; }
.chart-wrap { overflow-x: auto; }
.chart {
  width: 100%;
  height: 220px;
  display: block;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px 6px 0;
  font-size: 11px;
  color: var(--muted);
}
.legend i {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.row p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pill {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  background: #f4e7b6;
  color: #6a5410;
  margin-left: 6px;
}
.badge { font-size: 11px; font-weight: 700; }
.badge.wait { color: var(--muted); }
.badge.up { color: #1a6aa5; }
.badge.ok { color: var(--mint); }
.badge.fail { color: var(--coral); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}
.card h3 {
  font-size: 13px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-weight: 700;
  color: var(--muted);
}
.seg button.on { background: var(--forest); color: #fff; border-color: var(--forest); }
.toggle { display: flex; gap: 8px; }
.toggle button {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--white);
  font-weight: 650;
}
.toggle .ok.on { background: #e7f3ec; color: var(--mint); border-color: #b7d8c4; }
.toggle .bad.on { background: #f8e8e6; color: var(--coral); border-color: #e3b6b0; }
.num-list { display: flex; flex-direction: column; gap: 8px; }
.num-row {
  display: grid;
  grid-template-columns: 52px 1fr 44px;
  align-items: center;
  gap: 8px;
}
.num-name {
  font-size: 13px;
  color: var(--ink);
}
.num-row input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: var(--paper);
  font-size: 14px;
}
.num-unit {
  font-size: 12px;
  color: var(--muted);
}
.hint { font-size: 11px; color: var(--muted); margin-top: 8px; }
.photos { display: flex; gap: 8px; }
.photos a {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
}
.photos img, .photos a img, .addshot {
  width: 72px; height: 72px;
  border-radius: 10px;
  object-fit: cover;
}
.addshot {
  border: 1px dashed var(--line);
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--paper);
  font-size: 11px;
  gap: 2px;
}
.lock { font-size: 13px; color: var(--ink); }
.sticky {
  position: sticky;
  bottom: 0;
  padding: 10px 0 8px;
  background: linear-gradient(180deg, transparent, var(--paper) 28%);
}
.meta-line { font-size: 12px; color: var(--muted); line-height: 1.7; }
.detail-head {
  position: relative;
  overflow: hidden;
  margin: 0 16px 12px;
  padding: 18px 16px 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, #dce8e1 0%, #eef3ee 58%, #f7f6f1 100%);
}
.detail-head .mark {
  position: absolute;
  right: -8px;
  top: -8px;
  width: 88px;
  height: 88px;
  border-radius: 18px;
  opacity: 0.18;
}
.detail-kicker {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  color: var(--forest);
  margin-bottom: 6px;
}
.detail-head h2 {
  font-family: ui-monospace, monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.detail-tags span {
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  background: rgba(255,252,247,.72);
  color: var(--forest);
}
.detail-tags .wait { background: #f4e7b6; color: #6a5410; }
.detail-tags .ok { background: #e7f3ec; color: var(--mint); }
.detail-dots {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.detail-dots b {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: rgba(26, 60, 43, 0.12);
}
.detail-dots b.on { background: var(--mint); }
.detail-dots b.warn { background: #c9a227; }
.photo-hero {
  height: 140px;
  overflow: hidden;
}
.photo-hero img { width: 100%; height: 100%; object-fit: cover; }

.login-hero { height: 280px; }
.login-card { margin-top: -56px; }
.help { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; }

.phone.mine-page { background: var(--white); }
.mine-hero {
  background: linear-gradient(180deg, #d7e3db 0%, #e8efe9 72%, var(--white) 100%);
  padding: 0 16px 8px;
}
.mine-hero .status {
  position: relative;
  color: var(--ink);
  text-shadow: none;
}
.mine-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px 16px;
}
.mine-avatar-wrap { position: relative; flex-shrink: 0; }
.mine-avatar-wrap img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
}
.mine-tag {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--forest);
  color: #fff;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 999px;
}
.mine-user h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.mine-user p { margin-top: 4px; font-size: 13px; color: var(--muted); }
.mine-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mine-stat {
  position: relative;
  background: var(--white);
  border-radius: 16px;
  padding: 14px 16px 12px;
  min-height: 78px;
  box-shadow: 0 8px 20px rgba(26, 60, 43, 0.07);
}
.mine-stat b { display: block; font-size: 26px; letter-spacing: -0.04em; line-height: 1; }
.mine-stat span { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.mine-stat .mine-dot {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.mine-dot.wait { background: var(--coral); }
.mine-dot.ok { background: var(--mint); }
.mine-sheet {
  background: var(--white);
  padding: 10px 8px 96px;
}
.mine-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 12px;
  font-size: 15px;
}
.mine-item + .mine-item {
  border-top: 1px solid #cfd6d0;
}
.mine-item .icon { color: var(--forest); flex-shrink: 0; }
.mine-label { flex: 1; }
.mine-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}
.mine-aside { font-size: 13px; color: var(--muted); }
.mine-aside.ok { color: var(--mint); font-weight: 650; }
.mine-item .chev {
  width: 18px;
  height: 18px;
  stroke: #c2c7c0;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.mine-item.danger { color: var(--coral); }
.mine-item.danger .icon { color: var(--coral); }
.mine-sheet .hint { padding: 8px 12px 0; }

.banner {
  margin: 0 16px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}
.banner.bad { background: #f8e8e6; color: var(--coral); }
.banner.warn { background: #f4e7b6; color: #6a5410; }
.banner.ok { background: #e7f3ec; color: var(--mint); }
.banner.info { background: #e8eef0; color: #1a6aa5; }
.empty {
  text-align: center;
  padding: 56px 28px 24px;
}
.empty b { display: block; font-size: 16px; color: var(--ink); margin: 12px 0 6px; }
.empty p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.fab {
  position: absolute;
  right: 18px;
  bottom: 92px;
  height: 48px;
  padding: 0 16px;
  border-radius: 24px;
  background: var(--forest);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 10px 24px rgba(26, 60, 43, 0.28);
  z-index: 5;
}
.sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(22, 24, 20, 0.46);
  z-index: 6;
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 8px 8px 28px;
  z-index: 7;
}
.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 4px;
  background: #d0d5ce;
  margin: 8px auto 12px;
}
.sheet-act {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  font-size: 16px;
}
.sheet-act + .sheet-act { border-top: 1px solid #cfd6d0; }
.sheet-act .icon { color: var(--forest); }
.kv {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px 12px;
  font-size: 14px;
}
.kv dt { color: var(--muted); }
.kv dd { color: var(--ink); word-break: break-all; }
.done {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px 96px;
  text-align: center;
}
.done-mark {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e7f3ec;
  color: var(--mint);
  margin-bottom: 16px;
}
.done-mark.fail { background: #f8e8e6; color: var(--coral); }
.done h2 { font-size: 20px; margin-bottom: 8px; }
.done p { font-size: 13px; color: var(--muted); line-height: 1.6; }
.viewer {
  position: relative;
  background: #121412;
  height: 100%;
}
.viewer img { width: 100%; height: 100%; object-fit: contain; }
.viewer .bar { background: transparent; color: #fff; }
.viewer .bar h1, .viewer .icon-btn { color: #fff; }
.btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
.progress {
  height: 6px;
  border-radius: 99px;
  background: #e4e7e2;
  overflow: hidden;
  margin: 12px 0;
}
.progress i {
  display: block;
  height: 100%;
  width: 58%;
  background: var(--forest);
}

html.embed,
html.embed body {
  background: transparent;
  min-height: 0;
}
html.embed .stage {
  padding: 0;
  min-height: 0;
  height: 844px;
  background: transparent;
  align-items: stretch;
  justify-content: stretch;
}
html.embed .phone {
  border-radius: 0;
  border: 0;
  box-shadow: none;
  width: 390px;
  height: 844px;
}
@media (max-width: 430px) {
  html:not(.gallery) .stage { padding: 0; background: var(--paper); }
  html:not(.gallery) .phone { width: 100%; height: 100vh; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
}
