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

:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-bg: #eef2ff;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1), 0 3px 10px rgba(0,0,0,0.06);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* === Topbar === */
.topbar {
  background: #0a1929;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  height: 64px;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
}

.brand {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 36px;
  background: linear-gradient(135deg, #0080FF 0%, #A100FF 100%);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.brand-icon {
  flex-shrink: 0;
}

.tabs {
  display: flex;
  gap: 4px;
  height: 100%;
  margin-left: 32px;
}

.tab {
  background: transparent;
  border: none;
  padding: 0 24px;
  height: 100%;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.tab:hover {
  color: rgba(255,255,255,0.9);
}

.tab.active {
  color: #fff;
  font-weight: 600;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: #2563eb;
  border-radius: 2px;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 24px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0080FF 0%, #A100FF 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.user-dropdown {
  position: relative;
}

.dropdown-menu-large {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  padding: 4px 0;
  z-index: 200;
}

.dropdown-menu-large .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: #1e293b;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}
.dropdown-menu-large .dropdown-item:hover {
  background: #f3f4ff;
  color: #0080FF;
}
.dropdown-menu-large .dropdown-item svg {
  flex-shrink: 0;
}
.dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 4px 0;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, #0080FF 0%, #A100FF 100%);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { opacity: 0.9; }

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

.btn-text {
  background: transparent;
  color: var(--text-secondary);
  padding: 9px 14px;
}
.btn-text:hover { color: var(--text); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid transparent;
}
.btn-danger:hover { background: var(--danger-bg); }

/* === Main Content === */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px;
}

.page-header { margin-bottom: 32px; }
.page-header h1 { font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.page-subtitle { color: var(--text-secondary); font-size: 15px; }

/* === Section Header (项目区域头部) === */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-title h1 { font-size: 28px; font-weight: 700; margin-bottom: 6px; }

.section-actions {
  display: flex;
  gap: 10px;
}

/* === Tab Panel === */
.tab-panel {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === Project Grid === */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.project-thumb {
  height: 160px;
  background: #9B9FA8;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.project-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h40v40H0z' fill='none'/%3E%3Cpath d='M0 20h40M20 0v40' stroke='rgba(255,255,255,0.05)' stroke-width='1'/%3E%3C/svg%3E");
}

.project-thumb svg {
  width: 48px;
  height: 48px;
  color: #fff;
  z-index: 1;
}

.project-thumb img.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* 悬停时给封面图加 30% 黑色遮罩，提升右上操作按钮的可视度；
   遮罩位于封面图之上(z-index 1，DOM 顺序在 img 之后)、按钮/角标之下(z-index 2) */
.project-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 1;
  pointer-events: none;
}
.project-card:hover .project-thumb::after { opacity: 1; }

.project-info {
  padding: 16px;
}

.project-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-meta {
  font-size: 13px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-date {
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-pages {
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-bg);
  padding: 2px 8px;
  border-radius: 4px;
  /* 与修改时间同行，靠右贴齐（原先在时间下方独立一行） */
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
  display: inline-block;
}

.card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}

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

.card-action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.9);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.15s;
}

.card-action-btn:hover { background: #fff; color: var(--text); }
.card-action-btn.danger:hover { color: var(--danger); background: var(--danger-bg); }

/* 删除按钮 loading 转圈 */
.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btnSpin 0.8s linear infinite;
}
.card-action-btn.danger .btn-spinner { border-color: rgba(220,38,38,0.25); border-top-color: currentColor; }
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-light);
}
.empty-state svg { margin-bottom: 16px; color: var(--border); }
.empty-state h3 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  width: 420px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
}

.modal h3 { font-size: 20px; margin-bottom: 20px; }

.modal-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}
.modal-input:focus { border-color: var(--primary); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* === Dropzone === */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 16px;
  color: var(--text-light);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}

.dropzone p { font-size: 14px; margin-top: 8px; color: var(--text-secondary); }
.dropzone-hint { font-size: 12px; margin-top: 4px; }
.dropzone .file-name { font-size: 14px; color: var(--primary); font-weight: 600; margin-top: 8px; }

/* === Toast === */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 2000;
  pointer-events: none;
}

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

.toast.error { background: var(--danger); }
.toast.success { background: #10b981; }

/* === Footer === */
.page-footer {
  position: fixed;
  right: 24px;
  bottom: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  pointer-events: none;
}

/* === 设计系统卡片 === */
.ds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.ds-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s, transform 0.15s;
  border: 1px solid #f0f0f0;
}
.ds-card:hover { box-shadow: 0 4px 16px rgba(79,70,229,0.15); transform: translateY(-2px); }
.ds-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.ds-card-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #0080FF 0%, #A100FF 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.ds-card-actions { display: flex; gap: 4px; }
.ds-card-actions .btn-icon {
  width: 30px; height: 30px;
  border: none; background: #f5f5f5;
  border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #666; transition: background 0.15s, color 0.15s;
}
.ds-card-actions .btn-icon:hover { background: #e8e8e8; color: #333; }
.ds-card-actions .ds-del:hover { background: #fee2e2; color: #dc2626; }
.ds-card-name {
  font-size: 16px; font-weight: 600;
  color: #1a1a1a; margin-bottom: 8px;
}
.ds-card-meta {
  display: flex; gap: 16px;
  font-size: 13px; color: #888; margin-bottom: 6px;
}
.ds-card-time { font-size: 12px; color: #bbb; }

/* === 组件样式库 === */
.cs-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid #eee;
}
.cs-section .section-header {
  margin-bottom: 28px;
}
/* 设计系统区块下线后，组件样式库是面板唯一区块：去掉为"分区"预留的间隔与分隔线（ID 级覆盖，媒体查询内的旧规则一并压住） */
#panel-design > .cs-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.cs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.cs-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #f0f0f0;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s, transform 0.15s;
}
.cs-card:hover {
  box-shadow: 0 4px 16px rgba(79,70,229,0.12);
  transform: translateY(-2px);
}
.cs-card-thumb {
  height: 140px;
  background: #f8f9fc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid #f0f0f0;
}
.cs-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #f8f9fc;
}
.cs-card-placeholder {
  color: #c0c4cc;
}
.cs-card-body { padding: 14px 16px 12px; }
.cs-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.cs-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.4;
}
.cs-card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.cs-card-actions .btn-icon {
  width: 28px; height: 28px;
  border: none; background: #f5f5f5;
  border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #666;
}
.cs-card-actions .btn-icon:hover { background: #e8e8e8; }
.cs-card-actions .cs-del:hover { background: #fee2e2; color: #dc2626; }
.cs-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cs-card-time { font-size: 12px; color: #bbb; }
.cs-editor-layout {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cs-editor-layout .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #444;
  margin-bottom: 6px;
}
.cs-code { min-height: 120px; }

/* ===== 新建项目下拉菜单 ===== */
.btn-dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 100;
  overflow: hidden;
  padding: 4px 0;
}
.dropdown-item {
  padding: 10px 16px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}
.dropdown-item:hover:not(.disabled) {
  background: #f3f4ff;
  color: #4f46e5;
}
.dropdown-item.disabled {
  color: #ccc;
  cursor: not-allowed;
  pointer-events: none;
}

/* 项目所有者徽章 */
.owner-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 4px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  z-index: 2;
  max-width: calc(100% - 24px);
}
.owner-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0080FF 0%, #A100FF 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
  overflow: hidden;
}
.owner-avatar span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.owner-name {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.owner-badge.mine {
  background: linear-gradient(135deg, #0080FF 0%, #A100FF 100%);
}

/* 设计系统卡片底部 */
.ds-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}
.ds-card-footer .owner-badge {
  position: static;
  padding: 2px 8px;
  background: #f1f5f9;
  border-radius: 999px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.ds-card-footer .owner-name {
  color: #475569;
  font-size: 12px;
}
/* 组件样式卡同款豁免：owner-badge 基样式是封面浮标(absolute)，缺此规则会飘到视口左上角（历史遗留，侧栏改版后暴露） */
.cs-card-footer .owner-badge {
  position: static;
  padding: 2px 8px;
  background: #f1f5f9;
  border-radius: 999px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.cs-card-footer .owner-name {
  color: #475569;
  font-size: 12px;
}
.cs-card-footer .owner-avatar {
  width: 20px;
  height: 20px;
  font-size: 11px;
}
.ds-card-footer .owner-avatar {
  width: 20px;
  height: 20px;
  font-size: 11px;
}

/* 通用返回按钮（设计系统/设置/其他页面） */
.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
  cursor: pointer;
}
.back-btn:hover { color: #fff; }
.back-btn svg { display: block; }

/* 工具箱 */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.tool-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
  border: 1px solid #f1f5f9;
}
.tool-card:not(.inactive) { cursor: pointer; }
.tool-card:not(.inactive):hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}
.tool-card.inactive {
  cursor: default;
  opacity: 0.45;
  filter: grayscale(1);
}
.tool-card.inactive:hover {
  box-shadow: none;
  transform: none;
}
.tool-icon {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  object-fit: contain;
}
.tool-icon-svg { display: inline-flex; align-items: center; justify-content: center; }
.tool-icon-svg svg { width: 100%; height: 100%; }
.tool-info { min-width: 0; }
.tool-name {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}
.tool-subtitle {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 新建项目封面预览 */
.modal-cover-upload {
  margin-bottom: 16px;
}
.cover-upload-preview {
  width: 100%;
  height: 120px;
  border: 2px dashed #e2e8f0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s;
  overflow: hidden;
  font-size: 13px;
}
.cover-upload-preview:hover {
  border-color: #0080FF;
  color: #0080FF;
}
.cover-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cover-upload-preview.has-cover svg,
.cover-upload-preview.has-cover span {
  display: none;
}

/* 资产库 - 主页 */
.asset-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding: 24px 0;
}
.asset-page-card {
  border: 1px solid var(--border, #f1f5f9);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  transition: all 0.15s;
}
.asset-page-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.asset-page-thumb {
  width: 100%; height: 160px; background: #f1f5f9;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.asset-page-thumb img, .asset-page-thumb video { width: 100%; height: 100%; object-fit: cover; }
.asset-page-info { padding: 12px 14px; }
.asset-page-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-page-meta { font-size: 11px; color: #94a3b8; display: flex; justify-content: space-between; }

/* 资产库 - 弹窗和详情样式 */
.asset-upload-preview {
  border: 2px dashed #e2e8f0; border-radius: 8px; padding: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: #94a3b8; cursor: pointer; transition: 0.15s;
}
.asset-upload-preview:hover { border-color: #0080FF; color: #0080FF; }
.asset-upload-preview.has-files {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px; padding: 12px; align-items: start;
}
.asset-page-upload-item {
  position: relative; aspect-ratio: 1; border-radius: 6px;
  overflow: hidden; background: #f1f5f9;
}
.asset-page-upload-item img, .asset-page-upload-item video { width: 100%; height: 100%; object-fit: cover; }
.asset-page-upload-item {
  position: relative; aspect-ratio: 1; border-radius: 6px;
  overflow: hidden; background: #f1f5f9;
}
.asset-page-upload-item img, .asset-page-upload-item video { width: 100%; height: 100%; object-fit: cover; }
.asset-page-upload-item .item-delete {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff; border: none;
  cursor: pointer; display: none; align-items: center;
  justify-content: center; font-size: 10px; line-height: 1;
}
.asset-page-upload-item:hover .item-delete { display: flex; }
.asset-page-upload-item.add-more {
  display: flex; align-items: center; justify-content: center;
  background: #f8fafc; border: 2px dashed #cbd5e1; aspect-ratio: 1;
  cursor: pointer; transition: 0.15s;
}
.asset-page-upload-item.add-more:hover {
  border-color: #0080FF; background: #eff6ff; color: #0080FF;
}
.asset-page-upload-item.add-more:hover .item-delete { display: none; }
.asset-detail-images {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 16px;
}
.asset-detail-images > * {
  border-radius: 6px; overflow: hidden;
  aspect-ratio: 16/10; background: #f1f5f9;
}
.asset-detail-images img, .asset-detail-images video { width: 100%; height: 100%; object-fit: cover; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.asset-detail-field { margin-bottom: 14px; }
.asset-detail-field label { font-size: 11px; color: #94a3b8; display: block; margin-bottom: 4px; text-transform: uppercase; }
.asset-detail-field p { font-size: 14px; margin: 0; line-height: 1.6; }
.asset-source-upload { font-size: 13px; }
.asset-empty {
  grid-column: 1/-1;
  text-align: center; padding: 80px 20px; color: #94a3b8;
}
.btn.is-loading, .btn:disabled { cursor: not-allowed; opacity: 0.7; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .tabs { margin-left: 12px; overflow-x: auto; }
  .tab { padding: 0 16px; font-size: 14px; }
  .brand-logo { padding: 0 20px; font-size: 20px; }
}

/* ============================================================
   移动端适配 —— 首页几个列表页
   （我的项目 / 设计系统 / 组件样式库 / 资产库 / 工具箱）
   全部规则只作用于窄屏（≤768px）与触屏（hover:none），
   PC 宽屏鼠标环境一条都不生效。
   ============================================================ */
@media (max-width: 768px) {
  /* ---- 顶栏：更矮，标签横向可滑（隐藏滚动条） ---- */
  .topbar-inner { height: 52px; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-logo { padding: 0 12px; font-size: 17px; letter-spacing: 0; }
  .brand-title { font-size: 15px; }
  .tabs {
    margin-left: 10px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* 右缘渐隐：提示标签栏可以横向滑动 */
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), rgba(0,0,0,0.35) 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), rgba(0,0,0,0.35) 100%);
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 0 13px; height: 52px; font-size: 14px; }
  .tab.active::after { bottom: 8px; width: 18px; height: 2px; }
  .topbar-actions { flex-shrink: 0; padding-right: 14px; gap: 8px; }
  .avatar { width: 32px; height: 32px; font-size: 13px; }

  /* ---- 页面留白与标题 ---- */
  .main-content { padding: 20px 14px 36px; }
  .page-header { margin-bottom: 20px; }
  .page-header h1, .section-title h1 { font-size: 22px; margin-bottom: 3px; }
  .page-subtitle { font-size: 13px; }
  .section-header { margin-bottom: 16px; gap: 10px; }
  .section-actions { gap: 8px; }
  .btn { padding: 9px 13px; font-size: 13px; }
  .cs-section { margin-top: 32px; padding-top: 22px; }
  .cs-section .section-header { margin-bottom: 16px; }

  /* ---- 列表栅格：窄屏自动收列 ---- */
  .project-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
  .ds-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
  .cs-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
  .asset-page-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; padding: 14px 0; }

  /* ---- 项目卡 ---- */
  .project-thumb { height: 140px; }
  .project-thumb svg { width: 40px; height: 40px; }
  .project-info { padding: 12px 14px 14px; }
  .project-name { font-size: 15px; }
  .owner-badge { top: 8px; left: 8px; padding: 3px 10px 3px 3px; }
  .owner-name { font-size: 12px; }
  .owner-avatar { width: 22px; height: 22px; font-size: 11px; }

  /* ---- 设计系统卡 ---- */
  .ds-card { padding: 16px; }
  .ds-card-icon { width: 38px; height: 38px; border-radius: 9px; }
  .ds-card-name { font-size: 15px; margin-bottom: 6px; }
  .ds-card-meta { gap: 10px; font-size: 12px; }

  /* ---- 组件样式卡 ---- */
  .cs-card-thumb { height: 96px; }
  .cs-card-body { padding: 10px 12px; }
  .cs-card-top { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
  .cs-card-name { font-size: 13px; word-break: break-word; }
  .cs-card-actions .btn-icon { width: 30px; height: 30px; }
  .cs-card-footer { flex-wrap: wrap; gap: 4px; }
  .cs-card-time { font-size: 11px; }

  /* ---- 资产卡 ---- */
  .asset-page-thumb { height: 112px; }
  .asset-page-info { padding: 10px 12px; }
  .asset-page-title { font-size: 13px; }
  .asset-page-meta { font-size: 10px; }

  /* ---- 工具箱卡 ---- */
  .tool-card { padding: 14px 16px; gap: 12px; }
  .tool-icon { width: 46px; height: 46px; }
  .tool-name { font-size: 15px; }
  .tool-subtitle { font-size: 12px; }

  /* ---- 卡片操作按钮：触屏没有 hover，必须常驻可见 ---- */
  .card-actions { opacity: 1; top: 8px; right: 8px; gap: 4px; }
  .card-action-btn { width: 34px; height: 34px; background: rgba(255,255,255,0.85); }
  .project-thumb::after { opacity: 1; }
  .asset-page-upload-item .item-delete { display: flex; }

  /* ---- 弹窗：贴底、按钮加大、输入不触发 iOS 缩放 ---- */
  .modal-overlay { padding: 12px; align-items: flex-end; justify-content: center; }
  .modal {
    width: 100%;
    max-width: calc(100vw - 24px);
    max-height: 82vh;
    overflow-y: auto;
    padding: 20px;
  }
  .modal h3 { font-size: 18px; margin-bottom: 14px; }
  .modal-input { font-size: 16px; padding: 11px 14px; }
  .modal-actions { margin-top: 16px; }
  .modal-actions .btn { flex: 1 1 auto; justify-content: center; }
  .cover-upload-preview { height: 112px; }
  .dropzone { padding: 22px 14px; }
  .dropzone svg { width: 36px; height: 36px; }

  /* ---- 空态与提示 ---- */
  .empty-state { padding: 44px 16px; }
  .empty-state svg { width: 48px; height: 48px; }
  .empty-state h3 { font-size: 16px; }
  .empty-state p { font-size: 13px; }
  .asset-empty { padding: 44px 16px; }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 32px); text-align: center; }

  /* ---- 刘海屏 / 底部横条安全区（无安全区时 env() 为 0，等于原样） ---- */
  .topbar { padding-top: env(safe-area-inset-top, 0px); }
  .main-content { padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px)); }
  .modal-overlay { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}

/* 很小的手机（≤480px）：标题区按钮占满一行（栅格列数与项目管理同款方案：不强制，随 minmax 自然收成单列） */
@media (max-width: 480px) {
  .section-header { align-items: flex-start; }
  .section-actions { width: 100%; }
  .section-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* 触屏环境（必须是粗指针的真触摸设备，触摸屏笔记本/台式机不会命中）：
   去掉 hover 抬升与变色（点完会“粘住”），改成按下反馈 */
@media (hover: none) and (pointer: coarse) {
  .project-card:hover, .ds-card:hover, .cs-card:hover, .asset-page-card:hover,
  .tool-card:not(.inactive):hover {
    transform: none;
  }
  .project-card:hover { border-color: var(--border); box-shadow: var(--shadow); }
  .ds-card:hover, .cs-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
  .asset-page-card:hover, .tool-card:not(.inactive):hover { box-shadow: none; }
  .project-card:active, .ds-card:active, .cs-card:active,
  .asset-page-card:active, .tool-card:active, .dropdown-item:active { opacity: 0.72; }
  .btn:active, .tab:active, .card-action-btn:active, .btn-icon:active { opacity: 0.7; }
  .btn, .tab, .dropdown-item, .card-action-btn, .btn-icon,
  .project-card, .ds-card, .cs-card, .tool-card, .asset-page-card {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}

/* ============================================================
   首页 PC 端（≥769px）左侧边栏 —— 2026-09-18 修订稿v7
   变更：logo 去底色改黑色文字左对齐 + 右侧收起按钮（可收成 64px 图标窄栏，
   状态记忆 localStorage）；tab 悬停/选中弃异形改 12px 圆角矩形；点阵底保留。
   双重隔离：仅 ≥769px + .home-page。回滚：删本块+body类+按钮/user-name标签。
   ============================================================ */
.user-name { display: none; }
.side-collapse-btn { display: none; } /* 移动端零感知 */
@media (min-width: 769px) {
  /* ---------- 骨架：点阵网格浅底，50% 半透明透出下层流体 ---------- */
  .home-page .topbar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 240px;
    display: flex;
    z-index: 100;
    background:
      radial-gradient(circle at 1px 1px, rgba(0,90,180,0.07) 1px, transparent 1.6px) 0 0 / 18px 18px,
      linear-gradient(180deg, rgba(251,252,255,0.5) 0%, rgba(243,246,251,0.5) 100%);
    border-right: 1px solid #dfe6f0;
    transition: width 0.22s ease;
  }
  .home-page .topbar-inner {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 0 18px;
  }
  /* ---------- 品牌区：黑色文字左对齐 + 收起按钮 ---------- */
  .home-page .brand {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    gap: 22px;
    padding: 0;
  }
  .home-page .brand-logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 56px;
    box-sizing: border-box;
    padding: 0 14px 0 16px;
    border-radius: 0;
    background: none;
    color: #0b1220;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 3px;
    filter: none;
  }
  .home-page .side-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid #dfe6f0;
    background: #fff;
    color: #5b6b7f;
    cursor: pointer;
    transition: all 0.18s ease;
  }
  .home-page .side-collapse-btn:hover { color: #0b1220; border-color: #a8ccff; background: #f0f6ff; }
  /* ---------- 导航：12px 圆角矩形（弃异形） ---------- */
  .home-page .tabs {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: auto;
    margin: 0 14px;
    gap: 8px;
    height: auto;
    overflow: visible;
  }
  .home-page .tabs::before {
    content: 'NAVIGATION';
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3.5px;
    color: #9fb0c6;
    padding: 0 0 2px 6px;
  }
  .home-page .tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    box-sizing: border-box;
    height: auto;
    padding: 12px 14px;
    border-radius: 12px;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 1px;
    color: #5b6b7f;
    white-space: normal;
    transition: all 0.2s ease;
  }
  .home-page .tab::before {
    content: '';
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    background-color: currentColor;
    -webkit-mask: var(--ico) no-repeat center / contain;
    mask: var(--ico) no-repeat center / contain;
    transition: transform 0.2s ease;
  }
  .home-page .tab[data-tab="editor"]::before { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E"); }
  .home-page .tab[data-tab="design"]::before { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E"); }
  .home-page .tab[data-tab="assets"]::before { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2 2 7l10 5 10-5z'/%3E%3Cpath d='M2 12l10 5 10-5'/%3E%3Cpath d='M2 17l10 5 10-5'/%3E%3C/svg%3E"); }
  .home-page .tab[data-tab="tools"]::before { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E"); }
  .home-page .tab:hover { color: #12305e; background: rgba(20,70,150,0.07); }
  .home-page .tab:hover::before { transform: scale(1.12); }
  .home-page .tab.active {
    color: #fff;
    font-weight: 700;
    background: linear-gradient(120deg, #0080FF 0%, #7B5CFF 55%, #A100FF 100%);
    box-shadow: 0 8px 20px -8px rgba(60,90,255,0.55);
  }
  .home-page .tab.active:hover { background: linear-gradient(120deg, #1a8fff 0%, #8a6cff 55%, #ae1aff 100%); }
  .home-page .tab.active::after { display: none; }
  /* ---------- 用户入口：与 tab 同款（无默认底，悬停圆角矩形） ---------- */
  .home-page .topbar-actions {
    margin: auto 14px 0;
    padding: 0;
    width: auto;
    display: block;
  }
  .home-page .user-dropdown {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .home-page .user-dropdown:hover { background: rgba(20,70,150,0.07); }
  .home-page .avatar {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
  .home-page .user-name {
    display: block;
    min-width: 0;
    color: #33415a;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .home-page .dropdown-menu-large {
    top: auto;
    bottom: calc(100% + 10px);
    left: 10px;
    right: auto;
    min-width: 184px;
    border-radius: 12px;
    border: 1px solid #dfe6f0;
    cursor: default;
  }
  /* ---------- 内容区 ---------- */
  .home-page .main-content {
    margin: 0 0 0 240px;
    max-width: none;
    width: auto;
    padding: 36px 40px 72px;
    transition: margin-left 0.22s ease;
  }
  /* ---------- 收起态：64px 图标窄栏（body.sidebar-collapsed） ---------- */
  .home-page.sidebar-collapsed .topbar { width: 64px; }
  .home-page.sidebar-collapsed .brand-logo { padding: 0; justify-content: center; font-size: 0; letter-spacing: 0; }
  .home-page.sidebar-collapsed .side-collapse-btn { transform: rotate(180deg); }
  .home-page.sidebar-collapsed .tabs { margin: 0 10px; }
  .home-page.sidebar-collapsed .tabs::before { display: none; }
  .home-page.sidebar-collapsed .tab { justify-content: center; gap: 0; padding: 12px 0; font-size: 0; letter-spacing: 0; }
  .home-page.sidebar-collapsed .user-dropdown { justify-content: center; padding: 12px 0; }
  .home-page.sidebar-collapsed .user-name { display: none; }
  .home-page.sidebar-collapsed .dropdown-menu-large { left: 6px; }
  .home-page.sidebar-collapsed .main-content { margin-left: 64px; }
}

/* ============================================================
   二级页面顶栏浅色系（20260918，罗先生定：与编辑器顶栏同款）
   适用：组件样式编辑 / 设置 / 资产详情 / 工具箱 9 页。
   各页 body 挂 class="sub-light" 后生效；
   首页桌面端（.home-page 侧栏规则）与移动端深色顶栏零影响。
   ============================================================ */
body.sub-light .topbar { background: #ffffff; border-bottom: 1px solid #dfe6f0; }
/* 垂直居中修正：基础 .topbar-inner / .brand 是 align-items:stretch，子项被拉满 64px 栏高——
   返回钮悬停底色变成通顶竖块、标题文字顶格。浅色态统一改 center（与编辑器顶栏观感一致）。 */
body.sub-light .topbar-inner { align-items: center; }
body.sub-light .brand { align-items: center; }
body.sub-light .back-btn { color: #5b6b7f; border-radius: 8px; transition: all 0.15s ease; }
body.sub-light .back-btn:hover { color: #12305e; background: rgba(20, 70, 150, 0.07); }
body.sub-light .brand-title { color: #0b1220; font-size: 16px; font-weight: 600; }
body.sub-light .page-title { color: #0b1220; }
/* 资产页右上"编辑/删除资产"小件：浅底描边，悬停浅蓝圆角（原半透明白为深底设计） */
body.sub-light .btn-topbar-secondary { background: #ffffff; border: 1px solid #dfe6f0; color: #5b6b7f; transition: all 0.15s ease; }
body.sub-light .btn-topbar-secondary:hover { background: rgba(20, 70, 150, 0.07); border-color: #b9cbe8; color: #12305e; }

/* ============================================================
   移动端首页 · 侧边抽屉导航 —— 2026-09-18 mobile v1
   顶栏改白底黑字 ZERO + 汉堡钮；tab 从横滑条变 240px 侧抽屉，默认收起。
   抽屉视觉 = 桌面侧栏同款：点阵浅底 + NAVIGATION 眉标 + 12px 圆角 tab。
   隔离：@media(≤768px) + .home-page 双作用域，桌面端与其他页面零影响。
   抽屉态 body.nav-open 不持久化，刷新/重进永远默认收起。
   ============================================================ */
.mobile-nav-btn { display: none; } /* 基准隐藏，仅移动端作用域显示 */
@media (max-width: 768px) {
  /* ---------- 顶栏：白底黑字 + 汉堡 ---------- */
  .home-page .topbar { background: #ffffff; border-bottom: 1px solid #dfe6f0; }
  .home-page .brand { flex: 0 0 auto; }
  .home-page .brand-logo { background: none; color: #0b1220; letter-spacing: 2px; padding: 0 12px; gap: 12px; }
  .home-page .mobile-nav-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px; border: 1px solid #dfe6f0;
    background: #fff; color: #5b6b7f; cursor: pointer; flex-shrink: 0;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  }
  .home-page .mobile-nav-btn:active { background: rgba(20,70,150,0.12); color: #12305e; border-color: #b9cbe8; }

  /* ---------- 抽屉：贴左、默认移出屏外 ---------- */
  .home-page .tabs {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 1;
    box-sizing: border-box; width: 240px; height: auto;
    margin: 0; padding: calc(14px + env(safe-area-inset-top, 0px)) 10px 28px;
    display: flex; flex-direction: column; align-items: stretch; gap: 8px;
    overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
    -webkit-mask-image: none; mask-image: none;
    background:
      radial-gradient(circle at 1px 1px, rgba(0,90,180,0.07) 1px, transparent 1.6px) 0 0 / 18px 18px,
      linear-gradient(180deg, #fbfcff 0%, #f3f6fb 100%);
    border-right: 1px solid #dfe6f0;
    box-shadow: 14px 0 36px rgba(15,30,60,0.20);
    transform: translateX(-105%); transition: transform 0.24s ease;
  }
  .home-page .tabs::-webkit-scrollbar { display: none; }
  .home-page.nav-open .tabs { transform: none; pointer-events: auto; }
  .home-page .tabs::before {
    content: 'NAVIGATION';
    font-size: 10px; font-weight: 700; letter-spacing: 3.5px;
    color: #9fb0c6; padding: 0 0 2px 6px;
  }

  /* ---------- 抽屉 tab：与桌面同一套 12px 圆角矩形语言 ---------- */
  .home-page .tab {
    position: relative; display: flex; align-items: center; gap: 11px;
    width: 100%; box-sizing: border-box; height: auto; padding: 13px 14px;
    border-radius: 12px; text-align: left; font-size: 15px; font-weight: 500;
    line-height: 20px; letter-spacing: 1px; color: #5b6b7f; white-space: normal;
    background: transparent; transition: all 0.2s ease;
  }
  .home-page .tab::before {
    content: '';
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    background-color: currentColor;
    -webkit-mask: var(--ico) no-repeat center / contain;
    mask: var(--ico) no-repeat center / contain;
    transition: transform 0.2s ease;
  }
  .home-page .tab[data-tab="editor"]::before { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E"); }
  .home-page .tab[data-tab="design"]::before { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E"); }
  .home-page .tab[data-tab="assets"]::before { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2 2 7l10 5 10-5z'/%3E%3Cpath d='M2 12l10 5 10-5'/%3E%3Cpath d='M2 17l10 5 10-5'/%3E%3C/svg%3E"); }
  .home-page .tab[data-tab="tools"]::before { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z'/%3E%3C/svg%3E"); }
  .home-page .tab.active {
    color: #fff; font-weight: 700;
    background: linear-gradient(120deg, #0080FF 0%, #7B5CFF 55%, #A100FF 100%);
    box-shadow: 0 8px 20px -8px rgba(60,90,255,0.55);
  }
  .home-page .tab.active::after { display: none; }

  /* ---------- 遮罩与层级：顶栏升到 1100（抽屉是其子层），遮罩 1050 盖内容 ---------- */
  .home-page .nav-backdrop {
    position: fixed; inset: 0; z-index: 1050;
    background: rgba(15,30,60,0.38);
    opacity: 0; pointer-events: none; transition: opacity 0.24s ease;
  }
  .home-page.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  .home-page.nav-open .topbar { z-index: 1100; pointer-events: none; }
  body.home-page.nav-open { overflow: hidden; }
}

/* ===== 组件样式实时预览 (cspreview v2) ===== */
.cs-preview-section { max-width: 1980px; margin: 0 auto; padding: 24px 20px 40px; }
.cs-preview-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.cs-preview-title { font-size: 13px; font-weight: 500; color: #444; }
.cs-preview-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cs-preview-size { font-size: 12px; color: #5b6b7f; background: #eef2f8; border: 1px solid #dfe6f0; border-radius: 6px; padding: 3px 8px; font-variant-numeric: tabular-nums; }
.cs-preview-auto { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 400; color: #5b6b7f; cursor: pointer; user-select: none; margin: 0; }
.cs-preview-auto input { accent-color: #0080FF; width: 14px; height: 14px; }
.cs-preview-tools .cs-preview-refresh { padding: 6px 14px; font-size: 13px; }
.cs-preview-seg { display: inline-flex; background: #eef2f8; border: 1px solid #dfe6f0; border-radius: 8px; padding: 2px; }
.cs-preview-seg button { border: 0; background: transparent; color: #5b6b7f; font-size: 12px; font-family: inherit; padding: 4px 12px; border-radius: 6px; cursor: pointer; transition: all 0.15s ease; }
.cs-preview-seg button:hover { color: #12305e; }
.cs-preview-seg button.active { background: #ffffff; color: #0b57d0; font-weight: 600; box-shadow: 0 1px 3px rgba(15, 30, 60, 0.12); }
.cs-preview-body { overflow-x: auto; padding: 20px; background: #f2f5fa; border: 1px solid #dfe6f0; border-radius: 12px; }
.cs-preview-frame-wrap { position: relative; width: 100%; margin: 0 auto; }
.cs-preview-frame { display: block; width: 100%; height: 1000px; border: 0; border-radius: 8px; background: #ffffff; box-shadow: 0 0 0 1px #e3e9f2, 0 1px 4px rgba(15, 30, 60, 0.08); }
.cs-preview-handle { position: absolute; top: 0; bottom: 0; width: 12px; display: flex; align-items: center; justify-content: center; cursor: ew-resize; border-radius: 6px; touch-action: none; z-index: 2; }
.cs-preview-handle::after { content: ""; width: 4px; height: 44px; border-radius: 2px; background: rgba(91, 107, 127, 0.5); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9); transition: background 0.15s ease, height 0.15s ease; }
.cs-preview-handle:hover::after, .cs-preview-handle.dragging::after { background: #0080FF; height: 72px; }
.cs-preview-handle.left { left: -16px; }
.cs-preview-handle.right { right: -16px; }
.cs-preview-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9fb0c6; font-size: 13px; border: 1px dashed #c9d5e6; border-radius: 8px; background: rgba(255, 255, 255, 0.65); pointer-events: none; }
.cs-preview-body.phone .cs-preview-handle { display: none; }
.cs-preview-body.phone .cs-preview-frame { border: 10px solid #101826; border-radius: 26px; box-shadow: 0 2px 10px rgba(15, 30, 60, 0.18); }
body.cs-preview-dragging { user-select: none; cursor: ew-resize; }
body.cs-preview-dragging .cs-preview-frame { pointer-events: none; }
@media (max-width: 768px) {
  .cs-preview-section { padding: 16px 10px 32px; }
  .cs-preview-bar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .cs-preview-body { padding: 12px; }
  .cs-preview-handle { width: 10px; }
  .cs-preview-handle.left { left: -11px; }
  .cs-preview-handle.right { right: -11px; }
}
/* 组件样式页预览区放宽：仅此页 main 解除 1400 上限（表单列本身居中，观感不变） */
.main-content.cs-preview-page { max-width: 1980px; padding: 32px 24px 40px; }
.cs-preview-section { padding-top: 4px; }

/* ===== 首页流体氛围背景 (homefluid v1，仅 .home-page) ===== */
/* fixed 层 z-index:-1：垫在页面底色之上、所有内容卡片之下，只在留白处透出 */
.home-page .home-fluid {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.35;           /* 整体再压淡一半（原 0.7），流体只是若有若无的氛围 */
  filter: blur(64px);      /* 统一大模糊，团块边缘互融成流体感 */
}
.home-page .home-fluid .hf-blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  will-change: transform;
}
/* 四个团块：蓝→紫，取品牌渐变(#0080FF→#7B5CFF→#A100FF)同色系；时长互质+ease-in-out 往复，叠加出准随机漂移 */
.home-page .hf-blob.hf-b1 {
  width: 58vmax; height: 58vmax; left: -14vmax; top: -18vmax;
  background: radial-gradient(circle at 38% 38%, rgba(0,128,255,0.32) 0%, rgba(0,128,255,0) 68%);
  animation: hfDriftA 16s ease-in-out infinite;
}
.home-page .hf-blob.hf-b2 {
  width: 52vmax; height: 52vmax; right: -16vmax; top: -8vmax;
  background: radial-gradient(circle at 60% 40%, rgba(123,92,255,0.26) 0%, rgba(123,92,255,0) 68%);
  animation: hfDriftB 20s ease-in-out infinite;
}
.home-page .hf-blob.hf-b3 {
  width: 60vmax; height: 60vmax; left: 6vmax; bottom: -28vmax;
  background: radial-gradient(circle at 45% 55%, rgba(161,0,255,0.20) 0%, rgba(161,0,255,0) 66%);
  animation: hfDriftC 22s ease-in-out infinite;
}
.home-page .hf-blob.hf-b4 {
  width: 40vmax; height: 40vmax; right: 10vmax; bottom: -12vmax;
  background: radial-gradient(circle at 50% 50%, rgba(90,140,255,0.24) 0%, rgba(90,140,255,0) 70%);
  animation: hfDriftD 17s ease-in-out infinite;
}
@keyframes hfDriftA {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  25% { transform: translate3d(26vw, 18vh, 0) scale(1.22); }
  50% { transform: translate3d(8vw, 46vh, 0) scale(0.86); }
  75% { transform: translate3d(-22vw, 14vh, 0) scale(1.12); }
}
@keyframes hfDriftB {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  30% { transform: translate3d(-32vw, 26vh, 0) scale(1.18); }
  60% { transform: translate3d(-10vw, 54vh, 0) scale(0.82); }
}
@keyframes hfDriftC {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  35% { transform: translate3d(30vw, -22vh, 0) scale(1.26); }
  70% { transform: translate3d(50vw, -8vh, 0) scale(0.88); }
}
@keyframes hfDriftD {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  40% { transform: translate3d(-26vw, -34vh, 0) scale(1.24); }
  75% { transform: translate3d(12vw, -16vh, 0) scale(0.8); }
}
/* 小屏降模糊半径省算力；减弱动效偏好下静止成一层淡淡的定妆色 */
@media (max-width: 768px) {
  .home-page .home-fluid { filter: blur(40px); }
}
@media (prefers-reduced-motion: reduce) {
  .home-page .home-fluid .hf-blob { animation: none; }
}
