.gfgoai-polyglot-app {
  --gfg-bg: #e8eef6;
  --gfg-card: #f7fbff;
  --gfg-border: #d6e0eb;
  --gfg-text: #24364d;
  --gfg-muted: #6c7d91;
  --gfg-blue: #e9f0fb;
  --gfg-green: #edf5ef;
  --gfg-shadow: 0 12px 40px rgba(41, 63, 95, 0.10);
  color: var(--gfg-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", sans-serif;
}

.gfgoai-polyglot-app * { box-sizing: border-box; }
.gfgoai-polyglot-app button,
.gfgoai-polyglot-app select,
.gfgoai-polyglot-app textarea { font: inherit; }

.gfgoai-polyglot-app .gfg-shell {
  background: var(--gfg-bg);
  border: 1px solid #dbe3ee;
  border-radius: 30px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.gfgoai-polyglot-app .gfg-topbar,
.gfgoai-polyglot-app .gfg-main-card,
.gfgoai-polyglot-app .gfg-history-card {
  background: rgba(255,255,255,0.58);
  border: 1px solid var(--gfg-border);
  border-radius: 28px;
  box-shadow: var(--gfg-shadow);
}

.gfgoai-polyglot-app .gfg-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 24px 26px;
}

.gfgoai-polyglot-app .gfg-eyebrow {
  color: var(--gfg-muted);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.gfgoai-polyglot-app .gfg-branding h1 {
  margin: 0 0 8px;
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.gfgoai-polyglot-app .gfg-subtitle {
  color: #5c7089;
  font-size: 18px;
  font-weight: 700;
}

.gfgoai-polyglot-app .gfg-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.gfgoai-polyglot-app .gfg-ui-language,
.gfgoai-polyglot-app .gfg-language-select,
.gfgoai-polyglot-app .gfg-settings-card select {
  background: #fff;
  border: 1px solid #cfd9e5;
  border-radius: 999px;
  min-height: 48px;
  padding: 0 18px;
  color: var(--gfg-text);
  max-width: 100%;
}

.gfgoai-polyglot-app .gfg-btn,
.gfgoai-polyglot-app .gfg-icon-btn,
.gfgoai-polyglot-app .gfg-send-btn,
.gfgoai-polyglot-app .gfg-float-btn {
  border: 1px solid #cfd9e5;
  background: #fff;
  color: var(--gfg-text);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}

.gfgoai-polyglot-app .gfg-btn:hover,
.gfgoai-polyglot-app .gfg-icon-btn:hover,
.gfgoai-polyglot-app .gfg-send-btn:hover,
.gfgoai-polyglot-app .gfg-float-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(31, 54, 85, 0.10);
}

.gfgoai-polyglot-app .gfg-btn {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
}

.gfgoai-polyglot-app .gfg-btn-ghost,
.gfgoai-polyglot-app .gfg-icon-btn { background: rgba(255,255,255,0.85); }

.gfgoai-polyglot-app .gfg-icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 22px;
}

.gfgoai-polyglot-app .gfg-user-pill {
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid #cfd9e5;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  font-weight: 700;
}

.gfgoai-polyglot-app .gfg-main-card {
  margin-top: 18px;
  padding: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.gfgoai-polyglot-app .gfg-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(270px, 1fr));
  gap: 20px;
  min-width: 620px;
}

.gfgoai-polyglot-app .gfg-panel {
  border: 1px solid #d8e2ed;
  border-radius: 26px;
  padding: 18px;
  min-width: 0;
}

.gfgoai-polyglot-app .gfg-panel-i { background: var(--gfg-blue); }
.gfgoai-polyglot-app .gfg-panel-you { background: var(--gfg-green); }

.gfgoai-polyglot-app .gfg-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.gfgoai-polyglot-app .gfg-side-code {
  color: #5e7188;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.gfgoai-polyglot-app .gfg-side-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
}

.gfgoai-polyglot-app .gfg-language-wrap {
  width: 210px;
  max-width: 100%;
}

.gfgoai-polyglot-app .gfg-language-wrap label,
.gfgoai-polyglot-app .gfg-result-label,
.gfgoai-polyglot-app .gfg-history-sub,
.gfgoai-polyglot-app .gfg-settings-card label span {
  display: block;
  color: #63778f;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}

.gfgoai-polyglot-app .gfg-textarea-wrap {
  position: relative;
}

.gfgoai-polyglot-app .gfg-input {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  border: 2px solid #c8d7f0;
  border-radius: 28px;
  background: rgba(255,255,255,0.84);
  color: #314152;
  font-size: 28px;
  line-height: 1.45;
  padding: 24px 84px 24px 24px;
  outline: none;
}

.gfgoai-polyglot-app .gfg-input:focus {
  border-color: #90aef7;
  box-shadow: 0 0 0 4px rgba(144, 174, 247, 0.12);
}

.gfgoai-polyglot-app .gfg-send-btn {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 700;
}

.gfgoai-polyglot-app .gfg-result-box {
  margin-top: 14px;
  border: 1px solid #d4dfe9;
  border-radius: 20px;
  background: rgba(255,255,255,0.72);
  padding: 14px 16px;
}

.gfgoai-polyglot-app .gfg-result-box-strong .gfg-translated,
.gfgoai-polyglot-app .gfg-result-box-strong .gfg-original {
  font-size: 28px;
  line-height: 1.35;
}

.gfgoai-polyglot-app .gfg-original,
.gfgoai-polyglot-app .gfg-translated {
  white-space: pre-wrap;
  word-break: break-word;
}

.gfgoai-polyglot-app .gfg-history-card {
  margin-top: 18px;
  padding: 20px;
  margin-bottom: 110px;
}

.gfgoai-polyglot-app .gfg-history-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 12px;
}

.gfgoai-polyglot-app .gfg-history-head h3 {
  margin: 0;
  font-size: 28px;
}

.gfgoai-polyglot-app .gfg-history-list {
  min-height: 170px;
  border: 1px solid #dbe3ec;
  border-radius: 24px;
  background: rgba(250, 252, 255, 0.8);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.gfgoai-polyglot-app .gfg-history-list.gfg-empty {
  place-items: center;
  color: var(--gfg-muted);
  font-weight: 700;
}

.gfgoai-polyglot-app .gfg-history-item {
  border: 1px solid #dde5ee;
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
}

.gfgoai-polyglot-app .gfg-history-item.gfg-history-pending {
  border-color: #cddaf0;
  background: #f7fbff;
}

.gfgoai-polyglot-app .gfg-history-item.gfg-history-error {
  border-color: #e2c4c4;
  background: #fff7f7;
}

.gfgoai-polyglot-app .gfg-history-item .gfg-history-role {
  display: inline-block;
  min-width: 52px;
  padding: 5px 10px;
  margin-right: 10px;
  border-radius: 999px;
  background: #edf3ff;
  font-size: 12px;
  font-weight: 800;
}

.gfgoai-polyglot-app .gfg-history-item .gfg-history-line {
  display: block;
  margin-top: 8px;
  color: #41556c;
}

.gfgoai-polyglot-app .gfg-settings-panel {
  position: fixed;
  inset: 0;
  background: rgba(26, 38, 54, 0.38);
  z-index: 99990;
  padding: 24px;
}

.gfgoai-polyglot-app .gfg-settings-card {
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(20, 34, 52, 0.22);
}

.gfgoai-polyglot-app .gfg-settings-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.gfgoai-polyglot-app .gfg-settings-head h3 {
  margin: 0;
  font-size: 30px;
}

.gfgoai-polyglot-app .gfg-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.gfgoai-polyglot-app .gfg-settings-card label {
  display: block;
}

.gfgoai-polyglot-app .gfg-settings-card select {
  width: 100%;
}

.gfgoai-polyglot-app .gfg-checks {
  margin-top: 16px;
  font-weight: 700;
}

.gfgoai-polyglot-app .gfg-status-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e4ebf2;
}

.gfgoai-polyglot-app .gfg-status-item {
  color: #52657b;
}

.gfgoai-polyglot-app .gfg-floating-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px 18px;
  background: rgba(255,255,255,0.96);
  border: 1px solid #d5dfe9;
  border-radius: 999px;
  box-shadow: 0 14px 36px rgba(34, 54, 78, 0.18);
  z-index: 99991;
  user-select: none;
}

.gfgoai-polyglot-app .gfg-floating-bar.is-dragging {
  box-shadow: 0 22px 44px rgba(34, 54, 78, 0.24);
}

.gfgoai-polyglot-app .gfg-float-btn {
  min-width: 146px;
  height: 68px;
  border-radius: 999px;
  font-size: 26px;
  font-weight: 800;
  background: #fff;
  touch-action: manipulation;
}

.gfgoai-polyglot-app .gfg-float-center {
  min-width: 70px;
  width: 70px;
  font-size: 40px;
  line-height: 1;
  cursor: grab;
  touch-action: none;
}

.gfgoai-polyglot-app .gfg-float-center:active {
  cursor: grabbing;
}

.gfgoai-polyglot-app .gfg-float-btn.is-recording,
.gfgoai-polyglot-app .gfg-send-btn.is-busy {
  background: #193a63;
  color: #fff;
  border-color: #193a63;
}

.gfgoai-polyglot-app .gfg-api-missing {
  color: #a33333;
}

@media (max-width: 980px) {
  .gfgoai-polyglot-app .gfg-branding h1 { font-size: 34px; }
  .gfgoai-polyglot-app .gfg-topbar { flex-direction: column; }
  .gfgoai-polyglot-app .gfg-toolbar { justify-content: flex-start; }
  .gfgoai-polyglot-app .gfg-settings-grid { grid-template-columns: 1fr; }
  .gfgoai-polyglot-app .gfg-input { min-height: 250px; font-size: 22px; }
  .gfgoai-polyglot-app .gfg-float-btn { min-width: 110px; height: 58px; font-size: 22px; }
  .gfgoai-polyglot-app .gfg-float-center { min-width: 60px; width: 60px; font-size: 34px; }
}

@media (max-width: 640px) {
  .gfgoai-polyglot-app .gfg-shell { padding: 14px; border-radius: 22px; }
  .gfgoai-polyglot-app .gfg-topbar,
  .gfgoai-polyglot-app .gfg-main-card,
  .gfgoai-polyglot-app .gfg-history-card { border-radius: 22px; }
  .gfgoai-polyglot-app .gfg-topbar { padding: 18px; }
  .gfgoai-polyglot-app .gfg-branding h1 { font-size: 28px; }
  .gfgoai-polyglot-app .gfg-subtitle { font-size: 16px; }
  .gfgoai-polyglot-app .gfg-toolbar { gap: 10px; }
  .gfgoai-polyglot-app .gfg-btn,
  .gfgoai-polyglot-app .gfg-ui-language,
  .gfgoai-polyglot-app .gfg-user-pill,
  .gfgoai-polyglot-app .gfg-icon-btn { min-height: 44px; }
  .gfgoai-polyglot-app .gfg-main-card,
  .gfgoai-polyglot-app .gfg-history-card { padding: 14px; }
  .gfgoai-polyglot-app .gfg-panels { gap: 12px; min-width: 560px; }
  .gfgoai-polyglot-app .gfg-panel { padding: 12px; border-radius: 20px; }
  .gfgoai-polyglot-app .gfg-panel-head { flex-direction: column; }
  .gfgoai-polyglot-app .gfg-side-code { font-size: 14px; }
  .gfgoai-polyglot-app .gfg-side-title { font-size: 22px; }
  .gfgoai-polyglot-app .gfg-language-wrap { width: 100%; }
  .gfgoai-polyglot-app .gfg-input { min-height: 190px; font-size: 18px; padding: 18px 68px 18px 16px; border-radius: 22px; }
  .gfgoai-polyglot-app .gfg-send-btn { width: 48px; height: 48px; right: 10px; bottom: 10px; font-size: 22px; }
  .gfgoai-polyglot-app .gfg-result-box-strong .gfg-translated,
  .gfgoai-polyglot-app .gfg-result-box-strong .gfg-original { font-size: 18px; }
  .gfgoai-polyglot-app .gfg-history-head { flex-direction: column; align-items: flex-start; }
  .gfgoai-polyglot-app .gfg-history-head h3 { font-size: 24px; }
  .gfgoai-polyglot-app .gfg-floating-bar { gap: 10px; padding: 10px 12px; bottom: 14px; }
  .gfgoai-polyglot-app .gfg-float-btn { min-width: 88px; height: 52px; font-size: 20px; }
  .gfgoai-polyglot-app .gfg-float-center { min-width: 54px; width: 54px; font-size: 30px; }
  .gfgoai-polyglot-app .gfg-history-card { margin-bottom: 90px; }
}
