:root {
  --bg: #000000;
  --bg-translucent: rgba(0, 0, 0, 0.78);
  --surface: #16181c;
  --surface-hover: rgba(231, 233, 234, 0.04);
  --surface-strong: #202327;
  --border: #2f3336;
  --text: #e7e9ea;
  --text-muted: #71767b;
  --blue: #1d9bf0;
  --blue-hover: #1a8cd8;
  --blue-soft: rgba(29, 155, 240, 0.14);
  --pink: #f91880;
  --pink-soft: rgba(249, 24, 128, 0.14);
  --green: #00ba7c;
  --green-soft: rgba(0, 186, 124, 0.14);
  --danger: #f4212e;
  --amber: #f59e0b;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bottom-nav-h: 56px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input, textarea, select {
  font-family: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

a {
  color: var(--blue);
  text-decoration: none;
}

.hidden {
  display: none !important;
}

/* ===== App Layout ===== */
.app-shell {
  display: flex;
  justify-content: center;
  min-height: 100vh;
  max-width: 1265px;
  margin: 0 auto;
}

/* Left Rail (Desktop) */
.left-rail {
  display: none;
  width: 260px;
  flex-shrink: 0;
  padding: 0 12px;
}

.left-rail-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px 0 16px;
}

.brand-logo-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 9999px;
  color: var(--text);
  transition: background 0.15s;
  width: fit-content;
}

.brand-logo-btn:hover {
  background: rgba(231, 233, 234, 0.1);
}

.brand-svg {
  width: 28px;
  height: 28px;
}

.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.rail-nav {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rail-item {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px 12px 14px;
  border-radius: 9999px;
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
  transition: background 0.15s;
  width: fit-content;
  position: relative;
}

.rail-item:hover {
  background: rgba(231, 233, 234, 0.1);
}

.rail-item.active {
  font-weight: 700;
}

.rail-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.nav-badge {
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rail-compose-btn {
  margin-top: 18px;
  width: 90%;
  height: 48px;
  border-radius: 9999px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  transition: background 0.15s, transform 0.1s;
}

.rail-compose-btn:hover {
  background: var(--blue-hover);
}

.rail-compose-btn:active {
  transform: scale(0.98);
}

.rail-account {
  margin-top: auto;
  padding-top: 12px;
}

.account-pill {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9999px;
  transition: background 0.15s;
  text-align: left;
}

.account-pill:hover {
  background: rgba(231, 233, 234, 0.08);
}

.account-pill-meta {
  flex: 1;
  min-width: 0;
}

.account-pill-name {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* Main Column */
.main-column {
  width: 100%;
  max-width: 600px;
  min-height: 100vh;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  padding-bottom: calc(var(--bottom-nav-h) + 28px);
}

/* Right Rail (Desktop Wide) */
.right-rail {
  display: none;
  width: 340px;
  flex-shrink: 0;
  padding: 0 18px;
}

.right-rail-inner {
  position: sticky;
  top: 0;
  padding: 12px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.right-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-strong);
  border: 1px solid transparent;
  border-radius: 9999px;
  padding: 10px 16px;
  transition: border-color 0.15s, background 0.15s;
}

.right-search-box:focus-within {
  background: var(--bg);
  border-color: var(--blue);
}

.right-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
}

.search-icon-inline {
  color: var(--text-muted);
  display: flex;
}

.search-icon-inline svg {
  width: 17px;
  height: 17px;
}

.side-card {
  background: var(--surface);
  border: 1px solid rgba(47, 51, 54, 0.7);
  border-radius: 16px;
  padding: 14px 16px;
}

.side-card-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.side-card-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.5;
}

/* ===== Sticky Header & Tabs ===== */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-translucent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.mobile-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 6px;
  height: 50px;
}

.mobile-top-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.mobile-top-center .brand-svg {
  width: 24px;
  height: 24px;
}

.mobile-top-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.desktop-home-header {
  display: none;
  padding: 12px 16px 4px;
}

@media (min-width: 720px) {
  .desktop-home-header {
    display: flex;
    align-items: center;
  }
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  min-height: 53px;
}

.icon-circle-btn {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background 0.15s;
  flex-shrink: 0;
}

.icon-circle-btn:hover {
  background: rgba(231, 233, 234, 0.12);
}

.header-title-wrap {
  min-width: 0;
  flex: 1;
}

.header-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.25;
}

.header-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.tabs-row {
  display: flex;
  width: 100%;
}

.tab-btn {
  flex: 1;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  transition: background 0.15s, color 0.15s;
}

.tab-btn:hover {
  background: rgba(231, 233, 234, 0.06);
}

.tab-btn.active {
  color: var(--text);
  font-weight: 700;
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 56px;
  height: 3.5px;
  border-radius: 9999px;
  background: var(--blue);
}

/* ===== Avatar & Verified Blue Badge ===== */
.avatar {
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  user-select: none;
  background-size: cover;
  background-position: center;
}

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

.avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.avatar-md { width: 40px; height: 40px; font-size: 16px; }
.avatar-lg { width: 46px; height: 46px; font-size: 18px; }
.avatar-xl { width: 82px; height: 82px; font-size: 30px; border: 4px solid var(--bg); }

.blue-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -2px;
  flex-shrink: 0;
}

.blue-badge svg {
  width: 17px;
  height: 17px;
}

.role-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}

.role-chip.l1 {
  color: #60a5fa;
  border-color: rgba(29, 155, 240, 0.45);
  background: rgba(29, 155, 240, 0.12);
}

.role-chip.l2 {
  color: var(--blue);
  border-color: rgba(29, 155, 240, 0.4);
  background: rgba(29, 155, 240, 0.1);
}

.role-chip.l3 {
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.role-chip.l4 {
  color: var(--text-muted);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
}

/* ===== Guest Upgrade Slim Banner ===== */
.guest-notice-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(29, 155, 240, 0.09) 0%, rgba(29, 155, 240, 0.02) 100%);
  font-size: 13px;
}

.guest-notice-text {
  color: #cfd9de;
  line-height: 1.4;
}

.guest-notice-btn {
  padding: 6px 13px;
  border-radius: 9999px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== Inline Composer (Desktop) ===== */
.inline-composer {
  display: none;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

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

.composer-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-size: 18px;
  line-height: 1.45;
  color: var(--text);
  min-height: 58px;
}

.composer-textarea::placeholder {
  color: var(--text-muted);
}

.composer-preview-wrap {
  position: relative;
  margin-top: 8px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  max-height: 280px;
}

.composer-preview-wrap img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

.composer-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(47, 51, 54, 0.6);
}

.composer-tools-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.composer-tool-btn {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.composer-tool-btn:hover {
  background: var(--blue-soft);
}

.composer-tools-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.char-count {
  font-size: 12px;
  color: var(--text-muted);
}

.char-count.warn {
  color: var(--amber);
}

.char-count.over {
  color: var(--danger);
}

/* ===== Buttons ===== */
.btn-primary {
  padding: 8px 18px;
  border-radius: 9999px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary:hover {
  background: var(--blue-hover);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-white {
  padding: 7px 16px;
  border-radius: 9999px;
  background: #eff3f4;
  color: #0f1419;
  font-size: 14px;
  font-weight: 700;
  transition: background 0.15s;
}

.btn-white:hover {
  background: #d7dbdc;
}

.btn-outline {
  padding: 7px 16px;
  border-radius: 9999px;
  border: 1px solid #536471;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s;
}

.btn-outline:hover {
  background: rgba(231, 233, 234, 0.1);
}

.btn-danger-outline {
  padding: 6px 13px;
  border-radius: 9999px;
  border: 1px solid rgba(244, 33, 46, 0.5);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.btn-danger-outline:hover {
  background: rgba(244, 33, 46, 0.12);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
}

/* ===== Post Card (Pure OLED Twitter Style) ===== */
.post-card {
  display: flex;
  gap: 11px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
  cursor: pointer;
}

.post-card:hover {
  background: var(--surface-hover);
}

.post-card.is-detail {
  cursor: default;
  flex-direction: column;
  gap: 12px;
}

.post-card.is-detail:hover {
  background: transparent;
}

.post-pinned-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: -2px 0 6px 32px;
}

.post-repost-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 6px;
}

.post-avatar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.thread-line {
  width: 2px;
  flex: 1;
  background: var(--border);
  margin-top: 6px;
  min-height: 16px;
  border-radius: 2px;
}

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

.post-header-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
}

.post-author-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-author-name:hover {
  text-decoration: underline;
}

.post-handle-time {
  color: var(--text-muted);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-more-btn {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  color: var(--text-muted);
  opacity: 0.65;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s, opacity 0.15s;
}

.post-more-btn svg {
  width: 15px;
  height: 15px;
}

.post-more-btn:hover {
  opacity: 1;
  color: var(--danger);
  background: rgba(244, 33, 46, 0.12);
}

.post-text {
  margin: 3px 0 0;
  font-size: 15px;
  line-height: 1.48;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.post-card.is-detail .post-text {
  font-size: 17px;
  line-height: 1.55;
}

.hashtag {
  color: var(--blue);
  cursor: pointer;
}

.hashtag:hover {
  text-decoration: underline;
}

.post-media {
  margin-top: 10px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0b0d10;
}

.post-media img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  display: block;
}

.quote-box {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 12px;
  transition: background 0.15s;
}

.quote-box:hover {
  background: rgba(255, 255, 255, 0.03);
}

.quote-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 4px;
}

.quote-text {
  font-size: 14px;
  color: var(--text);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Action Bar */
.post-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 420px;
  margin-top: 8px;
  margin-left: -7px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 13px;
  padding: 4px 7px;
  border-radius: 9999px;
  transition: color 0.15s, background 0.15s;
}

.action-btn svg {
  width: 18px;
  height: 18px;
}

.action-btn.reply:hover { color: var(--blue); background: var(--blue-soft); }
.action-btn.repost:hover, .action-btn.repost.active { color: var(--green); }
.action-btn.repost:hover { background: var(--green-soft); }
.action-btn.like:hover, .action-btn.like.active { color: var(--pink); }
.action-btn.like:hover { background: var(--pink-soft); }
.action-btn.bookmark:hover, .action-btn.bookmark.active { color: var(--blue); }
.action-btn.bookmark:hover { background: var(--blue-soft); }
.action-btn.share:hover { color: var(--blue); background: var(--blue-soft); }

/* Detail timestamp & metrics */
.detail-meta-time {
  color: var(--text-muted);
  font-size: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.detail-metrics {
  display: flex;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}

.detail-metrics strong {
  color: var(--text);
  margin-right: 4px;
}

/* Reply Box inside Detail */
.reply-inline-bar {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.reply-inline-bar textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-size: 15px;
  min-height: 36px;
  padding-top: 6px;
}

/* ===== Profile Page (Faithful to Mockup B Right Screen) ===== */
.profile-banner {
  height: 142px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.profile-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 75% 25%, rgba(29, 155, 240, 0.22), transparent 58%);
}

.profile-body {
  padding: 0 16px 14px;
}

.profile-avatar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: -42px;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}

.profile-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
}

.profile-name {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-handle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 1px;
}

.profile-bio {
  margin: 10px 0 8px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text);
}

.profile-tags-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.profile-stats {
  display: flex;
  gap: 18px;
  font-size: 14px;
  color: var(--text-muted);
}

.profile-stats strong {
  color: var(--text);
  margin-right: 3px;
}

/* ===== Blue-Badge Admins Directory & Admin Console ===== */
.section-intro {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.section-intro h2 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 7px;
}

.section-intro h2 svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.section-intro p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

.admin-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}

.admin-row:hover {
  background: var(--surface-hover);
}

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

.admin-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-name-line {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 15px;
  min-width: 0;
}

.admin-wechat-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.wechat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 9999px;
  font-size: 12.5px;
  color: var(--text);
}

.wechat-pill code {
  color: #7dd3fc;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.app-card {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

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

.app-meta-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  margin: 8px 0 10px;
}

.app-meta-box div + div {
  margin-top: 4px;
}

.app-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-input {
  flex: 1;
  min-width: 160px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 7px 12px;
  font-size: 13px;
  outline: none;
}

.inline-input:focus {
  border-color: var(--blue);
}

/* Search & Explore */
.search-header-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
}

.search-pill-input {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-strong);
  border: 1px solid transparent;
  border-radius: 9999px;
  padding: 9px 14px;
}

.search-pill-input:focus-within {
  background: var(--bg);
  border-color: var(--blue);
}

.search-pill-input input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14.5px;
}

.topic-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.topic-chip {
  padding: 6px 12px;
  border-radius: 9999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.15s, color 0.15s;
}

.topic-chip:hover, .topic-chip.active {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-soft);
}

/* Notifications */
.notif-row {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.notif-row.unread {
  background: rgba(29, 155, 240, 0.06);
}

.notif-row:hover {
  background: var(--surface-hover);
}

/* Demo Quick Switcher */
.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.demo-acct-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.demo-acct-btn:hover {
  border-color: var(--blue);
  background: rgba(29, 155, 240, 0.08);
}

.demo-acct-btn strong {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.demo-acct-btn span {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ===== Mobile FAB & Bottom Navigation ===== */
.mobile-fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--bottom-nav-h) + 18px + env(safe-area-inset-bottom, 0px));
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(29, 155, 240, 0.42);
  z-index: 30;
  transition: transform 0.12s, background 0.15s;
}

.mobile-fab:hover {
  background: var(--blue-hover);
}

.mobile-fab:active {
  transform: scale(0.93);
}

.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 30;
}

.bottom-tab {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  position: relative;
}

.bottom-tab.active {
  color: var(--text);
}

.bottom-tab .tab-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.tab-dot {
  position: absolute;
  top: 12px;
  right: calc(50% - 16px);
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background: var(--blue);
}

/* ===== Modals ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(91, 112, 131, 0.42);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 14px 20px;
  overflow-y: auto;
}

.modal-container {
  width: 100%;
  max-width: 520px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
}

.modal-body {
  padding: 16px;
}

.form-field {
  margin-bottom: 14px;
}

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

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--blue);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

.form-error {
  color: var(--danger);
  font-size: 13px;
  margin: 8px 0 0;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  object-fit: contain;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 18px;
}

/* Empty & Loading */
.empty-state {
  padding: 52px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state h3 {
  color: var(--text);
  margin: 0 0 6px;
  font-size: 17px;
}

.empty-state p {
  margin: 0 0 16px;
  font-size: 14px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav-h) + 22px);
  transform: translateX(-50%);
  background: var(--blue);
  color: #fff;
  padding: 10px 18px;
  border-radius: 9999px;
  font-size: 13.5px;
  font-weight: 600;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  max-width: 90vw;
  text-align: center;
}

/* ===== Visual Interactive Trust Tree (True Top-Down SVG Node Graph) ===== */
.trust-tree-wrap {
  padding: 14px 16px 24px;
}

.trust-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.trust-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 9999px;
  display: inline-block;
}

.trust-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 3px 6px;
}

.trust-zoom-btn {
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  transition: background 0.15s;
}

.trust-zoom-btn:hover {
  background: rgba(231, 233, 234, 0.12);
}

.view-mode-switch {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 3px;
  gap: 2px;
}

.view-mode-btn {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.view-mode-btn.active {
  background: var(--text);
  color: #000;
}

.tier-list-group {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #0a0c10;
}

.tier-list-heading {
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.tier-list-heading span {
  font-weight: 400;
  margin-left: 4px;
}

.tier-list-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(47, 51, 54, 0.55);
  transition: background 0.12s;
}

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

.tier-list-row:not(:disabled):hover {
  background: var(--surface-hover);
}

.tier-list-row.is-red {
  background: rgba(244, 33, 46, 0.07);
}

.tier-list-row.is-selected {
  background: rgba(244, 33, 46, 0.16);
  box-shadow: inset 3px 0 0 var(--danger);
}

.trust-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trust-workspace.is-fullscreen {
  position: fixed;
  inset: 14px;
  z-index: 120;
  background: #050608;
  border: 1px solid #3f464d;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.95);
  overflow: hidden;
  gap: 0;
}

.trust-workspace-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trust-workspace.is-fullscreen .trust-workspace-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 0;
}

.trust-pane-tree {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.trust-workspace.is-fullscreen .trust-pane-tree {
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.trust-pane-detail {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trust-workspace.is-fullscreen .trust-pane-detail {
  overflow-y: auto;
  padding: 16px;
  background: #0a0c10;
}

.trust-canvas-shell {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--border);
  background-color: #050608;
  background-image: radial-gradient(rgba(113, 118, 123, 0.28) 1px, transparent 1px);
  background-size: 20px 20px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 440px;
}

.trust-workspace.is-fullscreen .trust-canvas-shell {
  flex: 1;
  max-height: none;
  border: none;
  border-radius: 0;
}

@media (max-width: 900px) {
  .trust-workspace.is-fullscreen .trust-workspace-body {
    grid-template-columns: 1fr;
    grid-template-rows: 46% 54%;
  }

  .trust-workspace.is-fullscreen .trust-pane-tree {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

.trust-fullscreen-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  background: rgba(10, 12, 16, 0.96);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.synced-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
}

.trust-stage-scroll {
  display: flex;
  justify-content: center;
  min-width: fit-content;
  padding: 6px;
}

.trust-stage {
  position: relative;
  transform-origin: top center;
}

.trust-edges-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.tree-edge-path {
  fill: none;
  stroke: #333940;
  stroke-width: 2;
  transition: stroke 0.2s, stroke-width 0.2s, opacity 0.2s;
}

.tree-edge-path.is-dimmed {
  opacity: 0.25;
}

.tree-edge-path.is-flagged {
  stroke: rgba(244, 33, 46, 0.72);
  stroke-width: 2.2;
}

.tree-edge-path.is-impacted {
  stroke: var(--danger);
  stroke-width: 2.6;
  stroke-dasharray: 6 4;
  animation: edgeFlow 1.1s linear infinite;
}

@keyframes edgeFlow {
  from { stroke-dashoffset: 20; }
  to { stroke-dashoffset: 0; }
}

.tree-tier-label {
  position: absolute;
  left: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(113, 118, 123, 0.72);
  background: rgba(5, 6, 8, 0.85);
  padding: 2px 6px;
  border-radius: 6px;
  pointer-events: none;
}

.graph-node {
  position: absolute;
  border-radius: 14px;
  background: #101216;
  border: 1.5px solid #2f3336;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, opacity 0.18s, transform 0.12s;
}

.graph-node:hover {
  border-color: #5b6570;
  background: #16191f;
  transform: translateY(-1px);
}

.graph-node.is-root {
  border-color: #536471;
  background: #14171c;
  cursor: default;
}

.graph-node.is-root:hover {
  transform: none;
}

.graph-node.is-dimmed {
  opacity: 0.32;
}

.graph-node.is-flagged {
  border-color: rgba(244, 33, 46, 0.72);
  background: rgba(244, 33, 46, 0.09);
}

.graph-node.is-selected {
  border-color: var(--danger);
  background: rgba(244, 33, 46, 0.16);
  box-shadow: 0 0 0 2.5px rgba(244, 33, 46, 0.3), 0 8px 24px rgba(244, 33, 46, 0.22);
  opacity: 1;
}

.graph-node.is-impacted:not(.is-selected) {
  border-color: rgba(244, 33, 46, 0.8);
  background: rgba(244, 33, 46, 0.1);
  opacity: 1;
}

.graph-node.is-frozen {
  border-style: dashed;
  border-color: rgba(244, 33, 46, 0.75);
}

.graph-node-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.graph-node-name-wrap {
  flex: 1;
  min-width: 0;
}

.graph-node-name {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.graph-node-handle {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.graph-node-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: 4px;
}

.graph-collapse-btn {
  position: absolute;
  left: 50%;
  bottom: -11px;
  transform: translateX(-50%);
  height: 20px;
  padding: 0 7px;
  border-radius: 9999px;
  background: #1b2028;
  border: 1px solid #3c444d;
  color: #cfd9de;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  white-space: nowrap;
}

.graph-collapse-btn:hover {
  border-color: var(--blue);
  color: #fff;
}

.orphan-shelf {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.orphan-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.orphan-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 12.5px;
}

.orphan-chip.is-selected {
  border-color: var(--danger);
  background: rgba(244, 33, 46, 0.14);
}

.impact-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
  padding: 1px 6px;
  border-radius: 9999px;
  white-space: nowrap;
}

.frozen-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--danger);
  background: rgba(244, 33, 46, 0.14);
  border: 1px solid rgba(244, 33, 46, 0.45);
  padding: 1px 6px;
  border-radius: 9999px;
  white-space: nowrap;
}

.warned-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.45);
  padding: 1px 6px;
  border-radius: 9999px;
  white-space: nowrap;
}

.extreme-drawer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(244, 33, 46, 0.35);
}

.extreme-drawer summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-muted);
  user-select: none;
}

.extreme-drawer summary:hover {
  color: var(--danger);
}

.branch-control-panel {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(244, 33, 46, 0.11) 0%, var(--surface) 100%);
  border: 1px solid rgba(244, 33, 46, 0.5);
}

.branch-control-panel.is-neutral {
  background: var(--surface);
  border-color: var(--border);
}

.branch-impact-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}

.impact-pill {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 9999px;
  background: rgba(244, 33, 46, 0.16);
  border: 1px solid rgba(244, 33, 46, 0.45);
  color: #fecdd3;
}

.branch-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.btn-danger-solid {
  padding: 7px 14px;
  border-radius: 9999px;
  background: var(--danger);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: opacity 0.15s;
}

.btn-danger-solid:hover {
  opacity: 0.9;
}

.btn-amber-outline {
  padding: 7px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.08);
  font-size: 13px;
  font-weight: 700;
}

.btn-amber-outline:hover {
  background: rgba(245, 158, 11, 0.16);
}

.btn-green-outline {
  padding: 7px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(0, 186, 124, 0.55);
  color: var(--green);
  background: rgba(0, 186, 124, 0.08);
  font-size: 13px;
  font-weight: 700;
}

.btn-green-outline:hover {
  background: rgba(0, 186, 124, 0.16);
}

/* Audit Logs */
.audit-row {
  display: flex;
  gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.audit-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid var(--border);
}

.audit-badge.approve { color: var(--green); border-color: rgba(0, 186, 124, 0.45); background: rgba(0, 186, 124, 0.1); }
.audit-badge.danger { color: var(--danger); border-color: rgba(244, 33, 46, 0.45); background: rgba(244, 33, 46, 0.1); }
.audit-badge.warn { color: #fbbf24; border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.1); }
.audit-badge.info { color: var(--blue); border-color: rgba(29, 155, 240, 0.45); background: rgba(29, 155, 240, 0.1); }

.verify-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px 12px;
}

/* ===== WeChat 5-Digit Code Verification Card & Modal ===== */
.wx-verify-banner {
  margin: 14px 16px 4px;
  padding: 15px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0, 186, 124, 0.14) 0%, rgba(29, 155, 240, 0.08) 100%);
  border: 1px solid rgba(0, 186, 124, 0.42);
}

.wx-verify-banner h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 7px;
}

.wx-verify-banner p {
  margin: 0 0 12px;
  font-size: 13px;
  color: #cfd9de;
  line-height: 1.55;
}

.wx-code-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px 0;
  padding: 18px 14px;
  border-radius: 14px;
  background: #0a0c10;
  border: 1px dashed rgba(0, 186, 124, 0.65);
}

.wx-code-digits {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: #34d399;
  padding-left: 0.28em;
}

.wx-verified-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #34d399;
  background: rgba(0, 186, 124, 0.14);
  border: 1px solid rgba(0, 186, 124, 0.45);
  padding: 2px 9px;
  border-radius: 9999px;
}

.wx-config-card {
  margin: 12px 16px 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
}

.wx-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  margin-top: 6px;
  border-radius: 10px;
  background: #090b0f;
  border: 1px solid rgba(47, 51, 54, 0.8);
}

.wx-config-row code {
  color: #7dd3fc;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Responsive Breakpoints ===== */
@media (min-width: 720px) {
  .left-rail {
    display: block;
  }

  .main-column {
    border-left-color: var(--border);
    border-right-color: var(--border);
    padding-bottom: 48px;
  }

  .mobile-top-bar,
  .mobile-bottom-nav,
  .mobile-fab {
    display: none !important;
  }

  .inline-composer {
    display: flex;
  }

  .toast {
    bottom: 28px;
  }
}

@media (min-width: 1060px) {
  .right-rail {
    display: block;
  }
}

@media (max-width: 719px) {
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-container {
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    max-height: 92vh;
    overflow-y: auto;
  }
}
