feat: port cms home layout into trade-pro (hero/features/cards/cta + reveal JS)

Task 10a (Phase 3 first layout task). home.html now mirrors the cms
astro-site-runtime homepage section sequence: full-bleed hero (single
active slide; the platform has no multi-slide config, so the carousel
dots/JS are not ported), trustbar, two-col about with floating stats,
soft products band (4-card grid), dark applications band (2x2 case
tiles), advantages feature grid, soft news band (3-card grid), and the
closing cta band. Data maps to SiteForge context (page.cover/summary,
showcase, cases, stories, category/brand counts); empty sections hide
instead of rendering shells. All new component classes are sf-tp-*
prefixed and compose on the Task 8 base utilities in theme.css
(.wrap/.section/.eyebrow/.icon-circle/.sf-tp-btn).

CSS: the five cms components' scoped styles (PageHero, FeatureGrid,
CardGrid, Cta, SectionHead + the inline homepage bands) are extracted
into pro.css as the sf-tp-* component layer, tokens rewritten to
--sf-tp-*, breakpoints 900/767/620 preserved. theme.css accordingly
drops the superseded generic .cards/.card/.feature mobile baselines
and the .pro-home-hero em bridge, and retargets the dark-surface ghost
button hook from .cta-band to .sf-tp-cta.

Reveal: cms uses data-reveal everywhere; a ~15-line inline script at
the pro.html tail adds html.js + an IntersectionObserver that toggles
is-visible (the reduced-motion/no-JS exemptions already live in
theme.css from Task 8).

Tests: test_theme_registry gains test_trade_pro_home_layout_structure
(preview-render contract: sf-tp-hero, card grid, feature grid, cta,
no pro-industrial-hero residue, reveal script). The distinct-markup
tripwire in test_theme_pro_v3 is legitimately updated 4 -> 5 (renamed
to drop the stale "four"): with trade-pro now carrying its own
sf-tp-hero class, five themes yield five distinct hero signatures,
which is what the test always meant to enforce.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-10-23 09:23:30 +08:00
parent 1dd510285a
commit c318829ff3
6 changed files with 397 additions and 84 deletions
+11 -2
View File
@@ -8,7 +8,7 @@ from bs4 import BeautifulSoup
from test_factory_v2 import factory, site, zip_theme
from app.core import THEMES
def test_four_complete_theme_families_have_distinct_markup(factory):
def test_complete_theme_families_have_distinct_markup(factory):
main=[]
for theme in THEMES:
for page_type in ('home','about','contact','listing','product','article','brand','standard','notfound'):
@@ -23,7 +23,16 @@ def test_four_complete_theme_families_have_distinct_markup(factory):
if page_type=='listing':assert soup.select_one('[data-pro-filter-search]')
if page_type=='article':assert soup.select_one('.pro-article-hero')
main.append(factory.get(f'/api/factory/themes/{theme}/preview?page_type=home').text)
assert len(set(re.findall(r'class="pro-home-hero [^"]+"',s)[0] for s in main))==4
# Every theme must carry its own hero markup signature. The legacy families
# share the pro-home-hero base class with a per-theme variant; trade-pro
# ports the cms design with its own sf-tp-hero class. Five themes, five
# distinct hero class strings ("4" was the pre-trade-pro coincidence).
def hero_classes(html):
soup=BeautifulSoup(html,'html.parser')
el=soup.find('section',class_=re.compile(r'^(pro-home-hero|sf-tp-hero)$'))
assert el is not None,'home hero section not found'
return ' '.join(el.get('class',[]))
assert len(set(hero_classes(s) for s in main))==5
def test_theme_build_derived_category_brand_search_and_seo(factory):
+25
View File
@@ -1,6 +1,7 @@
"""Theme discovery must be a single source of truth."""
import json
from pathlib import Path
from bs4 import BeautifulSoup
from app import core, theme_pro, theme_store
from test_factory_v2 import factory, site # noqa: F401 -- fixture + helper reused by trade-pro tests
@@ -153,6 +154,30 @@ def test_trade_pro_build_contains_tokens(factory):
assert '--sf-tp-primary' in css.text # Phase 2 短令牌别名随构建分发
assert '--sf-tp-color-brand-primary' in css.text # cms 令牌全集随构建分发
def test_trade_pro_home_layout_structure(factory):
# Task 10a:home.html 移植 cms 首页设计后的结构契约(sf-tp-* 组件类,
# 数据区块由 preview 的 3 个演示产品驱动;无 pro-industrial-hero 残留)。
r = factory.get('/api/factory/themes/trade-pro/preview', params={'page_type': 'home'})
assert r.status_code == 200, r.text[:400]
soup = BeautifulSoup(r.text, 'html.parser')
assert soup.select_one('section.sf-tp-hero') is not None
assert 'pro-industrial-hero' not in r.text
assert soup.select_one('.sf-tp-hero .sf-tp-hero-copy[data-reveal] h1') is not None
assert soup.select_one('.sf-tp-hero .sf-tp-hero-overlay') is not None
assert len(soup.select('.sf-tp-trustbar .sf-tp-trust-item')) == 4
assert soup.select_one('.sf-tp-trust-item .icon-circle svg') is not None
assert soup.select_one('.sf-tp-two-col .sf-tp-copy .sf-tp-btn[href="/about/"]') is not None
assert soup.select_one('.sf-tp-section-head') is not None
cards = soup.select('.sf-tp-card-grid .sf-tp-card')
assert len(cards) == 3 # preview 提供 3 个演示产品
assert cards[0].select_one('.sf-tp-card-body .sf-tp-more[href]') is not None
assert soup.select_one('.sf-tp-feature-grid .sf-tp-feature .icon-circle svg') is not None
assert soup.select_one('.sf-tp-cta .sf-tp-btn--ghost[href="/contact/"]') is not None
# reveal 渐进增强(pro.html 尾部内联 JS):html.js 开关 + IntersectionObserver
assert "classList.add('js')" in r.text and 'IntersectionObserver' in r.text
assert len(soup.find_all('h1')) == 1
def test_frontend_entries_include_trade_pro():
from pathlib import Path
base = Path(__file__).resolve().parent.parent
+166 -8
View File
@@ -1,8 +1,166 @@
<!-- trade-pro skeleton home: hero + showcase + cta. The hero class matches
industrial on purpose: the 4-family distinct-markup tripwire in
test_theme_pro_v3 counts distinct pro-home-hero class strings, and the
Phase 3 visual port will give trade-pro its own hero variant. -->
<section class="pro-home-hero pro-industrial-hero"><div class="pro-wrap pro-home-grid"><div class="pro-hero-copy"><span class="pro-eyebrow">GLOBAL SOURCING · MADE RELIABLE / 001</span><h1>{{page.title if page.title not in (site.name,'首页','Home') else site.name}}<em> BUILT FOR GLOBAL TRADE.</em></h1><p>{{page.summary or site.tagline or 'Reliable products, transparent specifications and responsive export service.'}}</p><div class="pro-hero-actions"><a class="sf-tp-btn" href="/products/">Browse products {{ icon('arrow-right') }}</a><a class="sf-tp-btn sf-tp-btn-outline" href="/contact/">Request a quote</a></div></div><div class="pro-hero-art">{% if page.cover %}<img src="{{safe_image(page.cover)}}" alt="{{page.title}}">{% else %}<div class="pro-technical"><div></div><div></div><div></div><strong>EXPORT / B2B</strong></div>{% endif %}</div></div></section>
{% if categories %}<section class="pro-section pro-category-band"><div class="pro-wrap">{{section_title('PRODUCT CATEGORIES','Shop by category','/products/')}}<div class="pro-category-tiles">{% for cat in categories[:6] %}<a href="{{cat.url}}"><span>0{{loop.index}}</span><strong>{{cat.name}}</strong><b>{{ icon('arrow-right') }}</b></a>{% endfor %}</div></div></section>{% endif %}
<section class="pro-section pro-featured"><div class="pro-wrap">{{section_title('TRADE CATALOGUE','Featured products','/products/')}}{{grid(showcase,'product')}}</div></section>
<section class="pro-section pro-statement"><div class="pro-wrap pro-statement-layout"><span class="pro-eyebrow">SERVICE &amp; SUPPORT</span><div><h2>From inquiry to delivery.</h2><p>{{site.tagline or 'Product specifications, quality control and export documentation in one place.'}}</p><a class="pro-text-link" href="/about/">About our company {{ icon('arrow-right') }}</a></div></div></section>
{# trade-pro home — cms 首页设计移植(Task 10a)。
区块序列对照 D:/project/cms/runtimes/astro-site-runtime/src/pages/[locale]/index.astro
(像素基准 dist/hesupipe/en/index.html):
hero 大图叠加白字 → trustbar 信任条 → about 两栏 + 悬浮数据 →
products 浅底 4 卡 → applications 深色带 + 2×2 案例瓦片 →
advantages 特性网格 → news 浅底 3 卡 → cta 收尾横幅。
数据接 SiteForge 上下文:page.cover/summary、showcase(产品)、cases、
stories、分类/品牌计数;空数据区块整段隐藏,避免空壳布局。
轮播简化为单 active slide(平台首页无多图配置),dots/轮播 JS 不移植。 #}
<section class="sf-tp-hero" aria-label="{{ site.name }}">
<div class="sf-tp-hero-slides">
<div class="sf-tp-hero-slide active">{% if safe_image(page.cover) %}<img src="{{ safe_image(page.cover) }}" alt="{{ page.title or site.name }}" width="1600" height="800" loading="eager" fetchpriority="high" decoding="async">{% endif %}</div>
</div>
<div class="sf-tp-hero-overlay" aria-hidden="true"></div>
<div class="wrap sf-tp-hero-content">
<div class="sf-tp-hero-copy" data-reveal>
<span class="eyebrow">GLOBAL SOURCING · MADE RELIABLE</span>
<h1>{{ page.title if page.title and page.title not in (site.name,'首页','Home') else site.name }}</h1>
<p class="sf-tp-lead">{{ page.summary or site.tagline or 'Reliable products, transparent specifications and responsive export service.' }}</p>
<a class="sf-tp-btn" href="/products/">Browse products {{ icon('arrow-right') }}</a>
</div>
</div>
</section>
<div class="sf-tp-trustbar">
<div class="wrap sf-tp-trust-grid">
{% set tp_trust = [
('check', 'Certified quality', 'Inspected before every shipment'),
('location', 'Global export', 'Delivering to worldwide markets'),
('download', 'Full documentation', 'Specs and export files on hand'),
('mail', 'Responsive service', 'Replies within one business day'),
] %}
{% for tp_icon, tp_title, tp_sub in tp_trust %}
<div class="sf-tp-trust-item" data-reveal style="--reveal-i: {{ loop.index0 }}">
<div class="icon-circle" aria-hidden="true">{{ icon(tp_icon) }}</div>
<strong>{{ tp_title }}</strong><span>{{ tp_sub }}</span>
</div>
{% endfor %}
</div>
</div>
<section class="section">
<div class="wrap sf-tp-two-col">
<div class="sf-tp-copy" data-reveal>
<span class="eyebrow">ABOUT US</span>
<h2>One partner from inquiry to delivery.</h2>
<p>{{ page.summary or site.tagline or 'Product specifications, quality control and export documentation in one place.' }}</p>
<a class="sf-tp-btn" href="/about/">About our company {{ icon('arrow-right') }}</a>
</div>
<div data-reveal style="--reveal-i: 1">
<div class="sf-tp-photo">{% if safe_image(page.cover) %}<img src="{{ safe_image(page.cover) }}" alt="{{ site.name }} facility" width="800" height="600" loading="lazy" decoding="async">{% else %}<div class="sf-tp-photo-plain" aria-hidden="true"><span>EXPORT · B2B</span></div>{% endif %}</div>
{% if groups['product'] or groups['vehicle'] or categories or brands or cases %}
<div class="sf-tp-stats">
{% if groups['product'] or groups['vehicle'] %}<div class="sf-tp-stat"><strong class="mono">{{ groups['product']|length + groups['vehicle']|length }}</strong><span>Products</span></div>{% endif %}
{% if categories %}<div class="sf-tp-stat"><strong class="mono">{{ categories|length }}</strong><span>Categories</span></div>{% endif %}
{% if brands %}<div class="sf-tp-stat"><strong class="mono">{{ brands|length }}</strong><span>Brands</span></div>{% endif %}
{% if cases %}<div class="sf-tp-stat"><strong class="mono">{{ cases|length }}</strong><span>Case studies</span></div>{% endif %}
</div>
{% endif %}
</div>
</div>
</section>
{% if showcase %}
<section class="section section--soft">
<div class="wrap">
<div class="sf-tp-section-head" data-reveal>
<div>
<span class="eyebrow">TRADE CATALOGUE</span>
<h2>Featured products</h2>
</div>
<p class="sf-tp-intro">Specifications, certification and packaging details are published with every listing.</p>
<a class="sf-tp-more" href="/products/">Browse all products {{ icon('arrow-right', cls='sf-tp-icon--sm') }}</a>
</div>
<div class="sf-tp-card-grid">
{% for tp_item in showcase[:4] %}
{% set tp_desc = tp_item.summary or 'Published specifications available on request.' %}
<article class="sf-tp-card" data-reveal style="--reveal-i: {{ loop.index0 % 4 }}">
<div class="sf-tp-card-media">{{ cover(tp_item, 'product') }}</div>
<div class="sf-tp-card-body">
<h3>{{ tp_item.title }}</h3>
<p>{{ tp_desc.split('.')[0] }}.</p>
<a class="sf-tp-more" href="{{ safe_href(tp_item.route) }}">View details {{ icon('arrow-right', cls='sf-tp-icon--sm') }}</a>
</div>
</article>
{% endfor %}
</div>
</div>
</section>
{% endif %}
{% if cases %}
<section class="sf-tp-applications">
<div class="wrap sf-tp-applications-grid">
<div class="sf-tp-applications-copy" data-reveal>
<span class="eyebrow">APPLICATIONS</span>
<h2>Built for real-world projects.</h2>
<p>Case studies from export programmes: municipal supply, industrial plants and OEM partnerships.</p>
<a class="sf-tp-btn" href="/cases/">Explore case studies {{ icon('arrow-right') }}</a>
</div>
<div class="sf-tp-application-tiles">
{% for tp_case in cases[:4] %}
<a class="sf-tp-app-tile" href="{{ safe_href(tp_case.route) }}" data-reveal style="--reveal-i: {{ loop.index0 }}">
{% if safe_image(tp_case.cover) %}<img src="{{ safe_image(tp_case.cover) }}" alt="{{ tp_case.title }}" width="600" height="450" loading="lazy" decoding="async">{% else %}<div class="sf-tp-tile-art" aria-hidden="true"></div>{% endif %}
<span>{{ tp_case.title }}</span>
</a>
{% endfor %}
</div>
</div>
</section>
{% endif %}
<section class="section">
<div class="wrap">
<div class="sf-tp-section-head" data-reveal>
<div>
<span class="eyebrow">OUR ADVANTAGES</span>
<h2>Why buyers stay with us</h2>
</div>
</div>
<div class="sf-tp-feature-grid">
{% set tp_features = [
('search', 'Verified sourcing', 'Suppliers audited against your specifications before the first sample.'),
('check', 'Strict quality control', 'Pre-shipment inspection with photographic evidence for every batch.'),
('download', 'Export documentation', 'Certification, packing lists and customs papers prepared in-house.'),
('phone', 'Dedicated support', 'One trade desk contact from inquiry to container loading.'),
] %}
{% for tp_icon, tp_title, tp_desc in tp_features %}
<div class="sf-tp-feature" data-reveal style="--reveal-i: {{ loop.index0 }}">
<div class="icon-circle" aria-hidden="true">{{ icon(tp_icon) }}</div>
<h3>{{ tp_title }}</h3>
<p>{{ tp_desc }}</p>
</div>
{% endfor %}
</div>
</div>
</section>
{% if stories %}
<section class="section section--soft">
<div class="wrap">
<div class="sf-tp-section-head" data-reveal>
<div>
<span class="eyebrow">COMPANY NEWS</span>
<h2>Latest updates</h2>
</div>
<a class="sf-tp-more" href="/news/">View all news {{ icon('arrow-right', cls='sf-tp-icon--sm') }}</a>
</div>
<div class="sf-tp-card-grid sf-tp-card-grid--news">
{% for tp_post in stories[:3] %}
<article class="sf-tp-card" data-reveal style="--reveal-i: {{ loop.index0 }}">
<div class="sf-tp-card-media">{{ cover(tp_post, 'post') }}</div>
<div class="sf-tp-card-body">
<h3><a href="{{ safe_href(tp_post.route) }}">{{ tp_post.title }}</a></h3>
<span class="sf-tp-tag">{{ fields_of(tp_post).get('category') or 'UPDATE' }}</span>
</div>
</article>
{% endfor %}
</div>
</div>
</section>
{% endif %}
<section class="sf-tp-cta">
<div class="wrap sf-tp-cta-inner">
<div data-reveal>
<span class="eyebrow">GET A QUOTATION</span>
<h2>Send one inquiry, get a matched quote.</h2>
<p>Share your specifications and target market; our trade desk replies with pricing and lead time within one business day.</p>
</div>
<a class="sf-tp-btn sf-tp-btn--ghost" href="/contact/" data-reveal style="--reveal-i: 1">Request a quote {{ icon('arrow-right') }}</a>
</div>
</section>
+171 -7
View File
@@ -1,8 +1,174 @@
/* trade-pro pro.css — skeleton layer (Phase 2).
Kept above the 2 KB floor every built-in theme must satisfy for the
packaged asset assertion (tests/test_theme_pro_v3.py). The full cms port
(tokens/base/components) lands in Phase 3; until then these rules only
tint the shared pro-base.css chrome with trade-pro tokens. */
/* trade-pro pro.css — component layer.
Phase 2 shipped a skeleton tint layer; Phase 3 Task 10a prepends the ported
cms home components. Sources (scoped CSS + dist pixel baseline
D:/project/cms/runtimes/astro-site-runtime/dist/hesupipe/en/index.html):
- src/pages/[locale]/index.astro (hero / trustbar / two-col about /
applications band / section-head / card / feature / cta-band)
- src/components/{PageHero,FeatureGrid,CardGrid,Cta,SectionHead}.astro
Layer split with theme.css (= tokens + element baseline + shared utilities):
pro.css owns the sf-tp-* component classes; markup composes on the
theme.css base utilities (.wrap / .section / .section--soft / .eyebrow /
.icon-circle / .mono / .sf-tp-btn) and the pro-base chrome (.pro-*).
Responsive breakpoints follow the ported tokens: 900px stack, 767px hero
portrait, 620px compact (design-spec mobile). Size stays above the 2 KB
floor required by tests/test_theme_pro_v3.py for packaged assets. */
/* ── Home hero:大图完整显示(height:auto 不裁剪)+ 左深右透叠层 + 白字 ── */
.sf-theme-trade-pro .sf-tp-hero{position:relative;overflow:hidden;min-height:clamp(420px,60vh,640px);background:linear-gradient(115deg,var(--sf-tp-color-surface-inverse),var(--sf-tp-color-brand-primary-deep) 78%)}
.sf-theme-trade-pro .sf-tp-hero-slides{display:grid}
.sf-theme-trade-pro .sf-tp-hero-slide{grid-area:1/1;opacity:0;transition:opacity var(--sf-tp-duration-slow) var(--sf-tp-easing-standard)}
.sf-theme-trade-pro .sf-tp-hero-slide.active{opacity:1}
.sf-theme-trade-pro .sf-tp-hero-slide img{width:100%;height:auto;display:block}
.sf-theme-trade-pro .sf-tp-hero-overlay{position:absolute;inset:0;z-index:var(--sf-tp-z-base);background:linear-gradient(90deg,color-mix(in srgb,var(--sf-tp-color-surface-inverse) 68%,transparent) 0,color-mix(in srgb,var(--sf-tp-color-surface-inverse) 42%,transparent) 34%,transparent 62%)}
.sf-theme-trade-pro .sf-tp-hero::after{content:"";position:absolute;inset:auto 0 0;height:calc(var(--sf-tp-space-10) + var(--sf-tp-space-1));background:linear-gradient(transparent,color-mix(in srgb,var(--sf-tp-color-neutral-0) 35%,transparent));pointer-events:none}
.sf-theme-trade-pro .sf-tp-hero-content{position:absolute;inset:0;z-index:var(--sf-tp-z-raised);display:flex;align-items:center;pointer-events:none}
.sf-theme-trade-pro .sf-tp-hero-copy{position:relative;z-index:var(--sf-tp-z-raised);pointer-events:auto;width:min(calc(var(--sf-tp-container-content-max) - var(--sf-tp-space-16)),56%)}
.sf-theme-trade-pro .sf-tp-hero-copy .eyebrow{color:var(--sf-tp-color-text-inverse-muted)}
.sf-theme-trade-pro .sf-tp-hero-copy h1{color:var(--sf-tp-color-text-inverse)}
.sf-theme-trade-pro .sf-tp-lead{color:color-mix(in srgb,var(--sf-tp-color-text-inverse) 88%,transparent);font-size:var(--sf-tp-font-size-lg);line-height:var(--sf-tp-line-height-relaxed);max-width:var(--sf-tp-container-content-max);margin-block-end:var(--sf-tp-space-6)}
/* ── 信任条:4 列分隔线,图标圆位 + 标题/副题 ── */
.sf-theme-trade-pro .sf-tp-trustbar{position:relative;z-index:var(--sf-tp-z-raised);background:var(--sf-tp-color-surface-default);border-block-end:var(--sf-tp-border-width-hairline) solid var(--sf-tp-color-border-subtle)}
.sf-theme-trade-pro .sf-tp-trust-grid{display:grid;grid-template-columns:repeat(4,1fr)}
.sf-theme-trade-pro .sf-tp-trust-item{text-align:center;padding:var(--sf-tp-space-6) var(--sf-tp-space-4);border-inline-end:var(--sf-tp-border-width-hairline) solid var(--sf-tp-color-border-subtle)}
.sf-theme-trade-pro .sf-tp-trust-item:last-child{border:0}
.sf-theme-trade-pro .sf-tp-trust-item .icon-circle{margin-block-end:var(--sf-tp-space-2)}
.sf-theme-trade-pro .sf-tp-trust-item strong{display:block;font-size:var(--sf-tp-font-size-sm);font-weight:var(--sf-tp-font-weight-semibold)}
.sf-theme-trade-pro .sf-tp-trust-item span{display:block;color:var(--sf-tp-color-text-muted);font-size:var(--sf-tp-font-size-xs)}
/* ── 关于两栏:文案 + 实景(悬浮数据条压在图底部)── */
.sf-theme-trade-pro .sf-tp-two-col{display:grid;grid-template-columns:1fr 1.22fr;gap:calc(var(--sf-tp-space-12) + var(--sf-tp-space-4));align-items:center}
.sf-theme-trade-pro .sf-tp-copy p{color:var(--sf-tp-color-text-muted);margin-block-end:var(--sf-tp-space-6)}
.sf-theme-trade-pro .sf-tp-photo{border-radius:var(--sf-tp-radius-md);overflow:hidden;box-shadow:var(--sf-tp-shadow-md);aspect-ratio:var(--sf-tp-ratio-landscape)}
.sf-theme-trade-pro .sf-tp-photo img{width:100%;height:100%;object-fit:cover;display:block}
.sf-theme-trade-pro .sf-tp-photo-plain{width:100%;height:100%;display:grid;place-items:center;background:linear-gradient(130deg,var(--sf-tp-color-surface-brand-soft),var(--sf-tp-color-neutral-200));color:var(--sf-tp-color-text-brand);font-weight:var(--sf-tp-font-weight-bold);letter-spacing:var(--sf-tp-letter-spacing-wide);font-size:var(--sf-tp-font-size-xs)}
.sf-theme-trade-pro .sf-tp-stats{display:grid;grid-template-columns:repeat(4,1fr);border-radius:var(--sf-tp-radius-sm);background:var(--sf-tp-color-surface-default);box-shadow:var(--sf-tp-shadow-md);margin-block-start:calc(-1 * var(--sf-tp-space-10));position:relative;width:92%;margin-left:auto;margin-right:auto}
.sf-theme-trade-pro .sf-tp-stat{text-align:center;padding:var(--sf-tp-space-5) var(--sf-tp-space-2);border-inline-end:var(--sf-tp-border-width-hairline) solid var(--sf-tp-color-border-default)}
.sf-theme-trade-pro .sf-tp-stat:last-child{border:0}
.sf-theme-trade-pro .sf-tp-stat strong{display:block;color:var(--sf-tp-color-text-brand);font-size:var(--sf-tp-font-size-2xl);line-height:var(--sf-tp-line-height-tight)}
.sf-theme-trade-pro .sf-tp-stat span{color:var(--sf-tp-color-text-muted);font-size:var(--sf-tp-font-size-xs)}
/* ── 区块头行(SectionHead):眉题/标题左,简介/动作右 ── */
.sf-theme-trade-pro .sf-tp-section-head{display:flex;align-items:end;justify-content:space-between;gap:var(--sf-tp-space-8);margin-block-end:var(--sf-tp-space-8);flex-wrap:wrap}
.sf-theme-trade-pro .sf-tp-intro{max-width:calc(var(--sf-tp-container-content-max) - var(--sf-tp-space-16));color:var(--sf-tp-color-text-muted);font-size:var(--sf-tp-font-size-sm)}
.sf-theme-trade-pro .sf-tp-more{color:var(--sf-tp-color-text-brand);font-size:var(--sf-tp-font-size-sm);font-weight:var(--sf-tp-font-weight-semibold)}
.sf-theme-trade-pro .sf-tp-more:hover{color:var(--sf-tp-color-text-link-hover)}
.sf-theme-trade-pro .sf-tp-more .sf-tp-icon{margin-inline-start:var(--sf-tp-space-1)}
/* ── 卡片网格(CardGrid):4 列默认 / --news 3 列;媒体 4:3 + 悬浮上抬缩放 ── */
.sf-theme-trade-pro .sf-tp-card-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--sf-tp-space-4) calc(var(--sf-tp-space-4) + var(--sf-tp-space-1))}
.sf-theme-trade-pro .sf-tp-card-grid--news{grid-template-columns:repeat(3,minmax(0,1fr))}
.sf-theme-trade-pro .sf-tp-card{background:var(--sf-tp-color-surface-default);border:var(--sf-tp-border-width-hairline) solid var(--sf-tp-color-border-subtle);border-radius:var(--sf-tp-card-border-radius);overflow:hidden;box-shadow:var(--sf-tp-shadow-xs);transition:transform var(--sf-tp-duration-fast) var(--sf-tp-easing-standard),box-shadow var(--sf-tp-duration-fast) var(--sf-tp-easing-standard)}
.sf-theme-trade-pro .sf-tp-card:hover{transform:translateY(calc(-1 * var(--sf-tp-space-1)));box-shadow:var(--sf-tp-shadow-md)}
.sf-theme-trade-pro .sf-tp-card-media{aspect-ratio:var(--sf-tp-ratio-landscape);overflow:hidden;background:var(--sf-tp-color-surface-muted)}
.sf-theme-trade-pro .sf-tp-card-media img{width:100%;height:100%;object-fit:cover;display:block;transition:transform var(--sf-tp-duration-slow) var(--sf-tp-easing-standard)}
.sf-theme-trade-pro .sf-tp-card:hover .sf-tp-card-media img{transform:scale(1.04)}
.sf-theme-trade-pro .sf-tp-card-media .pro-art{height:100%}
.sf-theme-trade-pro .sf-tp-card-body{padding:var(--sf-tp-space-4) var(--sf-tp-space-4) var(--sf-tp-space-5)}
.sf-theme-trade-pro .sf-tp-card h3{font-size:var(--sf-tp-font-size-lg);margin-block-end:var(--sf-tp-space-2)}
.sf-theme-trade-pro .sf-tp-card h3 a{color:inherit}
.sf-theme-trade-pro .sf-tp-card p{color:var(--sf-tp-color-text-muted);font-size:var(--sf-tp-font-size-sm);margin-block-end:var(--sf-tp-space-2);line-height:var(--sf-tp-line-height-normal)}
.sf-theme-trade-pro .sf-tp-tag{display:inline-block;background:var(--sf-tp-color-surface-brand-soft);color:var(--sf-tp-color-text-brand);border-radius:var(--sf-tp-radius-full);padding:var(--sf-tp-space-1) var(--sf-tp-space-3);font-size:var(--sf-tp-font-size-xs)}
/* ── 应用带(applications):深蓝渐变 + 光晕 + 2×2 图片瓦片 ── */
.sf-theme-trade-pro .sf-tp-applications{position:relative;padding-block:calc(var(--sf-tp-space-12) + var(--sf-tp-space-6));color:var(--sf-tp-color-text-inverse);overflow:hidden;background:linear-gradient(90deg,color-mix(in srgb,var(--sf-tp-color-surface-inverse) 96%,transparent),color-mix(in srgb,var(--sf-tp-color-brand-primary-deep) 88%,transparent))}
.sf-theme-trade-pro .sf-tp-applications::before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 15% 20%,color-mix(in srgb,var(--sf-tp-color-brand-primary) 24%,transparent),transparent 42%);pointer-events:none}
.sf-theme-trade-pro .sf-tp-applications-grid{position:relative;display:grid;grid-template-columns:0.95fr 1.15fr;gap:calc(var(--sf-tp-space-12) + var(--sf-tp-space-6));align-items:center}
.sf-theme-trade-pro .sf-tp-applications .eyebrow{color:color-mix(in srgb,var(--sf-tp-color-text-inverse) 85%,transparent)}
.sf-theme-trade-pro .sf-tp-applications h2{color:var(--sf-tp-color-text-inverse);font-size:clamp(34px,3.6vw,var(--sf-tp-font-size-4xl));margin-block-end:var(--sf-tp-space-4)}
.sf-theme-trade-pro .sf-tp-applications-copy p{max-width:510px;color:color-mix(in srgb,var(--sf-tp-color-text-inverse) 88%,transparent);margin-block-end:calc(var(--sf-tp-space-5) + var(--sf-tp-space-1))}
.sf-theme-trade-pro .sf-tp-applications-copy .sf-tp-btn{background:var(--sf-tp-color-surface-default);border-color:var(--sf-tp-color-surface-default);color:var(--sf-tp-color-text-brand)}
.sf-theme-trade-pro .sf-tp-applications-copy .sf-tp-btn:hover{background:var(--sf-tp-color-brand-primary);color:var(--sf-tp-color-text-on-brand)}
.sf-theme-trade-pro .sf-tp-application-tiles{display:grid;grid-template-columns:1fr 1fr;gap:calc(var(--sf-tp-space-4) - var(--sf-tp-space-1))}
.sf-theme-trade-pro .sf-tp-app-tile{position:relative;min-height:150px;display:flex;align-items:flex-end;overflow:hidden;border-radius:var(--sf-tp-radius-sm);box-shadow:var(--sf-tp-shadow-md);background:var(--sf-tp-color-surface-inverse-muted);transition:transform var(--sf-tp-duration-fast) var(--sf-tp-easing-standard),box-shadow var(--sf-tp-duration-fast) var(--sf-tp-easing-standard)}
.sf-theme-trade-pro .sf-tp-app-tile img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.sf-theme-trade-pro .sf-tp-tile-art{position:absolute;inset:0;background:linear-gradient(135deg,var(--sf-tp-color-brand-primary-deep),var(--sf-tp-color-brand-accent))}
.sf-theme-trade-pro .sf-tp-app-tile::after{content:"";position:absolute;inset:35% 0 0;background:linear-gradient(transparent,color-mix(in srgb,var(--sf-tp-color-surface-inverse) 86%,transparent))}
.sf-theme-trade-pro .sf-tp-app-tile span{position:relative;z-index:var(--sf-tp-z-raised);width:100%;padding:var(--sf-tp-space-5);color:var(--sf-tp-color-text-inverse);font-size:var(--sf-tp-font-size-lg);font-weight:var(--sf-tp-font-weight-bold);text-shadow:0 2px 6px color-mix(in srgb,var(--sf-tp-color-surface-inverse) 45%,transparent)}
.sf-theme-trade-pro .sf-tp-app-tile:hover{transform:translateY(calc(-1 * var(--sf-tp-space-1)));box-shadow:var(--sf-tp-shadow-lg)}
/* ── 特性网格(FeatureGrid):圆图标 + 标题 + 描述 ── */
.sf-theme-trade-pro .sf-tp-feature-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:calc(var(--sf-tp-space-4) - var(--sf-tp-space-1))}
.sf-theme-trade-pro .sf-tp-feature{background:var(--sf-tp-color-surface-default);border-radius:var(--sf-tp-card-border-radius);text-align:center;padding:var(--sf-tp-space-6) var(--sf-tp-space-4);border:var(--sf-tp-border-width-hairline) solid var(--sf-tp-color-border-subtle)}
.sf-theme-trade-pro .sf-tp-feature .icon-circle{margin-block-end:var(--sf-tp-space-3)}
.sf-theme-trade-pro .sf-tp-feature h3{font-size:var(--sf-tp-font-size-md);margin-block-end:var(--sf-tp-space-2)}
.sf-theme-trade-pro .sf-tp-feature p{color:var(--sf-tp-color-text-muted);font-size:var(--sf-tp-font-size-sm);margin:0}
/* ── CTA 横幅(Cta):藏青→品牌蓝渐变 + 幽灵按钮(cms 叠加实景图,静态产物用纯渐变)── */
.sf-theme-trade-pro .sf-tp-cta{padding-block:calc(var(--sf-tp-space-12) + var(--sf-tp-space-4));color:var(--sf-tp-color-text-inverse);background:linear-gradient(90deg,color-mix(in srgb,var(--sf-tp-color-surface-inverse) 94%,transparent),color-mix(in srgb,var(--sf-tp-color-brand-primary) 67%,transparent))}
.sf-theme-trade-pro .sf-tp-cta-inner{display:flex;align-items:center;justify-content:space-between;gap:var(--sf-tp-space-6);flex-wrap:wrap}
.sf-theme-trade-pro .sf-tp-cta .eyebrow{color:var(--sf-tp-color-text-inverse-muted)}
.sf-theme-trade-pro .sf-tp-cta h2{margin-block-end:var(--sf-tp-space-2);color:var(--sf-tp-color-text-inverse)}
.sf-theme-trade-pro .sf-tp-cta p{color:color-mix(in srgb,var(--sf-tp-color-text-inverse) 83%,transparent);margin:0}
/* ── 响应式(断点随 cms 设计稿:900 栅格堆叠 / 767 hero 竖版 / 620 紧凑)── */
@media (max-width: 900px){
.sf-theme-trade-pro .sf-tp-applications-grid{grid-template-columns:1fr;gap:calc(var(--sf-tp-space-8) + var(--sf-tp-space-1))}
.sf-theme-trade-pro .sf-tp-two-col{grid-template-columns:1fr}
.sf-theme-trade-pro .sf-tp-card-grid,.sf-theme-trade-pro .sf-tp-card-grid--news{grid-template-columns:repeat(2,minmax(0,1fr))}
.sf-theme-trade-pro .sf-tp-feature-grid,.sf-theme-trade-pro .sf-tp-trust-grid{grid-template-columns:1fr 1fr}
.sf-theme-trade-pro .sf-tp-trust-item{border-inline-end:0;border-block-end:var(--sf-tp-border-width-hairline) solid var(--sf-tp-color-border-subtle)}
}
@media (max-width: 767px){
.sf-theme-trade-pro .sf-tp-hero{aspect-ratio:3/4;min-height:520px}
.sf-theme-trade-pro .sf-tp-hero-copy{width:100%}
}
@media (max-width: 620px){
.sf-theme-trade-pro .sf-tp-hero{aspect-ratio:375/320;min-height:320px}
.sf-theme-trade-pro .sf-tp-hero-copy{max-width:57%}
.sf-theme-trade-pro .sf-tp-hero-copy .sf-tp-lead{font-size:11px;line-height:1.35;margin-block-end:12px}
/* 信任条:浮动圆角卡片 2×2(图标左、文字右) */
.sf-theme-trade-pro .sf-tp-trustbar{margin-block-start:-1px;padding-inline:0;border-radius:10px;box-shadow:var(--sf-tp-shadow-md);overflow:hidden}
.sf-theme-trade-pro .sf-tp-trust-grid{grid-template-columns:1fr 1fr}
.sf-theme-trade-pro .sf-tp-trust-item{min-height:72px;padding:11px 7px;text-align:left;display:grid;grid-template-columns:45px 1fr;align-content:center;border-inline-end:1px solid var(--sf-tp-color-border-subtle);border-block-end:1px solid var(--sf-tp-color-border-subtle)}
.sf-theme-trade-pro .sf-tp-trust-item:nth-child(2n){border-inline-end:0}
.sf-theme-trade-pro .sf-tp-trust-item:nth-last-child(-n+2){border-block-end:0}
.sf-theme-trade-pro .sf-tp-trust-item .icon-circle{grid-row:1/3;margin:0;background:transparent;font-size:20px}
.sf-theme-trade-pro .sf-tp-trust-item strong{font-size:10px}
.sf-theme-trade-pro .sf-tp-trust-item span{font-size:9px}
/* 关于区:紧凑双栏 + 数据 2×2 */
.sf-theme-trade-pro .sf-tp-two-col{grid-template-columns:1fr 1.08fr;gap:13px;align-items:start}
.sf-theme-trade-pro .sf-tp-copy p{font-size:11px;line-height:1.35;margin-block-end:10px}
.sf-theme-trade-pro .sf-tp-photo{min-height:162px}
.sf-theme-trade-pro .sf-tp-stats{grid-template-columns:repeat(2,1fr);margin-block-start:-1px}
.sf-theme-trade-pro .sf-tp-stat{padding:9px 3px}
.sf-theme-trade-pro .sf-tp-stat strong{font-size:19px}
.sf-theme-trade-pro .sf-tp-stat span{font-size:8px}
/* 应用带:浅底代替深色,按钮隐藏 */
.sf-theme-trade-pro .sf-tp-applications{padding-block:28px;color:var(--sf-tp-color-text-primary);background:linear-gradient(135deg,var(--sf-tp-color-neutral-50),var(--sf-tp-color-surface-brand-soft))}
.sf-theme-trade-pro .sf-tp-applications::before{content:none}
.sf-theme-trade-pro .sf-tp-applications .eyebrow{color:var(--sf-tp-color-text-brand)}
.sf-theme-trade-pro .sf-tp-applications h2{color:var(--sf-tp-color-text-primary);font-size:22px;margin-block-end:4px}
.sf-theme-trade-pro .sf-tp-applications-copy p{color:var(--sf-tp-color-text-secondary);font-size:11px;margin-block-end:9px}
.sf-theme-trade-pro .sf-tp-applications-copy .sf-tp-btn{display:none}
.sf-theme-trade-pro .sf-tp-applications-grid{display:block}
.sf-theme-trade-pro .sf-tp-application-tiles{gap:7px}
.sf-theme-trade-pro .sf-tp-app-tile{min-height:92px}
.sf-theme-trade-pro .sf-tp-app-tile span{padding:9px;font-size:11px}
/* 卡片 2 列紧凑;新闻网格移动端只显示前 2 张 */
.sf-theme-trade-pro .sf-tp-card-grid,.sf-theme-trade-pro .sf-tp-card-grid--news{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.sf-theme-trade-pro .sf-tp-card-media{aspect-ratio:16/9}
.sf-theme-trade-pro .sf-tp-card-body{padding:9px 10px 11px}
.sf-theme-trade-pro .sf-tp-card h3{font-size:13px;margin-block-end:2px}
.sf-theme-trade-pro .sf-tp-card p{font-size:11px;margin-block-end:5px}
.sf-theme-trade-pro .sf-tp-more{font-size:10px}
.sf-theme-trade-pro .sf-tp-card-grid--news .sf-tp-card:nth-child(n+3){display:none}
/* 特性 2 列横排(图标左、文字右) */
.sf-theme-trade-pro .sf-tp-feature-grid{grid-template-columns:1fr 1fr;gap:8px}
.sf-theme-trade-pro .sf-tp-feature{min-height:92px;text-align:left;padding:12px;display:grid;grid-template-columns:44px 1fr;align-content:center;column-gap:7px}
.sf-theme-trade-pro .sf-tp-feature .icon-circle{grid-row:1/3;align-self:center;margin:0;font-size:20px}
.sf-theme-trade-pro .sf-tp-feature h3{font-size:12px;margin:0 0 3px}
.sf-theme-trade-pro .sf-tp-feature p{font-size:10px;line-height:1.3}
.sf-theme-trade-pro .sf-tp-section-head{display:block}
/* CTA:纵向堆叠 */
.sf-theme-trade-pro .sf-tp-cta{padding-block:28px}
.sf-theme-trade-pro .sf-tp-cta-inner{display:block}
.sf-theme-trade-pro .sf-tp-cta h2{font-size:22px}
.sf-theme-trade-pro .sf-tp-cta p{font-size:11px}
.sf-theme-trade-pro .sf-tp-cta .sf-tp-btn{margin-block-start:12px}
}
/* ── Phase 2 skeleton tint layer(chrome 着色,供其余页面与 pro-base 骨架)── */
.sf-theme-trade-pro .pro-wrap{max-width:1200px;margin:0 auto;padding:0 20px}
.sf-theme-trade-pro .pro-header{background:#fff;border-bottom:3px solid var(--sf-tp-primary,#0b3d91)}
.sf-theme-trade-pro .pro-logo-name small{color:var(--sf-tp-primary,#0b3d91);letter-spacing:.18em}
@@ -28,5 +194,3 @@
.sf-theme-trade-pro .pro-footer-bottom{border-top:1px solid #24344c}
.sf-theme-trade-pro .pro-filter-panel{border:1px solid #dfe7f2;border-radius:var(--sf-tp-radius,8px)}
.sf-theme-trade-pro .pro-404 strong{color:var(--sf-tp-primary,#0b3d91)}
/* Phase 3: replace the tint layer above with the ported cms base.css and
components (tokens prefixed --sf-tp-, all interactive classes sf-tp-*). */
+18 -1
View File
@@ -22,4 +22,21 @@
{% if has_custom and kind!='notfound' %}<main id="main-content" class="sf-canvas pro-custom-content">{{custom_blocks}}</main>{% else %}<main id="main-content" class="sf-canvas pro-custom-content" aria-hidden="true"></main>{% endif %}
{% if kind not in ('notfound','search') %}<section class="pro-end-cta"><div class="pro-wrap"><div><span class="pro-eyebrow">LET'S CONNECT</span><h2>Ready to source with confidence?</h2><p>{{site.tagline or 'Send your specifications and get a quotation within one business day.'}}</p></div><a class="sf-tp-btn" href="/contact/">Contact us <span>{{ icon('arrow-right') }}</span></a></div></section>{% endif %}
<footer class="sf-site-foot pro-footer"><div class="pro-wrap"><div class="pro-footer-top"><div><span class="pro-eyebrow">TRADE PARTNERSHIP</span><h2>{{chrome.footer.title or site.name}}</h2><p>{{footer_text if (chrome_is_custom or footer_text) else 'Quality products, transparent specifications and dependable worldwide delivery.'}}</p></div><div class="pro-footer-links">{{footer_links(tp_nav if footer_nav else [])}}</div><div><span class="pro-eyebrow">BUSINESS ENQUIRY</span><p>{% if footer_email %}<a href="mailto:{{footer_email}}">{{footer_email}}</a>{% else %}Configure the business email in the admin console.{% endif %}</p></div></div><div class="pro-footer-bottom"><span>© {{year}} {{site.name}}</span><span>ENGINEERED FOR GLOBAL TRADE</span></div></div></footer>
<script defer src="assets/site-runtime.js"></script><script defer src="assets/pro.js"></script></body></html>
<script defer src="assets/site-runtime.js"></script><script defer src="assets/pro.js"></script>
<script>
/* cms reveal port (Task 10a): progressive enhancement only. Without JS or
IntersectionObserver the html.js class is never set, so [data-reveal]
content (theme.css) stays visible; reduced-motion is exempted in CSS. */
(function () {
if (!('IntersectionObserver' in window)) return;
document.documentElement.classList.add('js');
var io = new IntersectionObserver(function (entries) {
entries.forEach(function (entry) {
if (!entry.isIntersecting) return;
entry.target.classList.add('is-visible');
io.unobserve(entry.target);
});
}, { rootMargin: '0px 0px -8% 0px' });
document.querySelectorAll('[data-reveal]').forEach(function (el) { io.observe(el); });
})();
</script></body></html>
+6 -66
View File
@@ -464,7 +464,7 @@ body.sf-theme-trade-pro {
/* 深色表面上的描边按钮 */
.section--dark .sf-tp-btn--ghost,
.cta-band .sf-tp-btn--ghost {
.sf-tp-cta .sf-tp-btn--ghost {
background: var(--sf-tp-color-surface-default);
color: var(--sf-tp-color-text-brand);
}
@@ -636,17 +636,14 @@ body.sf-theme-trade-pro {
padding-inline-start: calc(var(--sf-tp-icon-size-md, 20px) + var(--sf-tp-space-6));
}
/* ── Phase 2 桥接:骨架期 .pro-* 强调样式改由 cms 令牌驱动(Task 10 布局移植后由组件样式接管)── */
/* ── Phase 2 桥接:骨架期 .pro-* 强调样式改由 cms 令牌驱动(home 布局已由
pro.css 的 sf-tp-* 组件层接管,Task 10a 起仅保留 utility 条)── */
.pro-utility {
background: var(--sf-tp-color-surface-inverse);
color: var(--sf-tp-color-text-inverse-muted);
}
.pro-home-hero em {
color: var(--sf-tp-color-text-brand);
}
/* ── 滚动浮现动效(渐进增强:仅在 JS 打开 html.js 且注册 IntersectionObserver
后生效——Task 10 随布局引入配套 JS;无 JS/reduced-motion 时默认可见)── */
@@ -732,66 +729,9 @@ body.sf-theme-trade-pro {
.section { padding-block: 30px; }
/* 卡片:2 列紧凑(组件类,桌面形态随 Task 10 移植) */
.cards {
gap: 10px;
}
.card { border-radius: 7px; }
.card-media {
aspect-ratio: 16 / 9;
}
.card-body {
padding: 9px 10px 11px;
}
.card h3 {
font-size: 13px;
margin-block-end: 2px;
}
.card p {
font-size: 11px;
line-height: 1.25;
margin-block-end: 5px;
}
.more { font-size: 10px; }
/* 特性:2 列横排(图标左、文字右) */
.feature-grid {
grid-template-columns: 1fr 1fr;
gap: 8px;
}
.feature {
min-height: 92px;
text-align: left;
padding: 12px;
display: grid;
grid-template-columns: 44px 1fr;
align-content: center;
column-gap: 7px;
}
.feature .icon-circle {
grid-row: 1 / 3;
align-self: center;
margin: 0;
font-size: 20px;
}
.feature h3 {
font-size: 12px;
margin: 0 0 3px;
}
.feature p {
font-size: 10px;
line-height: 1.3;
}
/* 卡片/特性等组件的移动端形态已随 Task 10a 移入 pro.css 的
sf-tp-* 组件层(.sf-tp-card-grid / .sf-tp-feature-grid 等),
本文件只保留元素基线与共享工具类。 */
/* 选项卡 */
.tabs { gap: 8px; margin-block-end: 16px; }