/* ============================================================
   项目详情页通用样式（在 styles.css 之后加载）
   站点骨架沿用首页，只把强调色换成每个项目自己的品牌色
   ============================================================ */

body.detail-page { --btn-text: #ffffff; }

/* 每个项目一套品牌色：写在 body 上，通过 CSS 变量继承给整页 */
body.theme-blue {
  --accent: #2b6cf5;
  --accent-ink: #1a4fb8;
  --accent-soft: rgba(43, 108, 245, .10);
  --accent-line: rgba(43, 108, 245, .30);
  --ink-tint: rgba(43, 108, 245, .10);
}
body.theme-green {
  --accent: #0e9469;
  --accent-ink: #0a6d4d;
  --accent-soft: rgba(14, 148, 105, .11);
  --accent-line: rgba(14, 148, 105, .32);
  --ink-tint: rgba(14, 148, 105, .10);
}

/* 覆盖首页写死的琥珀色组件 */
.detail-page .btn-primary {
  background: var(--accent);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--accent) 30%, transparent);
}
.detail-page .btn-primary:hover { background: var(--accent); filter: brightness(.92); }
.detail-page .btn-ghost { border-color: rgba(30, 24, 12, .17); }
.detail-page .kicker { color: var(--accent-ink); }
.detail-page ::selection { background: var(--accent-soft); }
.detail-page :focus-visible { outline-color: var(--accent-ink); }

/* 顶部导航：左侧返回 + 右侧动作 */
.back-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--muted); font-size: 14px; padding: 6px 10px;
  border-radius: 8px; transition: color .15s, background .15s;
}
.back-link:hover { color: var(--text); background: rgba(30,24,12,.04); }
.back-link svg { width: 15px; height: 15px; }
.detail-actions { display: flex; align-items: center; gap: 8px; }
.detail-actions .btn-sm { padding: 8px 15px; font-size: 13px; }

/* ============ Hero ============ */
.detail-hero {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 76px 0 90px;
}
.detail-hero::before {
  content: ""; position: absolute; inset: -10% -10% 0; z-index: -3;
  background:
    radial-gradient(620px 420px at 12% 6%,  color-mix(in srgb, var(--accent) 15%, transparent), transparent 66%),
    radial-gradient(560px 420px at 88% 12%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 68%),
    radial-gradient(620px 380px at 60% 96%, rgba(255, 205, 120, .12), transparent 68%);
  filter: blur(12px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 48%, transparent 96%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 48%, transparent 96%);
}

/* 参考页那种斜向淡色条纹 */
.detail-stripes { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.detail-stripes i {
  position: absolute; display: block; height: 11px; border-radius: 999px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--accent) 4%, transparent),
    color-mix(in srgb, var(--accent) 26%, transparent) 42%,
    color-mix(in srgb, var(--accent) 6%, transparent));
  filter: blur(.4px);
  transform: rotate(-1.5deg);
}
.detail-stripes i:nth-child(1) { top: 13%; left: -8%;  width: 44%; }
.detail-stripes i:nth-child(2) { top: 13%; left: 62%;  width: 52%; opacity: .75; }
.detail-stripes i:nth-child(3) { top: 27%; left: 8%;   width: 86%; opacity: .55; }
.detail-stripes i:nth-child(4) { top: 47%; left: -4%;  width: 62%; opacity: .8; }
.detail-stripes i:nth-child(5) { top: 68%; left: 26%;  width: 82%; opacity: .5; }
.detail-stripes i:nth-child(6) { top: 84%; left: -10%; width: 48%; opacity: .65; }

.detail-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.02fr .98fr;
  gap: 56px; align-items: center;
}
.detail-copy { min-width: 0; }

.detail-app { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.detail-app img {
  width: 68px; height: 68px; border-radius: 18px; flex: none;
  box-shadow: 0 14px 40px color-mix(in srgb, var(--accent) 28%, transparent);
}
.detail-app-name { font-size: 15.5px; font-weight: 800; letter-spacing: .01em; }
.detail-app-cat { font-size: 13px; color: var(--muted); }

.detail-page .hero-title {
  font-size: clamp(34px, 4.2vw, 50px);
  line-height: 1.2; letter-spacing: -.025em; font-weight: 800;
  margin: 0 0 20px;
}
/* 桌面端两行标题只在 <br> 处断行，避免第二行被挤成第三行 */
@media (min-width: 921px) {
  .detail-page .hero-title { white-space: nowrap; }
  /* 英文字符更宽，单独收一档字号 */
  html[data-lang="en"] .detail-page .hero-title { font-size: clamp(30px, 3.6vw, 44px); }
}
/* 第二行用项目品牌色，覆盖首页的金色渐变 */
.detail-page .hero-title em {
  font-style: normal; color: var(--accent);
  background: none; -webkit-text-fill-color: var(--accent);
}
.detail-page .hero-sub {
  font-size: 16.5px; color: var(--muted);
  max-width: 40em; margin: 0 0 28px;
}
.detail-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.detail-page .facts { justify-content: flex-start; margin-top: 26px; }

/* ============ 深色产品示意面板 ============ */
.demo-wrap { position: relative; min-height: 420px; display: flex; align-items: center; justify-content: center; }
.demo-panel {
  width: 100%; max-width: 470px;
  background: rgba(17, 22, 38, .96);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 18px; padding: 17px 20px 19px;
  box-shadow: 0 32px 80px rgba(24, 28, 48, .34);
  color: #e9ebf4;
  animation: demoIn .9s cubic-bezier(.2,.7,.2,1) backwards;
  animation-delay: .18s;
}
@keyframes demoIn { from { opacity: 0; transform: translateY(18px) rotate(-1deg); } }
.demo-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.demo-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.14); }
.demo-bar i:first-child { background: var(--accent); }
.demo-bar span {
  margin-left: 8px; font-size: 10.5px; letter-spacing: .09em;
  color: rgba(255,255,255,.42); text-transform: uppercase;
}
.demo-note {
  margin-top: 13px; padding-top: 11px;
  border-top: 1px dashed rgba(255,255,255,.10);
  font-size: 10.5px; color: rgba(255,255,255,.34); text-align: left;
}

.demo-user {
  width: max-content; max-width: 88%; margin-left: auto;
  background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 600; line-height: 1.45;
  padding: 9px 14px; border-radius: 14px 14px 4px 14px;
  margin-bottom: 14px;
}
.demo-line {
  display: flex; align-items: center; gap: 9px;
  font: 500 11.5px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: rgba(255,255,255,.62); padding: 7px 0;
  border-top: 1px dashed rgba(255,255,255,.09);
}
.demo-line b { margin-left: auto; color: #5fe0a8; font-size: 12px; }
.demo-chip {
  flex: none; font-size: 10px; font-weight: 800; letter-spacing: .05em;
  padding: 2px 8px; border-radius: 999px;
  color: color-mix(in srgb, var(--accent) 72%, #fff 28%);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
}
.demo-card {
  margin-top: 10px; padding: 12px 13px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
}
.demo-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.demo-card-head small { font-size: 10.5px; color: rgba(255,255,255,.38); }
.demo-hit {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 0; border-top: 1px dashed rgba(255,255,255,.07);
  font-size: 11.5px; color: rgba(255,255,255,.86);
}
.demo-hit em {
  flex: none; font-style: normal; font-size: 10px; font-weight: 700;
  color: color-mix(in srgb, var(--accent) 72%, #fff 28%);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 5px; padding: 2px 6px;
}
.demo-hit span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-hit small { margin-left: auto; flex: none; font-size: 10px; color: rgba(255,255,255,.4); }
.demo-chart { display: flex; align-items: flex-end; gap: 7px; height: 62px; padding-top: 4px; }
.demo-chart i {
  flex: 1; height: var(--h); border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 35%, transparent));
  opacity: .85;
}

.demo-nodes { display: grid; gap: 7px; margin-bottom: 12px; }
.demo-node {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; border-radius: 9px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.07);
  font-size: 11.5px;
}
.demo-node b { font-weight: 700; color: #eef0f7; }
.demo-node code { font: 500 11px ui-monospace, Menlo, monospace; color: rgba(255,255,255,.5); }
.demo-node small { margin-left: auto; font-size: 10px; color: rgba(255,255,255,.38); }
.demo-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: #3ddc97; box-shadow: 0 0 12px 2px rgba(61,220,151,.55);
}
.demo-flow {
  padding: 11px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  font: 500 11px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: rgba(255,255,255,.74);
}
.demo-flow b { color: #fff; font-weight: 700; }
.demo-flow .ok { color: #6ee7b7; }
.demo-arrow { color: color-mix(in srgb, var(--accent) 70%, #fff 30%); padding: 2px 0 2px 10px; }
.demo-ports { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 11px; }
.demo-ports span {
  font: 500 10.5px ui-monospace, Menlo, monospace;
  color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px; padding: 4px 8px;
}
.demo-ports b { color: color-mix(in srgb, var(--accent) 70%, #fff 30%); }

.demo-float {
  position: absolute; right: -6px; bottom: 22px;
  display: inline-flex; align-items: center; gap: 7px;
  background: color-mix(in srgb, var(--accent) 16%, rgba(19, 23, 42, .96));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: rgba(255,255,255,.92);
  font-size: 12px; font-weight: 600;
  padding: 9px 14px; border-radius: 999px;
  box-shadow: 0 14px 34px rgba(20, 24, 40, .3);
  animation: floatUp 5.2s ease-in-out infinite;
}
.demo-float svg { width: 13px; height: 13px; flex: none; }
@keyframes floatUp { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* ============ 通用分区 ============ */
.detail-section { padding: 82px 0; }
.detail-section.alt {
  background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,0));
  border-top: 1px solid rgba(30,24,12,.06);
  border-bottom: 1px solid rgba(30,24,12,.06);
}
.detail-head { text-align: center; max-width: 720px; margin: 0 auto 50px; }
.detail-head .kicker { margin-bottom: 14px; }
.detail-head .section-title {
  font-size: clamp(26px, 3.4vw, 38px); font-weight: 800;
  letter-spacing: -.015em; line-height: 1.28; margin-bottom: 14px;
}
.detail-head .section-title em { font-style: normal; color: var(--accent); }
.detail-head .section-sub { color: var(--muted); font-size: 16px; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.info-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 16px; padding: 26px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.info-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 36%, transparent);
  box-shadow: 0 18px 44px color-mix(in srgb, var(--accent) 9%, transparent);
}
.info-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.info-card p { color: var(--muted); font-size: 14.5px; }
.info-card code {
  font: 600 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent-ink); background: var(--accent-soft);
  border-radius: 5px; padding: 2px 5px;
}
.feature-icon {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center; margin-bottom: 16px;
}
.feature-icon svg { width: 21px; height: 21px; }
.step-num {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 800; font-size: 14px;
  display: grid; place-items: center; margin-bottom: 15px;
}
.code-line {
  display: block; margin-top: 12px;
  font: 600 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #3c352a; background: rgba(30,24,12,.045);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 11px; overflow-x: auto; white-space: nowrap;
}
.code-line .cm { color: var(--faint); font-weight: 400; }

.detail-transition {
  text-align: center; margin: 46px auto 0; max-width: 780px;
  font-size: clamp(19px, 2.4vw, 24px); font-weight: 700; line-height: 1.55;
}
.detail-transition em { font-style: normal; color: var(--accent); }

.faq-list { max-width: 800px; margin: 0 auto; display: grid; gap: 14px; }
.faq-item {
  background: #fff; border: 1px solid var(--border);
  border-radius: 16px; padding: 20px 26px;
}
.faq-item h3 { font-size: 16.5px; font-weight: 700; margin-bottom: 7px; }
.faq-item h3::before {
  content: "Q"; display: inline-grid; place-items: center;
  width: 21px; height: 21px; margin-right: 9px; vertical-align: 1px;
  border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink);
  font-size: 11px; font-weight: 800;
}
.faq-item p { color: var(--muted); font-size: 14.5px; }

.detail-cta {
  position: relative; overflow: hidden;
  border: 1px solid var(--accent-line); border-radius: 22px;
  padding: 58px 32px; text-align: center;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 13%, transparent),
      color-mix(in srgb, var(--accent) 3%, transparent) 55%),
    #fff;
}
.detail-cta h2 {
  font-size: clamp(24px, 3.2vw, 34px); font-weight: 800;
  letter-spacing: -.015em; margin-bottom: 12px;
}
.detail-cta p { color: var(--muted); margin-bottom: 26px; }
.detail-cta .detail-ctas { justify-content: center; }

/* ============ 响应式 ============ */
@media (max-width: 920px) {
  .detail-hero { padding: 58px 0 66px; }
  .detail-inner { grid-template-columns: 1fr; gap: 46px; }
  .demo-wrap { min-height: auto; }
  .demo-panel { max-width: 520px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-section { padding: 64px 0; }
  .demo-float { right: 0; bottom: -14px; }
}
@media (max-width: 560px) {
  .detail-page .hide-sm { display: none; }
  .detail-actions { gap: 6px; }
  .detail-actions .btn-sm { padding: 7px 11px; font-size: 12px; }
  .detail-actions .lang-switch button { padding: 4px 8px; font-size: 11.5px; }
  .detail-hero { padding: 44px 0 52px; }
  .detail-app img { width: 58px; height: 58px; border-radius: 15px; }
  .detail-page .hero-title { font-size: clamp(31px, 8.6vw, 40px); }
  .detail-page .hero-sub { font-size: 15.5px; }
  .detail-section { padding: 56px 0; }
  .detail-head { margin-bottom: 34px; }
  .card-grid { grid-template-columns: 1fr; }
  .info-card, .faq-item { padding: 22px; }
  .demo-panel { padding: 14px 15px 16px; }
  .demo-float { display: none; }
  .detail-cta { padding: 42px 20px; }
  .detail-ctas .btn { width: 100%; }
  .detail-stripes i { height: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .demo-panel, .demo-float { animation: none !important; }
}
