:root {
  --portal-sidebar: 80px;
  --portal-sidebar-xl: 96px;
  --portal-bg: #f5f5f7;
  --portal-ink: #1d1d1f;
  --portal-muted: #86868b;
  --portal-accent: #0071e3;
  --portal-accent-hover: #147ce5;
  --portal-radius-lg: 20px;
  --portal-radius-xl: 24px;
  --portal-border: rgba(0, 0, 0, 0.05);
  --portal-card: rgba(255, 255, 255, 0.5);
  --portal-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body.home-page,
body.tools-page,
body.library-page {
  margin: 0;
  background: var(--portal-bg) !important;
  background-image: none !important;
  color: var(--portal-ink);
  font-family: var(--portal-font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.home-page::before,
body.tools-page::before,
body.library-page::before,
body.home-page::after,
body.tools-page::after,
body.library-page::after {
  display: none !important;
  content: none !important;
}

/* 阻断 site-theme.css 对 portal 页的覆盖 */
body.home-page .hero-carousel,
body.tools-page .hero-carousel,
body.library-page .hero-carousel {
  background: linear-gradient(135deg, #111115 0%, #1c1c24 50%, #252538 100%) !important;
  border: none !important;
}

body.home-page .hero-carousel .slide,
body.tools-page .hero-carousel .slide,
body.library-page .hero-carousel .slide {
  background: transparent !important;
}

body.home-page .slide-tag {
  color: #5ac8fa !important;
}

/* ── Page stack spacing (space-y-12) ── */
.portal-page-stack {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.portal-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── content shell（内容区占比） ── */
.portal-shell,
main.container {
  width: 95%;
  max-width: none !important;
  margin: 0 auto;
  padding: 40px 0 80px !important;
}

/* ── Hero (home) ── */
.hero-carousel {
  position: relative;
  overflow: hidden;
  margin-bottom: 0 !important;
  padding: 40px 56px;
  border-radius: var(--portal-radius-xl) !important;
  background: linear-gradient(135deg, #111115 0%, #1c1c24 50%, #252538 100%) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  transition: box-shadow 0.3s ease;
}

.hero-carousel:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 113, 227, 0.08) !important;
}

@media (min-width: 768px) {
  .hero-carousel { padding: 56px; }
}

.hero-carousel::before,
.hero-carousel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-carousel::before {
  top: -160px;
  right: -160px;
  width: 384px;
  height: 384px;
  background: rgba(0, 113, 227, 0.2);
  filter: blur(100px);
}

.hero-carousel::after {
  bottom: -80px;
  left: -80px;
  width: 320px;
  height: 320px;
  background: rgba(168, 85, 247, 0.1);
  filter: blur(80px);
}

.hero-carousel .slide {
  position: relative;
  z-index: 1;
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
  padding: 0 !important;
  background: transparent !important;
}

@media (min-width: 1024px) {
  .hero-carousel .slide {
    grid-template-columns: 7fr 5fr;
  }
}

.slide-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.slide-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px !important;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #5ac8fa !important;
  font-size: 12px !important;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.slide-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5ac8fa;
  animation: portal-pulse 2s ease infinite;
}

@keyframes portal-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.slide-title {
  margin-bottom: 16px !important;
  background: linear-gradient(90deg, #fff, #fff, #9ca3af);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  font-size: clamp(32px, 4vw, 56px) !important;
  font-weight: 800 !important;
  line-height: 1.05 !important;
  letter-spacing: -0.02em !important;
}

.slide-desc {
  max-width: 520px;
  margin-bottom: 28px !important;
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 17px !important;
  font-weight: 300;
  line-height: 1.6 !important;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-btn-primary,
.hero-btn-secondary {
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
}

.hero-btn-primary {
  background: #fff;
  color: #000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.hero-btn-primary:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
}

.hero-btn-secondary {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.hero-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.slide-visual-wrap {
  display: flex;
  justify-content: center;
}

.slide-visual {
  position: relative;
  width: 288px !important;
  height: 288px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 16px !important;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
  transition: transform 0.5s ease;
}

@media (min-width: 768px) {
  .slide-visual {
    width: 320px !important;
    height: 320px !important;
  }
}

.hero-carousel:hover .slide-visual {
  transform: scale(1.03);
}

.slide-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-visual-caption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent 60%);
  color: rgba(255, 255, 255, 0.8);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  pointer-events: none;
}

/* ── Section headers ── */
.section-header,
.home-recommended-head,
.portal-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--portal-border);
}

.section-title,
.home-recommended-head h3,
.portal-section-head h2 {
  margin: 0;
  font-size: 24px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

.section-subtitle,
.home-recommended-head p,
.portal-section-head p {
  margin: 4px 0 0;
  color: var(--portal-muted) !important;
  font-size: 12px !important;
}

.btn-outline,
.home-recommended-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0 !important;
  background: transparent !important;
  color: var(--portal-accent) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  cursor: pointer;
  text-decoration: none;
}

.btn-outline:hover,
.home-recommended-more:hover {
  text-decoration: underline;
}

/* ── Workflow grid (home + tools) ── */
.home-recommended-grid,
.tool-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px !important;
}

@media (min-width: 640px) {
  .home-recommended-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .home-recommended-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tool-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  .tool-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.home-workflow-gallery-card,
.tool-card {
  overflow: hidden;
  border: 1px solid var(--portal-border) !important;
  border-radius: var(--portal-radius-lg) !important;
  background: var(--portal-card) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  cursor: pointer;
  transition: all 0.3s ease;
}

.home-workflow-gallery-card:hover,
.tool-card:hover {
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
  transform: translateY(-4px);
}

.home-workflow-gallery-card {
  display: flex;
  flex-direction: column;
}

.home-workflow-gallery-card .wf-cover,
.tool-card .tool-cover {
  position: relative;
  overflow: hidden;
  background: #f3f4f6;
}

.home-workflow-gallery-card .wf-cover {
  aspect-ratio: 1;
}

.tool-card .tool-cover {
  aspect-ratio: 4 / 3;
}

.home-workflow-gallery-card .wf-cover img,
.tool-card .tool-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.home-workflow-gallery-card:hover .wf-cover img,
.tool-card:hover .tool-cover img {
  transform: scale(1.05);
}

.home-workflow-gallery-card .wf-body,
.tool-card .tool-body {
  padding: 16px;
}

.home-workflow-gallery-card h4,
.tool-card .tool-body strong {
  margin: 0 0 4px;
  font-size: 14px !important;
  font-weight: 700 !important;
  transition: color 0.2s;
}

.home-workflow-gallery-card:hover h4,
.tool-card:hover .tool-body strong {
  color: var(--portal-accent) !important;
}

.home-workflow-gallery-card .wf-desc,
.tool-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.4) !important;
}

.tool-card .tool-body small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  color: rgba(29, 29, 31, 0.5) !important;
  font-size: 12px !important;
  line-height: 1.5;
}

.home-workflow-usage,
.usage-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6) !important;
  color: #fff !important;
  font-size: 10px !important;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.tool-card .tool-enter {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--portal-ink);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s;
}

.tool-card:hover .tool-enter {
  background: var(--portal-accent);
  color: #fff;
}

/* ── Tutorials (home) ── */
.tutorial-section { margin-top: 0; }

/* 与教程分类页 .tutorial-public-list 相同的响应式列数，保证卡片尺寸一致 */
.tutorial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 640px) {
  .tutorial-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .tutorial-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  .tutorial-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.tutorial-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.tutorial-card:hover {
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.05);
  transform: translateY(-4px);
}

.tutorial-card .tutorial-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f3f4f6;
}

.tutorial-card .tutorial-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.tutorial-card:hover .tutorial-thumb img {
  transform: scale(1.05);
}

.tutorial-card .tutorial-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.tutorial-card .tutorial-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #b7bec9;
}

.tutorial-card .tutorial-thumb-placeholder svg {
  width: 32px;
  height: 32px;
}

.tutorial-card .tutorial-chip {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
}

.tutorial-card .tutorial-duration {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.2;
}

.tutorial-card .tutorial-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
  color: #1d1d1f;
}

.tutorial-card .tutorial-play svg {
  width: 14px;
  height: 14px;
  padding: 10px 8px 10px 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  fill: currentColor;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  box-sizing: content-box;
  transition: transform 0.25s ease;
}

.tutorial-card:hover .tutorial-play svg {
  transform: scale(1.08);
}

.tutorial-card .tutorial-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  min-height: 120px;
  padding: 20px;
}

.tutorial-card .tutorial-info h4 {
  margin: 0 0 8px;
  color: #000;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.tutorial-card:hover .tutorial-info h4 {
  color: var(--portal-accent);
}

.tutorial-card .tutorial-info p {
  display: none;
}

.tutorial-card .tutorial-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--portal-accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.tutorial-card .tutorial-cta svg {
  width: 12px;
  height: 12px;
  transition: transform 0.22s ease;
}

.tutorial-card:hover .tutorial-cta svg {
  transform: translateX(4px);
}

.published-empty {
  grid-column: 1 / -1;
  padding: 48px 24px;
  border: 1px dashed var(--portal-border);
  border-radius: var(--portal-radius-lg);
  text-align: center;
  color: var(--portal-muted);
}

.published-empty strong {
  display: block;
  margin-bottom: 8px;
  color: var(--portal-ink);
  font-size: 16px;
}

/* ── Tools page ── */
.tools-shell {
  width: 85% !important;
  max-width: none !important;
  margin: 0 auto;
  padding: 40px 0 80px !important;
}

.tools-search input {
  font-size: 14px !important;
}

.credit-pill {
  padding: 0 16px !important;
  border: 0 !important;
  background: rgba(0, 113, 227, 0.1) !important;
  color: var(--portal-accent) !important;
  font-size: 12px !important;
}

.member-pill {
  padding: 0 20px !important;
  border: 0 !important;
  background: linear-gradient(90deg, #f59e0b, #ea580c) !important;
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.15) !important;
}

.recent-section h2 {
  margin-bottom: 12px !important;
  color: var(--portal-muted) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* 最近使用卡片样式由 tools.css 定义（旧的药丸样式覆盖已移除） */

.tools-tabs {
  box-sizing: border-box;
  height: 40px;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin-bottom: 0 !important;
  padding: 4px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(0, 0, 0, 0.05) !important;
}

.tools-tabs button {
  height: 32px;
  display: inline-flex !important;
  align-items: center !important;
  padding: 0 16px !important;
  border-radius: 999px !important;
  color: rgba(29, 29, 31, 0.6) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}

.tools-tabs button.active {
  background: #fff !important;
  color: var(--portal-ink) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
  font-weight: 600 !important;
}

.tools-tabs button::after { display: none !important; }

.tools-filter-meta {
  margin-left: auto;
  color: var(--portal-muted);
  font-size: 12px;
}

.tools-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--portal-border);
}

/* ── Library page ── */
body.library-page .topbar { display: none; }

.library-shell {
  width: 85%;
  margin: 0 auto;
  padding: 40px 0 80px;
}

.library-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--portal-border);
}

.library-page-head h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.library-page-head p {
  margin: 4px 0 0;
  color: var(--portal-muted);
  font-size: 12px;
}

.library-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.library-head-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--portal-ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.library-head-actions .btn:hover {
  background: #fff;
}

.library-head-actions .btn.primary {
  border-color: var(--portal-accent);
  background: var(--portal-accent);
  color: #fff;
}

.library-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.library-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
}

.library-tabs .tab {
  padding: 8px 16px;
  border-radius: 999px;
  background: transparent;
  color: rgba(29, 29, 31, 0.6);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.library-tabs .tab.active {
  background: #fff;
  color: var(--portal-ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.library-search {
  position: relative;
}

.library-search input {
  width: 240px;
  padding: 8px 16px 8px 36px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  font-size: 12px;
  outline: none;
  transition: all 0.2s;
}

.library-search input:focus {
  border-color: var(--portal-accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.library-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--portal-muted);
  pointer-events: none;
}

body.library-page .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

@media (min-width: 768px) {
  body.library-page .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  body.library-page .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  body.library-page .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

body.library-page .asset-card {
  overflow: hidden;
  border: 1px solid var(--portal-border) !important;
  border-radius: var(--portal-radius-lg) !important;
  background: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  cursor: pointer;
  transition: all 0.3s ease;
}

body.library-page .asset-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
  transform: translateY(-4px);
}

body.library-page .asset-preview {
  position: relative;
  aspect-ratio: 1 !important;
  background: #f3f4f6;
  overflow: hidden;
}

body.library-page .asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

body.library-page .asset-card:hover .asset-preview img {
  transform: scale(1.05);
}

body.library-page .asset-hover-actions {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.2s;
}

body.library-page .asset-card:hover .asset-hover-actions {
  opacity: 1;
}

body.library-page .asset-hover-actions button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--portal-ink);
  cursor: pointer;
  transition: transform 0.2s;
}

body.library-page .asset-hover-actions button:hover {
  transform: scale(1.1);
}

/* 图片加载失败态：显示提示按钮，不再拿演示图顶替内容 */
.asset-img-failed { opacity: 1; }

.asset-img-retry {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  max-width: 88%;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  backdrop-filter: saturate(180%) blur(8px);
}

.asset-img-retry:hover { background: rgba(15, 23, 42, 0.86); }

body.library-page .asset-hover-actions svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

body.library-page .card-body {
  padding: 12px !important;
}

body.library-page .card-body h3 {
  margin: 0 0 4px;
  font-size: 12px !important;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.library-page .meta {
  display: flex;
  justify-content: space-between;
  color: rgba(29, 29, 31, 0.4) !important;
  font-size: 10px !important;
  font-family: ui-monospace, monospace;
}

body.library-page .library-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--portal-border);
}

body.library-page .library-pagination-summary {
  color: var(--portal-muted);
  font-size: 13px;
}

body.library-page .library-pagination-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

body.library-page .library-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  background: #fff;
  color: var(--portal-ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

body.library-page .library-pagination-btn:hover:not(:disabled) {
  border-color: rgba(0, 113, 227, 0.3);
  color: var(--portal-accent);
  background: rgba(0, 113, 227, 0.05);
}

body.library-page .library-pagination-btn.active {
  border-color: var(--portal-accent);
  background: var(--portal-accent);
  color: #fff;
}

body.library-page .library-pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

body.library-page .library-pagination-ellipsis {
  padding: 0 4px;
  color: var(--portal-muted);
  font-size: 13px;
}

body.library-page .asset-card-actions { display: none !important; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 3000;
  transform: translate(-50%, 18px);
  padding: 11px 18px;
  border-radius: 12px;
  background: #1d1d1f;
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

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

/* ── Apple lightbox (immersive image view) ── */
.asset-viewer {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.9) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.asset-viewer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.asset-viewer[hidden] {
  display: none !important;
}

.asset-viewer-close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 10;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s ease;
}

.asset-viewer-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.asset-viewer-close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

.asset-viewer-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 90vw;
  height: 100%;
  max-height: 90vh;
}

.asset-viewer-stage > img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
}

.asset-viewer-toolbar {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.asset-viewer-filename {
  display: flex;
  align-items: center;
  max-width: 200px;
  padding: 8px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.asset-viewer-filename span {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-viewer-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.asset-viewer-action svg {
  width: 16px;
  height: 16px;
  stroke: rgba(255, 255, 255, 0.8);
  fill: none;
  flex-shrink: 0;
}

.asset-viewer-action:hover {
  background: #0071e3;
  border-color: #0071e3;
}

.asset-viewer-action:hover svg {
  stroke: #fff;
}

.asset-viewer-action[data-asset-viewer-favorite]:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: transparent;
}

.asset-viewer-action[data-asset-viewer-favorite].is-favorite {
  background: rgba(255, 59, 48, 0.18);
  border-color: rgba(255, 59, 48, 0.35);
}

.asset-viewer-action[data-asset-viewer-favorite].is-favorite svg {
  stroke: #ff6b6b;
  fill: #ff6b6b;
}

@media (max-width: 640px) {
  .asset-viewer-toolbar {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 20px;
    bottom: 20px;
  }

  .asset-viewer-filename {
    width: 100%;
    max-width: none;
    justify-content: center;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .asset-viewer-close {
    top: 16px;
    right: 16px;
  }
}

@media (max-width: 768px) {
  .portal-shell,
  main.container,
  .tools-shell,
  .library-shell {
    width: 92%;
    padding-top: 24px !important;
  }

  .hero-carousel {
    padding: 32px 24px;
  }

  .hero-carousel .slide {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .slide-content {
    align-items: center;
  }

  .slide-visual-wrap {
    justify-content: center;
  }

  .slide-visual {
    width: 100% !important;
    max-width: 280px;
    height: 280px !important;
    margin: 0 auto;
  }

  .hero-actions {
    justify-content: center;
  }

  body.library-page .asset-hover-actions {
    opacity: 1;
  }
}

/* ── Tools page: neutralize tools.css conflicts ── */
body.tools-page .tools-shell {
  width: 85% !important;
  max-width: none !important;
  min-height: auto !important;
  margin: 0 auto !important;
  padding: 40px 0 80px !important;
}

/* 搜索框已移到分类标签行右侧（.tools-tabs-side） */
body.tools-page .tools-tabs-side {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 1 auto;
  min-width: 0;
}

body.tools-page .tools-search {
  width: min(300px, 32vw) !important;
  height: 40px !important;
  flex: 0 1 auto;
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  background: rgba(0, 0, 0, 0.05) !important;
  box-shadow: none !important;
}

body.tools-page .tools-search:focus-within {
  border-color: var(--portal-accent) !important;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15) !important;
}

body.tools-page .tools-filter-meta {
  white-space: nowrap;
}

@media (max-width: 760px) {
  body.tools-page .tools-tabs-row {
    flex-wrap: wrap;
  }

  body.tools-page .tools-tabs-side {
    width: 100%;
  }

  body.tools-page .tools-search {
    width: 100% !important;
  }
}

/* 旧手写顶栏（.tools-account）已从 tools.html 移除，相关规则删除 */

body.tools-page .tool-grid {
  gap: 24px !important;
}

/* ===== 最终优先级：压过 apple-design-system.css ===== */
body.home-page .hero-carousel,
body.home-page.has-global-sidebar .hero-carousel {
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 40px 56px !important;
  border-radius: var(--portal-radius-xl) !important;
  background: linear-gradient(to bottom right, #111115, #1c1c24, #252538) !important;
  border: none !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

@media (min-width: 768px) {
  body.home-page .hero-carousel { padding: 56px !important; }
}

body.home-page .hero-carousel .slide,
body.home-page .slide {
  background: transparent !important;
  padding: 0 !important;
}

body.home-page .slide-title {
  background: linear-gradient(90deg, #fff, #fff, #9ca3af) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  font-family: var(--portal-font) !important;
  font-size: clamp(36px, 5vw, 60px) !important;
  font-weight: 800 !important;
  line-height: 1.05 !important;
  letter-spacing: -0.02em !important;
}

body.home-page .slide-desc {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 17px !important;
  font-weight: 300 !important;
  line-height: 1.6 !important;
  max-width: 520px !important;
  margin-bottom: 0 !important;
}

body.home-page .slide-tag {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: fit-content !important;
  margin-bottom: 0 !important;
  padding: 6px 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: #5ac8fa !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  text-transform: none !important;
}

body.home-page .slide-visual {
  width: 320px !important;
  height: 320px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 16px !important;
  background: #111 !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

body.home-page .slide-visual img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  filter: none !important;
}

body.home-page .home-workflow-gallery-card,
body.home-page .home-workflow-gallery-card.published-workflow-card {
  flex: unset !important;
  width: auto !important;
  aspect-ratio: unset !important;
  padding: 0 !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  border-radius: var(--portal-radius-lg) !important;
  background: rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

body.home-page .tutorial-card {
  background: rgba(255, 255, 255, 0.6) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  border-radius: 24px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

/* ===== 资产库：文件夹卡片区 ===== */
.library-section-title {
  margin: 4px 0 16px;
  color: var(--portal-ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.library-folder-area {
  margin-bottom: 8px;
}

.folder-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 22px;
  margin: 0 0 34px;
}

.folder-card {
  cursor: pointer;
  text-align: center;
  outline: none;
}

.folder-card-shape {
  --folder-bg: #e8e9ee;
  position: relative;
  aspect-ratio: 5 / 4;
}

.folder-card:hover .folder-card-shape,
.folder-card:focus-visible .folder-card-shape {
  --folder-bg: #d9dbe2;
}

.folder-card-tab {
  position: absolute;
  top: 0;
  left: 0;
  width: 42%;
  height: 22px;
  border-radius: 10px 16px 0 0;
  background: var(--folder-bg);
  transition: background 0.2s ease;
}

.folder-card-body {
  position: absolute;
  inset: 12px 0 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 0 16px 16px 16px;
  background: var(--folder-bg);
  transition: background 0.2s ease;
}

.folder-card-body img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.folder-card-placeholder,
.folder-card-body > svg {
  color: #b3b8c2;
}

.folder-card-placeholder svg,
.folder-card-body > svg {
  width: 40px;
  height: 40px;
}

/* 文件夹封面：用 clip-path 让封面图填满整个文件夹轮廓（含左上页签），
   不再因为矩形封面盖不满不规则形状而在顶部露出灰色。 */
.folder-card-tab { display: none; }
.folder-card:not(.folder-card-new) .folder-card-body {
  inset: 0;
  border-radius: 0;
  clip-path: polygon(0 0, 42% 0, 42% 12px, 100% 12px, 100% 100%, 0 100%);
}

.folder-card-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.folder-card:hover .folder-card-actions,
.folder-card:focus-within .folder-card-actions {
  opacity: 1;
  transform: translateY(0);
}

.folder-card-actions button {
  border: 0;
  border-radius: 10px;
  padding: 7px 14px;
  background: #fff;
  color: var(--portal-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: background 0.15s ease, color 0.15s ease;
}

.folder-card-actions button:hover {
  background: #fee2e2;
  color: #dc2626;
}

.folder-card-name {
  display: block;
  margin-top: 10px;
  color: var(--portal-ink);
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-card-meta {
  display: block;
  margin-top: 3px;
  color: var(--portal-muted);
  font-size: 12px;
}

.folder-card-new .folder-card-body {
  inset: 0;
  border: 1.5px dashed rgba(0, 0, 0, 0.16);
  border-radius: 16px;
  background: transparent;
  color: var(--portal-muted);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.folder-card-new .folder-card-body svg {
  width: 26px;
  height: 26px;
  color: inherit;
}

.folder-card-new:hover .folder-card-body,
.folder-card-new:focus-visible .folder-card-body {
  border-color: rgba(0, 113, 227, 0.45);
  color: var(--portal-accent);
}

/* 文件夹打开视图头部 */
.library-folder-open {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 24px;
}

.library-folder-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--portal-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.library-folder-back:hover {
  border-color: rgba(0, 0, 0, 0.18);
  background: #fff;
}

.library-folder-back svg {
  width: 14px;
  height: 14px;
}

.library-folder-open-icon {
  display: inline-grid;
  place-items: center;
  color: var(--portal-accent);
}

.library-folder-open-icon svg {
  width: 20px;
  height: 20px;
}

.library-folder-open h2 {
  margin: 0;
  color: var(--portal-ink);
  font-size: 18px;
  font-weight: 700;
}

.library-folder-open-count {
  color: var(--portal-muted);
  font-size: 13px;
}

.library-folder-remove {
  margin-left: auto;
  padding: 8px 16px;
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 999px;
  background: transparent;
  color: #dc2626;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.library-folder-remove:hover {
  background: #fef2f2;
}

/* 批量选择 */
.library-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.library-select-toggle {
  padding: 9px 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--portal-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.library-select-toggle:hover {
  border-color: rgba(0, 0, 0, 0.18);
}

.library-select-toggle.active {
  border-color: rgba(0, 113, 227, 0.45);
  background: #e8f1fd;
  color: var(--portal-accent);
}

.asset-select-check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.22);
  color: transparent;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.asset-select-check svg {
  width: 13px;
  height: 13px;
}

.grid.is-selecting .asset-select-check {
  display: grid;
}

.grid.is-selecting .asset-hover-actions {
  display: none !important;
}

.grid.is-selecting .asset-card {
  cursor: pointer;
}

.asset-card.is-selected .asset-select-check {
  border-color: var(--portal-accent);
  background: var(--portal-accent);
  color: #fff;
}

.grid.is-selecting .asset-card.is-selected {
  box-shadow: 0 0 0 2px var(--portal-accent);
}

.library-batch-bar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 3100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 20px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.92);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateX(-50%);
}

.library-batch-count {
  font-weight: 600;
  white-space: nowrap;
}

.library-batch-bar button {
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.library-batch-bar button:hover {
  background: rgba(255, 255, 255, 0.24);
}

.library-batch-bar button.primary {
  background: var(--portal-accent);
}

.library-batch-bar button.primary:hover {
  background: var(--portal-accent-hover);
}

.library-batch-bar button.danger {
  background: rgba(220, 38, 38, 0.85);
}

.library-batch-bar button.danger:hover {
  background: #b91c1c;
}

/* 卡片悬停/查看器里的删除按钮：红色危险态 */
body.library-page .asset-hover-actions .asset-action-danger:hover {
  background: #fee2e2 !important;
  color: #dc2626 !important;
}

.asset-viewer .asset-viewer-danger:hover {
  background: rgba(220, 38, 38, 0.9) !important;
  color: #fff !important;
}

.library-batch-bar button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.folder-new-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 5px 4px 14px;
  border: 1px solid rgba(0, 113, 227, 0.4);
  border-radius: 999px;
  background: #fff;
}

.folder-new-form input {
  width: 130px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--portal-ink);
  font-family: inherit;
  font-size: 13px;
}

.folder-new-form button {
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  background: var(--portal-accent);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.folder-new-form button:hover {
  background: var(--portal-accent-hover);
}

/* ===== 资产库：弹层（移动到文件夹 / 删除确认，需盖过 z-index:5000 的大图查看器） ===== */
.library-dialog {
  position: fixed;
  inset: 0;
  z-index: 5200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.library-dialog.is-open {
  opacity: 1;
}

.library-dialog-card {
  width: min(380px, 100%);
  padding: 22px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  transform: translateY(8px);
  transition: transform 0.2s ease;
}

.library-dialog.is-open .library-dialog-card {
  transform: translateY(0);
}

.library-dialog-card h3 {
  margin: 0 0 8px;
  color: var(--portal-ink);
  font-size: 17px;
  font-weight: 700;
}

.library-dialog-card > p {
  margin: 0 0 20px;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.6;
}

.library-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.library-dialog-actions button {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  padding: 9px 18px;
  background: #fff;
  color: var(--portal-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.library-dialog-actions button:hover {
  background: #f3f4f6;
}

.library-dialog-actions button.danger {
  border-color: transparent;
  background: #dc2626;
  color: #fff;
}

.library-dialog-actions button.danger:hover {
  background: #b91c1c;
}

.folder-picker-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  margin: 0 0 14px;
  overflow-y: auto;
}

.folder-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--portal-ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.folder-picker-row svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.folder-picker-row:hover {
  background: #f3f4f6;
}

.folder-picker-row.active {
  background: #e8f1fd;
  color: var(--portal-accent);
}

.folder-picker-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-picker-count {
  color: var(--portal-muted);
  font-size: 12px;
}

.folder-picker-remove {
  color: var(--portal-muted);
}

.folder-picker-empty {
  margin: 4px 2px 8px;
  color: var(--portal-muted);
  font-size: 13px;
}

.folder-picker-new {
  display: flex;
  width: 100%;
}

.folder-picker-new input {
  flex: 1;
  width: auto;
}

.library-dialog-input {
  display: flex;
  width: 100%;
  margin-top: 4px;
}

.library-dialog-input input {
  flex: 1;
  width: auto;
}


/* ============================================================
   首页：聊天框 Hero + 快捷入口 + Recent Projects
   宽度/圆角/边框/阴影全部沿用 portal 设计变量，与工作流/教程等区块对齐
   ============================================================ */
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.home-hero-title {
  margin: 4px 0 24px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1d1d1f;
}
.home-hero-title em {
  font-style: normal;
  color: var(--portal-accent);
}

.home-chat-box {
  position: relative;
  width: 100%;
  max-width: 920px;
  padding: 18px 18px 14px;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-xl);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.home-chat-box:focus-within {
  border-color: rgba(0, 113, 227, 0.35);
  box-shadow: 0 8px 26px rgba(0, 113, 227, 0.1);
}
.home-chat-box textarea {
  width: 100%;
  min-height: 92px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: #1d1d1f;
  font: inherit;
  font-size: 15px;
  line-height: 1.6;
}
.home-chat-box textarea::placeholder { color: var(--portal-muted); }

.home-chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.home-chat-tools { display: inline-flex; gap: 8px; }
.home-chat-tool {
  height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--portal-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #4b5563;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.home-chat-tool.icon { width: 34px; padding: 0; justify-content: center; }
.home-chat-tool:hover { border-color: rgba(0, 113, 227, 0.35); color: var(--portal-accent); }
.home-chat-send {
  height: 38px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #1d1d1f;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.home-chat-send:hover { background: #000; }

/* ── 首页 composer（对齐画布底部输入框样式；网站浅色 UI） ── */
.home-composer { padding: 16px 16px 14px; }
.home-composer-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.home-composer-add {
  flex: none;
  width: 58px;
  height: 80px;
  margin: 2px 6px 0 2px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(150deg, #f4f5f8, #e9ebf0);
  color: #a6abb5;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
  transform: rotate(-7deg);
  transition: transform 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.home-composer-add:hover {
  color: var(--portal-accent);
  transform: rotate(-3deg) translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14);
}
.home-composer textarea { min-height: 84px; }

.home-composer-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.home-pill {
  flex: none;
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  color: #1d1d1f;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.home-pill:hover { background: #f2f6fb; border-color: rgba(0, 113, 227, 0.3); }
.home-pill svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.home-pill.is-primary {
  border-color: rgba(0, 113, 227, 0.3);
  background: rgba(0, 113, 227, 0.08);
  color: var(--portal-accent);
}
.home-pill-caret { width: 13px !important; height: 13px !important; opacity: 0.7; }
.home-pill-sep { width: 1px; height: 14px; background: var(--portal-border); }
.home-spark { color: var(--portal-accent); font-size: 12px; }
.home-ratio-chip {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1.6px solid currentColor;
  border-radius: 3px;
  box-sizing: border-box;
}
.home-composer-spacer { flex: 1; }
.home-composer-cost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--portal-muted);
  font-size: 13px;
}
.home-composer-cost b { color: #1d1d1f; }
.home-composer-send {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--portal-accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}
.home-composer-send:hover { background: #0060c0; transform: translateY(-1px); }
.home-composer-send svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Agent 模式：隐藏只跟直接生图相关的控件 */
.home-composer[data-composer-mode="agent"] #homeModelButton,
.home-composer[data-composer-mode="agent"] #homeSizeButton,
.home-composer[data-composer-mode="agent"] .home-composer-cost { display: none; }

/* 展开面板 */
.home-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 16px;
  z-index: 30;
  min-width: 240px;
  max-width: calc(100vw - 48px);
  padding: 12px;
  border: 1px solid var(--portal-border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
  backdrop-filter: saturate(170%) blur(24px);
  -webkit-backdrop-filter: saturate(170%) blur(24px);
  text-align: left;
}
.home-popover[hidden] { display: none; }
.home-popover-model { width: min(430px, calc(100vw - 48px)); max-height: 420px; overflow-y: auto; }
.home-popover-size { width: min(460px, calc(100vw - 48px)); }
.home-popover h5 {
  margin: 2px 2px 8px;
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 500;
}
.home-popover h5 + * { margin-bottom: 10px; }

.home-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #1d1d1f;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.home-option:hover { background: rgba(0, 113, 227, 0.06); }
.home-option.is-selected { background: rgba(0, 113, 227, 0.1); }
.home-option-icon {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--portal-accent);
}
.home-option-icon svg { width: 17px; height: 17px; fill: currentColor; }
.home-option-main { flex: 1; min-width: 0; }
.home-option-name { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.home-option-desc { display: block; margin-top: 2px; color: var(--portal-muted); font-size: 12px; }
.home-option-badge {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(0, 113, 227, 0.12);
  color: var(--portal-accent);
  font-size: 10px;
  font-weight: 600;
}
.home-option-badge.locked { background: rgba(203, 128, 20, 0.14); color: #b06a00; }
.home-option-check { color: var(--portal-accent); font-weight: 700; }
.home-option.is-locked { opacity: 0.55; cursor: not-allowed; }
.home-option.is-locked:hover { background: transparent; }

.home-ratio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
  gap: 6px;
}
.home-ratio-grid button {
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 8px 4px 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #4b5563;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.home-ratio-grid button:hover { background: rgba(0, 113, 227, 0.06); }
.home-ratio-grid button.is-selected {
  border-color: rgba(0, 113, 227, 0.28);
  background: rgba(0, 113, 227, 0.1);
  color: #1d1d1f;
}
.home-res-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.home-res-group button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #4b5563;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.home-res-group button:hover { background: rgba(0, 113, 227, 0.06); }
.home-res-group button.is-selected {
  border-color: rgba(0, 113, 227, 0.28);
  background: rgba(0, 113, 227, 0.1);
  color: #1d1d1f;
}
.home-size-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}
.home-size-inputs label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--portal-muted);
  font-size: 12px;
}
.home-size-inputs input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1d1d1f;
  font: inherit;
  font-size: 13px;
  text-align: right;
}
.home-size-x, .home-size-unit { color: var(--portal-muted); font-size: 12px; }

.home-shortcuts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 920px;
  margin-top: 16px;
}
.home-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius-lg);
  background: var(--portal-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.home-shortcut:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}
.home-shortcut .sc-ico {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 19px;
  font-style: normal;
  background: #eef2ff;
}
.home-shortcut .sc-ico.ecom { background: #fee2e2; }
.home-shortcut .sc-ico.poster { background: #cffafe; }
.home-shortcut .sc-ico.video { background: #f5e8ff; }
.home-shortcut .sc-ico.social { background: #dbeafe; }
.home-shortcut .sc-ico.brand { background: #dcfce7; }
.home-shortcut .sc-ico.office { background: #e0f2fe; }
.home-shortcut span { display: flex; flex-direction: column; }
.home-shortcut strong { font-size: 13.5px; font-weight: 600; color: #1d1d1f; }
.home-shortcut small { font-size: 11.5px; color: var(--portal-muted); }

/* ---------- Recent Projects（沿用 portal-section / section-header 布局） ---------- */
.home-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
/* 首页最近项目默认只展示一行，多出的用「查看更多」去项目管理页看 */
.home-project-grid-oneline {
  max-height: 200px; /* 卡片高 200px = 一行 */
  overflow: hidden;
}
.home-project-new,
.home-project-card {
  height: 200px;
  border-radius: var(--portal-radius-lg);
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.home-project-new {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1.5px dashed rgba(0, 0, 0, 0.14);
  background: var(--portal-card);
  color: var(--portal-muted);
  font: inherit;
}
.home-project-new:hover { border-color: rgba(0, 113, 227, 0.4); color: var(--portal-accent); }
.home-project-new .np-plus { font-size: 30px; line-height: 1; }
.home-project-new b { font-size: 14px; font-weight: 600; }

.home-project-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--portal-border);
  background: var(--portal-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.home-project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}
.home-project-card .hp-thumbs {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  background: #eef0f3;
  min-height: 0;
}
.home-project-card .hp-cell { overflow: hidden; background: #f3f4f6; }
.home-project-card .hp-cell.empty { background: #f4f5f7; }
.home-project-card .hp-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-project-card .hp-meta { padding: 12px 14px; }
.home-project-card .hp-meta strong { display: block; font-size: 14px; font-weight: 600; color: #1d1d1f; }
.home-project-card .hp-meta small { font-size: 12px; color: var(--portal-muted); }

@media (max-width: 640px) {
  .home-hero-title { font-size: 23px; }
  .home-project-grid { grid-template-columns: 1fr; }
  /* 手机单列时「一行」只有一张会太少，放开高度正常滚动 */
  .home-project-grid-oneline { max-height: none; overflow: visible; }
}

/* ==================== 灵感广场 ==================== */
.home-inspiration .portal-section-head { align-items: flex-start; flex-wrap: wrap; gap: 14px; }
.insp-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-left: auto; }
.insp-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.insp-tab { padding: 7px 14px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .05);
  color: #4a4a4f; font-size: 13px; cursor: pointer; transition: background .15s ease, color .15s ease; }
.insp-tab:hover { background: rgba(0, 0, 0, .09); }
.insp-tab.active { background: #16181d; color: #fff; font-weight: 600; }
.insp-search { display: flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px;
  background: rgba(0, 0, 0, .05); min-width: 210px; }
.insp-search svg { width: 15px; height: 15px; fill: none; stroke: #8a8f99; stroke-width: 2; stroke-linecap: round; flex: none; }
.insp-search input { border: 0; background: transparent; outline: none; font-size: 13px; color: #16181d; width: 100%; }

.insp-masonry { column-count: 5 !important; column-width: auto !important; column-gap: 14px; margin-top: 18px; }
@media (max-width: 1100px) { .insp-masonry { column-count: 4 !important; } }
@media (max-width: 900px) { .insp-masonry { column-count: 3 !important; } }
@media (max-width: 700px) { .insp-masonry { column-count: 2 !important; column-gap: 10px; } }
.insp-card { position: relative; display: block; width: 100%; padding: 0; margin: 0 0 14px; border: 0;
  background: transparent; cursor: pointer; break-inside: avoid; text-align: left; overflow: hidden; border-radius: 14px; }
.insp-card-media { display: block; position: relative; width: 100%; border-radius: 14px; overflow: hidden;
  background: #f1f2f4; transition: transform .18s ease, box-shadow .18s ease; }
.insp-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.insp-card:hover .insp-card-media { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(15, 23, 42, .16); }
.insp-card-foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  padding: 26px 12px 10px; opacity: 0; transition: opacity .18s ease;
  background: linear-gradient(to top, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0));
  pointer-events: none; border-radius: 0 0 14px 14px; }
.insp-card:hover .insp-card-foot { opacity: 1; }
.insp-card-name { font-size: 12px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.insp-card-like { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #fff; flex: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.insp-card-like svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.insp-card-like.is-liked svg { fill: #ff3b57; stroke: #ff3b57; }

.insp-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 6px; }
.insp-more { padding: 9px 26px; border: 1px solid rgba(0, 0, 0, .12); border-radius: 999px;
  background: #fff; color: #16181d; font-size: 13px; cursor: pointer; }
.insp-more:hover { border-color: #16181d; }
.insp-empty { color: #8a8f99; font-size: 13px; }

/* 详情弹层 */
.insp-modal[hidden] { display: none !important; }
.insp-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 32px; }
.insp-modal-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(6px); }
.insp-modal-body { position: relative; display: flex; width: min(1180px, 100%); max-height: 88vh;
  border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 30px 90px rgba(15, 23, 42, .3); }
.insp-modal-figure { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center;
  background: #f6f7f9; padding: 24px; }
.insp-modal-figure img { max-width: 100%; max-height: calc(88vh - 48px); object-fit: contain; border-radius: 10px; }
.insp-modal-side { width: 390px; flex: none; padding: 22px 24px; overflow-y: auto; border-left: 1px solid rgba(0, 0, 0, .07); }
.insp-side-head { display: flex; align-items: center; gap: 10px; }
.insp-author { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.insp-avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #1677ff, #7b5cff); flex: none; }
.insp-author b { font-size: 14px; color: #16181d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insp-like { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 999px; background: #fff; color: #6e6e73; font-size: 13px; cursor: pointer; }
.insp-like svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.insp-like.is-liked { color: #ff3b57; border-color: rgba(255, 59, 87, .35); }
.insp-like.is-liked svg { fill: currentColor; }
.insp-modal-close { width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .05);
  color: #6e6e73; font-size: 18px; line-height: 1; cursor: pointer; flex: none; }
.insp-modal-close:hover { background: rgba(0, 0, 0, .1); }
.insp-meta { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; color: #8a8f99; font-size: 12px; }
.insp-meta i { width: 1px; height: 10px; background: rgba(0, 0, 0, .15); }
.insp-prompt-title { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 22px 0 8px; font-size: 14px; color: #16181d; }
.insp-copy { padding: 3px 10px; border: 1px solid rgba(0, 0, 0, .12); border-radius: 999px;
  background: #fff; color: #6e6e73; font-size: 12px; cursor: pointer; }
.insp-copy:hover { border-color: #1677ff; color: #1677ff; }
.insp-prompt { margin: 0; color: #3a3a3c; font-size: 13px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.insp-params { margin: 12px 0 0; color: #8a8f99; font-size: 12px; }
.insp-actions { display: flex; gap: 10px; margin-top: 22px; }
.insp-action { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 0; border: 1px solid rgba(0, 0, 0, .1); border-radius: 12px; background: #f6f7f9;
  color: #16181d; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s ease; }
.insp-action:hover { background: rgba(22, 119, 255, .08); border-color: rgba(22, 119, 255, .3); color: #1677ff; }
.insp-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.insp-nav { position: absolute; right: 400px; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); box-shadow: 0 6px 18px rgba(15, 23, 42, .18); cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.insp-nav svg { width: 17px; height: 17px; fill: none; stroke: #16181d; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.insp-nav-prev { top: calc(50% - 42px); }
.insp-nav-next { top: calc(50% + 6px); }
.insp-nav:hover { background: #fff; }
@media (max-width: 900px) {
  .insp-modal { padding: 12px; }
  .insp-modal-body { flex-direction: column; max-height: 92vh; }
  .insp-modal-side { width: 100%; border-left: 0; border-top: 1px solid rgba(0, 0, 0, .07); }
  .insp-nav { display: none; }
}

/* ---- 灵感广场标题行吸顶 ---- */
.insp-sticky-head { position: sticky; top: 64px; z-index: 40; padding: 14px 0 12px; margin-bottom: 4px;
  background: rgba(248, 249, 251, .86); backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px); transition: box-shadow .2s ease, border-color .2s ease;
  border-bottom: 1px solid transparent; }
.insp-sticky-head.is-stuck { border-bottom-color: rgba(0, 0, 0, .07); box-shadow: 0 6px 18px rgba(15, 23, 42, .05); }
/* 吸顶区左右出血，避免图片从两侧缝隙穿过 */
.insp-sticky-head::before { content: ''; position: absolute; inset: 0 -24px; z-index: -1;
  background: inherit; backdrop-filter: inherit; -webkit-backdrop-filter: inherit; }

/* ---- 首页大输入框：加宽加大 ---- */
.home-hero .home-composer { width: 100%; max-width: 1180px; margin-left: auto; margin-right: auto;
  padding: 20px 22px 16px; border-radius: 20px; }
.home-hero .home-composer textarea { min-height: 86px; font-size: 15px; line-height: 1.7; }
.home-hero .home-composer-add { width: 62px; height: 62px; font-size: 24px; border-radius: 14px; }
.home-hero .home-composer-controls { gap: 10px; margin-top: 14px; }
.home-hero .home-pill { height: 40px; padding: 0 15px; font-size: 13px; border-radius: 12px; }
.home-hero .home-composer-send { width: 44px; height: 44px; }
.home-hero .home-composer-cost { font-size: 13px; }
.home-hero .home-hero-title { margin-bottom: 22px; }

/* ---- 底部悬浮输入条 ---- */
.home-dock[hidden] { display: none !important; }
.home-dock { position: fixed; z-index: 90; left: calc(50% + var(--global-sidebar-width, 0px) / 2); bottom: 26px;
  transform: translate(-50%, 14px);
  display: flex; align-items: center; gap: 10px; width: min(760px, calc(100vw - 48px));
  padding: 10px 12px 10px 10px; border-radius: 999px; background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(0, 0, 0, .07); box-shadow: 0 18px 46px rgba(15, 23, 42, .16);
  backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  opacity: 0; transition: opacity .22s ease, transform .22s ease; }
.home-dock.is-visible { opacity: 1; transform: translate(-50%, 0); }
.home-dock-add { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .05); color: #6e6e73; font-size: 19px; line-height: 1; cursor: pointer; }
.home-dock-add:hover { background: rgba(0, 0, 0, .09); }
.home-dock input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-size: 14px; color: #16181d; }
.home-dock-send { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%;
  background: #1677ff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.home-dock-send:hover { background: #0e63e0; }
.home-dock-send svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 720px) { .home-dock { bottom: 16px; width: calc(100vw - 24px); } }

/* ---- 吸顶时与顶部导航栏合并成一条 ---- */
@media (min-width: 1101px) {
  .insp-sticky-head.is-merged {
    position: fixed;
    top: 0;
    left: var(--global-sidebar-width, 72px);
    right: 340px;                     /* 让开右侧的点数/会员/通知/头像 */
    z-index: 2960;                    /* 盖在导航栏之上，但只占左半区 */
    height: 64px;
    padding: 0 24px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 0;
    box-shadow: none;
  }
  .insp-sticky-head.is-merged::before { display: none; }
  .insp-sticky-head.is-merged .insp-tab { height: 32px !important; padding: 0 14px !important; font-size: 13px !important; }
  .insp-sticky-head.is-merged .insp-search { height: 34px !important; }
  .insp-sticky-head.is-merged .insp-search-wrap { max-width: 320px; }
  .insp-sticky-head.is-merged .insp-mine { font-size: 13px; }
}
@media (min-width: 1281px) {
  .insp-sticky-head.is-merged { left: var(--global-sidebar-width-xl, 88px); }
}
/* 合并后原位留出占位，避免下方内容突然上跳 */
.insp-head-holder { display: none; }
.insp-head-holder.is-on { display: block; height: 72px; }

/* ---- 底部悬浮条：胶囊态 ⇄ 展开态 ---- */
.home-dock.is-open { width: min(1100px, calc(100vw - 120px)); padding: 0; border-radius: 20px;
  background: rgba(255, 255, 255, .96); }
.home-dock-pill { display: flex; align-items: center; gap: 10px; width: 100%; }
.home-dock.is-open .home-dock-pill { display: none; }
.home-dock-full { width: 100%; padding: 18px 20px 14px; }
.home-dock-full[hidden] { display: none !important; }
.home-dock-full .home-composer-main { display: flex; gap: 14px; align-items: flex-start; }
.home-dock-full textarea { flex: 1; min-height: 76px; border: 0; outline: none; background: transparent;
  resize: none; font: inherit; font-size: 15px; line-height: 1.7; color: #16181d; }
.home-dock-full .home-composer-add { width: 58px; height: 58px; flex: none; border: 1px dashed rgba(0, 0, 0, .16);
  border-radius: 14px; background: #fafbfc; color: #b0b6c0; font-size: 22px; cursor: pointer; }
.home-dock-full .home-composer-controls { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.home-dock-full .home-composer-spacer { flex: 1; }
.home-dock-full .home-composer-cost { color: #8a8f99; font-size: 13px; }
.home-dock-full .home-composer-send { width: 42px; height: 42px; border: 0; border-radius: 50%; background: #1677ff;
  cursor: pointer; display: flex; align-items: center; justify-content: center; }
.home-dock-full .home-composer-send svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round; }
.home-dock-full .home-composer-send:hover { background: #0e63e0; }

/* ==================== 首页排版统一（字号/字重对齐） ==================== */
.portal-section > .section-header .section-title,
.home-projects .section-title { font-size: 16px !important; font-weight: 600 !important; letter-spacing: 0; color: #1d1d1f; }
.home-projects .section-header { margin-bottom: 16px; }

/* ---- 最近项目：去卡片边框，文字移到缩略图下方 ---- */
.home-project-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important; gap: 22px !important; }
.home-project-grid-oneline { max-height: 232px !important; }
.home-project-new,
.home-project-card {
  height: auto !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  display: block !important;
  text-align: left;
  padding: 0;
}
.home-project-new:hover,
.home-project-card:hover { transform: none !important; box-shadow: none !important; }
.home-project-card .hp-thumbs,
.home-project-new .np-box {
  height: 176px; border-radius: 14px; overflow: hidden; background: #eef0f3;
  transition: box-shadow .2s ease, transform .2s ease;
}
.home-project-card:hover .hp-thumbs,
.home-project-new:hover .np-box { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 23, 42, .1); }
.home-project-new .np-box { display: flex; align-items: center; justify-content: center;
  background: #f1f2f5; border: 1px solid rgba(0, 0, 0, .05); }
.home-project-new .np-plus { font-size: 26px; font-style: normal; color: #9aa1ad; line-height: 1; }
.home-project-card .hp-meta,
.home-project-new .hp-meta { display: block; padding: 10px 2px 0 !important; }
.home-project-card .hp-meta strong,
.home-project-new .hp-meta strong { display: block; font-size: 14px !important; font-weight: 500 !important;
  color: #1d1d1f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-project-card .hp-meta small { display: block; margin-top: 3px; font-size: 12px !important;
  font-weight: 400 !important; color: #9aa1ad; }

/* ---- 灵感标题栏：分类胶囊 + 搜索框 + 我的发布（对齐参考图） ---- */
.insp-head { display: flex; align-items: center; gap: 16px; }
.insp-head .insp-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.insp-head .insp-tab { height: 38px; padding: 0 18px; display: inline-flex; align-items: center;
  border: 0; border-radius: 10px; background: transparent; color: #4a4a4f;
  font-size: 14px !important; font-weight: 500 !important; cursor: pointer; white-space: nowrap; }
.insp-head .insp-tab:hover { background: rgba(0, 0, 0, .045); }
.insp-head .insp-tab.active { background: rgba(0, 0, 0, .06); color: #16181d; font-weight: 600 !important; }
.insp-search-wrap { position: relative; flex: 1; max-width: 420px; }
.insp-head .insp-search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 8px 0 14px;
  border-radius: 12px; background: rgba(0, 0, 0, .045); min-width: 0; }
.insp-head .insp-search svg { width: 16px; height: 16px; flex: none; fill: none; stroke: #8a8f99; stroke-width: 2; stroke-linecap: round; }
.insp-head .insp-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font-size: 14px; font-weight: 400; color: #16181d; }
.insp-search-go { height: 30px; padding: 0 14px; border: 0; border-radius: 8px; background: #16181d;
  color: #fff; font-size: 13px; font-weight: 500; cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity .15s ease; flex: none; }
.insp-search-wrap.is-active .insp-search-go { opacity: 1; pointer-events: auto; }
.insp-mine { margin-left: auto; color: #4a4a4f; font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.insp-mine:hover { color: #1677ff; }

/* 搜索历史面板 */
.insp-history[hidden] { display: none !important; }
.insp-history { position: absolute; z-index: 60; left: 0; right: -60px; top: calc(100% + 10px);
  padding: 16px 18px 18px; border-radius: 16px; background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .16); border: 1px solid rgba(0, 0, 0, .05); }
.insp-history-head { display: flex; align-items: center; justify-content: space-between; }
.insp-history-head b { font-size: 14px; font-weight: 600; color: #16181d; }
.insp-history-head button { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px;
  border: 0; border-radius: 8px; background: rgba(0, 0, 0, .05); color: #4a4a4f; font-size: 13px; cursor: pointer; }
.insp-history-head button:hover { background: rgba(0, 0, 0, .09); }
.insp-history-head svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.insp-history-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.insp-history-chips button { height: 34px; padding: 0 16px; border: 0; border-radius: 10px;
  background: rgba(0, 0, 0, .045); color: #3a3a3c; font-size: 13px; cursor: pointer; }
.insp-history-chips button:hover { background: rgba(22, 119, 255, .1); color: #1677ff; }
.insp-history-empty { margin: 14px 0 0; color: #9aa1ad; font-size: 13px; }

/* 标题栏与瀑布流间距收紧（对齐参考图） */
.home-inspiration .insp-masonry { margin-top: 12px !important; }
.insp-sticky-head { padding: 10px 0 10px !important; }

/* ==================== 首页细节修正 ==================== */
/* 1) 新建项目：灰块撑满、＋ 居中，标签在块外下方（与项目卡一致） */
.home-project-new { display: block !important; place-items: initial !important; gap: 0 !important; }
.home-project-new .np-box { width: 100% !important; height: 176px !important; display: flex !important;
  align-items: center; justify-content: center; }

/* 2) 字重整体变细（不加粗） */
.portal-section > .section-header .section-title,
.home-projects .section-title { font-weight: 500 !important; }
.home-project-card .hp-meta strong,
.home-project-new .hp-meta strong { font-weight: 400 !important; }
.insp-head .insp-tab { font-weight: 400 !important; }
.insp-head .insp-tab.active { font-weight: 500 !important; }
.insp-mine { font-weight: 400; }

/* 3) 灵感标题栏：去掉底部色块与分割线，完全透明 */
.insp-sticky-head { background: transparent !important; backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important; border-bottom: 0 !important; box-shadow: none !important; }
.insp-sticky-head::before { display: none !important; }
.insp-sticky-head.is-stuck { border-bottom: 0 !important; box-shadow: none !important; }

/* 4) 灵感弹窗盖住顶部状态栏（导航栏 z-index 2950） */
.insp-modal { z-index: 3000 !important; }

/* ---- 合并吸顶态微调：保持内容区左间距、「我的发布」不参与合并 ---- */
@media (min-width: 1101px) {
  .insp-sticky-head.is-merged {
    /* 与内容区（95% 居中）左边缘对齐，不贴到最左侧 */
    left: calc(var(--global-sidebar-width, 72px) + 2.5%) !important;
    padding: 0 !important;
  }
  .insp-sticky-head.is-merged .insp-mine { display: none !important; }
}
@media (min-width: 1281px) {
  .insp-sticky-head.is-merged { left: calc(var(--global-sidebar-width-xl, 88px) + 2.5%) !important; }
}


/* ---------------- 首页输入框参考图（上传 / 粘贴 / 拖拽） ---------------- */

.home-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px 0;
}

.home-attachments[hidden] { display: none !important; }

.home-attachment {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 12px;
  overflow: hidden;
  background: #f1f3f6;
  border: 1px solid rgba(15, 23, 42, 0.08);
  flex: 0 0 auto;
}

.home-attachment img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-attachment-remove {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.home-attachment-remove:hover { background: rgba(15, 23, 42, 0.85); }

.home-hero .home-composer.is-drop-target {
  outline: 2px dashed rgba(59, 130, 246, 0.7);
  outline-offset: 3px;
  background: rgba(59, 130, 246, 0.04);
}

.home-hero-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(10px);
  z-index: 400;
  max-width: 76vw;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.home-hero-toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------------- 资产库：存储空间用量条 ---------------- */

.storage-bar {
  margin-bottom: 18px;
  padding: 16px 20px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 14px;
  background: #fff;
}

.storage-bar[hidden] { display: none !important; }

.storage-bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  color: #667085;
}

.storage-bar-head b { color: #1d1d1f; font-size: 14px; }

.storage-bar-track {
  height: 8px;
  border-radius: 999px;
  background: #eef1f5;
  overflow: hidden;
}

.storage-bar-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #0071e3;
  transition: width .3s ease;
}

.storage-bar-track i.is-warn { background: #f0a020; }
.storage-bar-track i.is-danger { background: #e5484d; }

.storage-bar-tip {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
}

.storage-bar-tip.is-warn { color: #b06a00; }
.storage-bar-tip.is-danger { color: #d64956; }
