@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* ============================================================================
   * YunChat H5 — UI/UX Pro Max Glassmorphism Design System
   * Spec: backdrop-filter: blur(18px) saturate(185%), 1px specular border,
   * top light-source reflection, multi-orb vibrant aurora mesh background.
   * ============================================================================ */
  --blur-amount: 18px;
  --blur-strong: 24px;
  --glass-bg: rgba(255, 255, 255, 0.56);
  --glass-bg-elevated: rgba(255, 255, 255, 0.74);
  --glass-bg-subtle: rgba(255, 255, 255, 0.38);
  --glass-border: rgba(255, 255, 255, 0.78);
  --glass-border-strong: rgba(255, 255, 255, 0.92);
  --glass-divider: rgba(148, 163, 184, 0.18);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  --glass-shadow: 0 12px 32px -8px rgba(37, 99, 235, 0.12), 0 4px 12px rgba(15, 23, 42, 0.04);
  --glass-shadow-lg: 0 20px 44px -10px rgba(37, 99, 235, 0.18), 0 8px 20px rgba(15, 23, 42, 0.06);

  --ground: #e8f0fe;
  --surface: rgba(255, 255, 255, 0.58);
  --surface-2: rgba(255, 255, 255, 0.76);
  --border: rgba(255, 255, 255, 0.74);
  --border-strong: rgba(255, 255, 255, 0.9);
  --text: #0f172a;
  --muted: #475569;
  --subtle: #64748b;
  --primary: #2563eb;
  --primary-2: #6366f1;
  --primary-fg: #ffffff;
  --active: rgba(37, 99, 235, 0.12);
  --accent: #2563eb;
  --accent-tint: rgba(37, 99, 235, 0.14);
  --accent-ink: #1d4ed8;
  --pos: #059669;
  --pos-tint: rgba(16, 185, 129, 0.16);
  --pos-ink: #065f46;
  --warn: #d97706;
  --warn-tint: rgba(245, 158, 11, 0.16);
  --warn-ink: #92400e;
  --neg: #dc2626;
  --neg-tint: rgba(239, 68, 68, 0.15);
  --neg-ink: #991b1b;

  /* Compatibility aliases */
  --appbar-bg: rgba(255, 255, 255, 0.58);
  --scaffold-bg: transparent;
  --card-bg: rgba(255, 255, 255, 0.56);
  --text-main: #0f172a;
  --text-sub: #475569;
  --text-muted: #64748b;
  --divider: rgba(148, 163, 184, 0.18);
  --danger: #dc2626;
  --success: #059669;
  --warning-bg: rgba(245, 158, 11, 0.16);
  --warning-text: #92400e;

  --font-sans: "Inter", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  /* Vibrant multi-layered ambient aurora background for Glassmorphism refraction */
  background:
    radial-gradient(circle at 10% 14%, rgba(59, 130, 246, 0.56) 0%, transparent 40%),
    radial-gradient(circle at 88% 18%, rgba(124, 58, 237, 0.48) 0%, transparent 42%),
    radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.44) 0%, transparent 44%),
    radial-gradient(circle at 20% 84%, rgba(99, 102, 241, 0.42) 0%, transparent 44%),
    radial-gradient(circle at 50% 48%, rgba(236, 72, 153, 0.24) 0%, transparent 50%),
    linear-gradient(135deg, #c7d9ff 0%, #dbeafe 40%, #e0e7ff 72%, #cffafe 100%);
}

.num {
  font-variant-numeric: tabular-nums;
}

/* 响应式容器 + 动态环境光球层 */
.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  background: transparent;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}

/* Ambient floating light orbs behind frosted glass layers */
.app-shell::before,
.app-shell::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(48px);
}

.app-shell::before {
  width: 380px;
  height: 380px;
  top: 10px;
  left: -40px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.62) 0%, rgba(124, 58, 237, 0.34) 65%, transparent 100%);
}

.app-shell::after {
  width: 420px;
  height: 420px;
  bottom: 20px;
  right: -50px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.56) 0%, rgba(6, 182, 212, 0.38) 65%, transparent 100%);
}

/* 顶部毛玻璃导航栏 (Frosted Glass AppBar) */
.app-bar {
  background: rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  color: var(--text);
  height: 62px;
  padding: 0 24px;
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 24px -4px rgba(37, 99, 235, 0.08), var(--glass-highlight);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 10;
}

.app-bar-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.app-bar-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #0f172a 0%, #1e40af 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.25;
}

.app-bar-subtitle {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid var(--glass-border-strong);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.06), var(--glass-highlight);
  color: var(--text);
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12), var(--glass-highlight);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.icon-btn-primary {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(99, 102, 241, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #ffffff;
  box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.icon-btn-primary:hover {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.96), rgba(79, 70, 229, 0.96));
  box-shadow: 0 10px 24px -4px rgba(37, 99, 235, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* 主视图与 Tab 页面切换 */
.tab-views {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.tab-page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  padding-bottom: 12px;
}

.tab-page.active {
  display: flex;
}

/* Tab 0: 桌面双栏毛玻璃工作台 */
.inbox-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
  gap: 20px;
  padding: 20px 24px;
  align-items: start;
}

.inbox-primary-col {
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 6px;
}

.section-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--glass-divider);
  background: rgba(255, 255, 255, 0.35);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.section-strip .num {
  font-weight: 500;
  color: var(--muted);
}

.inbox-aside {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ledger-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-amount)) saturate(185%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(185%);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ledger-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-divider);
}

.ledger-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.ledger-meta {
  font-size: 12px;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.status-pos {
  background: var(--pos-tint);
  color: var(--pos-ink);
}

.status-text-pos {
  color: var(--pos);
  font-weight: 600;
}

.ledger-kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--glass-highlight);
  overflow: hidden;
}

.ledger-kpi-cell {
  padding: 14px 16px;
  background: transparent;
}

.ledger-kpi-cell + .ledger-kpi-cell {
  border-left: 1px solid var(--glass-divider);
}

.ledger-kpi-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.ledger-kpi-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.ledger-kpi-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.ledger-quick-bar {
  display: flex;
  gap: 10px;
}

.ledger-quick-bar .btn-secondary {
  flex: 1;
}

.ledger-kv-list {
  display: flex;
  flex-direction: column;
}

.ledger-kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-divider);
  font-size: 13px;
  color: var(--muted);
}

.ledger-kv-row:last-child {
  border-bottom: none;
}

.ledger-kv-row .num {
  color: var(--text);
  font-weight: 600;
}

/* 会话列表项 (Floating Frosted Glass Session Cards) */
.session-list {
  background: transparent;
  padding: 6px 0;
}

.session-item {
  display: flex;
  align-items: center;
  margin: 8px 12px;
  padding: 13px 16px;
  gap: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.64) 0%, rgba(255, 255, 255, 0.36) 100%);
  backdrop-filter: blur(18px) saturate(195%);
  -webkit-backdrop-filter: blur(18px) saturate(195%);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 18px;
  box-shadow: 0 8px 24px -6px rgba(37, 99, 235, 0.14), inset 0 1px 1px rgba(255, 255, 255, 0.96);
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.session-item:last-child {
  margin-bottom: 6px;
}

.session-item.pinned {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.74) 0%, rgba(238, 242, 255, 0.48) 100%);
  border-color: rgba(255, 255, 255, 0.94);
}

.session-item:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.84) 0%, rgba(255, 255, 255, 0.56) 100%);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -6px rgba(37, 99, 235, 0.20), inset 0 1px 1px rgba(255, 255, 255, 0.98);
}

.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.avatar-circle {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(99, 102, 241, 0.22));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--accent-ink);
  border: 1.5px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 14px -4px rgba(37, 99, 235, 0.18), var(--glass-highlight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.35);
  font-variant-numeric: tabular-nums;
}

.session-main {
  flex: 1;
  min-width: 0;
}

.session-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.session-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-official {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(99, 102, 241, 0.18));
  border: 1px solid rgba(37, 99, 235, 0.24);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
}

.session-subtitle {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.session-time {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pin-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-ink);
  background: rgba(37, 99, 235, 0.10);
  border: 1px solid rgba(37, 99, 235, 0.18);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

/* 通用分组列表 (通讯录 / 发现 / 我的) */
.page-inner {
  padding: 16px 24px 24px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.section-header {
  padding: 14px 6px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.card-group {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-amount)) saturate(185%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(185%);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  overflow: hidden;
}

.list-cell {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  gap: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--glass-divider);
  transition: background-color 180ms ease;
}

.list-cell:last-child {
  border-bottom: none;
}

.list-cell:hover {
  background: rgba(255, 255, 255, 0.68);
}

.cell-glyph {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(99, 102, 241, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cell-glyph svg {
  width: 18px;
  height: 18px;
}

.cell-content {
  flex: 1;
  min-width: 0;
}

.cell-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}

.cell-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.cell-action-text {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Tab 4: 我的 & 节点诊断 */
.profile-scroll {
  padding: 20px 24px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.white-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-amount)) saturate(185%);
  -webkit-backdrop-filter: blur(var(--blur-amount)) saturate(185%);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  box-shadow: var(--glass-shadow), var(--glass-highlight);
  padding: 18px 20px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(99, 102, 241, 0.9));
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px -6px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-info {
  min-width: 0;
  flex: 1;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.vip-tag {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.22));
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--warn-ink);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.mono-meta {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.45;
}

/* 钱包卡片：流光蓝紫毛玻璃卡片 (Luminous Sapphire Glass Card) */
.wallet-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.84) 0%, rgba(79, 70, 229, 0.82) 55%, rgba(14, 165, 233, 0.80) 100%);
  backdrop-filter: blur(22px) saturate(190%);
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 22px;
  box-shadow: 0 18px 40px -10px rgba(37, 99, 235, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  padding: 20px;
  color: #ffffff;
}

.wallet-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.86);
}

.wallet-label {
  font-weight: 600;
}

.vip-btn {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 180ms ease, transform 180ms ease;
}

.vip-btn:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: translateY(-1px);
}

.wallet-balance {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 10px 0 16px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 10px rgba(15, 23, 42, 0.16);
}

.wallet-actions {
  display: flex;
  gap: 10px;
}

.wallet-action-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #ffffff;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
}

.wallet-action-btn:hover {
  background: rgba(255, 255, 255, 0.30);
  transform: translateY(-1px);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-divider);
  margin-bottom: 10px;
}

.card-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.endpoint-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-divider);
}

.endpoint-item:last-child {
  border-bottom: none;
}

.ep-check {
  color: var(--pos);
  font-size: 13px;
  font-weight: 700;
  margin-top: 1px;
  flex-shrink: 0;
}

.ep-body {
  flex: 1;
  min-width: 0;
}

.ep-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.ep-detail {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-all;
  line-height: 1.45;
}

.ep-ms {
  font-size: 12px;
  font-weight: 700;
  color: var(--pos);
  flex-shrink: 0;
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}

.timelock-pre {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}

/* 底部悬浮液态玻璃导航栏 (Floating Liquid Glass Dock) */
.bottom-nav {
  height: 64px;
  margin: 0 16px 12px;
  background: rgba(255, 255, 255, 0.64);
  backdrop-filter: blur(var(--blur-strong)) saturate(200%);
  -webkit-backdrop-filter: blur(var(--blur-strong)) saturate(200%);
  border: 1px solid var(--glass-border-strong);
  border-radius: 22px;
  box-shadow: 0 14px 34px -6px rgba(37, 99, 235, 0.14), var(--glass-highlight);
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-shrink: 0;
  z-index: 15;
}

.nav-item {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  transition: color 180ms ease, transform 180ms ease;
}

.nav-item:hover {
  color: var(--text);
}

.nav-pill {
  width: 52px;
  height: 28px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-pill svg {
  width: 18px;
  height: 18px;
}

.nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

.nav-item.active .nav-pill {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(99, 102, 241, 0.22));
  border: 1px solid rgba(37, 99, 235, 0.28);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: var(--primary);
}

/* 聊天详情全屏玻璃视图 (ChatDetailScreen) */
.chat-detail-view {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(59, 130, 246, 0.28) 0%, transparent 45%),
    radial-gradient(circle at 82% 78%, rgba(99, 102, 241, 0.25) 0%, transparent 45%),
    linear-gradient(145deg, #e4eeff 0%, #eef2ff 50%, #e0f2fe 100%);
  z-index: 30;
  display: none;
  flex-direction: column;
}

.chat-detail-view.open {
  display: flex;
}

.chat-appbar-titles {
  flex: 1;
  margin-left: 10px;
  min-width: 0;
}

.chat-appbar-main {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-appbar-sub {
  font-size: 12px;
  color: var(--muted);
}

.group-notice-bar {
  background: rgba(254, 243, 199, 0.68);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--warn-ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.72);
  padding: 9px 24px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.notice-tag {
  background: rgba(217, 119, 6, 0.16);
  border: 1px solid rgba(217, 119, 6, 0.28);
  color: var(--warn-ink);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.chat-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sys-notice-pill {
  align-self: center;
  background: rgba(255, 255, 255, 0.56);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
  color: var(--muted);
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  text-align: center;
}

.msg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.msg-row.me {
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(99, 102, 241, 0.22));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--accent-ink);
  border: 1.5px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.msg-col {
  display: flex;
  flex-direction: column;
  max-width: 72%;
}

.msg-row.me .msg-col {
  align-items: flex-end;
}

.msg-sender-time {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.msg-bubble {
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  color: var(--text);
  border: 1px solid var(--glass-border-strong);
  box-shadow: 0 8px 20px -6px rgba(15, 23, 42, 0.08), var(--glass-highlight);
  padding: 11px 15px;
  border-radius: 18px 18px 18px 6px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.msg-row.me .msg-bubble {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.90), rgba(79, 70, 229, 0.88));
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: 0 10px 24px -6px rgba(37, 99, 235, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  color: #ffffff;
  border-radius: 18px 18px 6px 18px;
}

/* 红包毛玻璃卡片 */
.redpacket-bubble {
  width: 238px;
  padding: 13px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.86), rgba(225, 29, 72, 0.84));
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 12px 26px -6px rgba(225, 29, 72, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.48);
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  transition: transform 180ms ease;
}

.redpacket-bubble:hover {
  transform: translateY(-2px);
}

.redpacket-bubble.claimed {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--glass-border);
  box-shadow: var(--glass-highlight);
  color: var(--muted);
}

.rp-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.48);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.redpacket-bubble.claimed .rp-icon-box {
  background: rgba(239, 68, 68, 0.14);
  color: var(--neg);
}

.rp-text-title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-text-sub {
  font-size: 12px;
  color: inherit;
  opacity: 0.9;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* 底部毛玻璃聊天输入栏 */
.chat-input-bar {
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(22px) saturate(190%);
  -webkit-backdrop-filter: blur(22px) saturate(190%);
  border-top: 1px solid var(--glass-border-strong);
  box-shadow: 0 -6px 24px rgba(37, 99, 235, 0.06), var(--glass-highlight);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-banned-bar {
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--glass-border);
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.chat-text-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border-strong);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  outline: none;
  height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  transition: all 180ms ease;
}

.chat-text-input:focus {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.rp-trigger-btn {
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border-strong);
  box-shadow: var(--glass-highlight);
  color: var(--text);
  height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
}

.rp-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.88);
}

.send-trigger-btn {
  background: linear-gradient(135deg, #2563eb, #6366f1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 6px 16px -2px rgba(37, 99, 235, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  height: 40px;
  padding: 0 18px;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: all 180ms ease;
}

.send-trigger-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -2px rgba(37, 99, 235, 0.45);
}

/* 模态底部抽屉与弹窗 (Frosted Glass BottomSheet / Dialog) */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop.center-dialog {
  align-items: center;
  padding: 20px;
}

.modal-backdrop.show {
  display: flex;
}

.bottom-sheet {
  width: 100%;
  max-width: 640px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(26px) saturate(200%);
  -webkit-backdrop-filter: blur(26px) saturate(200%);
  border-top: 1px solid var(--glass-border-strong);
  border-left: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-lg), var(--glass-highlight);
  border-radius: 26px 26px 0 0;
  padding: 18px 22px 26px;
  max-height: 82%;
  overflow-y: auto;
}

.dialog-box {
  width: 100%;
  max-width: 390px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(26px) saturate(200%);
  -webkit-backdrop-filter: blur(26px) saturate(200%);
  border: 1px solid var(--glass-border-strong);
  box-shadow: var(--glass-shadow-lg), var(--glass-highlight);
  border-radius: 24px;
  padding: 20px 22px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-divider);
  margin-bottom: 10px;
}

.sheet-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--glass-divider);
}

.switch-row:last-child {
  border-bottom: none;
}

.switch-label-main {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.switch-label-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(148, 163, 184, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.7);
  transition: 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 22px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.2);
  transition: 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #2563eb, #6366f1);
  border-color: rgba(255, 255, 255, 0.4);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

/* 表单与按钮 */
.form-field {
  margin-top: 14px;
}

.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-field input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--glass-border-strong);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: all 180ms ease;
}

.form-field input:focus {
  background: rgba(255, 255, 255, 0.94);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  height: 36px;
  padding: 0 12px;
  cursor: pointer;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border-strong);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.06), var(--glass-highlight);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 180ms ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.88);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #6366f1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 6px 18px -4px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  height: 36px;
  padding: 0 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 180ms ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px -4px rgba(37, 99, 235, 0.5);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: 0 6px 16px -4px rgba(220, 38, 38, 0.35);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  height: 36px;
  padding: 0 16px;
  border-radius: 12px;
  cursor: pointer;
}

/* 浮动玻璃 SnackBar 提示条 */
.snackbar-toast {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 84px;
  max-width: 520px;
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.25);
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 80;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* 移动端响应式收拢 (< 768px) */
@media (max-width: 767px) {
  .app-bar {
    padding: 0 16px;
    height: 56px;
  }
  .app-bar-subtitle,
  .btn-label-desktop {
    display: none;
  }
  .inbox-workspace {
    grid-template-columns: 1fr;
    padding: 12px 14px;
    gap: 12px;
  }
  .inbox-aside {
    display: none;
  }
  .page-inner,
  .profile-scroll {
    padding: 12px 14px 20px;
  }
  .bottom-nav {
    margin: 0 12px 10px;
    height: 60px;
  }
  .chat-messages-area,
  .chat-input-bar,
  .group-notice-bar {
    padding-left: 16px;
    padding-right: 16px;
  }
}
