
/* 0820-i18n-6 防闪烁门控：仅非 zh 时挂 html.i18n-pending（语言包缓存命中或 fetch 进行中），隐藏 body 避免中文初始值闪现；zh 不加 */
html.i18n-pending body { visibility: hidden; }
:root {
  --bg: #ffffff; --fg: #0f172a; --muted: #64748b;
  --card: #ffffff; --border: #e2e8f0;
  --accent: #0f172a; --accent-soft: rgba(15,23,42,0.06);
  --grid: rgba(15,23,42,0.035);
  --orb: rgba(100,116,139,0.16);
  --green: #16a34a; --danger: #dc2626; --gray: #9ca3af;
  /* 23: lightbox 遮罩/按钮，中性黑灰，随主题 */
  --lb-bg: rgba(15,23,42,0.9); --lb-fg: #ffffff;
  --lb-btn-bg: rgba(255,255,255,0.12); --lb-btn-hover: rgba(255,255,255,0.22);
  --lb-border: rgba(255,255,255,0.28); --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px; --radius-xl: 18px; --radius-pill: 999px; /* design-system §4#2 圆角五档 */
}
[data-theme="dark"] {
  --bg: #0a0e14; --fg: #e2e8f0; --muted: #94a3b8;
  --card: #0e1420; --border: #1e293b;
  --accent: #e2e8f0; --accent-soft: rgba(226,232,240,0.06);
  --grid: rgba(226,232,240,0.04);
  --orb: rgba(148,163,184,0.10);
  --green: #22c55e; --danger: #f87171; --gray: #64748b;
  --lb-bg: rgba(2,4,8,0.92); --lb-fg: #e2e8f0;
  --lb-btn-bg: rgba(226,232,240,0.10); --lb-btn-hover: rgba(226,232,240,0.20);
  --lb-border: rgba(226,232,240,0.25);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
/* 22-2: 移除全局 scroll-behavior:smooth —— 它会把浏览器原生滚动恢复/scrollTo 变成平滑动画，
   与异步 i18n/图片加载的高度突变互相干扰，导致刷新/切语言后页面自动滚动到错误位置。
   锚点跳转的平滑体验改由 JS（scrollIntoView behavior:smooth）在点击时按需提供。 */
body {
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
  color: var(--fg);
  font-family: -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased; transition: background .25s, color .25s;
  overflow-x: hidden;
}
.mono { font-family: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, monospace; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.ic { width: 22px; height: 22px; stroke: currentColor; }

.orb { position: fixed; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: 0; background: var(--orb); }
.orb-1 { width: 440px; height: 440px; top: -140px; left: -120px; animation: drift1 22s ease-in-out infinite alternate; }
.orb-2 { width: 380px; height: 380px; top: 50%; right: -140px; animation: drift2 28s ease-in-out infinite alternate; }
@keyframes drift1 { from { transform: translate(0,0); } to { transform: translate(90px,50px); } }
@keyframes drift2 { from { transform: translate(0,0); } to { transform: translate(-70px,60px); } }

@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.anim { opacity: 0; animation: fadeUp .8s cubic-bezier(.22,1,.36,1) both; }
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .65s cubic-bezier(.22,1,.36,1), transform .65s cubic-bezier(.22,1,.36,1); }
.reveal.visible { opacity: 1; transform: none; }

header { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; position: relative; z-index: 100; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.logo .logo-mark { width: 30px; height: 30px; color: var(--accent); display: block; }
/* logo 图标 = 返回官网首页入口（仅图标可点，文字不受 <a> 的 hover/visited 影响） */
.logo > a.logo-home { display: inline-flex; align-items: center; color: inherit; cursor: pointer; }
.logo > a.logo-home:hover,
.logo > a.logo-home:visited,
.logo > a.logo-home:active { color: inherit; }
.logo > a.logo-home .logo-mark { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 12px; }
/* ===== RTL（العربية）布局统一 =====
   header 用 flex + space-between，dir="rtl" 时整行镜像，会把 logo 推到右侧、
   语言选择器与主题按钮推到左侧，与其余 11 种语言不一致。
   此处让 header 的「布局方向」固定为 ltr（logo 左 / 控件右，与 LTR 语言完全一致），
   仅把其中的语言文字单独还原为 rtl —— 与原站对 .mono/数字强制 direction:ltr 是同一类处理。 */
[dir="rtl"] header { direction: ltr; }
[dir="rtl"] header .lang-cur,
[dir="rtl"] header .lang-opt,
[dir="rtl"] header .gh-link span { direction: rtl; unicode-bidi: isolate; }
/* logo 文字为拉丁字符（Brian's Lab），在原站即强制 ltr，保持与其他语言一致 */
[dir="rtl"] header .logo .mono { direction: ltr; unicode-bidi: isolate; }

.theme-btn { background: var(--card); border: 1px solid var(--border); color: var(--fg); border-radius: var(--radius-md); padding: 6px 12px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: border-color .15s; }
.theme-btn:hover { border-color: var(--accent); }
.gh-link { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.gh-link:hover { color: var(--fg); }

/* 项目卡 star badge（2026-08-18：弃 img.shields.io，数据走自家 /api/github/stars，前端渲染） */
.repo-stars { display: inline-flex; align-items: center; gap: 6px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-pill); padding: 4px 12px; white-space: nowrap; vertical-align: middle; }
.repo-stars svg { width: 13px; height: 13px; flex: none; }
.repo-stars-num { line-height: 1; }

/* 语言切换器 */
.lang-wrap { position: relative; }
.lang-btn-ico { width: 14px; height: 14px; stroke: currentColor; flex-shrink: 0; }
.lang-cur { min-width: 20px; text-align: center; }
.lang-menu { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 6px; min-width: 158px; display: none; flex-direction: column; gap: 2px; box-shadow: 0 12px 32px rgba(0,0,0,.12); z-index: 50; }
[data-theme="dark"] .lang-menu { box-shadow: 0 12px 32px rgba(0,0,0,.55); }
.lang-menu.open { display: flex; }
.lang-opt { display: flex; align-items: center; gap: 8px; width: 100%; text-align: start; background: none; border: none; color: var(--fg); font-size: 13px; padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.lang-opt:hover { background: var(--accent-soft); }
.lang-opt.active { font-weight: 600; }

.hero { text-align: center; padding: 52px 0 28px; }
.hero .badge { display: inline-flex; align-items: center; gap: 8px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-pill); padding: 6px 16px; margin-bottom: 24px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--accent-soft); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 { font-size: 46px; line-height: 1.18; letter-spacing: -0.5px; font-weight: 700; }
.hero h1 .hl { color: var(--muted); }
.hero p { color: var(--muted); font-size: 17px; margin-top: 18px; max-width: 680px; margin-left: auto; margin-right: auto; line-height: 1.65; }
.hero .cta { margin-top: 28px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn { border-radius: var(--radius-md); padding: 12px 24px; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; transition: transform .15s, box-shadow .2s, background .15s, color .15s, border-color .15s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--bg); box-shadow: 0 6px 20px var(--accent-soft); }
.btn-primary:hover { opacity: .88; }
.btn-ghost { border: 1px solid var(--border); color: var(--fg); background: var(--card); }
.btn-ghost:hover { border-color: var(--accent); }
/* 作品卡片按钮修正：primary 去阴影 + 补透明 border 统一占位高度（与 ghost 底边对齐；hero 区 CTA 不受影响） */
.showcase .sc-meta .btn-primary,
.split .links .btn-primary { box-shadow: none; border: 1px solid transparent; }
/* 中英混排行高差（中文 line box 高于拉丁）导致 sc-meta 内按钮底边错位 → 统一行高 */
.showcase .sc-meta .btn,
.split .links .btn { line-height: 1.5; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 40px; }
.metric { border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-lg); padding: 20px 16px; text-align: center; }
.metric .num { font-family: ui-monospace, Menlo, monospace; font-size: 34px; font-weight: 700; line-height: 1; }
.metric .lbl { color: var(--muted); font-size: 13px; margin-top: 8px; }

/* 改版4: 官网访问统计 —— hero 指标条下方独立小卡片(黑灰 + SVG 线性图标 + 动态数字) */
.hero-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 18px; }
.hero-cards .visits { margin: 0; min-width: 210px; justify-content: center; }
.visits { display: inline-flex; align-items: center; gap: 12px; border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-pill); padding: 9px 24px; font-family: ui-monospace, Menlo, monospace; font-size: 14px; color: var(--muted); }
.visits svg { width: 15px; height: 15px; flex: none; }
.visits .v { display: inline-flex; align-items: baseline; gap: 5px; }
.visits .v b { font-weight: 700; color: var(--fg); font-size: 16px; font-variant-numeric: tabular-nums; }
.visits .dot { color: var(--border); }
.visits .unit { font-size: 12px; }
/* 改版6: 总 token 消耗 —— 复用 .visits pill 样式(黑灰 + SVG 线性图标 + 动态数字, 禁 emoji) */
.token-stats .unit { white-space: nowrap; }

.section { margin-top: 64px; }
.section-title { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.section-title .tag { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); font-weight: 500; }
.section-sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

/* AI 团队 */
.team { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.member { border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-lg); padding: 20px; transition: transform .2s, box-shadow .2s; min-width: 0; /* 3b: grid 子项允许收缩，m-cap nowrap ellipsis 才能真正截断而不是撑破列宽 */ }
.member:hover { transform: translateY(-4px); box-shadow: 0 12px 30px var(--accent-soft); }

/* CEO 单独成一行：横向铺满整行，与下方 4 列员工卡区分 */
.member-ceo { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding: 22px 24px; }
.member-ceo .m-avatar { width: 72px; height: 72px; }
.member-ceo .m-info { min-width: 132px; flex-shrink: 0; }
.member-ceo .m-info .m-name { font-size: 19px; }
.member-ceo .m-info .m-en { margin-bottom: 7px; }
.member-ceo .m-info .m-role { margin-top: 0; }
.member-ceo .m-duty { margin-top: 0; flex: 1 1 220px; min-width: 200px; }
.member-ceo .m-cap { margin-top: 0; border-top: none; padding-top: 0; text-align: right; align-self: center; white-space: normal; }
.member .m-head { display: flex; align-items: center; gap: 12px; }
.member .m-avatar { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.member .m-name { font-size: 15px; font-weight: 700; }
.member .m-en { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); }
.member .m-role { display: inline-block; margin-top: 10px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 600; background: var(--accent-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px 8px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; /* 3b: role 单行截断，防移动端窄卡 role 换行撑高（en 长角色名），8 卡真等高 */ }
.member .m-duty { color: var(--muted); font-size: 13px; margin-top: 10px; line-height: 1.55; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: calc(13px * 1.55 * 2); /* 3b: 固定 2 行等高，超 2 行截断省略号，8 卡 duty 区视觉等高 */ }
.member .m-cap { margin-top: 12px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; /* 3b: cap 单行截断，防止 en 长标签换行撑高卡片，保证 8 卡等高 */ }

/* 机制 */
.mech { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.mech-card { border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-lg); padding: 22px; }
.mech-card h4 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.mech-card h4 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.mech-card .item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.mech-card .item:last-child { border-bottom: none; }
.mech-card .item .k { color: var(--muted); }
.mech-card .item .v { font-weight: 600; text-align: end; }
.mech-card .flow { font-size: 13px; color: var(--muted); line-height: 1.7; }
.mech-card .flow b { color: var(--fg); font-weight: 600; }
.values { display: flex; flex-wrap: wrap; gap: 8px; }
.value { font-size: 12px; color: var(--muted); border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-pill); padding: 6px 14px; }

/* 五大优势 → 对比式（0820-f：传统公司 vs OPC） */
.cmp { border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-lg); overflow: hidden; }
.cmp-head, .cmp-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 44px minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px 20px; }
.cmp-head { border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700; letter-spacing: .05em; }
.cmp-row { border-top: 1px solid var(--border); }
.cmp-row:first-of-type { border-top: 0; }
.cmp-h { color: var(--muted); min-width: 0; word-break: break-word; }
.cmp-h.opc { color: var(--fg); }
.cmp-vs { font-family: ui-monospace, Menlo, monospace; font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.cmp-adv { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; overflow-wrap: break-word; position: relative; padding-inline-start: 24px; }
.cmp-idx { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--muted); position: absolute; inset-inline-start: 0; top: 0; }
.cmp-adv-name { font-size: 14px; font-weight: 700; min-width: 0; overflow-wrap: break-word; }
.cmp-adv-en { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); font-weight: 500; min-width: 0; flex-basis: 100%; overflow-wrap: break-word; }
.cmp-cell { font-size: 13px; line-height: 1.65; color: var(--muted); min-width: 0; word-break: break-word; }
.cmp-cell.opc { color: var(--fg); }
.cmp-tag { display: none; }
.cmp-arrow { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.cmp-arrow svg { width: 18px; height: 18px; stroke: currentColor; }
.cmp-intro { color: var(--muted); font-size: 14px; line-height: 1.75; margin: -12px 0 20px; }
.cmp-outro { margin-top: 22px; font-size: 14px; font-weight: 600; color: var(--fg); }
/* agentic 核心高亮：整条横跨 */
.cmp-row.featured { background: var(--accent); color: var(--bg); border-color: transparent; padding: 18px 20px; }
.cmp-row.featured .cmp-adv-name, .cmp-row.featured .cmp-cell.opc { color: var(--bg); }
.cmp-row.featured .cmp-idx, .cmp-row.featured .cmp-adv-en, .cmp-row.featured .cmp-cell.trad, .cmp-row.featured .cmp-arrow { color: var(--bg); opacity: .55; }

/* 作品 showcase */
.showcase { border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-xl); overflow: hidden; box-shadow: 0 8px 30px var(--accent-soft); transition: transform .25s, box-shadow .25s; }
.showcase:hover { transform: translateY(-4px); box-shadow: 0 16px 44px var(--accent-soft); }
.showcase .sc-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.showcase .sc-title h3 { font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.showcase .sc-title h3 .nm { font-family: ui-monospace, Menlo, monospace; }
.showcase .sc-title .tag { font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--accent-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px 8px; }
.showcase .sc-head .sc-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.showcase .sc-head img { display: block; border-radius: 4px; }
.showcase .sc-body img { width: 100%; display: block; }
.mrd-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px; }
/* 23: mrd-shot 改为可点击按钮（无默认样式）+ 放大镜光标；点图弹 lightbox */
.mrd-shot { position: relative; display: block; width: 100%; border: 0; background: none; padding: 0; font: inherit; text-align: start; cursor: zoom-in; }
.mrd-shot img { width: 100%; display: block; border-radius: var(--radius-md); border: 1px solid var(--border); }
/* 22-2: 截图是 1190×1280 竖屏，用 aspect-ratio 预占高度，防止图片异步加载后高度突变导致滚动位置漂移 */
.mrd-shot img { aspect-ratio: 1190 / 1280; object-fit: cover; }
.mrd-shot .lbl { position: absolute; top: 10px; inset-inline-start: 10px; background: var(--accent); color: var(--bg); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-sm); pointer-events: none; }
/* 23: lightbox —— 全屏遮罩 + 图片 contain 居中放大，遮罩/按钮随主题，点遮罩/Esc/关闭按钮关闭 */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  background: var(--lb-bg); cursor: zoom-out; padding: 20px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw; max-height: 86vh; width: auto; height: auto;
  object-fit: contain; border-radius: var(--radius-md); background: var(--card);
  box-shadow: 0 24px 80px rgba(0,0,0,0.45); cursor: default;
}
.lightbox .lb-close {
  position: absolute; top: 18px; inset-inline-end: 18px;
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  background: var(--lb-btn-bg); color: var(--lb-fg); border: 1px solid var(--lb-border);
  border-radius: 50%; cursor: pointer; transition: background .2s;
}
.lightbox .lb-close svg { width: 18px; height: 18px; stroke: currentColor; }
.lightbox .lb-close:hover { background: var(--lb-btn-hover); }
.showcase .sc-foot { padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.showcase .sc-foot p { color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 600px; }
.split { display: flex; align-items: stretch; }
.split .split-info { flex: 1; padding: 28px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.split .split-info h3 { font-size: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.split .split-info h3 .nm { font-family: ui-monospace, Menlo, monospace; }
.split .split-info .tag { font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--accent-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px 8px; }
.split .split-info p { color: var(--muted); line-height: 1.7; font-size: 15px; }
.split .split-info .links { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.split .split-media { width: 58%; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; gap: 14px; padding: 20px; }
.split .split-media img { border-radius: var(--radius-md); box-shadow: 0 16px 40px var(--accent-soft); }
.split .split-media .port { height: 370px; width: auto; }
.split .split-media .land { height: 370px; width: auto; }
.split .split-info img { display: block; border-radius: 4px; }

footer { margin: 64px 0 40px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; flex-wrap: wrap; gap: 8px; }
footer .mono { color: var(--fg); }
.footer-links { display: inline-flex; align-items: center; gap: 16px; }

/* 合作咨询（改版5）: 黑灰视觉 + SVG 线性图标, 禁 emoji */
/* 改版7: 沟通入口两栏区 —— #assistant(AI 问答, 强调卡片) + #contact(联系表单, 轻量底纹面板) 左右分栏 + 虚线分隔;
   消除「双居中卡片上下叠」的视觉重复; 移动端退回上下堆叠(分隔线转横向)。 */
.contact-split { position: relative; display: grid; grid-template-columns: 1fr 1fr; column-gap: 80px; align-items: stretch; }
/* 0818-d: 虚线画在两栏 gap 正中（::before 绝对定位 left:50%），不贴任何一栏 */
.contact-split::before {
  content: ""; position: absolute; inset-block: 0; left: 50%;
  border-inline-start: 1px dashed var(--border);
}
.contact-split .contact-card { max-width: none; margin-inline: 0; width: 100%; }
/* 左栏: AI 问答 —— 实线卡片 + 阴影, 强调面板 */
.contact-split #assistant .contact-card { box-shadow: 0 10px 34px var(--accent-soft); }
/* 右栏: 联系表单 —— 轻量底纹面板(无边框无阴影), 内容纵向居中与左栏视觉平衡 */
.contact-split #contact {
  display: flex; flex-direction: column; justify-content: center;
}
.contact-split #contact .contact-card { background: var(--accent-soft); border: none; box-shadow: none; }
.contact-card { border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-xl); padding: 28px; }
.contact-form { display: grid; gap: 16px; }
.c-field { display: flex; flex-direction: column; gap: 7px; }
.c-field label { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.c-field label svg { width: 14px; height: 14px; stroke: currentColor; color: var(--muted); flex-shrink: 0; }
.c-field input, .c-field select, .c-field textarea {
  font: inherit; font-size: 14px; color: var(--fg);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 11px 14px; outline: none; transition: border-color .15s, box-shadow .15s; width: 100%;
}
.c-field input:focus, .c-field select:focus, .c-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.c-field textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.c-field select { cursor: pointer; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 36px; }
[dir="rtl"] .c-field select { background-position: 18px 50%, 13px 50%; }
.c-submit { justify-content: center; }
.c-submit:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.c-msg { font-size: 13px; min-height: 20px; display: flex; align-items: center; gap: 7px; margin-top: 2px; }
.c-msg svg { width: 15px; height: 15px; stroke: currentColor; flex-shrink: 0; }
.c-msg.ok { color: var(--fg); font-weight: 600; }
.c-msg.err { color: var(--muted); }
.c-done { opacity: .8; }
/* AI 助理回复框（0818-a P0） */
.a-reply {
  border: 1px solid var(--border); background: var(--bg); border-radius: var(--radius-md);
  padding: 14px 16px; font-size: 14px; line-height: 1.7; white-space: pre-wrap;
  word-break: break-word; color: var(--fg);
}
.a-reply .a-label {
  display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  color: var(--muted); margin-bottom: 6px;
}
.a-reply .a-label svg { width: 13px; height: 13px; stroke: currentColor; }

/* RTL 镜像：代码/编号类内容保持 LTR 显示 */
[dir="rtl"] .mono, [dir="rtl"] .metric .num, [dir="rtl"] .member .m-en, [dir="rtl"] .member .m-role,
[dir="rtl"] .member .m-cap, [dir="rtl"] .cmp-idx, [dir="rtl"] .cmp-adv-en, [dir="rtl"] .cmp-vs,
[dir="rtl"] .showcase .sc-title .tag, [dir="rtl"] .split .split-info .tag, [dir="rtl"] .badge,
[dir="rtl"] .section-title .tag, [dir="rtl"] .mech-card .flow b { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .cmp-arrow svg { transform: scaleX(-1); }

@media (max-width: 860px) {
  .hero h1 { font-size: 32px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .team { grid-template-columns: repeat(2, 1fr); }
  .member-ceo { flex-direction: column; align-items: flex-start; gap: 12px; }
  .member-ceo .m-duty { width: 100%; flex: 1 1 auto; }
  .member-ceo .m-cap { align-self: flex-start; margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; text-align: left; }
  .mech { grid-template-columns: 1fr; }
  .cmp-head { grid-template-columns: 1fr 36px 1fr; }
  .cmp-head .cmp-lbl { display: none; }
  .cmp-row { grid-template-columns: 1fr; gap: 10px; }
  .cmp-adv { flex-wrap: wrap; }
  .cmp-arrow { transform: rotate(90deg); }
  .cmp-cell.trad { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 12px; }
  .cmp-cell.opc { border-inline-start: 2px solid var(--accent); padding-inline-start: 12px; }
  .cmp-tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--muted); margin-inline-end: 8px; letter-spacing: .04em; }
  .cmp-row.featured .cmp-cell.trad { background: transparent; }
  .cmp-row.featured .cmp-cell.opc { border-inline-start-color: var(--bg); }
  .split { flex-direction: column; }
  .split .split-media { width: 100%; }
  /* 改版7: 沟通入口 —— 窄屏两栏退单栏, 竖向分隔线转横向 */
  .contact-split { grid-template-columns: 1fr; column-gap: 0; }
  .contact-split::before { display: none; }
  .contact-split #contact {
    border-top: 1px dashed var(--border);
    padding-top: 32px;
    justify-content: flex-start;
  }
  /* 17a: 触屏可点区域 ≥44px（按钮/链接/菜单项） */
  .btn, .theme-btn, .lang-opt, #langBtn, .gh-link { min-height: 44px; }
  /* 改版5: 表单输入/下拉同守 44px 触控标准 */
  .c-field input, .c-field select { min-height: 44px; }
}
/* 17a: 窄屏(≤520px)移动端适配：header 压缩、Hero 字号、featured 卡纵向、作品图纵向 */
@media (max-width: 520px) {
  header { flex-wrap: wrap; row-gap: 8px; }
  .header-actions { margin-inline-start: auto; gap: 6px; }
  .theme-btn { font-size: 0; width: 44px; padding: 0; justify-content: center; }
  /* 21a: 明暗切换图标真正居中（font-size:0 隐藏文字后 gap 6px 会把图标推偏） */
  #themeBtn { gap: 0; }
  .gh-link { padding: 10px 8px; }
  .gh-link span { display: none; }
  /* 21a: 语言按钮宽度自适应（原 .theme-btn width:44px 误伤，图标+下拉 icon 溢出按钮） */
  #langBtn { width: auto; padding: 0 10px; }
  .lang-cur { display: none; }
  .hero { padding: 40px 0 24px; }
  .hero h1 { font-size: 28px; line-height: 1.3; }
  .hero p { font-size: 15px; }
  .cmp-row.featured { padding: 16px; }
  .split .split-media { flex-direction: column; align-items: center; padding: 18px 14px; gap: 14px; }
  .split .split-media img { height: 300px; width: auto; max-width: 100%; }
  .split .split-media .port { height: 330px; }
  .split .split-media .land { height: 300px; }
  /* 23: 窄屏 4 图保持单行 4 列（minmax(0,1fr) 不溢出），缩 gap/padding + 标签字号 */
  .mrd-grid { gap: 6px; padding: 10px; }
  .mrd-shot .lbl { font-size: 10px; padding: 2px 6px; top: 6px; inset-inline-start: 6px; }
  .lightbox img { max-width: 94vw; max-height: 80vh; }
  /* 改版6: 窄屏 token 卡片随卡片缩小(padding/字号), 避免比 hero-cards 容器宽溢出 */
  .hero-cards .visits { padding: 8px 16px; font-size: 13px; gap: 10px; }
  .hero-cards .visits .v b { font-size: 14px; }
  /* 0820-i18n-5 同批: 窄屏 token pill 允许 unit 换行+内部折行, 防 en/ar 长文案撑破(375px ar 溢出 34px) */
  .hero-cards .visits.token-stats { flex-wrap: wrap; justify-content: center; }
  .hero-cards .visits.token-stats .unit { white-space: normal; word-break: break-word; }
}
/* 悬浮反馈组件（0820-fb-3，复用 0820-fb-2/fb-2b blog 组件视觉规格）：右下球 + mini 独立反馈表单。
   提交走 /api/feedback(page=home, source=home_feedback)，零 LLM；埋点 /api/v1/knock/feedback fire-and-forget；
   全文案 data-i18n 7 语；z-index 900 低于 lightbox 1000；禁 emoji 全 SVG。 */
.fb-ball {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 900; /* 低于页面 lightbox/modal 的 1000 */
  box-shadow: 0 6px 20px var(--accent-soft);
  transition: transform .2s ease, box-shadow .2s ease;
}
[data-theme="dark"] .fb-ball { color: #0a0e14; }
.fb-ball:hover { transform: translateY(-2px); box-shadow: 0 10px 26px var(--accent-soft); }
.fb-ball:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fb-ball svg { width: 20px; height: 20px; }

.fb-panel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  width: 320px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 132px);
  overflow-y: auto;
  z-index: 900;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px var(--accent-soft);
  padding: 18px 18px 14px;
  font-size: 13px;
  color: var(--fg);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.fb-panel.fb-open { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.fb-head { font-size: 14px; font-weight: 700; }
.fb-sub { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 6px 0 12px; }
.fb-ta {
  width: 100%; min-height: 84px; resize: vertical;
  border: 1px solid var(--border); background: var(--bg); color: var(--fg);
  border-radius: var(--radius-md); padding: 9px 12px; font-size: 13px;
  font-family: inherit; line-height: 1.6; outline: none;
  transition: border-color .15s;
}
.fb-ta:focus { border-color: var(--accent); }
.fb-mail {
  width: 100%; margin-top: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--fg);
  border-radius: var(--radius-md); padding: 8px 12px; font-size: 13px; outline: none;
  transition: border-color .15s;
}
.fb-mail:focus { border-color: var(--accent); }
.fb-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.fb-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fb-send {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: var(--bg); border: none;
  border-radius: var(--radius-md); padding: 8px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.fb-send:hover { opacity: .8; }
.fb-send:disabled { opacity: .5; cursor: not-allowed; }
.fb-status { font-size: 12px; margin-top: 10px; color: var(--muted); line-height: 1.5; }
.fb-status.fb-err { color: var(--fg); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .fb-ball, .fb-panel { transition: none; }
}
