/* ===== 碎碎念 SuiNote 样式 ===== */
/* Copyright © 2026 SuiNote. All rights reserved. */

/* ===== 启动页 ===== */
.landing {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('heropage.png') center/cover no-repeat;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
}

.landing::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0.55;
  z-index: 0;
}

.landing-content {
  position: relative;
  z-index: 1;
}

.landing.hidden {
  opacity: 0;
  pointer-events: none;
}

.landing-content {
  display: flex;
  align-items: center;
  gap: 80px;
  max-width: 900px;
  padding: 40px;
}

.landing-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.landing-icon {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  border: 2px solid var(--border);
}


.landing-logo-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.landing-right {
  max-width: 480px;
}

.landing-title {
  font-size: 42px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.landing-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.landing-desc {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

.landing-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.landing-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.landing-feature-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.landing-feature strong {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}

.landing-feature p {
  font-size: 14px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

.landing-btn {
  padding: 12px 36px;
  background: var(--text-primary);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.landing-btn:hover {
  opacity: 0.85;
}

/* 启动页移动端适配 */
@media (max-width: 768px) {
  .landing-content {
    flex-direction: column;
    gap: 32px;
    text-align: center;
    padding: 40px 24px;
  }

  .landing-left {
    flex-direction: row;
    gap: 12px;
  }

  .landing-title {
    font-size: 32px;
  }

  .landing-desc {
    margin-bottom: 20px;
  }

  .landing-features {
    gap: 12px;
  }

  .landing-feature {
    text-align: left;
  }
}

/* ===== 基础重置 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* 主色调：黑白灰 */
  --bg: #FFFFFF;
  --bg-secondary: #F7F7F5;
  --bg-hover: #EFEFEF;
  --text-primary: #191919;
  --text-secondary: #6B6B6B;
  --text-tertiary: #9B9B9B;
  --border: #E8E8E8;
  --border-strong: #D4D4D4;
  --accent: #2383E2;

  /* 分类配色（Notion 风格柔和色） */
  --cat-idea: #9B59B6;
  --cat-idea-bg: #F4ECF7;
  --cat-todo: #E67E22;
  --cat-todo-bg: #FDF2E9;
  --cat-note: #2980B9;
  --cat-note-bg: #EBF5FB;
  --cat-secret: #E74C3C;
  --cat-secret-bg: #FDEDEC;

  /* 阴影 & 圆角 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
}

/* 暗色模式：手动切换或系统偏好 */
html.dark {
  --bg: #191919;
  --bg-secondary: #232323;
  --bg-hover: #2C2C2C;
  --text-primary: #EBEBEB;
  --text-secondary: #9B9B9B;
  --text-tertiary: #6B6B6B;
  --border: #2C2C2C;
  --border-strong: #3D3D3D;
  --accent: #529CCA;

  --cat-idea: #BB86FC;
  --cat-idea-bg: #2D1F3D;
  --cat-todo: #F0A050;
  --cat-todo-bg: #3D2E1A;
  --cat-note: #6CB4EE;
  --cat-note-bg: #1A2D3D;
  --cat-secret: #FF6B6B;
  --cat-secret-bg: #3D1A1A;
}

/* 未手动设置时，跟随系统 */
@media (prefers-color-scheme: dark) {
  html:not(.light):not(.dark) {
    --bg: #191919;
    --bg-secondary: #232323;
    --bg-hover: #2C2C2C;
    --text-primary: #EBEBEB;
    --text-secondary: #9B9B9B;
    --text-tertiary: #6B6B6B;
    --border: #2C2C2C;
    --border-strong: #3D3D3D;
    --accent: #529CCA;

    --cat-idea: #BB86FC;
    --cat-idea-bg: #2D1F3D;
    --cat-todo: #F0A050;
    --cat-todo-bg: #3D2E1A;
    --cat-note: #6CB4EE;
    --cat-note-bg: #1A2D3D;
    --cat-secret: #FF6B6B;
    --cat-secret-bg: #3D1A1A;
  }
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== App 布局 ===== */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 680px;
  margin: 0 auto;
}

/* ===== 顶部栏 ===== */
.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.app-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.subscription-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0;
}

.subscription-badge.paid {
  background: var(--accent);
  color: white;
}

.subscription-badge.trial {
  background: #e67e22;
  color: white;
}

.app-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-toggle {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.toggle-btn {
  padding: 5px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.toggle-btn.active {
  background: var(--text-primary);
  color: var(--bg);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

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

/* ===== 搜索栏 ===== */
.search-bar {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.search-bar input {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

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

/* ===== 筛选标签 ===== */
.filter-tags {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}

.filter-tag {
  padding: 3px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.filter-tag.active {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
}

/* ===== 日期分组 ===== */
.date-group {
  margin-bottom: 4px;
}

.date-separator {
  display: flex;
  align-items: center;
  padding: 10px 0 6px;
}

.date-separator::before,
.date-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.date-label {
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ===== 时间线切换 ===== */
.timeline-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  padding: 3px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.timeline-mode-btn {
  flex: 1;
  padding: 5px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
}

.timeline-mode-btn.active {
  background: var(--text-primary);
  color: var(--bg);
}

.inline-category {
  margin: 8px 0;
  padding-left: 8px;
  border-left: 2px solid var(--border);
}

.inline-category-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  padding: 1px 6px;
  border-radius: 3px;
  margin-bottom: 4px;
}

/* ===== 内容区域 ===== */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

/* ===== 空状态 ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  color: var(--text-tertiary);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-state p {
  font-size: 15px;
}

.empty-hint {
  font-size: 13px;
  margin-top: 4px;
  opacity: 0.6;
}

/* ===== 笔记卡片 ===== */
.note-card {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  margin-bottom: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.15s;
}

.note-card:hover {
  box-shadow: var(--shadow);
}

.note-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.note-time {
  font-size: 12px;
  color: var(--text-tertiary);
}

.note-category {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 3px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.note-category:hover {
  opacity: 0.8;
}

.note-category[data-cat="想法"] {
  background: var(--cat-idea-bg);
  color: var(--cat-idea);
}

.note-category[data-cat="待办"] {
  background: var(--cat-todo-bg);
  color: var(--cat-todo);
}

.note-category[data-cat="笔记"] {
  background: var(--cat-note-bg);
  color: var(--cat-note);
}

.note-category[data-cat="密码/密钥"] {
  background: var(--cat-secret-bg);
  color: var(--cat-secret);
}

.note-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.note-tag {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 1px 6px;
  border-radius: 3px;
}

.note-content {
  font-size: 14px;
  color: var(--text-primary);
  overflow-wrap: break-word;
  line-height: 1.6;
  cursor: pointer;
}

/* 密码/密钥：默认模糊，hover 显示 */
.note-content[data-cat="密码/密钥"] {
  filter: blur(4px);
  transition: filter 0.2s;
}

.note-content[data-cat="密码/密钥"]:hover {
  filter: blur(1px);
}

/* 编辑时取消模糊 */
.note-content[data-cat="密码/密钥"]:has(.inline-edit-area) {
  filter: none;
}

.inline-edit-area {
  width: 100%;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  padding: 6px 8px;
  outline: none;
  resize: none;
  font-family: inherit;
  overflow: hidden;
}

.note-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.15s;
}

.note-card:hover .note-actions {
  opacity: 1;
}

.note-action-btn {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

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

.note-action-btn.edit:hover {
  background: var(--cat-note-bg);
  color: var(--cat-note);
  border-color: var(--cat-note);
}

.note-action-btn.delete:hover {
  background: var(--cat-secret-bg);
  color: var(--cat-secret);
  border-color: var(--cat-secret);
}

/* 分类中状态 */
.note-category.loading {
  opacity: 0.5;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.2; }
}

/* ===== 批量管理模式 ===== */
.note-card.batch-mode {
  padding-left: 40px;
  position: relative;
}

.note-checkbox {
  position: absolute;
  left: 12px;
  top: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.note-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  gap: 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
}

.batch-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.batch-actions {
  display: flex;
  gap: 8px;
}

.batch-delete-btn:hover {
  background: var(--cat-secret-bg);
  color: var(--cat-secret);
  border-color: var(--cat-secret);
}

.icon-btn.active {
  background: var(--accent);
  color: white;
}

/* ===== 分类视图（整合模式） ===== */
.consolidated-group {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.consolidated-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.consolidated-header:hover {
  background: var(--bg-hover);
}

.consolidated-arrow {
  font-size: 10px;
  color: var(--text-tertiary);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.consolidated-group.expanded .consolidated-arrow {
  transform: rotate(90deg);
}

.consolidated-icon {
  font-size: 18px;
}

.consolidated-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  color: var(--text-primary);
}

.consolidated-count {
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.consolidated-list {
  padding: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.consolidated-list.collapsed {
  max-height: 0;
}

.consolidated-list.expanded {
  max-height: 5000px;
}

.consolidated-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

.consolidated-item {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.consolidated-item:last-child {
  border-bottom: none;
}

.consolidated-item:hover {
  background: var(--bg-hover);
}

.item-content {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  word-break: break-word;
  cursor: pointer;
}

.item-secret {
  filter: blur(5px);
  transition: filter 0.2s;
}

.consolidated-item:hover .item-secret {
  filter: none;
}

.item-secret:has(.inline-edit-area) {
  filter: none;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.item-time {
  font-size: 11px;
  color: var(--text-tertiary);
}

.item-tags {
  display: flex;
  gap: 4px;
  flex: 1;
}

.item-tag {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 1px 6px;
  border-radius: 3px;
}

.item-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.consolidated-item:hover .item-actions {
  opacity: 1;
}

.item-action-btn {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

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

.item-action-btn.edit:hover {
  background: var(--cat-note-bg);
  color: var(--cat-note);
  border-color: var(--cat-note);
}

.item-action-btn.delete:hover {
  background: var(--cat-secret-bg);
  color: var(--cat-secret);
  border-color: var(--cat-secret);
}

/* ===== 输入区 ===== */
.input-area {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}

.input-wrapper:focus-within {
  border-color: var(--accent);
}

#noteInput {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  max-height: 120px;
  font-family: inherit;
}

#noteInput::placeholder {
  color: var(--text-tertiary);
}

.send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--text-primary);
  color: var(--bg);
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.send-btn:hover {
  opacity: 0.85;
}

.send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ===== 弹窗 ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 440px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 80vh;
  overflow-y: auto;
}

.modal-small {
  max-width: 300px;
}

/* ===== 订阅定价弹窗 ===== */
.modal-pricing {
  max-width: 600px;
}

.trial-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #f0f7ff, #e8f4fd);
  border: 1px solid #c5ddf5;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

html.dark .trial-banner {
  background: linear-gradient(135deg, #1a2d3d, #1a3040);
  border-color: #2a4a5f;
}

.trial-icon {
  font-size: 18px;
}

.trial-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
}

.pricing-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.plan-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.plan-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 10px;
}

.plan-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
}

.plan-period {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.plan-prices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.plan-price-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-price-option input[type="radio"] {
  accent-color: var(--accent);
}

.plan-price-option label {
  display: flex;
  align-items: baseline;
  gap: 4px;
  cursor: pointer;
  font-size: 14px;
}

.price-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.price-unit {
  font-size: 13px;
  color: var(--text-secondary);
}

.price-save {
  font-size: 11px;
  color: #e67e22;
  background: #fdf2e9;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
}

html.dark .price-save {
  background: #3d2e1a;
  color: #f0a050;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.plan-features li {
  font-size: 13px;
  padding: 4px 0;
  color: var(--text-secondary);
}

.feature-disabled {
  opacity: 0.5;
}

.btn-subscribe {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
}

.activate-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.upgrade-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: center;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
}

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

.modal-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-body {
  padding: 8px 20px 16px;
}

.modal-footer {
  padding: 10px 20px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ===== 设置表单 ===== */
.setting-group {
  margin-bottom: 16px;
}

.setting-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.setting-group input[type="password"],
.setting-group input[type="text"],
.setting-group input[type="email"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.setting-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  transition: border-color 0.15s;
}

.setting-group textarea:focus {
  border-color: var(--accent);
}

.setting-group input:focus {
  border-color: var(--accent);
}

.setting-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 3px;
}

.setting-actions {
  display: flex;
  gap: 8px;
}

/* ===== 按钮 ===== */
.btn {
  padding: 7px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

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

.btn-primary:hover {
  opacity: 0.85;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

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

/* ===== 分类选项弹窗 ===== */
.category-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-option {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.category-option:hover {
  background: var(--bg-hover);
}

.category-option.active {
  background: var(--bg-secondary);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

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

/* ===== 响应式：小屏手机 ≤480px ===== */
@media (max-width: 480px) {
  .app-bar {
    padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top, 0));
  }

  .app-title {
    font-size: 15px;
  }

  .toggle-btn {
    padding: 4px 10px;
    font-size: 12px;
  }

  .content {
    padding: 6px 10px;
  }

  .input-area {
    padding: 6px 10px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0));
  }

  .input-wrapper {
    padding: 6px 10px;
  }

  #noteInput {
    font-size: 14px;
    max-height: 80px;
  }

  .note-card {
    padding: 8px 10px;
    margin-bottom: 4px;
  }

  .note-actions {
    opacity: 1;
  }
}

/* ===== 响应式：平板 481px-768px ===== */
@media (min-width: 481px) and (max-width: 768px) {
  .note-actions {
    opacity: 1;
  }
}

/* ===== 响应式：小笔记本/平板横屏 769px-1024px ===== */
@media (min-width: 769px) and (max-width: 1024px) {
  #app {
    max-width: 900px;
  }

  .filter-tags {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .note-actions {
    opacity: 1;
  }

  #noteInput {
    max-height: 150px;
  }

  .modal-content {
    max-width: 520px;
  }
}

/* ===== 响应式：桌面 ≥1025px ===== */
@media (min-width: 1025px) {
  #app {
    max-width: 1000px;
  }

  .filter-tags {
    flex-wrap: wrap;
    overflow-x: visible;
    gap: 8px;
    padding: 12px 20px;
  }

  #noteInput {
    max-height: 180px;
  }

  .modal-content {
    max-width: 560px;
  }

  .content {
    padding: 16px 24px;
  }

  .input-area {
    padding: 12px 24px;
  }
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ===== Toast 提示 ===== */
@keyframes fadeInOut {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  85% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ===== 登录注册 ===== */
.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 12px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
  padding: 0;
}

.link-btn:hover {
  opacity: 0.8;
}

.btn-full {
  width: 100%;
}

/* 用户头像/菜单 */
.user-menu {
  position: relative;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 50;
  overflow: hidden;
}

.user-dropdown.hidden {
  display: none;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: var(--bg-hover);
}

.dropdown-item.danger {
  color: var(--cat-secret);
}

.dropdown-email {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border);
  word-break: break-all;
}

/* 账号设置区域 */
.account-section {
  text-align: center;
  padding: 8px 0;
}

.account-email {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.account-status {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

/* 密码强度提示 */
.password-strength {
  margin-top: 6px;
  min-height: 20px;
}

.strength-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}

.strength-fill.weak {
  width: 33%;
  background: var(--cat-secret);
}

.strength-fill.medium {
  width: 66%;
  background: var(--cat-todo);
}

.strength-fill.strong {
  width: 100%;
  background: #27ae60;
}

.strength-text {
  font-size: 12px;
}

.strength-text.weak {
  color: var(--cat-secret);
}

.strength-text.medium {
  color: var(--cat-todo);
}

.strength-text.strong {
  color: #27ae60;
}

.password-match {
  font-size: 12px;
  margin-top: 4px;
  min-height: 16px;
}

.password-match.match {
  color: #27ae60;
}

.password-match.no-match {
  color: var(--cat-secret);
}

/* 验证码 */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.captcha-row input {
  flex: 1;
  max-width: 100px;
}

.captcha-question {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  user-select: none;
  white-space: nowrap;
}

/* ===== 回收站 ===== */
.trash-list {
  max-height: 400px;
  overflow-y: auto;
}

.trash-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.trash-item:last-child {
  border-bottom: none;
}

.trash-item:hover {
  background: var(--bg-hover);
}

.trash-item-content {
  flex: 1;
  min-width: 0;
}

.trash-item-text {
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trash-item-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.trash-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.trash-btn {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

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

.trash-btn.restore:hover {
  background: var(--cat-note-bg);
  color: var(--cat-note);
  border-color: var(--cat-note);
}

.trash-btn.delete:hover {
  background: var(--cat-secret-bg);
  color: var(--cat-secret);
  border-color: var(--cat-secret);
}

.trash-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
}

.trash-clear-btn {
  color: var(--cat-secret);
  border-color: var(--cat-secret);
}

.trash-clear-btn:hover {
  background: var(--cat-secret-bg);
}

/* 时间线工具栏 */
.timeline-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.timeline-toolbar .timeline-toggle {
  flex: 1;
  margin-bottom: 0;
}

/* AI 总结 */
.summary-content {
  min-height: 100px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.summary-loading {
  text-align: center;
  color: var(--text-tertiary);
  animation: pulse 1.5s infinite;
}
