:root {
  color-scheme: light;
  --blue: #4286fe;
  --cyan: #05bfae;
  --text: #1f2430;
  --muted: #8b909a;
  --line: #edf0f5;
  --bg: #f5f5f5;
  --card: #ffffff;
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-top: env(safe-area-inset-top);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; background: var(--bg); overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
}
button, input { font-family: inherit; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.phone-shell {
  width: min(520px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}
.main-content {
  min-height: 100vh;
  padding: calc(12px + var(--safe-top)) 12px calc(74px + var(--safe-bottom));
}
.page { display: none; }
.page.active { display: block; }
.android-titlebar {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.android-titlebar h1 { margin: 0; color: #07111f; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.android-titlebar p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.icon-action {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow: 0 3px 12px rgba(31, 36, 48, .08);
}
.icon-action img { width: 24px; height: 24px; object-fit: contain; }
.title-icon-wrap, .cloud-icon-wrap {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: linear-gradient(135deg, #22c7b8, #4286fe);
  box-shadow: 0 8px 18px rgba(66, 134, 254, .18);
}
.title-icon-wrap { width: 42px; height: 42px; border-radius: 50%; }
.title-icon { width: 24px; height: 24px; object-fit: contain; }
.app-card, .device-card {
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
  border: 1px solid rgba(0,0,0,.02);
}
.device-card { overflow: hidden; margin-bottom: 12px; }
.device-card-head {
  height: 48px;
  padding: 0 12px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.device-name-wrap { min-width: 0; display: flex; align-items: center; gap: 8px; }
.device-name-wrap strong { font-size: 15px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.status-dot { font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.status-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #b6bac3; }
.status-dot.online { color: var(--cyan); }
.status-dot.online::before { background: var(--cyan); }
.plain-icon { width: 34px; height: 34px; display: grid; place-items: center; }
.plain-icon img { width: 18px; height: 18px; object-fit: contain; opacity: .82; }
.camera-viewer { position: relative; width: 100%; aspect-ratio: 16 / 10; background: #121722; overflow: hidden; }
.camera-viewer video, .camera-viewer iframe { display: none; width: 100%; height: 100%; border: 0; background: #111827; }
.device-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  color: #fff;
}
.device-empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, rgba(255,255,255,.12), transparent 35%), linear-gradient(180deg,#1e2633,#111722);
}
.device-empty > * { position: relative; z-index: 1; }
.device-empty img { width: 118px; max-width: 40vw; filter: drop-shadow(0 10px 25px rgba(0,0,0,.35)); }
.device-empty strong { font-size: 16px; }
.device-empty span { max-width: 300px; color: rgba(255,255,255,.68); font-size: 12px; line-height: 1.45; }
.camera-controls {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 74px;
  background: #fff;
  border-top: 1px solid var(--line);
}
.camera-controls button { display: grid; place-items: center; align-content: center; gap: 5px; font-size: 11px; color: #565d69; }
.camera-controls img { width: 24px; height: 24px; object-fit: contain; }
.full-icon { width: 24px; height: 24px; display: grid; place-items: center; color: #505968; font-size: 20px; line-height: 1; }
.add-panel { display: none; padding: 15px; margin-bottom: 12px; overflow: hidden; background: linear-gradient(135deg, #21c8b8, #1c9ce8); color: #fff; }
.add-panel.open { display: block; }
.section-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.section-row h2, .cloud-hero h2, .profile-card h2, .message-empty h2, .install-help h2 { margin: 0; font-size: 17px; }
.section-row p, .cloud-hero p, .profile-card p, .message-empty p, .install-help p { margin: 6px 0 0; font-size: 12px; line-height: 1.45; color: rgba(255,255,255,.76); }
.section-row img { width: 34px; height: 34px; object-fit: contain; }
.add-panel label { display: grid; gap: 7px; margin-top: 12px; font-weight: 600; font-size: 13px; }
.add-panel input { width: 100%; height: 46px; min-width: 0; padding: 0 12px; border-radius: 6px; border: 0; outline: none; background: rgba(255,255,255,.95); color: #1f2430; font-size: 16px; line-height: 46px; }
.button-row { display: flex; gap: 10px; margin-top: 14px; }
.primary-btn, .ghost-btn { height: 42px; border-radius: 6px; padding: 0 16px; font-weight: 700; }
.primary-btn { background: #fff; color: var(--blue); }
.ghost-btn { background: rgba(255,255,255,.18); color: #fff; }
.cloud-hero { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; margin-bottom: 12px; background: linear-gradient(135deg, #ffffff, #eef8ff); }
.cloud-hero p { color: var(--muted); }
.cloud-icon-wrap { width: 58px; height: 58px; border-radius: 18px; }
.cloud-icon-wrap img { width: 34px; height: 34px; object-fit: contain; }
.settings-list { display: grid; gap: 10px; }
.setting-item {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.02);
  text-align: left;
}
.setting-item span { min-width: 0; font-size: 15px; }
.setting-item strong { display: block; font-size: 15px; font-weight: 600; }
.setting-item em { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setting-item b { color: #b4b8c1; font-size: 24px; font-weight: 300; }
.message-empty { min-height: 280px; display: grid; place-items: center; align-content: center; padding: 30px 20px; text-align: center; }
.message-empty .bell { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #ffae42, #ff685f); margin-bottom: 12px; }
.message-empty p { max-width: 300px; color: var(--muted); }
.profile-card { min-height: 88px; display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 12px; }
.profile-logo { width: 56px; height: 56px; object-fit: cover; border-radius: 14px; background: #05bfae; }
.profile-card p { color: var(--muted); }
.login-chip { margin-left: auto; min-width: 62px; height: 30px; border-radius: 999px; display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; }
.mine-list { margin-bottom: 12px; }
.install-help { padding: 16px; }
.install-help p { color: var(--muted); }
.bottom-tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 30;
  width: min(520px, 100%);
  height: calc(57px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-top: 1px solid #e9edf3;
}
.tab-item { display: grid; place-items: center; align-content: center; gap: 2px; font-size: 11px; color: #8b909a; }
.tab-item img { width: 24px; height: 24px; object-fit: contain; }
.tab-item.active { color: var(--blue); }
@media (min-width: 521px) {
  .phone-shell { box-shadow: 0 0 0 1px rgba(0,0,0,.04); }
}
@media (max-width: 360px) {
  .main-content { padding-left: 10px; padding-right: 10px; }
  .camera-controls { height: 68px; }
  .camera-controls button { font-size: 10px; }
}
