:root {
  --primary: #1476f2;
  --primary-dark: #075dcc;
  --primary-soft: #eaf3ff;
  --ink: #172033;
  --muted: #7c879e;
  --line: #e8eef7;
  --surface: rgba(255, 255, 255, .94);
  --page: #f4f8ff;
  --shadow: 0 14px 40px rgba(34, 84, 154, .10);
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 8% 4%, rgba(91, 170, 255, .20), transparent 28rem), radial-gradient(circle at 94% 12%, rgba(87, 120, 255, .11), transparent 24rem), var(--page);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.site-shell { width: 100%; max-width: 860px; min-height: 100vh; margin: 0 auto; padding: 0 20px 104px; overflow-x: hidden; }
.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; min-width: 0; }
.brand-logo { width: 42px; height: 42px; border-radius: 14px; padding: 3px; background: #fff; box-shadow: 0 8px 22px rgba(33, 98, 184, .14); overflow: hidden; flex: 0 0 auto; }
.brand-logo img { width: 100%; height: 100%; border-radius: 11px; object-fit: cover; }
.brand-copy { min-width: 0; margin-left: 11px; display: flex; flex-direction: column; }
.brand-copy strong { font-size: 17px; line-height: 1.35; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.brand-copy small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.device-pill { display: inline-flex; align-items: center; max-width: 160px; padding: 9px 12px; border: 1px solid rgba(20, 118, 242, .13); border-radius: 999px; background: rgba(255, 255, 255, .78); color: var(--primary); box-shadow: 0 7px 20px rgba(34, 84, 154, .06); font-size: 12px; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.status-dot { width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #ffad32; box-shadow: 0 0 0 4px rgba(255, 173, 50, .13); }
.device-pill.connected .status-dot { background: #2dcc8d; box-shadow: 0 0 0 4px rgba(45, 204, 141, .13); }

.hero { position: relative; min-height: 230px; padding: 34px; border-radius: 28px; overflow: hidden; background: linear-gradient(135deg, #0d67e7 0%, #3094ff 56%, #78c5ff 100%); box-shadow: 0 22px 55px rgba(22, 111, 231, .23); isolation: isolate; }
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; border: 1px solid rgba(255, 255, 255, .23); border-radius: 50%; }
.hero::before { width: 250px; height: 250px; right: -70px; top: -120px; }
.hero::after { width: 140px; height: 140px; right: 110px; bottom: -100px; }
.hero-image { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.hero-image.visible { opacity: 1; }
.hero-shade { position: absolute; inset: 0; z-index: -2; background: linear-gradient(90deg, rgba(1, 43, 112, .84), rgba(3, 75, 174, .52) 58%, rgba(20, 118, 242, .16)); }
.hero-content { position: relative; max-width: 520px; color: #fff; }
.hero-kicker { display: inline-flex; padding: 6px 10px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; background: rgba(255, 255, 255, .13); font-size: 11px; font-weight: 700; letter-spacing: .13em; }
.hero h1 { margin: 16px 0 8px; font-size: clamp(28px, 5vw, 42px); line-height: 1.15; letter-spacing: -.04em; }
.hero p { max-width: 480px; margin: 0; color: rgba(255, 255, 255, .83); font-size: 14px; line-height: 1.75; }
.hero-dots { position: absolute; left: 34px; bottom: 20px; display: flex; gap: 7px; }
.hero-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 9px; background: rgba(255, 255, 255, .45); transition: width .2s, background .2s; }
.hero-dots button.active { width: 24px; background: #fff; }

.notice-card { display: flex; align-items: center; gap: 10px; margin: 16px 0; padding: 12px 15px; border: 1px solid rgba(20, 118, 242, .10); border-radius: 15px; background: rgba(255, 255, 255, .80); color: #4e607b; font-size: 13px; box-shadow: 0 8px 22px rgba(31, 88, 164, .05); }
.notice-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-size: 18px; font-weight: 800; }
.notice-track { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#noticeText { display: block; transition: opacity .18s, transform .18s; }
#noticeText.changing { opacity: 0; transform: translateY(-4px); }

.finder { margin-top: 22px; }
.search-box { height: 52px; display: flex; align-items: center; padding: 0 14px; border: 1px solid rgba(103, 135, 177, .13); border-radius: 17px; background: var(--surface); box-shadow: 0 10px 28px rgba(34, 84, 154, .07); }
.search-box:focus-within { border-color: rgba(20, 118, 242, .42); box-shadow: 0 10px 30px rgba(20, 118, 242, .12); }
.search-box svg { width: 20px; height: 20px; fill: none; stroke: #8a98af; stroke-width: 2; stroke-linecap: round; }
.search-box input { min-width: 0; flex: 1; height: 100%; margin: 0 10px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search-box input::placeholder { color: #a3afc1; }
.search-box button { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: #edf2f8; color: #8795aa; }
.filter-row { display: flex; gap: 9px; margin-top: 13px; padding-bottom: 3px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip { flex: 0 0 auto; padding: 9px 17px; border: 1px solid #e7edf6; border-radius: 999px; background: rgba(255, 255, 255, .85); color: #718098; font-size: 13px; font-weight: 650; }
.filter-chip.active { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(20, 118, 242, .20); }

.section-head { display: flex; align-items: end; justify-content: space-between; margin: 30px 2px 13px; }
.eyebrow { color: var(--primary); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.section-head h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.02em; }
.app-total { color: var(--muted); font-size: 12px; }
.app-list { display: grid; gap: 12px; }
.app-card { position: relative; width: 100%; min-width: 0; display: grid; grid-template-columns: 62px minmax(0, 1fr) 72px; align-items: center; gap: 14px; padding: 17px; border: 1px solid rgba(111, 141, 180, .10); border-radius: 20px; background: var(--surface); box-shadow: 0 10px 28px rgba(34, 84, 154, .065); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.app-card:hover { transform: translateY(-2px); border-color: rgba(20, 118, 242, .18); box-shadow: var(--shadow); }
.app-card:active { transform: scale(.994); }
.app-icon { width: 62px; height: 62px; padding: 3px; border-radius: 17px; background: linear-gradient(145deg, #fff, #ecf3fd); box-shadow: inset 0 0 0 1px rgba(89, 118, 158, .10); }
.app-icon img { width: 100%; height: 100%; border-radius: 14px; object-fit: cover; }
.app-info { min-width: 0; }
.app-title { display: flex; align-items: center; min-width: 0; gap: 7px; }
.app-title h3 { min-width: 0; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 16px; }
.version-tag { flex: 0 0 auto; padding: 3px 7px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); font-size: 10px; font-weight: 700; }
.bundle-id, .app-desc { margin: 5px 0 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bundle-id { color: #8794a8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.app-desc { color: #68778f; font-size: 12px; }
.app-meta { display: flex; gap: 13px; margin-top: 7px; color: #a0abba; font-size: 10px; }
.select-button { min-width: 72px; padding: 10px 16px; border: 0; border-radius: 13px; background: linear-gradient(135deg, var(--primary), #3997ff); color: #fff; font-size: 13px; font-weight: 750; box-shadow: 0 9px 20px rgba(20, 118, 242, .22); cursor: pointer; }

.skeleton-card { height: 98px; display: grid; grid-template-columns: 62px 1fr; gap: 14px; align-items: center; padding: 17px; border-radius: 20px; background: rgba(255, 255, 255, .75); overflow: hidden; }
.skeleton-card i, .skeleton-card b, .skeleton-card span { display: block; background: linear-gradient(90deg, #edf2f8 25%, #f8fafd 50%, #edf2f8 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton-card i { width: 62px; height: 62px; border-radius: 17px; }
.skeleton-card b { width: 42%; height: 14px; border-radius: 7px; }
.skeleton-card span { width: 70%; height: 9px; margin-top: 9px; border-radius: 6px; }
.skeleton-card span:last-child { width: 52%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty-state { padding: 50px 18px; text-align: center; color: var(--muted); }
.empty-icon { width: 58px; height: 58px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 20px; background: #e8f2ff; color: var(--primary); font-size: 28px; }
.empty-state h3 { margin: 0; color: #43516a; font-size: 16px; }
.empty-state p { margin: 8px 0 0; font-size: 12px; }
.load-error { padding: 40px 20px; display: flex; flex-direction: column; align-items: center; border-radius: 20px; background: rgba(255, 255, 255, .75); color: var(--muted); text-align: center; }
.load-error strong { color: #40506a; }
.load-error span { margin: 7px 0 14px; font-size: 12px; }
.load-error button { padding: 9px 16px; border: 0; border-radius: 11px; background: var(--primary); color: #fff; }

.bottom-nav { position: fixed; z-index: 20; left: 50%; bottom: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100% - 28px); max-width: 720px; height: 70px; display: grid; grid-template-columns: repeat(4, 1fr); padding: 7px; border: 1px solid rgba(108, 137, 175, .14); border-radius: 24px; background: rgba(255, 255, 255, .88); box-shadow: 0 18px 50px rgba(32, 73, 126, .18); backdrop-filter: blur(22px); transform: translateX(-50%); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 18px; color: #8a97aa; font-size: 10px; font-weight: 650; }
.bottom-nav a.active { background: #edf5ff; color: var(--primary); }
.nav-icon { height: 24px; font-size: 21px; line-height: 24px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 100px; max-width: calc(100% - 44px); padding: 11px 16px; border-radius: 12px; background: rgba(23, 32, 51, .92); color: #fff; font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 600px) {
  .site-shell { padding: 0 12px 100px; }
  .topbar { height: 70px; }
  .brand-copy small { display: none; }
  .brand-logo { width: 38px; height: 38px; border-radius: 12px; }
  .hero { min-height: 198px; padding: 27px 23px; border-radius: 23px; }
  .hero h1 { margin-top: 13px; font-size: 28px; }
  .hero p { max-width: 86%; font-size: 12px; line-height: 1.65; }
  .hero-dots { left: 23px; bottom: 16px; }
  .app-card { grid-template-columns: 56px minmax(0, 1fr) 62px; gap: 11px; padding: 14px 12px; border-radius: 18px; }
  .app-icon { width: 56px; height: 56px; border-radius: 15px; }
  .app-icon img { border-radius: 12px; }
  .app-desc { display: none; }
  .select-button { min-width: 62px; padding: 9px 13px; }
}
@media (max-width: 390px) {
  .device-pill { max-width: 120px; padding: 8px 10px; }
  .app-card { grid-template-columns: 52px minmax(0, 1fr) 54px; }
  .app-icon { width: 52px; height: 52px; }
  .app-meta span:last-child { display: none; }
  .select-button { min-width: 54px; padding: 9px 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
