* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* flomo 绿色风格 */
  --primary: #50A373;
  --primary-dark: #3D8B63;
  --primary-light: #E8F5EE;
  --bg: #F7F7F5;
  --card-bg: #FFFFFF;
  --text-primary: #2C2C2C;
  --text-secondary: #8C8C8C;
  --tag-bg: #EDF6F1;
  --tag-text: #4A9D71;
  --shadow: 0 1px 8px rgba(0,0,0,0.04);
  --radius: 14px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* 顶部导航 - flomo 风格 */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #F7F7F5;
  padding: 15px 10px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #EBEBEB;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-menu-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.15s;
}
.nav-menu-btn:active { background: #EBEBEB; }
.nav-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #444;
  border-radius: 2px;
  transition: all 0.2s;
}
.nav-title {
  font-size: 18px;
  font-weight: 700;
  color: #2C2C2C;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: 8px;
  transition: background 0.15s;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}
.nav-title:active { background: #EBEBEB; }
.nav-title svg.dropdown-arrow {
  width: 16px;
  height: 16px;
  stroke: #999;
  transition: transform 0.2s;
}
.nav-title.open svg.dropdown-arrow { transform: rotate(180deg); }
/* Logo 下拉菜单 */
.logo-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  min-width: 140px;
  z-index: 200;
  overflow: hidden;
}
.logo-menu.show { display: block; }
.logo-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text-primary);
  transition: background 0.12s;
}
.logo-menu-item:hover, .logo-menu-item:active { background: var(--bg); }
.logo-menu-item svg { width: 18px; height: 18px; stroke: #666; flex-shrink: 0; }
.nav-search-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s;
}
.nav-search-btn:active { background: #EBEBEB; }

/* ===== 侧边栏 ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 500;
}
.sidebar-overlay.show { display: block; }
.sidebar {
  position: fixed;
  top: 0; left: -300px; bottom: 0;
  width: 280px;
  background: white;
  z-index: 501;
  transition: left 0.28s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 40px;
}
.sidebar.open { left: 0; }
.sidebar-header {
  padding: 15px 20px 16px;
  background: var(--primary);
}
.sidebar-logo {
  font-size: 20px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.5px;
}
.sidebar-logo-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-top: 3px;
}
.sidebar-all-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 16px;
  padding: 12px 16px;
  background: var(--primary);
  border-radius: 12px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.sidebar-all-btn:active { opacity: 0.85; }
.sidebar-section-title {
  padding: 16px 20px 8px;
  font-size: 12px;
  color: #999;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.sidebar-tag-item {
  display: flex;
  align-items: center;
  padding: 11px 20px;
  font-size: 15px;
  color: #333;
  cursor: pointer;
  transition: background 0.15s;
  gap: 8px;
}
.sidebar-tag-item:active { background: #F5F5F5; }
.sidebar-tag-item.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 500;
}
.sidebar-tag-hash {
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.sidebar-tag-count {
  margin-left: auto;
  font-size: 12px;
  color: #BBB;
  background: #F3F4F6;
  padding: 2px 8px;
  border-radius: 10px;
}
/* 清理空标签按钮 */
.sidebar-clean-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 12px 20px;
  padding: 10px 0;
  width: calc(100% - 40px);
  border: 1px dashed #D0D0D0;
  border-radius: 10px;
  background: transparent;
  color: #999;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar-clean-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.sidebar-clean-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* 回收站入口 */
.sidebar-trash-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 20px 16px;
  padding: 11px 16px;
  width: calc(100% - 40px);
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #999;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.sidebar-trash-btn:hover {
  background: #FFF3F3;
  color: #E74C3C;
}
.sidebar-trash-count {
  margin-left: auto;
  font-size: 12px;
  background: #FEE;
  color: #E74C3C;
  padding: 2px 8px;
  border-radius: 10px;
}
/* 回收站页面 */
.trash-page {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: none;
  flex-direction: column;
}
.trash-page.active { display: flex; }
.trash-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid #F0F0F0;
  gap: 12px;
}
.trash-back-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-primary);
}
.trash-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
}
.trash-empty-btn {
  background: none;
  border: none;
  color: #E74C3C;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
}
.trash-empty-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.trash-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.trash-item {
  background: white;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.trash-item-content {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trash-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}
.trash-item-actions {
  display: flex;
  gap: 8px;
}
.trash-restore-btn {
  padding: 5px 14px;
  border: 1px solid var(--primary);
  background: white;
  color: var(--primary);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}
.trash-restore-btn:hover { background: var(--primary-light); }
.trash-perm-del-btn {
  padding: 5px 14px;
  border: 1px solid #E5E7EB;
  background: white;
  color: #999;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}
.trash-perm-del-btn:hover { border-color: #E74C3C; color: #E74C3C; }
.trash-empty-hint {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #CCC;
  gap: 12px;
}
.trash-empty-hint p { font-size: 14px; }
/* 置顶图标 */
.sidebar-pin-icon {
  color: var(--primary);
  font-size: 12px;
  margin-left: 4px;
  flex-shrink: 0;
}
/* 置顶分组标题 */
.sidebar-pinned-title {
  padding: 12px 20px 4px;
  font-size: 11px;
  color: var(--primary);
  letter-spacing: 0.5px;
  font-weight: 700;
  text-transform: uppercase;
}
/* 长按菜单 */
.tag-ctx-menu {
  position: fixed;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  z-index: 9999;
  overflow: hidden;
  min-width: 160px;
}
.tag-ctx-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  font-size: 15px;
  cursor: pointer;
  color: #333;
}
.tag-ctx-menu-item:active { background: #F5F5F5; }
.tag-ctx-menu-item.danger { color: #E53935; }
.tag-ctx-menu-divider {
  height: 1px;
  background: #F0F0F0;
}

/* ===== 搜索页面 ===== */
.search-page {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #F7F7F5;
  z-index: 400;
  flex-direction: column;
}
.search-page.show { display: flex; }
.search-page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 10px 10px;
  background: #F7F7F5;
  border-bottom: 1px solid #EBEBEB;
}
.search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: white;
  border-radius: 22px;
  padding: 0 14px;
  height: 38px;
  box-shadow: var(--shadow);
  gap: 8px;
  border: none !important;
}
.search-input-wrap:focus-within {
  box-shadow: 0 1px 8px rgba(0,0,0,0.08), 0 0 0 2px rgba(80,163,115,0.15) !important;
}
.search-input-wrap svg {
  flex-shrink: 0;
  color: #999;
}
.search-real-input {
  flex: 1;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-size: 15px;
  background: none;
  color: #2C2C2C;
}
.search-real-input::placeholder { color: #BBB; }
.search-cancel-btn {
  font-size: 15px;
  color: #555;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  white-space: nowrap;
  flex-shrink: 0;
}
.search-page-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
}
.search-quick-title {
  font-size: 13px;
  color: #999;
  margin-bottom: 12px;
  font-weight: 500;
}
.search-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.search-quick-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: white;
  border-radius: 20px;
  font-size: 14px;
  color: #444;
  cursor: pointer;
  box-shadow: var(--shadow);
  border: 1px solid #EBEBEB;
  transition: all 0.15s;
}
.search-quick-tag:active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}
.search-results {
  margin-top: 8px;
}
.search-results-title {
  font-size: 13px;
  color: #999;
  margin-bottom: 10px;
}

/* 标签筛选栏 */
.tags-scroll {
  padding: 8px 0 8px 20px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}
.tags-scroll::-webkit-scrollbar { display: none; }
.tag-pill {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  margin-right: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1.5px solid transparent;
}
.tag-pill.active {
  background: var(--primary);
  color: white;
}
.tag-pill:not(.active) {
  background: white;
  color: var(--text-secondary);
  border-color: #E8E8E8;
}

/* 素材列表 */
.feed {
  padding: 0 16px 80px;
}
/* 长按多选模式 */
.card.selected {
  border: 0.5px solid var(--primary);
  box-shadow: 0 1px 8px rgba(80,163,115,0.18);
}
/* 多选模式下屏蔽：三点菜单、复制/下载按钮、展开按钮 */
.select-mode .card-menu { display: none !important; }
.select-mode .card-actions { display: none !important; }
.select-mode .expand-hint { display: none !important; }

/* ===== 复选框 - 隐藏不显示，仅通过点击卡片选中 ===== */
.select-checkbox { display: none !important; }

/* ===== 多选模式：顶部选中信息条（固定在顶部）===== */
.select-nav-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 160;
  background: var(--bg);
  padding: 10px 16px;
  padding-bottom: 12px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.select-nav-bar.active { display: flex; }
.select-nav-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}
.select-nav-title .count { color: var(--primary); }
.select-nav-done {
  font-size: 14px;
  color: var(--primary);
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 6px;
  background: none;
  border: none;
  font-weight: 500;
}
.select-nav-done:active { opacity: 0.7; }

/* 多选模式下隐藏原导航栏 */
body.select-mode > .nav-bar { display: none !important; }

/* ===== 多选模式：底部悬浮操作栏（白色背景长条）===== */
.selection-toolbar {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  background: #FFFFFF;
  border-radius: 22px;
  padding: 8px 24px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 2px 16px rgba(0,0,0,0.1);
  align-items: center;
  justify-content: center;
}
.selection-toolbar.active { display: flex; }
.selection-info { display: none; }
.selection-actions {
  display: flex;
  align-items: center;
  gap: 28px;
}
.sel-action-btn {
  padding: 6px 0;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-weight: 500;
  background: none;
}
.sel-action-btn svg {
  width: 22px; height: 22px; flex-shrink: 0;
}
.sel-del { color: #EF4444; }
.sel-del:active { opacity: 0.7; }
.sel-tag { color: var(--primary); }
.sel-tag:active { opacity: 0.7; }

/* 多选模式下隐藏 FAB */
body.select-mode .fab { display: none !important; }
/* 多选模式下给卡片列表加顶部间距，避免被固定导航遮挡 */
body.select-mode .feed { padding-top: 20px; }
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px 6px;
  margin-bottom: 8px;
  animation: fadeInUp 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 卡片头部 */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1px;
  gap: 6px;
}
.card-date {
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.card-source {
  font-size: 11px;
  color: #999;
  background: #F3F4F6;
  padding: 2px 8px;
  border-radius: 8px;
}

/* 卡片内容 - 左对齐，保留换行，无缩进 */
.card-content {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  word-break: break-word;
  text-indent: 0 !important;
  padding: 0 !important;
  margin: 0 0 2px 0 !important;
  max-height: 180px;
  overflow: hidden;
  position: relative;
}
.card-content * { text-indent: 0 !important; }
.card-content.expanded { max-height: none; }
.card-content::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 44px;
  background: linear-gradient(transparent, white);
  pointer-events: none;
}
.card-content.expanded::after { display: none; }
.expand-hint {
  color: var(--primary);
  font-size: 13px;
  text-align: right;
  margin-top: 4px;
  cursor: pointer;
  font-weight: 500;
}

/* 图片网格 - 微信朋友圈九宫格 */
.card-images {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.card-img-wrap {
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  background: #f0f0f0;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 九宫格尺寸计算 */
.card-images:not(.single):not(.two) .card-img-wrap {
  width: calc((100% - 10px) / 3);
  aspect-ratio: 1;
}
.card-images.single .card-img-wrap {
  width: auto;
  max-width: 220px;
  aspect-ratio: auto;
  max-height: 200px;
}
.card-images.single .card-img-wrap img {
  max-width: 220px;
  object-fit: contain;
}
.card-images.two .card-img-wrap {
  width: calc((100% - 5px) / 2);
  aspect-ratio: 1;
}
.card-img-wrap {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.card-img-wrap img:hover { transform: scale(1.05); }

/* 标签 */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.card-tag {
  font-size: 12px;
  padding: 3px 10px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 12px;
}

/* 操作按钮 - 三按钮横排 */
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #F0F0F0;
}
/* 编辑按钮（三点菜单 - 纯CSS大圆点） */
.card-menu {
  position: relative;
}
.menu-dots {
  width: 25px; height: 30px;
  border: none; background: none;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s;
  padding: 3px 4px;
  flex-shrink: 0;
}
/* 三点菜单 - 用 ::before 和 ::after 加中间 span 画三个圆点 */
.menu-dots::before, .menu-dots .dot-mid, .menu-dots::after {
  content: '';
  width: 3px; height: 3px;
  background: currentColor;
  border-radius: 50%;
  flex-shrink: 0;
}
.menu-dots:hover { color: #333; background: #F3F4F6; border-radius: 14px; }
.menu-dropdown {
  display: none;
  position: absolute; right: 0; top: 100%;
  z-index: 200;
  min-width: 120px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  overflow: hidden;
  margin-top: 4px;
  flex-direction: column;
  padding: 6px;
}
.card-menu[data-open="true"] .menu-dropdown {
  display: flex;
}
.menu-item {
  padding: 10px 14px;
  font-size: 14px; cursor: pointer;
  transition: all 0.15s;
  color: var(--text-primary);
  white-space: nowrap;
  border-radius: 6px;
  display: flex; align-items: center; gap: 8px;
}
.menu-item:hover { background: #F5F5F5; }
.menu-item.danger { color: #EF4444; }
.menu-item.danger:hover { background: #FEF2F2; }
.menu-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
}

/* 置顶标识 */
.pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 1px 7px;
  border-radius: 8px;
  margin-left: 6px;
  flex-shrink: 0;
}
.action-btn {
  flex: 1;
  padding: 8px 4px;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  background: white;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.action-icon {
  width: 14px; height: 14px;
  flex-shrink: 0;
}
.action-btn.copy { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.action-btn.download { border-color: #3B82F6; color: #3B82F6; background: #EFF6FF; }
.action-btn.danger { color: #EF4444; border-color: #FEE2E2; }

/* 底部发布按钮 - flomo风格圆形加号 */
.fab {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), #3D8B63);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(80,163,115,0.4);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fab:active { transform: translateX(-50%) scale(0.92); }
/* 手机端放右下角 */
@media (max-width: 768px) {
  .fab {
    left: auto;
    right: 24px;
    transform: none;
  }
  .fab:active { transform: scale(0.92); }
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}
.empty-icon { font-size: 64px; margin-bottom: 16px; }
.empty-text { font-size: 15px; line-height: 1.6; }

/* 加载中 */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}
.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #E5E7EB;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 发布弹窗 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-panel {
  background: white;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 20px 34px;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  border: none;
  background: #F3F4F6;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}

textarea {
  width: 100%;
  min-height: 130px;
  max-height: 500px;
  padding: 14px;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  font-size: 15px;
  resize: vertical;
  outline: none;
  font-family: inherit;
  line-height: 1.75;
  overflow-y: auto;
}
textarea:focus { border-color: var(--primary); }
.input-group { margin-bottom: 14px; }
.input-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; display: block; }
input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}
input[type="text"]:focus { border-color: var(--primary); }

/* 一键粘贴按钮 */
.paste-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 6px;
}
.paste-btn:active { opacity: 0.7; }

/* 一键排版按钮 */
.format-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: #F0FDF4;
  color: #16A34A;
  border: 1px solid #BBF7D0;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 6px;
  margin-left: 6px;
}
.format-btn:active { opacity: 0.7; }

/* 微信风格图片上传 */
.img-upload-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}
.img-thumb {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 6px;
  overflow: visible;
  border: 1px solid #E5E7EB;
  flex-shrink: 0;
}
.img-thumb img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 6px;
}
.img-thumb .del-btn {
  position: absolute;
  top: -8px; right: -8px;
  width: 20px; height: 20px;
  background: #EF4444;
  color: white;
  border: 2px solid white;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.img-add-btn {
  width: 78px; height: 78px;
  border: 2px dashed #D1D5DB;
  border-radius: 6px;
  background: #FAFAFA;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 0;
}
.img-add-btn:active { background: var(--primary-light); border-color: var(--primary); border-style: dashed; }
.img-add-icon {
  width: 28px; height: 28px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.img-add-icon::before, .img-add-icon::after {
  content: '';
  position: absolute;
  background: #BBB;
  border-radius: 2px;
}
.img-add-icon::before { width: 28px; height: 3px; }
.img-add-icon::after { width: 3px; height: 28px; }
.img-add-btn:active .img-add-icon::before,
.img-add-btn:active .img-add-icon::after { background: var(--primary); }

/* 图片数量提示 */
.img-count-hint {
  font-size: 12px; color: #999; margin-top: 4px;
}
.img-add-btn::before {
  width: 28px; height: 3px;
  border-radius: 2px;
}
.img-add-btn::after {
  width: 3px; height: 28px;
  border-radius: 2px;
}
.img-add-btn:active::before, .img-add-btn:active::after { background: var(--primary); }

/* 拖拽上传高亮 */
.img-upload-grid.drag-over {
  position: relative;
}
.img-upload-grid.drag-over::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2.5px dashed var(--primary);
  border-radius: 10px;
  background: rgba(80, 163, 115, 0.06);
  pointer-events: none;
  z-index: 1;
  animation: dragPulse 1.2s ease-in-out infinite;
}
.img-upload-grid.drag-over .img-add-btn {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.05);
}
.img-upload-grid.drag-over .img-add-icon::before,
.img-upload-grid.drag-over .img-add-icon::after {
  background: var(--primary);
}
@keyframes dragPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* 常用标签 */
.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.quick-tag {
  padding: 5px 12px;
  border-radius: 16px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.quick-tag:active, .quick-tag.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary-dark);
}
.upload-hidden { display: none; }

/* 提交按钮 - 发布/编辑弹窗用全宽 */
.submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 图片预览器 */
.viewer-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.95);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.viewer-overlay.show { display: flex; }
.viewer-img { max-width: 95%; max-height: 85vh; object-fit: contain; border-radius: 8px; }
.viewer-nav {
  position: absolute;
  top: 50%; width: 44px; height: 44px;
  background: rgba(255,255,255,0.15);
  border: none; border-radius: 50%;
  color: white; font-size: 22px;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.viewer-prev { left: 10px; }
.viewer-next { right: 10px; }
.viewer-close {
  position: absolute; top: 20px; right: 20px;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.2);
  border: none; border-radius: 50%;
  color: white; font-size: 18px;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.viewer-count {
  position: absolute; bottom: 30px;
  color: white; font-size: 14px;
  background: rgba(0,0,0,0.5);
  padding: 4px 14px; border-radius: 12px;
}
.viewer-download {
  position: absolute; bottom: 30px;
  right: 20px; padding: 8px 20px;
  background: var(--primary); color: white;
  border: none; border-radius: 20px;
  font-size: 14px; cursor: pointer;
}

/* Toast 提示 */
.toast {
  position: fixed;
  top: 60px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.78);
  color: white; padding: 10px 24px;
  border-radius: 20px; font-size: 14px;
  z-index: 2000; opacity: 0;
  transition: opacity 0.3s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* 下拉刷新提示 */
.pull-tip {
  text-align: center;
  padding: 16px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* 登录/注册弹窗 */
.auth-panel {
  background: white;
  border-radius: 20px;
  padding: 36px 28px 28px;
  width: 90%;
  max-width: 340px;
  animation: slideUp 0.3s ease;
}
.auth-logo {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.auth-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.auth-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F7F7F5;
  border: 1.5px solid #EBEBEB;
  border-radius: 12px;
  padding: 0 14px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.auth-field:focus-within {
  border-color: var(--primary);
  background: white;
}
.auth-field svg {
  flex-shrink: 0;
}
.auth-field input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 0;
  font-size: 15px;
  outline: none;
  color: var(--text-primary);
}
.auth-field input::placeholder {
  color: #BBB;
}
.auth-error {
  color: #EF4444;
  font-size: 13px;
  text-align: center;
  margin-bottom: 8px;
  display: none;
}
.auth-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.auth-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-btn:active { opacity: 0.85; }
.auth-mode-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 16px;
}
.auth-mode-hint a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
