/* TopCopilot terminology pages — glossary & instructions */
@import url("./upgrade-banner.css");
@import url("./dev-mode-badge.css");
@import url("./workspace-chrome.css");

:root {
  --tc-bg: #f5f6f8;
  --tc-surface: #ffffff;
  --tc-border: #e4e7ec;
  --tc-text: #1a1d21;
  --tc-muted: #6b7280;
  --tc-accent: #0078d4;
  --tc-accent-hover: #106ebe;
  --tc-accent-soft: #e8f3fc;
  --tc-danger: #c42b1c;
  --tc-radius: 8px;
  --tc-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  color: var(--tc-text);
  background: var(--tc-bg);
}

.tc-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 10000;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--tc-text);
  background: var(--tc-surface);
  border: 1px solid var(--tc-border);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.14);
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.tc-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.tc-toast--success {
  border-color: #9fd89f;
  background: #f1faf1;
}

.tc-toast--warn {
  border-color: #f5d90a;
  background: #fffbeb;
}

.tc-toast--error {
  border-color: #f4b4b0;
  background: #fdf3f2;
  color: #8a261c;
}

.tc-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
}

.tc-header {
  flex: 0 0 auto;
  padding: 14px 16px 12px;
  background: var(--tc-surface);
  border-bottom: 1px solid var(--tc-border);
  box-shadow: var(--tc-shadow);
}

.tc-header h1 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tc-header p {
  margin: 0;
  font-size: 12px;
  color: var(--tc-muted);
  line-height: 1.4;
}

/* 与全局翻译 mode-bar 对齐：36px 蓝底顶栏、白字标题 */
.tc-header--brand {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  min-height: 36px;
  max-height: 36px;
  padding: 0 14px;
  background: #0078d4;
  border-bottom: none;
  box-shadow: none;
}

.tc-header--brand h1 {
  margin: 0;
  width: 100%;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  line-height: 1;
  text-align: center;
}

/* AI 对话：标题保持居中，操作按钮置于右上 */
.tc-header--brand.tc-header--chat-actions {
  position: relative;
}

.tc-chat-header-actions {
  position: absolute;
  top: 50%;
  right: 2px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 3;
}

/* AI 对话页：本地调试角标下移，避免挡住右上角 + / 历史 */
body.tc-page-chat .tc-dev-mode-badge {
  top: 42px;
}

.tc-chat-history-anchor {
  position: relative;
}

.tc-chat-head-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tc-chat-head-icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.tc-chat-head-icon-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

.tc-chat-head-icon-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 1px;
}

.tc-chat-head-icon-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.18);
}

.tc-chat-history-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  width: min(288px, calc(100vw - 36px));
  max-height: min(360px, 72vh);
  padding: 0;
  overflow: hidden;
  background: var(--tc-surface);
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius);
  box-shadow: 0 10px 32px rgba(16, 24, 40, 0.16);
}

/* display:flex 覆盖 native [hidden]，必须显式关闭 */
.tc-chat-history-popover[hidden] {
  display: none !important;
}

.tc-chat-history-title {
  flex: 0 0 auto;
  padding: 10px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tc-muted);
}

.tc-chat-history-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin: 0;
  padding: 0 4px 6px;
  list-style: none;
}

.tc-chat-history-date {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--tc-muted);
  list-style: none;
}

.tc-chat-history-date:first-child {
  padding-top: 2px;
}

.tc-main {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 0;
}

.tc-main.tc-chat-layout {
  grid-template-columns: minmax(0, 1fr);
}

.tc-sidebar {
  background: var(--tc-bg);
  border-right: 1px solid var(--tc-border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tc-sidebar-actions {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tc-sidebar-hint {
  margin: 0;
  padding: 0 10px 8px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--tc-muted);
}

.tc-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 8px 12px;
  list-style: none;
  margin: 0;
}

.tc-list-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 10px;
  margin-bottom: 4px;
  border-radius: var(--tc-radius);
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}

.tc-list-item--translate-on {
  border-left-color: var(--tc-accent);
  background: rgba(255, 255, 255, 0.55);
}

.tc-list-translate {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 1px;
}

.tc-list-translate-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--tc-muted);
  line-height: 1;
  user-select: none;
}

.tc-toggle {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: #c8cdd4;
  cursor: pointer;
  transition: background 0.15s;
}

.tc-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--tc-surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.18);
  transition: transform 0.15s;
}

.tc-toggle[aria-checked="true"] {
  background: var(--tc-accent);
}

.tc-toggle[aria-checked="true"]::after {
  transform: translateX(16px);
}

.tc-toggle:hover {
  filter: brightness(0.97);
}

.tc-toggle:focus {
  outline: none;
}

.tc-toggle:focus-visible {
  outline: 2px solid var(--tc-accent);
  outline-offset: 2px;
}

.tc-list-body {
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
}

.tc-list-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.tc-list-name-row .name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 0;
}

.tc-list-edit-btn {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--tc-muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s, background 0.12s, color 0.12s, border-color 0.12s;
}

.tc-list-item:hover .tc-list-edit-btn,
.tc-list-item:focus-within .tc-list-edit-btn,
.tc-list-edit-btn:focus {
  opacity: 1;
  pointer-events: auto;
}

.tc-list-edit-btn:hover {
  background: var(--tc-accent-soft);
  border-color: var(--tc-accent);
  color: var(--tc-accent);
}

.tc-list-edit-btn:focus-visible {
  outline: 2px solid var(--tc-accent-soft);
  outline-offset: 1px;
  opacity: 1;
  pointer-events: auto;
}

.tc-list-item:hover {
  background: rgba(255, 255, 255, 0.7);
}

.tc-list-item.selected {
  background: var(--tc-surface);
  border-color: var(--tc-accent);
  box-shadow: var(--tc-shadow);
}

.tc-list-item.selected.tc-list-item--translate-on {
  border-left-color: var(--tc-accent);
}

.tc-list-item .name {
  font-weight: 600;
  font-size: 12px;
  display: block;
  margin-bottom: 2px;
}

.tc-list-item .meta {
  display: block;
  font-size: 11px;
  color: var(--tc-muted);
  text-align: left;
}

.tc-meta-status {
  font-weight: 500;
}

.tc-meta-status--on {
  color: var(--tc-accent);
}

.tc-meta-status--off {
  color: var(--tc-muted);
}

.tc-editor {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--tc-surface);
}

.tc-toolbar {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--tc-border);
}

.tc-toolbar-center {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.tc-toolbar-end {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.tc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--tc-border);
  background: var(--tc-surface);
  color: var(--tc-text);
  text-align: center;
}

.tc-btn:hover {
  background: var(--tc-bg);
}

.tc-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* display:flex 会覆盖原生 [hidden]，绑定类按钮等需显式隐藏 */
.tc-btn[hidden] {
  display: none !important;
}

.tc-btn-primary {
  background: var(--tc-accent);
  border-color: var(--tc-accent);
  color: #fff;
}

.tc-btn-primary:hover {
  background: var(--tc-accent-hover);
  border-color: var(--tc-accent-hover);
}

.tc-btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--tc-danger);
}

.tc-btn-ghost:hover {
  background: #fdecea;
}

.tc-import {
  position: relative;
  overflow: hidden;
}

.tc-import input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.tc-import-pick {
  position: relative;
  cursor: pointer;
}

.tc-import-pick input {
  display: none;
}

.tc-modal-panel--wide {
  width: min(520px, calc(100vw - 32px));
  max-height: min(90vh, 720px);
  overflow: auto;
}

.tc-format-card {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--tc-border);
  border-radius: 8px;
  background: #fafafa;
}

.tc-format-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
}

.tc-format-list {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--tc-text);
}

.tc-format-list code {
  font-size: 11px;
}

.tc-format-caption {
  margin: 0 0 6px;
  font-size: 11px;
  color: var(--tc-muted);
}

.tc-format-sample {
  margin: 0;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.45;
  font-family: Consolas, "Courier New", monospace;
  background: #fff;
  border: 1px solid var(--tc-border);
  border-radius: 6px;
  overflow-x: auto;
  white-space: pre;
}

.tc-format-sample--compact {
  margin: 0 0 12px;
  background: #fafafa;
}

.tc-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tc-import-preview {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f0f6ff;
  border: 1px solid #c7dafc;
}

.tc-import-preview-summary {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
}

.tc-import-preview-warn {
  margin: 0 0 8px;
  font-size: 11px;
  color: #8a6116;
  line-height: 1.45;
}

.tc-import-mode {
  margin: 0;
  padding: 0;
  border: none;
}

.tc-import-mode-option {
  display: block;
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

.tc-import-mode-option input {
  margin-right: 6px;
  vertical-align: -2px;
}

.tc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tc-editor-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px 14px 14px;
}

.tc-field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--tc-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tc-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--tc-border);
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 12px;
}

.tc-input:focus,
.tc-textarea:focus {
  outline: none;
  border-color: var(--tc-accent);
  box-shadow: 0 0 0 2px var(--tc-accent-soft);
}

.tc-search-bar {
  margin-bottom: 4px;
}

.tc-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.tc-search-wrap.tc-search-editing {
  outline: 2px solid var(--tc-accent-soft);
  outline-offset: 2px;
  border-radius: 8px;
}

.tc-search-input {
  margin-bottom: 0;
  padding-right: 32px;
}

.tc-search-input::-webkit-search-cancel-button {
  display: none;
}

.tc-search-clear {
  position: absolute;
  right: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--tc-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.tc-search-clear:hover {
  background: var(--tc-bg);
  color: var(--tc-text);
}

.tc-search-meta {
  margin: 6px 0 10px;
  font-size: 11px;
  color: var(--tc-muted);
}

.tc-search-meta-empty {
  color: var(--tc-danger);
}

.tc-textarea {
  width: 100%;
  min-height: 140px;
  padding: 10px;
  border: 1px solid var(--tc-border);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
}

.tc-table-wrap {
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius);
  overflow: hidden;
}

.tc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

/* 术语表词条表：固定列宽，避免「启用」等表头/占位符竖排换行 */
.tc-table.tc-glossary-table {
  table-layout: fixed;
}

.tc-table.tc-glossary-table .tc-col-source,
.tc-table.tc-glossary-table .tc-col-target {
  width: 32%;
}

.tc-table.tc-glossary-table .tc-col-note {
  width: auto;
}

.tc-table.tc-glossary-table .tc-col-enable {
  width: 56px;
  min-width: 56px;
  white-space: nowrap;
  text-align: center;
}

.tc-table.tc-glossary-table .tc-col-actions {
  width: 40px;
  min-width: 40px;
  padding-left: 4px;
  padding-right: 4px;
}

.tc-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--tc-bg);
  font-weight: 600;
  color: var(--tc-muted);
  font-size: 11px;
  white-space: nowrap;
}

.tc-table.tc-glossary-table th.tc-col-enable {
  text-align: center;
}

.tc-table td {
  padding: 4px 6px;
  border-top: 1px solid var(--tc-border);
}

.tc-editable-cell {
  cursor: text;
  vertical-align: middle;
}

.tc-cell-view {
  display: block;
  min-height: 30px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
  color: var(--tc-text);
}

.tc-table.tc-glossary-table .tc-cell-view.tc-cell-placeholder {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc-table.tc-glossary-table .tc-editable-cell .tc-cell-view:not(.tc-cell-placeholder) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tc-editable-cell:hover .tc-cell-view {
  background: var(--tc-bg);
}

.tc-cell-view:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--tc-accent-soft);
}

.tc-cell-placeholder {
  color: var(--tc-muted);
}

.tc-cell-enable {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  width: 56px;
}

.tc-cell-enable input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
}

.tc-cell-enable input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.tc-table input[type="text"].tc-cell-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  border: 1px solid var(--tc-accent);
  background: var(--tc-surface);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
}

.tc-table input[type="text"].tc-cell-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--tc-accent-soft);
}

.tc-table td.tc-cell-actions {
  text-align: center;
  vertical-align: middle;
}

.tc-table td.tc-cell-actions button[data-del] {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--tc-border);
  border-radius: 6px;
  background: var(--tc-surface);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: var(--tc-muted);
}

.tc-table td.tc-cell-actions button[data-del]:hover {
  background: #fdecea;
  border-color: rgba(196, 43, 28, 0.35);
  color: var(--tc-danger);
}

.tc-footer {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-top: 1px solid var(--tc-border);
  background: var(--tc-bg);
}

.tc-footer-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--tc-muted);
  margin-bottom: 8px;
}

.tc-check-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 88px;
  overflow-y: auto;
}

.tc-check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
}

.tc-empty {
  padding: 24px;
  text-align: center;
  color: var(--tc-muted);
  font-size: 12px;
}

.tc-list-status {
  padding: 12px 8px;
  text-align: center;
  color: var(--tc-muted);
  font-size: 12px;
  line-height: 1.45;
}

.tc-list-status--error {
  color: var(--tc-danger);
}

.tc-select-row {
  margin-bottom: 12px;
}

.tc-select-row select {
  width: 100%;
  height: 32px;
  border: 1px solid var(--tc-border);
  border-radius: 6px;
  padding: 0 8px;
  font-size: 12px;
  background: var(--tc-surface);
}

.tc-link-bar {
  flex: 0 0 auto;
  padding: 8px 16px;
  font-size: 11px;
  color: var(--tc-muted);
  border-top: 1px solid var(--tc-border);
  background: var(--tc-surface);
}

.tc-editor-hint {
  margin: 0;
  line-height: 1.45;
}

.tc-link-bar a {
  color: var(--tc-accent);
  text-decoration: none;
  font-weight: 600;
}

.tc-link-bar a:hover {
  text-decoration: underline;
}

/* ── Modal（术语表等页面共用） ───────────────────────────────────────── */
.tc-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.tc-modal[hidden] {
  display: none !important;
}

.tc-modal-backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: rgba(26, 29, 33, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: default;
}

.tc-modal-panel {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  padding: 22px 24px 20px;
  background: var(--tc-surface);
  border: 1px solid var(--tc-border);
  border-radius: 12px;
  box-shadow:
    0 4px 6px rgba(16, 24, 40, 0.04),
    0 24px 48px rgba(16, 24, 40, 0.14);
}

.tc-modal-panel--danger {
  border-color: rgba(196, 43, 28, 0.22);
  box-shadow:
    0 4px 6px rgba(16, 24, 40, 0.04),
    0 24px 48px rgba(196, 43, 28, 0.08);
}

.tc-modal-panel--payment {
  width: min(420px, 100%);
}

.tc-modal-lede--tight {
  margin-bottom: 18px;
}

#glossaryDeleteModalName {
  font-weight: 600;
  color: var(--tc-text);
}

.tc-modal-em-danger {
  font-weight: 600;
  color: var(--tc-danger);
}

.tc-btn-danger {
  background: var(--tc-danger);
  border-color: var(--tc-danger);
  color: #fff;
}

.tc-btn-danger:hover {
  background: #a82518;
  border-color: #a82518;
}

.tc-modal-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--tc-text);
}

.tc-modal-title.tc-modal-title--danger {
  color: var(--tc-danger);
}

.tc-modal-lede {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--tc-muted);
}

.tc-modal-lede--payment {
  margin-bottom: 12px;
}

.tc-modal-lede--payment-note {
  margin-top: 12px;
  margin-bottom: 16px;
}

/* ===== 申请发票（开票视图）===== */
.tc-inv-panel {
  width: min(560px, 100%);
  max-height: 88vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.tc-inv-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--tc-muted);
  cursor: pointer;
  z-index: 2;
  transition: background 0.12s, color 0.12s;
}
.tc-inv-close:hover { background: var(--tc-bg); color: var(--tc-text); }
.tc-inv-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  padding-right: 28px;
}
.tc-inv-head-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--tc-accent-soft);
  color: var(--tc-accent);
  flex-shrink: 0;
}
.tc-inv-section {
  margin-top: 16px;
}
.tc-inv-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}
.tc-inv-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--tc-text);
  letter-spacing: 0.01em;
}
.tc-inv-summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.tc-inv-summary {
  font-size: 11px;
  color: var(--tc-muted);
}
.tc-inv-summary--active {
  color: var(--tc-accent);
  font-weight: 600;
}
.tc-inv-linkbtn {
  padding: 0;
  border: none;
  background: none;
  font-size: 11px;
  color: var(--tc-accent);
  cursor: pointer;
  line-height: 1;
}
.tc-inv-linkbtn:hover { color: var(--tc-accent-hover); text-decoration: underline; }
.tc-inv-linkbtn:disabled { color: var(--tc-muted); cursor: default; text-decoration: none; opacity: 0.5; }
.tc-inv-orders-scroll {
  max-height: 168px;
  overflow-y: auto;
  border: 1px solid var(--tc-border);
  border-radius: 8px;
  background: var(--tc-surface);
}
.tc-inv-orders {
  background: var(--tc-surface);
}
.tc-inv-order {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--tc-border);
  cursor: pointer;
  transition: background 0.12s;
}
.tc-inv-order:last-child { border-bottom: none; }
.tc-inv-order:hover { background: #f9fafb; }
.tc-inv-order input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--tc-accent);
  flex-shrink: 0;
}
.tc-inv-order-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tc-inv-order-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--tc-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tc-inv-order-meta {
  font-size: 11px;
  color: var(--tc-muted);
}
.tc-inv-order-amount {
  font-size: 13px;
  font-weight: 600;
  color: var(--tc-text);
  flex-shrink: 0;
}
.tc-inv-empty {
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--tc-muted);
}
.tc-inv-loading {
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--tc-muted);
}

/* 抬头类型分段控件 */
.tc-inv-seg {
  display: inline-flex;
  padding: 2px;
  background: var(--tc-bg);
  border: 1px solid var(--tc-border);
  border-radius: 8px;
}
.tc-inv-seg label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  font-size: 12px;
  color: var(--tc-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
}
.tc-inv-seg input { display: none; }
.tc-inv-seg label:hover { color: var(--tc-text); }
.tc-inv-seg input:checked + span {
  color: var(--tc-accent);
}
.tc-inv-seg label:has(input:checked) {
  background: var(--tc-surface);
  color: var(--tc-accent);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}
.tc-inv-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tc-inv-field { display: flex; flex-direction: column; gap: 4px; }
.tc-inv-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--tc-muted);
  letter-spacing: 0.02em;
}
.tc-inv-field-label .tc-inv-opt { color: #aab0b8; font-weight: 400; }
.tc-inv-field input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--tc-border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--tc-surface);
  color: var(--tc-text);
}
.tc-inv-field input:focus {
  outline: none;
  border-color: var(--tc-accent);
  box-shadow: 0 0 0 2px var(--tc-accent-soft);
}
.tc-inv-field--disabled { opacity: 0.45; }

.tc-inv-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.tc-inv-actions .tc-btn { flex: 1; }

/* 我的申请卡片 */
.tc-inv-req {
  padding: 12px;
  border: 1px solid var(--tc-border);
  border-radius: 8px;
  background: var(--tc-surface);
}
.tc-inv-req + .tc-inv-req { margin-top: 8px; }
.tc-inv-req-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.tc-inv-req-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--tc-text);
  word-break: break-all;
}
.tc-inv-req-line {
  font-size: 11px;
  color: var(--tc-muted);
  margin-top: 3px;
}
.tc-inv-req-note {
  font-size: 11px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--tc-border);
}
.tc-inv-req-note--ok { color: #16a34a; }
.tc-inv-req-note--bad { color: var(--tc-danger); }
.tc-inv-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.tc-inv-badge--pending { color: #b45309; background: #fef3c7; }
.tc-inv-badge--issued { color: #15803d; background: #dcfce7; }
.tc-inv-badge--rejected { color: #b91c1c; background: #fee2e2; }
.tc-inv-req-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}
.tc-inv-issued-email {
  font-size: 12px;
  line-height: 1.4;
  color: #16a34a;
  text-align: right;
  max-width: 160px;
  word-break: break-all;
}

.tc-account-payment-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #b8d7ef;
  border-radius: 10px;
  background: #f3f9fe;
  color: var(--tc-text);
}

.tc-account-payment-contact-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.tc-account-payment-contact-label {
  font-size: 12px;
  color: var(--tc-muted);
}

.tc-account-payment-contact strong {
  font-size: 16px;
  line-height: 1.2;
  color: var(--tc-accent);
  word-break: break-all;
}

.tc-account-copy-btn {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #b8d7ef;
  border-radius: 6px;
  background: #fff;
  color: var(--tc-accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tc-account-copy-btn:hover {
  border-color: var(--tc-accent);
  background: #e8f3fc;
}

.tc-modal-input {
  margin-bottom: 8px;
}

.tc-modal-panel .tc-input {
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: #fafbfc;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.tc-modal-panel .tc-input::placeholder {
  color: #9ca3af;
}

.tc-modal-panel .tc-input:hover {
  border-color: #c5cdd8;
}

.tc-modal-panel .tc-input:focus {
  background: #fff;
}

.tc-modal-field + .tc-modal-field {
  margin-top: 14px;
}

.tc-modal-field .tc-modal-input {
  margin-bottom: 0;
}

.tc-modal-code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.tc-modal-code-row .tc-modal-input--code {
  flex: 1;
  min-width: 0;
}

.tc-modal-code-btn {
  flex-shrink: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--tc-border);
  border-radius: 8px;
  background: var(--tc-surface);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--tc-accent);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.tc-modal-code-btn:hover:not(:disabled) {
  background: var(--tc-accent-soft);
  border-color: #9ec5e6;
}

.tc-modal-code-btn:disabled {
  color: var(--tc-muted);
  cursor: default;
}

.tc-modal-actions--form {
  margin-top: 20px;
}

.tc-modal-error {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--tc-danger);
  min-height: 1.2em;
}

.tc-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.tc-modal-actions .tc-btn {
  min-width: 84px;
}

.tc-modal-actions--stack {
  flex-direction: column;
  align-items: stretch;
}

.tc-modal-actions--stack .tc-btn {
  width: 100%;
  min-width: 0;
}

.tc-editor--dirty .tc-textarea {
  border-color: #d4a012;
  box-shadow: 0 0 0 2px rgba(212, 160, 18, 0.2);
}

.tc-field-label--dirty::after {
  content: ' · 未保存';
  color: #9a6700;
  font-weight: 600;
}

.tc-btn.tc-btn--emphasize {
  box-shadow: 0 0 0 2px var(--tc-accent-soft);
}

/* ── Quick translate ─────────────────────────────────────────────────────── */
.tc-app--stack {
  display: flex;
  flex-direction: column;
}

.tc-qt-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 12px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tc-qt-split {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.tc-qt-pane {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tc-qt-pane-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tc-qt-pane-head .tc-field-label {
  margin-bottom: 0;
  font-weight: 600;
}

.tc-qt-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  color: var(--tc-muted);
  cursor: pointer;
}

.tc-qt-text-btn:hover {
  color: var(--tc-text);
  background: rgba(0, 0, 0, 0.04);
}

.tc-qt-pane-text {
  flex: 1 1 auto;
  min-height: 72px;
  resize: none;
  font-size: 15px;
  line-height: 1.55;
}

.tc-qt-control-card {
  flex: 0 0 auto;
  padding: 12px;
  border: 1px solid var(--tc-border);
  border-radius: 10px;
  background: #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tc-qt-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tc-qt-lang-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.tc-qt-lang-inline .tc-field-label {
  margin-bottom: 0;
  white-space: nowrap;
  font-weight: 500;
}

.tc-qt-lang-inline .tc-select {
  flex: 1 1 auto;
  min-width: 100px;
  max-width: 168px;
}

.tc-qt-submit {
  width: 100%;
  height: 36px;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
}

.tc-select {
  width: 100%;
  height: 32px;
  border: 1px solid var(--tc-border);
  border-radius: 6px;
  padding: 0 8px;
  font-size: 12px;
  background: var(--tc-surface);
}

.tc-qt-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.tc-qt-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: auto;
  min-height: 28px;
  padding: 5px 12px;
  font-weight: 500;
  color: var(--tc-muted);
  border-color: var(--tc-border);
  background: var(--tc-surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tc-qt-action-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.tc-qt-action:hover:not(:disabled) {
  color: var(--tc-accent);
  border-color: var(--tc-accent);
  background: var(--tc-accent-soft);
  box-shadow: none;
}

.tc-qt-action:hover:not(:disabled) .tc-qt-action-icon {
  opacity: 1;
}

.tc-qt-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tc-qt-status {
  font-size: 12px;
  color: var(--tc-muted);
  margin: 0;
}

.tc-qt-status--error {
  color: var(--tc-danger);
}

.tc-qt-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--tc-border);
  padding: 8px 16px 12px;
  background: var(--tc-surface);
}

.tc-btn-sm {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
}

/* ── AI chat ─────────────────────────────────────────────────────────────── */
.tc-chat-layout {
  min-height: 0;
}

.tc-chat-session-empty {
  padding: 12px 12px;
  color: var(--tc-muted);
  font-size: 12px;
  list-style: none;
}

.tc-chat-session-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--tc-text);
}

.tc-chat-history-list > li.tc-chat-history-row {
  list-style: none;
}

.tc-chat-history-row-inner {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  border-radius: 6px;
}

.tc-chat-history-row-inner .tc-chat-session-item {
  flex: 1 1 auto;
  min-width: 0;
}

.tc-chat-history-session-del {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--tc-muted);
  cursor: pointer;
  transition:
    opacity 0.14s ease,
    background 0.14s ease,
    color 0.14s ease;
}

@media (hover: hover) and (pointer: fine) {
  .tc-chat-history-session-del {
    opacity: 0;
  }

  .tc-chat-history-row:hover .tc-chat-history-session-del,
  .tc-chat-history-row:focus-within .tc-chat-history-session-del {
    opacity: 1;
  }
}

.tc-chat-history-session-del:hover {
  background: #fdf3f2;
  color: var(--tc-danger);
}

.tc-chat-history-session-del:focus-visible {
  opacity: 1;
  outline: 2px solid var(--tc-accent);
  outline-offset: 1px;
}

.tc-chat-history-session-del svg {
  flex-shrink: 0;
}

.tc-chat-session-item:hover {
  background: var(--tc-accent-soft);
}

.tc-chat-session-item--active {
  background: var(--tc-accent-soft);
  box-shadow: inset 3px 0 0 var(--tc-accent);
}

.tc-chat-session-title {
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.tc-chat-session-meta {
  font-size: 10px;
  color: var(--tc-muted);
}

.tc-chat-doc-hint {
  margin: 8px 10px 10px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--tc-muted);
}

.tc-chat-doc-hint--popover {
  flex: 0 0 auto;
  margin: 0 12px 10px;
  padding-top: 4px;
  border-top: 1px solid var(--tc-border);
}

.tc-chat-panel {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--tc-surface);
}

.tc-chat-empty {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  line-height: 1.4;
}

/* 无消息：占位文案落在中上区域；有消息后同列排版，由下方气泡自然「顶上」顶部 */
.tc-chat-thread--idle .tc-chat-empty {
  margin-top: clamp(40px, calc(22vh + 12px), 140px);
}

.tc-chat-thread:not(.tc-chat-thread--idle) .tc-chat-empty {
  margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  .tc-chat-empty {
    transition: none;
  }
}

.tc-chat-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tc-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 72px;
}

.tc-chat-msg {
  display: flex;
}

.tc-chat-msg--user {
  justify-content: flex-end;
}

.tc-chat-msg--assistant {
  justify-content: flex-start;
}

.tc-chat-msg-inner {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  max-width: 92%;
  min-width: 0;
}

.tc-chat-msg--user .tc-chat-msg-inner {
  margin-inline-start: auto;
}

.tc-chat-msg-select-col {
  flex: 0 0 auto;
  width: 22px;
  padding-top: 8px;
  display: flex;
  justify-content: center;
}

.tc-chat-msg-pair-check {
  display: inline-flex;
  color: var(--tc-accent);
}

.tc-chat-msg-stack {
  flex: 1 1 auto;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tc-chat-msg--user .tc-chat-msg-stack {
  align-items: flex-end;
}

.tc-chat-msg--assistant .tc-chat-msg-stack {
  align-items: flex-start;
}

.tc-chat-msg-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tc-chat-msg--user .tc-chat-msg-actions {
  justify-content: flex-end;
}

.tc-chat-msg--assistant .tc-chat-msg-actions {
  justify-content: flex-start;
}

@media (hover: hover) and (pointer: fine) {
  .tc-chat-msg-actions {
    opacity: 0;
    transition: opacity 0.15s ease;
  }

  .tc-chat-msg-inner:hover .tc-chat-msg-actions,
  .tc-chat-msg-inner:focus-within .tc-chat-msg-actions,
  .tc-chat-msg-inner:has(.tc-chat-msg-more-btn--open) .tc-chat-msg-actions {
    opacity: 1;
  }
}

.tc-chat-ctx-menu {
  position: fixed;
  z-index: 800;
  min-width: 132px;
  padding: 4px;
  margin: 0;
  border: 1px solid var(--tc-border);
  border-radius: 10px;
  background: var(--tc-surface);
  box-shadow: 0 10px 32px rgba(16, 24, 40, 0.16);
}

.tc-chat-ctx-menu[hidden] {
  display: none;
}

.tc-chat-ctx-menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  margin: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
  color: var(--tc-text);
  text-align: left;
  cursor: pointer;
}

.tc-chat-ctx-menu-item:hover {
  background: var(--tc-bg);
}

.tc-chat-ctx-menu-item:focus-visible {
  outline: 2px solid var(--tc-accent);
  outline-offset: 0;
}

.tc-chat-ctx-menu-item--danger {
  color: var(--tc-danger);
}

.tc-chat-ctx-menu-item--danger:hover {
  background: #fdf3f2;
}

.tc-chat-msg-more-item svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.tc-chat-msg-more-wrap {
  position: relative;
  display: inline-flex;
}

.tc-chat-msg-more-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 158px;
  padding: 4px;
  margin: 0;
  border: 1px solid var(--tc-border);
  border-radius: 10px;
  background: var(--tc-surface);
  box-shadow: 0 10px 32px rgba(16, 24, 40, 0.16);
  z-index: 720;
}

.tc-chat-msg-more-dropdown.tc-chat-msg-more-dropdown--flip-up {
  top: auto;
  bottom: calc(100% + 6px);
}

.tc-chat-msg--user .tc-chat-msg-more-dropdown {
  left: auto;
  right: 0;
}

.tc-chat-msg-more-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  margin: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--tc-text);
  text-align: left;
  cursor: pointer;
  line-height: 1.3;
}

.tc-chat-msg-more-item:hover {
  background: var(--tc-bg);
}

.tc-chat-msg-more-item:focus-visible {
  outline: 2px solid var(--tc-accent);
  outline-offset: 0;
}

.tc-chat-msg-more-label {
  flex: 1 1 auto;
}

.tc-chat-msg-more-item--danger {
  color: var(--tc-danger);
}

.tc-chat-msg-more-item--danger:hover {
  background: #fdf3f2;
}

.tc-chat-msg-more-item--danger svg {
  color: var(--tc-danger);
}

.tc-chat-msg-toolbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 32px;
  height: 32px;
  margin: 0;
  padding: 0 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--tc-muted);
  cursor: pointer;
}

.tc-chat-msg-toolbtn:hover {
  background: rgba(17, 24, 39, 0.07);
  color: var(--tc-text);
}

.tc-chat-msg-more-btn--open {
  background: rgba(17, 24, 39, 0.1);
  color: var(--tc-text);
}

.tc-chat-msg-toolbtn:focus-visible {
  outline: 2px solid var(--tc-accent);
  outline-offset: 1px;
}

.tc-chat-msg-toolbtn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.tc-chat-pair-delete-bar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--tc-border);
  background: var(--tc-accent-soft);
}

/* [hidden] 默认的 display:none 会被上面的 display:flex 覆盖，需显式恢复隐藏 */
.tc-chat-pair-delete-bar[hidden] {
  display: none;
}

.tc-chat-pair-delete-bar-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--tc-text);
  max-width: 100%;
}

.tc-chat-pair-delete-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tc-chat-msg--assistant .tc-chat-msg-inner {
  max-width: 100%;
}

.tc-chat-bubble {
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  white-space: normal;
  word-break: break-word;
}

.tc-chat-body {
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.65;
  white-space: normal;
  word-break: break-word;
  color: var(--tc-text);
}

.tc-chat-msg--user .tc-chat-bubble {
  background: var(--tc-accent);
  color: #fff;
  white-space: pre-wrap;
}

@media (hover: hover) and (pointer: fine) {
  .tc-panel-excel .tc-chat-msg--user:not(.tc-chat-msg--pending) .tc-chat-bubble {
    transition: background 0.15s ease, box-shadow 0.15s ease;
  }

  .tc-panel-excel .tc-chat-msg--user:not(.tc-chat-msg--pending) .tc-chat-msg-inner:hover .tc-chat-bubble {
    background: var(--tc-accent-hover);
    box-shadow: 0 2px 10px rgba(0, 120, 212, 0.18);
  }

  .tc-panel-excel .tc-chat-msg--assistant:not(.tc-chat-msg--pending) .tc-chat-body {
    transition: background 0.15s ease, box-shadow 0.15s ease;
  }

  .tc-panel-excel .tc-chat-msg--assistant:not(.tc-chat-msg--pending) .tc-chat-msg-inner:hover .tc-chat-body {
    background: var(--tc-accent-soft);
    box-shadow: 0 0 0 1px rgba(0, 120, 212, 0.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tc-panel-excel .tc-chat-bubble,
  .tc-panel-excel .tc-chat-body {
    transition: none;
  }
}

.tc-chat-msg--pending .tc-chat-body {
  color: var(--tc-muted);
  font-style: italic;
  white-space: pre-wrap;
}

.tc-chat-failure-card {
  display: flex;
  gap: 12px;
  max-width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(196, 43, 28, 0.16);
  background: linear-gradient(180deg, #fff8f7 0%, #fff 100%);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.tc-chat-failure-card__icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--tc-danger);
  background: rgba(196, 43, 28, 0.08);
}

.tc-chat-failure-card__body {
  flex: 1 1 auto;
  min-width: 0;
}

.tc-chat-failure-card__title {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.4;
}

.tc-chat-failure-card__detail {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: #4b5563;
  word-break: break-word;
}

.tc-chat-failure-card__hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: #6b7280;
}

.tc-chat-failure-card__actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tc-chat-failure-card__cta {
  min-height: 32px;
  padding-inline: 14px;
  border-radius: 999px;
  font-weight: 600;
}

.tc-chat-attach-limit-panel {
  width: min(440px, 100%);
  text-align: center;
}

.tc-chat-attach-limit-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #2563eb;
  background: linear-gradient(180deg, #eff6ff 0%, #e8f0fe 100%);
}

.tc-chat-attach-limit-detail {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #4b5563;
  background: #f9fafb;
  border: 1px solid var(--tc-border);
  border-radius: 10px;
  word-break: break-word;
  text-align: left;
}

.tc-chat-attach-limit-actions {
  justify-content: center;
  gap: 10px;
}

.tc-chat-attach-limit-actions .tc-btn-primary {
  min-width: 148px;
  border-radius: 999px;
  font-weight: 600;
}

.tc-chat-body > :first-child,
.tc-chat-bubble > :first-child { margin-top: 0; }
.tc-chat-body > :last-child,
.tc-chat-bubble > :last-child { margin-bottom: 0; }

.tc-chat-body p,
.tc-chat-body ul,
.tc-chat-body ol,
.tc-chat-body blockquote,
.tc-chat-body pre,
.tc-chat-body table,
.tc-chat-bubble p,
.tc-chat-bubble ul,
.tc-chat-bubble ol,
.tc-chat-bubble blockquote,
.tc-chat-bubble pre,
.tc-chat-bubble table {
  margin: 0.5em 0;
}

.tc-chat-body h1,
.tc-chat-body h2,
.tc-chat-body h3,
.tc-chat-body h4,
.tc-chat-bubble h1,
.tc-chat-bubble h2,
.tc-chat-bubble h3,
.tc-chat-bubble h4 {
  margin: 0.75em 0 0.35em;
  line-height: 1.35;
  font-weight: 600;
}

.tc-chat-body h1,
.tc-chat-bubble h1 { font-size: 1.15em; }
.tc-chat-body h2,
.tc-chat-bubble h2 { font-size: 1.08em; }
.tc-chat-body h3,
.tc-chat-bubble h3 { font-size: 1em; }

.tc-chat-body ul,
.tc-chat-body ol,
.tc-chat-bubble ul,
.tc-chat-bubble ol {
  padding-left: 1.35em;
}

.tc-chat-body li + li,
.tc-chat-bubble li + li {
  margin-top: 0.2em;
}

.tc-chat-artifacts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 100%;
}

.tc-chat-artifact-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--tc-border);
  box-shadow: 0 4px 16px rgba(16, 24, 40, 0.08);
}

/* 用户消息气泡内展示其上传的图片/PDF 附件 */
.tc-chat-user-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.tc-chat-msg--user .tc-chat-user-attachments {
  justify-content: flex-end;
}

.tc-chat-user-att-imgbtn {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 0;
  margin: 0;
  border: 1px solid var(--tc-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--tc-bg);
  cursor: pointer;
  line-height: 0;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.08);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.tc-chat-user-att-imgbtn:hover {
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.18);
}

.tc-chat-user-att-imgbtn:focus-visible {
  outline: 2px solid var(--tc-accent);
  outline-offset: 2px;
}

.tc-chat-user-att-img {
  display: block;
  width: 116px;
  height: 116px;
  object-fit: cover;
}

.tc-chat-user-att-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--tc-border);
  border-radius: 8px;
  background: var(--tc-bg);
  font-size: 12px;
  color: var(--tc-text);
}

button.tc-chat-user-att-file {
  margin: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

button.tc-chat-user-att-file:hover {
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.1);
}

button.tc-chat-user-att-file:focus-visible {
  outline: 2px solid var(--tc-accent);
  outline-offset: 2px;
}

.tc-chat-user-att-fileicon {
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 5px;
  border-radius: 3px;
  color: #fff;
  background: var(--tc-muted);
}

.tc-chat-user-att-fileicon--pdf {
  background: #d33;
}

.tc-chat-user-att-filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.tc-chat-user-att-fileicon--pdf + .tc-chat-user-att-filename {
  max-width: 88px;
}

.tc-chat-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(16, 24, 40, 0.74);
  cursor: zoom-out;
}

.tc-chat-lightbox[hidden] {
  display: none !important;
}

.tc-chat-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}

.tc-chat-body blockquote,
.tc-chat-bubble blockquote {
  padding-left: 12px;
  border-left: 3px solid var(--tc-border);
  color: var(--tc-muted);
}

.tc-chat-body code,
.tc-chat-bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: rgba(16, 24, 40, 0.06);
  color: #c7254e;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.tc-chat-body pre,
.tc-chat-body .tc-md-pre,
.tc-chat-bubble pre,
.tc-chat-bubble .tc-md-pre {
  position: relative;
  background: #1e1e1e;
  color: #f3f3f3;
  border-radius: 8px;
  padding: 12px 12px 10px;
  overflow-x: auto;
}

.tc-chat-body pre code,
.tc-chat-bubble pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  white-space: pre;
}

.tc-md-code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #f3f3f3;
  font-size: 11px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
}

.tc-md-code-copy:hover {
  background: rgba(255, 255, 255, 0.16);
}

.tc-md-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--tc-border);
}

.tc-chat-body table,
.tc-chat-bubble table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tc-chat-body th,
.tc-chat-body td,
.tc-chat-bubble th,
.tc-chat-bubble td {
  border: 1px solid var(--tc-border);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.tc-chat-body th,
.tc-chat-bubble th {
  background: var(--tc-bg);
  font-weight: 600;
}

.tc-chat-body a,
.tc-chat-bubble a {
  color: var(--tc-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tc-chat-body img,
.tc-chat-bubble img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

.tc-chat-composer {
  flex: 0 0 auto;
  padding: 8px 10px 10px;
  background: var(--tc-surface);
}

.tc-chat-compose-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 8px;
  border: 1px solid var(--tc-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
}

body.tc-panel-excel .tc-chat-compose-card.tc-chat-compose-card--dragover {
  border-color: #2563eb;
  background: #f8fafc;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

/* Word / WPS：AI 对话暂不支持文件附件，隐藏输入框附件按钮 */
body.tc-page-chat:not(.tc-panel-excel) .tc-chat-compose-tools {
  display: none !important;
}

body.tc-page-chat:not(.tc-panel-excel) .tc-chat-compose-toolbar {
  justify-content: flex-end;
}

.tc-chat-compose-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.tc-chat-compose-chips[hidden] {
  display: none !important;
}

.tc-chat-compose-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 2px 2px 6px;
  border: 1px solid var(--tc-border);
  border-radius: 999px;
  background: var(--tc-bg);
  font-size: 11px;
  line-height: 1.3;
  color: var(--tc-text);
  min-width: 0;
}

.tc-chat-compose-chip--file {
  padding: 2px 2px 2px 4px;
}

.tc-chat-compose-chip--file[data-attachment-id] {
  cursor: pointer;
}

.tc-chat-compose-chip--file .tc-chat-compose-chip-label {
  max-width: 44px;
}

.tc-chat-compose-chip--selection {
  border-color: rgba(37, 99, 235, 0.28);
  background: rgba(37, 99, 235, 0.06);
  color: #1d4ed8;
}

.tc-chat-compose-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.tc-chat-compose-chip-thumb {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: cover;
  flex: 0 0 auto;
  pointer-events: none;
}

.tc-chat-compose-chip-fileicon {
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: #d33;
  color: #fff;
}

.tc-chat-compose-chip-rm {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--tc-muted);
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.tc-chat-compose-chip-rm:hover {
  color: var(--tc-text);
  background: rgba(16, 24, 40, 0.06);
}

.tc-chat-compose-input {
  width: 100%;
  min-height: 40px;
  max-height: 200px;
  padding: 0;
  border: none;
  background: transparent;
  resize: none;
  overflow-y: hidden;
  border-radius: 0;
  line-height: 1.5;
  font-size: 14px;
  box-shadow: none;
}

.tc-chat-compose-input:focus {
  outline: none;
  box-shadow: none;
}

.tc-chat-compose-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
}

.tc-chat-compose-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.tc-chat-compose-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--tc-muted);
  cursor: pointer;
}

.tc-chat-compose-tool:hover {
  background: var(--tc-bg);
  color: var(--tc-text);
}

.tc-chat-compose-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: var(--tc-accent);
  color: #fff;
  cursor: pointer;
  flex: 0 0 auto;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.tc-chat-compose-send:hover:not(:disabled) {
  filter: brightness(1.05);
}

.tc-chat-compose-send:active:not(:disabled) {
  transform: scale(0.96);
}

.tc-chat-compose-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tc-chat-compose-send.tc-chat-compose-send--stop {
  background: #d32f2f;
}

.tc-chat-compose-send.tc-chat-compose-send--stop:hover:not(:disabled) {
  filter: brightness(1.08);
}

.tc-chat-selection-attach {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 0;
  min-width: 0;
  opacity: 0.72;
}

.tc-chat-selection-attach[hidden] {
  display: none !important;
}

.tc-chat-selection-attach-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--tc-muted, #888);
  line-height: 1.3;
  min-width: 0;
}

.tc-chat-selection-attach-preview {
  font-size: 11px;
  font-weight: 400;
  color: var(--tc-muted, #888);
  line-height: 1.3;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc-autofill-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  overflow: auto;
}

.tc-autofill-input {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tc-autofill-source {
  width: 100%;
  min-height: 100px;
  resize: vertical;
}

.tc-autofill-instr-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  padding: 2px 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--tc-accent, #2563eb);
}

.tc-autofill-instr-caret {
  transition: transform 0.15s ease;
}

.tc-autofill-instr-toggle--open .tc-autofill-instr-caret {
  transform: rotate(90deg);
}

.tc-autofill-instruction {
  width: 100%;
  min-height: 60px;
  resize: vertical;
}

.tc-autofill-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 2px;
}

.tc-autofill-status {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
}

.tc-autofill-status[data-kind='error']   { color: #b91c1c; }
.tc-autofill-status[data-kind='warn']    { color: #b45309; }
.tc-autofill-status[data-kind='success'] { color: #047857; }

/* 填写区域指示器 */
.tc-autofill-scope-caption {
  margin-top: 2px;
}

.tc-autofill-scope-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--tc-border, #e5e7eb);
  background: #f8fafc;
  min-width: 0;
  transition: border-color 0.15s, background 0.15s;
}

.tc-autofill-scope-bar[data-scope='selection'] {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.tc-autofill-scope-icon {
  flex: 0 0 auto;
  display: inline-flex;
  color: #64748b;
}

.tc-autofill-scope-bar[data-scope='selection'] .tc-autofill-scope-icon {
  color: #2563eb;
}

.tc-autofill-scope-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tc-autofill-scope-name {
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}

.tc-autofill-scope-preview {
  font-size: 11px;
  color: #64748b;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc-autofill-scope-reset {
  flex: 0 0 auto;
}

.tc-autofill-scan-btn {
  flex: 1 1 auto;
}

.tc-autofill-review {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tc-autofill-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tc-autofill-group {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.tc-autofill-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #eef2f7;
}

.tc-autofill-group--suggested .tc-autofill-group-head {
  background: #ecfdf5;
  border-bottom-color: #d1fae5;
}

.tc-autofill-group--confirm .tc-autofill-group-head {
  background: #fffbeb;
  border-bottom-color: #fef3c7;
}

.tc-autofill-group-title {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

.tc-autofill-group-hint {
  font-size: 11px;
  color: #6b7280;
}

.tc-autofill-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tc-autofill-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px;
  border-top: 1px solid #f1f5f9;
  transition: background 0.15s;
}

.tc-autofill-row:first-child { border-top: 0; }

.tc-autofill-row--applied {
  background: #f0fdf4;
}

.tc-autofill-row-label {
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  overflow-wrap: anywhere;
}

.tc-autofill-row-value-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.tc-autofill-row-value {
  flex: 1 1 0;
  min-width: 0;
}

.tc-autofill-row-btn {
  flex: 0 0 auto;
  min-width: 48px;
}

.tc-autofill-row-evidence,
.tc-autofill-row-note {
  font-size: 11px;
  color: #6b7280;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.tc-chat-composer-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

/* ── Account & billing ───────────────────────────────────────────────────── */
.tc-header--account {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tc-account-back {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 8px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  color: #fff;
  cursor: pointer;
  opacity: 0.95;
  white-space: nowrap;
}

.tc-account-back:hover {
  opacity: 1;
  text-decoration: underline;
}

.tc-account-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  padding: 14px 16px 28px;
}

.tc-account-lede {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--tc-muted);
  line-height: 1.45;
}

.tc-account-overview {
  background: var(--tc-surface);
  border-radius: 10px;
  padding: 16px 14px 12px;
  margin-bottom: 18px;
  box-shadow: var(--tc-shadow);
  border: 1px solid var(--tc-border);
}

.tc-account-balance-label {
  font-size: 12px;
  color: var(--tc-muted);
  margin-bottom: 0;
}

.tc-account-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}

.tc-account-meta .tc-account-label-row {
  margin-bottom: 3px;
}

.tc-account-meta-label-row.tc-account-label-row {
  margin-bottom: 0;
}

.tc-account-meta .tc-account-label-row .tc-account-meta-label {
  margin-bottom: 0;
}

.tc-account-inline-action {
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--tc-muted);
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.82;
  transition: color 0.15s, opacity 0.15s;
}

.tc-account-inline-action:hover {
  color: var(--tc-accent);
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tc-account-balance-value {
  font-size: clamp(26px, 7vw, 32px);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  margin-bottom: 12px;
}

.tc-account-balance-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--tc-muted);
  margin-left: 4px;
}

.tc-account-balance-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--tc-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.tc-account-pack-hint--expire {
  margin-top: 6px;
}

.tc-account-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding-top: 12px;
  border-top: 1px solid var(--tc-border);
}

.tc-account-meta-label-row {
  grid-column: 1 / -1;
  margin-bottom: -4px;
}

.tc-account-meta-label-row .tc-account-meta-label {
  margin-bottom: 0;
}

.tc-account-meta-label {
  font-size: 11px;
  color: var(--tc-muted);
  margin-bottom: 3px;
}

.tc-account-meta-value {
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}

.tc-account-meta-value--muted {
  font-weight: 500;
  color: var(--tc-muted);
  font-size: 13px;
}

.tc-account-meta-hint {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--tc-muted);
  line-height: 1.4;
}

.tc-account-security-grid {
  margin-top: 10px;
}

.tc-account-security-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tc-account-security-item--uid {
  grid-column: 1 / -1;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--tc-border);
}

.tc-account-uid-value {
  font-size: 13px;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.2px;
  word-break: break-all;
  color: var(--tc-muted);
}

.tc-account-security-status {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.tc-account-bind-hint {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--tc-accent);
  cursor: pointer;
  white-space: nowrap;
}

.tc-account-bind-hint:hover {
  text-decoration: underline;
}

.tc-account-bind-hint[hidden] {
  display: none !important;
}

.tc-account-subscription-manage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--tc-border);
}

.tc-account-subscription-manage[hidden] {
  display: none !important;
}

.tc-account-subscription-status {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  color: var(--tc-muted);
  line-height: 1.4;
}

.tc-account-renew-btn {
  flex-shrink: 0;
  min-width: 64px;
  padding: 0 14px;
  font-size: 13px;
}

.tc-account-scheduled-notice {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--tc-text);
  background: var(--tc-surface-elevated, #f0f6fc);
  border-radius: 8px;
  border: 1px solid var(--tc-border);
}

.tc-account-scheduled-notice[hidden] {
  display: none;
}

.tc-account-section {
  margin-bottom: 10px;
}

.tc-account-usage-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.tc-account-usage-period {
  display: inline-flex;
  padding: 2px;
  border-radius: 8px;
  background: var(--tc-surface);
  border: 1px solid var(--tc-border);
}

.tc-account-usage-period-btn {
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  font-size: 11px;
  color: var(--tc-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.tc-account-usage-period-btn:hover {
  color: var(--tc-text);
}

.tc-account-usage-period-btn.is-active {
  background: var(--tc-accent-soft);
  color: var(--tc-accent);
  font-weight: 600;
}

.tc-account-usage-card {
  background: #fafafa;
  border-radius: 10px;
  padding: 14px;
  border: 1px solid var(--tc-border);
}

#usageModal .tc-modal-actions {
  margin-top: 14px;
}

.tc-account-usage-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin-bottom: 12px;
}

.tc-account-usage-stat {
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.tc-account-usage-note {
  margin: 0 0 12px;
  font-size: 11px;
  color: var(--tc-muted);
  line-height: 1.45;
}

.tc-account-usage-table-wrap {
  border-top: 1px solid var(--tc-border);
  padding-top: 10px;
}

.tc-account-usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.tc-account-usage-table th,
.tc-account-usage-table td {
  padding: 6px 4px;
  text-align: left;
  border-bottom: 1px solid var(--tc-border);
}

.tc-account-usage-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--tc-muted);
}

.tc-account-usage-table tbody tr:last-child td {
  border-bottom: none;
}

.tc-account-usage-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tc-account-usage-empty {
  margin: 0;
  padding: 8px 0 2px;
  font-size: 12px;
  color: var(--tc-muted);
  text-align: center;
}

.tc-account-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.tc-account-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  max-width: 100%;
  margin: 0 0 10px;
  padding: 4px 0;
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.tc-account-toggle:hover .tc-account-section-title {
  color: var(--tc-accent);
}

.tc-account-chevron {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
  color: var(--tc-muted);
  transition: transform 0.2s ease;
}

.tc-account-toggle[aria-expanded="true"] .tc-account-chevron {
  transform: rotate(90deg);
}

.tc-account-pack-body {
  display: none;
}

.tc-account-pack-body.is-open {
  display: block;
}

.tc-account-plan-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tc-account-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--tc-border);
  border-radius: 8px;
  background: var(--tc-surface);
  transition: border-color 0.15s, background 0.15s;
}

.tc-account-plan-row--current {
  border-color: var(--tc-accent);
  background: var(--tc-accent-soft);
}

.tc-account-plan-row--upgrade {
  border-color: color-mix(in srgb, var(--tc-accent) 35%, var(--tc-border));
  background: var(--tc-accent-soft);
}

.tc-account-plan-row--top {
  border-color: color-mix(in srgb, var(--tc-accent) 55%, var(--tc-border));
}

.tc-account-plan-row__main {
  min-width: 0;
  flex: 1;
}

.tc-account-plan-row__kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tc-muted);
  margin-bottom: 4px;
}

.tc-account-plan-row__name {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.tc-account-plan-row__price {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--tc-muted);
}

.tc-account-plan-row__action {
  flex-shrink: 0;
}

.tc-account-plan-row__btn {
  min-width: 72px;
  padding: 6px 16px;
  font-size: 13px;
}

.tc-account-plan-row__badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tc-accent);
  background: color-mix(in srgb, var(--tc-accent) 12%, transparent);
}

.tc-account-pack-card {
  background: var(--tc-surface);
  border-radius: 10px;
  padding: 14px;
  border: 1px solid var(--tc-border);
  box-shadow: var(--tc-shadow);
}

.tc-account-pack-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--tc-muted);
}

.tc-account-pack-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.tc-account-pack-chip {
  padding: 9px 6px;
  border: 1px solid var(--tc-border);
  border-radius: 8px;
  background: var(--tc-surface);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.tc-account-pack-chip:hover {
  border-color: var(--tc-accent);
  background: var(--tc-accent-soft);
}

.tc-account-pack-chip.is-active {
  border-color: var(--tc-accent);
  background: var(--tc-accent-soft);
  color: var(--tc-accent);
  font-weight: 600;
}

.tc-account-pack-chip.is-disabled,
.tc-account-pack-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: var(--tc-border);
  background: var(--tc-surface);
  color: var(--tc-muted);
}

.tc-account-pack-chip.is-disabled:hover,
.tc-account-pack-chip:disabled:hover {
  border-color: var(--tc-border);
  background: var(--tc-surface);
}

.tc-account-pack-summary {
  font-size: 13px;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.tc-account-issue-list {
  margin: 0 0 16px;
  padding-left: 1.2rem;
  font-size: 13px;
  line-height: 1.5;
  color: var(--tc-text);
}

.tc-account-issue-list li + li {
  margin-top: 6px;
}

.tc-account-logout {
  width: 100%;
  margin-top: 20px;
}

.tc-account-about {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--tc-border);
  text-align: center;
}

.tc-account-about__version {
  display: inline-block;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 12px;
  color: var(--tc-muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.tc-account-about__version:hover {
  color: var(--tc-accent);
  text-decoration-color: currentColor;
}

.tc-account-about .tc-upgrade-slot--account {
  margin-top: 12px;
}

.tc-account-about .tc-upgrade-slot--account.is-visible {
  max-height: 120px;
}

.tc-account-overview.is-loading .tc-account-balance-value,
.tc-account-overview.is-loading .tc-account-meta-value {
  color: transparent;
  background: #e8eaed;
  border-radius: 4px;
}

.tc-account-usage-card.is-loading .tc-account-usage-stat {
  color: transparent;
  background: #e8eaed;
  border-radius: 4px;
  min-height: 1.2em;
}

.tc-account-usage-card.is-loading .tc-account-usage-table-wrap {
  opacity: 0.45;
  pointer-events: none;
}

.tc-softbreak-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.tc-softbreak-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tc-softbreak-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tc-softbreak-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tc-text);
}

.tc-softbreak-summary p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--tc-muted);
}

.tc-softbreak-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--tc-text);
}

.tc-softbreak-check input {
  margin-top: 3px;
}

.tc-softbreak-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tc-softbreak-result {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid var(--tc-border);
  padding-top: 14px;
}

.tc-softbreak-result div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tc-softbreak-result span {
  font-size: 11px;
  color: var(--tc-muted);
}

.tc-softbreak-result strong {
  font-size: 15px;
  color: var(--tc-text);
}

/* ── Excel chat 附件 + fills 卡片 ── */
.tc-chat-attachments-wrap { margin: 6px 0; }
.tc-chat-attachments-head { display:flex; align-items:center; justify-content:space-between; font-size:12px; color:var(--tc-muted); margin-bottom:4px; }
.tc-chat-attachments-label { display:inline-flex; align-items:center; gap:4px; }
.tc-chat-attachments { display:flex; flex-wrap:wrap; gap:6px; }
.tc-chat-attach-chip { display:flex; align-items:center; gap:4px; padding:4px 6px; background:var(--tc-surface-2,#eef1f6); border-radius:6px; font-size:12px; max-width:160px; }
.tc-chat-attach-thumb { width:24px; height:24px; object-fit:cover; border-radius:4px; }
.tc-chat-attach-fileicon { background:#d33; color:#fff; font-size:10px; padding:2px 4px; border-radius:3px; }
.tc-chat-attach-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tc-chat-attach-rm { border:none; background:none; cursor:pointer; color:var(--tc-muted); font-size:16px; line-height:1; }
.tc-chat-fills-card { margin-top:8px; border:1px solid var(--tc-border,#ddd); border-radius:8px; overflow:hidden; }
.tc-chat-fills-head { padding:6px 10px; background:var(--tc-surface-2,#eef1f6); font-size:13px; font-weight:600; display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.tc-chat-fills-actions { display:flex; gap:6px; align-items:center; }
.tc-chat-fills-row { padding:8px 10px; border-top:1px solid var(--tc-border,#eee); }
.tc-chat-fills-row--fill { background:#f0f9ff; }
.tc-chat-fills-row--review { background:#fffbeb; }
.tc-chat-fills-row--skip { background:#f5f5f5; opacity:.7; }
.tc-chat-fills-label { font-size:13px; font-weight:500; margin-bottom:4px; }
.tc-chat-fills-valrow { display:flex; gap:6px; align-items:center; }
.tc-chat-fills-value { flex:1; }
.tc-chat-fills-value-readonly { flex:1; font-size:13px; word-break:break-all; }
.tc-chat-fills-evidence { font-size:11px; color:var(--tc-muted); margin-top:4px; }
.tc-chat-msg--pending .tc-chat-body { color:var(--tc-muted); font-style:italic; }

/* ---------- plugin image translate (imagetranslate.html) ---------- */
body.tc-page-imgtr .tc-app {
  min-height: 100vh;
}

.tc-imgtr-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tc-imgtr-host-hint {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
}

.tc-imgtr-card {
  background: #fff;
  border: 1px solid var(--tc-border, #e5e7eb);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.tc-imgtr-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.tc-imgtr-card-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.tc-imgtr-scope-badge {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.tc-imgtr-scope-badge[data-state='empty'] {
  color: #64748b;
  background: #f1f5f9;
}

.tc-imgtr-scope-badge[data-state='ready'] {
  color: #1d4ed8;
  background: #dbeafe;
}

.tc-imgtr-scope-badge[data-state='invalid'] {
  color: #b91c1c;
  background: #fee2e2;
}

.tc-imgtr-scope-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--tc-border, #e5e7eb);
  background: #f8fafc;
  min-width: 0;
  min-height: 72px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.tc-imgtr-scope-bar[data-scope='ready'] {
  border-color: #bfdbfe;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.06);
}

.tc-imgtr-scope-bar[data-scope='invalid'] {
  border-color: #fecaca;
  background: #fef2f2;
}

.tc-imgtr-scope-placeholder {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1.5px dashed #cbd5e1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.tc-imgtr-scope-bar[data-scope='ready'] .tc-imgtr-scope-placeholder {
  display: none;
}

.tc-imgtr-scope-thumb-wrap {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.tc-imgtr-scope-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tc-imgtr-scope-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tc-imgtr-scope-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
}

.tc-imgtr-scope-meta {
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}

.tc-imgtr-scope-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.45;
}

.tc-imgtr-scope-hint[hidden] {
  display: none !important;
}

.tc-imgtr-card--settings {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tc-imgtr-card--settings .tc-field-label {
  margin-bottom: 0;
}

.tc-imgtr-lang {
  width: 100%;
  margin-bottom: 0;
}

.tc-imgtr-instr-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  margin-top: 2px;
  padding: 2px 0;
  border: none;
  background: none;
  font-size: 12px;
  color: var(--tc-accent, #2563eb);
  cursor: pointer;
}

.tc-imgtr-instr-toggle:hover {
  color: var(--tc-accent-hover, #1d4ed8);
}

.tc-imgtr-instr-caret {
  transition: transform 0.15s ease;
}

.tc-imgtr-instr-toggle--open .tc-imgtr-instr-caret {
  transform: rotate(90deg);
}

.tc-imgtr-instruction {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  margin-top: 2px;
}

.tc-imgtr-card--action {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.tc-imgtr-credit-hint {
  margin: 0;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.45;
  text-align: center;
}

.tc-imgtr-mock-btn {
  width: 100%;
  min-height: 32px;
  font-size: 12px;
  color: #64748b;
  border-radius: 8px;
}

.tc-imgtr-mock-btn[hidden] {
  display: none;
}

.tc-imgtr-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

.tc-imgtr-start-btn {
  width: 100%;
  min-height: 38px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
}

.tc-imgtr-start-btn:disabled {
  opacity: 0.55;
}

.tc-imgtr-cancel-btn {
  align-self: center;
  min-height: 32px;
  font-size: 12px;
}

.tc-imgtr-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tc-imgtr-progress[hidden] {
  display: none !important;
}

.tc-imgtr-bar {
  height: 5px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.tc-imgtr-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  border-radius: inherit;
  transition: width 0.28s ease;
}

.tc-imgtr-status {
  margin: 0;
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
}

.tc-imgtr-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tc-imgtr-result[hidden] {
  display: none !important;
}

.tc-imgtr-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tc-imgtr-compare[hidden] {
  display: none !important;
}

.tc-imgtr-compare-fig {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.tc-imgtr-compare-fig figcaption {
  margin: 0;
}

.tc-imgtr-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #475569;
  letter-spacing: 0.02em;
}

.tc-imgtr-tag--accent {
  background: #dbeafe;
  color: #1d4ed8;
}

.tc-imgtr-compare-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 108px;
  max-height: 148px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  overflow: hidden;
}

.tc-imgtr-compare-frame img {
  width: 100%;
  max-height: 132px;
  object-fit: contain;
  display: block;
}

.tc-imgtr-result-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tc-imgtr-replace-btn {
  width: 100%;
  min-height: 36px;
  font-weight: 600;
  border-radius: 10px;
}

.tc-imgtr-replace-btn:disabled {
  opacity: 0.55;
}

.tc-imgtr-result-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
}

.tc-imgtr-link-btn {
  min-height: 30px;
  padding: 0 6px;
  font-size: 12px;
}

.tc-imgtr-replace-status {
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: #047857;
  background: #ecfdf5;
  border-radius: 8px;
  text-align: center;
}

.tc-imgtr-replace-status[data-kind='info'] {
  color: #475569;
  background: #f8fafc;
}

.tc-imgtr-replace-status[hidden] {
  display: none !important;
}

/* ---------- image translate lightbox (fullscreen iframe) ---------- */
.tc-imgtr-zoomable {
  cursor: zoom-in;
}

.tc-imgtr-zoomable:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.tc-imgtr-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background: #0b1220;
}

.tc-imgtr-lightbox[hidden] {
  display: none !important;
}

.tc-imgtr-lightbox-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  background: #111827;
}

.tc-imgtr-lightbox-title {
  font-size: 14px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.35;
}

.tc-imgtr-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tc-imgtr-lightbox-toolbar .tc-btn-ghost {
  color: #e2e8f0;
}

.tc-imgtr-lightbox-toolbar .tc-btn-ghost:hover {
  background: rgba(148, 163, 184, 0.16);
  color: #fff;
}

.tc-imgtr-lightbox-frame-wrap {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.tc-imgtr-lightbox-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #0b1220;
}

