/* ============================================
   CX-Workspace 作品集 — 对标 Notion 白底浅色风格
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #fff;
  color: #1a1a1a;
  line-height: 1.6;
  min-height: 100vh;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input { font-family: inherit; }

/* --- Cover Banner --- */
.cover-wrapper {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: visible;
  background: #f5f5f5;
}
.cover-grid {
  display: grid;
  width: 100%;
  height: 100%;
  gap: 0;
}
.cover-grid:has(> :only-child) { grid-template-columns: 1fr; }
.cover-grid:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, 1fr); }
.cover-grid:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
.cover-grid:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, 1fr); }
.cover-grid:has(> :nth-child(5):last-child) { grid-template-columns: repeat(5, 1fr); }
.cover-grid:has(> :nth-child(6):last-child),
.cover-grid:has(> :nth-child(6)) { grid-template-columns: repeat(6, 1fr); }
.cover-grid-item {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cover-grid-item:only-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover-grid-cell {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.cover-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 1.1rem;
  grid-column: 1 / -1;
}
.cover-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s, background .2s;
}
.cover-grid-cell:hover .cover-delete-btn { opacity: 1; }
.cover-delete-btn:hover { background: rgba(0,0,0,.75); }

.cover-logo {
  position: absolute;
  bottom: -63px;
  left: max(48px, calc((100vw - 2040px) / 2 + 48px));
  width: 126px;
  height: 126px;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a1a;
  box-shadow: 0 6px 24px rgba(0,0,0,.25);
  border: none;
  z-index: 10;
  cursor: pointer;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s;
}
.cover-logo:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(0,0,0,.32);
}
.cover-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 编辑模式：Logo上的换图覆盖层 */
.logo-edit-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 1.8rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 11;
  transition: background .2s;
}
body.editing .logo-edit-overlay {
  display: flex;
  opacity: 0;
  transition: opacity .2s;
}
body.editing .cover-logo:hover .logo-edit-overlay {
  opacity: 1;
}
.logo-edit-overlay:hover {
  background: rgba(0,0,0,.6);
}


/* --- Main Content --- */
.main-content {
  max-width: 2040px;
  margin: 0 auto;
  padding: 90px 48px 100px;
}

/* Site Title */
.site-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin: 0 0 16px;
  color: #111;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* View Switcher */
.view-switcher {
  margin-bottom: 28px;
}
.view-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 1.2rem;
  font-weight: 500;
  color: #555;
  background: #f5f5f5;
  border-radius: 8px;
  cursor: default;
}

/* --- Skeleton Loading --- */
.skeleton-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 20px;
}
.skeleton-category { display: flex; flex-direction: column; gap: 14px; }
.skeleton-bar {
  height: 18px;
  background: linear-gradient(90deg, #e8e8e8 25%, #f0f0f0 50%, #e8e8e8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
.skeleton-bar.w-32 { width: 32%; }
.skeleton-bar.w-40 { width: 40%; }
.skeleton-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.skeleton-card {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(90deg, #e8e8e8 25%, #f0f0f0 50%, #e8e8e8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px;
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* --- Category Section --- */
.category-section {
  margin-bottom: 48px;
}
.category-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  cursor: pointer;
  user-select: none;
  border-bottom: 2px solid #eee;
  margin-bottom: 24px;
  position: relative;
}
.category-toggle {
  font-size: 1.5rem;
  color: #888;
  transition: transform .2s;
  width: 28px;
  flex-shrink: 0;
}
.category-toggle.collapsed { transform: rotate(-90deg); }
.category-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}
.category-name {
  font-size: 1.65rem;
  font-weight: 800;
  color: #222;
}
.category-count {
  font-size: 1rem;
  color: #999;
  font-weight: 400;
}
.category-projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  overflow: hidden;
  transition: max-height .35s ease, opacity .35s ease;
  max-height: 5000px;
  opacity: 1;
}
.category-projects.collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: -24px;
}

/* --- Project Card --- */
.project-card {
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  background: #fff;
  border: 1px solid #f0f0f0;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0,0,0,.12);
}
.project-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #f5f5f5;
  display: block;
}
.project-card-body {
  padding: 20px 22px;
}
.project-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #222;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-card-date {
  font-size: 1.1rem;
  color: #999;
  margin-top: 8px;
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 48px 0 24px;
  color: #bbb;
  font-size: .85rem;
  border-top: 1px solid #f0f0f0;
  margin-top: 20px;
}

/* --- About Tooltip (Logo hover) --- */
.about-tooltip {
  display: block;
  position: fixed;
  z-index: 150;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  padding: 20px 24px;
  max-width: 320px;
  min-width: 240px;
  font-size: .92rem;
  color: #333;
  line-height: 1.7;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
}
.about-tooltip.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.about-tooltip-content {
  white-space: pre-wrap;
  max-height: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.about-tooltip-hint {
  margin-top: 10px;
  font-size: .78rem;
  color: #888;
  text-align: right;
}

/* --- About Detail Popup --- */
.about-modal {
  max-width: 580px;
}
.about-detail-page {
  padding: 48px 56px 56px;
  max-height: 78vh;
  overflow-y: auto;
}
.about-detail-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: #111;
  margin-bottom: 24px;
  padding-bottom: 14px;
  position: relative;
}
.about-detail-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #111 0%, #555 100%);
  border-radius: 2px;
}
.about-detail-content {
  font-size: 1rem;
  color: #333;
  line-height: 1.85;
  white-space: pre-wrap;
  min-height: 80px;
}
.about-detail-content:empty::before {
  content: '尚未填写介绍内容';
  color: #bbb;
  font-style: italic;
}
.about-detail-edit-toolbar {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 10px;
}

/* --- Search Bar --- */
.search-bar {
  margin: 0 0 20px;
}
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #f5f5f5;
  border-radius: 10px;
  padding: 0 16px;
  transition: background .2s;
}
.search-input-wrap:focus-within {
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(45,127,249,.12);
}
.search-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 14px;
  font-size: .95rem;
  color: #333;
  outline: none;
  font-family: inherit;
}
.search-input::placeholder { color: #bbb; }
.search-clear {
  background: none;
  border: none;
  color: #999;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background .15s;
}
.search-clear:hover { background: rgba(0,0,0,.06); }

.no-results {
  text-align: center;
  padding: 48px 20px;
  color: #bbb;
  font-size: 1rem;
}

/* ============================================
   编辑模式相关样式
   ============================================ */

/* 编辑模式提示条 */
.edit-bar {
  display: none !important;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #1a1a1a;
  color: #fff;
  padding: 8px 20px;
  align-items: center;
  justify-content: space-between;
  font-size: .85rem;
}
body.editing .edit-bar { display: flex !important; }
.edit-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
body.editing #viewer { padding-top: 42px; }
.edit-bar-label { font-weight: 600; }
.btn-edit-about {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  padding: 5px 14px;
  border-radius: 6px;
  font-size: .8rem;
  transition: background .2s;
  cursor: pointer;
}
.btn-edit-about:hover { background: rgba(255,255,255,.28); }
.btn-exit-edit {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  padding: 5px 14px;
  border-radius: 6px;
  font-size: .8rem;
  transition: background .2s;
}
.btn-exit-edit:hover { background: rgba(255,255,255,.25); }

/* 编辑模式下可交互元素样式 */
body.editing .cover-wrapper { cursor: pointer; position: relative; }
body.editing .cover-wrapper::after {
  content: '点击添加封面图';
  position: absolute;
  top: 12px;
  right: 16px;
  background: rgba(0,0,0,.6);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: .75rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
body.editing .cover-wrapper:hover::after { opacity: 1; }
body.editing .cover-logo { cursor: pointer; }

body.editing .site-title {
  cursor: text;
  outline: 2px dashed transparent;
  border-radius: 4px;
  padding: 2px 6px;
  transition: outline-color .2s;
}
body.editing .site-title:hover { outline-color: #ccc; }

body.editing .category-header { cursor: pointer; }
body.editing .category-tag { cursor: pointer; }
body.editing .category-name:hover { background: #f0f0f0; border-radius: 4px; }

body.editing .project-card { position: relative; }
body.editing .project-card:hover .card-edit-actions { opacity: 1; }
.card-edit-actions {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}
body.editing .card-edit-actions { display: flex; }
.card-edit-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: rgba(255,255,255,.9);
  color: #444;
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  transition: background .15s;
}
.card-edit-btn:hover { background: #fff; }
.card-edit-btn.danger { color: #e03e3e; }

/* 添加按钮 */
.add-project-btn {
  border: 2px dashed #ddd;
  border-radius: 12px;
  background: transparent;
  color: #aaa;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all .2s;
}
.add-project-btn:hover {
  border-color: #aaa;
  color: #666;
  background: #fafafa;
}
.add-category-btn {
  width: 100%;
  max-width: 420px;
  height: 72px;
  border: 2px dashed #ddd;
  border-radius: 10px;
  background: transparent;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all .2s;
  margin: 32px 0 48px;
}
.add-category-btn:hover {
  border-color: #aaa;
  color: #666;
  background: #fafafa;
}
.add-symbol { font-size: 2.2rem; font-weight: 300; }

/* 内联编辑框 */
.inline-edit-input {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  border: 2px solid #2D7FF9;
  border-radius: 4px;
  padding: 2px 6px;
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(45,127,249,.15);
  min-width: 60px;
}
.inline-edit-input.title-input {
  font-size: 2rem;
  font-weight: 700;
  padding: 4px 8px;
  width: 100%;
  max-width: 600px;
}

/* --- 弹窗通用 --- */
.password-overlay, .confirm-overlay, .color-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.4);
  align-items: center;
  justify-content: center;
}
.password-overlay.active, .confirm-overlay.active, .color-overlay.active {
  display: flex;
}
.password-modal, .confirm-modal, .color-modal {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  min-width: 320px;
  max-width: 400px;
}
.password-modal h3, .color-modal h4 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: #222;
}
.password-modal input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
}
.password-modal input:focus { border-color: #2D7FF9; }
.password-actions, .confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  justify-content: flex-end;
}
.password-error {
  color: #e03e3e;
  font-size: .8rem;
  margin-top: 8px;
  min-height: 20px;
}

/* 按钮通用 */
.btn-cancel, .btn-confirm, .btn-danger {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 500;
  border: none;
  transition: background .15s;
}
.btn-cancel { background: #f0f0f0; color: #555; }
.btn-cancel:hover { background: #e4e4e4; }
.btn-confirm { background: #2D7FF9; color: #fff; }
.btn-confirm:hover { background: #1a6de0; }
.btn-danger { background: #e03e3e; color: #fff; }
.btn-danger:hover { background: #c53030; }

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a1a;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: .85rem;
  z-index: 300;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 颜色选择 */
.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color .15s, transform .15s;
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.selected { border-color: #1a1a1a; }

/* 确认弹窗 */
.confirm-modal p { font-size: .95rem; color: #333; line-height: 1.5; }

/* 图片上传进度 */
.upload-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0,0,0,.1);
}
.upload-progress-bar {
  height: 100%;
  background: #2D7FF9;
  transition: width .3s;
}

/* 水印（图片防下载） */
.watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 40px,
    rgba(0,0,0,.03) 40px, rgba(0,0,0,.03) 80px
  );
  z-index: 1;
}

/* 编辑模式下分类头部操作 */
body.editing .category-header .cat-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  opacity: 0;
  transition: opacity .15s;
}
body.editing .category-header:hover .cat-actions { opacity: 1; }
.cat-actions .cat-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: #f0f0f0;
  color: #666;
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.cat-actions .cat-btn:hover { background: #e4e4e4; }
.cat-actions .cat-btn.danger { color: #e03e3e; }
.cat-actions .cat-btn.danger:hover { background: #ffe6e6; }

/* 添加分类按钮 */
.add-category-btn {
  width: 100%;
  max-width: 320px;
  height: 56px;
  border: 2px dashed #ddd;
  border-radius: 8px;
  background: transparent;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s;
  margin: 24px 0 40px;
}
.add-category-btn:hover {
  border-color: #aaa;
  color: #666;
  background: #fafafa;
}
.add-category-btn .add-symbol { font-size: 1.5rem; font-weight: 300; }

/* 项目详情弹窗 */
.detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(0,0,0,.45);
  align-items: flex-start;
  justify-content: center;
  padding: 28px 20px;
  overflow-y: auto;
}
.detail-overlay.active { display: flex; }
.detail-modal {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 860px;
  box-shadow: 0 16px 56px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
}
.detail-close {
  position: fixed;
  top: 16px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.95);
  color: #333;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  box-shadow: 0 1px 6px rgba(0,0,0,.12);
}
.detail-close:hover { background: #fff; }

/* 详情页内容区 */
.detail-page {
  padding: 48px 60px 60px;
  max-height: 84vh;
  overflow-y: auto;
}

/* 详情标题 */
.detail-title {
  font-size: 2.6rem;
  font-weight: 900;
  color: #111;
  margin: 0 0 18px;
  padding-bottom: 14px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  position: relative;
}
.detail-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #111 0%, #555 100%);
  border-radius: 2px;
}
body.editing .detail-title:hover { cursor: text; background: #fafafa; border-radius: 4px; }
body.editing .detail-title:hover::after { display: none; }

/* 封面/画廊 */
.detail-cover {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
  margin-bottom: 24px;
  position: relative;
}
.detail-main-image {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #0a0a0a;
  display: block;
}
.detail-main-image[src=""] { display: none; }
.detail-thumbs {
  display: none;
  gap: 8px;
  padding: 12px;
  overflow-x: auto;
  background: #1a1a1a;
}
.detail-thumb {
  width: 74px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: .7;
  transition: opacity .15s, border-color .15s;
  flex-shrink: 0;
}
.detail-thumb:hover, .detail-thumb.active { opacity: 1; border-color: #fff; }
.detail-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.9);
  color: #333;
  font-size: 2rem;
  font-weight: 300;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
  transition: background .15s, transform .15s;
  line-height: 1;
}
.detail-nav-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.08);
}
.detail-nav-arrow:disabled {
  opacity: .35;
  cursor: default;
  transform: translateY(-50%);
}
.detail-nav-prev { left: 16px; }
.detail-nav-next { right: 16px; }


/* 属性表格 */
.detail-properties {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 32px;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  padding: 12px 0;
}
.detail-prop {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 0;
}
.detail-prop-label {
  width: 96px;
  flex-shrink: 0;
  color: #999;
  font-size: .85rem;
  line-height: 1.5;
}
.detail-prop-value {
  flex: 1;
  color: #333;
  font-size: .95rem;
  line-height: 1.5;
  white-space: pre-wrap;
  display: flex;
  align-items: center;
}
.detail-prop-value:hover { cursor: text; }
body.editing .detail-prop-value:hover { background: #fafafa; border-radius: 4px; }
.detail-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 4px;
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  vertical-align: middle;
}
.detail-empty-value { color: #bbb; font-style: italic; }

/* 正文区域 */
.detail-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.detail-block {
  position: relative;
}
.detail-block-text {
  font-size: 1rem;
  color: #333;
  line-height: 1.75;
  white-space: pre-wrap;
}
.detail-block-image {
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}
.detail-block-image img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  background: #0a0a0a;
  display: block;
}

/* 编辑模式：正文块操作 */
body.editing .detail-block { padding-left: 36px; position: relative; }
.detail-block-actions {
  display: none;
  position: absolute;
  left: 0;
  top: 4px;
  gap: 4px;
}
body.editing .detail-block:hover .detail-block-actions { display: flex; }
.detail-block-actions button {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  border: none;
  background: #f0f0f0;
  color: #555;
  font-size: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.detail-block-actions button:hover { background: #e4e4e4; }
.detail-block-actions button.danger { color: #e03e3e; }
.detail-block-actions button.danger:hover { background: #ffe6e6; }

/* 编辑模式输入框 */
.detail-edit-input {
  width: 100%;
  border: 2px solid #2D7FF9;
  border-radius: 6px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: .95rem;
  color: #333;
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(45,127,249,.1);
}
.detail-edit-input.title-input {
  font-size: 2rem;
  font-weight: 800;
  color: #111;
  padding: 6px 10px;
}
.detail-edit-textarea {
  width: 100%;
  min-height: 80px;
  border: 2px solid #2D7FF9;
  border-radius: 6px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.7;
  color: #333;
  outline: none;
  background: #fff;
  resize: vertical;
  box-shadow: 0 0 0 3px rgba(45,127,249,.1);
}

/* 编辑工具栏 */
.detail-edit-toolbar {
  display: none;
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #eee;
  padding: 12px 0;
  gap: 12px;
  margin-top: 24px;
}
body.editing .detail-edit-toolbar { display: flex; }
.toolbar-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #555;
  font-size: .85rem;
  transition: all .15s;
}
.toolbar-btn:hover { background: #f5f5f5; border-color: #ccc; }

/* 响应式：详情弹窗 */
@media (max-width: 768px) {
  .detail-overlay { padding: 0; }
  .detail-modal { max-height: 100vh; border-radius: 0; }
  .detail-page { padding: 24px 20px 80px; max-height: 100vh; }
  .detail-title { font-size: 1.6rem; }
  .detail-prop-label { width: 80px; }
  .detail-main-image { max-height: 280px; }
  .detail-close { top: 10px; right: 12px; }
}

/* --- Responsive --- */
@media (max-width: 2040px) {
  .main-content { padding: 90px 48px 100px; }
}
@media (max-width: 1200px) {
  .main-content { padding: 80px 32px 80px; }
  .site-title { font-size: 2.2rem; }
  .cover-logo { left: 32px; }
  .category-projects { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
  .skeleton-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
  .add-project-btn { min-height: 200px; }
}
@media (max-width: 768px) {
  .main-content { padding: 60px 16px 60px; }
  .site-title { font-size: 1.8rem; }
  .cover-wrapper { height: 280px; }
  .cover-grid,
  .cover-grid:has(> :only-child),
  .cover-grid:has(> :nth-child(2):last-child),
  .cover-grid:has(> :nth-child(3):last-child),
  .cover-grid:has(> :nth-child(4):last-child),
  .cover-grid:has(> :nth-child(5):last-child),
  .cover-grid:has(> :nth-child(6):last-child),
  .cover-grid:has(> :nth-child(6)) { grid-template-columns: repeat(2, 1fr); }
  .cover-grid:has(> :only-child) { grid-template-columns: 1fr; }
  .cover-grid:has(> :nth-child(3)) { grid-template-columns: repeat(3, 1fr); }
  .cover-logo { bottom: -42px; left: 16px; width: 84px; height: 84px; border-width: 0; border-radius: 8px; }
  .category-projects { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
  .skeleton-cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
  .category-name { font-size: 1.2rem; }
  .category-tag { padding: 4px 10px; font-size: .85rem; }
  .project-card-title { font-size: 1rem; }
  .project-card-date { font-size: .85rem; }
  .add-project-btn { min-height: 140px; }
  .detail-nav-arrow {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }
  .detail-nav-prev { left: 10px; }
  .detail-nav-next { right: 10px; }
}

@media (max-width: 480px) {
  .cover-wrapper { height: 220px; }
  .category-projects { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .skeleton-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
}

/* Cover grid auto-fit override */
.cover-grid {
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr)) !important;
}
