| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- /**
- * utils/theme.js —— Apple 风格浅/深色令牌(阶段 C 展厅 + 详情页 + 实验室)。
- * 主 KV 是纯白底照片:浅色下底色纯白,图片无边框阴影直接融进页面;
- * 深色下页面转纯黑,图片用 multiply 混色把白底压成黑底(黑底 × 任何色不变,只显示产品本身)。
- */
- export const themeCss = `
- :host {
- --bg: #ffffff;
- --bg-soft: #f5f5f7;
- --ink: #1d1d1f;
- --ink-2: #6e6e73;
- --ink-3: #86868b;
- --line: rgba(0, 0, 0, 0.08);
- --accent: #0071e3;
- --warn: #ff9f0a;
- --bar-1: #1d1d1f;
- --img-blend: normal;
- --img-filter: none;
- --img-bg: #ffffff;
- --header-bg: rgba(255, 255, 255, 0.8);
- --pad: clamp(20px, 5vw, 64px);
- --gap-block: clamp(72px, 10vw, 140px);
- --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
- color: var(--ink);
- background: var(--bg);
- font-family: var(--font);
- -webkit-font-smoothing: antialiased;
- text-rendering: optimizeLegibility;
- }
- @media (prefers-color-scheme: dark) {
- :host {
- --bg: #000000;
- --bg-soft: #0b0b0d;
- --ink: #f5f5f7;
- --ink-2: #a1a1a6;
- --ink-3: #86868b;
- --line: rgba(255, 255, 255, 0.14);
- --accent: #2997ff;
- --bar-1: #f5f5f7;
- --img-blend: normal;
- /* 白底主 KV → 屏幕混合:白色变透明,产品本体反相后仍保持中性灰 */
- --img-filter: invert(1) hue-rotate(180deg) saturate(0.9);
- --img-bg: #ffffff;
- --header-bg: rgba(0, 0, 0, 0.72);
- }
- }
- * { box-sizing: border-box; }
- img { display: block; }
- a { color: inherit; text-decoration: none; }
- `;
- export const sharedHtmlCss = `
- .eyebrow { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 0; }
- .kv { width: 100%; height: auto; mix-blend-mode: var(--img-blend); background: transparent; }
- .link { color: var(--accent); }
- .btn {
- display: inline-flex; align-items: center; justify-content: center; gap: 8px;
- height: 48px; padding: 0 28px; border-radius: 980px; border: 1px solid transparent;
- font: 500 16px/1 var(--font); cursor: pointer; background: var(--ink); color: var(--bg);
- transition: opacity 0.2s ease, transform 0.2s ease;
- }
- .btn:hover { opacity: 0.86; }
- .btn:active { transform: scale(0.98); }
- .btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
- .btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
- .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
- `;
- /** 品牌页脚 */
- export function brandFooter(html) {
- return html`<footer class="brand-foot">FmodeCode · Pocket Hardware Lab</footer>`;
- }
- export const footerCss = `
- .brand-foot {
- padding: 40px var(--pad) 56px; color: var(--ink-3); font-size: 12px;
- border-top: 1px solid var(--line); letter-spacing: 0.02em;
- }
- `;
|