body {
  font-family: "微软雅黑", Arial, sans-serif;
  background: #f5f6fa url('../static/img/background.jpg') no-repeat center center fixed;
  background-size: cover;
  margin: 0;
  padding: 0;
  height.note-app-modal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 聊天应用模态框 */
.chat-app-modal {
  position: fixed;
  top: 45%; /* 向上偏移，确保不会覆盖任务栏 */
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: 75%; /* 进一步减少高度，确保不会盖住任务栏 */
  max-width: 1200px;
  display: none;
  flex-direction: column;
  box-sizing: border-box;
  z-index: 3500; /* 确保高于登录按钮但低于任务栏 */
  opacity: 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  max-height: calc(100vh - 80px); /* 确保窗口底部和任务栏之间有足够空间 */
}

.chat-app-modal.hidden {
  opacity: 0;
  transform: translate(-50%, -45%);
  transition: opacity 0.3s, transform 0.3s;
}

.chat-app-modal.visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.note-app-container {
  width: 100vw; /* 确保body占满整个视口宽度 */
  overflow: hidden; /* 防止出现滚动条 */
}

/* 登录相关样式 */
.login-container {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 3000;
  transition: all 0.3s ease;
}

.login-container.below-app {
  z-index: 1000;
  pointer-events: none; /* 当应用打开时，禁用登录按钮的交互 */
}

.login-button {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.login-user-info {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-user-info span {
  margin-right: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.logout-button {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
}

.logout-button:hover {
  background: #ebebeb;
}

.login-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.3s;
}

.login-form {
  background: white;
  width: 320px;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.login-form h3 {
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
  color: #333;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  color: #555;
}

.form-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.login-submit-button, .login-cancel-button {
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}

.login-submit-button {
  background: #1890ff;
  color: white;
  border: none;
}

.login-cancel-button {
  background: white;
  color: #333;
  border: 1px solid #ddd;
}

.login-error {
  color: #ff4d4f;
  margin-bottom: 15px;
  padding: 5px;
  background: #fff2f0;
  border: 1px solid #ffccc7;
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
}

/* 动画样式 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 应用区域 - 留出底部空间给任务栏 */
.app-area {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 60px); /* 为任务栏预留空间 */
  overflow: hidden;
}

/* 弹窗遮罩 */
.modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3400; /* 确保在应用窗口下方，但高于其他元素且低于任务栏 */
  transition: opacity 0.3s ease;
  pointer-events: auto;
}

.modal-mask.hidden {
  opacity: 0;
}

.modal-mask.visible {
  opacity: 1;
}

/* 应用弹窗 */
.note-app-modal {
  position: fixed;
  top: 45%; /* 向上偏移，确保不会覆盖任务栏 */
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3500; /* 确保高于登录按钮但低于任务栏 */
  display: flex;
  flex-direction: column;
  width: 90%;
  height: 75%; /* 进一步减少高度，确保不会盖住任务栏 */
  max-width: 1200px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  box-sizing: border-box;
  max-height: calc(100vh - 80px); /* 确保窗口底部和任务栏之间有足够空间 */
}

.note-app-modal.hidden {
  opacity: 0;
  transform: translate(-50%, -45%);
}

.note-app-modal.visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.note-app-container, .chat-app-container {
  width: 100%; /* 使用100%宽度填满父容器 */
  height: 100%; /* 使用100%高度填满父容器 */
  background: #fff;
  border-radius: 8px; /* 统一圆角 */
  box-shadow: none; /* 移除阴影，因为父容器已有阴影 */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0; /* 确保没有内边距 */
  margin: 0; /* 确保没有外边距 */
}

.note-app-header, .chat-app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 16px; /* 更小的内边距，增加内容区域 */
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0; /* 防止头部被压缩 */
  min-height: 30px; /* 减少最小高度 */
  height: 30px; /* 固定高度 */
}

.note-app-header h3, .chat-app-header h3 {
  margin: 0;
  font-size: 1.1em;
  color: #333;
  line-height: 1;
}

.close-button {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0 8px;
  transition: color 0.2s;
}

.close-button:hover {
  color: #333;
}

.note-app-iframe, .chat-app-iframe {
  flex: 1;
  width: 100%;
  height: calc(100% - 31px); /* 减小标题栏高度扣除值，配合新标题栏高度 */
  border: none;
  overflow: hidden;
  padding: 0; /* 确保没有内边距 */
  margin: 0; /* 确保没有外边距 */
}

/* Dock 样式 */
.mac-dock {
  position: fixed;
  left: 50%;
  bottom: 10px; /* Dock栏位于底部 */
  transform: translateX(-50%);
  z-index: 4000; /* 提高任务栏的z-index，确保它始终在最上层 */
  display: flex;
  align-items: flex-end;
  background: rgba(255,255,255,0.85);
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  padding: 6px 18px 5px 18px;
  min-width: 108px;
  height: 38px;
  gap: 18px;
  border: 1.5px solid #e0e0e0;
}

.dock-app {
  width: 29px;
  height: 29px;
  border-radius: 10px;
  background: linear-gradient(145deg,#f5f6fa 60%,#e0e0e0 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s;
  position: relative;
}

.dock-app.active {
  box-shadow: 0 4px 16px #4f8cff44;
  transform: scale(1.12);
  background: linear-gradient(145deg,#e6f7ff 60%,#bae7ff 100%);
  border-bottom: 2px solid #1890ff;
}

.dock-app img {
  width: 19px;
  height: 19px;
  pointer-events: none;
}

.dock-app-label {
  position: absolute;
  left: 50%;
  bottom: 38px; /* 修改为正值，使标签位于图标上方 */
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  font-size: 13px;
  border-radius: 6px;
  padding: 2px 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* 添加小三角形指示器 */
.dock-app-label::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #222;
}

.dock-app:hover .dock-app-label {
  opacity: 1;
}

/* 上下文菜单样式 */
.dock-context-menu {
  position: fixed;
  background: rgba(255,255,255,0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0,0,0,0.1);
  min-width: 160px;
  animation: fadeIn 0.15s ease-out;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
  border-radius: 8px;
  padding: 5px 0;
  z-index: 9999;
}

.context-menu-item {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  transition: background 0.15s;
}

.context-menu-item:hover {
  background: #f5f5f5;
}

.context-menu-item.selected {
  background: #e6f7ff;
  color: #1890ff;
  font-weight: 500;
}

/* 图标样式 */
.menu-icon {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  display: inline-block;
}

.public-icon {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%231890ff"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg>') no-repeat center;
}

.internal-icon {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ff9800"><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/></svg>') no-repeat center;
}

/* 通用隐藏类 */
.hidden {
  display: none !important;
}

/* 调试信息样式 */
.debug-info {
  position: fixed;
  left: 10px;
  top: 10px;
  background: rgba(255,255,255,0.7);
  padding: 5px;
  border-radius: 5px;
  font-size: 12px;
}

/* 备案容器样式 */
.beian-container {
  position: fixed;
  left: 5px;
  bottom: 10px;
  text-align: left;
  background: rgba(255,255,255,0.7);
  font-size: 13px;
  z-index: 9999;
  border-radius: 5px;
  padding: 2px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 备案链接样式 */
.beian-link {
  color: #333;
  text-decoration: none;
}

/* 备案图片样式 */
.beian-img {
  height: 20px;
  vertical-align: middle;
  margin: 0 5px;
}

@media (max-width: 600px) {
  .mac-dock {
    min-width: 60px;
    padding: 4px 10px;
    height: 24px;
    gap: 8px;
  }
  .dock-app {
    width: 20px;
    height: 20px;
  }
  .dock-app img {
    width: 14px;
    height: 14px;
  }
  .dock-app-label {
    font-size: 11px;
    bottom: 30px; /* 调整小屏幕下标签位置 */
    padding: 1px 8px;
  }
}