/* 云海导航 · 对齐 Sun-Panel（参考 v1.3.0 + 9058 部署） */
:root {
  --nav-icon-bg: #2a2a2a6b;
  --nav-icon-size: 70px;
  --nav-max: 1200px;
  --nav-font: "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: #152a5c;
  background-image: var(--nav-wallpaper, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.nav-body {
  font-family: var(--nav-font);
  color: #fff;
  position: fixed;
  inset: 0;
  width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background-color: #152a5c;
  background-image: var(--nav-wallpaper, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/*
 * iOS「添加到主屏幕」全屏 quirk（WebKit 254868 / SO 79902310）：
 * black-translucent + viewport-fit=cover 时，100dvh / fixed inset 会少算安全区，
 * 底边露出 WebView 黑带。壳高度 = 100dvh + 顶/底 inset（或回退 100vh）。
 */
html.nav-standalone,
html.nav-standalone body {
  height: 100vh;
  min-height: 100vh;
}
html.nav-standalone .nav-body {
  top: 0;
  right: 0;
  left: 0;
  bottom: auto;
  inset: auto;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  height: calc(100dvh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px));
  min-height: calc(100dvh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px));
}
@media all and (display-mode: standalone) {
  html, body {
    height: 100vh;
    min-height: 100vh;
  }
  .nav-body {
    top: 0;
    right: 0;
    left: 0;
    bottom: auto;
    inset: auto;
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    height: calc(100dvh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px));
    min-height: calc(100dvh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px));
  }
}

.sun-main {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  user-select: none;
}
.cover.wallpaper {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.05);
  transform-origin: center center;
  filter: blur(var(--nav-blur, 0px));
}
.mask {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.sun-main.has-wallpaper-dim .mask {
  opacity: var(--nav-mask, 0);
}
.sun-main.is-dimmed .mask {
  opacity: .45;
}
.sun-scroll {
  position: absolute; inset: 0; z-index: 2;
  overflow: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.sun-scroll::-webkit-scrollbar { width: 0; height: 0; display: none; }
.sun-content {
  max-width: var(--nav-content-max, 1200px);
  /* black-translucent 时内容会画进状态栏，需叠 safe-area */
  margin-top: calc(5% + var(--nav-content-top, 70px) + env(safe-area-inset-top, 0px));
  margin-bottom: 0;
  margin-left: auto;
  margin-right: auto;
  padding: 10px var(--nav-content-side, 16px) calc(32px + env(safe-area-inset-bottom, 0px) + var(--nav-content-bottom, 5%));
}

.text-shadow { text-shadow: 2px 2px 50px #000; }
.app-icon-text-shadow { text-shadow: 2px 2px 5px #000; }

/* 右上角工具条 */
.top-tools {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(16px + env(safe-area-inset-right, 0px));
  z-index: 30;
}
.top-tools-inner {
  display: flex; align-items: center; gap: 0;
  background: var(--nav-icon-bg);
  border-radius: 999px;
  box-shadow: 0 0 10px 2px rgba(0,0,0,.2);
  overflow: hidden;
}
.tool-btn {
  border: 0; background: transparent; color: #fff;
  width: 42px; height: 38px; display: grid; place-items: center; cursor: pointer;
}
.tool-btn + .tool-btn { border-left: 1px solid rgba(255,255,255,.08); }
.tool-btn:hover { background: rgba(255,255,255,.08); }
.tool-ico { width: 20px; height: 20px; }

/* 标题+搜索外层：对齐 mx-[auto] w-[80%] */
.sun-hero {
  width: 80%;
  margin-left: auto;
  margin-right: auto;
}

/* 头：flex mx-[auto] items-center justify-center text-white */
.sun-header {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin: 0 auto;
}
.logo { flex: 0 0 auto; }
/* text-2xl / md:text-6xl font-bold；禁止 overflow，避免 text-shadow 被裁成方块 */
.logo-text {
  display: inline;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: normal;
  white-space: nowrap;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
  overflow: visible;
}
@media (min-width: 768px) {
  .logo-text {
    font-size: 3.75rem; /* 60px */
    line-height: 3.75rem;
  }
}
/* divider: text-base lg:text-2xl mx-[10px] */
.divider {
  flex: 0 0 auto;
  margin: 0 10px;
  font-size: 1rem;
  line-height: 1;
  opacity: .9;
}
@media (min-width: 1024px) {
  .divider { font-size: 1.5rem; }
}
.clock-wrap { flex: 0 0 auto; }
.clock {
  width: 100%;
  min-width: 7.6em;
  text-align: center;
}
/* clock-time: text-2xl md:text-3xl font-[600] */
.clock-time {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: normal;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
}
@media (min-width: 768px) {
  .clock-time {
    font-size: 1.875rem; /* 30px */
    line-height: 2.25rem;
  }
}
.clock-meta {
  display: none;
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
}
@media (min-width: 768px) {
  .clock-meta { display: block; }
}
.clock-meta .clock-date { margin-right: 4px; }

/* 搜索：标题下方间距 30px（原 20 + 10）；lg:w-[80%]；search-container rounded-2xl */
.search-wrap {
  width: 100%;
  margin: 30px auto 0;
  position: relative;
  z-index: 20;
}
@media (min-width: 1024px) {
  .search-wrap { width: 80%; }
}
.search-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 46px;
  padding: 2px 10px;
  border-radius: 16px; /* rounded-2xl */
  background: var(--nav-search-bg, rgba(42, 42, 42, .42));
  color: var(--nav-search-text, #fff);
  border: 1px solid var(--nav-search-border, transparent);
  transition: box-shadow .2s ease, background .2s ease;
  position: relative;
  box-sizing: border-box;
}
.search-box:hover,
.search-box:focus-within {
  box-shadow: 0 0 16px 6px rgba(0,0,0,.22);
}
.engine-switch {
  position: relative;
  flex-shrink: 0;
}
.engine-current {
  border: 0; background: transparent; width: 40px; height: 32px;
  border-radius: 8px; display: grid; place-items: center; cursor: pointer;
  padding: 0; color: inherit; flex-shrink: 0;
}
.engine-current:hover,
.engine-switch.is-open .engine-current {
  background: rgba(255,255,255,.14);
}
.engine-current-icon {
  display: grid; place-items: center; width: 20px; height: 20px;
}
.engine-current-icon svg { width: 20px; height: 20px; display: block; }
.engine-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 25;
  min-width: 132px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(30, 30, 36, .96);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 12px 28px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.engine-menu[hidden] { display: none !important; }
.engine-option {
  display: flex; align-items: center; gap: 10px;
  width: 100%; border: 0; background: transparent;
  color: rgba(255,255,255,.88); font: inherit; font-size: .86rem;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left;
}
.engine-option:hover { background: rgba(255,255,255,.1); }
.engine-option.on { background: rgba(99,226,183,.16); color: #63e2b7; }
.engine-option svg,
.engine-option .engine-favicon,
.engine-current-icon .engine-favicon {
  flex: 0 0 auto; display: block;
  width: 20px; height: 20px; object-fit: contain; border-radius: 4px;
}
.search-box input {
  flex: 1; border: 0; outline: none; background: transparent;
  color: inherit; font: inherit; font-size: 17px; min-width: 0;
  line-height: 1.6; padding: 10px 5px;
}
.search-box input::placeholder { color: rgba(255,255,255,.5); }
.search-go {
  border: 0; background: transparent; color: inherit; opacity: .75;
  width: 40px; height: 34px; display: grid; place-items: center; cursor: pointer; border-radius: 8px;
  flex-shrink: 0;
}
.search-go:hover { opacity: 1; background: rgba(255,255,255,.1); }

.back-top {
  position: fixed; right: 20px; bottom: 24px; z-index: 40;
  width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: rgba(42,42,42,.72); color: #fff; font-size: 1.15rem;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.28);
  transition: opacity .2s ease, transform .2s ease;
}
.back-top:hover { background: rgba(42,42,42,.9); transform: translateY(-2px); }
.back-top[hidden] { display: none !important; }

/* 分组 */
.item-list { margin-top: 50px; }
.item-list.sorting {
  box-shadow: 0 0 30px 10px rgba(0,0,0,.3);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 12px;
}
.group-hd {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 20px 10px; min-height: 28px;
}
.group-title {
  font-size: 1.25rem; font-weight: 800; margin: 0;
}
.group-actions {
  display: flex; align-items: center; gap: 8px;
  opacity: 0; transition: opacity .15s;
  pointer-events: none;
}
.item-list:hover .group-actions,
.item-list.sorting .group-actions {
  opacity: 1; pointer-events: auto;
}
.group-act {
  border: 0; background: transparent; color: #fff;
  width: 26px; height: 26px; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  border-radius: 6px; opacity: .9;
}
.group-act:hover { background: rgba(255,255,255,.12); opacity: 1; }
.group-act svg { width: 18px; height: 18px; }
.group-act.on { background: rgba(255,255,255,.18); }
.sort-bar {
  display: none; margin-top: 12px;
}
.item-list.sorting .sort-bar { display: flex; gap: 8px; }
.sort-bar .nav-btn {
  background: var(--nav-icon-bg);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
}

/* 详情图标 */
.icon-info-box {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px; width: 100%;
}
.app-icon-info {
  display: flex; width: 100%; border-radius: 1rem;
  background: var(--nav-icon-bg); color: #fff; text-decoration: none;
  overflow: hidden; min-height: var(--nav-icon-size);
  transition: box-shadow .2s ease, opacity .2s ease;
  cursor: pointer;
}
.app-icon-info:hover { box-shadow: 0 0 20px 10px rgba(0,0,0,.2); }
.app-icon-info:active { box-shadow: 0 0 12px 6px rgba(0,0,0,.28); }
.app-icon-info.dragging { opacity: .45; }
.item-list.sorting .app-icon-info,
.item-list.sorting .app-icon-small {
  cursor: grab;
}
.item-list.sorting .app-icon-info:active,
.item-list.sorting .app-icon-small:active {
  cursor: grabbing;
}
.drag-over {
  outline: 2px dashed rgba(255,255,255,.45);
  outline-offset: 2px;
}
.app-icon-info-icon {
  width: var(--nav-icon-size);
  height: var(--nav-icon-size);
  flex: 0 0 var(--nav-icon-size);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* 对齐 Sun-Panel：容器 70，内图标 50（Iconify/SVG 约 35） */
.app-icon-info-icon-inner {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  background: transparent;
}
.app-icon-info-icon-inner .app-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.app-icon-info-icon-inner.is-svg .app-icon-img,
.app-icon-info-icon-inner.is-iconify .app-icon-img {
  width: 35px;
  height: 35px;
}
.icon-preview.has-img {
  background: rgba(255,255,255,.1);
  padding: 6px;
}
.icon-preview .app-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 10px;
}
.app-icon-info-text { flex: 1; min-width: 0; display: flex; align-items: center; padding: 8px 12px 8px 0; max-width: calc(100% - 80px); }
.app-icon-info-title { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-icon-info-desc { font-size: .72rem; opacity: .75; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 小图标 */
.icon-small-box {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
  gap: 18px; width: 100%;
}
.app-icon-small { text-align: center; }
.app-icon-small-link { display: block; color: inherit; text-decoration: none; }
.app-icon-small-icon {
  width: var(--nav-icon-size); height: var(--nav-icon-size); margin: 0 auto;
  border-radius: 1rem; background: var(--nav-icon-bg);
  display: grid; place-items: center; font-size: 1.75rem; font-weight: 700;
  transition: box-shadow .2s ease;
  overflow: hidden;
  cursor: pointer;
}
.app-icon-small-icon .app-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.app-icon-small-icon.is-svg .app-icon-img,
.app-icon-small-icon.is-iconify .app-icon-img {
  width: 35px;
  height: 35px;
}
.app-icon-small:hover .app-icon-small-icon { box-shadow: 0 0 20px 10px rgba(0,0,0,.2); }
.app-icon-small:active .app-icon-small-icon { box-shadow: 0 0 12px 6px rgba(0,0,0,.28); }
.app-icon-small-title {
  margin-top: 2px; font-size: .78rem; max-width: 90px; margin-inline: auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.nav-empty { text-align: center; color: rgba(255,255,255,.65); padding: 48px 16px; }
.sun-footer {
  margin-top: 66px;
  padding-bottom: 8px;
  text-align: center;
  font-size: .82rem;
  color: rgba(255,255,255,.5);
  line-height: 1.7;
}
.sun-footer p { margin: 0; }
.sun-footer-line + .sun-footer-line { margin-top: 2px; }
.sun-footer-thanks { margin-top: 6px !important; font-size: .78rem; color: inherit; }
.sun-footer a {
  color: inherit;
  text-decoration: none;
}
.sun-footer a:hover {
  text-decoration: underline;
}

/* 登录层 */
.auth-layer {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: rgba(20,20,24,.72);
  padding: 20px;
}
.auth-layer[hidden] { display: none !important; }
.auth-card {
  position: relative;
  width: 100%; max-width: 400px; min-width: min(400px, 100%);
  background: rgba(30,30,36,.95);
  border-radius: 20px; padding: 24px 22px 18px;
  box-shadow: 0 24px 64px rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.06);
}
.auth-close {
  position: absolute; top: 10px; right: 12px;
  border: 0; background: none; color: rgba(255,255,255,.55);
  font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 4px 8px;
}
.auth-close:hover { color: #fff; }
.auth-brand {
  margin: 0 0 18px; text-align: center; font-size: 1.75rem; font-weight: 700;
  background: linear-gradient(90deg, #63e2b7, #36ad6a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-field {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; padding: 0 10px; margin-bottom: 12px;
}
.auth-field:focus-within { border-color: rgba(99,226,183,.45); }
.auth-prefix { opacity: .65; font-size: .9rem; width: 20px; text-align: center; }
.auth-field input {
  flex: 1; border: 0; outline: none; background: transparent;
  color: #fff; font: inherit; padding: 11px 0;
}
.auth-submit {
  width: 100%; border: 0; border-radius: 10px; padding: 11px;
  background: linear-gradient(90deg, #36ad6a, #2080f0);
  color: #fff; font-weight: 600; cursor: pointer; margin-top: 4px;
}
.auth-foot { text-align: center; margin: 12px 0 0; }
.auth-link { border: 0; background: none; color: #63e2b7; cursor: pointer; font: inherit; }
.auth-powered { text-align: center; font-size: .78rem; color: rgba(255,255,255,.35); margin: 14px 0 0; }
.auth-powered a { color: rgba(255,255,255,.5); }

/* 系统应用侧栏 — 固定 1000×700，页面居中（自右上方向展开） */
.launcher {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: 1000px;
  height: 700px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  background: #eceff3;
  color: #1f2937;
  box-sizing: border-box;
  overflow: hidden;
  position: fixed;
  inset: 0;
  margin: auto;
  transform-origin: 100% 0%;
  opacity: 0;
  transform: scale(.18);
  transition: opacity .22s ease, transform .28s cubic-bezier(.2,.8,.2,1);
}
.launcher.launcher-open {
  opacity: 1;
  transform: scale(1);
}
.launcher.launcher-closing {
  opacity: 0;
  transform: scale(.18);
}
.launcher::backdrop {
  background: rgba(0,0,0,.45);
  opacity: 0;
  transition: opacity .22s ease;
}
.launcher.launcher-open::backdrop { opacity: 1; }
.launcher.launcher-closing::backdrop { opacity: 0; }
.launcher-shell {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}
.launcher-side {
  width: 180px;
  flex-shrink: 0;
  background: #dfe5ec;
  border-radius: 16px 0 0 16px;
  padding: 14px 10px;
  box-sizing: border-box;
  overflow: auto;
}
.launcher-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: .9rem; padding: 6px 10px 12px; color: #475569;
}
.launcher-title-ico {
  width: .9rem; height: .9rem; flex: 0 0 .9rem; color: #0f766e;
}
.launcher-nav { display: flex; flex-direction: column; gap: 4px; }
.launcher-item {
  border: 0; background: transparent; text-align: left;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  font: inherit; font-size: .86rem; color: #475569;
}
.launcher-item.on { background: #fff; color: #0f766e; font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.launcher-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 14px 16px;
  overflow: hidden;
  box-sizing: border-box;
}
.launcher-main-hd,
.launcher-main-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.launcher-main-hd h2,
.launcher-main-hd h2 { margin: 0; font-size: 1.05rem; }
.launcher-close,
.launcher-close {
  border: 0; background: none; font-size: 1.5rem; line-height: 1;
  cursor: pointer; color: #64748b;
}
.launcher-panels {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.launcher-panel { display: none; }
.launcher-panel.on { display: block; }
.setting-card {
  background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.setting-card-title { font-weight: 700; color: #64748b; font-size: .82rem; margin-bottom: 8px; }

.nav-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; font-size: .82rem; }
.nav-field input, .nav-field select, .nav-field textarea {
  border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px 10px; font: inherit;
}
.nav-check { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; margin-bottom: 8px; }
.nav-inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.nav-inline-form input[type=text] { flex: 1; min-width: 140px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 8px; }
.nav-btn {
  border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer;
  background: #0f766e; color: #fff; font-weight: 600; font-size: .82rem;
}
.nav-btn.ghost { background: #e2e8f0; color: #475569; }
.nav-btn.danger { background: #fee2e2; color: #b91c1c; }
.nav-msg { min-height: 1.2em; font-size: .82rem; color: #dc2626; }
.nav-msg.ok { color: #059669; }
.nav-admin-group { border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px; margin-bottom: 8px; background: #fff; }
.nav-admin-group-hd { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.nav-admin-group-hd input { flex: 1; min-width: 120px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 6px 8px; }
.nav-admin-items { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; }
.nav-admin-item-row { display: flex; gap: 8px; align-items: center; }
.nav-admin-item-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #e2e8f0; font-size: .82rem;
}
.nav-user-meta { flex: 1; min-width: 160px; line-height: 1.45; }
.nav-user-meta strong { font-weight: 700; }
.nav-user-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  border-radius: 999px; font-size: .72rem; background: #e2e8f0; color: #475569;
}
.nav-user-tag.warn { background: #fee2e2; color: #b91c1c; }
.nav-user-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.device-card { margin-top: 18px; }
.device-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 12px; }
.device-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 12px; border-radius: 12px;
  background: #fff; border: 1px solid #e2e8f0;
  font-size: .82rem; color: #334155;
}
.device-row.is-current { border-color: #99f6e4; background: #f0fdfa; }
.device-meta { flex: 1; min-width: 160px; line-height: 1.45; }
.device-meta strong { display: block; color: #0f172a; font-weight: 700; }
.device-meta span { color: #64748b; }
.device-tag {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  border-radius: 999px; font-size: .72rem; font-weight: 600;
  background: #ccfbf1; color: #0f766e;
}
.device-actions { display: flex; gap: 6px; align-items: center; }
.device-actions .nav-btn { padding: 6px 10px; font-size: .78rem; }
.nav-user-edit {
  width: 100%; display: none; gap: 8px; flex-wrap: wrap;
  padding: 8px 0 4px; border-top: 1px dashed #e2e8f0; margin-top: 4px;
}
.nav-user-edit.open { display: flex; }
.pref-color-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px;
}
.pref-color-grid input[type="color"] {
  width: 100%; height: 36px; padding: 2px; border-radius: 8px; border: 1px solid #cbd5e1; cursor: pointer;
}
.icon-files-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.icon-file-row {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 10px; padding: 8px 10px;
  border: 1px solid #e2e8f0; font-size: .82rem;
}
.icon-file-row img { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; background: #f1f5f9; }
.icon-file-row .name { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; color: #334155; overflow: hidden; text-overflow: ellipsis; }
.icon-file-row .tag { font-size: .72rem; color: #64748b; }

.icon-url-display {
  margin-top: 6px; font-size: .75rem; color: rgba(255,255,255,.45);
  font-family: ui-monospace, Consolas, monospace;
}
.nav-view-banner {
  margin: 0 0 14px; padding: 10px 14px; border-radius: 12px;
  background: rgba(15,118,110,.22); border: 1px solid rgba(99,226,183,.35);
  color: rgba(255,255,255,.92); font-size: .84rem;
}
.nav-view-banner a { color: #7ec8ff; margin-left: 8px; }

.nav-dialog {
  border: 0;
  border-radius: 14px;
  background: #1e1e24;
  color: #eee;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.nav-dialog-item {
  width: 616px;
  min-height: 700px;
  height: fit-content;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow: hidden;
}
.nav-dialog::backdrop { background: rgba(0,0,0,.5); }
.nav-dialog-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}
.nav-dialog-item .nav-dialog-shell {
  min-height: 700px;
  height: auto;
  max-height: calc(100vh - 24px);
}
.nav-dialog-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-dialog-hd h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.nav-dialog-close {
  border: 0;
  background: none;
  color: rgba(255,255,255,.65);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.nav-dialog-close:hover { color: #fff; }
.nav-dialog-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px 16px;
  box-sizing: border-box;
}
.nav-dialog-item .nav-dialog-body {
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
}
.nav-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; align-items: center; }
.nav-dialog-item .nav-field > span { color: rgba(255,255,255,.72); }
.nav-dialog-item .nav-field input,
.nav-dialog-item .nav-field select,
.nav-dialog-item .nav-field textarea {
  border-color: rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color: #eee;
  width: 100%;
  box-sizing: border-box;
}
.nav-dialog-item .nav-btn.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.7);
}
.nav-dialog-item .nav-btn.success {
  background: #18a058;
  color: #fff;
}
.nav-dialog-item .nav-btn.danger {
  background: #d03050;
  color: #fff;
}
.nav-dialog-item .req { color: #e88080; font-style: normal; margin-right: 2px; }
.item-preview-bar {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  margin-bottom: 8px; font-size: .82rem; color: rgba(255,255,255,.7);
}
.item-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.item-preview-canvas {
  display: flex; gap: 18px; align-items: center; justify-content: center;
  background: #d1d5db; border-radius: 12px; padding: 16px 18px;
  margin-bottom: 14px; min-height: 110px;
}
.item-preview-canvas.clear {
  background-image:
    linear-gradient(45deg, #bbb 25%, transparent 25%, transparent 75%, #bbb 75%),
    linear-gradient(45deg, #bbb 25%, transparent 25%, transparent 75%, #bbb 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
  background-color: #ccc;
}
.item-preview-canvas[hidden] { display: none !important; }
.item-preview-info {
  display: flex; width: 210px; border-radius: 14px;
  background: #2a2a2a; color: #fff; overflow: hidden; min-height: 70px;
}
.item-preview-info-icon {
  width: 70px; height: 70px; flex: 0 0 70px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 700; overflow: hidden;
}
.item-preview-info-icon .app-icon-img {
  width: 50px; height: 50px; object-fit: contain; display: block;
}
.item-preview-info-icon.is-iconify .app-icon-img,
.item-preview-info-icon.is-svg .app-icon-img {
  width: 35px; height: 35px;
}
.item-preview-info-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding-right: 10px; }
.item-preview-info-title { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-preview-info-desc { font-size: .72rem; opacity: .7; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-preview-small { text-align: center; color: #1f2937; width: 78px; }
.item-preview-small-icon {
  width: 70px; height: 70px; margin: 0 auto; border-radius: 16px;
  background: #2a2a2a; color: #fff;
  display: grid; place-items: center; font-size: 1.4rem; font-weight: 700; overflow: hidden;
}
.item-preview-small-icon .app-icon-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.item-preview-small-icon.is-iconify .app-icon-img,
.item-preview-small-icon.is-svg .app-icon-img { width: 35px; height: 35px; margin: auto; }
.item-preview-small-title {
  margin-top: 4px; font-size: .78rem; color: #111;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.field-with-count { position: relative; }
.field-with-count input { padding-right: 58px !important; }
.field-count {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: .72rem; color: rgba(255,255,255,.4); pointer-events: none;
}
.field-with-btn { display: flex; gap: 0; align-items: stretch; }
.field-with-btn input {
  flex: 1; min-width: 0;
  border-radius: 8px 0 0 8px !important;
}
.field-side-btn {
  flex: 0 0 auto; border: 1px solid rgba(255,255,255,.12); border-left: 0;
  border-radius: 0 8px 8px 0; background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.82); padding: 0 12px; cursor: pointer; font: inherit; font-size: .8rem;
  white-space: nowrap;
}
.field-side-btn:hover { background: rgba(99,226,183,.16); color: #63e2b7; }
.field-side-btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-inline-row { display: flex; gap: 10px; align-items: center; }
.icon-inline-row input { flex: 1; min-width: 0; }
.icon-upload-row {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-top: 8px;
}
.icon-upload-btn {
  display: inline-block; cursor: pointer;
  font-size: .8rem; color: #7ec8ff;
  background: none; border: 0; padding: 0; font: inherit;
}
.icon-upload-btn:hover { color: #a8dbff; text-decoration: underline; }
.icon-gallery {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(0,0,0,.22);
  max-height: 220px;
  overflow: auto;
}
.icon-gallery-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; font-size: .78rem; color: rgba(255,255,255,.55);
}
.icon-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
}
.icon-gallery-item {
  width: 100%; aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  padding: 6px;
  cursor: pointer;
  box-sizing: border-box;
  display: grid; place-items: center;
  overflow: hidden;
}
.icon-gallery-item:hover,
.icon-gallery-item.is-on {
  border-color: rgba(99,226,183,.55);
  background: rgba(99,226,183,.12);
}
.icon-gallery-item img {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
}
.icon-gallery-empty {
  margin: 0; font-size: .8rem; color: rgba(255,255,255,.45);
}
.launcher #adminMsg { flex-shrink: 0; margin-top: 8px; }

/* 统一系统设置表单控件 */
.launcher .launcher-ctrl,
.launcher .nav-field input[type="text"],
.launcher .nav-field input[type="password"],
.launcher .nav-field input[type="url"],
.launcher .nav-field input[type="number"],
.launcher .nav-field select,
.launcher .nav-field textarea,
.launcher select.launcher-ctrl,
.launcher textarea.launcher-ctrl,
.nav-user-edit .launcher-ctrl,
.nav-group-owned input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: .85rem;
  background: #fff;
  color: #1f2937;
  -webkit-appearance: none;
  appearance: none;
}
.launcher .nav-inline-form .launcher-ctrl {
  width: auto;
  flex: 1;
  min-width: 120px;
}
.launcher .nav-field select,
.launcher select.launcher-ctrl {
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 3px), calc(100% - 9px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}
.launcher .range-field { margin-bottom: 12px; }
.launcher .launcher-range {
  width: 100%;
  accent-color: #18a058;
  height: 6px;
  cursor: pointer;
}
.wallpaper-preview {
  position: relative;
  display: block;
  width: 100%;
  height: 140px;
  border: 0;
  border-radius: 10px;
  padding: 0;
  margin-bottom: 12px;
  background: #cbd5e1 center/cover no-repeat;
  cursor: pointer;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.wallpaper-preview-tip {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  padding: 6px 12px; border-radius: 999px;
  background: rgba(0,0,0,.45); color: #fff;
  font-size: .8rem; pointer-events: none;
  opacity: 0; transition: opacity .15s ease;
}
.wallpaper-preview:hover .wallpaper-preview-tip { opacity: 1; }

/* Naive UI 风格顶部消息（对齐 Sun-Panel）；避开刘海/状态栏 */
.n-message-container {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
}
html.nav-standalone .n-message-container {
  top: calc(16px + env(safe-area-inset-top, 0px));
}
@media all and (display-mode: standalone) {
  .n-message-container {
    top: calc(16px + env(safe-area-inset-top, 0px));
  }
}
.n-message {
  --n-line-height: 1.6;
  --n-border-radius: 3px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 180px;
  max-width: min(92vw, 420px);
  padding: 10px 16px 10px 12px;
  border-radius: var(--n-border-radius);
  background: #fff;
  color: rgb(51, 54, 57);
  box-shadow: 0 3px 6px -4px rgba(0,0,0,.12), 0 6px 16px 0 rgba(0,0,0,.08), 0 9px 28px 8px rgba(0,0,0,.05);
  font-size: 14px;
  line-height: var(--n-line-height);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .2s ease, transform .2s ease;
}
.n-message.n-message--show {
  opacity: 1;
  transform: translateY(0);
}
.n-message__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.n-message__icon svg { width: 18px; height: 18px; display: block; }
.n-message__icon--success-type { color: #18a058; }
.n-message__icon--error-type { color: #d03050; }
.n-message__icon--info-type { color: #2080f0; }
.n-message__icon--warning-type { color: #f0a020; }
.n-message__content { flex: 1; min-width: 0; }

.nav-group-pref-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.nav-group-pref-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 10px 12px; cursor: grab;
}
.nav-group-pref-row.dragging { opacity: .5; }
.nav-group-pref-row.drag-over { outline: 2px dashed #0f766e; }
.nav-group-drag {
  color: #94a3b8; font-size: 1rem; line-height: 1; cursor: grab; user-select: none;
}
.nav-group-pref-title { flex: 1; min-width: 100px; font-weight: 600; font-size: .88rem; color: #1f2937; }
.nav-group-pref-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-group-pref-row .nav-check { margin: 0; color: #475569; }
.nav-group-owned {
  margin-top: 8px; width: 100%; border-top: 1px dashed #e2e8f0; padding-top: 8px;
}

/* 右键菜单 */
.ctx-menu {
  position: fixed; z-index: 80; min-width: 148px;
  background: rgba(36,36,42,.96);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
  backdrop-filter: blur(8px);
}
.ctx-menu[hidden] { display: none !important; }
.ctx-menu button {
  display: block; width: 100%; text-align: left;
  border: 0; background: transparent; color: #eee;
  font: inherit; font-size: .86rem;
  padding: 8px 12px; border-radius: 8px; cursor: pointer;
}
.ctx-menu button:hover { background: rgba(255,255,255,.1); }
.ctx-menu button.ctx-danger { color: #f8786e; }

/* 图标编辑 */
.icon-type-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0;
}
.icon-type-tab {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.75);
  font-size: .8rem; padding: 6px 14px; border-radius: 8px; cursor: pointer;
}
.icon-type-tab.on {
  border-color: transparent;
  color: #fff;
  background: #18a058;
}
.icon-edit-row {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 8px;
}
.icon-preview {
  width: 56px; height: 56px; flex: 0 0 56px;
  border-radius: 14px; background: rgba(255,255,255,.1);
  display: grid; place-items: center;
  font-size: 1.4rem; font-weight: 700; overflow: hidden;
}
.icon-edit-fields { flex: 1; min-width: 0; }
.icon-pane { display: none; }
.icon-pane.on { display: block; }
.icon-pane input[type="text"],
.icon-pane input[type="url"] {
  width: 100%; box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25); color: inherit;
  border-radius: 10px; padding: 9px 11px; font: inherit;
}
.icon-pane input[type="file"] {
  width: 100%; color: rgba(255,255,255,.75); font-size: .82rem;
}
.nav-hint, .nav-hint-link {
  display: block; margin-top: 6px;
  font-size: .75rem; color: rgba(255,255,255,.45);
}
.launcher .nav-hint {
  color: #64748b;
}
.launcher .nav-hint-link { color: #0f766e; }
.nav-hint-link { color: #7ec8ff; text-decoration: none; }
.icon-inline-row .nav-hint-link {
  display: inline; margin-top: 0; white-space: nowrap; flex-shrink: 0;
}
.nav-hint-link:hover { text-decoration: underline; }
.admin-item-thumb {
  width: 28px; height: 28px; flex: 0 0 28px;
  border-radius: 8px; background: rgba(255,255,255,.1);
  display: grid; place-items: center;
  font-size: .75rem; font-weight: 700; overflow: hidden;
}
.admin-item-thumb .app-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

@media (max-width: 640px) {
  .launcher {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
  }
  .launcher-shell { flex-direction: column; }
  .launcher-side {
    width: 100%;
    max-height: 140px;
    border-radius: 16px 16px 0 0;
  }
  .launcher-nav { flex-direction: row; flex-wrap: wrap; }
  .nav-dialog-item {
    width: calc(100vw - 16px);
    min-height: 0;
    max-height: calc(100vh - 16px);
  }
  .nav-dialog-item .nav-dialog-shell {
    min-height: 0;
    max-height: calc(100vh - 16px);
  }
  .item-grid-2 { grid-template-columns: 1fr; }
  .item-preview-canvas { flex-wrap: wrap; justify-content: center; }
  .icon-info-box { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .sun-hero { width: 100%; }
  .logo-text { font-size: 1.5rem; line-height: 1.2; }
  .clock-time { font-size: 1.5rem; }

  /* 手机端：安全区 + 加大左右留白 */
  .sun-content {
    margin-top: calc(20px + var(--nav-content-top, 70px) + env(safe-area-inset-top, 0px));
    padding-left: max(18px, env(safe-area-inset-left, 0px));
    padding-right: max(18px, env(safe-area-inset-right, 0px));
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px) + var(--nav-content-bottom, 5%));
    box-sizing: border-box;
  }
  /* 搜索框略窄于内容区，两侧更透气 */
  .search-wrap {
    width: 92%;
    max-width: 100%;
    margin: 24px auto 0;
    box-sizing: border-box;
  }
  .search-box {
    min-height: 44px;
    padding: 2px 8px;
  }
  /* 固定两列，避免加大边距后挤成单列 */
  .icon-info-box {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .item-list { margin-top: 36px; }
  .group-hd { margin-left: 4px; margin-bottom: 14px; }
  .group-title { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  .app-icon-info, .app-icon-small-icon { transition: none; }
}
