/* ============================================
   Books Companion · 治愈系手账风
   奶油 → 浅绿渐变背景 + 圆角卡片 + 柔和投影
   手绘 SVG 图标（云/植物/太阳/书/笔/心/星星）
   ============================================ */

:root {
  /* 治愈系配色 */
  --cream: #FAF6EC;          /* 奶油色 */
  --cream-deep: #F2EAD3;     /* 深奶油 */
  --mint: #E8F3E0;           /* 浅绿 */
  --mint-deep: #C9E2BD;      /* 深薄荷 */
  --sage: #7CA982;           /* 鼠尾草绿（主） */
  --sage-deep: #5B8C5F;      /* 深鼠尾草 */
  --honey: #E8C07D;          /* 蜜糖 */
  --honey-deep: #C9923E;     /* 深蜜糖 */
  --lavender: #C8A2C8;       /* 柔紫（辅） */
  --coral: #E89B83;          /* 柔珊瑚（强调） */
  --soil: #3A4A3F;           /* 深橄榄（主文字） */
  --soil-soft: #6B7B6F;      /* 柔土壤（次文字） */
  --soil-light: #A0AFA3;     /* 浅土壤（最次文字） */
  --line: rgba(58, 74, 63, 0.08);    /* 卡片边框 */
  --line-soft: rgba(58, 74, 63, 0.05);
  --shadow-sm: 0 2px 8px rgba(58, 74, 63, 0.04);
  --shadow-md: 0 4px 16px rgba(58, 74, 63, 0.06);
  --shadow-lg: 0 8px 32px rgba(58, 74, 63, 0.10);
  --shadow-float: 0 12px 36px rgba(124, 169, 130, 0.25);

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: "SF Mono", "Menlo", "Consolas", monospace;
}

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

html, body {
  background: linear-gradient(135deg, var(--cream) 0%, var(--mint) 100%);
  background-attachment: fixed;
  color: var(--soil);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* SVG 装饰背景 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(232, 192, 125, 0.08) 0%, transparent 30%),
    radial-gradient(circle at 90% 80%, rgba(200, 162, 200, 0.06) 0%, transparent 30%);
  z-index: 0;
}

a { color: var(--sage-deep); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--sage); text-decoration: underline; text-decoration-color: var(--mint-deep); }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: var(--soil);
}

/* ============================================
   容器（保持 max-width 960 不变）
   ============================================ */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 32px 100px;
  position: relative;
  z-index: 1;
}

/* ============================================
   首页头部
   ============================================ */
.hero {
  margin-bottom: 40px;
  padding-bottom: 24px;
  position: relative;
}

.hero-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--soil);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-title .hand-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.hero-subtitle {
  font-size: 14px;
  color: var(--soil-soft);
  margin-bottom: 24px;
  font-style: italic;
}

.hero-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  padding: 16px 24px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 80px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--sage-deep);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12px;
  color: var(--soil-soft);
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-label .mini-icon {
  width: 12px;
  height: 12px;
}

/* ============================================
   时间线侧栏
   ============================================ */
.list-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.timeline-sidebar {
  flex-shrink: 0;
  width: 180px;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  position: sticky;
  top: 20px;
  box-shadow: var(--shadow-sm);
}

.timeline-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--sage-deep);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-left: 8px;
}

.timeline-list {
  position: relative;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.timeline-item:hover {
  background: rgba(150, 196, 165, 0.1);
}

.timeline-item.active {
  background: linear-gradient(90deg, rgba(150, 196, 165, 0.2), rgba(150, 196, 165, 0.05));
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mint-deep);
  border: 2px solid var(--cream);
  box-shadow: 0 0 0 2px var(--mint-deep);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.timeline-dot::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 30px;
  background: linear-gradient(180deg, var(--mint-deep), transparent);
  z-index: 1;
}

.timeline-dot.last::before {
  display: none;
}

.timeline-dot-all {
  background: var(--honey);
  box-shadow: 0 0 0 2px var(--honey);
}

.timeline-dot-all::before {
  background: linear-gradient(180deg, var(--honey), var(--mint-deep));
}

.timeline-year {
  font-size: 14px;
  font-weight: 600;
  color: var(--soil);
  font-variant-numeric: tabular-nums;
  flex: 1;
}

.timeline-item.active .timeline-year {
  color: var(--sage-deep);
  font-weight: 700;
}

.timeline-count {
  font-size: 12px;
  color: var(--soil-soft);
  background: var(--mint);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.timeline-item.active .timeline-count {
  background: var(--sage-deep);
  color: white;
}

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

@media (max-width: 768px) {
  .list-layout {
    flex-direction: column;
  }
  .timeline-sidebar {
    width: 100%;
    position: static;
  }
  .timeline-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .timeline-item {
    flex-shrink: 0;
  }
  .timeline-dot::before {
    display: none;
  }
}

/* ============================================
   筛选条
   ============================================ */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.filter-chip {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  font-size: 12px;
  color: var(--soil-soft);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
  transition: all 0.2s;
  font-weight: 500;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--mint-deep);
  color: var(--sage-deep);
  transform: translateY(-1px);
}

.filter-chip.active {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 169, 130, 0.3);
}

/* ============================================
   书目网格（圆角卡片 + 柔和投影）
   ============================================ */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.book-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.book-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--mint-deep), var(--honey), var(--lavender));
  opacity: 0.6;
  transition: opacity 0.25s;
}

.book-card:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: var(--mint-deep);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.book-card:hover::before {
  opacity: 1;
}

.book-card-year {
  font-size: 11px;
  font-weight: 600;
  color: var(--sage-deep);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 4px;
}

.book-card-year .mini-icon {
  width: 14px;
  height: 14px;
}

/* 紧凑版书卡片 */
.book-card-compact {
  padding: 14px 18px;
  margin-bottom: 8px;
}

.book-card-compact .book-card-year {
  font-size: 11px;
  margin-bottom: 2px;
  opacity: 0.7;
}

.book-card-compact .book-card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 0;
}

.book-card-compact .book-card-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  word-break: break-word;
  line-height: 1.3;
}

.book-card-compact .book-card-category {
  flex-shrink: 0;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--mint);
  color: var(--sage-deep);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
  white-space: nowrap;
}

.book-card-compact .book-card-category svg {
  width: 10px;
  height: 10px;
}

.book-card-compact .book-card-author {
  font-size: 12px;
  color: var(--soil-soft);
  margin-top: 1px;
  line-height: 1.3;
}

.book-card-compact .book-card-summary {
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.5;
  color: var(--soil-soft);
}

.book-card-compact .book-card-summary.empty {
  font-style: italic;
  opacity: 0.6;
}

.book-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--soil);
  line-height: 1.35;
  letter-spacing: -0.2px;
}

.book-card-author {
  font-size: 13px;
  color: var(--soil-soft);
  font-style: italic;
}

.book-card-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  color: var(--sage-deep);
  background: var(--mint);
  align-self: flex-start;
  margin-top: 4px;
  font-weight: 500;
}

.book-card-category .mini-icon {
  width: 12px;
  height: 12px;
}

.book-card-summary {
  font-size: 13px;
  color: var(--soil-soft);
  margin-top: 10px;
  line-height: 1.65;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.book-card-summary.empty {
  color: var(--soil-light);
  font-style: italic;
}

.book-card-actions {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

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

.card-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--soil-soft);
}

.card-icon-btn:hover {
  background: var(--mint);
  color: var(--sage-deep);
  transform: scale(1.1);
}

.card-icon-btn.delete:hover {
  background: #FBE6E0;
  color: #C2553A;
  border-color: #E89B83;
}

.card-icon-btn .mini-icon {
  width: 14px;
  height: 14px;
}

/* ============================================
   浮动新建按钮（右下角圆形）
   ============================================ */
.fab {
  position: fixed;
  right: 32px;
  bottom: 32px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-deep) 100%);
  color: #fff;
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-float);
  z-index: 100;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 16px 44px rgba(124, 169, 130, 0.35);
}

.fab:active {
  transform: translateY(0) scale(0.98);
}

.fab .fab-icon {
  width: 28px;
  height: 28px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fab-tooltip {
  position: absolute;
  right: 76px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--soil);
  color: var(--cream);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.fab-tooltip::after {
  content: '';
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: var(--soil);
}

.fab:hover .fab-tooltip {
  opacity: 1;
}

/* ============================================
   详情页
   ============================================ */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--soil-soft);
  margin-bottom: 24px;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.2s;
}

.detail-back:hover {
  color: var(--sage-deep);
  text-decoration: none;
}

.detail-back .mini-icon {
  width: 16px;
  height: 16px;
}

.detail-header {
  padding: 28px 32px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 20px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.detail-meta-top {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--soil-soft);
  flex-wrap: wrap;
}

.detail-year {
  font-weight: 600;
  color: var(--sage-deep);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.detail-status {
  padding: 3px 10px;
  border-radius: 10px;
  background: var(--mint);
  color: var(--sage-deep);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.detail-status.finished {
  background: var(--mint-deep);
  color: var(--sage-deep);
}

.detail-status .mini-icon {
  width: 12px;
  height: 12px;
}

.detail-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--soil);
  margin-bottom: 8px;
  letter-spacing: -0.6px;
  line-height: 1.2;
}

.detail-author {
  font-size: 15px;
  color: var(--soil-soft);
  margin-bottom: 16px;
  font-style: italic;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.detail-tag {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  color: var(--honey-deep);
  background: rgba(232, 192, 125, 0.18);
  font-weight: 500;
}

.detail-keyquote {
  padding: 14px 18px;
  background: var(--cream-deep);
  border-left: 3px solid var(--honey);
  border-radius: 12px;
  font-size: 14px;
  color: var(--soil);
  font-style: italic;
  line-height: 1.7;
  margin-top: 16px;
}

.detail-keyquote-label {
  display: block;
  font-size: 11px;
  color: var(--honey-deep);
  margin-bottom: 6px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.detail-edit-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--mint);
  color: var(--sage-deep);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}

.detail-edit-btn:hover {
  background: var(--sage);
  color: #fff;
}

.detail-edit-btn .mini-icon {
  width: 12px;
  height: 12px;
}

/* ============================================
   详情页元信息网格
   ============================================ */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  margin-bottom: 32px;
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
}

.meta-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 11px;
  color: var(--soil-soft);
  letter-spacing: 0.5px;
  font-weight: 500;
}

.meta-value {
  font-size: 14px;
  color: var(--soil);
  font-variant-numeric: tabular-nums;
}

.meta-value.empty {
  color: var(--soil-light);
  font-style: italic;
}

/* ============================================
   Tabs（柔化版）
   ============================================ */
.tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.5);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 28px;
  border: 1px solid var(--line-soft);
  width: fit-content;
}

.tab {
  padding: 5px 12px;
  font-size: 12px;
  color: var(--soil-soft);
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.3;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--soil);
}

.tab.active {
  background: var(--sage);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 169, 130, 0.3);
}

.tab .mini-icon {
  width: 14px;
  height: 14px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* ============================================
   笔记区
   ============================================ */
.section {
  margin-bottom: 28px;
  padding: 24px 28px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--sage-deep);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.3px;
}

.section-title .mini-icon {
  width: 18px;
  height: 18px;
}

.section-edit-btn {
  padding: 4px 10px;
  border-radius: 10px;
  background: transparent;
  color: var(--soil-soft);
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-edit-btn:hover {
  background: var(--mint);
  color: var(--sage-deep);
}

.section-edit-btn .mini-icon {
  width: 12px;
  height: 12px;
}

.section-body {
  font-size: 14px;
  color: var(--soil);
  line-height: 1.85;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.section-body:empty::before,
.section-empty::before {
  content: "（暂未记录）";
  color: var(--soil-light);
  font-style: italic;
}

/* ============================================
   空状态
   ============================================ */
.empty-state {
  text-align: center;
  padding: 80px 16px;
  color: var(--soil-soft);
}

.empty-state .empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: block;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--soil);
  font-weight: 600;
}

.empty-state-hint {
  font-size: 13px;
  color: var(--soil-soft);
}

/* ============================================
   Modal 弹窗（编辑笔记 / 新建书）
   ============================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(58, 74, 63, 0.4);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: linear-gradient(180deg, var(--cream) 0%, #fff 100%);
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.5);
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--soil);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title .mini-icon {
  width: 20px;
  height: 20px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--soil-soft);
  background: transparent;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--mint);
  color: var(--sage-deep);
  transform: rotate(90deg);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-field {
  margin-bottom: 16px;
}

.modal-label {
  display: block;
  font-size: 12px;
  color: var(--soil-soft);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.modal-input,
.modal-textarea,
.modal-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--soil);
  font-size: 14px;
  transition: all 0.2s;
  outline: none;
}

.modal-input:focus,
.modal-textarea:focus,
.modal-select:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(124, 169, 130, 0.15);
  background: #fff;
}

.modal-textarea {
  min-height: 120px;
  line-height: 1.7;
  resize: vertical;
  font-family: inherit;
}

.modal-textarea-wide {
  min-height: 320px;
  font-size: 15px;
  line-height: 1.85;
  padding: 14px 18px;
  resize: vertical;
}

.modal-hint-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-counter {
  font-variant-numeric: tabular-nums;
  color: var(--sage-deep);
  font-weight: 600;
  background: var(--mint);
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
}

/* 编辑笔记时让 modal 更宽 */
body:has(.modal-textarea-wide) .modal {
  max-width: 720px;
  width: calc(100vw - 48px);
}

@media (min-width: 1024px) {
  body:has(.modal-textarea-wide) .modal {
    max-width: 820px;
  }
}

.modal-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background: rgba(255, 255, 255, 0.5);
}

.btn {
  padding: 8px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--sage);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 169, 130, 0.3);
}

.btn-primary:hover {
  background: var(--sage-deep);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 169, 130, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--soil-soft);
}

.btn-ghost:hover {
  background: var(--mint);
  color: var(--sage-deep);
}

.btn-danger {
  background: #FBE6E0;
  color: #C2553A;
}

.btn-danger:hover {
  background: #E89B83;
  color: #fff;
}

.btn .mini-icon {
  width: 14px;
  height: 14px;
}

/* Toast 提示 */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--soil);
  color: var(--cream);
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast .mini-icon {
  width: 16px;
  height: 16px;
  color: var(--mint-deep);
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 640px) {
  .container { padding: 32px 16px 100px; }
  .hero-title { font-size: 24px; }
  .detail-title { font-size: 22px; }
  .detail-header { padding: 20px; }
  .book-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 12px; padding: 12px 16px; }
  .stat-item { min-width: 60px; }
  .section { padding: 18px; }
  .fab { right: 20px; bottom: 20px; width: 56px; height: 56px; }
  .fab .fab-icon { width: 24px; height: 24px; }
  .modal-grid-2 { grid-template-columns: 1fr; }
  .detail-edit-btn { position: static; margin-top: 12px; }
}
