/* 模板中心 — 对齐 solutions 营销站风格，主色沿用首页 #3351FF */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #3351FF;
  --primary-dark: #2563EB;
  --dark: #0F172A;
  --gray-700: #334155;
  --gray-500: #64748B;
  --gray-300: #CBD5E1;
  --gray-100: #F1F5F9;
  --white: #FFFFFF;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  color: #333;
  background: #f5f7fa;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo img {
  height: 40px;
  margin-right: 8px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-links a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

/* Hero */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, #36cfc9 100%);
  color: white;
  padding: 72px 0 64px;
  text-align: center;
}

.hero-section h1 {
  font-size: 42px;
  margin-bottom: 16px;
  line-height: 1.3;
  font-weight: 700;
}

.hero-section p {
  font-size: 18px;
  opacity: 0.95;
  max-width: 720px;
  margin: 0 auto 28px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(51, 81, 255, 0.35);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.28);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn-ghost {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-ghost:hover {
  background: rgba(51, 81, 255, 0.06);
}

/* Filters — 精简：有数据的分类 + 搜索 + 按需场景 */
.filters-section {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #eef2f7;
  padding: 18px 0 14px;
  position: sticky;
  top: 70px;
  z-index: 90;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.filter-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.cat-tab {
  appearance: none;
  border: none;
  background: #f1f5f9;
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  line-height: 1.2;
}

.cat-tab em {
  font-style: normal;
  font-weight: 700;
  margin-left: 4px;
  color: #94a3b8;
  font-size: 12px;
}

.cat-tab:hover {
  background: #e2e8f0;
  color: var(--dark);
}

.cat-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(51, 81, 255, 0.28);
}

.cat-tab.active em {
  color: rgba(255, 255, 255, 0.8);
}

.filter-search-wrap {
  flex-shrink: 0;
}

.filter-search {
  width: 220px;
  height: 40px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--dark);
  background: #fff;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.filter-search::placeholder {
  color: #94a3b8;
}

.filter-search:focus {
  border-color: rgba(51, 81, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(51, 81, 255, 0.12);
}

.filter-scenes {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e8edf3;
}

.filter-scenes.has-items {
  display: flex;
}

.scene-label {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  margin-right: 4px;
}

.scene-chip {
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: var(--gray-700);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.scene-chip:hover {
  border-color: rgba(51, 81, 255, 0.4);
  color: var(--primary);
}

.scene-chip.active {
  background: rgba(51, 81, 255, 0.08);
  border-color: rgba(51, 81, 255, 0.35);
  color: var(--primary);
}

/* Grid */
.templates-section {
  padding: 40px 0 72px;
}

.section-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.section-meta[hidden] {
  display: none;
}

.section-meta h2 {
  font-size: 22px;
  color: var(--dark);
}

.result-count {
  font-size: 14px;
  color: var(--gray-500);
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.template-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid #eee;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(51, 81, 255, 0.12);
  border-color: rgba(51, 81, 255, 0.25);
}

.card-cover-wrap {
  position: relative;
}

.card-cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, #e0e7ff, #cffafe);
  display: block;
}

.discover-feed {
  display: block;
}

.discover-section {
  margin-bottom: 48px;
}

.discover-section:last-child {
  margin-bottom: 0;
}

.discover-head {
  margin-bottom: 20px;
}

.discover-title {
  font-size: 22px;
  font-weight: 750;
  color: var(--dark);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.discover-desc {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.6;
  max-width: 640px;
}

.preview-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
}

.preview-tip {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  padding: 8px 10px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
  white-space: normal;
  min-width: 160px;
}

.preview-wrap:hover .preview-tip,
.preview-wrap:focus-within .preview-tip {
  display: block;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.card-body {
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(51, 81, 255, 0.08);
  color: var(--primary);
  font-weight: 500;
}

.tag.scene {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
  line-height: 1.4;
}

.card-intro {
  font-size: 14px;
  color: var(--gray-500);
  flex: 1;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-suit {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--gray-500);
  background: #fff;
  border-radius: var(--radius);
  border: 1px dashed var(--gray-300);
}

/* Detail page — 顶栏固定，左侧滚动，右侧白底铺满到底 */
body.detail-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: #f8fafc;
}

body.detail-page > header {
  position: relative;
  flex-shrink: 0;
  top: auto;
}

body.detail-page > footer {
  display: none;
}

.detail-back-bar {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid #eef2f7;
  padding: 14px 0;
  z-index: 50;
}

.detail-back-inner {
  display: flex;
  align-items: center;
  max-width: none;
  padding-left: 32px;
  padding-right: 32px;
}

.detail-back {
  color: var(--gray-500);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.detail-back:hover {
  color: var(--primary);
}

.detail-root {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #f1f5f9;
}

.detail-loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--gray-500);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  height: 100%;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.detail-main {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 32px 56px;
  background: #f8fafc;
  border-right: 1px solid #e8edf3;
  -webkit-overflow-scrolling: touch;
}

.detail-shots {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.detail-shots img {
  width: 100%;
  height: auto;
  min-height: 220px;
  display: block;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #e0e7ff, #cffafe);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.detail-shots img.shot-clickable {
  cursor: zoom-in;
  transition: transform 0.2s, box-shadow 0.2s;
}

.detail-shots img.shot-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(51, 81, 255, 0.14);
}

.aside-cover-wrap {
  position: relative;
  margin-bottom: 18px;
}

.aside-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  background: linear-gradient(135deg, #e0e7ff, #cffafe);
  margin-bottom: 0;
  border: 1px solid #eef2f7;
  flex-shrink: 0;
  display: block;
}

.preview-aside-hint {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
  text-align: center;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.86);
  padding: 24px;
}

.lightbox.open {
  display: flex;
}

.lightbox-img {
  max-width: min(1100px, 92vw);
  max-height: 86vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  background: #0b1220;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

.lightbox-counter {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 600;
}

body.lightbox-open {
  overflow: hidden;
}

.detail-block {
  max-width: 920px;
  margin: 0 auto 28px;
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 14px;
  padding: 24px 28px 28px;
}

.block-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.block-sub {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  margin-left: 8px;
}

.block-lead {
  font-size: 15px;
  color: var(--gray-700);
  line-height: 1.75;
  margin-bottom: 16px;
}

.block-hint {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.muted {
  color: var(--gray-500);
  font-size: 14px;
}

.split-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.info-card {
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px 16px;
}

.info-card h3 {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 10px;
  font-weight: 600;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: #eef2ff;
  color: var(--primary);
}

.chip-solve {
  background: #ecfdf5;
  color: #047857;
}

.demo-card {
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border: 1px dashed #dbe3ef;
  border-radius: 12px;
  padding: 18px 20px;
}

.demo-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 600;
  margin-bottom: 4px;
}

.demo-company {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
}

.demo-project {
  font-size: 15px;
  color: var(--gray-700);
}

.stage-wrap {
  margin-top: 4px;
}

.stage-caption {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 18px;
}

/* 横向阶段轨迹 */
.stage-track {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 0;
  padding: 8px 4px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stage-step {
  position: relative;
  flex: 1 1 0;
  min-width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 6px;
}

.stage-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  left: calc(50% + 18px);
  right: calc(-50% + 18px);
  height: 2px;
  background: linear-gradient(90deg, rgba(51, 81, 255, 0.45), rgba(51, 81, 255, 0.15));
  border-radius: 2px;
  pointer-events: none;
}

.stage-node {
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
}

.stage-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #3351FF 0%, #2563EB 100%);
  box-shadow: 0 4px 12px rgba(51, 81, 255, 0.28);
  border: 3px solid #eef2ff;
}

.stage-step:first-child .stage-dot {
  box-shadow: 0 4px 14px rgba(51, 81, 255, 0.36);
}

.stage-step:last-child .stage-dot {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
  border-color: #ecfdf5;
}

.stage-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  line-height: 1.4;
  max-width: 96px;
}

@media (max-width: 960px) {
  .stage-track {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
  }

  .stage-step {
    flex: none;
    min-width: 0;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 14px;
    padding: 0 0 0 2px;
    min-height: 52px;
  }

  .stage-step:not(:last-child)::after {
    top: 40px;
    left: 16px;
    right: auto;
    width: 2px;
    height: calc(100% - 28px);
    background: linear-gradient(180deg, rgba(51, 81, 255, 0.4), rgba(51, 81, 255, 0.12));
  }

  .stage-node {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .stage-label {
    max-width: none;
    font-size: 14px;
  }
}

.status-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--gray-700);
  font-size: 13px;
  font-weight: 600;
}

.status-sep {
  color: #94a3b8;
  font-size: 14px;
}

.fields-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 14px;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fields-table th,
.fields-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
}

.fields-table th {
  background: #f8fafc;
  color: var(--gray-500);
  font-weight: 600;
  font-size: 13px;
}

.fields-table td {
  color: var(--gray-700);
}

.doc-list {
  list-style: none;
}

.doc-list li {
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}

.doc-list li:last-child {
  border-bottom: none;
}

.doc-list li strong {
  color: var(--dark);
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.doc-list li span {
  font-size: 14px;
  color: var(--gray-500);
}

.detail-aside {
  height: 100%;
  background: #fff;
  border-left: 1px solid #e8edf3;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 32px 28px 40px;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

.detail-aside-sticky {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100%;
}

.aside-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.detail-title {
  font-size: 24px;
  font-weight: 750;
  color: var(--dark);
  margin-bottom: 12px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.aside-intro {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.7;
}

.detail-cta {
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-cta .btn {
  width: 100%;
}

/* Footer */
footer {
  background: #1a1a2e;
  color: #aaa;
  padding: 48px 0 24px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 32px;
}

.footer-column h3 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 14px;
}

.footer-column ul {
  list-style: none;
}

.footer-column a {
  color: #aaa;
  text-decoration: none;
  font-size: 13px;
  line-height: 2;
}

.footer-column a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 18px;
  text-align: center;
  font-size: 12px;
}

@media (max-width: 960px) {
  .templates-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }

  body.detail-page {
    height: auto;
    overflow: auto;
  }

  body.detail-page > footer {
    display: block;
  }

  .detail-root {
    overflow: visible;
    flex: none;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .detail-aside {
    order: -1;
    height: auto;
    border-left: none;
    border-bottom: 1px solid #e8edf3;
  }

  .detail-aside-sticky {
    min-height: 0;
  }

  .detail-cta {
    margin-top: 24px;
  }

  .detail-main {
    height: auto;
    overflow: visible;
    border-right: none;
    padding: 20px 16px 48px;
  }

  .split-cards {
    grid-template-columns: 1fr;
  }

  .detail-back-inner {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero-section {
    padding: 48px 0 40px;
  }

  .hero-section h1 {
    font-size: 28px;
  }

  .hero-section p {
    font-size: 15px;
  }

  .filters-section {
    top: 0;
    position: relative;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-search {
    width: 100%;
  }

  .templates-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
