/* ===== 全局重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
  line-height: 1.6;
}

/* ===== 登录页 ===== */
.login-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fce4ec 0%, #e8f5e9 50%, #fff3e0 100%);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 50px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  text-align: center;
}
.brand-logo-login {
  width: 180px;
  height: auto;
  margin-bottom: 16px;
  border-radius: 12px;
}
.login-icon { font-size: 56px; margin-bottom: 12px; }
.login-card h1 { font-size: 24px; color: #2e7d32; margin-bottom: 4px; }
.login-subtitle { font-size: 13px; color: #999; margin-bottom: 32px; }
.login-error {
  background: #ffebee;
  color: #c62828;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.login-hint { font-size: 12px; color: #bbb; margin-top: 24px; }

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 18px;
  text-align: left;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}
.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafafa;
  font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #66bb6a;
  box-shadow: 0 0 0 3px rgba(102, 187, 106, 0.15);
  background: #fff;
}
.form-group textarea { resize: vertical; min-height: 60px; }
.required { color: #e53935; }
.hint { font-weight: normal; font-size: 12px; color: #999; }

.form-row { display: flex; gap: 16px; margin-bottom: 4px; }
.flex-1 { flex: 1; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: #43a047; color: #fff; }
.btn-primary:hover { background: #388e3c; box-shadow: 0 4px 12px rgba(67,160,71,0.3); }
.btn-outline { background: transparent; color: #555; border: 1.5px solid #ddd; }
.btn-outline:hover { background: #f5f5f5; border-color: #bbb; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; padding: 12px; font-size: 15px; }
.btn-danger { background: #e53935; color: #fff; }
.btn-danger:hover { background: #c62828; }
.btn-clone { background: #7b1fa2; color: #fff; }
.btn-clone:hover { background: #6a1b9a; }

/* ===== 主界面布局：flex列，只让内容区滚动 ===== */
.page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ===== 顶部导航 ===== */
.header {
  background: #fff;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  flex-shrink: 0;
  z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.brand-logo-header {
  height: 36px;
  width: auto;
  border-radius: 6px;
  margin-right: 10px;
}
.header-icon { font-size: 24px; }
.header-left h2 { font-size: 18px; color: #2e7d32; font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 10px; }
.user-info { font-size: 13px; color: #666; padding: 4px 10px; background: #f0f2f5; border-radius: 6px; }

/* ===== 工具栏 ===== */
.toolbar {
  background: #fff;
  padding: 16px 28px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}
.toolbar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.search-group {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 200px;
}
.search-group input {
  flex: 1;
  padding: 8px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  max-width: 300px;
}
.search-group input:focus {
  outline: none;
  border-color: #66bb6a;
  box-shadow: 0 0 0 3px rgba(102,187,106,0.15);
}
.active-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  flex-wrap: wrap;
  min-height: 0;
}
.active-filters .filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px 3px 12px;
  border-radius: 16px;
  font-size: 13px;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
  white-space: nowrap;
}
.active-filters .filter-tag .filter-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  color: #66bb6a;
  transition: all 0.15s;
}
.active-filters .filter-tag .filter-tag-remove:hover {
  background: #c8e6c9;
  color: #c62828;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-item label { font-size: 13px; color: #666; white-space: nowrap; }
.filter-item select,
.filter-item input.color-search {
  padding: 6px 10px;
  border: 1.5px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
  background: #fafafa;
  width: 130px;
  cursor: text;
}
.filter-item input.color-search:focus {
  outline: none;
  border-color: #66bb6a;
  box-shadow: 0 0 0 3px rgba(102,187,106,0.15);
}
/* 颜色多选下拉 */
.color-filter-wrap { position: relative; }
.color-search-wrap { position: relative; }
.color-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 300px;
  max-height: 340px;
  overflow-y: auto;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  z-index: 1000;
  padding: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}
.color-dropdown-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #444;
  transition: background 0.15s;
}
.color-dropdown-item:hover { background: #f0faf0; }
.color-dropdown-item.selected {
  background: #e8f5e9;
  color: #2e7d32;
  font-weight: 600;
}
.color-dropdown-item .color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.1);
}
.color-dd-name { font-weight: 500; }
.color-dd-ref {
  display: block;
  width: 100%;
  font-size: 10px;
  color: #aaa;
  font-family: 'Courier New', monospace;
  padding-left: 18px;
  margin-top: -2px;
  line-height: 1.3;
}
.color-dropdown-item .check-icon {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.6;
}
.action-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.count-badge {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* ===== 花卉卡片网格 ===== */
.content { padding: 24px 28px; }
.flower-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.flower-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}
.flower-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.card-image {
  width: 100%;
  height: 180px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.card-image img:hover { transform: scale(1.08); }
.card-image .no-image {
  font-size: 64px;
  opacity: 0.3;
  user-select: none;
}
.card-body { padding: 16px 18px 18px; }
.card-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}
.card-subtitle {
  font-size: 12px;
  color: #999;
  margin-bottom: 10px;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.color-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.color-tag.with-dot::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.month-tag {
  display: inline-block;
  padding: 2px 8px;
  background: #e3f2fd;
  color: #1565c0;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}
.card-actions .btn { flex: 1; }

.card-img-actions {
  display: flex;
  gap: 8px;
  margin-top: -4px;
  padding: 0 18px 14px;
}
.card-img-actions .btn {
  flex: 1;
  font-size: 11px;
  padding: 5px 4px;
  line-height: 1.4;
  border-radius: 6px;
  transition: all 0.15s;
}
.btn-card-img {
  background: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #e1bee7;
}
.btn-card-img:hover {
  background: #e1bee7;
  color: #4a148c;
  border-color: #ce93d8;
  transform: translateY(-1px);
}
.btn-pptx {
  background: #e8eaf6;
  color: #283593;
  border: 1px solid #c5cae9;
}
.btn-pptx:hover {
  background: #c5cae9;
  color: #1a237e;
  border-color: #9fa8da;
  transform: translateY(-1px);
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #999;
}
.empty-icon { font-size: 80px; margin-bottom: 16px; opacity: 0.5; }
.empty-state p { font-size: 16px; }
.empty-hint { font-size: 13px; color: #bbb; margin-top: 8px; }

/* ===== 排序栏 ===== */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #f9fafb;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.sort-label { font-size: 13px; color: #999; margin-right: 4px; }
.sort-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  color: #666;
  transition: all 0.15s;
  user-select: none;
}
.sort-chip:hover { border-color: #81c784; color: #43a047; }
.sort-chip.active { background: #e8f5e9; border-color: #43a047; color: #2e7d32; font-weight: 600; }
.sort-arrow { font-size: 11px; min-width: 10px; text-align: center; }

/* ===== 诗词/典故 徽标 ===== */
.card-meta {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
  background: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #e1bee7;
  transition: all 0.15s;
}
.meta-badge:hover { background: #e1bee7; }

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp 0.25s ease;
}
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 960px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-header h3 { font-size: 18px; color: #1a1a1a; }
.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: #f0f0f0;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: background 0.2s;
}
.modal-close:hover { background: #e0e0e0; }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
}

/* 上传区域 */
.upload-area {
  border: 2px dashed #ddd;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-area:hover { border-color: #66bb6a; background: #f1f8e9; }
.upload-icon { font-size: 36px; display: block; margin-bottom: 8px; }
.upload-hint { font-size: 12px; color: #bbb; margin-top: 4px; }
.upload-area img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 6px;
}

/* 图片预览弹窗 */
.image-preview-container {
  position: relative;
  max-width: 80vw;
  max-height: 85vh;
}
.preview-image {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.preview-close {
  position: absolute;
  top: -12px; right: -12px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 18px;
}
.preview-close:hover { background: rgba(0,0,0,0.7); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 14px;
  color: #fff;
  z-index: 300;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  animation: slideUp 0.3s ease;
}
.toast.success { background: #43a047; }
.toast.error { background: #e53935; }
.toast.info { background: #1e88e5; }

/* ===== 动画 ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  html { font-size: 14px; }
  .header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .header-left h2 { font-size: 15px; }
  .header-right { gap: 6px; }
  .toolbar { padding: 12px 16px; }
  .toolbar-row { flex-direction: column; align-items: stretch; }
  .search-group { max-width: 100%; }
  .search-group input { max-width: 100%; }
  .filter-group { flex-wrap: wrap; }
  .action-group { margin-left: 0; justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  .action-group .btn,
  .action-group .btn-sm { min-height: 38px; }
  .content { padding: 16px; }
  .flower-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
  .form-row { flex-direction: column; gap: 0; }
  .modal { max-width: 100%; margin: 10px; max-height: 85vh; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; min-height: 40px; }
  .image-preview-container { max-width: 95vw; }
  .color-dropdown { width: 260px; left: 0; right: auto; }
  /* 排序栏横向滚动 */
  .sort-bar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 4px; padding: 10px 12px; }
  .sort-bar::-webkit-scrollbar { display: none; }
  .sort-chip { white-space: nowrap; padding: 5px 10px; font-size: 12px; flex-shrink: 0; }
  /* 全貌图网格 */
  .fullview-images-grid { gap: 8px; }
  .fullview-image-item img { width: 100px; height: 100px; }
  /* tab 栏横向滚动 */
  .tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; padding: 0 12px; }
  .tab-bar::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; flex-shrink: 0; padding: 12px 16px; font-size: 14px; }
  /* 上传区域 */
  .upload-area { padding: 16px; min-height: 80px; }
  .upload-color-row { flex-direction: column; align-items: stretch; }
  .upload-color-row select { width: 100%; }
  .upload-fullview-row { text-align: center; }
}
@media (max-width: 480px) {
  html { font-size: 13px; }
  .flower-grid { grid-template-columns: 1fr; }
  .card-body { padding: 14px; }
  .card-image { height: 160px; }
  .header { padding: 10px 12px; }
  .header-left h2 { font-size: 14px; }
  .header-right .btn-sm { padding: 10px 12px; font-size: 13px; min-height: 40px; }
  .toolbar { padding: 10px 12px; }
  .content { padding: 12px; }
  .search-group input { padding: 10px 12px; font-size: 16px; } /* 防止iOS缩放 */
  .btn-sm { padding: 10px 14px; min-height: 42px; font-size: 14px; }
  .btn { min-height: 42px; }
  .modal { margin: 6px; border-radius: 12px; max-height: 90vh; }
  .modal-header { padding: 16px 16px 0; }
  .modal-header h3 { font-size: 16px; }
  .modal-footer .btn { flex: 1; min-height: 44px; font-size: 14px; }
  .filter-group { gap: 8px; }
  .filter-item select,
  .filter-item input.color-search { width: 100px; font-size: 14px; padding: 8px; }
  .color-dropdown { width: 220px; }
  .sort-bar { padding: 8px 10px; }
  .sort-chip { padding: 6px 12px; font-size: 12px; }
  .tab { padding: 10px 12px; font-size: 13px; }
  .card-title { font-size: 15px; }
  .form-group { margin-bottom: 14px; }
  .form-group input, .form-group textarea, .form-group select { padding: 12px 14px; font-size: 16px; } /* 防止iOS缩放 */
  .upload-area { padding: 14px; min-height: 60px; }
  .fullview-image-item img { width: 80px; height: 80px; }
  .count-badge { font-size: 12px; padding: 3px 10px; }
  .pagination { gap: 4px; padding: 16px 0 8px; }
  .pagination-btn { min-width: 32px; height: 34px; font-size: 12px; padding: 0 8px; }
  .pagination-info, .pagination-goto { font-size: 11px; }
  .pagination-goto input { width: 36px; height: 28px; font-size: 12px; }
}

/* ===== 别称雅号 ===== */
.card-alias {
  font-size: 12px;
  color: #8d6e63;
  margin-bottom: 6px;
  background: #fff8e1;
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  border: 1px solid #ffe0b2;
}

/* ===== PDF按钮 ===== */
.btn-pdf { background: #1565c0; color: #fff; }
.btn-pdf:hover { background: #0d47a1; }
.btn-img { background: #6a1b9a; color: #fff; }
.btn-img:hover { background: #4a148c; }

/* ===== 各色图片网格 ===== */
.color-images-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
  min-height: 40px;
}
.color-image-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 10px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
}
.color-image-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
}
.color-image-item img:hover { opacity: 0.8; }
.color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.1);
}
.color-name { font-size: 12px; font-weight: 600; color: #555; min-width: 20px; }
.btn-icon {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1;
}
.btn-icon:hover { color: #e53935; }
.upload-color-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.upload-color-row select {
  padding: 8px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  font-family: inherit;
  flex: 1;
}

/* ===== 全貌图网格（1-2张） ===== */
.fullview-images-grid {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  min-height: 40px;
}
.fullview-image-item {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.fullview-image-item img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  transition: transform 0.15s;
}
.fullview-image-item img:hover { transform: scale(1.03); }
.fullview-image-item .btn-icon {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  background: #e53935;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fullview-label {
  font-size: 11px;
  color: #888;
}
.upload-fullview-row { margin-top: 4px; }

/* ===== Tab 导航 ===== */
.tab-bar {
  display: flex;
  background: #fff;
  border-bottom: 2px solid #e8eaf6;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 90;
}
.tab {
  padding: 12px 24px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: #888;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  user-select: none;
}
.tab:hover { color: #3949ab; background: #f5f5ff; }
.tab.active { color: #3949ab; border-bottom-color: #3949ab; }
.tab-content { display: none; }
.tab-content.active { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.tab-content.active > .content { flex: 1; min-height: 0; overflow-y: auto; }

/* ===== 花文化知识库卡片 ===== */
.culture-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  border: 1px solid #e8eaf6;
  transition: box-shadow 0.15s;
  box-shadow: 0 1px 4px rgba(92,107,192,0.06);
}
.culture-card:hover { box-shadow: 0 2px 12px rgba(92,107,192,0.12); }
.culture-card-header { margin-bottom: 8px; }
.culture-card-title { font-size: 16px; font-weight: 700; color: #283593; }
.culture-card-flower { font-size: 13px; color: #999; margin-top: 2px; }
.culture-card-tags { margin-bottom: 10px; }
.culture-tag {
  display: inline-block;
  padding: 2px 10px;
  margin: 1px 3px 1px 0;
  border-radius: 10px;
  font-size: 12px;
  background: #e8eaf6;
  color: #283593;
}
.culture-card-content {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 12px;
  white-space: pre-wrap;
}
.culture-card-actions { display: flex; gap: 6px; }

/* ===== 标签系统 ===== */
.tag-input-wrapper { position: relative; }
.tag-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0 0 8px 8px;
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.tag-suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: #555;
}
.tag-suggestion-item:hover { background: #e8eaf6; }
.tag-display { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 13px;
  background: #e8eaf6;
  color: #283593;
  border: 1px solid #c5cae9;
}
.tag-chip-remove {
  cursor: pointer;
  font-size: 12px;
  color: #999;
  margin-left: 2px;
}
.tag-chip-remove:hover { color: #e53935; }

/* ===== HTML 编辑器工具栏 ===== */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  flex-wrap: wrap;
}
.editor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: #444;
  transition: all 0.1s;
}
.editor-btn:hover { background: #e8eaf6; border-color: #5c6bc0; }
.editor-sep { color: #ccc; margin: 0 2px; font-size: 14px; user-select: none; }
#cultureEditContent {
  border-radius: 0 0 6px 6px;
  font-family: 'STSong', 'SimSun', serif;
  font-size: 14px;
  line-height: 1.8;
}
.content-preview {
  margin-top: 8px;
  padding: 12px;
  background: #f9fafb;
  border: 1px dashed #ddd;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.8;
  color: #666;
  min-height: 40px;
  max-height: 200px;
  overflow-y: auto;
}
.content-preview:empty::before { content: '内容预览将在此显示…'; color: #ccc; }

/* ===== 活跃筛选条件条 ===== */
.active-filters-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: #f5f5ff;
  border: 1px solid #e8eaf6;
  border-radius: 8px;
  margin-bottom: 12px;
}
.active-filters-label { font-size: 13px; color: #888; white-space: nowrap; }
#activeFiltersContainer { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 13px;
  background: #e8eaf6;
  color: #283593;
  border: 1px solid #c5cae9;
  cursor: pointer;
  transition: all 0.1s;
  user-select: none;
}
.filter-chip:hover { background: #d1d5f0; border-color: #5c6bc0; }

/* ===== 可点击标签 ===== */
.culture-tag { cursor: pointer; }
.culture-tag:hover { background: #c5cae9; }
.culture-card-flower { cursor: pointer; }
.culture-card-flower:hover { color: #283593; }

/* ===== 花单模式 ===== */
/* 花单顶部横条 */
.order-bar {
  padding: 8px 12px;
  background: #f1f8e9;
  border-bottom: 1px solid #dcedc8;
}
.order-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.order-bar-label { font-size: 13px; font-weight: 600; color: #558b2f; white-space: nowrap; }
.order-selected-list {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 100px;
}
.order-selected-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px 2px 10px;
  border-radius: 14px;
  font-size: 12px;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
  white-space: nowrap;
  cursor: default;
}
.order-selected-item .order-remove {
  margin-left: 2px;
  cursor: pointer;
  font-size: 11px;
  color: #81c784;
  transition: color 0.15s;
}
.order-selected-item .order-remove:hover { color: #c62828; }
.order-count-badge {
  font-size: 13px;
  font-weight: 600;
  color: #558b2f;
  background: #dcedc8;
  padding: 2px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

/* 花单模式下花卉卡片可选样式 */
.order-mode .flower-card {
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.order-mode .flower-card:hover {
  box-shadow: 0 4px 16px rgba(102,187,106,0.2);
  border-color: #81c784;
}
.order-mode .flower-card.order-selected {
  border-color: #43a047;
  box-shadow: 0 0 0 2px #43a047, 0 4px 16px rgba(67,160,71,0.15);
  background: #f1f8e9;
}
.order-mode .flower-card .order-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ccc;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  z-index: 2;
  transition: all 0.15s;
}
.order-mode .flower-card.order-selected .order-check {
  background: #43a047;
  border-color: #43a047;
  color: #fff;
}

/* 花单详情弹窗 */
/* ===== 花单编辑区（页面内嵌） ===== */
.order-edit-section {
  background: #fff;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  margin: 8px 16px 12px;
  box-shadow: 0 2px 8px rgba(67,160,71,.12);
}
.order-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #e8f5e9;
  border-radius: 8px 8px 0 0;
}
.order-edit-title {
  font-size: 15px;
  font-weight: 600;
  color: #2e7d32;
}
.order-edit-body {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e8f5e9;
}
.order-detail-list {
  max-height: 320px;
  overflow-y: auto;
}
.order-detail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}
.order-detail-item:hover {
  background: #fafff5;
}
.od-info {
  min-width: 100px;
  flex-shrink: 0;
}
.od-avatar {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #e0e0e0;
  background: #f5f5f5;
  position: relative;
}
.od-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
}
.od-color-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.od-color-img {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.od-info .od-name { font-weight: 500; color: #333; }
.od-info .od-color { font-size: 12px; color: #888; margin-top: 2px; }
.od-fields {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}
.od-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.od-field label {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
}
.od-field input {
  width: 64px;
  padding: 4px 6px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
}
.od-field input:focus {
  outline: none;
  border-color: #66bb6a;
}
.od-subtotal {
  min-width: 60px;
  text-align: right;
  font-weight: 500;
  color: #2e7d32;
}
@media (max-width: 600px) {
  .order-bar-inner { gap: 4px; }
  .order-selected-list { min-width: 0; }
  .order-edit-body { flex-direction: column; gap: 8px; }
  .order-detail-item { flex-wrap: wrap; gap: 6px; }
  .od-fields { flex-wrap: wrap; justify-content: flex-start; }
  .od-field input { width: 52px; }
}

/* ===== 花单记录列表 ===== */
.order-record-list { padding: 8px 16px; }
.order-record-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 16px;
}
.order-record-card:hover { border-color: #a5d6a7; box-shadow: 0 2px 6px rgba(67,160,71,.1); }
.order-record-name { flex: 1; font-weight: 500; color: #333; font-size: 14px; }
.order-record-meta { display: flex; gap: 16px; font-size: 12px; color: #888; }
.order-record-meta span { white-space: nowrap; }
.order-record-price { font-weight: 600; color: #2e7d32; font-size: 14px; white-space: nowrap; }
.order-record-actions { display: flex; gap: 6px; flex-shrink: 0; }
.order-record-actions button { font-size: 12px; padding: 3px 10px; }
@media (max-width: 600px) {
  .order-record-card { flex-wrap: wrap; gap: 8px; }
  .order-record-meta { flex-wrap: wrap; gap: 8px; }
}

/* ===== 项目成本核算 ===== */

/* 采购单列表 */
.purchase-order-list { padding: 8px 16px; }
.purchase-order-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 10px;
  transition: all 0.15s;
}
.purchase-order-card:hover { border-color: #ffb74d; box-shadow: 0 2px 8px rgba(255,152,0,0.1); }
.po-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}
.po-card-name { flex: 1; font-weight: 600; color: #333; font-size: 15px; }
.po-card-cost { font-weight: 700; color: #e65100; font-size: 16px; white-space: nowrap; }
.po-card-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #999;
  margin-bottom: 10px;
}
.po-card-meta span { white-space: nowrap; }
.po-card-items-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}
.po-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffe0b2;
}
.po-card-actions { display: flex; gap: 6px; }

/* 采购单编辑弹窗 */
.purchase-import-area {
  background: #fff3e0;
  border: 1px solid #ffe0b2;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.purchase-import-area label { font-size: 13px; font-weight: 600; color: #e65100; display: block; margin-bottom: 6px; }
.purchase-import-row { display: flex; gap: 8px; align-items: center; }

.purchase-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}
.purchase-items-title { font-size: 15px; font-weight: 600; color: #333; }
.purchase-items-actions { display: flex; gap: 8px; }

.purchase-table-wrap { overflow-x: auto; margin-bottom: 8px; }
.purchase-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;

}
.purchase-table th {
  background: #fff3e0;
  color: #e65100;
  padding: 8px 10px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 2px solid #ffe0b2;
}
.purchase-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #f5f5f5;
  vertical-align: middle;
}
.purchase-table tr:hover td { background: #fffaf0; }
.purchase-table .col-category { min-width: 110px; }
.purchase-table .col-name { min-width: 120px; }
.purchase-table .col-price { width: 80px; }
.purchase-table .col-pack-qty { width: 80px; }
.purchase-table .col-min-unit { width: 70px; }
.purchase-table .col-min-price { width: 80px; text-align: right; }
.purchase-table .col-qty { width: 100px; }
.purchase-table .col-unit { width: 65px; }
.purchase-table .col-logistics { width: 75px; }
.purchase-table .col-subtotal { width: 90px; text-align: right; }
.purchase-table .col-perperson { width: 85px; text-align: right; }
.purchase-table .col-action { width: 40px; text-align: center; }

.purchase-table .cost-input {
  width: 100%;
  padding: 5px 8px;
  border: 1.5px solid #e0e0e0;
  border-radius: 5px;
  font-size: 13px;
  text-align: center;
  background: #fafafa;
  transition: border-color 0.15s;
}
.purchase-table .cost-input:focus {
  outline: none;
  border-color: #ff9800;
  box-shadow: 0 0 0 3px rgba(255,152,0,0.1);
  background: #fff;
}
.purchase-table .cost-select {
  width: 100%;
  padding: 5px 6px;
  border: 1.5px solid #e0e0e0;
  border-radius: 5px;
  font-size: 13px;
  background: #fafafa;
}
.purchase-table .cost-select:focus {
  outline: none;
  border-color: #ff9800;
}
.purchase-table .subtotal-display {
  font-weight: 600;
  color: #e65100;
  text-align: right;
  padding-right: 10px;
}
.purchase-table .row-delete-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #ccc;
  cursor: pointer;
  border-radius: 6px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.purchase-table .row-delete-btn:hover { background: #ffebee; color: #e53935; }

.purchase-total-row {
  text-align: right;
  padding: 10px 16px;
  background: #fff3e0;
  border-radius: 8px;
  font-size: 16px;
  color: #e65100;
}
.purchase-total-row strong { font-size: 20px; }

/* 类目管理 */
.category-list { margin-bottom: 12px; }
.category-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
}
.category-item:last-child { border-bottom: none; }
.category-item-name { flex: 1; font-size: 14px; color: #333; }
.category-item-actions { display: flex; gap: 4px; }
.category-item .btn-sm { font-size: 12px; padding: 3px 10px; }
.category-item .edit-input {
  flex: 1;
  padding: 6px 10px;
  border: 1.5px solid #ff9800;
  border-radius: 6px;
  font-size: 14px;
}
.category-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

/* 采购单查看弹窗 */
.purchase-view-detail { padding: 8px 0; }
.purchase-view-header { margin-bottom: 16px; }
.purchase-view-header h4 { font-size: 20px; color: #333; margin-bottom: 4px; }
.purchase-view-header .po-notes { font-size: 13px; color: #888; }
.purchase-view-header .po-meta { font-size: 12px; color: #999; margin-top: 8px; }
.purchase-view-header .po-meta span { margin-right: 16px; }
.po-category-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.po-cat-summary-item {
  background: #fff3e0;
  border: 1px solid #ffe0b2;
  border-radius: 8px;
  padding: 10px 16px;
  text-align: center;
  min-width: 100px;
}
.po-cat-summary-item .cat-name { font-size: 12px; color: #e65100; }
.po-cat-summary-item .cat-cost { font-size: 16px; font-weight: 700; color: #bf360c; }
.po-view-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}
.po-view-table th {
  background: #f5f5f5;
  padding: 8px 10px;
  text-align: center;
  font-weight: 600;
  color: #666;
  border-bottom: 2px solid #e0e0e0;
}
.po-view-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f0f0f0;
  text-align: center;
}
.po-view-table tr:last-child td { border-bottom: none; }
.po-view-table .vt-subtotal { font-weight: 600; color: #e65100; }
.po-view-total {
  text-align: right;
  padding: 12px 10px;
  font-size: 16px;
  border-top: 2px solid #ffe0b2;
  margin-top: 4px;
}
.po-view-total strong { font-size: 20px; color: #e65100; }

/* ===== Toast 自定义 ===== */
.toast.cost { background: #e65100; }

/* ===== Spinner ===== */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #e0e0e0;
  border-top-color: #43a047;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 果实标签 ===== */
.fruit-color-tag {
  display: inline-flex; align-items: center;
  padding: 2px 10px; margin: 2px;
  border-radius: 12px; font-size: 12px;
  background: #fce4ec; color: #c62828;
}
.fruit-month-tag {
  background: #fff3e0 !important; color: #e65100 !important;
}

/* ===== 分页控件 ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 0 12px;
  flex-wrap: wrap;
}
.pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  background: #fff;
  color: #555;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pagination-btn:hover:not(:disabled):not(.active) {
  border-color: #43a047;
  color: #43a047;
  background: #e8f5e9;
}
.pagination-btn.active {
  background: #43a047;
  border-color: #43a047;
  color: #fff;
  font-weight: 600;
}
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination-ellipsis {
  padding: 0 4px;
  color: #999;
  font-size: 14px;
}
.pagination-info {
  margin-left: 12px;
  font-size: 13px;
  color: #888;
  white-space: nowrap;
}
.pagination-goto {
  margin-left: 8px;
  font-size: 13px;
  color: #888;
  white-space: nowrap;
}
.pagination-goto input {
  width: 48px;
  height: 32px;
  text-align: center;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  vertical-align: middle;
}
.pagination-goto input:focus {
  border-color: #43a047;
  box-shadow: 0 0 0 2px rgba(67,160,71,0.15);
}


/* ===== 采购单查看-成本标签 ===== */
.purchase-view-cost-badge {
  display: inline-block;
  background: #fff3e0;
  color: #e65100;
  padding: 4px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  border: 1px solid #ffe0b2;
}

/* ===== 打印控制 ===== */
.print-only { display: none !important; }

@media print {
  body * { visibility: hidden; }
  #purchaseViewModal .modal-body,
  #purchaseViewModal .modal-body * { visibility: visible; }
  #purchaseViewModal .modal-body { position: absolute; left: 0; top: 0; width: 100%; }
  #purchaseViewModal .modal-header,
  #purchaseViewModal .modal-footer { display: none !important; }
  .print-only { display: block !important; }
}

/* ===== 采购单人标签（卡片列表） ===== */
.po-meta .people-badge {
  color: #e65100;
  font-weight: 500;
}

/* 花单详情删除按钮 */
.od-delete {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: #e53935;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.15s;
  margin-left: 4px;
}
.od-delete:hover {
  background: #ffebee;
  color: #c62828;
}
