/* 店主后台（期 6a）。上半截照抄 docs/design/期6_样稿/console.html 的样式（值一个不改；6a 没有接手，回复框那几条没带）；
   “样稿之外”以下是样稿没画的：登录页、对话页、规则页、提示行、空状态，用同一套 tokens。 */
body { background: var(--paper); }
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr) 460px; height: 100vh; }
.dot.me { background: var(--ink); }
@keyframes enter { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
.swap { animation: enter var(--base) var(--ease-out) both; }

/* ---------- 左栏：安静的导航 ---------- */
.side { background: var(--mist); padding: 24px 14px; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; font: 600 17px/1 var(--font); letter-spacing: -0.01em; padding: 4px 10px 22px; }
/* 顾客报回执号、订单号，这里直接搜 */
.search { width: 100%; height: 34px; margin: 0 0 16px; border: 0; border-radius: 9px; padding: 0 10px 0 32px; font: var(--t-13); color: var(--ink);
  background: rgba(0,0,0,0.05) url("data:image/svg+xml,%3Csvg xmlns='http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='4.6' fill='none' stroke='%236e6e73' stroke-width='1.6'/%3E%3Cpath d='M10.4 10.4 14 14' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") 11px center / 14px no-repeat;
  transition: background-color var(--fast) var(--ease-out), box-shadow var(--fast) var(--ease-out); }
.search::placeholder { color: var(--ink-2); }
.search:focus { background-color: var(--paper); box-shadow: 0 0 0 1px var(--rule), 0 1px 3px rgba(0,0,0,0.06); }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: 15px; }
.nav:hover { color: var(--ink); }
.nav[aria-current="page"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.nav .n { font-size: 13px; color: var(--human); font-weight: 600; }
.nav .n:empty { display: none; }
.side .me { margin-top: auto; padding: 9px 12px; color: var(--ink-2); font-size: 13px; }

/* ---------- 中栏：现在要你做什么 ---------- */
.main { overflow-y: auto; padding: 64px 56px 48px; }
.lead { font: var(--t-34); letter-spacing: -0.02em; margin: 0 0 12px; max-width: 18em; }
.sub { font: var(--t-17); color: var(--ink-2); margin: 0 0 48px; max-width: 34em; }
.group { margin-bottom: 40px; }
.group h2 { font: 600 15px/1 var(--font); margin: 0 0 6px; padding: 0 16px; display: flex; justify-content: space-between; gap: 16px; }
.group h2 span { font-weight: 400; color: var(--ink-2); font-size: 13px; }
.q { display: grid; grid-template-columns: 14px 88px 1fr auto; gap: 14px; align-items: baseline; width: 100%; text-align: left;
  border: 0; background: none; padding: 16px; border-radius: 12px; cursor: pointer; transition: background var(--fast) var(--ease-out); }
.q:hover { background: #fafafa; }
.q[aria-selected="true"] { background: var(--mist); }
.q .dot { transform: translateY(-1px); }
.q .who { font: 600 17px/1.3 var(--font); }
.q .why { font: var(--t-15); color: var(--ink); }
.q .why small { display: block; color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.q .when { font: var(--t-13); color: var(--ink-2); white-space: nowrap; }
.q + .q { box-shadow: inset 0 1px 0 var(--rule); border-radius: 0; }
.q[aria-selected="true"], .q[aria-selected="true"] + .q { box-shadow: none; border-radius: 12px; }

/* ---------- 右栏：这段对话的处理经过 ---------- */
.detail { border-left: 1px solid var(--rule); overflow-y: auto; padding: 56px 40px 40px; }
.detail header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.detail h3 { font: var(--t-24); letter-spacing: -0.02em; margin: 0 0 4px; }
.detail .ord { color: var(--ink-2); font-size: 15px; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); padding-top: 6px; white-space: nowrap; }
.actions { display: flex; align-items: center; gap: 6px; margin-bottom: 36px; }
.btn-quiet { appearance: none; border: 0; cursor: pointer; height: 44px; padding: 0 20px; border-radius: 12px; background: var(--mist); color: var(--ink);
  font-weight: 600; font-size: 15px; transition: background var(--fast) var(--ease-out); }
.btn-quiet:hover { background: #ececf0; }
.h4 { font: 600 15px/1 var(--font); margin: 0 0 18px; }
.tl { list-style: none; margin: 0 0 28px; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 3.5px; top: 10px; bottom: 14px; width: 1px; background: var(--rule); }
.tl li { display: grid; grid-template-columns: 8px 1fr; gap: 16px; padding-bottom: 20px; position: relative; }
.tl .dot { margin-top: 7px; box-shadow: 0 0 0 4px var(--paper); }
.tl time { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 2px; }
.tl p { margin: 0; font: var(--t-15); }
.tl p em { font-style: normal; color: var(--ink-2); }
/* 顾客当时看到的那张确认卡，原样缩小放在时间线里 */
.cardlet { margin-top: 10px; border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px 4px; }
.cardlet b { display: block; font: 600 13px/1.4 var(--font); margin-bottom: 6px; }
.cardlet dl { display: grid; grid-template-columns: 52px 1fr; margin: 0; font-size: 13px; }
.cardlet dt, .cardlet dd { padding: 6px 0; border-top: 1px solid var(--rule); }
.cardlet dt { color: var(--ink-2); }
.cardlet dd { margin: 0; }
.cardlet .was { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.cardlet .cap { display: block; padding: 8px 0 6px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--ink-2); }
.tech { border-top: 1px solid var(--rule); padding-top: 14px; }
.tech summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-2); }
.tech summary::-webkit-details-marker { display: none; }
.tech summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform var(--fast) var(--ease-out); }
.tech[open] summary::before { transform: rotate(45deg); }
.tech dl { display: grid; grid-template-columns: 96px 1fr; gap: 10px 14px; margin: 16px 0 0; font-size: 13px; }
.tech dt { color: var(--ink-2); }
.tech dd { margin: 0; color: var(--ink); word-break: break-all; }

/* 看完整对话：右栏变成原话 */
.msgs { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.m { max-width: 88%; font: var(--t-15); }
.m.cust { background: var(--mist); padding: 10px 14px; border-radius: 18px 18px 18px 6px; align-self: flex-start; }
.m.ai { color: var(--ink-2); }
/* AI 那一行前面的字（中文“AI：”、英文“AI: ”）在字典里（aiLabel，任务 17）：console.js 把它设在这一行的 data-ai-label 上 */
.m.ai::before { content: attr(data-ai-label); }
.m.sys { align-self: center; max-width: none; display: flex; align-items: center; gap: 8px; font: var(--t-13); color: var(--ink-2); padding: 2px 0; }

/* 窄屏：右栏变成从右边滑出的抽屉，点哪一行就拉出哪一段 */
.shut { display: none; position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: none;
  color: var(--ink-2); place-items: center; cursor: pointer; }
.shut:hover { background: var(--mist); color: var(--ink); }
.veil { display: none; }
@media (max-width: 1180px) {
  .app { grid-template-columns: 200px minmax(0, 1fr); }
  .detail { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--paper); z-index: 10; border-left: 0;
    box-shadow: -24px 0 64px rgba(0,0,0,0.12); transform: translateX(104%); visibility: hidden;
    transition: transform var(--base) var(--ease-spring), visibility 0s linear var(--base); }
  .app.open .detail { transform: none; visibility: visible; transition: transform var(--base) var(--ease-spring); }
  .shut { display: grid; }
  .veil { display: block; position: fixed; inset: 0; z-index: 9; background: rgba(29,29,31,0.12); opacity: 0; pointer-events: none;
    transition: opacity var(--fast) var(--ease-out); }
  .app.open .veil { opacity: 1; pointer-events: auto; }
}
@media (max-width: 720px) { .app { grid-template-columns: minmax(0, 1fr); } .main { padding: 32px 20px; } .lead { font-size: 28px; } .detail { padding: 56px 24px 32px; } }

/* ================= 样稿之外（同一套语言） ================= */
[hidden] { display: none !important; }

/* 句子按分句排（裁定 R24）：一个分句不拆行，换行只落在中文标点后面 */
.ph { white-space: nowrap; }
/* 只在放得下 20 个字的地方不换行，别处放开（不然会把页面撑出横向滚动）。中栏的宽度不是越宽越大：
   721–1180px 左栏 200px、没有右栏；1181px 起右栏占 460px，中栏反而变窄。每处按“字号 × 20 + 这一行别的列”算出两段 */
@media (max-width: 991px), (min-width: 1181px) and (max-width: 1483px) { .lead .ph { white-space: normal; } }
@media (max-width: 899px), (min-width: 1181px) and (max-width: 1389px) { .q .ph { white-space: normal; } }
@media (max-width: 859px), (min-width: 1181px) and (max-width: 1349px) { .rules .ph { white-space: normal; } }
@media (max-width: 720px) { .sub .ph { white-space: normal; } }
@media (max-width: 720px) { .banner .ph { white-space: normal; } }
/* 抽屉里 15px × 20 = 300px：375 宽的手机正好放得下（375 − 48 − 24 = 303），再窄就放开 */
@media (max-width: 374px) { .ph { white-space: normal; } }

/* 顾客、模型、店员的字里可能有一长串不带空格的东西（商品链接、英文名）：放不下就在哪儿都能折，不把右栏、中栏撑出横向滚动。
   网格里装这些字的那一格要 min-width: 0——1fr 的下限是 min-content，不设就被最长的那一串撑开（终审 I1） */
.tl li > div, .cardlet dd, .q .why, .detail header > div, #me { min-width: 0; }
.tl p, .m, .cardlet dd, .cardlet b, .detail h3, .detail .ord, .q .who, .q .why, .tech dd, .note, .pane-note, .rules .text, #me { overflow-wrap: anywhere; }

/* 窄于 720px（裁定 R33）：顶上一条细栏（店标 + “菜单”），左栏从左边滑出来当抽屉——搜索、四个导航、退出在手机上都够得着。
   动法、遮罩、阴影同右边那个抽屉；宽屏不显示细栏和左栏里的“关上” */
.bar, .side-shut { display: none; }
@media (max-width: 720px) { .app { grid-template-rows: auto minmax(0, 1fr); } .bar { display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 8px 0 20px; box-shadow: inset 0 -1px 0 var(--rule); } .bar .brand { padding: 0; } }
@media (max-width: 720px) { .side { position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); z-index: 12; overflow-y: auto; box-shadow: 24px 0 64px rgba(0,0,0,0.12); transform: translateX(-104%); visibility: hidden; transition: transform var(--base) var(--ease-spring), visibility 0s linear var(--base); } .app.menu .side { transform: none; visibility: visible; transition: transform var(--base) var(--ease-spring); } .app.menu .veil { opacity: 1; pointer-events: auto; } }
@media (max-width: 720px) { .side-shut { display: grid; position: absolute; top: 10px; right: 10px; border-radius: 50%; border: 0; background: none; color: var(--ink-2); place-items: center; cursor: pointer; } .side-shut:hover { background: rgba(0,0,0,0.05); color: var(--ink); } }
/* 窄屏、或者手指点的屏：能点的东西至少 44 × 44（终审 M7）；细指针的宽屏照样稿的密度 */
@media (max-width: 720px), (pointer: coarse) { .shut, .side-shut { width: 44px; height: 44px; top: 10px; right: 10px; } .nav { min-height: 44px; } .search { height: 44px; } .side .me .out { min-width: 44px; min-height: 44px; } .menu-btn { min-width: 44px; min-height: 44px; } .btn-text { min-height: 44px; } }

/* 语言切换（甲 3 任务 8）：一个链接，写的是另一种语言的名字；登录卡里、窄屏的细栏里、左栏底部各一个 */
.lang { text-decoration: none; display: inline-flex; align-items: center; }
.login-card .lang { align-self: center; margin-top: 8px; }
.side .lang { margin-top: auto; align-self: flex-start; font-size: 13px; padding: 8px 12px; }
.side .lang + .me { margin-top: 0; }
.bar .lang { font-size: 14px; }
/* 三门以上时切换是个菜单（.langs，样子在 tokens.css；任务 17）：占原来那个链接的位置，按钮还是那个链接的样子。左栏底部的往上开（下面没地方了） */
.login-card .langs { align-self: center; margin-top: 8px; }
.side .langs { margin-top: auto; align-self: flex-start; }
.langs > .lang { margin: 0; align-self: auto; }
.side .langs + .me { margin-top: 0; }
.side .langs-list { top: auto; bottom: calc(100% + 4px); left: 0; right: auto; }

/* 左栏底部：名字 + 退出（回放模式没有退出） */
.side .me { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; }
.side .me .out { font-size: 13px; padding: 8px 10px; margin: -8px -10px -8px 0; }

/* 中栏顶上的一行提示：连不上、服务出错时出，数据留着上一次的 */
.alert { font: var(--t-13); color: var(--stop); margin: -32px 0 14px; min-height: 18px; }
.alert:empty { visibility: hidden; }
/* 首屏的预算提示条（乙 3 任务 5，设计 7.1）：统计行下面一条 mist 底的条，前面一个圆点：到顶红，提醒线、盲琥珀（data-level）。不顶掉标题行。
   没字时收成 0 高（不用 hidden：role="status" 要一直在无障碍树里）；有字时和统计行隔 24px（统计行的 48px 和这里的 −24px 叠在一起）。
   圆点对齐第一行的中线：上内边距 + 半个行高（--t-15 的行高 1.55）− 半个点 */
.banner { margin: 0; position: relative; max-width: 46em; font: var(--t-15); color: var(--ink); }
.banner:not(:empty) { margin: -24px 0 40px; padding: 12px 16px 12px 34px; border-radius: 12px; background: var(--mist); }
.banner:not(:empty)::before { content: ""; position: absolute; left: 16px; top: calc(12px + 0.775em - 4px); width: 8px; height: 8px; border-radius: 50%;
  background: var(--human); }
.banner[data-level="exhausted"]::before { background: var(--stop); }
.q .when.late { color: var(--stop); }
.q .why small:empty { display: none; }
.note { font: var(--t-15); color: var(--ink-2); margin: 0; padding: 0 16px; }
.note + .group, .group + .note { margin-top: 28px; }
.more { margin: 16px 0 0 16px; }

/* 规则页：一条一行，右边是最近 7 天的数 */
.rules { list-style: none; margin: 0; padding: 0; max-width: 46em; }
.rules li { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: baseline; padding: 18px 16px; }
.rules li + li { box-shadow: inset 0 1px 0 var(--rule); }
.rules .text { font: var(--t-17); }
.rules .count { font: var(--t-13); color: var(--ink-2); white-space: nowrap; }

/* 右栏：还没选对话时、读不到时；点了另一段、新的还没到时先变淡（终审 M3） */
#pane { transition: opacity var(--fast) var(--ease-out); }
#pane[aria-busy="true"] { opacity: 0.3; }
.pane-note { font: var(--t-15); color: var(--ink-2); margin: 8px 0 0; }
.pane-note.bad { color: var(--stop); font-size: 13px; }
.msgs + .btn-text { margin-left: -12px; }

/* 登录：mist 底，正中一张白卡 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--mist); }
.login-card { width: 360px; max-width: 100%; background: var(--paper); border-radius: 22px; padding: 36px 32px 32px; display: flex; flex-direction: column; }
.login-card .brand { padding: 0 0 18px; }
.login-title { font: var(--t-24); letter-spacing: -0.02em; margin: 0 0 26px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font: var(--t-13); color: var(--ink-2); margin-bottom: 6px; }
.field input { width: 100%; height: 44px; border: 0; border-radius: 12px; background: var(--mist); padding: 0 14px; font: var(--t-15); color: var(--ink);
  transition: box-shadow var(--fast) var(--ease-out); }
.field input:focus { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.login-error { font: var(--t-13); color: var(--stop); margin: 0; min-height: 19px; }
.login-card .btn-primary { margin-top: 12px; width: 100%; }
.login-card .btn-primary:disabled { opacity: 0.45; cursor: default; }

@media (max-width: 720px) { .alert { margin-top: -12px; } .rules li { grid-template-columns: 1fr; gap: 4px; } .q { grid-template-columns: 14px 72px 1fr auto; gap: 10px; padding: 14px 8px; } .group h2, .note { padding: 0 8px; } }

/* ---------- 接入页（期 6b，设计 5.5；样稿没画，同一套 tokens）：六段，每段一个 20px 的标题、一句说明。
   标题和正文跟页首的“接入”左对齐（这一页没有会变底色的行，不留那 16px） ---------- */
.integ { max-width: 46em; }
.integ section { margin-bottom: 44px; }
.integ h2 { font: var(--t-20); letter-spacing: -0.01em; margin: 0 0 6px; }
.integ p { font: var(--t-15); color: var(--ink-2); margin: 0 0 14px; overflow-wrap: anywhere; }
.integ p.state { color: var(--ink); margin-bottom: 4px; }
/* sub 那一句是这一页唯一的安全要求：正文色 */
.integ p.must { color: var(--ink); margin-bottom: 0; }
/* 代码块：等宽（它是代码，不是界面文字）；放不下自己横向滚，页面不滚 */
.code { margin: 0 0 12px; padding: 14px 16px; border-radius: 12px; background: var(--mist); color: var(--ink); overflow-x: auto; white-space: pre;
  tab-size: 4; font: 13px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-feature-settings: normal; }
/* 复制：文字按钮，字和代码块的左边对齐；点按区域 44px */
.integ .copy { min-height: 44px; margin: -6px 0 0 -12px; color: var(--ink); font-weight: 600; }
.origins { list-style: none; margin: 0; padding: 0; }
.origins li { padding: 10px 0; font: var(--t-15); overflow-wrap: anywhere; }
.origins li + li { box-shadow: inset 0 1px 0 var(--rule); }
.paste { display: block; width: 100%; min-height: 112px; margin: 0 0 12px; border: 0; border-radius: 12px; background: var(--mist); padding: 12px 14px;
  color: var(--ink); resize: vertical; overflow-wrap: anywhere; font: 13px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  transition: box-shadow var(--fast) var(--ease-out); }
.paste:focus { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.integ .btn-primary { height: 44px; font-size: 15px; padding: 0 22px; }
.integ .btn-primary:disabled { opacity: 0.45; cursor: default; }
/* 结论：圆点一格、字一格——折行悬挂在字下面 */
.integ p.verdict { display: flex; align-items: baseline; gap: 8px; color: var(--ink); margin: 14px 0 0; min-height: 23px; }
.verdict .dot { transform: translateY(-1px); }
.verdict span:last-child { min-width: 0; }
/* 手机上一行放不下“圆点 + 20 个字”：分句放开（同 .sub） */
@media (max-width: 720px) { .integ .ph { white-space: normal; } }

/* 只给读屏听的字（“已复制”）：看不见，不占地方 */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* 规则、接入没取到时页面里那一句 */
.miss { font: var(--t-15); color: var(--ink-2); margin: 0; }

/* 规则、接入两页没有“这段对话”可看（裁定 R17-6b）：宽屏收起右栏，宽度给中栏。窄屏右栏本来就是抽屉，不动 */
@media (min-width: 1181px) { .app.solo { grid-template-columns: 232px minmax(0, 1fr); } .app.solo .detail { display: none; } }

/* ================= 英文那面（甲 3 任务 10）=================
   只管拉丁字母的后台（<html data-script="latin">，任务 17 起按文字系统）；中文那面上面的规则不动（代码块右边的渐隐除外：两种语言都有，见下）。 */
html[data-script="latin"] .brand .mark.wordmark { --wordmark: 28px; }
html[data-script="latin"] .side .brand { padding-bottom: 18px; }
html[data-script="latin"] .bar .brand .mark.wordmark { --wordmark: 26px; }
html[data-script="latin"] .login-card .brand .mark.wordmark { --wordmark: 34px; }
html[data-script="latin"] .lead { letter-spacing: -0.024em; text-wrap: balance; }
html[data-script="latin"] .sub { max-width: 36em; }
/* “Customer said:”后面跟的原话：英文的冒号后面要空一格（字典里句尾的空格渲染时没了），中文的全角冒号自己带着空 */
html[data-script="latin"] .tl p em { margin-left: 0.3em; }
/* 时间线里缩小的确认卡：英文的行名长（“Current address”），左列跟着最长的那个走，不折行 */
html[data-script="latin"] .cardlet dl { grid-template-columns: minmax(52px, max-content) 1fr; }
html[data-script="latin"] .cardlet dt { padding-right: 14px; white-space: nowrap; }
/* 480 以下：一行拆成两层——上面名字和时间，下面整行宽的那句话（英文句子长，挤在第三列里会一个词一行） */
@media (max-width: 480px) {
  html[data-script="latin"] .q { grid-template-columns: 14px minmax(0, 1fr) auto; row-gap: 3px; }
  html[data-script="latin"] .q .why { grid-column: 2 / -1; grid-row: 2; }
  html[data-script="latin"] .group h2 { flex-direction: column; gap: 6px; margin-bottom: 8px; }
  html[data-script="latin"] .group h2 span { line-height: 1.35; }
}
/* 代码块放不下时自己横向滚：窄屏上右边 28px 渐隐，告诉人“后面还有”（同店铺页的场景栏）；滚到头时最后几个字不在渐隐里 */
@media (max-width: 720px) {
  .code { padding-right: 28px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
}
