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

:root {
  --cork-bg: #c9a876;
  --cork-dark: #8b7355;
  --yellow-note: #fff475;
  --pink-note: #ffb5d5;
  --blue-note: #96d4f5;
  --green-note: #aae5a4;
  --purple-note: #d4bbf7;
  --orange-note: #ffb380;
  --accent: #ff6b9d;
}

body {
  font-family: 'Noto Sans SC', sans-serif;
  background: #f0e5d8;
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 10px;
  position: relative;
}

/* 顶部栏 */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 100;
}

.logo {
  font-family: 'Patrick Hand', cursive;
  font-size: 28px;
  color: var(--accent);
  font-weight: bold;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 107, 157, 0.1);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.user-chip:hover {
  background: rgba(255, 107, 157, 0.2);
}

.user-avatar-small {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ff8fab);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.user-chip span {
  font-size: 13px;
  color: #333;
}

.login-btn {
  padding: 8px 18px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Noto Sans SC', sans-serif;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
}

/* 便签墙选择器 - 紧凑版 */
.wall-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  margin-bottom: 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  position: relative;
  z-index: 10;
}

.wall-tab {
  padding: 8px 16px;
  background: white;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Noto Sans SC', sans-serif;
}

.wall-tab:hover {
  border-color: var(--accent);
}

.wall-tab.active {
  background: var(--accent);
  color: white;
  transform: scale(1.05);
}

.new-wall-tab {
  background: linear-gradient(135deg, #ffa07a, var(--accent));
  color: white;
  font-weight: 500;
}

/* 软木板 */
.cork-board {
  background: var(--cork-bg);
  background-image: 
    repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(139, 115, 85, 0.05) 3px, rgba(139, 115, 85, 0.05) 6px),
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(139, 115, 85, 0.05) 3px, rgba(139, 115, 85, 0.05) 6px);
  border-radius: 12px;
  padding: 30px;
  min-height: 600px;
  box-shadow: 
    inset 0 0 60px rgba(0, 0, 0, 0.08),
    0 8px 30px rgba(0, 0, 0, 0.15);
  position: relative;
  border: 10px solid var(--cork-dark);
}

.cork-board:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 15% 25%, rgba(139, 115, 85, 0.15) 1.5px, transparent 1.5px),
    radial-gradient(circle at 65% 75%, rgba(139, 115, 85, 0.15) 1.5px, transparent 1.5px),
    radial-gradient(circle at 85% 15%, rgba(139, 115, 85, 0.15) 1.5px, transparent 1.5px),
    radial-gradient(circle at 35% 85%, rgba(139, 115, 85, 0.15) 1.5px, transparent 1.5px);
  background-size: 120px 120px, 150px 150px, 130px 130px, 140px 140px;
  pointer-events: none;
  border-radius: 2px;
}

/* 添加便签区域 */
.add-note-panel {
  background: white;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 25px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

.add-note-panel textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  font-family: 'Patrick Hand', cursive;
  font-size: 18px;
  resize: vertical;
  transition: border-color 0.3s;
}

.add-note-panel textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.color-picker {
  display: flex;
  gap: 10px;
  margin: 12px 0;
  justify-content: center;
}

.color-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  position: relative;
}

.color-dot:hover {
  transform: scale(1.15);
}

.color-dot.selected {
  border-color: #333;
  transform: scale(1.25);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.color-dot.selected:after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #333;
  font-size: 18px;
  font-weight: bold;
}

.add-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent), #ff8fab);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Noto Sans SC', sans-serif;
}

.add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

/* 便签容器 */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 25px;
  position: relative;
  /* 👇 添加这一行 👇 */
  align-items: start; 
}
/* 便签样式 - 改进的图钉 */
.sticky-note {
  background: var(--yellow-note);
  padding: 22px 18px 18px;
  border-radius: 3px;
  box-shadow: 
    0 6px 12px rgba(0, 0, 0, 0.12),
    0 2px 4px rgba(0, 0, 0, 0.08);
  position: relative;
  min-height: 200px;
  cursor: grab;
  transition: all 0.3s ease;
  transform-origin: center top;
  animation: noteIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes noteIn {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(-50px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.sticky-note:nth-child(6n+1) { transform: rotate(1.2deg); }
.sticky-note:nth-child(6n+2) { transform: rotate(-1.5deg); }
.sticky-note:nth-child(6n+3) { transform: rotate(0.8deg); }
.sticky-note:nth-child(6n+4) { transform: rotate(-1deg); }
.sticky-note:nth-child(6n+5) { transform: rotate(1.8deg); }
.sticky-note:nth-child(6n+6) { transform: rotate(-0.5deg); }

.sticky-note:hover {
  transform: scale(1.03) rotate(0deg) translateY(-4px) !important;
  box-shadow: 
    0 15px 30px rgba(0, 0, 0, 0.2),
    0 8px 15px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

.sticky-note:active {
  cursor: grabbing;
}

/* 真实的图钉效果 */
.pushpin {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  z-index: 1;
}

.pushpin-head {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  background: radial-gradient(circle at 30% 30%, #e74c3c, #c0392b);
  border-radius: 50%;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset -2px -2px 4px rgba(0, 0, 0, 0.2),
    inset 2px 2px 4px rgba(255, 255, 255, 0.3);
}

.pushpin-head:before {
  content: '';
  position: absolute;
  top: 3px;
  left: 4px;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
}

.pushpin-needle {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 8px;
  background: linear-gradient(to bottom, #888, #555);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* style.css 中找到 .note-text 并替换为以下内容 */

.note-text {
  /* 改用标准字体，清晰易读 */
  font-family: 'Noto Sans SC', sans-serif; 
  /* 稍微加大字号 */
  font-size: 17px;
  /* 增加行高，让文字不拥挤 */
  line-height: 1.7;
  color: #2c3e50;
  /* 关键：保留空格和换行符！ */
  white-space: pre-wrap; 
  /* 确保长单词会自动换行，不撑破便签 */
  word-wrap: break-word;
  word-break: break-word;
  margin-bottom: 12px;
  /* 去掉阴影，减少模糊感 */
  /* text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5); */
}

.note-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.note-meta {
  font-size: 11px;
  color: #666;
}

.note-author {
  font-size: 10px;
  color: #999;
  font-style: italic;
  margin-top: 2px;
}

.delete-btn {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s;
  font-family: 'Noto Sans SC', sans-serif;
}

.delete-btn:hover {
  background: #c0392b;
  transform: scale(1.05);
}

.my-note {
  box-shadow: 
    0 6px 12px rgba(255, 107, 157, 0.3),
    0 2px 4px rgba(255, 107, 157, 0.2),
    0 0 0 3px var(--accent);
}

.empty-msg {
  text-align: center;
  padding: 80px 20px;
  color: rgba(0, 0, 0, 0.25);
  font-family: 'Patrick Hand', cursive;
  font-size: 28px;
}

/* 模态框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 420px;
  width: 90%;
  animation: slideUp 0.3s;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-box h2 {
  font-family: 'Patrick Hand', cursive;
  font-size: 32px;
  margin-bottom: 20px;
  color: #333;
}

.modal-box input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 15px;
  font-family: 'Noto Sans SC', sans-serif;
}

.modal-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-btns {
  display: flex;
  gap: 10px;
}

.modal-btns button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Noto Sans SC', sans-serif;
}

.modal-btns .confirm {
  background: linear-gradient(135deg, var(--accent), #ff8fab);
  color: white;
}

.modal-btns .cancel {
  background: #e8e8e8;
  color: #333;
}

.modal-btns button:hover {
  transform: translateY(-2px);
}

.login-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.login-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: #f0f0f0;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Noto Sans SC', sans-serif;
  transition: all 0.3s;
  font-size: 14px;
}

.login-tab.active {
  background: linear-gradient(135deg, var(--accent), #ff8fab);
  color: white;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hint-text {
  color: #999;
  font-size: 12px;
  line-height: 1.5;
  margin-top: -5px;
}

@media (max-width: 768px) {
  .logo {
    font-size: 22px;
  }

  .cork-board {
    padding: 20px;
  }

  .notes-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
  }

  .sticky-note {
    min-height: 160px;
    padding: 20px 15px 15px;
  }

  .note-text {
    font-size: 16px;
  }
}