/* ═══════════════════════════════════════════════════════
   DeepQuote — RFQ 智能評估工作台
   玻璃擬態 · 銀白主題 (Glassmorphism Silver)
   ═══════════════════════════════════════════════════════ */

:root {
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .8);
  --glass-inner: rgba(255, 255, 255, .55);
  --line: rgba(28, 35, 51, .10);
  --line-soft: rgba(28, 35, 51, .055);
  --txt-0: #1c2333;
  --txt-1: #4a5568;
  --txt-2: #8a94a8;
  --cyan: #2470d8;
  --cyan-soft: rgba(36, 112, 216, .09);
  --teal: #0b9e86;
  --violet: #7752d8;
  --amber: #b97b08;
  --red: #d84848;
  --red-soft: rgba(216, 72, 72, .07);
  --green: #188a52;
  --green-soft: rgba(24, 138, 82, .08);
  --shadow: 0 10px 36px rgba(45, 62, 110, .10);
  --shadow-soft: 0 4px 18px rgba(45, 62, 110, .07);
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Inter", "Noto Sans TC", "PingFang TC", -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background:
    radial-gradient(1000px 520px at 88% -12%, rgba(110, 155, 255, .20), transparent 60%),
    radial-gradient(860px 480px at -6% 110%, rgba(60, 200, 175, .16), transparent 60%),
    radial-gradient(700px 400px at 55% 115%, rgba(150, 120, 235, .10), transparent 60%),
    linear-gradient(165deg, #f5f7fc 0%, #e9edf5 52%, #f0f2f9 100%);
  background-attachment: fixed;
  color: var(--txt-0);
  font-size: 14px;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(28, 35, 51, .18); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

#shell { display: flex; flex-direction: column; height: 100vh; }

/* ─────────── 頂欄 ─────────── */
#topbar {
  display: flex; align-items: center; gap: 28px;
  padding: 14px 26px;
  border-bottom: 1px solid rgba(255, 255, 255, .65);
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: var(--shadow-soft);
  z-index: 5;
}
.tb-brand { display: flex; align-items: center; gap: 12px; }
.tb-logo {
  width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #fff;
  background: linear-gradient(135deg, #3d86e8, #17b39a);
  box-shadow: 0 6px 18px rgba(45, 120, 220, .35);
}
.tb-name { line-height: 1.25; }
.tb-name b { font-size: 16.5px; letter-spacing: .3px; color: var(--txt-0); }
.tb-name em {
  display: block; font-style: normal;
  font-size: 11px; color: var(--txt-2); letter-spacing: .4px;
}

.tb-cases { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tb-cases-label {
  font-size: 10px; letter-spacing: 1px; color: var(--txt-2);
  margin-right: 2px;
}
.case {
  display: flex; align-items: center; gap: 10px;
  background: var(--glass-inner); border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 12px; padding: 8px 16px 8px 13px;
  color: var(--txt-1); text-align: left;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  transition: all .2s;
}
.case:hover { border-color: rgba(36, 112, 216, .3); color: var(--txt-0); }
.case.active {
  border-color: rgba(36, 112, 216, .45);
  background: rgba(255, 255, 255, .85);
  color: var(--txt-0);
  box-shadow: 0 6px 22px rgba(36, 112, 216, .16);
}
.case-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.case-dot.risk { background: var(--red); box-shadow: 0 0 7px rgba(216, 72, 72, .5); }
.case-dot.warn { background: #e0a010; box-shadow: 0 0 7px rgba(224, 160, 16, .5); }
.case-txt b { display: block; font-size: 12.5px; font-family: var(--mono); font-weight: 600; }
.case-txt i { display: block; font-style: normal; font-size: 10.5px; color: var(--txt-2); margin-top: 1px; }

.tb-actions { display: flex; align-items: center; gap: 12px; }
.btn-replay {
  background: var(--glass-inner); border: 1px solid rgba(255, 255, 255, .75);
  color: var(--txt-1); border-radius: 10px;
  padding: 9px 16px; font-size: 12.5px;
  box-shadow: var(--shadow-soft);
  transition: all .2s;
}
.btn-replay:hover { border-color: rgba(36, 112, 216, .4); color: var(--cyan); }
.tb-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #8a6fe0, #6d5bd0);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff;
  box-shadow: 0 4px 12px rgba(109, 91, 208, .35);
}

/* ─────────── 三欄工作區 ─────────── */
#workspace {
  flex: 1; display: grid;
  grid-template-columns: 340px 1fr 400px;
  gap: 14px; padding: 14px 18px;
  min-height: 0;
}
.panel {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 18px;
  backdrop-filter: blur(26px) saturate(1.5);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 9px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.ph-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #e0a010; box-shadow: 0 0 8px rgba(224, 160, 16, .6);
}
.ph-dot-agent { background: var(--cyan); box-shadow: 0 0 8px rgba(36, 112, 216, .55); }
.ph-dot-art { background: var(--teal); box-shadow: 0 0 8px rgba(11, 158, 134, .55); }
.ph-title { font-size: 12.5px; font-weight: 650; letter-spacing: .3px; }
.ph-title i { font-style: normal; font-weight: 400; color: var(--txt-2); font-size: 10.5px; margin-left: 6px; }
.ph-badge {
  margin-left: auto; font-size: 10px; font-family: var(--mono);
  color: var(--txt-2); border: 1px solid var(--line);
  background: rgba(255, 255, 255, .5);
  border-radius: 20px; padding: 3px 9px;
  transition: all .3s;
}
.ph-badge.live { color: var(--cyan); border-color: rgba(36, 112, 216, .35); animation: pulse-badge 1.6s infinite; }
.ph-badge.done { color: var(--green); border-color: rgba(24, 138, 82, .35); }
@keyframes pulse-badge { 50% { box-shadow: 0 0 10px rgba(36, 112, 216, .3); } }

.panel-body { flex: 1; overflow-y: auto; padding: 16px; scroll-behavior: smooth; }

/* ─────────── 左欄：Gmail 郵件檢視 ─────────── */
.gmail-host { padding: 0 !important; background: rgba(246, 248, 252, .6); }

.gmail {
  background: #fff; min-height: 100%;
  font-family: "Google Sans", Roboto, "Noto Sans TC", Arial, sans-serif;
  color: #202124;
  animation: fade-up .4s ease both;
}

/* Gmail 上方工具列 */
.gm-toolbar {
  display: flex; align-items: center; gap: 2px;
  padding: 8px 10px; border-bottom: 1px solid #e8eaed;
  position: sticky; top: 0; background: #fff; z-index: 2;
}
.gm-tb-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: none;
  display: flex; align-items: center; justify-content: center;
}
.gm-tb-btn:hover { background: #f1f3f4; }
.gm-tb-btn svg { width: 17px; height: 17px; fill: #444746; }
.gm-tb-sep { width: 1px; height: 20px; background: #e8eaed; margin: 0 5px; }
.gm-tb-count {
  margin-left: auto; font-size: 12px; color: #444746;
  display: flex; align-items: center; gap: 12px; padding-right: 4px;
}

/* 主旨列 */
.gm-subject { padding: 16px 20px 4px; display: flex; align-items: flex-start; gap: 10px; }
.gm-subject h1 {
  font-size: 18.5px; font-weight: 400; line-height: 1.4;
  color: #1f1f1f; flex: 1;
}
.gm-label {
  font-size: 11px; color: #444746; background: #eff1f2;
  border-radius: 4px; padding: 2px 7px; margin-top: 4px;
  white-space: nowrap;
}

/* 寄件人列 */
.gm-sender { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px 6px 20px; }
.gm-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px; font-weight: 500;
}
.gm-who { flex: 1; min-width: 0; }
.gm-name { font-size: 13.5px; font-weight: 600; color: #1f1f1f; }
.gm-addr { font-weight: 400; font-size: 12px; color: #5e5e5e; }
.gm-to { font-size: 12px; color: #5e5e5e; margin-top: 1px; }
.gm-to .caret { font-size: 9px; }
.gm-right { display: flex; align-items: center; gap: 2px; flex-shrink: 0; color: #444746; }
.gm-time { font-size: 11.5px; color: #5e5e5e; margin-right: 4px; white-space: nowrap; }
.gm-right .gm-ic {
  font-size: 15px; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.gm-right .gm-ic:hover { background: #f1f3f4; }

/* 內文 */
.gm-body {
  padding: 14px 20px 6px 72px;
  font-size: 13.5px; line-height: 1.8; color: #222;
}
.gm-body p { margin-bottom: 14px; }
.gm-sig { color: #5e5e5e; font-size: 12.5px; line-height: 1.6; }

/* 高亮(白底信件上的螢光筆效果) */
.hl { border-radius: 3px; padding: 0 2px; transition: all .4s; }
.hl.lit {
  background: #fef3a2; color: #1f1f1f;
  box-shadow: 0 0 0 2px #fef3a2;
  animation: hl-pop .5s ease;
}
.hl.lit-warn {
  background: #fce8e6; color: #c5221f; font-weight: 600;
  box-shadow: 0 0 0 2px #fce8e6;
  animation: hl-pop .5s ease;
}
@keyframes hl-pop { 0% { transform: scale(.94); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* 附件卡 */
.gm-attach { margin: 6px 20px 0 72px; }
.gm-attach-head {
  font-size: 12px; color: #5e5e5e; padding: 12px 0 10px;
  border-top: 1px solid #e8eaed;
}
.gm-attach-card {
  width: 182px; border: 1px solid #dadce0; border-radius: 10px;
  overflow: hidden; cursor: pointer; transition: box-shadow .2s;
  background: #fff;
}
.gm-attach-card:hover { box-shadow: 0 1px 5px rgba(0,0,0,.18); }
.gm-attach-preview {
  height: 86px; background: #f8f9fa;
  display: flex; align-items: center; justify-content: center;
}
.gm-attach-preview .pdf-big {
  width: 38px; height: 48px; background: #fff;
  border: 1px solid #dadce0; border-radius: 3px; position: relative;
}
.gm-attach-preview .pdf-big::after {
  content: "PDF"; position: absolute; left: -6px; bottom: 8px;
  background: #d93025; color: #fff; font-size: 8.5px; font-weight: 700;
  padding: 2px 5px; border-radius: 2px; letter-spacing: .5px;
}
.gm-attach-foot {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 10px; border-top: 1px solid #e8eaed;
}
.gm-attach-foot .pdf-ico {
  width: 16px; height: 16px; border-radius: 3px; flex-shrink: 0;
  background: #d93025; color: #fff; font-size: 6.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.gm-attach-foot .fname {
  font-size: 11px; color: #202124;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gm-attach-size { font-size: 10.5px; color: #5e5e5e; margin-top: 6px; }

/* 回覆 / 轉寄 */
.gm-actions { display: flex; gap: 10px; padding: 18px 20px 24px 72px; }
.gm-actions button {
  display: flex; align-items: center; gap: 7px;
  border: 1px solid #747775; background: #fff; color: #1f1f1f;
  border-radius: 18px; padding: 7px 18px; font-size: 13px;
  font-family: inherit;
}
.gm-actions button:hover { background: #f8fafd; }

/* ─────────── 中欄：AI 分析流 ─────────── */
#agent-stream { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }

.step {
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 15px;
  background: var(--glass-strong);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  animation: fade-up .45s ease both;
  transition: border-color .3s, box-shadow .3s;
}
.step.running { border-color: rgba(36, 112, 216, .4); box-shadow: 0 8px 28px rgba(36, 112, 216, .13); }
.step.alert-step.running { border-color: rgba(216, 72, 72, .4); box-shadow: 0 8px 28px rgba(216, 72, 72, .12); }

.step-head {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 15px; cursor: pointer; user-select: none;
}
.step-num {
  font-family: var(--mono); font-size: 10px; color: var(--txt-2);
  width: 22px; flex-shrink: 0;
}
.step-status { width: 18px; height: 18px; flex-shrink: 0; position: relative; }
.step-status .spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(36, 112, 216, .2); border-top-color: var(--cyan);
  animation: spin .7s linear infinite;
}
.step-status .check {
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--green-soft); border: 1px solid rgba(24, 138, 82, .45);
  color: var(--green); font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}
.step-status .check.warn { background: var(--red-soft); border-color: rgba(216, 72, 72, .45); color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }

.step-title { font-size: 13.5px; font-weight: 650; }
.step-tool {
  margin-left: auto; flex-shrink: 0;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .5px;
  color: var(--violet); background: rgba(119, 82, 216, .08);
  border: 1px solid rgba(119, 82, 216, .22);
  padding: 3px 8px; border-radius: 6px;
}
.step-result-chip {
  font-size: 10.5px; padding: 3px 9px; border-radius: 20px; flex-shrink: 0;
  display: none;
}
.step.done .step-result-chip { display: inline-block; }
.chip-ok { background: var(--green-soft); color: var(--green); border: 1px solid rgba(24, 138, 82, .3); }
.chip-warn { background: var(--red-soft); color: var(--red); border: 1px solid rgba(216, 72, 72, .3); }
.chip-info { background: var(--cyan-soft); color: var(--cyan); border: 1px solid rgba(36, 112, 216, .3); }

.step-body { padding: 2px 15px 15px 48px; display: flex; flex-direction: column; gap: 10px; }
.step.collapsed .step-body { display: none; }
.step.done .step-head:hover { background: rgba(28, 35, 51, .025); }

/* 推理文字(打字流) */
.think {
  font-size: 12.5px; color: var(--txt-1); line-height: 1.9;
  background: rgba(28, 35, 51, .035);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px 13px;
}
.think .caret {
  display: inline-block; width: 7px; height: 14px; margin-left: 2px;
  background: var(--cyan); vertical-align: -2px;
  animation: blink .8s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* 參數萃取網格 */
.param-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.param {
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 2px 10px rgba(45, 62, 110, .06);
  border-radius: 11px; padding: 9px 12px;
  animation: fade-up .4s ease both;
}
.param .pk { font-size: 10px; color: var(--txt-2); letter-spacing: .5px; margin-bottom: 3px; }
.param .pv { font-size: 13.5px; font-weight: 650; font-family: var(--mono); color: var(--cyan); }
.param .pv small { font-size: 10px; color: var(--txt-2); font-weight: 400; margin-left: 4px; }
.param.warn .pv { color: var(--red); }
.param.note .pv { color: var(--amber); }

/* 警示卡 */
.alert-card {
  border: 1px solid rgba(216, 72, 72, .3); border-radius: 13px;
  background: linear-gradient(180deg, rgba(216, 72, 72, .08), rgba(216, 72, 72, .02)),
              rgba(255, 255, 255, .6);
  padding: 13px 15px;
  animation: alert-in .5s ease both;
}
@keyframes alert-in {
  0% { opacity: 0; transform: translateY(10px) scale(.97); }
  60% { transform: translateY(0) scale(1.015); }
  100% { opacity: 1; transform: none; }
}
.alert-card .ac-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; color: var(--red);
  margin-bottom: 8px;
}
.alert-card.amber {
  border-color: rgba(185, 123, 8, .32);
  background: linear-gradient(180deg, rgba(224, 160, 16, .09), rgba(224, 160, 16, .02)),
              rgba(255, 255, 255, .6);
}
.alert-card.amber .ac-head { color: var(--amber); }
.alert-card .ac-body { font-size: 12px; color: var(--txt-1); line-height: 1.85; }
.alert-card .ac-body b { color: var(--txt-0); }
.alert-card .ac-fix {
  margin-top: 9px; padding: 8px 11px; border-radius: 9px;
  background: rgba(24, 138, 82, .07); border: 1px dashed rgba(24, 138, 82, .35);
  font-size: 11.5px; color: var(--green); line-height: 1.8;
}

/* 情報引用卡 */
.intel-card {
  display: flex; gap: 11px;
  border: 1px solid rgba(255, 255, 255, .9); border-radius: 12px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 2px 10px rgba(45, 62, 110, .06);
  padding: 11px 13px;
  animation: fade-up .4s ease both;
}
.intel-card .ic-ico {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; background: rgba(119, 82, 216, .1); color: var(--violet);
}
.intel-card .ic-src { font-size: 10px; font-family: var(--mono); color: var(--violet); letter-spacing: .4px; }
.intel-card .ic-title { font-size: 12px; font-weight: 650; margin: 2px 0 4px; }
.intel-card .ic-quote { font-size: 11.5px; color: var(--txt-1); line-height: 1.75; }
.intel-card .ic-quote b { color: var(--amber); }

/* BOM / 資料表 */
.mini-table {
  border: 1px solid rgba(255, 255, 255, .9); border-radius: 12px;
  overflow: hidden; animation: fade-up .4s ease both;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 2px 10px rgba(45, 62, 110, .06);
}
.mini-table .mt-title {
  font-size: 11px; font-weight: 650; letter-spacing: .4px;
  padding: 8px 12px; background: rgba(28, 35, 51, .04); color: var(--txt-1);
  border-bottom: 1px solid var(--line-soft);
}
.mini-table table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.mini-table th {
  text-align: left; font-size: 10px; color: var(--txt-2); font-weight: 500;
  padding: 7px 12px; border-bottom: 1px solid var(--line-soft); letter-spacing: .4px;
}
.mini-table td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); color: var(--txt-1); }
.mini-table tr:last-child td { border-bottom: none; }
.mini-table td.mono, .mini-table .mono { font-family: var(--mono); font-size: 11px; }
.mini-table .tag-risk { color: var(--red); font-weight: 600; }
.mini-table .tag-ok { color: var(--green); font-weight: 600; }
.mini-table .tag-note { color: var(--amber); font-weight: 600; }

/* 草稿 / 建議卡 */
.talk-card {
  border: 1px solid rgba(36, 112, 216, .25); border-radius: 13px;
  background: linear-gradient(180deg, rgba(36, 112, 216, .06), transparent),
              rgba(255, 255, 255, .65);
  padding: 13px 15px; animation: fade-up .45s ease both;
}
.talk-card .tc-label {
  font-size: 10px; letter-spacing: 1px; color: var(--cyan);
  font-weight: 700; margin-bottom: 7px;
}
.talk-card .tc-body { font-size: 12px; line-height: 1.9; color: var(--txt-1); }
.talk-card .tc-body b { color: var(--txt-0); }
.talk-card .tc-quote {
  margin-top: 8px; padding: 10px 13px; border-radius: 10px;
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(36, 112, 216, .18);
  box-shadow: 0 2px 8px rgba(45, 62, 110, .05);
  font-size: 11.5px; color: var(--txt-1); line-height: 1.85;
  font-style: italic;
}

/* 報價方案比較 */
.dual-quote { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quote-opt {
  border: 1px solid rgba(255, 255, 255, .9); border-radius: 13px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 2px 10px rgba(45, 62, 110, .06);
  padding: 12px 14px;
  animation: fade-up .45s ease both;
}
.quote-opt.reco { border-color: rgba(11, 158, 134, .45); box-shadow: 0 6px 20px rgba(11, 158, 134, .13); }
.quote-opt .qo-tag {
  font-size: 9.5px; letter-spacing: .8px; font-weight: 700;
  color: var(--txt-2); margin-bottom: 5px;
}
.quote-opt.reco .qo-tag { color: var(--teal); }
.quote-opt .qo-name { font-size: 13px; font-weight: 650; margin-bottom: 8px; }
.quote-opt .qo-row { display: flex; justify-content: space-between; font-size: 11.5px; margin: 4px 0; color: var(--txt-1); }
.quote-opt .qo-row b { font-family: var(--mono); color: var(--txt-0); }
.quote-opt .qo-row b.good { color: var(--teal); }
.quote-opt .qo-row b.bad { color: var(--red); }

/* ─────────── 右欄：輸出文件 ─────────── */
#artifact-stack { display: flex; flex-direction: column; gap: 14px; }
#artifact-stack > * { flex-shrink: 0; }
.artifact {
  border: 1px solid rgba(255, 255, 255, .85); border-radius: 15px;
  background: var(--glass-strong);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  animation: art-in .55s cubic-bezier(.2,.9,.3,1.1) both;
}
@keyframes art-in {
  0% { opacity: 0; transform: translateX(24px) scale(.96); }
  100% { opacity: 1; transform: none; }
}
.artifact .art-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
  font-size: 11.5px; font-weight: 650;
}
.artifact .art-head .ah-ico { color: var(--teal); }
.artifact .art-head .ah-tag {
  margin-left: auto; font-family: var(--mono); font-size: 9px;
  color: var(--txt-2); letter-spacing: .5px;
}
.artifact .art-body { padding: 12px 14px; }
.artifact svg { display: block; width: 100%; height: auto; }
.art-caption { font-size: 10.5px; color: var(--txt-2); line-height: 1.7; padding: 0 14px 12px; }

/* 提案完成卡 */
.final-card {
  border: 1px solid rgba(11, 158, 134, .4); border-radius: 15px;
  background: linear-gradient(160deg, rgba(11, 158, 134, .09), rgba(36, 112, 216, .04)),
              var(--glass-strong);
  box-shadow: 0 8px 26px rgba(11, 158, 134, .13);
  padding: 16px; animation: art-in .6s ease both;
}
.final-card .fc-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 700; color: var(--teal); margin-bottom: 10px;
}
.final-card .fc-rows { display: flex; flex-direction: column; gap: 6px; }
.final-card .fc-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--txt-1); }
.final-card .fc-row b { font-family: var(--mono); color: var(--txt-0); }
.final-card .fc-note {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(11, 158, 134, .3);
  font-size: 11px; color: var(--txt-1); line-height: 1.8;
}
.final-card .fc-actions { display: flex; gap: 8px; margin-top: 12px; }
.final-card .fc-actions button {
  flex: 1; padding: 8px 0; border-radius: 9px; font-size: 11.5px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .7); color: var(--txt-1);
  transition: all .2s;
}
.final-card .fc-actions button:hover { border-color: var(--teal); color: var(--teal); }
.final-card .fc-actions button.primary {
  background: rgba(11, 158, 134, .12); border-color: rgba(11, 158, 134, .45); color: var(--teal);
  font-weight: 600;
}

/* ─────────── 產物聚焦展示(放大 → 飛回) ─────────── */
.zoom-overlay { position: fixed; inset: 0; z-index: 60; }
.zoom-backdrop {
  position: absolute; inset: 0;
  background: rgba(235, 240, 248, .5);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  animation: fade-in .4s ease both;
  transition: opacity .55s;
}
@keyframes fade-in { from { opacity: 0; } }
.zoom-wrap {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.zoom-card {
  width: min(700px, 66vw);
  border-radius: 20px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: 0 30px 90px rgba(45, 62, 110, .28);
  backdrop-filter: blur(30px);
  overflow: hidden;
  animation: zoom-in .55s cubic-bezier(.2,.9,.3,1.08) both;
}
@keyframes zoom-in {
  0% { opacity: 0; transform: scale(.72) translateY(26px); }
  100% { opacity: 1; transform: none; }
}
.zoom-card .art-head { font-size: 14.5px; padding: 15px 20px; }
.zoom-card .art-head .ah-tag { font-size: 10.5px; }
.zoom-card .art-body { padding: 18px 26px; }
.zoom-card .art-caption { font-size: 12.5px; padding: 0 26px 18px; color: var(--txt-1); }
.zoom-card svg { display: block; width: 100%; height: auto; }
.zoom-card.final-card { padding: 24px; animation: zoom-in .55s cubic-bezier(.2,.9,.3,1.08) both; }
.zoom-card.final-card .fc-title { font-size: 16px; }
.zoom-card.final-card .fc-row { font-size: 13.5px; }
.zoom-card.final-card .fc-note { font-size: 12.5px; }

.zoom-hint {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 40px;
  font-size: 11px; letter-spacing: 1.5px; color: var(--txt-2);
  animation: fade-in .8s .4s ease both;
}

.artifact.landed, .final-card.landed { animation: land-pop .5s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes land-pop {
  0% { opacity: .4; transform: scale(.94); }
  60% { transform: scale(1.02); }
  100% { opacity: 1; transform: none; }
}

/* ─────────── 文件視窗(PDF / RD 覆核 / 報價單) ─────────── */
.doc-overlay { position: fixed; inset: 0; z-index: 80; }
.doc-backdrop {
  position: absolute; inset: 0;
  background: rgba(225, 232, 244, .55);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  animation: fade-in .3s ease both;
}
.doc-modal {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 82vw); max-height: 86vh;
  display: flex; flex-direction: column;
  border-radius: 20px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: 0 30px 90px rgba(45, 62, 110, .3);
  backdrop-filter: blur(30px);
  overflow: hidden;
  animation: modal-in .45s cubic-bezier(.2,.9,.3,1.08) both;
}
@keyframes modal-in {
  0% { opacity: 0; transform: translate(-50%, -46%) scale(.92); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.doc-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.doc-head .dh-ico { color: var(--teal); }
.doc-head b { font-size: 14px; }
.doc-head .dh-tag {
  font-family: var(--mono); font-size: 10px; color: var(--txt-2);
  border: 1px solid var(--line); border-radius: 20px; padding: 2px 9px;
}
.doc-close {
  margin-left: auto; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: rgba(28, 35, 51, .05); color: var(--txt-1);
  font-size: 13px;
}
.doc-close:hover { background: rgba(216, 72, 72, .1); color: var(--red); }
.doc-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.doc-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .6); flex-shrink: 0;
}
.doc-foot-note { font-size: 10.5px; color: var(--txt-2); margin-right: auto; }
.doc-btn {
  padding: 8px 18px; border-radius: 9px; font-size: 12px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .8); color: var(--txt-1);
  transition: all .2s;
}
.doc-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.doc-btn.primary {
  background: var(--cyan); border-color: var(--cyan); color: #fff; font-weight: 600;
}
.doc-btn.primary:hover { background: #1c5fc0; color: #fff; }
.doc-btn.primary.sent {
  background: var(--green-soft); border-color: rgba(24, 138, 82, .4);
  color: var(--green); cursor: default;
}

/* 紙本文件(提案書 / 報價單) */
.paper {
  position: relative;
  background: #fff; border: 1px solid #e3e7ef; border-radius: 6px;
  box-shadow: 0 3px 16px rgba(45, 62, 110, .08);
  padding: 26px 30px;
  font-size: 12px; color: #2a3242; overflow: hidden;
}
.paper-mark {
  position: absolute; top: 42%; left: 50%;
  transform: translate(-50%, -50%) rotate(-24deg);
  font-size: 92px; font-weight: 800; letter-spacing: 12px;
  color: rgba(216, 72, 72, .06); pointer-events: none; user-select: none;
}
.pp-head {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 14px; border-bottom: 2px solid #2a3242; margin-bottom: 18px;
}
.pp-logo {
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  background: linear-gradient(135deg, #3d86e8, #17b39a);
  color: #fff; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.pp-co b { display: block; font-size: 12.5px; letter-spacing: .3px; }
.pp-co span { display: block; font-size: 9.5px; color: #78829a; margin-top: 2px; }
.pp-ref {
  margin-left: auto; text-align: right;
  font-family: var(--mono); font-size: 9.5px; color: #78829a; line-height: 1.6;
}
.pp-title { font-size: 21px; font-weight: 700; letter-spacing: .5px; }
.pp-title-zh { font-size: 14px; font-weight: 500; color: #78829a; margin-left: 8px; }
.pp-sub { font-size: 12px; color: #4a5568; margin: 5px 0 16px; }
.pp-meta { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.pp-meta td { padding: 6px 10px; border: 1px solid #e8ecf3; font-size: 11px; }
.pp-meta td:first-child { width: 130px; background: #f6f8fb; color: #78829a; }
.pp-sec {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  color: #2470d8; margin: 16px 0 8px;
  padding-bottom: 4px; border-bottom: 1px solid #e8ecf3;
}
.pp-toc-row {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 11.5px; padding: 4px 0; color: #2a3242;
}
.pp-toc-row i { flex: 1; border-bottom: 1px dotted #c6cede; }
.pp-toc-row b { font-family: var(--mono); font-size: 10px; color: #78829a; font-weight: 500; }
.pp-fig {
  border: 1px solid #e8ecf3; border-radius: 8px;
  padding: 12px 14px 8px; background: #fbfcfe;
}
.pp-fig svg { display: block; width: 78%; margin: 0 auto; height: auto; }
.pp-figcap { text-align: center; font-size: 10px; color: #78829a; padding: 8px 0 4px; }
.pp-foot {
  display: flex; justify-content: space-between;
  margin-top: 20px; padding-top: 10px; border-top: 1px solid #e8ecf3;
  font-size: 9px; color: #a0a9bc; letter-spacing: .8px;
}

/* 報價單品項表 */
.q-items { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
.q-items th {
  text-align: left; font-size: 9.5px; letter-spacing: .8px; color: #78829a;
  background: #f6f8fb; padding: 7px 10px; border: 1px solid #e8ecf3;
}
.q-items td { padding: 9px 10px; border: 1px solid #e8ecf3; font-size: 11px; vertical-align: top; }
.q-items td b { display: inline; font-size: 11.5px; }
.q-items td small { display: block; color: #78829a; font-size: 10px; margin-top: 3px; line-height: 1.5; }
.q-items td.num { font-family: var(--mono); font-size: 10.5px; text-align: right; white-space: nowrap; }
.q-items .q-reco td { background: rgba(11, 158, 134, .05); }
.q-items .q-bad td { background: rgba(216, 72, 72, .04); }
.q-tag {
  font-size: 9px; font-weight: 700; border-radius: 20px;
  padding: 1px 7px; margin-left: 6px; vertical-align: 1px;
}
.q-tag.ok { background: rgba(11, 158, 134, .12); color: #0b9e86; }
.q-tag.no { background: rgba(216, 72, 72, .1); color: #d84848; }
.q-total td {
  font-weight: 700; font-size: 12px; background: #f6f8fb;
}
.q-terms { margin: 4px 0 0 18px; font-size: 11px; color: #4a5568; line-height: 2; }
.q-internal {
  margin-top: 16px; padding: 9px 12px; border-radius: 8px;
  border: 1px dashed #c6cede; background: #f8f9fc;
  font-size: 10px; color: #78829a; line-height: 1.7;
}

/* RD 覆核請求單 */
.rd-form { font-size: 12.5px; }
.rd-row { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.rd-k { width: 64px; flex-shrink: 0; color: var(--txt-2); font-size: 11.5px; padding-top: 1px; }
.rd-v { color: var(--txt-1); line-height: 1.6; }
.rd-v b { color: var(--txt-0); }
.rd-pri {
  font-size: 11px; font-weight: 650; color: var(--red);
  background: var(--red-soft); border: 1px solid rgba(216, 72, 72, .25);
  border-radius: 20px; padding: 2px 10px;
}
.rd-sec {
  font-size: 10.5px; font-weight: 700; letter-spacing: 1px;
  color: var(--txt-2); margin: 16px 0 8px;
}
.rd-check {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 12px; margin-bottom: 7px;
  background: rgba(255, 255, 255, .75); border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: 0 2px 8px rgba(45, 62, 110, .05);
  border-radius: 10px; cursor: pointer;
  font-size: 12px; color: var(--txt-1); line-height: 1.65;
}
.rd-check input { margin-top: 3px; accent-color: var(--cyan); }
.rd-check b {
  font-family: var(--mono); font-size: 10px; color: var(--cyan);
  margin-right: 8px; font-weight: 600;
}
.rd-attach { display: flex; flex-wrap: wrap; gap: 8px; }
.rd-chip {
  font-size: 11px; color: var(--txt-1);
  background: rgba(255, 255, 255, .8); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 11px;
}

/* 提示訊息 */
.app-toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 100;
  transform: translateX(-50%) translateY(16px);
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(24, 138, 82, .35);
  box-shadow: 0 12px 36px rgba(45, 62, 110, .18);
  backdrop-filter: blur(16px);
  color: var(--green); font-size: 12.5px; font-weight: 600;
  border-radius: 12px; padding: 11px 20px;
  opacity: 0; transition: all .35s cubic-bezier(.2,.9,.3,1.1);
  pointer-events: none;
}
.app-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─────────── 底部案件狀態列 ─────────── */
#valuebar {
  display: flex; align-items: center; gap: 22px;
  padding: 12px 28px;
  border-top: 1px solid rgba(255, 255, 255, .65);
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  flex-shrink: 0;
}
.vb-item { display: flex; flex-direction: column; }
.vb-item b { font-size: 15px; font-family: var(--mono); color: var(--txt-0); transition: all .4s; }
.vb-item span { font-size: 10px; color: var(--txt-2); letter-spacing: .5px; margin-top: 1px; }
.vb-sep { width: 1px; height: 26px; background: var(--line); }
.vb-note { margin-left: auto; font-size: 11.5px; color: var(--txt-2); }

/* ─────────── 通用動畫 ─────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* SVG 流動動畫 */
.flow-line {
  stroke-dasharray: 7 6;
  animation: flow 1.1s linear infinite;
}
@keyframes flow { to { stroke-dashoffset: -13; } }
.pulse-glow { animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .35; } }

.bar-fill { transform-box: fill-box; transform-origin: left center; animation: bar-grow 1s cubic-bezier(.2,.8,.3,1) both; }
@keyframes bar-grow { from { transform: scaleX(0); } }

@media (max-width: 1280px) {
  #workspace { grid-template-columns: 300px 1fr 340px; }
}
