/* ==========================================================================
   Notepook - 纯前端毛玻璃记事本核心样式表
   ========================================================================== */

/* --- 1. 变量与基础重置 --- */
:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-main);
  
  /* 配色系统 */
  --bg-gradient: linear-gradient(135deg, #0b0f19 0%, #111827 50%, #1e1b4b 100%);
  --accent-color: #6366f1;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --accent-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #111827;
  
  /* 玻璃拟态参数 */
  --glass-bg: rgba(17, 24, 39, 0.45);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  --glass-blur: blur(16px) saturate(180%);
  --glass-focus-border: rgba(99, 102, 241, 0.4);
  --glass-focus-shadow: 0 8px 32px 0 rgba(99, 102, 241, 0.15);
  
  /* 状态颜色 */
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

body {
  font-family: var(--font-main);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
  position: relative;
}

/* 装饰性背景光球 */
body::before, body::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.25;
  pointer-events: none;
}
body::before {
  top: 10%;
  left: 10%;
  background: #4f46e5;
}
body::after {
  bottom: 10%;
  right: 10%;
  background: #7c3aed;
}

/* --- 2. 滚动条美化 --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* --- 3. 玻璃卡片基类 --- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 4. 登录屏蔽罩 (Active Glassmorphism) --- */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.6);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.login-card {
  width: 90%;
  max-width: 440px;
  padding: 40px;
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  border-radius: 24px;
  text-align: center;
  backdrop-filter: blur(10px);
  transform: translateY(20px);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.overlay.active .login-card {
  transform: translateY(0);
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: var(--accent-gradient);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}
.logo-icon i {
  width: 32px;
  height: 32px;
  color: white;
}

.login-header h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #fff;
}
.login-header p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
  line-height: 1.5;
}

.input-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.input-group input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  outline: none;
  transition: all 0.3s;
}
.input-group input:focus {
  border-color: var(--accent-color);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.2);
}
.input-group button {
  width: 100%;
  padding: 16px;
  background: var(--accent-gradient);
  border: none;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}
.input-group button:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}
.input-group button i {
  width: 18px;
  height: 18px;
  transition: transform 0.3s;
}
.input-group button:hover i {
  transform: translateX(3px);
}

.error-msg {
  color: var(--color-danger);
  font-size: 13px;
  margin-top: 16px;
  min-height: 20px;
  opacity: 0;
  transition: opacity 0.3s;
}
.error-msg.active {
  opacity: 1;
}

/* --- 5. 主布局结构 --- */
.app-container {
  width: 100%;
  max-width: 1200px;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  align-items: start;
}

/* --- 6. 侧边栏及组件 --- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 个人资料卡 */
.profile-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}
.profile-avatar {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.profile-info {
  flex-grow: 1;
  min-width: 0;
}
.profile-info h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-info .badge {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 20px;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.2);
}
.icon-btn-danger {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
}
.icon-btn-danger i {
  width: 18px;
  height: 18px;
}

/* 统计卡 */
.stats-widget {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  text-align: center;
}
.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stats-widget .divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
}

/* 标签云卡 */
.tags-cloud-widget {
  padding: 20px;
}
.tags-cloud-widget h4, .heatmap-widget h4 {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tags-cloud-widget h4 i, .heatmap-widget h4 i {
  width: 16px;
  height: 16px;
  color: var(--accent-color);
}
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}
.tag-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tag-badge:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
}
.tag-badge.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}
.tag-count {
  font-size: 9px;
  opacity: 0.75;
  background: rgba(0,0,0,0.25);
  padding: 1px 4px;
  border-radius: 10px;
}
.empty-text {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  padding: 10px 0;
  text-align: center;
  width: 100%;
}

/* 热力图卡 */
.heatmap-widget {
  padding: 20px;
}
.heatmap-container {
  overflow-x: auto;
  padding-bottom: 6px;
  width: 100%;
}
.heatmap-grid {
  display: grid;
  grid-template-flow: column; /* 按列排，每列代表一周，一共7行代表周日到周六 */
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 10px);
  gap: 2.5px;
}
.heatmap-cell {
  width: 10px;
  height: 10px;
  border-radius: 1.5px;
  background: rgba(255, 255, 255, 0.05);
  transition: transform 0.1s;
  position: relative;
  cursor: pointer;
}
.heatmap-cell:hover {
  transform: scale(1.3);
  z-index: 2;
}

/* 提示框 tooltip */
.heatmap-cell::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: #1e293b;
  color: #fff;
  padding: 4px 8px;
  font-size: 10px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: all 0.15s ease;
  border: 1px solid rgba(255,255,255,0.08);
}
.heatmap-cell:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.heatmap-cell.level-0 { background: rgba(255, 255, 255, 0.05); }
.heatmap-cell.level-1 { background: rgba(168, 85, 247, 0.25); border: 1px solid rgba(168, 85, 247, 0.2); }
.heatmap-cell.level-2 { background: rgba(168, 85, 247, 0.55); }
.heatmap-cell.level-3 { background: rgba(168, 85, 247, 0.95); box-shadow: 0 0 6px rgba(168, 85, 247, 0.4); }

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 10px;
  font-size: 10px;
  color: var(--text-muted);
}
.legend-cells {
  display: flex;
  gap: 2px;
}
.legend-cell {
  width: 8px;
  height: 8px;
  border-radius: 1px;
}

/* --- 7. 头部控制区 --- */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.search-bar {
  flex-grow: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}
.search-bar input {
  width: 100%;
  padding: 10px 40px 10px 42px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}
.search-bar input:focus {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--glass-focus-border);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}
.clear-btn, .icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}
.clear-btn:hover, .icon-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.clear-btn i, .icon-btn i {
  width: 16px;
  height: 16px;
}
.search-bar .clear-btn {
  position: absolute;
  right: 12px;
  padding: 4px;
}

.date-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.date-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 6px 12px;
}
.date-input-wrapper i {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  margin-right: 8px;
}
.date-input-wrapper input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
/* 暗黑模式下清除日期选择器的默认样式 */
::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.6;
  cursor: pointer;
}
::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
.hide {
  display: none !important;
}

/* --- 8. 编辑器模块 --- */
.editor-section {
  position: relative;
  padding: 16px;
  display: flex;
  flex-direction: column;
}
/* 拖拽提示层 */
.drag-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  border: 2px dashed var(--accent-color);
}
.editor-section.dragover .drag-overlay {
  opacity: 1;
  pointer-events: auto;
}
.drag-message {
  text-align: center;
  color: #a5b4fc;
}
.drag-message i {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  animation: bounce 1.5s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.editor-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}
.editor-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.editor-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}
.editor-tab.active {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  font-weight: 600;
}
.editor-tab i {
  width: 14px;
  height: 14px;
}

.editor-body {
  position: relative;
  min-height: 140px;
}
#note-textarea {
  width: 100%;
  height: 140px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  padding: 4px;
}
#note-preview {
  width: 100%;
  min-height: 140px;
  padding: 4px 4px 20px;
  overflow-y: auto;
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-wrap: wrap;
  gap: 12px;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.tool-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tool-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.tool-btn i {
  width: 16px;
  height: 16px;
}
.divider-v {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 4px;
}
.upload-status-text {
  font-size: 11px;
  color: var(--accent-color);
  margin-left: 6px;
  font-style: italic;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-btn {
  background: var(--accent-gradient);
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 500;
  font-size: 13.5px;
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}
.primary-btn:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.3);
}
.primary-btn kbd {
  font-size: 10px;
  font-family: inherit;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 1.5px 5px;
  border-radius: 4px;
  opacity: 0.8;
}

/* --- 9. 过滤指示栏 --- */
.filter-indicator-bar {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.25);
}
.indicator-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: #a5b4fc;
}
.indicator-text i {
  width: 16px;
  height: 16px;
}
.clear-filter-btn {
  background: transparent;
  border: none;
  color: #a5b4fc;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}
.clear-filter-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  color: white;
}
.clear-filter-btn i {
  width: 14px;
  height: 14px;
}

/* --- 10. 笔记卡片流及 Markdown 渲染样式 --- */
.notes-stream {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 加载动画 */
.loading-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  gap: 16px;
  color: var(--text-muted);
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.note-card {
  padding: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.note-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

.note-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.note-author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.note-avatar {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.note-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.note-meta h5 {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.note-time {
  font-size: 11px;
  color: var(--text-muted);
}
.note-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.note-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.note-action-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.note-action-btn.edit:hover {
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.1);
}
.note-action-btn.delete:hover {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.1);
}
.note-action-btn i {
  width: 14px;
  height: 14px;
}

/* 笔记内容排版 (Markdown & HTML) */
.note-card-body {
  word-break: break-word;
  line-height: 1.6;
  font-size: 13.5px;
}

.markdown-body {
  color: var(--text-main);
}
.markdown-body p {
  margin-bottom: 12px;
}
.markdown-body p:last-child {
  margin-bottom: 0;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: #fff;
  margin: 16px 0 10px;
}
.markdown-body h1 { font-size: 18px; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 4px; }
.markdown-body h2 { font-size: 16px; }
.markdown-body h3 { font-size: 14.5px; }

.markdown-body code {
  font-family: Consolas, Monaco, "Courier New", monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  color: #f472b6;
}
.markdown-body pre {
  background: rgba(10, 10, 15, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 14px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 14px 0;
}
.markdown-body pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: 12px;
}

.markdown-body blockquote {
  border-left: 4px solid var(--accent-color);
  padding-left: 14px;
  color: var(--text-muted);
  margin: 14px 0;
  font-style: italic;
}

.markdown-body ul, .markdown-body ol {
  padding-left: 20px;
  margin-bottom: 12px;
}
.markdown-body li {
  margin-bottom: 4px;
}

/* 美化图片和媒体文件 */
.markdown-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 8px 0;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 0.25s ease;
}
.markdown-body img:hover {
  transform: scale(1.01);
}

.markdown-body a {
  color: #818cf8;
  text-decoration: none;
  border-bottom: 1px dashed rgba(129, 140, 248, 0.4);
  transition: all 0.2s;
}
.markdown-body a:hover {
  color: #a5b4fc;
  border-bottom-style: solid;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13px;
}
.markdown-body th, .markdown-body td {
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px 12px;
  text-align: left;
}
.markdown-body th {
  background: rgba(255,255,255,0.03);
  font-weight: 600;
  color: #fff;
}
.markdown-body tr:nth-child(even) {
  background: rgba(255,255,255,0.01);
}

/* 任务列表 */
.markdown-body .task-list-item {
  list-style-type: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.markdown-body input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  background: transparent;
  flex-shrink: 0;
}
.markdown-body input[type="checkbox"]:checked {
  background: var(--accent-color);
  border-color: var(--accent-color);
}
.markdown-body input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 4.5px;
  width: 3.5px;
  height: 7.5px;
  border: solid white;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.note-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.04);
}
.note-tag {
  font-size: 10.5px;
  color: #a5b4fc;
  cursor: pointer;
  transition: opacity 0.2s;
}
.note-tag:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* --- 11. 响应式布局自适应 --- */
@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
    padding: 20px 10px;
    gap: 20px;
  }
  .sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .profile-card {
    grid-column: span 2;
  }
  .stats-widget {
    height: 100%;
  }
  .tags-cloud-widget {
    grid-column: span 2;
  }
  .heatmap-widget {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .sidebar {
    grid-template-columns: 1fr;
  }
  .profile-card, .stats-widget, .tags-cloud-widget, .heatmap-widget {
    grid-column: span 1;
  }
  .editor-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .primary-btn {
    justify-content: center;
  }
}
