/* =============================================================
   标书智能排版 · 对话版 —— 样式表（M5 优化版）
   暖色纸张风为底，精致度/布局向 SanjuStyle 看齐。
   新增段落用「=== xxx ===」banner 圈出，便于交接对照。
   ============================================================= */

:root {
  --bg:        #efeae1;
  --panel:     #f6f2ea;
  --paper:     #fbf9f4;
  --card:      #ffffff;
  --ink:       #2b2722;
  --ink-soft:  #5b5347;
  --muted:     #8a8175;
  --muted-2:   #a89f8d;
  --line:      #e6ddcd;
  --line-2:    #e2dccf;
  --line-3:    #efe8da;
  --accent:    #bf5a36;
  --accent-d:  #a64a2a;
  --accent-soft:#f6e7df;
  --ok:        #3f7a52;

  --r-sm: 8px; --r-md: 11px; --r-lg: 16px; --r-xl: 20px;
  --sh-pop:  0 2px 10px rgba(60,50,30,.10);
  --sh-card: 0 12px 34px rgba(60,50,30,.12);
  --sh-page: 0 18px 48px rgba(60,50,30,.16);

  --serif: 'Noto Serif SC', serif;
  --sans:  'Noto Sans SC', system-ui, -apple-system, 'PingFang SC', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
.is-hidden { display: none !important; }
[hidden] { display: none !important; }

/* 登录门禁 */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: #faf8f3;
}
.login__panel {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--sh-card);
  padding: 34px 34px 30px;
}
.login__mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 21px;
  margin-bottom: 22px;
}
.login__title {
  margin: 0 0 26px;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.25;
}
.login__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login__field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}
.login__field input {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  padding: 12px 13px;
  outline: 0;
}
.login__field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(191,90,54,.16);
}
.login__submit {
  margin-top: 4px;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  padding: 13px 16px;
  box-shadow: 0 8px 18px rgba(191,90,54,.24);
}
.login__submit:hover { background: var(--accent-d); }
.login__submit:disabled { opacity: .62; }
.login__error {
  min-height: 20px;
  color: #b53a2f;
  font-size: 12.5px;
  line-height: 1.6;
}

/* 通用按钮 */
.btn-primary {
  border: 0; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px;
  padding: 12px 22px; border-radius: var(--r-md); cursor: pointer; box-shadow: 0 6px 16px rgba(191,90,54,.24);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}
.btn-primary:hover { background: var(--accent-d); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(191,90,54,.28); }
.btn-ghost {
  border: 1px solid var(--line-2); background: #fff; color: var(--ink-soft); font-weight: 700; font-size: 13.5px;
  padding: 12px 20px; border-radius: var(--r-md); cursor: pointer; transition: border-color .14s ease, background .14s ease;
}
.btn-ghost:hover { border-color: #d8cdba; background: var(--paper); }
.btn-outline {
  border: 1px solid rgba(191,90,54,.32); background: #fff8f1; color: var(--accent-d); font-weight: 800; font-size: 13.5px;
  padding: 10px 16px; border-radius: var(--r-md); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  box-shadow: 0 4px 12px rgba(117,72,44,.08); transition: border-color .14s ease, background .14s ease, transform .14s ease, box-shadow .14s ease;
}
.btn-outline:hover { border-color: rgba(191,90,54,.52); background: #fff0e4; transform: translateY(-1px); box-shadow: 0 8px 18px rgba(117,72,44,.12); }

/* =============================================================
   主界面
   ============================================================= */
.home { min-height: 100vh; background: #faf8f3; overflow: auto; }
.home__top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 40px; background: rgba(250,248,243,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand__mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 700; font-size: 18px; flex: none; }
.brand__name { font-family: var(--serif); font-size: 17px; font-weight: 700; }
.brand__sub { color: var(--muted-2); font-size: 12px; margin-top: 2px; }
.home__tagline { font-size: 12.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 7px 14px; border-radius: 999px; }

.home__main { max-width: 1180px; margin: 0 auto; padding: 56px 32px 80px; }
.start-panel { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 48px; align-items: center; padding-bottom: 64px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.start-panel__eyebrow { color: var(--accent); font-size: 12.5px; font-weight: 800; letter-spacing: .08em; margin-bottom: 16px; }
.start-panel__title { font-family: var(--serif); font-size: 40px; line-height: 1.28; margin: 0 0 18px; font-weight: 700; }
.start-panel__desc { max-width: 540px; margin: 0 0 28px; color: var(--ink-soft); font-size: 15px; line-height: 1.85; }
.start-panel__cta { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 10px; border: 0; background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; padding: 16px 28px; border-radius: 14px; cursor: pointer; box-shadow: 0 10px 26px rgba(191,90,54,.26); transition: transform .24s cubic-bezier(.2,.85,.25,1), box-shadow .24s cubic-bezier(.2,.85,.25,1), background .18s ease; }
.start-panel__cta::after { content: ""; position: absolute; top: 0; bottom: 0; left: -65%; width: 48%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.38), transparent); transform: skewX(-18deg); opacity: 0; pointer-events: none; }
.start-panel__cta:hover { background: var(--accent-d); transform: translateY(-2px); box-shadow: 0 18px 38px rgba(191,90,54,.34); }
.start-panel__cta:hover::after { animation: ctaSheen .72s cubic-bezier(.2,.8,.2,1); }
@keyframes ctaSheen { 0% { left: -65%; opacity: 0; } 14% { opacity: 1; } 100% { left: 125%; opacity: 0; } }
.start-panel__cta:active { transform: translateY(0) scale(.984); box-shadow: 0 7px 16px rgba(191,90,54,.28); transition-duration: .07s; }
.start-panel__cta:focus-visible { outline: 3px solid rgba(191,90,54,.4); outline-offset: 3px; }
.start-panel__cta-plus { font-size: 20px; line-height: 1; transition: transform .32s cubic-bezier(.2,.85,.25,1); }
.start-panel__cta:hover .start-panel__cta-plus { transform: translateY(-2px) scale(1.16); }
@media (prefers-reduced-motion: reduce) { .start-panel__cta, .start-panel__cta-plus { transition: background .18s ease; } .start-panel__cta:hover { transform: none; } .start-panel__cta:hover::after { animation: none; } .start-panel__cta:hover .start-panel__cta-plus { transform: scale(1.12); } }
.start-panel__note { margin-top: 14px; font-size: 12.5px; color: var(--muted-2); }
#file-input { display: none; }

/* 主界面装饰：叠放的纸样 */
.start-panel__art { position: relative; height: 260px; }
.art-doc { position: absolute; border-radius: 10px; background: #fff; box-shadow: var(--sh-card); }
.art-doc--back  { inset: 30px 40px 30px 0; transform: rotate(-6deg); background: #f3eee4; }
.art-doc--mid   { inset: 16px 20px 16px 16px; transform: rotate(3deg); background: #f8f4ec; }
.art-doc--front { inset: 0 0 0 36px; padding: 22px; display: flex; flex-direction: column; gap: 9px; }
.art-doc__head { height: 34px; border-radius: 7px; background: linear-gradient(118deg,#1A3C6E,#3F6699); margin-bottom: 6px; }
.art-doc__line { height: 7px; border-radius: 4px; background: #e7e1d5; }
.art-doc__line--accent { width: 52%; height: 9px; background: var(--accent); }
.art-doc__line--short { width: 76%; }
.art-doc__callout { height: 38px; border-radius: 0 7px 7px 0; border-left: 4px solid #1A3C6E; background: #f4f7fb; margin: 6px 0; }

.projects { padding-top: 44px; }
.projects__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.projects__title { font-family: var(--serif); font-size: 22px; margin: 0; }
.projects__count { color: var(--muted-2); font-size: 13px; margin-top: 5px; }
.projects__tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #e7e1d5; border-radius: 10px; padding: 8px 12px; width: 216px; }
.search__icon { color: #b3a995; font-size: 16px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-family: inherit; color: var(--ink); font-size: 13px; }
.home-seg { display: flex; gap: 2px; background: #ece5d8; border-radius: 10px; padding: 3px; }
.home-seg__btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 8px; }
.home-seg__btn.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(60,50,30,.14); }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px,1fr)); gap: 18px; }
.project-card { display: block; width: 100%; min-height: 258px; text-align: left; border: 1px solid #ece5d8; background: #fff; border-radius: 16px; overflow: hidden; color: inherit; cursor: pointer; box-shadow: 0 4px 14px rgba(60,50,30,.05); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.project-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(60,50,30,.13); border-color: #e0d6c4; }
.project-card--new { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; border: 1.5px dashed #d8cdba; background: #f7f3ec; color: var(--muted); text-align: center; }
.project-card__plus { width: 46px; height: 46px; border-radius: 13px; background: #fff; color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 26px; box-shadow: 0 4px 12px rgba(60,50,30,.08); }
.project-card__new-title { font-family: var(--serif); font-weight: 700; color: var(--ink-soft); }
.project-card__new-desc { font-size: 12px; }
.project-card__thumb { height: 146px; background: #f3efe7; padding: 18px 22px 0; overflow: hidden; }
.project-card__paper { background: #fff; border-radius: 7px 7px 0 0; padding: 12px 13px 16px; box-shadow: 0 10px 22px rgba(60,50,30,.10); }
.project-card__thumb-head { height: 30px; border-radius: 7px 7px 0 0; }
.project-card__line { display: block; height: 5px; border-radius: 3px; background: #e7e1d5; margin-bottom: 6px; }
.project-card__line--accent { width: 46%; height: 7px; margin-bottom: 10px; }
.project-card__line--short { width: 90%; }
.project-card__callout { display: block; height: 34px; margin-top: 11px; background: #f6f5f1; border-left: 3px solid #1A3C6E; border-radius: 0 6px 6px 0; }
.project-card__body { padding: 14px 16px 15px; }
.project-card__name { min-height: 42px; font-family: var(--serif); font-weight: 700; font-size: 15px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-card__meta { display: flex; align-items: center; gap: 8px; margin-top: 9px; font-size: 12.5px; color: var(--muted); }
.project-card__swatch { width: 13px; height: 13px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); flex: none; }
.project-card__foot { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #f0ebe1; margin-top: 12px; padding-top: 11px; }
.project-card__badge { font-size: 11px; font-weight: 800; padding: 3px 11px; border-radius: 20px; }
.project-card__time { font-size: 11.5px; color: var(--muted-2); }
.project-empty { grid-column: 1/-1; padding: 46px; text-align: center; color: var(--muted-2); border: 1.5px dashed var(--line-2); border-radius: 16px; background: #f7f3ec; }

/* =============================================================
   工作台布局
   ============================================================= */
.app { display: grid; grid-template-columns: 392px 1fr; grid-template-rows: 100%; height: 100vh; width: 100vw; overflow: hidden; }
.workspace-toggle, .workspace-scrim, .review__side-head { display: none; }

/* ---- 左侧对话栏 ---- */
.chat { display: flex; flex-direction: column; min-height: 0; background: var(--panel); box-shadow: 1px 0 0 var(--line); }
.chat__head { display: flex; align-items: center; gap: 11px; padding: 16px 16px 12px; }
.chat__logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 700; font-size: 15px; flex: none; }
.chat__heading { flex: 1; min-width: 0; }
.chat__title { font-family: var(--serif); font-weight: 600; font-size: 16px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__sub { font-size: 11px; color: var(--muted-2); margin-top: 1px; }
.chat__feedback { border: 1px solid rgba(191,90,54,.28); background: #fff7ef; color: var(--accent-d); min-width: 58px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 800; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px; box-shadow: 0 4px 12px rgba(117,72,44,.08); transition: border-color .14s ease, background .14s ease, color .14s ease; }
.chat__feedback span { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-size: 11px; line-height: 1; }
.chat__feedback:hover { border-color: rgba(191,90,54,.48); background: #fff0e4; color: #8d3d21; }
.chat__icon { border: 0; background: #ece5d8; color: #7a7164; width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 15px; flex: none; display: inline-flex; align-items: center; justify-content: center; transition: background .14s ease; }
.chat__icon:hover { background: #e2d9c8; }

/* 步骤指示 */
.steps { display: flex; align-items: center; gap: 4px; padding: 4px 14px 12px; flex-wrap: wrap; }
.step { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; cursor: default; font-size: 12px; padding: 5px 8px; border-radius: var(--r-sm); color: var(--muted-2); font-weight: 600; }
.step.is-reachable { cursor: pointer; }
.step__n { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; background: #e2d9c8; color: #8a8175; font-size: 11px; font-weight: 700; }
.step.is-done { color: var(--ink-soft); }
.step.is-done .step__n { background: var(--ok); color: #fff; }
.step.is-active { color: var(--accent); font-weight: 800; }
.step.is-active .step__n { background: var(--accent); color: #fff; }

/* 消息流 */
.thread { flex: 1; min-height: 0; overflow: auto; padding: 12px 16px 8px; border-top: 1px solid var(--line); }
.thread::-webkit-scrollbar { width: 8px; }
.thread::-webkit-scrollbar-thumb { background: #ddd4c4; border-radius: 8px; }
.msg { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.msg--user { flex-direction: row-reverse; }
.msg--user .msg__card { background: #f1ece2; border-color: #e6ddcd; }
.msg--user .msg__label { color: var(--ink-soft); text-align: right; }
.msg__avatar { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; font-family: var(--serif); }
.msg__card { flex: 1; min-width: 0; background: #fbf9f4; border: 1px solid #e7e1d5; border-radius: 12px; padding: 11px 14px; }
.msg__label { font-size: 11px; font-weight: 700; margin-bottom: 5px; color: var(--accent); }
.msg__text { font-size: 13.5px; line-height: 1.75; color: var(--ink); white-space: pre-wrap; }
.msg__text--pending { color: var(--muted); font-style: italic; opacity: .85; }

/* === 静默 agent 进度卡（非聊天气泡式通知） === */
.agent { background: #fbf9f4; border: 1px solid #ece4d4; border-radius: 12px; padding: 11px 13px; margin-bottom: 14px; }
.agent--done { background: #f7f4ee; border-color: #ece4d4; }
.agent__head { display: flex; align-items: center; gap: 9px; }
.agent__icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; flex: none; background: var(--accent-soft); color: var(--accent); }
.agent--done .agent__icon { background: #e6efe8; color: var(--ok); }
.agent__icon.is-spin { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.agent__title { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.agent__toggle { border: 0; background: transparent; color: var(--muted-2); font-size: 11.5px; cursor: pointer; padding: 2px 4px; }
.agent__steps { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; padding-left: 3px; }
.agent__step { display: flex; gap: 9px; align-items: flex-start; padding: 4px 0; position: relative; }
.agent__step::before { content: ""; position: absolute; left: 8px; top: 18px; bottom: -2px; width: 1.5px; background: #e6ddcd; }
.agent__step:last-child::before { display: none; }
.agent__dot { width: 17px; height: 17px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #fff; background: #d8cdba; z-index: 1; }
.agent__step--running .agent__dot { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.agent__step--done .agent__dot { background: var(--ok); }
.agent__step--wait .agent__dot { background: #e2d9c8; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(191,90,54,.34); } 50% { box-shadow: 0 0 0 5px rgba(191,90,54,0); } }
.agent__step-copy { display: flex; flex-direction: column; gap: 1px; padding-top: 1px; }
.agent__step-label { font-size: 12.5px; color: var(--ink); font-weight: 600; }
.agent__step--wait .agent__step-label { color: var(--muted-2); font-weight: 500; }
.agent__step-detail { font-size: 11.5px; color: var(--muted-2); line-height: 1.5; }

/* 输入区 */
.composer { padding: 10px 16px 16px; background: var(--panel); box-shadow: 0 -1px 0 var(--line); }
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { border: 1px solid var(--line-2); background: var(--paper); color: var(--ink-soft); font-size: 12px; padding: 6px 12px; border-radius: 20px; cursor: pointer; white-space: nowrap; transition: border-color .14s, background .14s; }
.chip:hover { border-color: #d8cdba; background: #fff; }
.composer__box { display: flex; align-items: flex-end; gap: 8px; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 8px 8px 8px 14px; box-shadow: 0 2px 12px rgba(60,50,30,.05); }
.composer__input { flex: 1; border: 0; outline: 0; resize: none; font-family: inherit; font-size: 13.5px; line-height: 1.5; color: var(--ink); background: transparent; max-height: 120px; min-height: 24px; padding: 5px 0; }
.composer__input::placeholder { color: #b3a995; }
.composer__send { border: 0; background: var(--accent); color: #fff; width: 38px; height: 38px; border-radius: var(--r-md); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.composer__meta { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding: 0 2px; }
.composer__meta span { font-size: 11px; color: #b0a795; }

/* =============================================================
   右侧舞台 + 画布标签（浏览器式）
   ============================================================= */
.stage { position: relative; min-width: 0; display: flex; flex-direction: column; background: var(--bg); background-image: radial-gradient(#ddd4c5 1.1px, transparent 1.1px); background-size: 24px 24px; }
.tabbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px 0; height: 52px; flex: none; }
.tabbar__tabs { display: flex; align-items: flex-end; gap: 6px; min-width: 0; overflow-x: auto; flex: 1; }
.tabbar__tabs::-webkit-scrollbar { height: 0; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; background: #f4efe6; border: 1px solid var(--line-2); border-bottom: 0; border-radius: 10px 10px 0 0; color: var(--ink-soft); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; max-width: 240px; transition: background .14s; }
.tab:hover { background: #f8f4ec; }
.tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 -2px 8px rgba(60,50,30,.05); }
.tab--ghost { background: transparent; border: 1px dashed var(--line-2); color: var(--muted); cursor: default; }
.tab__dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.tab__label { overflow: hidden; text-overflow: ellipsis; }
.tab__badge { font-size: 10px; font-weight: 800; color: var(--ok); background: #e6efe8; border-radius: 5px; padding: 1px 6px; }
.tab__close { border: 0; background: transparent; color: var(--muted-2); width: 18px; height: 18px; border-radius: 5px; font-size: 15px; line-height: 1; flex: none; }
.tab__close:hover { background: #ece4d4; color: var(--ink); }
.tabbar__add { border: 1px solid var(--line-2); background: #fff; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; font-size: 16px; flex: none; transition: border-color .14s, color .14s; }
.tabbar__add:hover { border-color: var(--accent); color: var(--accent); }

/* === 画布切换：标签为主，溢出折叠成下拉 === */
.tabbar__more { position: relative; flex: none; }
.tabbar__more-btn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-soft); border-radius: 8px; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: border-color .14s, color .14s; }
.tabbar__more-btn:hover, .tabbar__more-btn.is-open { border-color: var(--accent); color: var(--accent); }
.tabbar__more-btn .caret { font-size: 9px; transition: transform .16s ease; }
.tabbar__more-btn.is-open .caret { transform: rotate(180deg); }
.tabbar__more-menu { position: absolute; right: 0; top: 37px; z-index: 60; min-width: 252px; max-height: 60vh; overflow: auto; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--sh-card); padding: 6px; animation: menuIn .16s cubic-bezier(.2,.8,.2,1); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px); } }
.menu-head { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; color: var(--muted-2); padding: 5px 10px 6px; }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: left; color: var(--ink-soft); transition: background .12s; }
.menu-item:hover { background: var(--paper); }
.menu-item.is-active { background: var(--accent-soft); }
.menu-item__dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.menu-item__label { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item__badge { font-size: 10px; font-weight: 800; color: var(--ok); background: #e6efe8; border-radius: 5px; padding: 1px 6px; flex: none; }
.menu-item__close { border: 0; background: transparent; color: var(--muted-2); width: 20px; height: 20px; border-radius: 5px; font-size: 14px; line-height: 1; flex: none; }
.menu-item__close:hover { background: #ece4d4; color: var(--ink); }
.tabbar__spacer { flex: 0; }
.tabbar__zoom { display: flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 4px; box-shadow: var(--sh-pop); }
.zoom__btn { border: 0; background: transparent; width: 30px; height: 30px; border-radius: var(--r-sm); cursor: pointer; color: var(--ink-soft); font-size: 17px; }
.zoom__val { border: 0; background: transparent; min-width: 50px; height: 30px; border-radius: var(--r-sm); cursor: pointer; color: #3a352d; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.zoom__sep { width: 1px; height: 18px; background: #eee4d4; margin: 0 2px; }
.zoom__fit { border: 0; background: #f1ece2; height: 30px; padding: 0 12px; border-radius: var(--r-sm); cursor: pointer; color: var(--ink-soft); font-size: 12px; font-weight: 700; }

.stage__body { flex: 1; min-height: 0; overflow: auto; border-top: 1px solid var(--line); background: rgba(255,255,255,.32); }
.stage-center { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 40px; }

/* 解析占位 */
.parsing { width: min(440px,100%); text-align: center; background: rgba(255,255,255,.86); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 40px 34px; box-shadow: var(--sh-pop); }
.parsing__spinner { display: flex; gap: 7px; justify-content: center; margin-bottom: 22px; }
.parsing__spinner span { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: bounce 1.2s ease-in-out infinite; }
.parsing__spinner span:nth-child(2) { animation-delay: .15s; opacity: .7; }
.parsing__spinner span:nth-child(3) { animation-delay: .3s; opacity: .45; }
@keyframes bounce { 0%,80%,100% { transform: translateY(0); } 40% { transform: translateY(-9px); } }
.parsing__title { font-family: var(--serif); font-size: 21px; font-weight: 700; margin-bottom: 10px; }
.parsing__desc { color: var(--muted); font-size: 13.5px; line-height: 1.8; }

/* =============================================================
   === 需求表单（全选择题 + 页边距 + 其他短下划线） ===
   ============================================================= */
.sheet-scroll { min-height: 100%; padding: 32px; display: flex; justify-content: center; }
.sheet { width: min(760px,100%); background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--sh-card); padding: 38px 42px 44px; animation: riseIn .42s cubic-bezier(.2,.8,.2,1); }
@keyframes riseIn { from { transform: translateY(14px); } to { transform: none; } }

/* === 丝滑入场：错落淡入上浮（表单字段 / 色卡 / 模板卡） === */
@keyframes stagIn { from { transform: translateY(12px); } to { transform: none; } }
.stag { animation: stagIn .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 55ms); }
@media (prefers-reduced-motion: reduce) { .stag, .sheet, .picker, .review { animation: none !important; transform: none !important; } }
.sheet__eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .06em; margin-bottom: 10px; }
.sheet__title { font-family: var(--serif); font-size: 30px; font-weight: 700; margin: 0 0 10px; }
.sheet__intro { font-size: 14.5px; color: var(--muted); line-height: 1.7; margin: 0; }
.field { margin-top: 30px; }
.field__q-box { margin-bottom: 14px; }
.field__q { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.field__hint { font-size: 13px; color: var(--muted-2); margin-top: 4px; }

.org-line { display: flex; align-items: center; gap: 12px; background: var(--paper); border: 1px solid #e3dccd; border-radius: 13px; padding: 14px 16px; }
.org-line__val { flex: 1; min-width: 0; font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-line__input { flex: 1; min-width: 0; border: 0; border-bottom: 1.5px solid var(--accent); background: transparent; outline: 0; font-family: var(--serif); font-size: 16px; color: var(--ink); padding: 2px 0; }
.org-line__edit { border: 1px solid var(--line-2); background: #fff; color: var(--ink-soft); font-size: 12.5px; font-weight: 700; padding: 7px 14px; border-radius: 8px; flex: none; }

.swatch-row { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 38px; height: 38px; border-radius: 10px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); cursor: pointer; transition: transform .12s ease; }
.swatch:hover { transform: scale(1.08); }
.swatch.is-active { border-color: var(--ink); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 0 0 3px rgba(191,90,54,.18); }

.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { cursor: pointer; font-size: 14px; font-weight: 600; padding: 11px 20px; border-radius: 999px; border: 1.5px solid #e3dccd; background: var(--paper); color: #4a4337; display: inline-flex; align-items: center; gap: 8px; transition: border-color .14s, background .14s, color .14s; }
.pill:hover { border-color: #d8cdba; }
.pill.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-d); }
.pill--other { border-style: dashed; color: var(--muted); }
.pill--other.is-active { border-style: solid; }

.other-line { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-left: 2px; }
.other-line__input { flex: 1; max-width: 320px; border: 0; border-bottom: 1.5px solid var(--accent); background: transparent; outline: 0; font-family: inherit; font-size: 14px; color: var(--ink); padding: 5px 2px; }
.other-line__input::placeholder { color: var(--muted-2); }
.other-line__ok { border: 0; background: var(--accent); color: #fff; font-size: 12.5px; font-weight: 700; padding: 7px 16px; border-radius: 8px; }

.margin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 12px; margin-top: 14px; }
.margin-grid.is-locked { opacity: .62; }
.margin-cell { display: flex; align-items: center; gap: 5px; background: var(--paper); border: 1px solid #e3dccd; border-radius: 10px; padding: 9px 10px; }
.margin-cell__k { font-size: 13px; color: var(--muted); font-weight: 700; flex: none; }
.margin-cell__v { flex: 1 1 0; width: auto; min-width: 0; border: 0; border-bottom: 1.5px solid #d8cdba; background: transparent; outline: 0; font-family: inherit; font-size: 14px; font-weight: 700; color: var(--ink); text-align: center; padding: 2px 0; }
.margin-cell__v:not(:disabled) { border-bottom-color: var(--accent); }
.margin-cell__u { font-size: 12px; color: var(--muted-2); flex: none; }

/* 字体与字号（按标题层级，号数制选择） */
.typeset { display: flex; flex-direction: column; gap: 9px; }
.typeset__row { display: grid; grid-template-columns: 96px 1fr 1fr; gap: 10px; align-items: center; }
.typeset__lv { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.typeset__lv-t { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.typeset__lv-s { font-size: 11px; color: var(--muted-2); }
.typeset__sel { position: relative; display: block; min-width: 0; }
.typeset__sel::after { content: "▾"; position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-size: 10px; color: var(--muted-2); pointer-events: none; }
.typeset__sel select { width: 100%; appearance: none; -webkit-appearance: none; border: 1.5px solid #e3dccd; background: var(--paper); border-radius: 10px; padding: 10px 28px 10px 13px; font-family: inherit; font-size: 14px; font-weight: 600; color: #4a4337; cursor: pointer; transition: border-color .14s; }
.typeset__sel select:hover { border-color: #d8cdba; }
.typeset__sel select:focus { border-color: var(--accent); outline: 0; }

.sheet__submit { margin-top: 40px; display: flex; align-items: center; gap: 16px; }
.sheet__submit-note { font-size: 13px; color: var(--muted-2); }

/* =============================================================
   === 选模板与配色：HTML 质感色卡 + 模板卡 ===
   ============================================================= */
.picker { width: min(1040px,100%); animation: riseIn .42s ease; }
.picker__head { margin-bottom: 22px; }
.picker__choice-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.picker__pane { min-width: 0; padding: 18px; border: 1px solid rgba(224,212,186,.82); border-radius: 16px; background: linear-gradient(145deg,rgba(255,255,255,.84),rgba(246,240,227,.7)); box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 12px 28px -24px rgba(74,54,20,.35); }
.picker__pane--colors { position: static; }
.picker__sub { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--ink-soft); margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.picker__sub::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.picker__sub-hint { font-family: var(--sans); font-size: 11.5px; font-weight: 600; color: var(--muted-2); }
.picker__pane--colors .picker__sub { flex-wrap: wrap; row-gap: 3px; }
.picker__pane--colors .picker__sub::after { display: none; }
.picker__pane--colors .picker__sub-hint { flex-basis: 100%; }
.mytpl > .picker__sub { margin-top: 28px; }

.colorcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.colorcard { text-align: left; background: linear-gradient(#fff,#fdfbf6); border: 1px solid #ece4d4; border-radius: 13px; overflow: hidden; cursor: pointer; padding: 0; box-shadow: 0 1px 3px rgba(60,50,30,.06); transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s cubic-bezier(.2,.8,.2,1), border-color .18s ease; }
.colorcard:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(60,50,30,.15); }
.colorcard.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(191,90,54,.14), 0 10px 24px rgba(60,50,30,.13); }

/* 拟物纸样：一叠真实纸样躺在台面上（立体 / 光影 / 悬停扇开） */
.swatchdeck { position: relative; height: 88px; padding: 13px 15px 16px; background: radial-gradient(130% 90% at 50% -10%, rgba(255,255,255,.7), transparent 60%), linear-gradient(#f0ebe1,#e7e0d2); }
.deck-chip { position: relative; z-index: 4; height: 100%; border-radius: 7px; background: var(--c); padding: 8px 9px; display: flex; flex-direction: column; justify-content: space-between; transform: rotate(-1.6deg); transform-origin: 50% 90%; box-shadow: 0 1px 0 rgba(255,255,255,.32) inset, 0 -10px 18px -12px rgba(0,0,0,.3) inset, 0 9px 17px rgba(40,28,14,.26); transition: transform .24s cubic-bezier(.2,.8,.2,1); }
.deck-chip::after { content: ""; position: absolute; inset: 0; border-radius: 7px; pointer-events: none; mix-blend-mode: screen; background: linear-gradient(118deg, rgba(255,255,255,.24), rgba(255,255,255,0) 40%), repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px); }
.colorcard:hover .deck-chip { transform: rotate(-3deg) translateY(-2px); }
.deck-chip__code { position: relative; z-index: 1; font-family: var(--sans); font-size: 8.5px; font-weight: 800; letter-spacing: .08em; color: rgba(255,255,255,.92); text-shadow: 0 1px 2px rgba(0,0,0,.28); }
.deck-chip__hex { position: relative; z-index: 1; align-self: flex-end; font-family: var(--sans); font-size: 9px; font-weight: 700; letter-spacing: .03em; color: #fff; background: rgba(0,0,0,.2); padding: 1px 6px; border-radius: 999px; }
.deck-strip { position: absolute; left: 15px; right: 15px; top: 13px; bottom: 16px; border-radius: 7px; background: var(--c); transform-origin: 62% 84%; box-shadow: 0 5px 11px rgba(40,28,14,.18); transition: transform .24s cubic-bezier(.2,.8,.2,1); }
.deck-strip:nth-child(1) { z-index: 3; transform: rotate(3.4deg) translate(5px,3px); }
.deck-strip:nth-child(2) { z-index: 2; transform: rotate(7deg) translate(9px,5px); }
.deck-strip:nth-child(3) { z-index: 1; transform: rotate(10.6deg) translate(13px,8px); }
.colorcard:hover .deck-strip:nth-child(1) { transform: rotate(5.4deg) translate(8px,4px); }
.colorcard:hover .deck-strip:nth-child(2) { transform: rotate(10.6deg) translate(14px,6px); }
.colorcard:hover .deck-strip:nth-child(3) { transform: rotate(15.6deg) translate(19px,9px); }
.colorcard__meta { padding: 9px 11px 11px; }
.colorcard__name { font-family: var(--serif); font-size: 13px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.colorcard__rec { font-size: 9px; font-weight: 800; color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 1px 6px; }
.colorcard__stock { font-size: 10px; font-weight: 700; letter-spacing: .01em; color: var(--accent-d); margin-top: 3px; }
.colorcard__tag { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.35; }

.tpl-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tpl-mini {
  --c1: #666; --c1d: #444; --c2: #ccc; --c3: #eee; --tx: #c9c9c9;
  position: relative;
  display: block;
  width: 100%;
  border: 1px solid #e0d4ba;
  border-radius: 12px;
  padding: 15px 15px 13px;
  background: linear-gradient(180deg,#f6f0e3 0%, #f1e9d7 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 6px 16px -8px rgba(74,54,20,.28);
  color: #4a4034;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.tpl-mini:hover { transform: translateY(-3px); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset,0 12px 24px -10px rgba(74,54,20,.4); }
.tpl-mini.is-selected { border-color: #b8853f; box-shadow: 0 0 0 2px #b8853f, 0 12px 24px -10px rgba(74,54,20,.4); }
.tpl-mini.is-selected::after {
  content: "✓";
  position: absolute;
  top: -9px;
  right: -9px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #b8853f;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(74,54,20,.45);
}
.tpl-mini__selected-text { display: none; }
.tpl-mini__rec {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 2;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(184,133,63,.25);
  border-radius: 5px;
  padding: 1px 7px;
}
.tpl-mini__page {
  position: relative;
  width: 100%;
  aspect-ratio: 196 / 261;
  background: #fff;
  border: 1px solid #ece4d3;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 7px -2px rgba(60,45,20,.22);
}
.tpl-mini__page--pdf { aspect-ratio: 1190.64 / 841.92; }
.tpl-mini__page::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,.015) inset;
}
.tpl-mini__pdf-canvas { display: block; width: 100%; height: 100%; background: #fff; }
.tpl-mini__pdf-canvas[data-loading="true"] { filter: saturate(.96) brightness(.99); }
.tpl-mini__pdf-canvas.is-error { background: linear-gradient(145deg,#fff,#f3eee4); }
.tpl-mini__meta { display: flex; align-items: center; gap: 10px; margin-top: 13px; }
.tpl-mini__txt { flex: 1; min-width: 0; }
.tpl-mini__name { display: block; font-size: 14px; font-weight: 700; color: #3c3328; line-height: 1.2; }
.tpl-mini__pos { display: block; font-size: 10.5px; color: #9a8e79; margin-top: 3px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-mini__dots { flex: none; display: flex; gap: 4px; align-items: center; }
.tpl-mini__dots i { width: 9px; height: 9px; border-radius: 50%; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.06) inset; }

.tpl-card-pg { position: relative; height: 100%; display: flex; flex-direction: column; background: #fff; }
.tpl-card-pad { padding: 8px 9px; display: flex; flex-direction: column; gap: 6px; }
.tpl-card-pad--fill { flex: 1; }
.tpl-card-pad--center { justify-content: center; gap: 7px; }
.tpl-card-row { display: flex; }
.tpl-card-stack { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.tpl-card-spacer { flex: 1; }
.tpl-card-band { height: 15px; width: 100%; background: var(--c1); display: flex; align-items: center; padding: 0 7px; flex: none; }
.tpl-card-band--sm { height: 12px; }
.tpl-card-tt { height: 6px; width: 48%; background: var(--c1d); border-radius: 1px; }
.tpl-card-para { width: 100%; background-image: repeating-linear-gradient(to bottom,var(--tx) 0 2px,transparent 2px 6.5px); }
.tpl-card-ln { height: 3px; border-radius: 1px; background: var(--tx); display: block; }
.tpl-card-ln--soft { background: #d2d2d2; }
.tpl-card-imgph { background: #ededed; border: 1px solid #e4e4e4; border-radius: 2px; position: relative; overflow: hidden; }
.tpl-card-imgph::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg,transparent 45%, rgba(0,0,0,.06) 45% 47%, transparent 47%, transparent 53%, rgba(0,0,0,.06) 53% 55%, transparent 55%); }
.tpl-card-cap { height: 5px; border-radius: 1px; background: var(--tx); width: 60%; margin: 3px auto 0; }
.tpl-card-tbl { border: 1px solid var(--c2); border-radius: 2px; overflow: hidden; display: flex; flex-direction: column; }
.tpl-card-th { height: 11px; background: var(--c1); flex: none; }
.tpl-card-tb { display: flex; flex: 1; }
.tpl-card-tlabel { width: 30%; background: var(--c2); flex: none; display: flex; flex-direction: column; gap: 5px; padding: 6px 5px; }
.tpl-card-tlabel .tpl-card-ln { background: rgba(255,255,255,.75); }
.tpl-card-tcell { flex: 1; padding: 6px; display: flex; flex-direction: column; gap: 5px; background: #fff; }
.tpl-card-box { border: 1.4px solid var(--c1); border-radius: 7px; padding: 7px; display: flex; flex-direction: column; gap: 5px; }
.tpl-card-dash { border: 1.4px dashed var(--accent,var(--c1)); border-radius: 7px; padding: 7px; display: flex; flex-direction: column; gap: 5px; }
.tpl-card-dash--pink { --accent: #e87b92; }
.tpl-card-panel { background: var(--c3); border-radius: 3px; padding: 7px; display: flex; flex-direction: column; gap: 5px; }
.tpl-card-chip { height: 10px; border-radius: 1px; background: var(--accent,var(--c1)); display: block; }
.tpl-card-note { background: #f8e7e1; border-radius: 2px; height: 11px; margin-top: 4px; display: flex; align-items: center; justify-content: center; }
.tpl-card-rect { border: 1.3px solid var(--c1d); border-radius: 2px; height: 18px; width: 62%; margin-top: 1px; }
.tpl-card-solidline { height: 8px; background: var(--c1); border-radius: 1px; display: block; }
.tpl-card-sidetab { position: absolute; right: 0; top: 36%; width: 11px; height: 48px; background: var(--c1); border-radius: 3px 0 0 3px; display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; }
.tpl-card-sidetab i { width: 5px; height: 4px; background: rgba(255,255,255,.85); border-radius: 1px; display: block; }
.tpl-card-booktab { position: relative; height: 11px; }
.tpl-card-booktab::before { content: ""; position: absolute; top: 0; right: 13px; width: 36px; height: 9px; background: var(--c1); }
.tpl-card-booktab b { position: absolute; top: 0; right: 0; width: 9px; height: 9px; background: var(--c1d); display: block; }
.tpl-card-foot { height: 12px; width: 100%; background: var(--c1); margin-top: auto; flex: none; position: relative; }
.tpl-card-stripe { position: absolute; right: 0; top: 0; bottom: 0; width: 34%; background: repeating-linear-gradient(115deg,rgba(255,255,255,0) 0 4px, rgba(255,255,255,.28) 4px 8px); }
.tpl-card-corner { position: absolute; right: 0; top: 0; bottom: 0; width: 14px; background: var(--c1d); }
.tpl-card-gcard { background: #f1f1f1; border-radius: 2px; padding: 5px 6px; display: flex; flex-direction: column; gap: 4px; }
.tpl-card-bars { display: flex; align-items: flex-end; gap: 3px; height: 22px; flex: none; }
.tpl-card-bars i { width: 6px; border-radius: 1px 1px 0 0; display: block; background: var(--c1); }
.tpl-card-legend { display: flex; gap: 4px; align-items: center; }
.tpl-card-legend i { width: 7px; height: 7px; border-radius: 1.5px; display: block; }
.tpl-card-mk { display: flex; align-items: center; gap: 5px; }
.tpl-card-mk b { width: 7px; height: 7px; background: var(--c1); display: block; border-radius: 1px; flex: none; }
.tpl-card-mk .tpl-card-ln { flex: 1; }
.tpl-card-side { width: 33%; background: var(--c2); border-radius: 2px; display: flex; flex-direction: column; gap: 8px; padding: 8px 6px; }
.tpl-card-side .tpl-card-ln { background: rgba(255,255,255,.85); }
.tpl-card-half { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.tpl-card-half--dash { border-left: 1.4px dashed var(--c1); }
.tpl-card-dash-top { border-top: 1.4px dashed var(--c1); padding-top: 7px; }
.tpl-card-map { background-image: linear-gradient(0deg,transparent 49%,#e6e6e6 49% 51%,transparent 51%),linear-gradient(90deg,transparent 49%,#e6e6e6 49% 51%,transparent 51%); background-color: #efefef; }
.tpl-card-map span { position: absolute; width: 6px; height: 6px; border-radius: 50%; }
.tpl-card-band-wrap { background: var(--c2); padding: 3px 0; }
.tpl-card-k-head { height: 21px; display: flex; align-items: center; gap: 8px; padding: 0 8px; background: var(--c1); }
.tpl-card-k-tab { height: 13px; border-radius: 1px 1px 4px 1px; background: var(--c1d); }
.tpl-card-k-project { height: 3px; margin-left: auto; border-radius: 2px; background: rgba(255,255,255,.72); }
.tpl-card-k-title { display: flex; align-items: center; gap: 7px; padding: 6px 7px; border-left: 3px solid var(--c1); background: var(--c2); }
.tpl-card-k-title .tpl-card-ln { flex: 1; background: var(--c1d); opacity: .72; }
.tpl-card-k-box { padding: 7px; border: 1px solid var(--c2); border-radius: 3px; background: var(--c3); display: flex; flex-direction: column; gap: 5px; }
.tpl-card-k-caption { height: 13px; display: flex; align-items: center; justify-content: center; border-radius: 2px; background: var(--c4); }
.tpl-card-k-caption .tpl-card-ln { background: rgba(91,67,48,.38); }
.s-a{--c1:#397790;--c1d:#295866;--c2:#9ad3da;--c3:#e6f1f3}
.s-b{--c1:#4482b3;--c1d:#2f6396;--c2:#89d0ee;--c3:#e1eff8}
.s-c{--c1:#198796;--c1d:#12606b;--c2:#8ec9c3;--c3:#e2f0ee}
.s-d{--c1:#00a3d7;--c1d:#0a4384;--c2:#cfeefb;--c3:#e9f7fd}
.s-e{--c1:#7db552;--c1d:#5f9239;--c2:#e8f2de;--c3:#fff2e8}
.s-f{--c1:#8a3a10;--c1d:#5f2708;--c2:#efe1d3;--c3:#f5e8dc}
.s-g{--c1:#0168b7;--c1d:#024e8a;--c2:#dbeaf6;--c3:#eef4fa}
.s-h{--c1:#2e74b6;--c1d:#1f5a93;--c2:#d1e6f6;--c3:#eaf3fb}
.s-i{--c1:#1d9aca;--c1d:#14739b;--c2:#c0dfee;--c3:#eff8fc;--c4:#ffb955}
.s-j{--c1:#00aeef;--c1d:#087cad;--c2:#cbeeff;--c3:#eefaff}
.s-k{--c1:#506e94;--c1d:#37577b;--c2:#c4dbee;--c3:#eff7fc;--c4:#f7e9d9}

.picker__act { margin-top: 30px; display: flex; align-items: center; gap: 16px; }

/* =============================================================
   === 看样品：模板轨 + 预览画布 + 打磨面板 + 版本轨道 ===
   ============================================================= */
.review { height: 100%; min-height: 0; display: flex; flex-direction: column; animation: riseIn .42s cubic-bezier(.2,.8,.2,1); }
.tpl-rail { display: flex; align-items: center; gap: 8px; padding: 12px 18px; background: rgba(255,255,255,.7); border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.tpl-rail::-webkit-scrollbar { height: 0; }
.tpl-rail__label { font-size: 11.5px; font-weight: 800; color: var(--muted-2); flex: none; margin-right: 2px; }
.tpl-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-soft); font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 999px; white-space: nowrap; flex: none; transition: border-color .14s, background .14s; }
.tpl-chip:hover { border-color: #d8cdba; }
.tpl-chip.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-d); }
.tpl-chip__dot { width: 9px; height: 9px; border-radius: 3px; }

/* 「生成全文」按钮在样品渲染中时置灰（用户消息②） */
.polish__gen.is-busy, .polish__gen[disabled] { opacity: .55; cursor: progress; box-shadow: none; transform: none; }

.review__main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 312px; }
.review__main--full { grid-template-columns: 1fr; }
.review__side { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; border-left: 1px solid var(--line); background: rgba(255,255,255,.55); }
.canvas-scroll { position: relative; overflow: hidden; display: flex; justify-content: center; min-width: 0; }
.canvas-vp { overflow: auto; width: 100%; padding: 30px; display: flex; flex-direction: column; align-items: center; scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color .2s ease; }
.canvas-vp::-webkit-scrollbar { width: 9px; }
.canvas-vp::-webkit-scrollbar-thumb { background: transparent; border-radius: 9px; }
.canvas-vp:hover { scrollbar-color: #cdc2ae transparent; }
.canvas-vp:hover::-webkit-scrollbar-thumb { background: #cdc2ae; }
.pages { display: flex; flex-direction: column; gap: 26px; width: 100%; max-width: 660px; transform-origin: top center; transition: transform .16s ease; }

/* 文档页（独立单元，为未来「单页重排」留挂点） */
.doc-page { position: relative; width: 100%; max-width: 660px; background: #fff; border-radius: 5px; box-shadow: var(--sh-page); overflow: hidden; font-family: var(--serif); transition: box-shadow .16s ease, transform .16s ease; }
.doc-page--image { display: block; border: 0; padding: 0; cursor: pointer; }
.doc-page__img { display: block; width: 100%; height: auto; }
.doc-page:hover { box-shadow: 0 22px 56px rgba(60,50,30,.22); }
.doc-page__header { padding: 26px 34px; }
.doc-page__htitle { font-family: var(--serif); color: #fff; font-weight: 700; line-height: 1.25; }
.doc-page__hsub { font-family: var(--sans); color: rgba(255,255,255,.85); font-size: 12px; margin-top: 7px; }
.doc-page__body { padding: 26px 36px 30px; }
.doc-page__h { font-weight: 700; margin-bottom: 12px; }
.doc-page__p { line-height: 1.95; margin: 0 0 15px; color: #3a352d; }
.doc-page__hl { padding: 14px 16px; margin: 16px 0; }
.doc-page__hl-title { font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.doc-page__hl-text { font-size: 12.5px; line-height: 1.75; color: #3a352d; }
.doc-page__foot { display: flex; justify-content: space-between; padding: 14px 36px 22px; font-family: var(--sans); font-size: 11px; color: var(--muted-2); border-top: 1px solid #f0ebe1; margin-top: 4px; }
.doc-page__tag { position: absolute; top: 12px; right: 0; background: rgba(43,39,34,.72); color: #fff; font-family: var(--sans); font-size: 10.5px; font-weight: 700; padding: 4px 10px; border-radius: 7px 0 0 7px; opacity: 0; transition: opacity .16s ease; }
.doc-page:hover .doc-page__tag { opacity: 1; }

/* 打磨面板 */
.polish { background: rgba(255,255,255,.45); padding: 20px 18px; display: flex; flex-direction: column; gap: 18px; flex: none; border-bottom: 1px solid var(--line); }
.polish__title { font-family: var(--serif); font-size: 16px; font-weight: 700; }
.polish__group { display: flex; flex-direction: column; gap: 9px; }
.polish__label { font-size: 11.5px; font-weight: 800; color: var(--muted-2); }
.polish__swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.pswatch { width: 26px; height: 26px; border-radius: 7px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); cursor: pointer; }
.pswatch.is-active { border-color: var(--ink); }
.polish__seg { display: flex; gap: 6px; }
.seg-btn { flex: 1; border: 0; background: #f1ece2; color: #7a7164; font-size: 12px; font-weight: 700; padding: 8px 4px; border-radius: 8px; cursor: pointer; transition: background .14s, color .14s; }
.seg-btn:hover { background: #ece4d4; }
.seg-btn.is-active { background: var(--accent); color: #fff; }
/* 文本框形状按钮组（卡 G·T2）：8 款形状用按钮，跟「对齐/字号/页边距」一致、一眼可见。
   每行 4 个、共 2 行（flex-basis ≈ 1/4 触发换行）。 */
.polish__shapes { display: flex; flex-wrap: wrap; gap: 6px; }
.shape-btn { flex: 1 1 calc(25% - 6px); min-width: 0; padding: 7px 2px; font-size: 11.5px; }
/* 高级设置（可展开列表）：自定义主色 + 撞色点睛 */
.polish__adv { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 6px; }
.polish__adv-head { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 0; background: none; cursor: pointer; padding: 6px 2px; font-size: 12.5px; font-weight: 800; color: var(--ink-soft); }
.polish__adv-head:hover { color: var(--accent); }
.polish__adv-caret { transition: transform .18s ease; font-size: 11px; color: var(--muted); }
.polish__adv.is-open .polish__adv-caret { transform: rotate(180deg); }
.polish__adv-body { display: flex; flex-direction: column; gap: 13px; padding: 8px 0 4px; }
.polish__adv-hint { font-size: 11px; line-height: 1.55; color: var(--muted); }
.polish__color { display: flex; align-items: center; gap: 10px; }
.polish__color-input { width: 40px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; flex: none; }
.polish__color-input::-webkit-color-swatch-wrapper { padding: 3px; }
.polish__color-input::-webkit-color-swatch { border: 0; border-radius: 5px; }
.polish__color-hex { font-size: 12px; font-weight: 700; color: #5a5247; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.polish__color.is-off .polish__color-input { opacity: .4; }
.polish__color.is-off .polish__color-hex { color: var(--muted); font-weight: 600; font-size: 11px; }
.polish__color-clear { margin-left: auto; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.polish__color-clear:hover { color: var(--accent); border-color: var(--accent); }
.polish__gen { margin-top: 6px; width: 100%; }
.polish__dirty-hint { margin-top: 6px; font-size: 11.5px; line-height: 1.5; color: var(--accent); }

/* 版本轨道（参数化 log + 回选） */
.vtrack { border-top: 1px solid var(--line); background: rgba(255,255,255,.78); padding: 12px 18px 14px; flex: none; }
.vtrack__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.vtrack__title { font-size: 12.5px; font-weight: 800; color: var(--ink-soft); }
.vtrack__count { font-size: 11.5px; color: var(--muted-2); }
.vtrack__rail { display: flex; flex-direction: column; gap: 8px; }
.vtrack__rail::-webkit-scrollbar { height: 6px; }
.vtrack__rail::-webkit-scrollbar-thumb { background: #ddd4c4; border-radius: 6px; }
.vchip { display: flex; align-items: center; gap: 9px; width: 100%; border: 1.5px solid var(--line-2); background: #fff; border-radius: 11px; padding: 7px 12px 7px 8px; cursor: pointer; transition: border-color .14s, box-shadow .14s; text-align: left; }
.vchip:hover { border-color: #d8cdba; }
.vchip.is-current { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(191,90,54,.14); }
.vchip__thumb { width: 30px; height: 38px; border-radius: 5px; flex: none; display: flex; align-items: flex-end; padding: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.vchip__thumb-bar { width: 100%; height: 5px; border-radius: 2px; background: rgba(255,255,255,.85); }
.vchip__meta { display: flex; flex-direction: column; gap: 2px; }
.vchip__label { font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.vchip__params { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }

/* === 版本无限画布（一览迭代与关系） === */
.vtrack__head { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; }
.vtrack__head-top { display: flex; align-items: center; gap: 8px; }
.vtrack__spacer { flex: 1; }
.vtrack__title { font-size: 13px; font-weight: 800; color: var(--ink); white-space: nowrap; flex: none; }
.vtrack__count { font-size: 11px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vtrack__canvas-btn { flex: none; white-space: nowrap; border: 1px solid var(--line-2); background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: border-color .14s, color .14s; }
.vtrack__canvas-btn:hover { border-color: var(--accent); color: var(--accent); }
.vtrack__canvas-ic { font-size: 14px; line-height: 1; }
.vcanvas-overlay { position: absolute; inset: 0; z-index: 80; display: flex; flex-direction: column; background: rgba(245,242,234,.96); backdrop-filter: blur(3px); }
.vcanvas__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 22px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.72); flex: none; }
.vcanvas__title { font-family: var(--serif); font-size: 17px; font-weight: 700; }
.vcanvas__sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.vcanvas__legend { display: flex; gap: 16px; margin-top: 7px; }
.vlg { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.vlg__line { width: 18px; height: 0; border-top: 2px solid #c9bda6; }
.vlg__line--branch { border-top: 2px dashed var(--accent); }
.vcanvas__tools { display: flex; align-items: center; gap: 6px; }
.vcanvas__btn { border: 1px solid var(--line-2); background: #fff; color: var(--ink-soft); height: 32px; min-width: 32px; padding: 0 9px; border-radius: 9px; font-size: 15px; font-weight: 700; cursor: pointer; transition: border-color .14s; }
.vcanvas__btn:hover { border-color: #d8cdba; }
.vcanvas__btn--val { font-size: 12.5px; min-width: 54px; font-variant-numeric: tabular-nums; color: #3a352d; }
.vcanvas__btn--text { font-size: 12.5px; background: #f1ece2; }
.vcanvas__btn--close { font-size: 18px; color: var(--muted); }
.vcanvas__vp { position: relative; flex: 1; min-height: 0; overflow: hidden; cursor: grab; background-image: radial-gradient(#d8cfbe 1.1px, transparent 1.1px); background-size: 26px 26px; }
.vcanvas__vp.is-grabbing { cursor: grabbing; }
.vcanvas__world { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.vcanvas__svg { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; }
.vcanvas__edge { fill: none; stroke: #c9bda6; stroke-width: 2; }
.vcanvas__edge--rollback { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-dasharray: 5 4; opacity: .85; }
.vnode { position: absolute; text-align: left; background: #fff; border: 1.5px solid var(--line-2); border-radius: 13px; padding: 0; cursor: pointer; box-shadow: 0 6px 18px rgba(60,50,30,.1); transition: transform .14s, box-shadow .14s, border-color .14s; overflow: hidden; display: flex; flex-direction: column; }
.vnode:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(60,50,30,.18); border-color: #d8cdba; }
.vnode.is-current { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(191,90,54,.18), 0 12px 26px rgba(60,50,30,.16); }
.vnode__preview { position: relative; height: 198px; overflow: hidden; background: #ece6db; border-bottom: 1px solid var(--line-3); pointer-events: none; }
.vnode__preview-scale { transform: scale(.35); transform-origin: top left; width: 660px; display: flex; flex-direction: column; gap: 16px; padding-top: 2px; }
.vnode__doctag { position: absolute; left: 9px; bottom: 9px; font-size: 10px; font-weight: 700; color: #fff; background: rgba(43,39,34,.64); border-radius: 6px; padding: 2px 9px; }
/* 问题1 / 美化2：版本画布节点封面用真实 PDF 首页（盖住示意页） */
.vnode__cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; background: #fff; }
.vnode__cap { padding: 9px 12px 11px; display: flex; flex-direction: column; gap: 4px; }
.vnode__cap-top { display: flex; align-items: baseline; gap: 6px; }
.vnode__v { font-size: 12px; font-weight: 800; color: var(--accent); flex: none; }
.vnode__label { font-size: 12px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vnode__metarow { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.vnode__params { font-size: 10.5px; color: var(--muted-2); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vnode__time { font-size: 10px; color: var(--muted-2); font-variant-numeric: tabular-nums; flex: none; }
.vaxis-line { stroke: #c9bda6; stroke-width: 1.5; }
.vaxis-stem { stroke: #ddd1bb; stroke-width: 1.2; stroke-dasharray: 3 3; }
.vaxis-dot { fill: #c9bda6; }
.vaxis-dot.is-current { fill: var(--accent); }
.vtimeline { position: absolute; }
.vtick { position: absolute; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 1px; }
.vtick__time { font-size: 11px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vtick__v { font-size: 10px; color: var(--muted-2); }
.vaxis-label { position: absolute; font-size: 11px; font-weight: 800; letter-spacing: .04em; color: var(--muted-2); }
.vnode__badge { position: absolute; top: 7px; right: 7px; font-size: 9.5px; font-weight: 800; color: #fff; background: var(--accent); border-radius: 6px; padding: 1px 7px; }

/* =============================================================
   === 生成全文（四阶段）+ 产物预览/下载 ===
   ============================================================= */
.gen { width: min(520px,100%); text-align: center; background: rgba(255,255,255,.9); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 38px 36px; box-shadow: var(--sh-pop); }
.gen__title { font-family: var(--serif); font-size: 22px; font-weight: 700; margin-bottom: 24px; }
.gen__stages { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 24px; }
.gen-step { display: flex; flex-direction: column; align-items: center; gap: 7px; opacity: .5; transition: opacity .2s ease; }
.gen-step.is-active, .gen-step.is-done { opacity: 1; }
.gen-step__n { width: 30px; height: 30px; border-radius: 50%; background: #e2d9c8; color: #8a8175; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; transition: background .2s, color .2s; }
.gen-step.is-active .gen-step__n { background: var(--accent); color: #fff; animation: pulse 1.3s ease-in-out infinite; }
.gen-step.is-done .gen-step__n { background: var(--ok); color: #fff; }
.gen-step__t { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.gen-step__sep { color: #d8cdba; font-size: 13px; margin-bottom: 18px; }
.gen-bar { height: 8px; background: #ece5d8; border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.gen-bar__fill { display: block; width: 0; height: 100%; background: var(--accent); border-radius: 999px; transition: width .35s ease; }
.gen__now { font-size: 13px; color: var(--muted); }
.gen__now b { color: var(--accent); }

.rendering { width: min(440px,100%); text-align: center; }
.rendering__title { font-family: var(--serif); font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.render-bar { height: 7px; background: #ece5d8; border-radius: 999px; overflow: hidden; margin-bottom: 12px; }
.render-bar__fill { display: block; width: 8%; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s ease; }
.rendering__hint { font-size: 13px; color: var(--muted-2); }
.rendering--error { border: 1px solid #ead0c3; background: #fff8f4; }
.rendering--error .rendering__title { color: #9e3c25; }

/* 产物条 */
.artifacts-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 16px 22px; background: rgba(255,255,255,.85); border-bottom: 1px solid var(--line); flex: none; }
.artifacts-bar__ok { display: flex; align-items: center; gap: 12px; }
.artifacts-bar__check { width: 36px; height: 36px; border-radius: 11px; background: var(--ok); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.artifacts-bar__title { font-family: var(--serif); font-size: 15.5px; font-weight: 700; color: #2c5a3c; }
.artifacts-bar__ok.is-warning .artifacts-bar__check { background: #d48a22; }
.artifacts-bar__ok.is-warning .artifacts-bar__title { color: #875717; }
.artifacts-bar__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.artifacts-bar__dl { display: flex; gap: 10px; }
.artifacts-bar__right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fullview-seg { display: flex; gap: 2px; background: #ece5d8; border-radius: 10px; padding: 3px; }
.fullview-seg__btn { border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 700; padding: 7px 14px; border-radius: 8px; cursor: pointer; transition: background .14s, color .14s; }
.fullview-seg__btn.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(60,50,30,.14); }

/* 全文缩略图栅格（一行多页·识图） */
.fullgrid-scroll { overflow: auto; width: 100%; padding: 26px 30px 40px; }
.fullgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 22px 18px; max-width: 1120px; margin: 0 auto; }
.fpage { border: 0; background: transparent; cursor: pointer; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fpage__preview { position: relative; height: 224px; overflow: hidden; background: #fff; border: 1px solid var(--line-2); border-radius: 4px; box-shadow: 0 6px 16px rgba(60,50,30,.1); transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.fpage:hover .fpage__preview { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(60,50,30,.18); border-color: #d8cdba; }
.fpage__scale { transform: scale(.272); transform-origin: top left; width: 660px; pointer-events: none; }
.fpage__img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.fpage__no { font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }

/* 图片转换失败提示：贴在渲染卡片右上角的透明玻璃质感小警告（不再在顶部铺横幅）。
   默认只露一颗玻璃 chip，点开才展开详情 + 动作。玻璃配方沿用 .docpage-hover（美化1）。 */
.degbadge { position: absolute; top: 14px; right: 20px; z-index: 12; }  /* top 由 JS 按工具条高度实测覆写 */
.degbadge__chip { display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 6px 13px 6px 9px; border-radius: 999px;
  background: rgba(252,247,235,.46); backdrop-filter: blur(16px) saturate(155%); -webkit-backdrop-filter: blur(16px) saturate(155%);
  border: 1px solid rgba(255,255,255,.6); box-shadow: 0 10px 30px rgba(120,80,20,.18), inset 0 1px 0 rgba(255,255,255,.6);
  font-size: 12px; font-weight: 700; color: #875717; transition: transform .14s ease, box-shadow .14s ease; }
.degbadge__chip:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(120,80,20,.24), inset 0 1px 0 rgba(255,255,255,.6); }
.degbadge__ic { width: 17px; height: 17px; border-radius: 50%; background: #e0a030; color: #fff; font-weight: 800; font-size: 12px; line-height: 17px; text-align: center; flex: none; }
.degbadge__txt { font-variant-numeric: tabular-nums; }
.degbadge__pop { position: absolute; top: calc(100% + 8px); right: 0; width: min(480px, calc(100vw - 48px)); max-height: min(620px, calc(100vh - 180px)); overflow: auto; z-index: 13;
  background: rgba(255,253,248,.82); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255,255,255,.7); border-radius: 14px; padding: 14px 15px; box-shadow: 0 18px 44px rgba(60,40,10,.22), inset 0 1px 0 rgba(255,255,255,.55); }
.degbadge__title { font-size: 13px; font-weight: 800; color: #875717; }
.degbadge__desc { margin-top: 4px; font-size: 11.5px; line-height: 1.55; color: var(--ink-soft); }
.degbadge__list { margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 11px; color: var(--muted); list-style: none; }
.degbadge__item { display: grid; grid-template-columns: 84px minmax(0,1fr); gap: 10px; padding: 9px; background: rgba(255,255,255,.58); border: 1px solid rgba(216,205,186,.8); border-radius: 10px; }
.degbadge__thumb { display: block; width: 84px; height: 64px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.degbadge__meta { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.degbadge__name { max-width: 100%; font-size: 12px; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.degbadge__reason { color: #9a5518; font-weight: 700; }
.degbadge__nearby { max-width: 100%; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.degbadge__file { display: none; }
.degbadge__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; }
.degbadge__btn { border: 1px solid var(--accent); background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.degbadge__btn--ghost { background: transparent; border-color: var(--line-2); color: var(--muted); }
.degbadge__btn[disabled] { opacity: .45; cursor: not-allowed; }
.degbadge__soon { font-size: 10px; color: var(--muted); width: 100%; margin-top: -3px; }

@media (max-width: 640px) {
  .degbadge { right: 10px; }
  .degbadge__item { grid-template-columns: 64px minmax(0,1fr); }
  .degbadge__thumb { width: 64px; height: 54px; }
}

/* === 下载后：会话过长提示 === */
.session-prompt { position: absolute; left: 50%; bottom: 24px; transform: translate(-50%, 0); display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid var(--line-2); border-radius: 16px; padding: 14px 18px; box-shadow: var(--sh-card); z-index: 40; max-width: calc(100% - 48px); animation: promptIn .32s ease; }
@keyframes promptIn { from { transform: translate(-50%, 18px); } }
.session-prompt__ic { width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 19px; flex: none; }
.session-prompt__copy { display: flex; flex-direction: column; gap: 2px; }
.session-prompt__copy b { font-size: 14px; }
.session-prompt__copy span { font-size: 12.5px; color: var(--muted); }
.session-prompt__act { display: flex; gap: 9px; }
.session-prompt__act .btn-primary, .session-prompt__act .btn-ghost { padding: 9px 16px; font-size: 13px; }

/* =============================================================
   响应式
   ============================================================= */
@media (max-width: 1080px) {
  .app { grid-template-columns: 320px minmax(0, 1fr); }
  .canvas-vp { padding: 18px; }
}
@media (max-width: 1480px) {
  .app { grid-template-columns: 340px minmax(0, 1fr); }
  .review__main { grid-template-columns: minmax(0, 1fr); }
  .review__side { position: fixed; top: 0; right: 0; bottom: 0; z-index: 82; width: min(360px, calc(100vw - 48px)); border-left: 1px solid var(--line); background: #fbf8f1; box-shadow: -18px 0 44px rgba(60,50,30,.2); transform: translateX(105%); transition: transform .2s ease; }
  .app.is-polish-open .review__side { transform: translateX(0); }
  .review__side-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(251,248,241,.96); backdrop-filter: blur(14px); }
  .review__side-head-title { font-family: var(--serif); font-size: 16px; font-weight: 700; }
  .review__side-close { width: 32px; height: 32px; border: 0; border-radius: 9px; background: #eee7da; color: var(--muted); font-size: 19px; cursor: pointer; }
  .workspace-toggle--polish { position: absolute; right: 18px; bottom: 18px; z-index: 20; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border: 1px solid rgba(191,90,54,.35); border-radius: 999px; background: rgba(255,248,240,.94); color: var(--accent-d); font-size: 13px; font-weight: 800; box-shadow: 0 10px 28px rgba(80,50,20,.2); cursor: pointer; backdrop-filter: blur(14px); }
  .workspace-scrim { position: fixed; inset: 0; z-index: 80; display: block; border: 0; background: rgba(39,33,25,.24); }
  .workspace-scrim[hidden] { display: none; }
  .docpreview__toolbar { align-items: flex-start; }
  .docpreview__tools { flex-wrap: wrap; justify-content: flex-end; }
  .docpreview__scroll { padding: 22px; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); padding-bottom: 78px; }
  .stage { grid-column: 1; grid-row: 1; }
  .chat { position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 82; width: auto; height: 58px; min-height: 0; border: 1px solid var(--line-2); border-radius: 18px; background: rgba(251,248,241,.97); box-shadow: 0 14px 40px rgba(60,50,30,.2); overflow: hidden; transition: height .2s ease, inset .2s ease, border-radius .2s ease; backdrop-filter: blur(18px); }
  .app.is-chat-open .chat { top: 10px; height: auto; border-radius: 20px; }
  .chat__head, .steps, .thread, .composer .chips, .composer__meta { display: none; }
  .app.is-chat-open .chat__head, .app.is-chat-open .steps, .app.is-chat-open .thread, .app.is-chat-open .composer .chips, .app.is-chat-open .composer__meta { display: flex; }
  .composer { margin-top: auto; padding: 7px; box-shadow: none; background: transparent; }
  .composer__box { height: 44px; padding: 3px 3px 3px 12px; border-radius: 13px; }
  .composer__input { min-height: 24px; max-height: 34px; padding: 4px 0; }
  .composer__send { width: 36px; height: 36px; }
  .app.is-chat-open .composer { padding: 10px 16px 16px; background: var(--panel); box-shadow: 0 -1px 0 var(--line); }
  .app.is-chat-open .composer__box { height: auto; min-height: 54px; padding: 8px 8px 8px 14px; border-radius: var(--r-lg); }
  .app.is-chat-open .composer__input { max-height: 120px; }
  .workspace-toggle--chat { position: fixed; left: 16px; bottom: 74px; z-index: 83; display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 12px; border: 1px solid rgba(191,90,54,.35); border-radius: 999px; background: rgba(255,248,240,.96); color: var(--accent-d); font-size: 12px; font-weight: 800; box-shadow: 0 8px 22px rgba(80,50,20,.17); cursor: pointer; backdrop-filter: blur(14px); }
  .app.is-chat-open .workspace-toggle--chat { bottom: auto; top: 20px; left: auto; right: 66px; }
  .workspace-toggle--polish { bottom: 90px; }
  .tabbar { padding-left: 12px; }
  .tpl-rail { padding-inline: 12px; flex-wrap: wrap; overflow-x: visible; }
  .docpreview__toolbar { padding: 9px 12px; gap: 8px; }
  .docpreview__notice { max-width: 100%; }
  .docpreview__tools { width: 100%; justify-content: flex-start; gap: 8px; flex-wrap: wrap; overflow: visible; padding-bottom: 2px; }
  .docpreview__tools > * { flex: none; }
  .docpreview__scroll { padding: 16px 12px 24px; }
}
@media (max-width: 880px) {
  .start-panel { grid-template-columns: 1fr; }
  .start-panel__art { display: none; }
  .start-panel__title { font-size: 30px; }
  .sheet { padding: 28px 22px 34px; }
  .picker__choice-grid { grid-template-columns: 1fr; }
  .picker__pane--colors { position: static; }
  .colorcards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .margin-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .picker__pane { padding: 14px; }
  .tpl-grid, .colorcards { grid-template-columns: 1fr; }
}

/* =============================================================
   === 产物预览：docx-preview 真实排版容器（工具条 + 缩放 + 逐页分隔 + 诚实文案） ===
   本轮新增。预览里的文档 HTML 为运行时注入的真内容（docx-preview 渲染 full_document.docx）。
   ============================================================= */
.docpreview { position: relative; display: flex; flex-direction: column; min-height: 0; height: 100%; }
.docpreview__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 10px 18px; background: rgba(255,255,255,.72); border-bottom: 1px solid var(--line); flex: none; }

/* 常驻诚实文案 */
.docpreview__notice { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: #8a5a12; background: #fff8e8; border: 1px solid #ebd2a7; border-radius: 999px; padding: 6px 12px; }
.docpreview__notice-dot { width: 7px; height: 7px; border-radius: 50%; background: #d48a22; flex: none; }
.docpreview__notice-text { white-space: nowrap; }
.docpreview__info { position: relative; border: 0; background: transparent; color: #b07d2a; font-size: 13px; cursor: help; padding: 0 2px; line-height: 1; }
.docpreview__pop { position: absolute; left: 0; top: 28px; z-index: 50; width: 330px; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--sh-card); padding: 13px 15px; font-size: 12px; font-weight: 500; line-height: 1.75; color: var(--ink-soft); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .16s ease, transform .16s ease, visibility .16s; pointer-events: none; text-align: left; }
.docpreview__pop b { color: var(--ink); }
.docpreview__pop u { text-decoration: none; color: var(--accent-d); font-weight: 700; background: var(--accent-soft); border-radius: 4px; padding: 0 3px; }
.docpreview__info:hover .docpreview__pop, .docpreview__info:focus-visible .docpreview__pop { opacity: 1; visibility: visible; transform: none; }

.docpreview__tools { display: flex; align-items: center; gap: 12px; }
.docpreview__smart { display: inline-flex; align-items: center; gap: 7px; border: 0; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; padding: 9px 16px; border-radius: 10px; cursor: pointer; box-shadow: 0 6px 16px rgba(191,90,54,.24); transition: background .14s ease, transform .14s ease, box-shadow .14s ease; white-space: nowrap; }
.docpreview__smart:hover { background: var(--accent-d); transform: translateY(-1px); }
.docpreview__smart-ic { font-size: 13px; line-height: 1; }
.docpreview__smart.is-reflowing { background: #c9a36a; cursor: progress; box-shadow: none; transform: none; }
.docpreview__smart.is-done { background: var(--ok); box-shadow: none; transform: none; }
.docpreview__feedback { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid rgba(191,90,54,.34); background: #fff7ef; color: var(--accent-d); font-size: 13px; font-weight: 800; padding: 8px 14px; border-radius: 10px; white-space: nowrap; box-shadow: 0 5px 14px rgba(117,72,44,.10); }
.docpreview__feedback:hover { border-color: rgba(191,90,54,.55); background: #fff0e4; }
.docpreview__feedback-ic { width: 17px; height: 17px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-size: 11px; line-height: 1; flex: none; }

.docpreview__zoom { display: flex; align-items: center; gap: 3px; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 3px; box-shadow: var(--sh-pop); }
.dz__btn { border: 0; background: transparent; width: 28px; height: 28px; border-radius: var(--r-sm); cursor: pointer; color: var(--ink-soft); font-size: 16px; }
.dz__btn:hover { background: var(--paper); }
.dz__val { border: 0; background: transparent; min-width: 46px; height: 28px; border-radius: var(--r-sm); cursor: pointer; color: #3a352d; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dz__sep { width: 1px; height: 16px; background: #eee4d4; margin: 0 2px; }
.dz__fit { border: 0; background: #f1ece2; height: 28px; padding: 0 11px; border-radius: var(--r-sm); cursor: pointer; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.dz__fit:hover { background: #ece4d4; }

.docpreview__scroll { flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center; padding: 28px; scrollbar-width: thin; scrollbar-color: #cdc2ae transparent; }
.docpreview__scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.docpreview__scroll::-webkit-scrollbar-thumb { background: #cdc2ae; border-radius: 9px; }
.docpreview__canvas { transform-origin: top center; transition: transform .16s ease; height: max-content; }

/* docx-preview 输出适配暖纸主题（双类选择器盖过库注入的内联样式） */
.docpreview .docx-wrapper { background: transparent; padding: 0; gap: 26px; box-shadow: none; }
.docpreview .docx-wrapper > section.docx, .docpreview section.docx { margin: 0 auto; background: #fff; box-shadow: var(--sh-page); border-radius: 4px; }

/* 每页 = 独立可悬停单元（为单页重排回路留挂点） */
.docpage-unit { position: relative; transition: box-shadow .16s ease; }
.docpage-unit:hover { box-shadow: 0 22px 56px rgba(60,50,30,.24); }
.docpage-unit::after { content: ""; position: absolute; inset: 0; border: 2px solid transparent; border-radius: 4px; pointer-events: none; transition: border-color .16s ease; }
.docpage-unit:hover::after { border-color: rgba(191,90,54,.32); }
/* 美化1：hover 提醒——统一的磨砂玻璃胶囊（页码直接落在玻璃上、按钮为干净的强调胶囊），
   不再是两块实底色块叠在一起。更通透、更精致。 */
.docpage-hover { position: absolute; top: 10px; right: 10px; z-index: 5; display: flex; align-items: center; gap: 9px; opacity: 0; transform: translateY(-5px); transition: opacity .18s ease, transform .18s ease;
  padding: 5px 6px 5px 13px; border-radius: 999px;
  background: rgba(252,250,245,.5); backdrop-filter: blur(16px) saturate(155%); -webkit-backdrop-filter: blur(16px) saturate(155%);
  border: 1px solid rgba(255,255,255,.6); box-shadow: 0 10px 30px rgba(60,50,30,.18), inset 0 1px 0 rgba(255,255,255,.55); }
.docpage-unit:hover .docpage-hover { opacity: 1; transform: none; }
.docpage-hover__no { font-size: 11.5px; font-weight: 800; color: #5b5346; background: none; padding: 0; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.docpage-hover__btn { border: 0; background: rgba(191,90,54,.94); color: #fff; font-size: 11.5px; font-weight: 700; padding: 6px 13px; border-radius: 999px; cursor: pointer; box-shadow: 0 3px 11px rgba(191,90,54,.34); transition: background .14s; }
.docpage-hover__btn:hover { background: var(--accent-d); }
/* 卡 J：后端判定的「建议重排」候选页——按钮加一圈柔和光环 + 轻微呼吸，提示这页值得重排 */
.docpage-hover__btn--relayout.is-suggested { box-shadow: 0 0 0 2px rgba(255,255,255,.7), 0 3px 14px rgba(191,90,54,.5); animation: relayoutPulse 1.8s ease-in-out infinite; }
@keyframes relayoutPulse { 0%,100% { box-shadow: 0 0 0 2px rgba(255,255,255,.6), 0 3px 12px rgba(191,90,54,.4); } 50% { box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 4px 18px rgba(191,90,54,.6); } }

/* 问题6：轻量瞬时 toast（「已是当前版本」等，不进对话区） */
.app-toast { position: fixed; left: 50%; bottom: 38px; transform: translate(-50%, 8px); z-index: 9999;
  background: rgba(43,39,34,.92); color: #fff; font-size: 12.5px; font-weight: 600; padding: 9px 16px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,.22); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.app-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.feedback-modal { position: fixed; inset: 0; z-index: 9998; display: flex; align-items: center; justify-content: center; padding: 22px; background: rgba(30,24,18,.32); backdrop-filter: blur(3px); }
.feedback-card { width: min(460px, 100%); background: #fffdf8; border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 22px 70px rgba(44,34,22,.24); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.feedback-card__title { font-family: var(--serif); font-size: 20px; font-weight: 800; color: var(--ink); }
.feedback-card__desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.feedback-card__text { width: 100%; min-height: 118px; resize: vertical; border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 12px; font-family: inherit; font-size: 14px; line-height: 1.6; background: #fff; color: var(--ink); outline: none; }
.feedback-card__text:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.feedback-card__file-row { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.feedback-card__file-row .btn-outline::before { content: "↑"; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-size: 12px; line-height: 1; }
.feedback-card__file-input { display: none; }
.feedback-card__file-name { min-width: 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feedback-card__err { min-height: 18px; font-size: 12.5px; color: #9e3c25; }
.feedback-card__actions { display: flex; justify-content: flex-end; gap: 9px; }
.docpage-unit.is-reflowing::after { border-color: var(--accent); animation: reflowGlow 1.1s ease-in-out infinite; }
@keyframes reflowGlow { 0%,100% { box-shadow: inset 0 0 0 0 rgba(191,90,54,0); } 50% { box-shadow: inset 0 0 44px 0 rgba(191,90,54,.12); } }
.docpage-reflow { position: absolute; top: 10px; left: 10px; z-index: 6; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: #8a5a12; background: #fff8e8; border: 1px solid #ebd2a7; border-radius: 7px; padding: 5px 10px; box-shadow: var(--sh-pop); }
.docpage-reflow.is-done { color: #2c5a3c; background: #e6efe8; border-color: #bfd9c6; }

/* 加载 / 错误占位 */
.docpreview__state { width: min(440px,100%); margin: 40px auto; text-align: center; background: rgba(255,255,255,.86); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: 38px 30px; box-shadow: var(--sh-pop); }
.docpreview__state-title { font-family: var(--serif); font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.docpreview__state-desc { font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 16px; }
.docpreview__state--error .docpreview__state-ic { width: 38px; height: 38px; border-radius: 11px; background: #d48a22; color: #fff; font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.docpreview__spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #ece5d8; border-top-color: var(--accent); margin: 0 auto 16px; animation: spin 1s linear infinite; }
.dz-spin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .8s linear infinite; vertical-align: -1px; }

/* 缩略图·多页：docx-preview 渲染页缩放克隆（真内容缩略图） */
.docpreview--grid { height: 100%; }
.fpage__docscale { transform: scale(.227); transform-origin: top left; width: 794px; pointer-events: none; }
.fpage__docscale section.docx, .fpage__docscale .docx-wrapper > section { box-shadow: none !important; margin: 0 !important; }

/* 需求表单：渲染引擎徽标「兼容优化逐步上线」 */
.field__q-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.field__badge { font-size: 11px; font-weight: 800; letter-spacing: .02em; color: var(--accent-d); background: var(--accent-soft); border: 1px solid rgba(191,90,54,.22); border-radius: 999px; padding: 3px 10px; }

/* =============================================================
   === PDF.js 适配（2026-06-29：渲染内核 docx-preview → PDF.js）===
   每页 = .docpage-unit 内一个 <canvas>，由 PDF.js 渲染导出 PDF 的真实版面。
   上面 docx-preview 的 .docx-wrapper / section.docx 规则在 PDF.js 下不命中
   （无害，保留以便与 CD 设计块对照）；下面是 canvas 版页单元的实际样式。
   ============================================================= */
.docpreview__canvas .docx-host { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.docpreview__canvas .docpage-unit { background: #fff; box-shadow: var(--sh-page); border-radius: 4px; line-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.docpreview__canvas .docx-host { gap: 26px; }
.docpage-canvas { display: block; max-width: 100%; border-radius: 4px; }
.docpreview__canvas .docpage-unit > .docpreview__spin { margin: 40px; }
/* 缩略图·多页：PDF.js 直接渲染缩略 canvas（不再走 docx 克隆 .fpage__docscale）。
   单元用 JS 设 aspect-ratio = 该页真实尺寸比例 + height:auto，canvas 填满 → 整页完整不裁切。 */
.fpage__preview canvas.fpage__img { width: 100%; height: 100%; display: block; object-fit: contain; }

/* === 真 app 首页项目区状态：加载 / 空 / 加载失败可重试（#14 不再铺 demo 假项目）=== */
.home-state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 52px 24px; text-align: center; }
.home-state__title { font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--ink); }
.home-state__desc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.home-state__spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #ece5d8; border-top-color: var(--accent); animation: spin 1s linear infinite; margin-bottom: 8px; }
.home-state .btn-primary { margin-top: 12px; }

/* === 模板库 MVP：「我的模板」区 + 「存为模板」内联表单（只求走通，美化走 Claude Design）=== */
.mytpl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.mytpl-card { position: relative; text-align: left; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
.mytpl-card:hover { transform: translateY(-2px); border-color: #b8853f; box-shadow: 0 10px 20px -10px rgba(74,54,20,.35); }
.mytpl-card.is-busy { opacity: .55; pointer-events: none; }
.mytpl-card__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mytpl-card__dot { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 1px solid rgba(0,0,0,.08); }
.mytpl-card__name { font-weight: 700; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mytpl-card__base { margin-top: 6px; font-size: 12px; color: var(--ink-soft); }
.mytpl-card__del { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; line-height: 18px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); font-size: 14px; cursor: pointer; }
.mytpl-card__del:hover { background: #f2e6df; color: var(--accent-d); }
@media (max-width: 1200px) { .mytpl-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .mytpl-grid { grid-template-columns: repeat(2, 1fr); } }

.savetpl { display: inline-flex; align-items: center; }
.savetpl__btn { padding: 8px 14px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-soft); font-weight: 700; font-size: 13px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.savetpl__btn:hover { border-color: #d8cdba; background: var(--paper); }
.savetpl__form { display: inline-flex; align-items: center; gap: 6px; }
.savetpl__input { width: 180px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px; font-size: 13px; color: var(--ink); background: #fff; }
.savetpl__ok { padding: 8px 12px; border-radius: 10px; font-size: 13px; cursor: pointer; white-space: nowrap; box-shadow: none; }
.savetpl__cancel { padding: 8px 12px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-soft); font-weight: 700; font-size: 13px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
