﻿*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f0f2f5;
  min-height: 100vh;
  color: #1f2329;
}

/* 鈹€鈹€ 棣栭〉 鈹€鈹€ */
#homePage {
  padding: 32px 16px 120px;
  max-width: 900px;
  margin: 0 auto;
}

/* 棣栭〉鍒嗗尯 */
.home-section {
  margin-bottom: 36px;
}
.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.home-section-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2329;
}
.btn-section-action {
  height: 32px;
  padding: 0 14px;
  border: 1px solid #d0d7de;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  color: #1f2329;
  transition: background .15s;
}
.btn-section-action:hover:not(:disabled) { background: #f5f6f7; }
.btn-section-action:disabled { opacity: .5; cursor: not-allowed; }

/* 椋炰功鏂囨。鍒楄〃 */
.doc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-item {
  background: #fff;
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  border: 1px solid transparent;
}
.doc-item:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,.1);
  border-color: #3370ff30;
}
.doc-item:active { transform: scale(.99); }

.doc-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #e8f0fe;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.doc-icon svg { width: 18px; height: 18px; fill: #3370ff; }

.doc-info { flex: 1; min-width: 0; }
.doc-name {
  font-size: 15px;
  font-weight: 500;
  color: #1f2329;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-date {
  font-size: 12px;
  color: #8f959e;
  margin-top: 2px;
}

.doc-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.doc-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, background .15s;
  flex-shrink: 0;
  text-decoration: none;
}
.doc-item:hover .doc-action-btn { opacity: 1; }
.doc-action-btn:hover { background: #eef0f4; }
.doc-action-btn svg { width: 15px; height: 15px; }

.doc-open svg { fill: none; stroke: #3370ff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.doc-open:hover { background: #e8f0fe !important; }

.doc-delete svg { fill: #d83931; }
.doc-delete:hover { background: #fff1f0 !important; }

/* 娓告垙椤圭洰鍗＄墖缃戞牸 */
.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.project-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  border: 1px solid transparent;
  position: relative;
  transition: box-shadow .15s, border-color .15s;
}
.project-card:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,.1);
  border-color: #3370ff30;
}
.project-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #e8f0fe;
}
.project-cover-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #e8f0fe 0%, #dbeafe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.project-body {
  padding: 10px 12px;
}
.project-name {
  font-size: 14px;
  font-weight: 600;
  color: #1f2329;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-uid {
  font-size: 11px;
  color: #8f959e;
  margin-top: 3px;
  font-family: 'SF Mono', 'Consolas', monospace;
}
.project-group {
  font-size: 11px;
  color: #8f959e;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.project-card:hover .project-delete-btn { display: flex; }
.project-delete-btn:hover { background: #d83931; }
.project-stats-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border-radius: 5px;
  font-size: 11px;
  padding: 3px 6px;
  line-height: 1.6;
  pointer-events: none;
}
.project-stats-spinner {
  width: 10px;
  height: 10px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: proj-spin .7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes proj-spin { to { transform: rotate(360deg); } }

.empty-hint {
  text-align: center;
  color: #8f959e;
  font-size: 14px;
  margin-top: 40px;
}
.empty-hint .emoji { font-size: 40px; margin-bottom: 12px; }

.project-empty-hint {
  grid-column: 1 / -1;
  text-align: center;
  color: #8f959e;
  font-size: 14px;
  padding: 40px 0;
}

/* FAB 鍙婁簩绾ц彍鍗?*/
#fab {
  position: fixed;
  right: 28px;
  bottom: 32px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #3370ff;
  color: #fff;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(51,112,255,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .15s;
  z-index: 100;
}
#fab:hover { background: #2860e1; }
#fab.fab-open { transform: rotate(45deg); }

.fab-menu {
  position: fixed;
  right: 28px;
  bottom: 96px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .18s, transform .18s;
}
.fab-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  height: 40px;
  background: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 20px;
  font-size: 14px;
  color: #1f2329;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  white-space: nowrap;
}
.fab-menu-item:hover { background: #f5f6f7; }
.fab-menu-item svg { width: 16px; height: 16px; flex-shrink: 0; }

/* 鈹€鈹€ 寮圭獥 鈹€鈹€ */
.modal-mask {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-mask.open { display: flex; }

.modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px 28px 24px;
  width: min(460px, calc(100vw - 32px));
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.modal h2 { font-size: 17px; font-weight: 600; margin-bottom: 18px; }
.modal input[type="text"] {
  width: 100%; height: 42px;
  border: 1px solid #d0d7de;
  border-radius: 8px; padding: 0 14px;
  font-size: 14px; outline: none;
  transition: border-color .15s;
  display: block;
}
.modal input[type="text"]:focus { border-color: #3370ff; }
.modal-hint { font-size: 12px; color: #8f959e; margin-top: 8px; }
.modal-status { font-size: 13px; min-height: 20px; margin-top: 10px; color: #646a73; }
.modal-status.error { color: #d83931; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.btn-cancel { height: 38px; padding: 0 18px; border: 1px solid #d0d7de; border-radius: 8px; background: #fff; font-size: 14px; cursor: pointer; color: #1f2329; }
.btn-cancel:hover { background: #f5f6f7; }
.btn-confirm { height: 38px; padding: 0 18px; border: none; border-radius: 8px; background: #3370ff; color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s; }
.btn-confirm:hover:not(:disabled) { background: #2860e1; }
.btn-confirm:disabled { opacity: .5; cursor: not-allowed; }

/* 鈹€鈹€ 璇︽儏椤?鈹€鈹€ */
#detailPage {
  display: none;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* 椤堕儴鏍?*/
.detail-topbar {
  background: #fff;
  border-bottom: 1px solid #e5e6eb;
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  overflow-x: auto;
}
.detail-topbar::-webkit-scrollbar { height: 0; }

.btn-back {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #d0d7de;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #1f2329;
  flex-shrink: 0;
}
.btn-back:hover { background: #f5f6f7; }
.btn-back svg { width: 14px; height: 14px; fill: none; stroke: #646a73; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.detail-title {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  max-width: 180px;
}

/* 椤圭洰涓嬫媺 */
.project-select {
  height: 32px;
  padding: 0 10px;
  border: 1px solid #d0d7de;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  color: #1f2329;
  cursor: pointer;
  max-width: 200px;
  min-width: 120px;
  outline: none;
  flex-shrink: 0;
}
.project-select:focus { border-color: #3370ff; }

/* 宸ヤ綔琛ㄦ爣绛炬爮 */
#sheetTabBar {
  background: #fafbfc;
  border-bottom: 1px solid #e5e6eb;
  display: flex;
  align-items: center;
  min-height: 40px;
  flex-shrink: 0;
  padding: 0 4px;
  gap: 0;
}
#sheetTabScroll {
  flex: 1;
  display: flex;
  align-items: center;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 0 8px;
  gap: 2px;
}
#sheetTabScroll::-webkit-scrollbar { height: 0; }
.tab-scroll-btn {
  flex-shrink: 0;
  width: 24px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: #646a73;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}
.tab-scroll-btn:hover { background: #eef0f4; color: #1f2329; }

.sheet-tab {
  padding: 0 14px;
  height: 30px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: #646a73;
  border-radius: 6px;
  white-space: nowrap;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.sheet-tab:hover { background: #eef0f4; color: #1f2329; }
.sheet-tab.active { background: #e8f0fe; color: #3370ff; font-weight: 500; }

/* 鐘舵€佹潯 */
#detailStatus {
  font-size: 13px;
  color: #646a73;
  padding: 8px 20px 0;
  flex-shrink: 0;
  min-height: 28px;
}
#detailStatus.error { color: #d83931; }
#detailStatus:empty { min-height: 0; padding-top: 0; }

/* 琛ㄦ牸鍖哄煙 */
.detail-table-wrap {
  flex: 1;
  overflow: hidden;
  padding: 8px 20px 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#dataTable {
  flex: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e6eb;
  min-height: 0;
}

.tabulator {
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  border: none;
  height: 100% !important;
}
.tabulator .tabulator-header { background: #f7f8fa; border-bottom: 1px solid #e5e6eb; }
.tabulator .tabulator-header .tabulator-col { background: #f7f8fa; border-right: 1px solid #e5e6eb; }
.tabulator .tabulator-header .tabulator-col .tabulator-col-content { padding: 8px 12px; }
.tabulator .tabulator-header .tabulator-col .tabulator-col-title { font-weight: 600; color: #1f2329; white-space: nowrap; }
.tabulator .tabulator-row { border-bottom: 1px solid #e5e6eb; }
.tabulator .tabulator-row.tabulator-row-even { background: #fafbfc; }
.tabulator .tabulator-row .tabulator-cell { border-right: 1px solid #e5e6eb; padding: 8px 12px; white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word; }
.tabulator .tabulator-footer { background: #f7f8fa; border-top: 1px solid #e5e6eb; font-size: 12px; color: #646a73; }
.tabulator .tabulator-row:hover .tabulator-cell,
.tabulator .tabulator-row.tabulator-row-even:hover .tabulator-cell { background: inherit !important; }
.tabulator .tabulator-row:not(.row-no-interact) .tabulator-cell.cell-interactive {
  cursor: pointer;
  user-select: none;
  transition: background .12s, outline-color .12s;
}
.tabulator .tabulator-row:not(.row-no-interact) .tabulator-cell.cell-interactive:hover {
  background: rgba(51,112,255,.07) !important;
  outline: 1px solid #3370ff;
  outline-offset: -1px;
}
.tabulator .tabulator-cell.cell-selected {
  background: rgba(51,112,255,.12) !important;
  outline: 2px solid #3370ff;
  outline-offset: -2px;
}

.meta { font-size: 12px; color: #8f959e; margin-top: 6px; flex-shrink: 0; }

/* Misc 鍗＄墖缃戞牸 */
.misc-group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #e5e6eb;
}
.misc-group-row:last-child { border-bottom: none; }
.misc-card {
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  padding: 8px 12px;
  min-width: 130px;
  max-width: 220px;
  cursor: default;
  user-select: none;
  transition: background .15s, border-color .15s;
  background: #fff;
}
.misc-card:hover {
  background: rgba(51,112,255,.07);
  border-color: #3370ff;
}
.misc-card-field   { font-size: 11px; font-weight: 400; color: #a8abb3; word-break: break-all; }
.misc-card-comment { font-size: 13px; color: #3370ff; font-weight: 600; margin-top: 3px; }
.misc-card-value   { font-size: 13px; color: #1f2329; margin-top: 4px; font-weight: 500; }
/* 鍙抽敭鑿滃崟 */
#tableContextMenu {
  display: none;
  position: fixed;
  background: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  z-index: 9999;
  padding: 4px 0;
  min-width: 140px;
}
#tableContextMenu button {
  display: block;
  width: 100%;
  padding: 8px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  color: #1f2329;
  white-space: nowrap;
}
#tableContextMenu button:hover { background: #f0f4ff; color: #3370ff; }
#miscContextMenu {
  display: none;
  position: fixed;
  background: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  z-index: 9999;
  padding: 4px 0;
  min-width: 140px;
}
#miscContextMenu button {
  display: block;
  width: 100%;
  padding: 8px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  color: #1f2329;
  white-space: nowrap;
}
#miscContextMenu button:hover { background: #f0f4ff; color: #3370ff; }

/* 椤堕儴鏍忔搷浣滄寜閽粍 */
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-topbar {
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.btn-topbar:disabled { opacity: .6; cursor: not-allowed; }

.btn-studio {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #86efac;
}
.btn-studio:hover:not(:disabled) {
  background: #dcfce7;
  border-color: #4ade80;
}

.btn-prod {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
}
.btn-prod:hover:not(:disabled) {
  background: #ffedd5;
  border-color: #fb923c;
}

.btn-cleanup {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}
.btn-cleanup:hover:not(:disabled) {
  background: #fee2e2;
  border-color: #f87171;
}

.btn-refresh {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.btn-refresh:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
}

/* 涓€閿湰鍦板寲鎸夐挳 */
.btn-localize {
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: #d97706;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  box-shadow: 0 1px 3px rgba(217,119,6,.35);
}
.btn-localize:hover:not(:disabled) { background: #b45309; }
.btn-localize:disabled { opacity: .6; cursor: not-allowed; }

/* 涓婁紶鏈湴鍖栨寜閽?*/
.btn-upload-l10n {
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  box-shadow: 0 1px 3px rgba(37,99,235,.35);
}
.btn-upload-l10n:hover:not(:disabled) { background: #1d4ed8; }
.btn-upload-l10n:disabled { opacity: .6; cursor: not-allowed; }

/* 涓婁紶鏈湴鍖?diff 鏍囩 */
.l10n-tag--add    { background: #dcfce7; color: #166534; }
.l10n-tag--modify { background: #fef3c7; color: #92400e; }
.l10n-type-badge  { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; flex-shrink: 0; }
.l10n-type-badge--new    { background: #dcfce7; color: #166534; }
.l10n-type-badge--update { background: #dbeafe; color: #1d4ed8; }

/* 澶嶅埗閰嶇疆浠ｇ爜鎸夐挳 */
.btn-copy-config {
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: #3370ff;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  box-shadow: 0 1px 3px rgba(51,112,255,.35);
}
.btn-copy-config:hover:not(:disabled) { background: #2860e1; }
.btn-copy-config:disabled { opacity: .6; cursor: not-allowed; }

/* 鈹€鈹€ 榻胯疆鎸夐挳 鈹€鈹€ */
#settingsBtn {
  position: fixed;
  top: 16px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #e5e6eb;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.09);
  z-index: 90;
  transition: background .15s, box-shadow .15s;
}
#settingsBtn:hover { background: #f5f6f7; box-shadow: 0 2px 8px rgba(0,0,0,.13); }
#settingsBtn svg { width: 18px; height: 18px; fill: #646a73; }

/* 鈹€鈹€ 璁剧疆闈㈡澘 鈹€鈹€ */
.settings-modal {
  width: min(440px, calc(100vw - 32px));
}
.settings-modal h2 { font-size: 17px; font-weight: 600; margin-bottom: 20px; }
.settings-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-row-label {
  font-size: 13px;
  font-weight: 500;
  color: #1f2329;
}
.settings-row-control {
  display: flex;
  gap: 8px;
  align-items: center;
}
.settings-row-control input[type="text"] {
  flex: 1;
  height: 38px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  font-family: 'SF Mono', 'Consolas', monospace;
  color: #1f2329;
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.settings-row-control input[type="text"]:focus { border-color: #3370ff; }
.settings-row-control input[type="text"]:read-only { background: #f7f8fa; color: #646a73; cursor: default; }
.btn-settings-action {
  height: 38px;
  padding: 0 14px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  color: #1f2329;
  white-space: nowrap;
  transition: background .15s;
  flex-shrink: 0;
}
.btn-settings-action:hover { background: #f5f6f7; }
.btn-settings-action.primary {
  background: #3370ff;
  border-color: #3370ff;
  color: #fff;
}
.btn-settings-action.primary:hover { background: #2860e1; }
.settings-status { font-size: 12px; min-height: 18px; color: #8f959e; }
.settings-status.error { color: #d83931; }
.settings-status.ok { color: #15803d; }

/* 鍔犺浇鍔ㄧ敾 */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid #e5e6eb;
  border-top-color: #3370ff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* 鈹€鈹€ Diff 寮圭獥 鈹€鈹€ */
.diff-modal {
  width: min(700px, calc(100vw - 32px));
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.diff-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid #e5e6eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.diff-header h2 { font-size: 16px; font-weight: 600; margin: 0; }
.diff-close-btn {
  width: 38px; height: 38px;
  border: none; background: #dc2626; cursor: pointer;
  font-size: 22px; color: #fff; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.diff-close-btn:hover { background: #b91c1c; }
.diff-update-btn {
  padding: 6px 16px; height: 38px;
  background: #15803d; color: #fff;
  border: none; border-radius: 6px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  flex-shrink: 0;
}
.diff-update-btn:hover:not(:disabled) { background: #166534; }
.diff-update-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.diff-body { flex: 1; overflow-y: auto; padding: 16px 24px 24px; }
.diff-summary { font-size: 13px; color: #646a73; margin-bottom: 14px; }
.diff-empty {
  text-align: center; color: #15803d; font-size: 14px;
  padding: 36px 0; background: #f0fdf4;
  border-radius: 10px; border: 1px solid #86efac;
}
.diff-section { margin-bottom: 18px; }
.diff-section-title {
  font-size: 13px; font-weight: 600; color: #1f2329;
  margin-bottom: 6px; padding-bottom: 5px;
  border-bottom: 1px solid #e5e6eb;
  display: flex; align-items: center; gap: 8px;
}
.diff-count { font-weight: 400; color: #646a73; font-size: 12px; }
.diff-no-change { font-size: 12px; color: #8f959e; padding: 3px 6px; }
.diff-row {
  display: flex; align-items: baseline; gap: 6px;
  padding: 4px 8px; border-radius: 5px; margin-bottom: 2px;
  font-size: 12.5px;
  font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
}
.diff-row-added   { background: #f0fdf4; }
.diff-row-removed { background: #fff1f0; }
.diff-row-changed { background: #fffbeb; }
.diff-badge {
  font-size: 10.5px; font-weight: 600;
  padding: 1px 5px; border-radius: 3px; flex-shrink: 0;
}
.diff-badge-added   { background: #dcfce7; color: #15803d; }
.diff-badge-removed { background: #fee2e2; color: #dc2626; }
.diff-badge-changed { background: #fef3c7; color: #b45309; }
.diff-path { color: #646a73; flex-shrink: 0; }
.diff-row-label { font-size: 10.5px; color: #8f959e; background: #f0f2f5; padding: 1px 5px; border-radius: 3px; flex-shrink: 0; }
.diff-value-old { color: #dc2626; text-decoration: line-through; word-break: break-all; }
.diff-value-new  { color: #15803d; word-break: break-all; }
.diff-arrow { color: #8f959e; flex-shrink: 0; }

/* 鈹€鈹€ 鏈湴鍖栧脊绐?鈹€鈹€ */
.l10n-modal {
  width: min(680px, calc(100vw - 32px));
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.l10n-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid #e5e6eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.l10n-header h2 { font-size: 16px; font-weight: 600; margin: 0; }
.l10n-close-btn {
  width: 38px; height: 38px;
  border: none; background: #dc2626; cursor: pointer;
  font-size: 22px; color: #fff; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.l10n-close-btn:hover { background: #b91c1c; }
.l10n-translate-btn {
  padding: 6px 16px; height: 38px;
  background: #15803d; color: #fff;
  border: none; border-radius: 6px;
  font-size: 14px; font-weight: 500; cursor: pointer; flex-shrink: 0;
}
.l10n-translate-btn:hover:not(:disabled) { background: #166534; }
.l10n-translate-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.l10n-body { flex: 1; overflow-y: auto; padding: 16px 24px 24px; }
.l10n-all-good {
  text-align: center; color: #15803d; font-size: 14px;
  padding: 36px 0; background: #f0fdf4;
  border-radius: 10px; border: 1px solid #86efac;
}
.l10n-section { margin-bottom: 20px; }
.l10n-section-title {
  font-size: 13px; font-weight: 600; color: #1f2329;
  margin-bottom: 6px; padding-bottom: 5px;
  border-bottom: 1px solid #e5e6eb;
  display: flex; align-items: center; gap: 8px;
}
.l10n-lang-code { font-weight: 400; color: #8f959e; font-size: 12px; font-family: monospace; }
.l10n-miss-count {
  margin-left: auto;
  font-size: 11px; font-weight: 600;
  padding: 1px 7px; border-radius: 10px;
  background: #fee2e2; color: #dc2626;
}
.l10n-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 8px; border-radius: 5px; margin-bottom: 3px;
  background: #fafafa; border: 1px solid #f0f0f0; font-size: 12.5px;
}
.l10n-item-num {
  font-size: 11px; color: #9ca3af; font-weight: 500;
  flex-shrink: 0; padding-top: 2px; min-width: 22px;
}
.l10n-item-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.l10n-item-text { color: #1f2329; word-break: break-all; line-height: 1.5; }
.l10n-item-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.l10n-tag {
  font-size: 11px; font-weight: 600;
  padding: 1px 7px; border-radius: 10px;
  background: #fee2e2; color: #dc2626;
  flex-shrink: 0;
}
.l10n-summary { font-size: 13px; color: #646a73; margin-bottom: 14px; }

/* 鈹€鈹€ 缈昏瘧杩涘害鍗＄墖 鈹€鈹€ */
.l10n-modal--wide { width: min(1100px, calc(100vw - 32px)) !important; }
.tx-card-container { display: flex; flex-direction: column; gap: 10px; }
.tx-card { border: 1px solid #e5e6eb; border-radius: 8px; overflow: hidden; }
.tx-card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  background: #f9fafb; user-select: none; font-size: 13px;
}
.tx-card-header:hover { background: #f0f2f5; }
.tx-card-arrow { font-size: 10px; color: #9ca3af; transition: transform .2s; flex-shrink: 0; }
.tx-card--expanded .tx-card-arrow { transform: rotate(0deg); }
.tx-card:not(.tx-card--expanded) .tx-card-arrow { transform: rotate(-90deg); }
.tx-card-batch { font-weight: 600; color: #1f2329; flex-shrink: 0; }
.tx-card-langs { color: #646a73; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-card-count { color: #9ca3af; flex-shrink: 0; }
.tx-card-status {
  margin-left: auto; flex-shrink: 0;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
}
.tx-status-pending { background: #fef9c3; color: #92400e; }
.tx-status-done { background: #d1fae5; color: #065f46; }
.tx-status-fail { background: #fee2e2; color: #dc2626; }
.tx-card-body { display: none; border-top: 1px solid #e5e6eb; }
.tx-card--expanded .tx-card-body { display: flex; }
.tx-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tx-panel-left { border-right: 1px solid #e5e6eb; max-width: 420px; }
.tx-panel-title {
  font-size: 11px; font-weight: 600; color: #8f959e;
  padding: 6px 12px; background: #f9fafb;
  border-bottom: 1px solid #e5e6eb; flex-shrink: 0;
}
.tx-prompt-pre {
  margin: 0; padding: 10px 12px;
  font-size: 11px; font-family: monospace;
  color: #374151; overflow: auto;
  max-height: 260px; white-space: pre-wrap; word-break: break-all;
}
.tx-result-content { padding: 10px 12px; font-size: 12px; color: #646a73; overflow: auto; max-height: 260px; }
.tx-result-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.tx-result-table th, .tx-result-table td {
  border: 1px solid #e5e6eb; padding: 4px 8px;
  text-align: left; vertical-align: top;
}
.tx-result-table th { background: #f3f4f6; font-weight: 600; font-size: 11px; color: #374151; }
.tx-cell-source { color: #8f959e; font-style: italic; max-width: 180px; word-break: break-all; }
.tx-error {
  color: #dc2626; background: #fff1f0;
  border: 1px solid #fca5a5; border-radius: 6px;
  padding: 10px 12px;
}

/* 鈹€鈹€ 娓呮暟鎹脊绐?鈹€鈹€ */
.cleanup-modal {
  width: min(520px, calc(100vw - 32px));
  height: 600px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  position: relative;
}
.cleanup-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid #e5e6eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.cleanup-header h2 { font-size: 16px; font-weight: 600; margin: 0; }
.cleanup-close-btn {
  width: 38px; height: 38px;
  border: none; background: #f3f4f6; cursor: pointer;
  font-size: 22px; color: #646a73; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cleanup-close-btn:hover { background: #e5e7eb; }
.cleanup-tabs {
  display: flex; gap: 4px;
  padding: 10px 24px 0;
  border-bottom: 1px solid #e5e6eb;
  flex-shrink: 0;
}
.cleanup-tab {
  padding: 8px 14px;
  font-size: 13px; font-weight: 500;
  color: #646a73; cursor: pointer;
  border-bottom: 2px solid transparent;
  background: none; border-left: none; border-right: none; border-top: none;
  margin-bottom: -1px;
}
.cleanup-tab.active { color: #3370ff; border-bottom-color: #3370ff; }
.cleanup-body { flex: 1; overflow-y: auto; padding: 12px 24px 80px; }
.cleanup-empty { text-align: center; color: #8f959e; font-size: 13px; padding: 40px 0; }
.cleanup-player-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  margin-bottom: 6px; background: #fafafa; border: 1px solid #f0f0f0;
}
.cleanup-player-name { font-size: 13.5px; color: #1f2329; flex-shrink: 0; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.cleanup-player-id { font-size: 12px; color: #9ca3af; font-family: monospace; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.cleanup-trash-btn {
  width: 30px; height: 30px; flex-shrink: 0;
  border: none; background: #fef2f2; color: #dc2626;
  border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.cleanup-trash-btn:hover:not(:disabled) { background: #fee2e2; }
.cleanup-trash-btn:disabled { opacity: .5; cursor: not-allowed; }
.cleanup-trash-btn svg { width: 15px; height: 15px; }
.cleanup-ds-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  margin-bottom: 6px; background: #fafafa; border: 1px solid #f0f0f0;
}
.cleanup-ds-id { font-size: 13px; color: #1f2329; font-family: monospace; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.cleanup-ds-remove {
  width: 24px; height: 24px; flex-shrink: 0;
  border: none; background: none; color: #9ca3af;
  cursor: pointer; font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
}
.cleanup-ds-remove:hover { background: #f3f4f6; color: #dc2626; }
.cleanup-fab {
  position: absolute; right: 22px; bottom: 22px;
  width: 46px; height: 46px; border-radius: 50%;
  background: #3370ff; color: #fff; border: none;
  font-size: 24px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(51,112,255,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.cleanup-fab:hover { background: #2860e1; }
.cleanup-add-form {
  position: absolute; left: 24px; right: 24px; bottom: 78px;
  background: #fff; border: 1px solid #e5e6eb; border-radius: 10px;
  padding: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.1);
  display: none;
}
.cleanup-add-form.open { display: block; }
.cleanup-add-form input {
  width: 100%; height: 38px;
  border: 1px solid #d0d7de; border-radius: 8px;
  padding: 0 12px; font-size: 13px; outline: none; margin-bottom: 8px;
}
.cleanup-add-form input:focus { border-color: #3370ff; }
.cleanup-add-actions { display: flex; gap: 8px; justify-content: flex-end; }
.cleanup-add-actions button {
  height: 32px; padding: 0 14px; border-radius: 6px;
  font-size: 13px; cursor: pointer; border: none;
}
.cleanup-add-cancel { background: #f3f4f6; color: #646a73; }
.cleanup-add-confirm { background: #3370ff; color: #fff; }
.cleanup-add-confirm:disabled { opacity: .6; cursor: not-allowed; }
.cleanup-add-error { font-size: 12px; color: #dc2626; margin-top: -4px; margin-bottom: 8px; }

/* 杞绘彁绀?Toast */
.toast {
  position: fixed;
  bottom: 108px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(31,35,41,.82);
  color: #fff;
  padding: 8px 22px;
  border-radius: 20px;
  font-size: 13px;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}
.toast.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 鈹€鈹€ 鐧诲綍瑕嗙洊灞?鈹€鈹€ */
#loginOverlay {
  position: fixed;
  inset: 0;
  background: #f0f2f5;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-spinner-wrap .spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px 40px;
  width: min(380px, calc(100vw - 32px));
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  text-align: center;
}
.login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: #e8f0fe;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-logo svg { width: 34px; height: 34px; }
.login-title {
  font-size: 20px;
  font-weight: 700;
  color: #1f2329;
  margin-bottom: 8px;
}
.login-sub {
  font-size: 14px;
  color: #8f959e;
  margin-bottom: 32px;
  line-height: 1.6;
}
.btn-feishu-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  background: #3370ff;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.btn-feishu-login:hover:not(:disabled) { background: #2860e1; }
.btn-feishu-login:disabled { opacity: .6; cursor: not-allowed; }
.btn-feishu-login svg { width: 20px; height: 20px; flex-shrink: 0; }
.login-error {
  margin-top: 16px;
  font-size: 13px;
  color: #d83931;
  background: #fff1f0;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 10px 14px;
  text-align: left;
  line-height: 1.5;
}

/* 鈹€鈹€ 鐢ㄦ埛澶村儚缁勪欢 鈹€鈹€ */
#userWidget {
  position: fixed;
  top: 18px;
  right: 64px;
  z-index: 91;
}
.user-avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #e5e6eb;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: #e8f0fe;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, box-shadow .15s;
}
.user-avatar-btn:hover { border-color: #3370ff; box-shadow: 0 0 0 3px rgba(51,112,255,.15); }
.user-avatar-img { width: 100%; height: 100%; object-fit: cover; display: none; }
.user-avatar-fallback { font-size: 13px; font-weight: 700; color: #3370ff; line-height: 1; }
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  min-width: 188px;
  overflow: hidden;
}
.user-dropdown-info {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f0f1f3;
}
.user-dropdown-name  { font-size: 14px; font-weight: 600; color: #1f2329; }
.user-dropdown-email { font-size: 12px; color: #8f959e; margin-top: 2px; word-break: break-all; }
.user-dropdown-tenant {
  margin-top: 6px; font-size: 11px; color: #b0b7c3;
  font-family: 'SF Mono', 'Consolas', monospace;
  cursor: pointer; word-break: break-all;
}
.user-dropdown-tenant:hover { color: #3370ff; }
.btn-logout {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: #d83931;
  transition: background .15s;
}
.btn-logout:hover { background: #fff1f0; }

/* 鈹€鈹€ 寮€鍙戣€呬骇鍝侀〉 鈹€鈹€ */
.products-uid {
  font-size: 12px;
  color: #8f959e;
  flex-shrink: 0;
}
.products-tab-bar {
  background: #fafbfc;
  border-bottom: 1px solid #e5e6eb;
  display: flex;
  align-items: center;
  min-height: 40px;
  flex-shrink: 0;
  padding: 0 12px;
  gap: 2px;
}
.products-status {
  font-size: 13px;
  color: #d83931;
  padding: 6px 20px 0;
  min-height: 0;
  flex-shrink: 0;
}
.products-status:empty { padding: 0; }
.products-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e6eb;
}
.products-table th {
  background: #fafbfc;
  border-bottom: 1px solid #e5e6eb;
  padding: 9px 12px;
  text-align: left;
  font-weight: 600;
  color: #1f2329;
  white-space: nowrap;
}
.products-table td {
  padding: 7px 12px;
  border-bottom: 1px solid #f0f1f3;
  color: #1f2329;
  vertical-align: middle;
}
.products-table tr:last-child td { border-bottom: none; }
.products-table tr:hover td { background: #f8f9fb; }
.products-table td[contenteditable="true"] {
  outline: none;
  cursor: text;
}
.products-table td[contenteditable="true"]:focus {
  background: #f0f5ff;
  box-shadow: inset 0 0 0 2px #3370ff;
  border-radius: 4px;
}
.products-table td.cell-error {
  box-shadow: inset 0 0 0 2px #d83931;
  border-radius: 4px;
  background: #fff1f0;
}
.products-table td.cell-readonly {
  color: #8f959e;
  font-size: 12px;
  user-select: all;
}
.products-fill-handle {
  position: fixed;
  display: none;
  width: 8px; height: 8px;
  background: #3370ff;
  border: 1.5px solid #fff;
  border-radius: 1px;
  cursor: crosshair;
  z-index: 9999;
  box-sizing: border-box;
}
.products-table td.fill-highlight {
  background: rgba(51,112,255,0.08) !important;
  box-shadow: inset 0 0 0 2px #3370ff !important;
  border-radius: 4px;
}
/* ── 拖拽上传弹窗 ── */
.upload-modal {
  width: min(420px, calc(100vw - 32px));
}
.upload-modal h2 { font-size: 16px; font-weight: 600; margin-bottom: 18px; }
.upload-drop-zone {
  border: 2px dashed #c2c7cf;
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #f8f9fa;
  user-select: none;
}
.upload-drop-zone:hover,
.upload-drop-zone.drag-over {
  border-color: #3370ff;
  background: #eef2ff;
}
.upload-drop-zone.drag-over { border-style: solid; }
.upload-drop-icon {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 12px;
  color: #8f959e;
  pointer-events: none;
}
.upload-drop-zone.drag-over .upload-drop-icon { color: #3370ff; }
.upload-drop-text {
  font-size: 15px;
  font-weight: 500;
  color: #1f2329;
  margin-bottom: 6px;
  pointer-events: none;
}
.upload-drop-hint {
  font-size: 12px;
  color: #8f959e;
  pointer-events: none;
}
.upload-select-btn {
  margin-top: 18px;
  width: 100%;
  height: 38px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  color: #1f2329;
  cursor: pointer;
}
.upload-select-btn:hover { background: #f5f6f7; }
.upload-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 28px; height: 28px;
  border: none; background: none;
  font-size: 18px; color: #8f959e;
  cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.upload-modal-close:hover { background: #f3f4f6; color: #1f2329; }

.products-empty {
  text-align: center;
  color: #8f959e;
  padding: 40px 0;
  font-size: 14px;
}
