* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #f5f5f5;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  line-height: 1.5;
}

.auth-container {
  height: 100vh !important;
  min-height: 0 !important;
  padding: 0 !important;
  display: flex !important;
  background: #f5f5f5 !important;
}

.wechat-chat {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f5f5f5;
  overflow: hidden;
}

/* 顶部导航栏 */
.wechat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  height: 56px;
  min-height: 56px;
  background: #f8f8f8;
  border-bottom: 1px solid #e5e5e5;
  flex-shrink: 0;
}

.wechat-header-left,
.wechat-header-right {
  width: 50px;
  flex-shrink: 0;
}

.wechat-header-right {
  text-align: right;
}

.wechat-back {
  display: flex;
  align-items: center;
  color: #1a1a1a;
}

.wechat-header-title {
  text-align: center;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wechat-header-title h1 {
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wechat-header-title span {
  font-size: 12px;
  color: #999;
}

.wechat-time {
  font-size: 13px;
  color: #1a1a1a;
}

/* 中间：邮箱输入区域（居中） */
.wechat-email-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.wechat-email-card {
  width: 100%;
  max-width: 340px;
  padding: 32px 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.wechat-email-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: #f0f0f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #07c160;
}

.wechat-email-title {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.wechat-email-desc {
  font-size: 14px;
  color: #999;
  margin-bottom: 24px;
}

.wechat-email-form {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.wechat-email-input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  background: #fafafa;
}

.wechat-email-input:focus {
  border-color: #07c160;
  background: #fff;
}

.wechat-email-btn {
  padding: 12px 24px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.wechat-email-btn:active {
  background: #06ad56;
}

.wechat-email-hint {
  font-size: 12px;
  color: #999;
}

.wechat-email-error {
  font-size: 13px;
  color: #fa5151;
  background: #ffefef;
  padding: 10px 12px;
  border-radius: 6px;
  margin-top: 12px;
}

/* 消息区域 */
.wechat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  background: #f5f5f5;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.wechat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.wechat-welcome-icon {
  width: 80px;
  height: 80px;
  background: #e8e8e8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
}

.wechat-welcome-text {
  font-size: 15px;
  color: #666;
  line-height: 1.6;
  margin-top: 20px;
  max-width: 280px;
}

/* 时间分隔线 */
.wechat-time-divider {
  text-align: center;
  margin: 16px 0;
}

.wechat-time-divider span {
  display: inline-block;
  padding: 4px 12px;
  background: #dadada;
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
}

/* 消息气泡 */
.wechat-message {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 0 4px;
}

.wechat-message.self {
  flex-direction: row-reverse;
}

.wechat-avatar {
  width: 40px;
  height: 40px;
  background: #07c160;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
  overflow: hidden;
}

.wechat-avatar.self {
  background: #576b95;
}

.wechat-avatar.has-image {
  background: transparent;
  padding: 0;
}

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

.wechat-bubble-wrap {
  max-width: 70%;
  margin: 0 12px;
}

.wechat-bubble {
  padding: 10px 14px;
  background: #fff;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.5;
  color: #1a1a1a;
  position: relative;
  word-break: break-word;
}

.wechat-bubble::after {
  content: '';
  position: absolute;
  top: 14px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
}

.wechat-bubble:not(.self)::after {
  left: -10px;
  border-right-color: #fff;
}

.wechat-bubble.self {
  background: #95ec69;
}

.wechat-bubble.self::after {
  right: -10px;
  border-left-color: #95ec69;
}

.wechat-bubble.media {
  padding: 0;
  background: transparent;
}

.wechat-bubble.media::after {
  display: none;
}

.wechat-image {
  display: block;
  max-width: 220px;
  border-radius: 10px;
}

/* 输入区域 */
.wechat-input-area {
  background: #f8f8f8;
  border-top: 1px solid #e5e5e5;
  flex-shrink: 0;
}

.wechat-input-toolbar {
  display: flex;
  padding: 8px 12px;
  gap: 12px;
  border-bottom: 1px solid #e5e5e5;
}

.wechat-tool-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wechat-tool-btn.active {
  color: #07c160;
}

.wechat-tool-btn:active {
  color: #666;
}

.wechat-emoji-panel {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  padding: 10px 12px;
  background: #f8f8f8;
  border-bottom: 1px solid #e5e5e5;
  max-height: 180px;
  overflow-y: auto;
}

.wechat-emoji-btn {
  border: none;
  background: #fff;
  border-radius: 10px;
  padding: 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  font-size: 20px;
}

.wechat-input-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 16px;
}

.wechat-input-wrap {
  flex: 1;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #e5e5e5;
  max-height: 100px;
  overflow-y: auto;
}

.wechat-input-wrap textarea {
  width: 100%;
  padding: 10px 12px;
  border: none;
  font-size: 15px;
  line-height: 1.5;
  resize: none;
  outline: none;
  background: transparent;
  max-height: 80px;
}

.wechat-send-btn {
  width: 40px;
  height: 40px;
  background: #07c160;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wechat-send-btn:disabled {
  background: #b7b7b7;
  cursor: not-allowed;
}

.wechat-send-btn:active:not(:disabled) {
  background: #06ad56;
}

.wechat-change-btn {
  display: block;
  margin: 0 16px 12px;
  padding: 10px;
  background: #fff;
  color: #999;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}

/* 滚动条 */
.wechat-messages::-webkit-scrollbar {
  width: 4px;
}

.wechat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.wechat-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

/* 响应式 */
@media (max-width: 480px) {
  .wechat-chat {
    max-width: 100vw;
  }

  .wechat-bubble-wrap {
    max-width: 75%;
  }

  .wechat-email-card {
    max-width: 100%;
    padding: 24px 20px;
  }

  .wechat-emoji-panel {
    grid-template-columns: repeat(4, 1fr);
  }
}
