
/* --- 悬浮记事本 容器 --- */
/* 这是整个组件的根容器，使用<details>标签实现点击展开/折叠功能 */
.notepad-widget {
  /* 固定定位，使其悬浮在页面上 */
  position: fixed;
  /* 垂直居中 */
  top: 50%;
  transform: translateY(-50%);
  /* 位于页面右侧 */
  right: 20px;
  z-index: 1000;
}

/* --- 触发按钮 --- */
/* 这是用户点击的圆形按钮，使用<summary>标签 */
.notepad-toggle {
  /* 隐藏<summary>默认的三角箭头 */
  list-style: none; 
  -webkit-appearance: none; /* 兼容更多浏览器 */
  
  /* 弹性布局，用于居中内部的图标 */
  display: flex;
  align-items: center;
  justify-content: center;

  /* 尺寸和形状 */
  width: 50px;
  height: 50px;
  border-radius: 50%; /* 圆形 */
  
  /* 外观 */
  background-color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #333; /* 图标颜色 */
  cursor: pointer;
  
  /* 动画效果 */
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 隐藏<summary>默认的三角箭头 (再次强调) */
.notepad-toggle::-webkit-details-marker {
  display: none;
}

/* 鼠标悬停在按钮上时的效果 */
.notepad-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* 展开时，按钮内部图标的旋转动画 */
.notepad-widget[open] > .notepad-toggle svg {
  transform: rotate(135deg);
}

/* 图标本身的样式和过渡 */
.notepad-toggle svg {
  transition: transform 0.4s ease;
}


/* --- 记事本内容区域 --- */
.notepad-content {
  /* 绝对定位，相对于父容器<details> */
  position: absolute;
  /* 从按钮的右侧展开 */
  right: calc(100% + 15px);
  top: 50%;
  
  /* 尺寸和布局 */
  width: 280px;
  height: 350px;
  display: flex;
  flex-direction: column;

  /* 外观 */
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);

  /* 初始状态：隐藏 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) scale(0.9);
  transform-origin: right center; /* 动画基点为右侧中心 */
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

/* 展开时的状态：显示 */
.notepad-widget[open] > .notepad-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
}

/* 记事本头部 */
.notepad-header {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0; /* 防止头部被压缩 */
}

/* 记事本主体（可编辑区域） */
.notepad-body {
  flex-grow: 1; /* 占据剩余所有空间 */
  font-size: 14px;
  line-height: 1.6;
  color: #555;
  outline: none; /* 移除点击时的蓝色边框 */
  overflow-y: auto; /* 内容超出时显示滚动条 */
  padding-right: 5px; /* 为滚动条留出空间 */
}


/* --- 美化滚动条 --- */
.notepad-body::-webkit-scrollbar {
  width: 6px;
}

.notepad-body::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.notepad-body::-webkit-scrollbar-thumb {
  background-color: #ddd;
  border-radius: 3px;
}

.notepad-body::-webkit-scrollbar-thumb:hover {
  background-color: #bbb;
}