html {
  overflow: hidden;
}

body {
  margin: 0;
  font-family: '微软雅黑', Arial, sans-serif;
  background: #f6f7fb;
  color: #222;
}

/* IE 兼容性提示条 */
.ie-warning {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 2000;
  padding: 10px 16px;
  background: #fff3cd;
  color: #856404;
  border-bottom: 1px solid #ffeeba;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.ie-warning a {
  color: #155724;
  text-decoration: underline;
}

.ie-warning-close {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #856404;
}

.ie-warning-close:focus {
  outline: 2px solid rgba(133, 100, 4, 0.12);
}

/* 当提示条显示时，为避免遮挡页面内容，给 body 顶部增加等高的内边距（在 JS 中会动态添加 .ie-warning-shown） */
.ie-warning-shown body {
  padding-top: 48px;
}

/* IE10 兼容性：为旧版 -ms- flexbox 添加前缀和退化支持 */
/* 这部分为 IE10 添加 -ms- 前缀，尽量保留现有布局（仅在需要时启用） */
.ie10 .container,
.ie10 .history-list,
.ie10 .main,
.ie10 .chat-body {
  display: -ms-flexbox !important;
  display: flex !important;
}

.ie10 .container {
  -ms-flex-direction: row;
  flex-direction: row;
}

.ie10 .container.column {
  -ms-flex-direction: column;
  flex-direction: column;
}

.ie10 .history-list {
  -ms-flex-direction: column;
  flex-direction: column;
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
}

.ie10 .history-panel {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-direction: column;
  flex-direction: column;
}

.ie10 .main {
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
  -ms-flex-direction: column;
  flex-direction: column;
}

.ie10 .chat-body {
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
  -ms-flex-direction: column;
  flex-direction: column;
}

.ie10 .message-row {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: end;
  align-items: flex-end;
}

.ie10 .message-row.user {
  -ms-flex-direction: row-reverse;
  flex-direction: row-reverse;
}

.ie10 .message-row.ai {
  -ms-flex-direction: row;
  flex-direction: row;
}

.ie10 .chat-footer {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: end;
  align-items: flex-end;
}

.ie10 .chat-input {
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
}

.ie10 .send-btn {
  -ms-flex: 0 0 auto;
  flex: 0 0 auto;
  -ms-flex-item-align: stretch;
  -ms-align: stretch;
  align-self: stretch;
}

/* 额外：一些旧 IE 在处理 vw/vh 时可能有差异，提供 min-height 退化 */
.ie10 html,
.ie10 body {
  height: 100%;
  min-height: 100%;
}


.container {
  display: flex;
  height: 100vh;
}

.history-panel {
  width: 240px;
  background: #f8faff;
  color: #2d3a4a;
  padding: 0;
  display: flex;
  flex-direction: column;
  z-index: 1001;
  position: relative;
  transition: transform 0.3s cubic-bezier(.7, .3, .1, 1);
  box-shadow: none;
}

.history-panel h2 {
  margin: 0;
  padding: 10px;
  font-size: 20px;
  background: #eaf3ff;
  color: #3a7afe;
  border-bottom: 1px solid #e3e8f0;
  border-right: 1px solid #e3e8f0;
  height: 30px;
  line-height: 30px;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.history-item {
  width: 100%;
  box-sizing: border-box;
  padding: 16px 20px;
  border-bottom: 1px solid #e3e8f0;
  cursor: pointer;
  position: relative;
  background: #f8faff;
  text-align: left;
}

.history-item.active,
.history-item:hover {
  background: #e3f0ff;
}

.history-time {
  float: right;
  color: #a0aec0;
  font-size: 13px;
  margin-left: 12px;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.chat-header {
  position: relative;
  padding: 18px 24px;
  border-bottom: 1px solid #e3e8f0;
  font-size: 18px;
  background: #f6f7fb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-header-title {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
  font-weight: 500;
  color: #3a7afe;
  z-index: 0;
  /* 确保标题在按钮和头像下方 */
}

.chat-header .history-btn {
  position: relative;
  z-index: 2;
  /* 提高按钮层级，覆盖标题 */
  margin-right: auto;
  pointer-events: auto;
  background: linear-gradient(90deg, #3a7afe 0%, #5bb3ff 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  padding: 6px 14px;
  cursor: pointer;
  height: 36px;
  box-shadow: 0 6px 18px rgba(58, 122, 254, 0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.chat-header .history-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(58, 122, 254, 0.18);
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.message-row {
  display: flex;
  align-items: flex-end;
  margin-bottom: 24px;
}

.message-row.user {
  flex-direction: row-reverse;
}

.message-row.ai {
  flex-direction: row;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #eaf3ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 12px;
  color: #3a7afe;
}

.message-row.user .avatar {
  background: #3a7afe;
  color: #fff;
}

.message-row.ai .avatar {
  background: #eaf3ff;
  color: #3a7afe;
}

.username {
  font-size: 14px;
  color: #7b8794;
  margin-bottom: 4px;
}

.message-content {
  max-width: 820px;
  background: #f6f7fb;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 16px;
  word-break: break-all;
  box-shadow: 0 1px 2px rgba(58, 122, 254, 0.03);
  color: #222;
}

.message-content>p {
  margin: 0;
}

.message-row.user .message-content {
  background: #e3f0ff;
  color: #1765ad;
}

.message-row.ai .message-content {
  background: #fff1f1;
  color: #222;
}

.chat-footer {
  padding: 10px 12px;
  display: flex;
  align-items: flex-end;
}

.input-wrapper {
  flex: 1;
  border: 1px solid #c3d0e6;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.input-container {
  position: relative;
  flex: 1;
}

.chat-input {
  width: 100%;
  font-size: 16px;
  padding: 14px 18px;
  border: none;
  outline: none;
  background: transparent;
  color: #222;
  min-height: 20px;
  max-height: 120px;
  height: auto;
  box-sizing: border-box;
  resize: none;
  line-height: 1.6;
  padding-right: 40px;
  /* 为清空按钮留空间 */
}

.clear-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.clear-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #666;
}

.input-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  /* border-top: 1px solid #e3e8f0; */
}

.beysty-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
}

.beysty-text {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #d0d0d0;
  background: transparent;
  color: #666;
  transition: border-color 0.2s, color 0.2s;
  user-select: none;
}

.beysty-label input:checked + .beysty-text {
  border-color: #3a7afe;
  color: #3a7afe;
}

.send-btn {
  padding: 8px 20px;
  font-size: 14px;
  background: #3a7afe;
  color: #fff;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(58, 122, 254, 0.2);
}

.send-btn:hover {
  background: #2d5aa0;
  box-shadow: 0 4px 8px rgba(58, 122, 254, 0.3);
}

.send-btn:disabled,
.send-btn[disabled] {
  background: #bfc8d8 !important;
  color: #fff !important;
  cursor: not-allowed !important;
  opacity: 0.6;
  box-shadow: none;
}

/* 抽屉/侧边栏通用样式 */
.history-mask {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1000;
}

.history-panel.drawer-mode {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 80vw;
  max-width: 320px;
  background: #fff;
  color: #333;
  z-index: 1001;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
  transform: translateX(-100%);
}

.history-panel.drawer-mode.open {
  display: flex;
  transform: translateX(0);
}

.history-mask.open {
  display: block;
}

.history-panel.drawer-mode h2 {
  background: #f7f7f7;
  color: #1890ff;
}

.history-panel.drawer-mode .history-list {
  flex: 1;
  overflow-y: auto;
}

.history-panel.drawer-mode .history-item {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  position: relative;
  font-size: 16px;
  text-align: left;
  min-width: 0;
}

.history-panel.drawer-mode .history-time {
  float: none;
  position: absolute;
  right: 20px;
  top: 18px;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    height: 100vh;
  }

  .history-panel {
    display: none !important;
  }

  .history-panel.drawer-mode {
    display: flex !important;
    flex-direction: column;
  }

  .history-btn {
    display: inline-block;
    background: linear-gradient(90deg, #3a7afe 0%, #5bb3ff 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    padding: 6px 14px;
    margin-right: 10px;
    cursor: pointer;
    height: 36px;
    box-shadow: 0 6px 18px rgba(58, 122, 254, 0.12);
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  }

  .history-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(58, 122, 254, 0.18);
  }

  .history-btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(58, 122, 254, 0.12);
  }

  .chat-header {
    display: flex;
    align-items: center;
  }

  .history-panel.drawer-mode .history-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
  }

  .history-panel.drawer-mode .history-item:last-child {
    border-bottom: none;
  }

  .main {
    flex: 1;
    width: 100%;
    min-width: 0;
  }

  .chat-header {
    font-size: 16px;
    padding: 12px 10px;
  }

  .chat-body {
    padding: 10px 4px;
  }

  .message-content {
    max-width: 90vw;
    font-size: 15px;
    padding: 10px 12px;
  }

  .avatar {
    width: 36px;
    height: 36px;
    font-size: 16px;
    margin: 0 6px;
  }

  .chat-footer {
    padding: 10px 12px;
  }

  .input-wrapper {
    border-radius: 10px;
  }

  .chat-input {
    font-size: 15px;
    padding: 12px 16px;
    padding-right: 36px;
    min-height: 20px;
    max-height: 100px;
  }

  .clear-btn {
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    font-size: 16px;
  }

  .input-bottom {
    padding: 10px 16px;
  }

  .beysty-text {
    padding: 5px 10px;
    font-size: 13px;
    border: 2px solid #d0d0d0;
    background: transparent;
  }

  .send-btn {
    font-size: 13px;
    padding: 6px 16px;
  }

  .formula-card {
    font-size: 14px;
    padding: 12px 8px;
  }

  .formula-card h4 {
    font-size: 16px;
  }
}

@media (min-width: 769px) {

  .history-btn,
  .history-panel.drawer-mode,
  .history-mask {
    display: none !important;
  }
}

/* AI消息中的markdown表格样式 */
.message-row.ai .message-content table {
  border-collapse: collapse;
  margin: 10px 0;
}

.message-row.ai .message-content td,
.message-row.ai .message-content th {
  border: 1px solid #e3e8f0;
  background-color: #f6f7fb;
  padding: 6px 13px;
  color: #2d3a4a;
}

.message-row.ai .message-content th {
  background-color: #eaf3ff;
  font-weight: 600;
}

.message-row.ai .message-content td {
  background-color: #fff;
}

.intro-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 48px 0 24px 0;
}

.intro-title {
  font-size: 22px;
  color: #3a7afe;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.intro-desc {
  font-size: 16px;
  color: #666;
  margin-bottom: 0;
}

.example-questions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 0 32px 0;
}

.example-title {
  font-size: 17px;
  color: #3a7afe;
  margin-bottom: 18px;
  font-weight: 500;
  letter-spacing: 1px;
}

.example-list-vertical {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 420px;
}

.example-item {
  background: #f6f7fb;
  color: #3a7afe;
  border: 1px solid #e3e8f0;
  border-radius: 6px;
  padding: 12px 22px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border 0.2s;
  outline: none;
  text-align: left;
}

.example-item:hover,
.example-item:focus {
  background: #eaf3ff;
  color: #1765ad;
  border: 1.5px solid #3a7afe;
}

.history-add-btn {
  width: 90%;
  margin: 18px auto 10px auto;
  display: block;
  background: linear-gradient(90deg, #eaf3ff 0%, #f6f7fb 100%);
  color: #3a7afe;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(58, 122, 254, 0.06);
  padding: 14px 0;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s, color 0.2s;
  outline: none;
  letter-spacing: 1px;
}

.history-add-btn:hover,
.history-add-btn:focus {
  background: linear-gradient(90deg, #d2e6ff 0%, #eaf3ff 100%);
  color: #1765ad;
}

.history-load-more {
  width: 90%;
  margin: 6px auto 12px auto;
  display: block;
  background: #ffffff;
  color: #3a7afe;
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  padding: 8px 0;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}

.history-load-more:hover {
  background: #f6fbff;
}

/* 表格基本样式 */
table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* 提升iOS上的滚动流畅度 */
}

/* 设置容器的宽度为100%并且启用水平滚动 */
.table-container {
  width: 100%;
  overflow-x: auto;
  /* 当内容超出容器宽度时启用水平滚动 */
  -webkit-overflow-scrolling: touch;
  /* 提升iOS设备上的滚动体验 */
}

/* 确保表格不会自动换行，这样它的宽度可以超出父容器的宽度 */
.table-container table {
  width: auto;
  /* 让表格宽度根据内容自动调整 */
  min-width: 100%;
  /* 确保表格至少与容器一样宽 */
  border-collapse: collapse;
  /* 可选：让边框合并 */
}

.container {
  display: flex;
  height: 100vh;
}

.history-panel {
  width: 250px;
  /* 左侧面板宽度 */
  height: 100vh;
  /* 设置左侧面板的高度与视口高度相同 */
  overflow-y: auto;
}

.main {
  flex-grow: 1;
  /* 右侧区域占据剩余空间 */
  display: flex;
  flex-direction: column;
  height: 100vh;
  /* 右侧区域的高度也设置为100vh */
}

.chat-header {
  height: 50px;
  /* 设置 chat-header 高度 */
  background-color: #f1f1f1;
  /* 可根据需要设置背景颜色 */
  display: flex;
  align-items: center;
  padding: 0 10px;
  justify-content: flex-end;
}


.preview-btn {
  /* 更友好的按钮样式：去掉固定定位，改为居中展示的胶囊按钮 */
  position: relative;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, #3a7afe 0%, #5bb3ff 100%);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(58, 122, 254, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  text-decoration: none;
  line-height: 1;
}

.preview-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(58, 122, 254, 0.22);
}

.preview-btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(58, 122, 254, 0.12);
}

/* 在欢迎区中单独增加间距和居中 */
.intro-block .preview-btn {
  margin-top: 12px;
}

.preview-btn svg {
  display: inline-block;
  /* inline-block 允许 vertical-align 生效，保持图标垂直居中 */
  vertical-align: middle;
}

/* 移动端：按钮变成块级，便于点击 */
@media (max-width: 768px) {
  .intro-block .preview-btn {
    /* 使用 inline-flex 保持图标与文字在同一行并水平垂直居中 */
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    /* 防止换行 */
    max-width: 420px;
    margin: 12px auto 0 auto;
    padding: 12px 16px;
    font-size: 15px;
  }
}

/* 弹框模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1002;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
  padding-top: 10px;
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 1000px;
  /* allow content to scroll inside modal when tall */
  max-height: calc(100vh - 160px);
  overflow: auto;
}

@media (max-width: 480px) {
  .modal-content {
    width: 90%;
    margin: 0 auto;
    padding: 12px;
  }

  .chat-header .chat-header-title {
    font-size: 16px
  }

  .auth-btn {
    padding: 6px 8px;
    font-size: 13px
  }
}

/* 登录模态增强样式 */
.login-modal .login-modal-content {
  max-width: 420px;
  width: 90%;
  padding: 14px 16px;
  border-radius: 10px;
}

.login-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px
}

.login-title {
  font-size: 18px;
  color: #223;
  font-weight: 600
}

.btn-icon {
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer
}

.login-body label {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: #556
}

.login-body input {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  box-sizing: border-box;
  border: 1px solid #d7e2f8;
  border-radius: 6px;
}

.login-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px
}

.login-error {
  background: #fff4f4;
  color: #a33;
  border: 1px solid #f2c6c6;
  padding: 8px;
  border-radius: 6px;
  font-size: 13px
}

/* 移动端：把登录模态变成底部抽屉 */
@media (max-width: 600px) {
  .login-modal .login-modal-content {
    width: 100%;
    max-width: 100%;
    border-radius: 12px 12px 0 0;
    margin: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 12px;
  }

  .login-modal {
    padding-top: 0
  }
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* persistent close button that stays visible even when modal content scrolls */
.modal-close-btn {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 1003;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #333;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.modal-close-btn:hover,
.modal-close-btn:focus {
  background: #fff;
  color: #000;
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  .modal-close-btn {
    right: 12px;
    top: 12px;
    width: 40px;
    height: 40px;
    font-size: 20px
  }

  .modal-content {
    max-height: calc(100vh - 50px);
    margin: 0 auto
  }
}

@media (max-width: 600px) {

  /* Mobile-specific: increase contrast and touch target for close button */
  .modal-close-btn {
    right: 14px;
    top: 14px;
    width: 48px;
    height: 48px;
    font-size: 22px;
    background: #222;
    /* 深色背景以便在遮罩和白色弹窗上形成强对比 */
    color: #fff;
    /* 白色 × 图标 */
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    touch-action: manipulation;
  }

  .modal-close-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.12);
    outline-offset: 2px;
  }

  /* 微调 modal-content 顶部内边距，避免与固定按钮视觉冲突 */
  .modal-content {
    padding-top: 28px;
  }
}

#formulaList {
  margin-top: 20px;
}

.formula-item {
  margin-bottom: 15px;
  padding: 10px;
  background-color: #f4f4f4;
  border-radius: 5px;
}

.auth-area {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.auth-btn {
  padding: 6px 14px;
  font-size: 16px;
  height: 36px;
  line-height: 24px;
  border-radius: 6px;
  background: linear-gradient(90deg, #3a7afe 0%, #5bb3ff 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(58, 122, 254, 0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(58, 122, 254, 0.18);
}

.username-badge {
  background: #3a7afe;
  color: #fff;
  padding: 6px 10px;
  border-radius: 14px;
  font-size: 14px;
}

/* 头像在 header 中尺寸更小，使用现有 .avatar 基础样式并微调 */
.auth-avatar {
  width: 36px;
  height: 36px;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eaf3ff;
  color: #3a7afe;
}

.auth-avatar img {
  display: block;
  border-radius: 50%;
}

/* 下拉弹框样式：在头像下方展示用户名与登出 */
.auth-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(26, 34, 56, 0.12);
  padding: 10px;
  display: none;
  z-index: 1005;
}

.auth-dropdown-name {
  font-size: 14px;
  color: #223;
  margin-bottom: 8px;
  padding: 4px 6px;
  word-break: break-all;
}

.auth-dropdown-logout {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #ff6b6b 0%, #ff8a80 100%);
  color: #fff;
  border: none;
  cursor: pointer;
}

.auth-dropdown-logout:hover {
  opacity: 0.95
}