html {
  font-size: 12.8px;
}

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

:root {
  /* Cell 级 6 色循环 */
  --purple: #CDB4DB;
  --pink: #FFC8DD;
  --rose: #FFAFCC;
  --blue-light: #BDE0FE;
  --blue: #A2D2FF;
  --blue-dark: #5BA3D9;

  /* 基础色：文字 */
  --text-primary: #4a4349;
  --text-secondary: #6b5f66;
  --text-muted: #b0a3aa;

  /* 主题色（pink 默认） */
  --theme-accent: #FFAFCC;
  --theme-action: #d63384;
  --theme-bg: #fff5f9;

  /* 派生值 */
  --border: rgba(255, 175, 204, 0.3);
  --bg-card: #ffffff;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(205, 180, 219, 0.12);
}

/* Blue theme */
body[data-theme="blue"] {
  --theme-accent: #A2D2FF;
  --theme-action: #5BA3D9;
  --theme-bg: #f0f5fa;
  --border: rgba(162, 210, 255, 0.35);
}

/* Purple theme */
body[data-theme="purple"] {
  --theme-accent: #c4b0d6;
  --theme-action: #9b8ab8;
  --theme-bg: #f7f4fa;
  --border: rgba(196, 176, 214, 0.3);
}

/* Green theme */
body[data-theme="green"] {
  --theme-accent: #a8d5ba;
  --theme-action: #5a9e6f;
  --theme-bg: #f4faf6;
  --border: rgba(168, 213, 186, 0.35);
}

/* Black theme */
body[data-theme="black"] {
  --theme-accent: #444;
  --theme-action: #333;
  --theme-bg: #f7f7f7;
  --border: rgba(68, 68, 68, 0.15);
}

body {
  font-family: "Noto Sans SC", sans-serif;
  background: var(--theme-bg);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-y: auto;
  padding: 32px;
  padding-left: 96px;
  transition: padding-left 0.25s ease;
}

body.sidebar-collapsed {
  padding-left: 56px;
}

body.journal-fullscreen {
  padding: 0;
  overflow: hidden;
}

.header {
  display: none;
}

/* 网格布局 */
.grid {
  display: flex;
  gap: 24px;
  width: 100%;
}

.grid-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 卡片 */
.card {
  background: var(--bg-card);
  padding: 16px;
  box-shadow: 0 2px 16px rgba(205, 180, 219, 0.10);
  border: none;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 24px rgba(205, 180, 219, 0.18);
}

.card--notes,
.card--plans,
.card--materials,
.card--journal { border-top: 4px solid var(--theme-accent); }

.card .list {
  overflow-y: visible;
  flex: none;
}

/* 卡片头部 */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  min-height: 32px;
  flex-shrink: 0;
}

.card-subtitle {
  font-size: 1rem;
  color: var(--theme-accent);
  margin: 0 0 8px 0;
  font-family: "KaiTi", "楷体", "STKaiti", serif;
}

.card-header h2 {
  margin-bottom: 0;
}

.card-header .btn-icon {
  color: var(--text-muted);
}

.card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.card-header .btn-icon .icon {
  width: 16px;
  height: 16px;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.btn-icon:hover {
  background: var(--theme-bg);
}

.search-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 搜索框跟随主题 */
.search-inline-input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--theme-bg);
  color: var(--text-primary);
  outline: none;
  width: 0;
  opacity: 0;
  transition: width 0.25s ease, opacity 0.25s ease, padding 0.25s ease;
}

.search-inline-input:focus {
  border-color: var(--theme-accent);
}

.card .btn-icon:hover {
  background: var(--theme-bg);
}

.card .search-inline .btn-icon:hover {
  color: var(--theme-action);
}

.search-inline-input.active {
  width: 144px;
  opacity: 1;
  padding: 4px 8px;
}

.search-inline-input.hidden {
  width: 0;
  opacity: 0;
  padding: 4px 0;
  border-color: transparent;
}

.card-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

/* 列表 */
.list {
  overflow-y: auto;
  flex: 1;
  counter-reset: list-idx;
}

.list-item {
  padding: 8px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid transparent;
  counter-increment: list-idx;
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-item::before {
  content: "";
  width: 4px;
  min-height: 24px;
  align-self: stretch;
  border-radius: 4px;
  flex-shrink: 0;
}

.list-item:nth-child(6n+1)::before { background: #cdb4db; }
.list-item:nth-child(6n+2)::before { background: #e6bedc; }
.list-item:nth-child(6n+3)::before { background: #ffc8dd; }
.list-item:nth-child(6n+4)::before { background: #ffafcc; }
.list-item:nth-child(6n+5)::before { background: #bde0fe; }
.list-item:nth-child(6n+6)::before { background: #a2d2ff; }

.list-item:nth-child(6n+1):hover { background: #f9f4fc; }
.list-item:nth-child(6n+2):hover { background: #fdf5fb; }
.list-item:nth-child(6n+3):hover { background: #fff5f9; }
.list-item:nth-child(6n+4):hover { background: #fff0f5; }
.list-item:nth-child(6n+5):hover { background: #f0f8ff; }
.list-item:nth-child(6n+6):hover { background: #eef5ff; }

.list-item:nth-child(6n+1):hover .btn-delete { color: #cdb4db; }
.list-item:nth-child(6n+2):hover .btn-delete { color: #e6bedc; }
.list-item:nth-child(6n+3):hover .btn-delete { color: #ffc8dd; }
.list-item:nth-child(6n+4):hover .btn-delete { color: #ffafcc; }
.list-item:nth-child(6n+5):hover .btn-delete { color: #bde0fe; }
.list-item:nth-child(6n+6):hover .btn-delete { color: #a2d2ff; }

.list-item:hover {
  border-color: var(--border);
}

.list-item-body {
  flex: 1;
  min-width: 0;
}

.list-item .btn-delete {
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.list-item:hover .btn-delete {
  opacity: 1;
}

.list-item-title {
  font-weight: 400;
  font-size: 0.9rem;
}

.list-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 输入组件 */
.input, .textarea, .input-sm {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--theme-bg);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

/* 所有卡片输入框统一跟随主题色 */
.card .input,
.card .textarea,
.card .input-sm {
  background: var(--theme-bg);
}

.card .input:focus,
.card .textarea:focus,
.card .input-sm:focus {
  border-color: var(--theme-accent);
}

/* 随记列表内容普通字体 */
.card--journal .list .list-item-title {
  font-size: 0.9rem;
  line-height: 1.8;
}

.input:focus, .textarea:focus, .input-sm:focus {
  border-color: var(--theme-accent);
}

.input::placeholder, .textarea::placeholder, .input-sm::placeholder {
  color: var(--text-muted);
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
}

/* 自定义双字体占位层 */
.journal-input {
  position: relative;
}
.custom-placeholder {
  position: absolute;
  top: 8px;
  left: 16px;
  right: 16px;
  pointer-events: none;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
}
.custom-placeholder .ph-zh {
  font-family: "KaiTi", "楷体", "STKaiti", serif;
}
.custom-placeholder.hidden {
  display: none;
}

.input { width: 100%; margin-bottom: 8px; }
.input-sm { flex: 1; }
.textarea { width: 100%; min-height: 80px; max-height: 160px; resize: none; margin-bottom: 8px; overflow-y: hidden; }
.textarea.scrollable { overflow-y: auto; }

/* 自定义滚动条 */
.textarea::-webkit-scrollbar {
  width: 8px;
}
.textarea::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}
.textarea::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.textarea::-webkit-scrollbar-thumb:hover {
  background: #aaa;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* 按钮 */
.btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: all 0.2s;
  white-space: nowrap;
}

.btn:hover { background: var(--theme-bg); }

.btn--primary {
  background: var(--rose);
  color: white;
  border-color: var(--rose);
}

.btn--primary:hover { background: var(--text-primary); }

.btn--secondary {
  background: var(--purple);
  color: var(--text-primary);
  border-color: var(--purple);
}

.btn--danger {
  color: #e06388;
  border-color: #f5d5e0;
}

.btn--danger:hover { background: #fff5f8; }

/* 编辑器 */
.editor { margin-top: 16px; }
.editor-actions { display: flex; gap: 8px; }

/* 资料模块 */
.material-input-wrap {
  position: relative;
}
.material-input-wrap .textarea {
  padding-bottom: 32px;
}
.material-input-wrap .input-actions {
  bottom: 8px;
  right: 8px;
}

.material-link {
  color: #2563eb;
  text-decoration: none;
  word-break: break-all;
  transition: color 0.2s;
}

.material-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.material-img {
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.material-img--thumb {
  max-width: 64px;
  max-height: 64px;
  object-fit: cover;
}

.material-img--expanded {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
}

.material-img:hover {
  opacity: 0.85;
}

/* 计划模块 */
.goal-item {
  margin-bottom: 16px;
}

.goal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-primary);
}

.goal-header:hover { color: var(--text-secondary); }

.goal-header .btn-delete {
  opacity: 0;
  transition: opacity 0.2s;
  color: var(--text-muted);
  margin-left: auto;
}
.goal-header:hover .btn-delete {
  opacity: 1;
}

.goal-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.todo-list { padding-left: 24px; }

.todo-item.done { text-decoration: line-through; color: var(--text-muted); }

.todo-item input[type="checkbox"] {
  accent-color: var(--rose);
}

.todo-due {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* 已完成待办容器 */
.done-todos {
  border-top: 1px dashed var(--border);
  margin-top: 4px;
  padding-top: 4px;
  overflow: hidden;
  max-height: 500px;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.done-todos.collapsed {
  max-height: 0;
  opacity: 0;
  border-top-color: transparent;
  margin-top: 0;
  padding-top: 0;
}

/* 待办完成动画 */
.todo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.95rem;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.todo-item.finishing {
  opacity: 0.4;
  text-decoration: line-through;
  color: var(--text-muted);
  transform: translateX(8px);
}

/* 眼睛按钮 */
.btn-eye {
  margin-left: auto;
  color: var(--text-muted);
  position: relative;
}

.btn-eye.active {
  color: var(--rose);
}

.btn-eye::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--rose);
  color: #fff;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.btn-eye::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--rose);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.btn-eye:hover::after,
.btn-eye:hover::before {
  opacity: 1;
}

.goal-header .btn-eye + .btn-delete {
  margin-left: 8px;
}

/* 优先级标签 */
.priority-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  line-height: 1;
}
.priority-tag--P0 { background: #ffebee; color: #e53935; }
.priority-tag--P1 { background: #fff3e0; color: #fb8c00; }
.priority-tag--P2 { background: #e8f5e9; color: #43a047; }

.tag-close {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 14px;
  height: 14px;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  background: var(--text-muted);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.priority-tag:hover .tag-close,
.ddl-tag:hover .tag-close {
  opacity: 1;
}
.tag-close:hover {
  background: #e53935;
}

.priority-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 200;
}
.priority-menu .priority-tag {
  font-size: 0.85rem;
  padding: 4px 12px;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.priority-menu .priority-tag:hover { opacity: 1; }

/* 目标 deadline 标签 */
.ddl-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  line-height: 1;
}
.ddl-tag--today { background: #ffebee; color: #e53935; }
.ddl-tag--tomorrow { background: #fff3e0; color: #fb8c00; }
.ddl-tag--dayafter { background: #e8f5e9; color: #43a047; }
.ddl-tag--date { background: #e3f2fd; color: #2563eb; }

.btn-calendar {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
}
.btn-calendar:hover { color: var(--rose); }

/* 日历弹窗 */
.calendar-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 260px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 200;
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.calendar-header span {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-secondary);
}
.calendar-nav {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 4px;
}
.calendar-nav:hover { background: var(--bg-surface); }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.calendar-grid .day-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 4px 0;
}
.calendar-grid .day-cell {
  font-size: 0.8rem;
  padding: 6px 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-primary);
}
.calendar-grid .day-cell:hover { background: #fce4ec; }
.calendar-grid .day-cell.today { font-weight: 600; color: var(--rose); }
.calendar-grid .day-cell.selected { background: var(--rose); color: #fff; }
.calendar-grid .day-cell.selected:hover { background: var(--rose); }
.calendar-grid .day-cell.other-month { color: var(--text-muted); opacity: 0.4; }
.calendar-footer {
  margin-top: 8px;
  text-align: right;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.calendar-btn-confirm {
  background: var(--rose);
  color: #fff;
}
.calendar-btn-clear {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* 日历快捷标签 */
.calendar-quick {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.calendar-quick-tag {
  font-size: 0.8rem;
  padding: 4px 14px;
  border-radius: 14px;
  background: #f5f5f5;
  color: var(--text-primary);
  cursor: pointer;
  border: 1px solid #eee;
}
.calendar-quick-tag:hover { background: #fce4ec; border-color: #f8bbd0; }
.calendar-quick-tag.active { background: var(--rose); color: #fff; border-color: var(--rose); }

/* 逾期目标 */
.goal-item.overdue {
  background: #fff0f0;
  border-left: 3px solid #e53935;
  padding-left: 8px;
  border-radius: 4px;
}
.goal-item.overdue .goal-header {
  color: #c62828;
}

/* 随记输入 */
.journal-input {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.journal-input .textarea { min-height: 80px; padding-bottom: 32px; }

/* 内联编辑 */
.inline-edit-textarea {
  width: 100%;
  min-height: 64px;
  font-size: 1rem;
  margin: 0;
}

/* 内联编辑 textarea 跟随 cell 色调 */
.list-item:nth-child(6n+1) .inline-edit-textarea { background: #f9f4fc; border-color: #cdb4db; }
.list-item:nth-child(6n+2) .inline-edit-textarea { background: #fdf5fb; border-color: #e6bedc; }
.list-item:nth-child(6n+3) .inline-edit-textarea { background: #fff5f9; border-color: #ffc8dd; }
.list-item:nth-child(6n+4) .inline-edit-textarea { background: #fff0f5; border-color: #ffafcc; }
.list-item:nth-child(6n+5) .inline-edit-textarea { background: #f0f8ff; border-color: #bde0fe; }
.list-item:nth-child(6n+6) .inline-edit-textarea { background: #eef5ff; border-color: #a2d2ff; }

/* 工具类 */
.hidden { display: none !important; }

/* Icons */
.icon {
  width: 24px;
  height: 24px;
  vertical-align: -4px;
  display: inline-block;
}

.icon-sm {
  width: 16px;
  height: 16px;
  vertical-align: -4px;
}

.icon-xs {
  width: 16px;
  height: 16px;
  vertical-align: -4px;
}

/* 随记全屏模式 */
.journal-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--theme-bg);
  display: flex;
  flex-direction: column;
  padding: 48px 64px;
  overflow-y: auto;
}

.journal-fullscreen-overlay .journal-fs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-shrink: 0;
}

.journal-fullscreen-overlay h2 {
  font-size: 1.8rem;
  font-weight: 400;
  color: #2a2a2a;
}

.journal-fullscreen-overlay .btn-close-fs {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #666;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.journal-fullscreen-overlay .btn-close-fs:hover {
  background: rgba(0,0,0,0.05);
}

.journal-fullscreen-overlay .textarea {
  font-size: 1.1rem;
  line-height: 1.8;
  background: var(--theme-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  padding-bottom: 48px;
  min-height: 64px;
  margin-bottom: 24px;
  resize: none;
  overflow-y: hidden;
}

.journal-fullscreen-overlay .textarea:focus {
  border-color: var(--theme-accent);
}

.journal-fullscreen-overlay .list-item {
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  border-radius: 0;
  padding: 16px 0;
  margin-bottom: 0;
}

.journal-fullscreen-overlay .list-item-title {
  font-size: 1.1rem;
  line-height: 1.8;
}

.journal-fullscreen-overlay .list-item-meta {
  font-family: "Noto Sans SC", sans-serif;
  font-size: 0.8rem;
}

/* 响应式 */
@media (max-width: 768px) {
  body { padding: 16px; }
  .grid {
    flex-direction: column;
    gap: 16px;
  }
}

/* ===== 用户入口（左下角） ===== */
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--rose));
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.user-avatar-lg {
  width: 56px;
  height: 56px;
}
.user-nickname {
  font-size: 0.9rem;
  color: var(--text-primary);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== 设置面板 ===== */
.user-panel {
  position: fixed;
  bottom: 64px;
  left: 72px;
  width: 280px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  border: 1px solid var(--theme-accent);
  z-index: 200;
  overflow: hidden;
}
.user-panel.hidden {
  display: none;
}
.user-panel-header {
  padding: 16px;
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: 1px solid var(--theme-accent);
  color: var(--theme-action);
}
.user-panel-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.user-panel-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.user-panel-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.btn-upload {
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--theme-bg);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-secondary);
}
.btn-upload:hover {
  border-color: var(--rose);
}
.nickname-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nickname-display {
  font-size: 0.95rem;
  color: var(--text-primary);
}
.btn-nickname-edit {
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--text-muted);
}
.btn-nickname-edit:hover {
  color: var(--theme-action);
}
.nickname-input {
  flex: 1;
  padding: 4px 8px;
  font-size: 0.9rem;
  height: 32px;
  box-sizing: border-box;
}
.btn-nickname-confirm {
  padding: 0 12px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: var(--theme-action);
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-nickname-confirm:hover {
  opacity: 0.85;
}

.user-panel-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.btn-logout {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.btn-logout:hover {
  border-color: var(--rose);
  color: var(--rose);
}
.btn-danger-text {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.btn-danger-text:hover {
  border-color: #e53935;
  color: #e53935;
}

/* 格式化确认弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  max-width: 360px;
  width: 90%;
  text-align: center;
}
.modal-warning {
  font-size: 1.1rem;
  color: #e53935;
  margin-bottom: 16px;
  line-height: 1.6;
  font-weight: 500;
}
.modal-code-hint {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.modal-code-hint strong {
  font-size: 1.2rem;
  color: var(--text-primary);
  letter-spacing: 4px;
}
.modal-code-input {
  width: 100%;
  text-align: center;
  font-size: 1.2rem;
  letter-spacing: 8px;
  margin-bottom: 24px;
  box-sizing: border-box;
}
.modal-actions {
  display: flex;
  gap: 16px;
}
.btn-modal-cancel {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.btn-modal-cancel:hover {
  border-color: var(--text-muted);
}
.btn-modal-confirm {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: #e53935;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn-modal-confirm:hover {
  opacity: 0.85;
}

/* ===== List Item Color Blocks (9-color cycle from coolors palette) ===== */

/* Collapse: hide items beyond 6 */
.list-item:nth-child(n+7) {
  display: none;
}
.list.list--expanded .list-item:nth-child(n+7) {
  display: flex;
}
.goal-item:nth-child(n+7) {
  display: none;
}
.list--expanded .goal-item:nth-child(n+7) {
  display: block;
}

/* Show more / collapse button */
.btn-show-more {
  display: block;
  width: 100%;
  padding: 8px;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  text-align: center;
  transition: color 0.2s;
}
.btn-show-more:hover {
  color: var(--text-secondary);
}

/* ===== Input Action Buttons (inside textarea) ===== */
.input-actions {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-input-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.btn-input-action:hover {
  color: var(--theme-action);
  background: rgba(255, 175, 204, 0.15);
}
/* Submit button */
.btn-submit {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: auto;
  height: 24px;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 22px;
  color: var(--theme-action);
  background: transparent;
  border: 1px solid var(--theme-action);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-submit:hover {
  background: var(--theme-action);
  color: #fff;
}
.input-actions .btn-submit {
  position: static;
}

/* ===== Material Image Preview ===== */
.material-img-preview {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 0 8px;
}
.material-img-preview:empty {
  display: none;
}
.material-pending-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.material-pending-thumb:hover {
  opacity: 0.5;
}

/* Material mixed preview */
.material-mixed-preview {
  font-size: 0.85rem;
  line-height: 1.4;
}
.material-mixed-preview img {
  max-width: 64px;
  max-height: 64px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  vertical-align: middle;
}
.material-mixed-preview img.material-img--expanded {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
}

/* Note list: title + preview */
.list-item-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Card header actions */
.card-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== Notes Fullscreen (3-column macOS Notes style) ===== */
.notes-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--theme-bg);
  display: grid;
  grid-template-columns: 1fr;
}
.notes-fullscreen-overlay.hidden {
  display: none;
}
body.notes-fullscreen {
  overflow: hidden;
}
.notes-fs-layout {
  display: grid;
  grid-template-columns: 200px 280px 1fr;
  height: 100vh;
}

/* Folders sidebar */
.notes-fs-folders {
  background: #f7f3fa;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.notes-fs-folders-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.notes-fs-folder-list {
  flex: 1;
  overflow-y: auto;
}
.fs-folder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}
.fs-folder-item:hover {
  background: rgba(162, 210, 255, 0.15);
}
.fs-folder-item.active {
  background: rgba(162, 210, 255, 0.3);
  font-weight: 500;
}
.btn-delete-sm {
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.15s;
}
.fs-folder-item:hover .btn-delete-sm {
  opacity: 0.6;
}
.btn-delete-sm:hover {
  opacity: 1 !important;
  color: #e53935;
}

/* Notes list (middle column) */
.notes-fs-list {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.notes-fs-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.notes-fs-note-list {
  flex: 1;
  overflow-y: auto;
}
.fs-note-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  cursor: pointer;
  transition: background 0.15s;
}
.fs-note-item:hover {
  background: rgba(162, 210, 255, 0.1);
}
.fs-note-item.active {
  background: rgba(162, 210, 255, 0.2);
}
.fs-note-item-title {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-note-item-preview {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-note-item-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Editor (right column) */
.notes-fs-editor {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notes-fs-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.notes-fs-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.notes-fs-folder-select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8rem;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
}
.notes-fs-folder-select:focus {
  border-color: var(--theme-accent);
}
.notes-fs-editor-header .btn-submit {
  position: static;
}
.notes-fs-title-input {
  border: none;
  outline: none;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 16px 24px 8px;
  color: var(--text-primary);
}
.notes-fs-title-input::placeholder {
  color: var(--text-muted);
}
#notes-fs-quill {
  flex: 1;
  overflow-y: auto;
}
.notes-fs-quill-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notes-fs-quill-wrap .ql-toolbar {
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
}
.notes-fs-quill-wrap .ql-container {
  border: none;
  font-size: 0.95rem;
  flex: 1;
  overflow-y: auto;
}
.notes-fs-quill-wrap .ql-editor {
  padding: 16px 24px;
  min-height: 300px;
}
.btn-close-fs {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary);
  border-radius: 4px;
}
.btn-close-fs:hover {
  background: rgba(0,0,0,0.05);
}
.btn-close-fs .icon {
  width: 20px;
  height: 20px;
}

/* ===== Generic Fullscreen Overlay (Materials, Plans) ===== */
.generic-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #fff;
  padding: 24px 32px;
  overflow-y: auto;
}
.generic-fs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.generic-fs-header h2 {
  font-size: 1.2rem;
  color: var(--text-primary);
}
.generic-fullscreen-overlay .list {
  max-width: 720px;
  margin: 0 auto;
}
.generic-fullscreen-overlay .list .list-item:nth-child(n+7) {
  display: flex;
}
.generic-fullscreen-overlay .goals-list {
  max-width: 720px;
  margin: 0 auto;
}

/* ===== Sidebar ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 64px;
  height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: width 0.25s ease, transform 0.25s ease;
  overflow: hidden;
}
.sidebar.collapsed {
  width: 24px;
  border-right: none;
}
.sidebar.collapsed .sidebar-nav {
  display: none;
}
.sidebar.collapsed .sidebar-toggle {
  border-bottom: none;
  padding: 12px 4px;
  font-size: 1rem;
}
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  gap: 4px;
}
.sidebar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.65rem;
  cursor: pointer;
  border-radius: 8px;
  margin: 0 8px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.sidebar-item:hover {
  background: var(--theme-bg);
  color: var(--theme-action);
}
.sidebar-item .icon-sm {
  width: 20px;
  height: 20px;
}
.sidebar-toggle {
  padding: 12px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.2rem;
  font-weight: 600;
  transition: color 0.15s, background 0.15s;
}
.sidebar-toggle:hover {
  color: var(--theme-action);
  background: var(--theme-bg);
}

.sidebar-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 8px;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-user:hover {
  background: var(--theme-bg);
}
.sidebar-user .user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--theme-bg) center/cover no-repeat;
}
.sidebar-user-name {
  font-size: 0.7rem;
  color: var(--theme-action);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 56px;
}
.sidebar.collapsed .sidebar-user {
  display: none;
}

/* ===== Theme Picker ===== */
.theme-picker {
  display: flex;
  gap: 12px;
}
.theme-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, transform 0.3s, opacity 0.3s;
}
.theme-dot:hover {
  transform: scale(1.15);
}
.theme-dot.active {
  border-color: transparent;
  background: transparent;
}
.theme-dot.active::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: inherit;
  clip-path: path('M12 4.248C8.852-1.154 0 .423 0 7.192c0 4.661 5.571 9.427 12 15.808 6.43-6.381 12-11.147 12-15.808C24 .423 15.149-1.154 12 4.248z');
  animation: heartPop 0.3s ease forwards;
}
@keyframes heartPop {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  60% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.theme-dot--pink { background: #FFAFCC; }
.theme-dot--pink.active::after { background: #FFAFCC; }
.theme-dot--blue { background: #A2D2FF; }
.theme-dot--blue.active::after { background: #A2D2FF; }
.theme-dot--purple { background: #c4b0d6; }
.theme-dot--purple.active::after { background: #c4b0d6; }
.theme-dot--green { background: #a8d5ba; }
.theme-dot--green.active::after { background: #a8d5ba; }
.theme-dot--black { background: #444; }
.theme-dot--black.active::after { background: #444; }

/* ===== Responsive: hide sidebar on mobile ===== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  body { padding-left: 32px !important; }
}
