    /* ===== 主版面 ===== */
    .container {
      max-width: 1160px;
      margin: 0 auto;
      padding: 28px 20px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 24px;
    }
    .panel-full { grid-column: 1 / -1; }

    /* Logo 上傳 (quote-specific hidden input overlay) */
    .logo-upload-area input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
    .logo-preview { max-height: 70px; max-width: 200px; border-radius: 5px; }
    .logo-upload-hint { font-size: .8rem; color: var(--muted); margin-top: 6px; }

    /* ===== 大小章上傳 ===== */
    .seal-groups { display: flex; gap: 22px; flex-wrap: wrap; }
    .seal-group { flex: 1 1 200px; }
    .seal-group-title { font-size: .8rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
    .seal-slot-row { display: flex; gap: 10px; }
    .seal-slot {
      position: relative; width: 92px; height: 92px; flex-shrink: 0;
      border: 2px dashed var(--border); border-radius: 10px;
      background: var(--bg); cursor: pointer; overflow: hidden;
      transition: border-color .15s, background .15s;
    }
    .seal-slot:hover, .seal-slot.drag-over { border-color: var(--primary); background: var(--primary-light); }
    .seal-slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }
    .seal-placeholder {
      position: absolute; inset: 0; display: flex; flex-direction: column;
      align-items: center; justify-content: center; gap: 3px; pointer-events: none;
    }
    .seal-slot-label { font-size: .9rem; font-weight: 700; color: var(--text); }
    .seal-slot-hint { font-size: .68rem; color: var(--muted); }
    .seal-thumb { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; }
    .seal-clear {
      position: absolute; top: 4px; right: 4px; z-index: 2;
      width: 20px; height: 20px; border: none; border-radius: 50%;
      background: rgba(0,0,0,.5); color: #fff; font-size: .7rem; line-height: 1;
      cursor: pointer; align-items: center; justify-content: center;
    }
    .seal-clear:hover { background: var(--danger); }
    .seal-spinner { display: none; }
    .seal-slot.processing .seal-placeholder { visibility: hidden; }
    .seal-slot.processing .seal-spinner {
      display: block; position: absolute; top: 50%; left: 50%;
      width: 22px; height: 22px; margin: -11px 0 0 -11px;
      border: 2px solid var(--primary); border-top-color: transparent;
      border-radius: 50%; animation: seal-spin .7s linear infinite;
    }
    @keyframes seal-spin { to { transform: rotate(360deg); } }

    /* ===== 報價明細表格 ===== */
    .items-table-wrap { overflow-x: auto; }
    .items-table {
      width: 100%; border-collapse: collapse; font-size: .85rem;
    }
    .items-table thead th {
      background: var(--primary-light);
      color: var(--text);
      font-weight: 700;
      padding: 10px 10px;
      text-align: left;
      border-bottom: 2px solid var(--primary-border);
      white-space: nowrap;
    }
    .items-table tbody tr:nth-child(even) { background: #f8fafc; }
    .items-table tbody tr:hover { background: var(--primary-light); }
    .items-table td { padding: 7px 6px; vertical-align: middle; border-bottom: 1px solid var(--border); }
    .items-table td input, .items-table td select, .items-table td textarea {
      width: 100%; border: 1.5px solid var(--border);
      border-radius: 5px; padding: 6px 8px;
      font-size: .84rem; font-family: inherit;
      background: var(--white); color: var(--text);
      box-sizing: border-box;
    }
    .items-table td textarea { resize: vertical; }
    .items-table td input:focus, .items-table td select:focus, .items-table td textarea:focus {
      border-color: var(--primary); outline: none;
    }
    .items-table td.td-amount { font-weight: 600; color: var(--text); white-space: nowrap; }
    .items-table td.td-seq { color: var(--muted); text-align: center; width: 38px; }
    .items-table td.td-action { text-align: center; width: 42px; }
    .btn-row-del {
      background: none; border: none; color: #ef4444;
      cursor: pointer; font-size: 1.1rem; padding: 2px 6px; border-radius: 4px;
      transition: background .15s;
    }
    .btn-row-del:hover { background: #fee2e2; }

    .items-footer {
      display: flex; justify-content: space-between; align-items: flex-start;
      margin-top: 14px; gap: 16px; flex-wrap: wrap;
    }
    .add-item-btn {
      display: inline-flex; align-items: center; gap: 6px;
      background: var(--primary-light); color: var(--primary);
      border: 1.5px solid var(--primary-border); border-radius: 7px;
      padding: 7px 14px; font-size: .84rem; font-weight: 600;
      cursor: pointer; transition: all .2s;
    }
    .add-item-btn:hover { background: var(--primary-light); }

    .totals-box {
      background: var(--primary-light); border: 1.5px solid var(--primary-border);
      border-radius: 9px; padding: 14px 20px; min-width: 260px;
    }
    .totals-row {
      display: flex; justify-content: space-between;
      align-items: center; padding: 4px 0; font-size: .88rem;
    }
    .totals-row .label { color: var(--muted); }
    .totals-row .value { font-weight: 600; color: var(--text); }
    .totals-row.grand { border-top: 2px solid var(--primary-border); margin-top: 6px; padding-top: 10px; }
    .totals-row.grand .label { font-size: 1rem; font-weight: 700; color: var(--text); }
    .totals-row.grand .value { font-size: 1.1rem; font-weight: 800; color: var(--text); }

    /* 稅率設定 */
    .tax-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
    .tax-row label { font-size: .83rem; color: var(--muted); white-space: nowrap; }
    .tax-row select, .tax-row input {
      border: 1.5px solid var(--border); border-radius: 6px;
      padding: 5px 9px; font-size: .83rem; font-family: inherit;
    }

    /* ===== 備註 / 條款 ===== */
    .remark-tabs { display: flex; gap: 0; margin-bottom: 14px; }
    .remark-tab {
      padding: 8px 18px; font-size: .84rem; font-weight: 600;
      cursor: pointer; border: 1.5px solid var(--border);
      background: var(--bg); color: var(--muted);
      transition: all .15s;
    }
    .remark-tab:first-child { border-radius: 7px 0 0 7px; }
    .remark-tab:last-child { border-radius: 0 7px 7px 0; border-left: none; }
    .remark-tab.active { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }

    /* ===== 預覽區 ===== */
    .preview-actions {
      display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    }

    /* ===== 報價單預覽樣式 ===== */
    #quotation-preview {
      background: var(--white);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    /* ===== 印刷樣式 ===== */
    /* @page 由 JS 動態寫入 */
    @media print {
      /* color-adjust 補充（shared.css 已涵蓋大部分，這裡加 color-adjust 舊屬性） */
      *, *::before, *::after { color-adjust: exact !important; }
    }

    /* ===== 響應式 ===== */
    @media (max-width: 900px) {
      .container { grid-template-columns: 1fr; }
      .panel-full { grid-column: 1; }
    }
    @media (max-width: 600px) {
      .doc-preview thead td { padding: 10px 14px 8px !important; }
      .doc-preview tbody td { padding: 0 14px 20px !important; }
    }

    /* ===== 更新預覽按鈕動畫 ===== */
    .btn-refresh { transition: background .25s, color .25s, border-color .25s; }
    .btn-refresh .refresh-icon {
      display: inline-block;
      transition: transform .3s;
      font-style: normal;
    }
    @keyframes rf-spin {
      to { transform: rotate(360deg); }
    }
    @keyframes rf-pop {
      0%   { transform: scale(1); }
      45%  { transform: scale(1.45); }
      100% { transform: scale(1); }
    }
    @keyframes rf-success-bg {
      0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
      70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
      100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
    }
    .btn-refresh.refreshing .refresh-icon {
      animation: rf-spin .55s linear infinite;
    }
    .btn-refresh.refreshed {
      background: #22c55e !important;
      color: #fff !important;
      border-color: #22c55e !important;
      animation: rf-success-bg .6s ease;
    }
    .btn-refresh.refreshed .refresh-icon {
      animation: rf-pop .28s ease;
    }
