:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #333;
  background: #f3f3f3;
  --paper: #eff5fc;
  --white: #fff;
  --line: #e8e8e8;
  --muted: #666;
  --blue: #1762d1;
  --header-inset: max(46px, env(safe-area-inset-top, 0px));
  --duration: 250ms;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }
body { margin: 0; overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; touch-action: manipulation; }
button, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, .scroll:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
button:active { opacity: .66; }
h1, h2, p { margin: 0; }
canvas { display: block; flex: none; }
[data-icon] { display: grid; place-items: center; }
[hidden] { display: none !important; }

.app {
  height: 100vh;
  height: 100dvh;
  max-width: 500px;
  margin-inline: auto;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #fff;
  box-shadow: 0 0 36px #0000000a;
}
.page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  transition: transform var(--duration) var(--ease);
}
.home { transform: translate3d(0, 0, 0); }
.profile {
  transform: translate3d(100%, 0, 0);
  visibility: hidden;
  transition: transform var(--duration) var(--ease), visibility 0s linear var(--duration);
  box-shadow: -5px 0 12px #00000018;
}
.app[data-page="profile"] .home { transform: translate3d(-14%, 0, 0); }
.app[data-page="profile"] .profile {
  transform: translate3d(0, 0, 0);
  visibility: visible;
  transition-delay: 0s;
}
.app.initial .page { transition: none; }

.symbol { display: grid; place-items: center; flex: none; font-size: 22px; }
.masthead {
  padding: var(--header-inset) max(16px, env(safe-area-inset-right)) 7px max(16px, env(safe-area-inset-left));
  background-color: #fff;
  background-image: linear-gradient(165deg, #c6e5ff, #e6ebff 62%, #fff);
  border-bottom: 1px solid #eee;
  flex: none;
}
.topbar { display: flex; align-items: center; height: 46px; gap: 12px; }
.topbar h1 { margin-right: auto; font-size: 19px; font-weight: 650; line-height: 1; white-space: nowrap; }
.avatar-button { flex: none; width: 32px; height: 44px; display: grid; place-items: center; }
.avatar-button img, .profile-photo { display: block; object-fit: contain; background: #fff; }
.avatar-button img { border-radius: 10px; }
.head-action { display: grid; place-items: center; width: 36px; height: 44px; flex: none; }
.topbar .head-action:last-child { margin-left: -12px; margin-right: -8px; }
.header-bag { width: 40px; height: 40px; --sprite-x: 28.57142857%; --sprite-y: 100%; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin-top: 5px;
  padding-inline: 8px;
  border-radius: 100px;
  background: #eff5fc;
  color: #c8c8c8;
}
.search input { height: 100%; min-width: 0; width: 100%; padding: 0; border: 0; background: transparent; font-size: 16px; }
.search input::placeholder { color: #c8c8c8; opacity: 1; }

.scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.scroll::-webkit-scrollbar { display: none; }
.home-scroll { padding: 8px max(8px, env(safe-area-inset-right)) 16px max(8px, env(safe-area-inset-left)); }
.panel { background: var(--white); }
.home .panel { border-radius: 13px; box-shadow: 0 1px 7px #00000008; margin-bottom: 8px; }
.apps { padding: 4px 8px 0; }
.filters { display: flex; gap: 20px; margin: 0 9px 0; min-height: 44px; }
.filters button { font-size: 14px; color: #999; }
.filters button[aria-pressed="true"] { color: #333; }
.grid { display: grid; }
.grid-five { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: 80px; }
.grid-five .tile:nth-last-child(-n+5) { padding-bottom: 4px; }
.grid-five:has(.tile:nth-child(15)) { grid-template-rows: 80px 80px 76px; }
.grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: 80px 70px; }
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  gap: 5px;
  padding: 0 1px;
  line-height: 1.2;
  text-align: center;
}
.tile span:last-child { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-five .tile { font-size: clamp(10px, 3.05vw, 12px); color: #333746; }
.tile-icon { width: 40px; height: 40px; }
.empty { padding: 12px 8px; color: var(--muted); font-size: 14px; }

.feature { padding: 8px 16px 0; }
.panel h2 { font-size: 15px; line-height: 1.3; font-weight: 500; }
.topic-title { display: flex; align-items: center; gap: 6px; min-height: 24px; text-align: left; }
.topic-title [data-icon] { color: #999; }
.feature-story {
  display: grid;
  grid-template-columns: minmax(64px, 28%) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 113px;
  padding-block: 12px;
  text-align: left;
}
.cover { display: block; object-fit: contain; width: 100%; height: auto; }
.feature-story strong, .feature-story small { display: block; font-weight: 400; }
.feature-story strong { font-size: 16px; line-height: 1.24; }
.feature-story small { color: #999; margin-top: 7px; font-size: 11.5px; line-height: 1.24; }
.news { display: flex; gap: 10px; align-items: center; width: 100%; min-height: 34px; text-align: left; font-size: 15px; }
.news::before { content: ""; width: 4px; height: 4px; margin-left: 2px; border-radius: 50%; background: #ccc; flex: none; }
.feature-story + .news { border-top: 1px solid var(--line); }
.shortcuts { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 10px; border-top: 1px solid var(--line); }
.shortcuts button { min-height: 46px; position: relative; font-size: 14px; color: #1658b5; }
.shortcuts button + button::before { content: ""; position: absolute; left: 0; top: calc(50% - 7px); width: 1px; height: 14px; background: #ddd; }
.bottom {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #fff;
  padding: 4px env(safe-area-inset-right) calc(11px + env(safe-area-inset-bottom)) env(safe-area-inset-left);
  flex: none;
}
.bottom button { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 0; min-height: 45px; color: #666; font-size: 10px; }
.bottom .symbol { display: grid; place-items: center; flex: none; font-size: 22px; }
.profile-bar h1 { align-self: start; margin-top: 11px; font-size: 17px; font-weight: 500; white-space: nowrap; }
.back { justify-self: start; width: 36px; height: 44px; }
.profile-scroll { padding-bottom: env(safe-area-inset-bottom); }
.profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 124px;
  margin: 0 max(17px, env(safe-area-inset-right)) 0 max(17px, env(safe-area-inset-left));
  padding: 14px 21px 14px 15px;
  border: 1px solid #f0f0f0;
  border-radius: 9px;
  background: #fff;
}
.profile-scroll { background: linear-gradient(#fff 0 182px, var(--paper) 182px); }
.identity h2 { font-size: 20px; line-height: 1.22; font-weight: 500; }
.identity p { margin-top: 8px; color: #666; font-size: 15px; }
.account { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 5px; margin-top: 6px; border-radius: 20px; background: #e4efff; color: #1658b5; font-size: 13px; }
.account-icon { width: 17px; height: 17px; border-radius: 50%; }
.profile-photo { flex: none; border-radius: 26px; border: 1px solid #f6eed0; }
.status { display: flex; align-items: center; gap: 10px; min-height: 58px; width: 100%; padding: 12px 18px 0 max(33px, env(safe-area-inset-left)); background: #fff; color: #666; font-size: 15px; text-align: left; overflow-wrap: anywhere; }
.status-mark { width: 27px; height: 27px; }
.profile-group h2 { display: flex; align-items: center; min-height: 40px; padding-left: max(16px, env(safe-area-inset-left)); background: var(--paper); }
.profile-group .grid { padding: 10px env(safe-area-inset-right) 0 env(safe-area-inset-left); }
.profile-group .tile { font-size: 14px; }

dialog { width: min(calc(100% - 34px), 410px); border: 1px solid var(--line); border-radius: 12px; padding: 20px; color: inherit; background: #fff; }
dialog::backdrop { background: #0006; }
dialog h2 { font-size: 18px; }
dialog p { margin: 12px 0 16px; color: var(--muted); line-height: 1.55; }
.primary, .secondary { min-height: 44px; padding: 0 16px; border-radius: 8px; }
.primary { background: #008ee8; color: white; }
.secondary { background: #f3f3f3; }
.status-label { display: grid; gap: 7px; margin: 13px 0; font-size: 14px; }
.status-label input { min-height: 44px; border-radius: 8px; border: 1px solid #ddd; padding: 8px; font-size: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (prefers-reduced-motion: reduce) {
  :root { --duration: 0ms; }
}

@media (display-mode: standalone) {
  /* The iPhone status bar already reserves space when it sits above the viewport. */
  :root { --header-inset: env(safe-area-inset-top, 0px); }
}

.tile-icon { border-radius: 50%; color: #1754a5; background: #e0edff; }
.tile:nth-child(3n+2) .tile-icon { background: #f5edcf; color: #755812; }
.tile:nth-child(3n) .tile-icon { background: #e9e9f5; color: #504d79; }
.cover { min-height: 64px; border-radius: 14px; background: #dbeaff; color: #1754a5; font-size: 34px; }
.profile-card { background: #e4efff; border-color: #d2e1f8; border-radius: 18px; }
.account-icon { font-size: 18px; }

