:root {
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #eef5f1;
  --line: #dce7e1;
  --text: #17211d;
  --muted: #6b7771;
  --soft: #8a9690;
  --brand: #19b978;
  --brand-2: #0d8f63;
  --blue: #2679e8;
  --danger: #e15353;
  --warning: #d98b1f;
  --shadow: 0 16px 40px rgba(18, 37, 29, .10);
  --radius: 8px;
  color-scheme: light;
}

[data-effective-theme="dark"] {
  --bg: #121715;
  --surface: #1b211f;
  --surface-2: #202b26;
  --line: #2d3a35;
  --text: #edf4f0;
  --muted: #a7b4ae;
  --soft: #83908b;
  --brand: #33d08f;
  --brand-2: #20aa74;
  --blue: #6fa5ff;
  --danger: #ff7575;
  --warning: #f2a83b;
  --shadow: 0 18px 46px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: .65;
}

a {
  color: var(--brand-2);
}

#app {
  width: 100%;
  height: 100%;
}

.desktop-app {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-columns: 64px 286px minmax(360px, 1fr) 300px;
  background: var(--bg);
  min-height: 0;
  overflow: hidden;
}

.desktop-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px 12px;
  background: #133326;
  color: #dceee7;
}

.rail-logo,
.brand-mark,
.boot-mark,
.empty-mark,
.about-logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(145deg, #33d08f, #1a9a70);
  color: #fff;
  font-weight: 800;
}

.desktop-rail button {
  position: relative;
  width: 46px;
  min-height: 46px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
}

.desktop-rail button > .rail-icon {
  display: grid;
  place-items: center;
  width: 100%;
  height: 22px;
}

.desktop-rail button .rail-svg {
  display: block;
  width: 21px;
  height: 21px;
}

.desktop-rail button em {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  font-style: normal;
}

.desktop-rail button.active,
.desktop-rail button:hover {
  background: rgba(255, 255, 255, .12);
}

.desktop-rail button b {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
}

.rail-user {
  margin-top: auto;
}

.desktop-rail .rail-user .nc-avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.desktop-sidebar,
.desktop-inspector {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.desktop-inspector {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.desktop-sidebar header,
.detail-head,
.chat-titlebar,
.desktop-inspector header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.desktop-sidebar h2,
.detail-head h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.detail-head p,
.desktop-inspector p,
.panel-note,
.row-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.desktop-main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

.sidebar-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.sidebar-search input,
label input,
label textarea,
label select,
.settings-field select,
.search-form input,
.composer-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: 0;
}

.sidebar-search input {
  height: 34px;
  padding: 0 12px;
  background: var(--surface-2);
}

.conversation-list,
.menu-list {
  height: calc(100% - 112px);
  overflow: auto;
  padding: 8px;
}

.conversation-item,
.contact-card,
.result-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.conversation-item {
  position: relative;
  min-height: 62px;
  padding: 8px;
}

.conversation-item:hover,
.conversation-item.active,
.menu-list button:hover,
.menu-list button.active,
.contact-card:hover,
.result-row:hover {
  background: var(--surface-2);
}

.conversation-item span,
.contact-card span,
.result-row span,
.member-row span,
.device-row span,
.transaction-row span,
.plan-row span {
  min-width: 0;
}

.conversation-item b,
.contact-card b,
.result-row b,
.member-row b,
.device-row b,
.transaction-row b,
.plan-row b {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item em,
.contact-card em,
.result-row em,
.member-row em,
.device-row em,
.transaction-row em,
.plan-row em {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item i {
  align-self: start;
  color: var(--soft);
  font-size: 11px;
  font-style: normal;
}

.conversation-item strong {
  position: absolute;
  right: 10px;
  bottom: 8px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.menu-list button {
  width: 100%;
  height: 38px;
  margin: 2px 0;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.nc-avatar {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #dfeee8;
  color: var(--brand-2);
  font-weight: 700;
}

.nc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nc-avatar.large {
  width: 56px;
  height: 56px;
}

.plain {
  border: 0;
  background: transparent;
  color: inherit;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.icon-btn:hover,
.secondary:hover {
  border-color: rgba(25, 185, 120, .45);
}

.primary,
.secondary,
.danger,
.send-btn,
.link-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.primary,
.send-btn {
  background: var(--brand);
  color: #fff;
}

.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.danger {
  background: #fff1f1;
  border-color: #ffd5d5;
  color: var(--danger);
}

[data-effective-theme="dark"] .danger {
  background: #3b2424;
  border-color: #5b3434;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--brand-2);
}

.chat-workspace {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--bg);
}

.chat-titlebar {
  flex: 0 0 auto;
  background: var(--surface);
}

.chat-person {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  text-align: left;
}

.chat-person span {
  min-width: 0;
}

.chat-person b {
  display: block;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-person em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.chat-title-actions {
  display: flex;
  gap: 8px;
}

.chat-readonly-banner {
  flex: 0 0 auto;
  padding: 8px 16px;
  background: #fff7e8;
  color: #8b5a10;
  font-size: 13px;
}

[data-effective-theme="dark"] .chat-readonly-banner {
  background: #332b1c;
  color: #f2c36e;
}

.message-scroll {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  padding: 18px 24px;
  overscroll-behavior: contain;
}

.message-divider {
  width: max-content;
  margin: 12px auto;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(23, 33, 29, .08);
  color: var(--muted);
  font-size: 11px;
}

.message-row {
  display: flex;
  gap: 10px;
  margin: 10px 0;
}

.message-row.mine {
  justify-content: flex-end;
}

.message-stack {
  max-width: min(560px, 72%);
}

.message-sender {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.message-bubble {
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(16, 37, 28, .04);
}

.message-row.mine .message-bubble {
  margin-left: auto;
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.message-bubble.red-packet-bubble,
.message-row.mine .message-bubble.red-packet-bubble {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: inherit;
}

[data-bubble="blue"] .message-row.mine .message-bubble {
  background: var(--blue);
  border-color: var(--blue);
}

[data-bubble="violet"] .message-row.mine .message-bubble {
  background: #7b6fe8;
  border-color: #7b6fe8;
}

[data-bubble="gray"] .message-row.mine .message-bubble {
  background: #67726d;
  border-color: #67726d;
}

[data-chat-font="1"] .message-bubble {
  font-size: 13px;
}

[data-chat-font="3"] .message-bubble {
  font-size: 15px;
}

.message-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.message-row.mine .message-text a {
  color: #fff;
  text-decoration: underline;
}

.system-message,
.chat-empty-state,
.empty-inline {
  width: max-content;
  max-width: 80%;
  margin: 18px auto;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(23, 33, 29, .06);
  color: var(--muted);
  font-size: 13px;
}

.image-message,
.video-message,
.file-message,
.location-card,
.red-packet-card {
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.image-message img {
  display: block;
  max-width: 260px;
  max-height: 320px;
  object-fit: cover;
}

.video-message {
  position: relative;
  width: 260px;
  height: 150px;
  background: #0d1612;
  color: #fff;
}

.video-message img,
.video-thumb-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-message b {
  position: absolute;
  left: 12px;
  bottom: 10px;
}

.file-message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  width: 260px;
  padding: 10px;
  background: var(--surface-2);
}

.file-message span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand-2);
  font-size: 11px;
  font-weight: 800;
}

.file-message b,
.file-message em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-message em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.location-card,
.red-packet-card {
  min-width: 240px;
  padding: 12px;
  background: linear-gradient(135deg, #fff4dc, #ffe0a6);
  color: #6e4200;
}

.red-packet-card {
  width: 300px;
  max-width: min(300px, 72vw);
  background: linear-gradient(135deg, #ff6b56, #d84035);
  color: #fff;
  box-shadow: 0 10px 24px rgba(216, 64, 53, .18);
}

.location-card b,
.red-packet-card b,
.location-card span,
.red-packet-card span,
.location-card i,
.red-packet-card em {
  display: block;
  font-style: normal;
}

.link-card-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.link-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  min-width: 240px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .28);
  color: inherit;
  text-decoration: none;
}

.link-card img,
.link-card i {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
}

.desktop-composer {
  display: flex;
  align-items: flex-start;
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  min-width: 0;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.composer-tools {
  display: flex;
  gap: 8px;
}

.composer-form {
  display: grid;
  align-items: start;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.composer-input-shell {
  position: relative;
}

.composer-form textarea {
  height: 40px;
  min-height: 40px;
  max-height: 96px;
  resize: none;
  overflow: auto;
  padding: 9px 12px;
}

.desktop-composer .send-btn {
  align-self: start;
  width: 72px;
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  white-space: nowrap;
}

.composer-disabled {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.mention-popover,
.emoji-popover {
  position: fixed;
  z-index: 50;
  width: 260px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mention-popover {
  position: absolute;
  left: 0;
  bottom: 44px;
}

.mention-popover button {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
}

.emoji-popover {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.emoji-popover button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-2);
}

.message-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.message-progress i {
  width: 90px;
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.message-progress b {
  display: block;
  height: 100%;
  background: var(--brand);
}

.message-progress.failed {
  color: var(--danger);
}

.desktop-inspector {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.desktop-inspector header {
  display: block;
  text-align: center;
}

.desktop-inspector h3 {
  margin: 10px 0 0;
  font-size: 16px;
}

.inspector-actions,
.inspector-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.inspector-list {
  border-top: 1px solid var(--line);
}

.inspector-list button {
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  padding: 0 12px;
}

.inspector-empty {
  margin: auto;
  color: var(--muted);
}

.detail-page {
  height: 100%;
  overflow: auto;
  padding: 0 0 24px;
}

.desktop-panel {
  margin: 14px 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.desktop-panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.desktop-grid {
  display: grid;
  gap: 14px;
  margin: 14px 16px;
}

.desktop-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.desktop-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

form label,
.settings-field {
  display: block;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

form label input,
form label textarea,
form label select,
.settings-field select {
  margin-top: 6px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 14px;
}

.desktop-auth,
.desktop-boot,
.desktop-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
}

.auth-panel {
  width: min(380px, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.auth-brand b {
  display: block;
  color: var(--text);
  font-size: 18px;
}

.auth-brand em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.desktop-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 160px;
  color: var(--muted);
}

.desktop-loading i {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 99px;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.contact-grid,
.favorite-grid,
.moment-list,
.result-list {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.contact-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.contact-card {
  grid-template-columns: 44px minmax(0, 1fr);
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.profile-hero,
.lumina-hero,
.wallet-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 14px 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.profile-avatar {
  width: 76px;
  height: 76px;
}

.profile-hero h1,
.lumina-hero strong,
.wallet-hero strong {
  margin: 0;
  font-size: 20px;
}

.wallet-hero {
  display: block;
  background: linear-gradient(135deg, #143c2c, #1fb979);
  color: #fff;
}

.wallet-hero span,
.wallet-hero em {
  display: block;
  opacity: .86;
  font-style: normal;
}

.wallet-hero strong {
  display: block;
  margin: 8px 0;
  font-size: 30px;
}

.transaction-list,
.plan-list,
.member-table,
.device-list {
  display: grid;
  gap: 8px;
}

.transaction-row,
.plan-row,
.member-row,
.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-2);
}

.member-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
}

.member-row div {
  display: flex;
  gap: 6px;
}

.transaction-row strong.plus {
  color: var(--brand-2);
}

.transaction-row strong.minus {
  color: var(--danger);
}

.settings-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.settings-switch:last-child {
  border-bottom: 0;
}

.settings-switch input {
  display: none;
}

.settings-switch i {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: #b9c4bf;
}

.settings-switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 99px;
  background: #fff;
  transition: transform .16s ease;
}

.settings-switch input:checked + i {
  background: var(--brand);
}

.settings-switch input:checked + i::after {
  transform: translateX(18px);
}

.profile-edit-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.avatar-picker input,
.file-label input {
  display: none;
}

.handle-input {
  display: flex;
  align-items: center;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.handle-input span {
  padding: 0 10px;
  color: var(--muted);
}

.handle-input input {
  border: 0;
  margin: 0;
}

.moment-publisher textarea {
  resize: vertical;
}

.publisher-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.moment-card,
.favorite-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.moment-card header,
.favorite-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.moment-author {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.moment-content {
  display: block;
  width: 100%;
  margin: 12px 0;
  text-align: left;
  white-space: pre-wrap;
}

.moment-images {
  display: grid;
  gap: 8px;
}

.moment-images.cols-1 {
  grid-template-columns: minmax(0, 280px);
}

.moment-images.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 180px));
}

.moment-images.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 160px));
}

.moment-images button {
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  aspect-ratio: 1;
  padding: 0;
  background: var(--surface-2);
}

.moment-images img,
.moment-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.moment-card footer {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.moment-card footer button {
  border: 0;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text);
}

.moment-card footer button.active {
  color: var(--brand-2);
}

.moment-comments {
  margin-top: 10px;
}

.moment-comments p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
}

.moment-comments form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.moment-comments input {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.lumina-badge {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  vertical-align: -3px;
}

.lumina-badge i,
.lumina-mark i {
  width: 16px;
  height: 16px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, transparent 30%, rgba(255,255,255,.9) 31%, transparent 45%),
    linear-gradient(135deg, #55e7a2, #2b82ff 55%, #9c6cff);
  box-shadow: 0 0 0 1px rgba(255,255,255,.55) inset;
}

.lumina-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: #12291f;
}

.lumina-mark i {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}

.desktop-context-menu,
.desktop-modal,
.media-preview-layer,
.rtc-window {
  box-shadow: var(--shadow);
}

.desktop-context-menu {
  position: fixed;
  z-index: 60;
  width: 170px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.desktop-context-menu button {
  display: block;
  width: 100%;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0 10px;
}

.desktop-context-menu button:hover {
  background: var(--surface-2);
}

.desktop-modal-layer,
.media-preview-layer,
.rtc-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .34);
}

.desktop-modal {
  width: min(760px, calc(100vw - 40px));
  max-height: calc(100vh - 56px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.desktop-modal.small {
  width: min(420px, calc(100vw - 40px));
}

.desktop-modal.wide {
  width: min(960px, calc(100vw - 40px));
}

.desktop-modal header,
.desktop-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.desktop-modal footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.modal-body {
  padding: 14px;
}

.forward-list {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.forward-list button {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 8px;
  color: var(--text);
  text-align: left;
}

.media-preview-layer {
  background: rgba(0, 0, 0, .82);
}

.media-preview-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 22px;
}

.media-preview-body img,
.media-preview-body video {
  max-width: min(90vw, 1100px);
  max-height: 82vh;
  border-radius: 8px;
}

.media-preview-actions {
  position: fixed;
  left: 50%;
  bottom: 24px;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

.media-preview-actions a {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  text-decoration: none;
}

.rtc-layer {
  z-index: 75;
}

.rtc-layer.minimized {
  inset: auto 24px 24px auto;
  width: 280px;
  height: 190px;
  background: transparent;
  place-items: stretch;
}

.rtc-window {
  width: min(720px, calc(100vw - 40px));
  overflow: hidden;
  border-radius: 8px;
  background: #101614;
  color: #fff;
}

.rtc-layer.minimized .rtc-window {
  width: 280px;
  height: 190px;
}

.rtc-window header,
.rtc-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, .06);
}

.rtc-stage {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 28px;
}

.rtc-layer.minimized .rtc-stage {
  min-height: 96px;
  padding: 10px;
}

.rtc-avatar-pulse {
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  50% { transform: scale(1.04); opacity: .88; }
}

.rtc-controls {
  justify-content: center;
}

.rtc-controls button {
  min-width: 78px;
  height: 36px;
  border: 0;
  border-radius: 8px;
}

.rtc-device-panel {
  padding: 10px;
  background: rgba(255, 255, 255, .08);
}

.desktop-toast-host {
  position: fixed;
  z-index: 100;
  top: 18px;
  left: 50%;
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
}

.desktop-toast {
  transform: translateY(-8px);
  opacity: 0;
  padding: 9px 14px;
  border-radius: 8px;
  background: rgba(22, 31, 27, .92);
  color: #fff;
  box-shadow: var(--shadow);
  transition: .18s ease;
}

.desktop-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.desktop-toast.error {
  background: rgba(178, 48, 48, .94);
}

.narrow-warning {
  display: none;
}

.file-hidden {
  display: none;
}

.native-window-controls {
  display: none;
}

html.nowchat-native-desktop .native-window-controls {
  position: fixed;
  top: 8px;
  right: 10px;
  z-index: 5000;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 30px;
  padding: 2px;
  border: 1px solid rgba(18, 51, 38, .10);
  border-radius: 7px;
  background: rgba(244, 247, 245, .72);
  box-shadow: 0 8px 22px rgba(13, 33, 24, .10);
  pointer-events: auto;
  backdrop-filter: blur(14px) saturate(1.2);
}

html.nowchat-native-desktop .native-window-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 24px;
  min-width: 32px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #315247;
  font-size: 15px;
  line-height: 1;
}

html.nowchat-native-desktop .native-window-btn:hover {
  background: rgba(18, 51, 38, .09);
  color: #173327;
}

html.nowchat-native-desktop .native-window-btn.close:hover {
  background: #e24d4d;
  color: #ffffff;
}

html.nowchat-native-desktop .chat-titlebar,
html.nowchat-native-desktop .detail-head,
html.nowchat-native-desktop .desktop-sidebar header,
html.nowchat-native-desktop .desktop-inspector header {
  padding-right: 122px;
}

html.nowchat-native-desktop[data-effective-theme="dark"] .native-window-controls {
  border-color: rgba(255, 255, 255, .10);
  background: rgba(20, 29, 25, .74);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}

html.nowchat-native-desktop[data-effective-theme="dark"] .native-window-btn {
  color: #c6d5cf;
}

html.nowchat-native-desktop[data-effective-theme="dark"] .native-window-btn:hover {
  background: rgba(255, 255, 255, .10);
  color: #ffffff;
}

body.desktop-dragging::after {
  content: "松开发送文件";
  position: fixed;
  inset: 12px;
  z-index: 70;
  display: grid;
  place-items: center;
  border: 2px dashed var(--brand);
  border-radius: 8px;
  background: rgba(25, 185, 120, .10);
  color: var(--brand-2);
  font-size: 18px;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .desktop-app {
    grid-template-columns: 64px 260px minmax(340px, 1fr);
  }
  .desktop-inspector {
    display: none;
  }
}

@media (max-width: 759px) {
  .desktop-app {
    display: none;
  }
  .narrow-warning {
    display: grid;
    place-items: center;
    height: 100vh;
    padding: 24px;
    text-align: center;
  }
}
