* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  color: #ffffff;
  background:
    radial-gradient(circle at 12% 20%, rgba(44, 92, 180, 0.35) 0%, rgba(44, 92, 180, 0.08) 18%, rgba(0, 0, 0, 0) 42%),
    radial-gradient(circle at 88% 88%, rgba(18, 113, 163, 0.32) 0%, rgba(18, 113, 163, 0.08) 18%, rgba(0, 0, 0, 0) 40%),
    linear-gradient(90deg, #020814 0%, #04101d 30%, #03111c 50%, #04101d 70%, #03131e 100%);
}

body {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(8, 18, 34, 0.88);
  border: 1px solid rgba(58, 90, 138, 0.35);
  border-radius: 24px;
  padding: 34px 28px 26px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
}

.auth-title {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 10px;
}

.auth-sub {
  text-align: center;
  font-size: 14px;
  color: #9db2d1;
  margin-bottom: 24px;
}

.hint {
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
  color: #8da3c5;
  margin-top: 16px;
}

.input,
.textarea {
  width: 100%;
  border: 1px solid #21324a;
  background: rgba(8, 16, 28, 0.9);
  color: #ffffff;
  border-radius: 14px;
  outline: none;
}

.input {
  height: 46px;
  padding: 0 14px;
  font-size: 14px;
}

.textarea {
  min-height: 110px;
  padding: 12px 14px;
  font-size: 14px;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: #6f86a8;
}

.input:focus,
.textarea:focus {
  border-color: #4878dd;
  box-shadow: 0 0 0 1px rgba(72, 120, 221, 0.25);
}

.btn {
  border: none;
  border-radius: 14px;
  min-height: 42px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(180deg, #4d85ff 0%, #356be6 100%);
  cursor: pointer;
  transition: 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.secondary {
  color: #dce8ff;
  background: linear-gradient(180deg, #1a2d4d 0%, #14253f 100%);
  border: 1px solid rgba(88, 128, 196, 0.28);
}

.btn.green {
  background: linear-gradient(180deg, #1f7e48 0%, #17673a 100%);
}

.auth-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 14px;
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 355px;
  min-width: 355px;
  max-width: 355px;
  padding: 16px 14px 12px;
  border-right: 1px solid rgba(58, 90, 138, 0.22);
  background: rgba(5, 14, 28, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.sidebar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sidebar-block {
  border: 1px solid rgba(52, 77, 117, 0.35);
  background: rgba(4, 12, 24, 0.58);
  border-radius: 20px;
  padding: 12px;
}

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #95abd0;
  margin-bottom: 10px;
}

.me-block {
  font-size: 13px;
  color: #a8bddc;
}

.small-text {
  font-size: 13px;
  color: #a8bddc;
}

.online-info {
  margin-top: 4px;
}

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

.small-copy-btn {
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
  white-space: nowrap;
}

.chat-list {
  display: flex;
  flex-direction: column;
}

.add-uin-block {
  margin-bottom: 12px;
}

.add-uin-title {
  font-size: 12px;
  color: #8da3c5;
  margin-bottom: 8px;
}

.chat-item-wrap {
  margin-bottom: 10px;
}

.chat-item {
  width: 100%;
  border: 1px solid rgba(32, 55, 90, 0.55);
  background: rgba(5, 18, 38, 0.78);
  border-radius: 16px;
  padding: 12px 12px 10px;
  color: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: 0.15s ease;
  display: block;
}

.chat-item:hover {
  background: rgba(9, 24, 48, 0.92);
  border-color: rgba(56, 95, 160, 0.5);
  transform: translateY(-1px);
}

.chat-item-wrap.active .chat-item {
  border-color: rgba(76, 125, 220, 0.8);
  box-shadow: 0 0 0 1px rgba(76, 125, 220, 0.35);
  background: rgba(10, 28, 58, 0.95);
}

.chat-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.chat-item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.chat-item-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-actions-inline {
  margin-left: 2px;
  font-size: 11px;
  opacity: 0.78;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-action {
  cursor: pointer;
  transition: 0.15s ease;
  color: #97afd5;
}

.admin-action:hover {
  opacity: 1;
  text-decoration: underline;
}

.admin-action.danger {
  color: #ff8b8b;
}

.chat-item-last {
  margin-top: 6px;
  font-size: 13px;
  color: #8da3c5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.new-badge {
  width: 9px;
  min-width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4d85ff;
  box-shadow: 0 0 10px rgba(77, 133, 255, 0.9);
  margin-top: 4px;
}

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

.small-btn {
  min-width: 42px;
  width: 42px;
  padding: 0;
}

.mini-btn {
  border: 1px solid rgba(88, 128, 196, 0.28);
  background: linear-gradient(180deg, #1a2d4d 0%, #14253f 100%);
  color: #dce8ff;
  border-radius: 12px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
}

.mini-btn:hover {
  transform: translateY(-1px);
}

.chat-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.chat-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7f98bc;
  font-size: 28px;
  text-align: center;
  padding: 40px;
}

.chat-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 12px;
}

.chat-header {
  border: 1px solid rgba(52, 77, 117, 0.35);
  background: rgba(6, 16, 31, 0.55);
  border-radius: 20px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.chat-header-left {
  min-width: 0;
}

.chat-header-right {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chat-title {
  font-size: 20px;
  font-weight: 800;
}

.chat-sub,
.typing-line {
  color: #89a2c5;
  font-size: 13px;
  margin-top: 4px;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid rgba(52, 77, 117, 0.35);
  background: rgba(4, 12, 24, 0.48);
  border-radius: 20px;
  padding: 14px;
}

.msg-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 12px;
}

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

.msg {
  width: min(760px, 100%);
  background: rgba(8, 22, 42, 0.95);
  border: 1px solid rgba(43, 69, 109, 0.5);
  border-radius: 18px;
  padding: 12px 14px 10px;
  cursor: pointer;
}

.msg.mine {
  background: rgba(15, 40, 82, 0.96);
  border-color: rgba(73, 111, 179, 0.65);
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 12px;
  color: #96acd0;
}

.user-link {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  color: #dce8ff;
  font-weight: 700;
  cursor: pointer;
}

.msg-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  color: #ffffff;
}

.msg-status {
  margin-top: 8px;
  font-size: 12px;
  color: #86a0c4;
  text-align: right;
}

.reply-preview,
.reply-box {
  border-left: 3px solid #4d85ff;
  background: rgba(18, 32, 54, 0.7);
  border-radius: 12px;
}

.reply-preview {
  margin-bottom: 8px;
  padding: 8px 10px;
  color: #cfe0ff;
  font-size: 13px;
}

.reply-author {
  font-weight: 700;
  margin-bottom: 4px;
}

.reply-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.reply-box-text {
  font-size: 13px;
  color: #cfe0ff;
}

.reply-close {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border: none;
  border-radius: 10px;
  background: #1e2f49;
  color: #ffffff;
  cursor: pointer;
}

.emoji-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(52, 77, 117, 0.35);
  background: rgba(6, 16, 31, 0.65);
  border-radius: 16px;
}

.emoji-btn,
.icon-btn,
.send-btn,
.delete-btn {
  cursor: pointer;
}

.emoji-btn {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(52, 77, 117, 0.35);
  background: rgba(12, 25, 43, 0.92);
  color: #fff;
  border-radius: 12px;
  font-size: 18px;
}

.composer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 1px solid rgba(52, 77, 117, 0.35);
  background: rgba(12, 25, 43, 0.92);
  color: #fff;
  border-radius: 12px;
  font-size: 18px;
}

.composer-input {
  flex: 1;
}

.send-btn {
  width: 46px;
  min-width: 46px;
  height: 46px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #4d85ff 0%, #356be6 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.file-line {
  font-size: 13px;
  color: #89a2c5;
  min-height: 18px;
}

.file-link {
  color: #9cc0ff;
  text-decoration: none;
}

.file-link:hover {
  text-decoration: underline;
}

.delete-btn {
  border: none;
  background: transparent;
  color: #ff9e9e;
  font-size: 12px;
  font-weight: 700;
  padding: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  background: #0a1527;
  border: 1px solid rgba(52, 77, 117, 0.45);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

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

.profile-line {
  margin-bottom: 14px;
  color: #d8e5ff;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.mobile-back-btn {
  display: none;
}

@media (max-width: 860px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 0;
    max-width: none;
    border-right: none;
    border-bottom: 1px solid rgba(58, 90, 138, 0.22);
  }

  .chat-panel {
    min-height: calc(100vh - 360px);
  }

  .chat-empty {
    font-size: 22px;
    padding: 28px;
  }

  .mobile-back-btn {
    display: inline-flex;
  }

  .chat-item-wrap {
    margin-bottom: 8px;
  }

  .admin-actions-inline {
    font-size: 10px;
    gap: 6px;
  }
}

@media (max-width: 640px) {
  .auth-page {
    padding: 18px;
  }

  .auth-card {
    padding: 28px 20px 22px;
    border-radius: 20px;
  }

  .auth-title {
    font-size: 25px;
  }

  .auth-actions {
    flex-direction: column;
  }

  .sidebar {
    padding: 12px;
  }

  .sidebar-header {
    flex-direction: column;
    align-items: stretch;
  }

  .sidebar-actions {
    justify-content: flex-start;
  }

  .chat-wrap {
    padding: 12px;
  }

  .chat-header {
    flex-direction: column;
  }

  .composer {
    gap: 8px;
  }

  .my-uin-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
