/* ── 侧边历史栏 ───────────────────────────────────────────────── */
#tab-today.with-sidebar {
  max-width: 1060px;
  display: flex;
  align-items: flex-start;
  gap: 24px;
}
#tab-today.with-sidebar #today-main { flex: 1; min-width: 0; }

#history-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 72px;
}

.sidebar-title {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}
.sidebar-loading,
.sidebar-empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 20px 0;
}

.sidebar-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  will-change: transform;
}
.si-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.si-mood { font-size: 18px; }
.si-date { font-size: 12px; color: var(--muted); }
.si-feeling { font-size: 11px; color: var(--muted); margin-left: auto; }
.si-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.si-highlight {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 2px solid var(--border);
  padding-left: 8px;
  margin-top: 6px;
}
.si-enc { font-size: 11px; color: var(--muted); margin-top: 4px; }
.si-enc-story { color: var(--accent); }

/* ── 他人日记面板 ─────────────────────────────────────────────── */
#right-col {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 72px;
  /* overflow 改为 visible，避免裁剪子卡片的 3D 倾斜效果和阴影 */
  overflow: visible;
  align-self: flex-start;
}
#social-panel {
  flex-shrink: 0;
  background: #fffdf9;
  border: 1px solid #ddd3c8;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 2px 14px rgba(90,52,18,0.07), 0 1px 3px rgba(90,52,18,0.04);
  will-change: transform;
}
.social-anon-note {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px dashed rgba(196, 121, 62, 0.28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.92), rgba(255, 255, 255, 0.96));
}
.social-anon-note p {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.social-anon-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(196, 121, 62, 0.12);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: .4px;
}
.social-empty-card {
  padding: 18px 14px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,250,244,0.88));
  text-align: center;
}
.social-empty-kicker {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 1.4px;
  color: var(--muted);
}
.social-empty-title {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text);
}
.social-empty-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}

.social-diary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  cursor: pointer;
  will-change: transform;
}
.social-author {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.social-author-name { color: var(--text); font-weight: 500; }
.social-mood-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.social-mood-emoji { font-size: 22px; }
.social-feeling { font-size: 12px; color: var(--muted); }
.social-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.social-highlight {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  border-left: 2px solid var(--accent);
  padding-left: 10px;
  margin-bottom: 10px;
}
.social-enc {
  font-size: 12px;
  color: var(--muted);
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}
.social-enc-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #fff;
  flex-shrink: 0;
}

/* 评论区 */
.social-comments { margin-bottom: 12px; }
.social-comments-title { font-size: 11px; color: var(--muted); letter-spacing: .5px; margin-bottom: 8px; }
.social-comment-item {
  font-size: 12px;
  line-height: 1.6;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.social-comment-item:last-child { border-bottom: none; }
.social-comment-author { color: var(--accent); font-weight: 500; margin-right: 4px; }
.social-comment-form { display: flex; flex-direction: column; gap: 6px; }
.social-comment-form textarea { resize: none; font-size: 13px; min-height: 60px; border-radius: 8px; }
.social-comment-submit { align-self: flex-end; font-size: 12px; padding: 6px 14px; }

/* ── 响应式 ───────────────────────────────────────────────────── */
@media (max-width: 600px) {
  #history-sidebar { display: none !important; }
}

@media (max-width: 900px) {
  #tab-today.with-sidebar { flex-direction: column; }
  #history-sidebar, #right-col {
    width: 100%;
    position: static;
    max-height: none;
  }
}

/* ── 待办面板 ─────────────────────────────────────────────────────── */
.todo-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.todo-tab {
  flex: 1;
  padding: 5px 0;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.todo-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
#todo-list {
  margin-bottom: 12px;
  min-height: 40px;
  max-height: calc(6 * 53px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.todo-item:last-child { border-bottom: none; }
.todo-check {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--muted);
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  margin-top: 2px;
  transition: all .15s;
}
.todo-check:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.todo-check:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 1px;
  width: 6px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.todo-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.todo-text {
  line-height: 1.5;
  color: var(--text);
  word-break: break-all;
}
.todo-text.done {
  text-decoration: line-through;
  color: var(--muted);
}
.todo-ddl-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.todo-ddl-btn {
  background: none;
  border: 1px dashed var(--border);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.todo-ddl-btn:hover { border-color: var(--accent); color: var(--accent); }
.todo-ddl-btn.has-ddl {
  border-style: solid;
  border-color: var(--accent);
  color: var(--accent);
}
.todo-ddl-input {
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 4px;
  background: var(--surface);
  color: var(--text);
  max-width: 130px;
}
.todo-completed-at {
  font-size: 11px;
  color: var(--muted);
}
.todo-del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.3;
  transition: opacity .15s;
}
.todo-item:hover .todo-del,
.todo-del:focus { opacity: 1; }
.todo-add-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.todo-add-row input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.todo-add-row input:focus {
  outline: none;
  border-color: var(--accent);
}
.todo-add-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity .15s;
}
.todo-add-btn:hover { opacity: .85; }

/* ── 待办面板 ────────────────────────────────────────────────────── */
#todo-panel {
  background: #fffdf9;
  border: 1px solid #ddd3c8;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 2px 14px rgba(90,52,18,0.07), 0 1px 3px rgba(90,52,18,0.04);
  will-change: transform;
}

/* ── 灵感记录面板 ─────────────────────────────────────────────────── */
#inspiration-panel {
  background: #fffdf9;
  border: 1px solid #ddd3c8;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 2px 14px rgba(90,52,18,0.07), 0 1px 3px rgba(90,52,18,0.04);
  will-change: transform;
}
#inspiration-list {
  margin-bottom: 12px;
  min-height: 20px;
  max-height: calc(6 * 53px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.inspiration-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.inspiration-item:last-child { border-bottom: none; }
.inspiration-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.inspiration-text {
  line-height: 1.5;
  word-break: break-all;
}
.inspiration-date {
  font-size: 11px;
  color: var(--muted);
}
