/* 沉浸式翻译 bb · 双语工作台 · 译林终端 —— 冷白 + 石墨 + 品牌粉 + 译文青碧,左侧边栏 app 骨架 */

:root {
  --bg: #FAFBFC;
  --bg-soft: #F1F4F7;
  --ink: #1F2933;
  --ink2: #5B6470;
  --ink3: #8A93A0;
  --brand: #EC4C8C;
  --brand2: #C9327A;
  --brand-soft: #FDEAF2;
  --teal: #0EA5A3;
  --teal-soft: #E4F6F5;
  --line: #E3E8EE;
  --line2: #D3DAE2;
  --foot: #1F2933;
  --foot-ink: #9AA3AF;
  --code: #101418;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(31,41,51,.06), 0 8px 28px rgba(31,41,51,.08);
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Code", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ============ 应用外壳:左侧边栏 + 主区 ============ */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 20px 14px;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.brand-name small { display: block; font-weight: 400; font-size: 11px; color: var(--ink3); letter-spacing: 0; }

.side-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.side-group {
  font-size: 11px; color: var(--ink3); letter-spacing: .08em;
  margin: 14px 8px 4px; text-transform: uppercase;
}
.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 14px; color: var(--ink2);
  transition: background .15s, color .15s;
}
.side-link:hover { background: var(--bg-soft); color: var(--ink); }
.side-link.active { background: var(--brand-soft); color: var(--brand2); font-weight: 600; }
.side-link svg { width: 17px; height: 17px; flex: none; }
.side-foot { font-size: 12px; color: var(--ink3); padding: 8px; border-top: 1px solid var(--line); }
.side-foot .ver { display: inline-block; background: var(--teal-soft); color: #0a7f7d; padding: 1px 7px; border-radius: 20px; font-size: 11px; }

.main { display: flex; flex-direction: column; min-width: 0; }

/* 顶部工具条 */
.toolbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 12px 26px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.crumb { font-size: 13px; color: var(--ink3); display: flex; align-items: center; gap: 6px; }
.crumb a { color: var(--ink2); }
.crumb a:hover { color: var(--brand2); }
.crumb .sep { color: var(--line2); }
.toolbar-act { display: flex; align-items: center; gap: 10px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 9px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { background: var(--brand2); }
.btn-ghost { border-color: var(--line2); color: var(--ink2); background: #fff; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand2); }
.btn-lg { padding: 12px 22px; font-size: 15px; }

.content { padding: 34px 26px 60px; max-width: 1080px; width: 100%; margin: 0 auto; }

/* ============ hero:编辑器窗口 ============ */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 34px; align-items: center; padding: 10px 0 34px; }
.hero-copy { display: flex; flex-direction: column; min-width: 0; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: var(--brand2); background: var(--brand-soft);
  padding: 5px 12px; border-radius: 20px; margin-bottom: 16px;
}
.hero-kicker .dotlive { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.hero-title { font-size: 40px; line-height: 1.18; font-weight: 800; letter-spacing: -.5px; }
.hero-title .hl { color: var(--brand); }
.hero-title .hl2 { color: var(--teal); }
.hero-sub { color: var(--ink2); font-size: 16px; margin: 16px 0 24px; max-width: 30em; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { font-size: 12px; color: var(--ink3); margin-top: 14px; }

/* 编辑器窗口 */
.editor-window {
  background: #fff; border: 1px solid var(--line2); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
}
.editor-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px; background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.editor-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.r { background: #FF5F57; } .dot.y { background: #FEBC2E; } .dot.g { background: #28C840; }
.editor-title { margin-left: 10px; font-family: var(--mono); font-size: 12px; color: var(--ink2); }
.editor-body { display: grid; grid-template-columns: 44px 1fr; font-family: var(--mono); font-size: 13.5px; }
.editor-gutter {
  background: var(--bg-soft); color: var(--ink3); text-align: right;
  padding: 12px 9px 12px 0; border-right: 1px solid var(--line); line-height: 2;
  user-select: none; font-size: 12px;
}
.editor-lines { padding: 12px 16px; line-height: 2; }
.editor-line { display: flex; gap: 8px; }
.editor-line .src { color: var(--code); }
.editor-line .dst { color: var(--teal); }
.editor-line .caret {
  width: 2px; height: 18px; background: var(--brand); display: inline-block;
  animation: blink 1s steps(2) infinite; align-self: center;
}
@keyframes blink { 50% { opacity: 0; } }
.editor-tag { font-size: 11px; padding: 1px 7px; border-radius: 5px; background: var(--teal-soft); color: #0a7f7d; margin-right: 8px; }
.editor-foot {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink3); font-family: var(--mono);
}
kbd {
  font-family: var(--mono); font-size: 11px; color: var(--ink2);
  background: #fff; border: 1px solid var(--line2); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px;
}

/* ============ 区块通用 ============ */
.section { padding: 30px 0; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.section-t { font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
.section-t .hl { color: var(--brand); }
.section-more { font-size: 14px; color: var(--brand2); font-weight: 600; }
.section-more:hover { text-decoration: underline; }
.section-d { color: var(--ink2); font-size: 14px; }

/* 工作台网格 */
.workbench { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.bench-item {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; transition: transform .15s, box-shadow .15s;
}
.bench-item:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.bench-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; margin-bottom: 14px;
}
.bench-icon svg { width: 20px; height: 20px; }
.bench-icon.pink { background: var(--brand-soft); color: var(--brand2); }
.bench-icon.teal { background: var(--teal-soft); color: #0a7f7d; }
.bench-icon.ink { background: var(--bg-soft); color: var(--ink); }
.bench-t { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.bench-d { font-size: 14px; color: var(--ink2); }

/* 语言覆盖条 */
.langstrip { display: flex; flex-wrap: wrap; gap: 10px; }
.lang-item {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 30px;
  padding: 7px 14px; font-size: 13px; color: var(--ink2);
}
.lang-code { font-family: var(--mono); font-weight: 700; color: var(--brand2); font-size: 12px; }

/* 流程 */
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.flow-step { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; }
.flow-num {
  font-family: var(--mono); font-weight: 800; font-size: 30px; color: var(--brand);
  line-height: 1; margin-bottom: 12px;
}
.flow-num::before { counter-increment: step; content: counter(step, decimal-leading-zero); }
.flow-t { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.flow-d { font-size: 14px; color: var(--ink2); }

/* 面板 */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-h { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 9px; }
.panel-h svg { width: 18px; height: 18px; color: var(--brand); }
.panel-b { padding: 20px; }

/* 卡片 */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-img { aspect-ratio: 16/10; object-fit: cover; }
.card-b { padding: 16px 18px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-t { font-size: 15px; font-weight: 700; }
.card-d { font-size: 13.5px; color: var(--ink2); flex: 1; }
.card-more { font-size: 13px; font-weight: 600; color: var(--brand2); }

/* 左右图文 */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: center; }
.split.rev .split-txt { order: 2; }
.split-img { border-radius: var(--radius); aspect-ratio: 16/10; object-fit: cover; border: 1px solid var(--line); }
.split-txt h3 { font-size: 21px; font-weight: 800; margin-bottom: 12px; }
.split-txt p { color: var(--ink2); font-size: 14.5px; margin-bottom: 10px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: var(--bg-soft); font-size: 12.5px; color: var(--ink2); letter-spacing: .03em; }
.table td:first-child { font-weight: 600; color: var(--ink); }
.table .yes { color: #0a7f7d; font-weight: 600; }
.table .no { color: var(--ink3); }

/* 提示框 */
.tip, .callout { border-radius: 10px; padding: 14px 16px; font-size: 14px; margin: 14px 0; display: flex; gap: 10px; }
.tip { background: var(--teal-soft); color: #0b5c5a; }
.callout { background: var(--brand-soft); color: #8c1d51; }
.tip svg, .callout svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }

/* FAQ 折叠 */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 16px 20px; font-size: 15px; font-weight: 600; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; font-family: inherit;
}
.faq-q .ico { color: var(--brand); transition: transform .2s; flex: none; }
.faq-item.open .faq-q .ico { transform: rotate(45deg); }
.faq-a { display: none; padding: 0 20px 18px; color: var(--ink2); font-size: 14px; }
.faq-item.open .faq-a { display: block; }

/* 相关卡片 */
.related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.related-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fff; transition: border-color .15s; }
.related-card:hover { border-color: var(--brand); }
.related-card .rt { font-size: 14px; font-weight: 600; }
.related-card .rc { font-size: 12px; color: var(--ink3); margin-top: 3px; }

/* ============ 文章页:双栏 + 粘性目录 ============ */
.article-grid { display: grid; grid-template-columns: 220px 1fr; gap: 36px; align-items: start; }
.toc-nav { position: sticky; top: 76px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.toc-nav .toc-t { font-size: 12px; font-weight: 700; color: var(--ink3); letter-spacing: .05em; margin-bottom: 8px; }
.toc-link { color: var(--ink2); padding: 5px 10px; border-left: 2px solid var(--line); }
.toc-link:hover { color: var(--brand2); border-left-color: var(--brand); }

.article { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 40px; }
.article-meta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--ink3); margin: 14px 0 22px; }
.article-meta .badge { background: var(--brand-soft); color: var(--brand2); padding: 2px 10px; border-radius: 20px; font-weight: 600; }
.article h1 { font-size: 30px; font-weight: 800; letter-spacing: -.4px; line-height: 1.25; }
.article .lead { font-size: 16px; color: var(--ink2); border-left: 3px solid var(--brand); padding-left: 14px; margin: 18px 0 8px; }
.article h2 { font-size: 21px; font-weight: 800; margin: 30px 0 12px; padding-top: 8px; }
.article h2 .num { color: var(--brand); font-family: var(--mono); font-size: 18px; margin-right: 8px; }
.article p { color: var(--ink2); font-size: 15px; margin-bottom: 14px; }
.article ul, .article ol { margin: 0 0 16px 22px; color: var(--ink2); font-size: 15px; }
.article li { margin-bottom: 6px; }
.article strong { color: var(--ink); }
.article a { color: var(--brand2); }
.article a:hover { text-decoration: underline; }
.article img.inline { border-radius: 10px; margin: 18px 0; border: 1px solid var(--line); width: 100%; }
.author { display: flex; align-items: center; gap: 10px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink3); }
.author .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand2); display: grid; place-items: center; font-weight: 700; }

/* 下载平台页 */
.plat-hero { display: flex; gap: 26px; align-items: center; padding: 8px 0 30px; }
.plat-icon { width: 84px; height: 84px; border-radius: 20px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); flex: none; }
.plat-icon svg { width: 42px; height: 42px; }
.plat-title { font-size: 30px; font-weight: 800; letter-spacing: -.4px; }
.plat-sub { color: var(--ink2); font-size: 15px; margin-top: 6px; }
.spec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.spec-item { background: var(--bg-soft); border-radius: 10px; padding: 12px 14px; }
.spec-item .k { font-size: 12px; color: var(--ink3); }
.spec-item .v { font-size: 14px; font-weight: 600; margin-top: 2px; }

/* 页脚 */
.site-foot { background: var(--foot); color: var(--foot-ink); padding: 30px 26px; margin-top: 40px; }
.site-foot .inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.site-foot .brand-row { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 700; }
.site-foot .brand-row img { width: 20px; height: 20px; border-radius: 5px; }
.site-foot .links { display: flex; gap: 18px; font-size: 13px; }
.site-foot .links a:hover { color: #fff; }
.site-foot .copy { font-size: 13px; }

/* 返回顶部 */
.backtop {
  position: fixed; right: 22px; bottom: 22px; z-index: 50;
  width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line2);
  background: #fff; color: var(--brand2); font-size: 18px; cursor: pointer;
  display: none; box-shadow: var(--shadow);
}
.backtop:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* 移动端 */
.menu-btn { display: none; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s; width: 248px; }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-flex; }
  .hero, .split, .article-grid { grid-template-columns: 1fr; }
  .workbench, .cards, .flow, .related { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 24px 18px 44px; }
  .article { padding: 24px 20px; }
  .toc-nav { display: none; }
}
@media (max-width: 600px) {
  .workbench, .cards, .flow, .related, .spec-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 30px; }
  .toolbar { padding: 10px 16px; }
}
