:root {
  --ink: #d8d1c6;
  --muted: rgba(216, 209, 198, 0.62);
  --soft: rgba(216, 209, 198, 0.09);
  --line: rgba(216, 209, 198, 0.14);
  --panel: rgba(24, 31, 38, 0.76);
  --panel-strong: rgba(28, 36, 44, 0.94);
  --orange: #ff9a4a;
  --orange-deep: #e56d2f;
  --blue: #62b7ff;
  --blue-deep: #2f77d4;
  --rose: #ff748a;
  --violet: #9c8cff;
  --deep: #10151b;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 154, 74, 0.24), transparent 34%),
    linear-gradient(320deg, rgba(98, 183, 255, 0.22), transparent 36%),
    #161c22;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.phone-os {
  position: relative;
  width: 100%;
  min-height: 100svh;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(216, 209, 198, 0.035), transparent 32%),
    linear-gradient(145deg, #263244 0%, #121923 45%, #261d18 100%);
  isolation: isolate;
}

@media (min-width: 520px) {
  body {
    display: grid;
    place-items: center;
    min-height: 100vh;
  }

  .phone-os {
    width: min(430px, calc(100vw - 28px));
    height: min(900px, calc(100vh - 28px));
    min-height: 0;
    border: 1px solid rgba(216, 209, 198, 0.16);
    border-radius: 34px;
    box-shadow: var(--shadow);
  }
}

.ambient {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 14%, rgba(98, 183, 255, 0.36), transparent 26%),
    radial-gradient(circle at 78% 8%, rgba(255, 154, 74, 0.28), transparent 24%),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.26));
}

.view {
  position: absolute;
  inset: 0;
  display: none;
  padding-top: env(safe-area-inset-top);
}

.view.active {
  display: flex;
  flex-direction: column;
}

.home {
  overflow: hidden;
  padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
}

.home-top {
  flex: 0 0 auto;
  padding: 18px 20px 10px;
}

.home-top p,
.home-top h1 {
  margin: 0;
}

.home-top p {
  color: var(--muted);
  font-size: 13px;
}

.home-top h1 {
  margin-top: 8px;
  font-size: clamp(34px, 8vh, 42px);
  line-height: 1;
  font-weight: 850;
  color: transparent;
  background: linear-gradient(135deg, var(--orange), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
}

.home-top span {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(216, 209, 198, 0.055);
  font-size: 12px;
}

.live-card {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: calc(100% - 32px);
  margin: 6px 16px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(98, 183, 255, 0.16), rgba(255, 154, 74, 0.09));
  box-shadow: var(--shadow);
  text-align: left;
  backdrop-filter: blur(22px);
  overflow: hidden;
}

.portrait,
.avatar {
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #170b02;
  background: linear-gradient(145deg, var(--orange), var(--blue));
  font-weight: 900;
}

.live-copy {
  min-width: 0;
}

.portrait {
  width: 58px;
  height: 58px;
  font-size: 24px;
}

.live-copy b,
.live-copy small {
  display: block;
  min-width: 0;
  max-width: 100%;
}

.live-copy b,
.tile b,
.nav h2 {
  color: #e2a96c;
}

.live-copy small {
  margin-top: 4px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  flex: 0 0 auto;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  color: #22070b;
  background: var(--rose);
  font-size: 12px;
  font-weight: 900;
  line-height: 24px;
  text-align: center;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  flex: 1 1 auto;
  min-height: 0;
  gap: 8px;
  padding: 0 16px 12px;
  overflow: hidden;
}

.tile {
  position: relative;
  min-height: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  text-align: left;
  backdrop-filter: blur(20px);
}

.tile i {
  display: block;
  width: clamp(26px, 4.8vh, 36px);
  height: clamp(26px, 4.8vh, 36px);
  margin-bottom: clamp(6px, 1.7vh, 14px);
  border-radius: 12px;
  background: var(--orange);
}

.tile b,
.tile small {
  display: block;
}

.tile b {
  font-size: clamp(15px, 2.35vh, 17px);
}

.tile small {
  margin-top: 3px;
  color: var(--muted);
  font-size: clamp(11px, 1.65vh, 12px);
}

.tile-chat i { background: linear-gradient(145deg, var(--orange), var(--blue)); }
.tile-call i { background: linear-gradient(145deg, var(--blue), var(--blue-deep)); }
.tile-moments i { background: linear-gradient(145deg, var(--orange), var(--orange-deep)); }
.tile-profile i { background: linear-gradient(145deg, var(--violet), #765ba4); }
.tile-memory i { background: linear-gradient(145deg, #a0a9b2, #56616c); }
.tile-album i { background: linear-gradient(145deg, var(--blue), var(--orange)); }
.tile-article i { background: linear-gradient(145deg, #e59a83, #a45347); }
.tile-music i { background: linear-gradient(145deg, #8bb9ec, #405f9d); }

.page {
  background:
    linear-gradient(180deg, rgba(98, 183, 255, 0.14), transparent 260px),
    rgba(16,21,27,0.96);
}

.nav {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(16,21,27,0.72);
  backdrop-filter: blur(20px);
}

.nav.transparent {
  border-bottom: 0;
  background: transparent;
}

.nav h2 {
  margin: 0;
  text-align: center;
  font-size: 17px;
}

.back,
.icon-action,
.composer button,
.wide,
.sheet button,
.call-main {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--soft);
  font-weight: 850;
}

.back {
  font-size: 28px;
  line-height: 1;
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 15px;
}

.person b,
.person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.switcher,
.sheet {
  position: absolute;
  z-index: 25;
  left: 12px;
  right: 12px;
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.switcher {
  top: calc(env(safe-area-inset-top) + 104px);
}

.sheet {
  bottom: calc(env(safe-area-inset-bottom) + 14px);
}

.character-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 16px;
  color: var(--ink);
  background: var(--soft);
  text-align: left;
}

.messages,
.feed,
.list,
.form,
.album {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
}

.message {
  max-width: 84%;
}

.message.user {
  align-self: flex-end;
}

.bubble {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(216, 209, 198, 0.075);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.user .bubble {
  color: #170b02;
  border-color: transparent;
  background: linear-gradient(135deg, var(--orange), var(--blue));
}

.message-actions {
  display: flex;
  gap: 6px;
  margin-top: 5px;
}

.mini-btn {
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--muted);
  background: rgba(216, 209, 198, 0.065);
  font-size: 12px;
}

.composer {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 7px;
  padding: 9px 10px calc(env(safe-area-inset-bottom) + 10px);
  border-top: 1px solid var(--line);
  background: rgba(16,21,27,0.84);
  backdrop-filter: blur(20px);
}

.attach-preview {
  grid-column: 1 / -1;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(216, 209, 198, 0.07);
  font-size: 12px;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: none;
  background: rgba(216, 209, 198, 0.07);
  color: var(--ink);
}

textarea {
  min-height: 38px;
  resize: none;
  padding: 9px 10px;
  line-height: 1.45;
}

input,
select {
  height: 42px;
  padding: 0 11px;
}

textarea::placeholder,
input::placeholder {
  color: rgba(216, 209, 198, 0.42);
}

select option {
  background: #1c242c;
  color: var(--ink);
}

.send,
.wide,
.sheet button,
.call-main {
  color: #170b02;
  background: linear-gradient(135deg, var(--orange), var(--blue));
}

.feed,
.list {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px 12px;
}

.moment,
.data-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
  backdrop-filter: blur(22px);
}

.moment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.person-row {
  display: flex;
}

.person,
.moment .person-row {
  min-width: 0;
}

.moment .person-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.moment .person-row b,
.moment .person-row small,
.data-card small {
  display: block;
}

.moment .person-row small,
.tag,
.data-card small {
  color: var(--muted);
  font-size: 12px;
}

.tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--soft);
}

.moment p,
.data-card p {
  margin: 0;
  line-height: 1.55;
}

.media-card {
  margin-top: 10px;
  padding: 12px;
  border-radius: 17px;
  color: #170b02;
  background: linear-gradient(130deg, var(--orange), var(--blue));
  font-weight: 800;
}

.article-card {
  background: linear-gradient(130deg, var(--orange), var(--rose));
}

.photo-card {
  height: 132px;
  margin: 10px 0;
  border-radius: 17px;
  background:
    linear-gradient(135deg, rgba(216, 209, 198, 0.13), transparent),
    linear-gradient(35deg, var(--blue), var(--orange));
}

.call {
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 26%, rgba(255,154,74,0.24), transparent 30%),
    radial-gradient(circle at 48% 36%, rgba(98,183,255,0.2), transparent 34%),
    linear-gradient(180deg, #151b21, #0d1116);
}

.call-body {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  flex: 1;
  padding: 20px;
  text-align: center;
}

.call-orbit {
  position: absolute;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(216, 209, 198, 0.14);
  border-radius: 50%;
}

.call-avatar {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: 1px solid var(--line);
  border-radius: 38px;
  color: #170b02;
  background: linear-gradient(145deg, var(--orange), var(--blue));
  box-shadow: var(--shadow);
  font-size: 42px;
  font-weight: 900;
}

.call-body h2,
.call-body p {
  z-index: 1;
  margin: 0;
}

.call-tools {
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: min(300px, 100%);
}

.call-tools button {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: var(--soft);
  font-weight: 800;
}

.call-main {
  z-index: 1;
  width: min(300px, 100%);
  height: 50px;
  border-radius: 18px;
}

.call-main.danger {
  color: #26080d;
  background: var(--rose);
}

.form {
  padding: 14px 12px;
}

.form label {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 13px;
}

.album {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  padding: 14px 12px;
}

.album-item {
  min-height: 154px;
  display: flex;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(216, 209, 198, 0.12), transparent),
    linear-gradient(35deg, var(--blue-deep), var(--orange-deep));
  font-size: 12px;
  font-weight: 850;
  word-break: break-word;
}

.hidden {
  display: none !important;
}
